@redocly/openapi-docs 3.0.0-alpha.75 → 3.0.0-alpha.76

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 (94) hide show
  1. package/dist/console.redocly-openapi-docs.min.js +163 -180
  2. package/dist/oauth2-redirect.js +1 -1
  3. package/dist/redocly-openapi-docs.min.js +1025 -972
  4. package/lib/components/OperationParameters/OperationParameters.js +1 -1
  5. package/lib/components/OperationParameters/types.d.ts +0 -1
  6. package/lib/components/OperationParameters/utils.d.ts +2 -2
  7. package/lib/components/common/CheckboxList.d.ts +4 -3
  8. package/lib/components/common/CheckboxList.js +1 -1
  9. package/lib/components/common/FileUpload/FileUpload.d.ts +1 -1
  10. package/lib/components/common/FileUpload/FileUpload.js +1 -1
  11. package/lib/components/common/TextField.d.ts +12 -5
  12. package/lib/components/common/TextField.js +2 -2
  13. package/lib/components/rightPanel/ActionPanel.d.ts +3 -4
  14. package/lib/components/rightPanel/ActionPanel.js +1 -1
  15. package/lib/components/rightPanel/AuthPanel/AuthPanel.d.ts +1 -1
  16. package/lib/components/rightPanel/AuthPanel/AuthPanel.js +1 -1
  17. package/lib/components/rightPanel/AuthPanel/types.d.ts +0 -3
  18. package/lib/components/rightPanel/CodemirrorInput/CodemirrorInput.d.ts +3 -4
  19. package/lib/components/rightPanel/CodemirrorInput/CodemirrorInput.js +1 -1
  20. package/lib/components/rightPanel/CodemirrorInput/helpers.d.ts +6 -1
  21. package/lib/components/rightPanel/CodemirrorInput/helpers.js +1 -1
  22. package/lib/components/rightPanel/CodemirrorInput/styled.d.ts +2 -1
  23. package/lib/components/rightPanel/CodemirrorInput/styled.js +44 -45
  24. package/lib/components/rightPanel/CodemirrorInput/types.d.ts +3 -14
  25. package/lib/components/rightPanel/Console/Console.js +1 -1
  26. package/lib/components/rightPanel/Console/Request.js +1 -1
  27. package/lib/components/rightPanel/Console/types.d.ts +1 -6
  28. package/lib/components/rightPanel/OAuth2Flow/OAuth2Flow.d.ts +1 -1
  29. package/lib/components/rightPanel/OAuth2Flow/OAuth2Flow.js +1 -1
  30. package/lib/components/rightPanel/OAuth2Flow/types.d.ts +0 -3
  31. package/lib/components/rightPanel/OAuth2TokenInput.d.ts +2 -8
  32. package/lib/components/rightPanel/OAuth2TokenInput.js +1 -1
  33. package/lib/components/rightPanel/OpenIDConnect.d.ts +0 -3
  34. package/lib/components/rightPanel/OpenIDConnect.js +1 -1
  35. package/lib/components/rightPanel/ParameterDropdown.d.ts +3 -2
  36. package/lib/components/rightPanel/ParameterDropdown.js +1 -1
  37. package/lib/components/rightPanel/RequestBody/Body.js +1 -1
  38. package/lib/components/rightPanel/RequestBody/RequestBody.js +1 -1
  39. package/lib/components/rightPanel/RequestBody/types.d.ts +1 -3
  40. package/lib/components/rightPanel/RequestBodyForm.d.ts +0 -2
  41. package/lib/components/rightPanel/RequestBodyForm.js +1 -1
  42. package/lib/components/rightPanel/Scope.js +1 -1
  43. package/lib/components/rightPanel/ServersDropdown/ServersDropdown.js +1 -1
  44. package/lib/components/rightPanel/utils.js +1 -1
  45. package/lib/jotai/app.js +1 -1
  46. package/lib/testProviders.d.ts +4 -1
  47. package/lib/testProviders.js +1 -1
  48. package/lib/utils/saveTextBeforeHeading.js +1 -1
  49. package/lib-esm/components/OperationParameters/OperationParameters.js +1 -1
  50. package/lib-esm/components/OperationParameters/types.d.ts +0 -1
  51. package/lib-esm/components/OperationParameters/utils.d.ts +2 -2
  52. package/lib-esm/components/common/CheckboxList.d.ts +4 -3
  53. package/lib-esm/components/common/CheckboxList.js +1 -1
  54. package/lib-esm/components/common/FileUpload/FileUpload.d.ts +1 -1
  55. package/lib-esm/components/common/FileUpload/FileUpload.js +1 -1
  56. package/lib-esm/components/common/TextField.d.ts +12 -5
  57. package/lib-esm/components/common/TextField.js +2 -2
  58. package/lib-esm/components/rightPanel/ActionPanel.d.ts +3 -4
  59. package/lib-esm/components/rightPanel/ActionPanel.js +1 -1
  60. package/lib-esm/components/rightPanel/AuthPanel/AuthPanel.d.ts +1 -1
  61. package/lib-esm/components/rightPanel/AuthPanel/AuthPanel.js +1 -1
  62. package/lib-esm/components/rightPanel/AuthPanel/types.d.ts +0 -3
  63. package/lib-esm/components/rightPanel/CodemirrorInput/CodemirrorInput.d.ts +3 -4
  64. package/lib-esm/components/rightPanel/CodemirrorInput/CodemirrorInput.js +1 -1
  65. package/lib-esm/components/rightPanel/CodemirrorInput/helpers.d.ts +6 -1
  66. package/lib-esm/components/rightPanel/CodemirrorInput/helpers.js +1 -1
  67. package/lib-esm/components/rightPanel/CodemirrorInput/styled.d.ts +2 -1
  68. package/lib-esm/components/rightPanel/CodemirrorInput/styled.js +44 -45
  69. package/lib-esm/components/rightPanel/CodemirrorInput/types.d.ts +3 -14
  70. package/lib-esm/components/rightPanel/Console/Console.js +1 -1
  71. package/lib-esm/components/rightPanel/Console/Request.js +1 -1
  72. package/lib-esm/components/rightPanel/Console/types.d.ts +1 -6
  73. package/lib-esm/components/rightPanel/OAuth2Flow/OAuth2Flow.d.ts +1 -1
  74. package/lib-esm/components/rightPanel/OAuth2Flow/OAuth2Flow.js +1 -1
  75. package/lib-esm/components/rightPanel/OAuth2Flow/types.d.ts +0 -3
  76. package/lib-esm/components/rightPanel/OAuth2TokenInput.d.ts +2 -8
  77. package/lib-esm/components/rightPanel/OAuth2TokenInput.js +1 -1
  78. package/lib-esm/components/rightPanel/OpenIDConnect.d.ts +0 -3
  79. package/lib-esm/components/rightPanel/OpenIDConnect.js +1 -1
  80. package/lib-esm/components/rightPanel/ParameterDropdown.d.ts +3 -2
  81. package/lib-esm/components/rightPanel/ParameterDropdown.js +1 -1
  82. package/lib-esm/components/rightPanel/RequestBody/Body.js +1 -1
  83. package/lib-esm/components/rightPanel/RequestBody/RequestBody.js +1 -1
  84. package/lib-esm/components/rightPanel/RequestBody/types.d.ts +1 -3
  85. package/lib-esm/components/rightPanel/RequestBodyForm.d.ts +0 -2
  86. package/lib-esm/components/rightPanel/RequestBodyForm.js +1 -1
  87. package/lib-esm/components/rightPanel/Scope.js +1 -1
  88. package/lib-esm/components/rightPanel/ServersDropdown/ServersDropdown.js +1 -1
  89. package/lib-esm/components/rightPanel/utils.js +1 -1
  90. package/lib-esm/jotai/app.js +1 -1
  91. package/lib-esm/testProviders.d.ts +4 -1
  92. package/lib-esm/testProviders.js +1 -1
  93. package/lib-esm/utils/saveTextBeforeHeading.js +1 -1
  94. package/package.json +9 -6
@@ -2,113 +2,79 @@
2
2
  * Redocly OpenAPI Docs
3
3
  * (c) Copyright 2018 Redocly LLC, all rights reserved.
4
4
  * -------------------------------------------------------------
5
- * Version: "3.0.0-alpha.75"
6
- */(this.webpackChunkRedoclyOpenAPIDocs=this.webpackChunkRedoclyOpenAPIDocs||[]).push([[290],{29641:(x,N,f)=>{(function(v){v(f(46944))})(function(v){var C={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},E=v.Pos;v.defineOption("autoCloseBrackets",!1,function(M,S,I){I&&I!=v.Init&&(M.removeKeyMap(D),M.state.closeBrackets=null),S&&(R(P(S,"pairs")),M.state.closeBrackets=S,M.addKeyMap(D))});function P(M,S){return S=="pairs"&&typeof M=="string"?M:typeof M=="object"&&M[S]!=null?M[S]:C[S]}var D={Backspace:Z,Enter:de};function R(M){for(var S=0;S<M.length;S++){var I=M.charAt(S),F="'"+I+"'";D[F]||(D[F]=V(I))}}R(C.pairs+"`");function V(M){return function(S){return $(S,M)}}function Q(M){var S=M.state.closeBrackets;if(!S||S.override)return S;var I=M.getModeAt(M.getCursor());return I.closeBrackets||S}function Z(M){var S=Q(M);if(!S||M.getOption("disableInput"))return v.Pass;for(var I=P(S,"pairs"),F=M.listSelections(),K=0;K<F.length;K++){if(!F[K].empty())return v.Pass;var te=k(M,F[K].head);if(!te||I.indexOf(te)%2!=0)return v.Pass}for(var K=F.length-1;K>=0;K--){var j=F[K].head;M.replaceRange("",E(j.line,j.ch-1),E(j.line,j.ch+1),"+delete")}}function de(M){var S=Q(M),I=S&&P(S,"explode");if(!I||M.getOption("disableInput"))return v.Pass;for(var F=M.listSelections(),K=0;K<F.length;K++){if(!F[K].empty())return v.Pass;var te=k(M,F[K].head);if(!te||I.indexOf(te)%2!=0)return v.Pass}M.operation(function(){var j=M.lineSeparator()||`
7
- `;M.replaceSelection(j+j,null),re(M,-1),F=M.listSelections();for(var ie=0;ie<F.length;ie++){var H=F[ie].head.line;M.indentLine(H,null,!0),M.indentLine(H+1,null,!0)}})}function re(M,S){for(var I=[],F=M.listSelections(),K=0,te=0;te<F.length;te++){var j=F[te];j.head==M.getCursor()&&(K=te);var ie=j.head.ch||S>0?{line:j.head.line,ch:j.head.ch+S}:{line:j.head.line-1};I.push({anchor:ie,head:ie})}M.setSelections(I,K)}function se(M){var S=v.cmpPos(M.anchor,M.head)>0;return{anchor:new E(M.anchor.line,M.anchor.ch+(S?-1:1)),head:new E(M.head.line,M.head.ch+(S?1:-1))}}function $(M,S){var I=Q(M);if(!I||M.getOption("disableInput"))return v.Pass;var F=P(I,"pairs"),K=F.indexOf(S);if(K==-1)return v.Pass;for(var te=P(I,"closeBefore"),j=P(I,"triples"),ie=F.charAt(K+1)==S,H=M.listSelections(),Y=K%2==0,ce,ge=0;ge<H.length;ge++){var G=H[ge],ve=G.head,ee,He=M.getRange(ve,E(ve.line,ve.ch+1));if(Y&&!G.empty())ee="surround";else if((ie||!Y)&&He==S)ie&&J(M,ve)?ee="both":j.indexOf(S)>=0&&M.getRange(ve,E(ve.line,ve.ch+3))==S+S+S?ee="skipThree":ee="skip";else if(ie&&ve.ch>1&&j.indexOf(S)>=0&&M.getRange(E(ve.line,ve.ch-2),ve)==S+S){if(ve.ch>2&&/\bstring/.test(M.getTokenTypeAt(E(ve.line,ve.ch-2))))return v.Pass;ee="addFour"}else if(ie){var _e=ve.ch==0?" ":M.getRange(E(ve.line,ve.ch-1),ve);if(!v.isWordChar(He)&&_e!=S&&!v.isWordChar(_e))ee="both";else return v.Pass}else if(Y&&(He.length===0||/\s/.test(He)||te.indexOf(He)>-1))ee="both";else return v.Pass;if(!ce)ce=ee;else if(ce!=ee)return v.Pass}var ze=K%2?F.charAt(K-1):S,dt=K%2?S:F.charAt(K+1);M.operation(function(){if(ce=="skip")re(M,1);else if(ce=="skipThree")re(M,3);else if(ce=="surround"){for(var ft=M.getSelections(),at=0;at<ft.length;at++)ft[at]=ze+ft[at]+dt;M.replaceSelections(ft,"around"),ft=M.listSelections().slice();for(var at=0;at<ft.length;at++)ft[at]=se(ft[at]);M.setSelections(ft)}else ce=="both"?(M.replaceSelection(ze+dt,null),M.triggerElectric(ze+dt),re(M,-1)):ce=="addFour"&&(M.replaceSelection(ze+ze+ze+ze,"before"),re(M,1))})}function k(M,S){var I=M.getRange(E(S.line,S.ch-1),E(S.line,S.ch+1));return I.length==2?I:null}function J(M,S){var I=M.getTokenAt(E(S.line,S.ch+1));return/\bstring/.test(I.type)&&I.start==S.ch&&(S.ch==0||!/\bstring/.test(M.getTokenTypeAt(S)))}})},82518:(x,N,f)=>{(function(v){v(f(46944))})(function(v){var C=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),E=v.Pos,P={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function D(re){return re&&re.bracketRegex||/[(){}[\]]/}function R(re,se,$){var k=re.getLineHandle(se.line),J=se.ch-1,M=$&&$.afterCursor;M==null&&(M=/(^| )cm-fat-cursor($| )/.test(re.getWrapperElement().className));var S=D($),I=!M&&J>=0&&S.test(k.text.charAt(J))&&P[k.text.charAt(J)]||S.test(k.text.charAt(J+1))&&P[k.text.charAt(++J)];if(!I)return null;var F=I.charAt(1)==">"?1:-1;if($&&$.strict&&F>0!=(J==se.ch))return null;var K=re.getTokenTypeAt(E(se.line,J+1)),te=V(re,E(se.line,J+(F>0?1:0)),F,K,$);return te==null?null:{from:E(se.line,J),to:te&&te.pos,match:te&&te.ch==I.charAt(0),forward:F>0}}function V(re,se,$,k,J){for(var M=J&&J.maxScanLineLength||1e4,S=J&&J.maxScanLines||1e3,I=[],F=D(J),K=$>0?Math.min(se.line+S,re.lastLine()+1):Math.max(re.firstLine()-1,se.line-S),te=se.line;te!=K;te+=$){var j=re.getLine(te);if(j){var ie=$>0?0:j.length-1,H=$>0?j.length:-1;if(!(j.length>M))for(te==se.line&&(ie=se.ch-($<0?1:0));ie!=H;ie+=$){var Y=j.charAt(ie);if(F.test(Y)&&(k===void 0||(re.getTokenTypeAt(E(te,ie+1))||"")==(k||""))){var ce=P[Y];if(ce&&ce.charAt(1)==">"==$>0)I.push(Y);else if(I.length)I.pop();else return{pos:E(te,ie),ch:Y}}}}}return te-$==($>0?re.lastLine():re.firstLine())?!1:null}function Q(re,se,$){for(var k=re.state.matchBrackets.maxHighlightLineLength||1e3,J=$&&$.highlightNonMatching,M=[],S=re.listSelections(),I=0;I<S.length;I++){var F=S[I].empty()&&R(re,S[I].head,$);if(F&&(F.match||J!==!1)&&re.getLine(F.from.line).length<=k){var K=F.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";M.push(re.markText(F.from,E(F.from.line,F.from.ch+1),{className:K})),F.to&&re.getLine(F.to.line).length<=k&&M.push(re.markText(F.to,E(F.to.line,F.to.ch+1),{className:K}))}}if(M.length){C&&re.state.focused&&re.focus();var te=function(){re.operation(function(){for(var j=0;j<M.length;j++)M[j].clear()})};if(se)setTimeout(te,800);else return te}}function Z(re){re.operation(function(){re.state.matchBrackets.currentlyHighlighted&&(re.state.matchBrackets.currentlyHighlighted(),re.state.matchBrackets.currentlyHighlighted=null),re.state.matchBrackets.currentlyHighlighted=Q(re,!1,re.state.matchBrackets)})}function de(re){re.state.matchBrackets&&re.state.matchBrackets.currentlyHighlighted&&(re.state.matchBrackets.currentlyHighlighted(),re.state.matchBrackets.currentlyHighlighted=null)}v.defineOption("matchBrackets",!1,function(re,se,$){$&&$!=v.Init&&(re.off("cursorActivity",Z),re.off("focus",Z),re.off("blur",de),de(re)),se&&(re.state.matchBrackets=typeof se=="object"?se:{},re.on("cursorActivity",Z),re.on("focus",Z),re.on("blur",de))}),v.defineExtension("matchBrackets",function(){Q(this,!0)}),v.defineExtension("findMatchingBracket",function(re,se,$){return($||typeof se=="boolean")&&($?($.strict=se,se=$):se=se?{strict:!0}:null),R(this,re,se)}),v.defineExtension("scanForBracket",function(re,se,$,k){return V(this,re,se,$,k)})})},77436:(x,N,f)=>{(function(v){v(f(46944))})(function(v){"use strict";var C="CodeMirror-hint",E="CodeMirror-hint-active";v.showHint=function(M,S,I){if(!S)return M.showHint(I);I&&I.async&&(S.async=!0);var F={hint:S};if(I)for(var K in I)F[K]=I[K];return M.showHint(F)},v.defineExtension("showHint",function(M){M=V(this,this.getCursor("start"),M);var S=this.listSelections();if(!(S.length>1)){if(this.somethingSelected()){if(!M.hint.supportsSelection)return;for(var I=0;I<S.length;I++)if(S[I].head.line!=S[I].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var F=this.state.completionActive=new P(this,M);F.options.hint&&(v.signal(this,"startCompletion",this),F.update(!0))}}),v.defineExtension("closeHint",function(){this.state.completionActive&&this.state.completionActive.close()});function P(M,S){if(this.cm=M,this.options=S,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var I=this;M.on("cursorActivity",this.activityFunc=function(){I.cursorActivity()})}}var D=window.requestAnimationFrame||function(M){return setTimeout(M,1e3/60)},R=window.cancelAnimationFrame||clearTimeout;P.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&v.signal(this.data,"close"),this.widget&&this.widget.close(),v.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(M,S){var I=M.list[S],F=this;this.cm.operation(function(){I.hint?I.hint(F.cm,M,I):F.cm.replaceRange(Q(I),I.from||M.from,I.to||M.to,"complete"),v.signal(M,"pick",I),F.cm.scrollIntoView()}),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(R(this.debounce),this.debounce=0);var M=this.startPos;this.data&&(M=this.data.from);var S=this.cm.getCursor(),I=this.cm.getLine(S.line);if(S.line!=this.startPos.line||I.length-S.ch!=this.startLen-this.startPos.ch||S.ch<M.ch||this.cm.somethingSelected()||!S.ch||this.options.closeCharacters.test(I.charAt(S.ch-1)))this.close();else{var F=this;this.debounce=D(function(){F.update()}),this.widget&&this.widget.disable()}},update:function(M){if(this.tick!=null){var S=this,I=++this.tick;$(this.options.hint,this.cm,this.options,function(F){S.tick==I&&S.finishUpdate(F,M)})}},finishUpdate:function(M,S){this.data&&v.signal(this.data,"update");var I=this.widget&&this.widget.picked||S&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=M,M&&M.list.length&&(I&&M.list.length==1?this.pick(M,0):(this.widget=new re(this,M),v.signal(M,"shown")))}};function V(M,S,I){var F=M.options.hintOptions,K={};for(var te in J)K[te]=J[te];if(F)for(var te in F)F[te]!==void 0&&(K[te]=F[te]);if(I)for(var te in I)I[te]!==void 0&&(K[te]=I[te]);return K.hint.resolve&&(K.hint=K.hint.resolve(M,S)),K}function Q(M){return typeof M=="string"?M:M.text}function Z(M,S){var I={Up:function(){S.moveFocus(-1)},Down:function(){S.moveFocus(1)},PageUp:function(){S.moveFocus(-S.menuSize()+1,!0)},PageDown:function(){S.moveFocus(S.menuSize()-1,!0)},Home:function(){S.setFocus(0)},End:function(){S.setFocus(S.length-1)},Enter:S.pick,Tab:S.pick,Esc:S.close},F=/Mac/.test(navigator.platform);F&&(I["Ctrl-P"]=function(){S.moveFocus(-1)},I["Ctrl-N"]=function(){S.moveFocus(1)});var K=M.options.customKeys,te=K?{}:I;function j(Y,ce){var ge;typeof ce!="string"?ge=function(G){return ce(G,S)}:I.hasOwnProperty(ce)?ge=I[ce]:ge=ce,te[Y]=ge}if(K)for(var ie in K)K.hasOwnProperty(ie)&&j(ie,K[ie]);var H=M.options.extraKeys;if(H)for(var ie in H)H.hasOwnProperty(ie)&&j(ie,H[ie]);return te}function de(M,S){for(;S&&S!=M;){if(S.nodeName.toUpperCase()==="LI"&&S.parentNode==M)return S;S=S.parentNode}}function re(M,S){this.id="cm-complete-"+Math.floor(Math.random(1e6)),this.completion=M,this.data=S,this.picked=!1;var I=this,F=M.cm,K=F.getInputField().ownerDocument,te=K.defaultView||K.parentWindow,j=this.hints=K.createElement("ul");j.setAttribute("role","listbox"),j.setAttribute("aria-expanded","true"),j.id=this.id;var ie=M.cm.options.theme;j.className="CodeMirror-hints "+ie,this.selectedHint=S.selectedHint||0;for(var H=S.list,Y=0;Y<H.length;++Y){var ce=j.appendChild(K.createElement("li")),ge=H[Y],G=C+(Y!=this.selectedHint?"":" "+E);ge.className!=null&&(G=ge.className+" "+G),ce.className=G,Y==this.selectedHint&&ce.setAttribute("aria-selected","true"),ce.id=this.id+"-"+Y,ce.setAttribute("role","option"),ge.render?ge.render(ce,S,ge):ce.appendChild(K.createTextNode(ge.displayText||Q(ge))),ce.hintId=Y}var ve=M.options.container||K.body,ee=F.cursorCoords(M.options.alignWithWord?S.from:null),He=ee.left,_e=ee.bottom,ze=!0,dt=0,ft=0;if(ve!==K.body){var at=["absolute","relative","fixed"].indexOf(te.getComputedStyle(ve).position)!==-1,Gt=at?ve:ve.offsetParent,ht=Gt.getBoundingClientRect(),Ot=K.body.getBoundingClientRect();dt=ht.left-Ot.left-Gt.scrollLeft,ft=ht.top-Ot.top-Gt.scrollTop}j.style.left=He-dt+"px",j.style.top=_e-ft+"px";var nt=te.innerWidth||Math.max(K.body.offsetWidth,K.documentElement.offsetWidth),Ue=te.innerHeight||Math.max(K.body.offsetHeight,K.documentElement.offsetHeight);ve.appendChild(j),F.getInputField().setAttribute("aria-autocomplete","list"),F.getInputField().setAttribute("aria-owns",this.id),F.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);var Fe=M.options.moveOnOverlap?j.getBoundingClientRect():new DOMRect,Re=M.options.paddingForScrollbar?j.scrollHeight>j.clientHeight+1:!1,it;setTimeout(function(){it=F.getScrollInfo()});var Dt=Fe.bottom-Ue;if(Dt>0){var qe=Fe.bottom-Fe.top,St=Fe.top-(ee.bottom-ee.top)-2;Ue-Fe.top<St?(qe>St&&(j.style.height=(qe=St)+"px"),j.style.top=(_e=ee.top-qe)+ft+"px",ze=!1):j.style.height=Ue-Fe.top-2+"px"}var Kt=Fe.right-nt;if(Re&&(Kt+=F.display.nativeBarWidth),Kt>0&&(Fe.right-Fe.left>nt&&(j.style.width=nt-5+"px",Kt-=Fe.right-Fe.left-nt),j.style.left=(He=Math.max(ee.left-Kt-dt,0))+"px"),Re)for(var Jt=j.firstChild;Jt;Jt=Jt.nextSibling)Jt.style.paddingRight=F.display.nativeBarWidth+"px";if(F.addKeyMap(this.keyMap=Z(M,{moveFocus:function(xt,Lt){I.changeActive(I.selectedHint+xt,Lt)},setFocus:function(xt){I.changeActive(xt)},menuSize:function(){return I.screenAmount()},length:H.length,close:function(){M.close()},pick:function(){I.pick()},data:S})),M.options.closeOnUnfocus){var pr;F.on("blur",this.onBlur=function(){pr=setTimeout(function(){M.close()},100)}),F.on("focus",this.onFocus=function(){clearTimeout(pr)})}F.on("scroll",this.onScroll=function(){var xt=F.getScrollInfo(),Lt=F.getWrapperElement().getBoundingClientRect();it||(it=F.getScrollInfo());var Or=_e+it.top-xt.top,Ft=Or-(te.pageYOffset||(K.documentElement||K.body).scrollTop);if(ze||(Ft+=j.offsetHeight),Ft<=Lt.top||Ft>=Lt.bottom)return M.close();j.style.top=Or+"px",j.style.left=He+it.left-xt.left+"px"}),v.on(j,"dblclick",function(xt){var Lt=de(j,xt.target||xt.srcElement);Lt&&Lt.hintId!=null&&(I.changeActive(Lt.hintId),I.pick())}),v.on(j,"click",function(xt){var Lt=de(j,xt.target||xt.srcElement);Lt&&Lt.hintId!=null&&(I.changeActive(Lt.hintId),M.options.completeOnSingleClick&&I.pick())}),v.on(j,"mousedown",function(){setTimeout(function(){F.focus()},20)});var Je=this.getSelectedHintRange();return(Je.from!==0||Je.to!==0)&&this.scrollToActive(),v.signal(S,"select",H[this.selectedHint],j.childNodes[this.selectedHint]),!0}re.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var M=this.completion.cm.getInputField();M.removeAttribute("aria-activedescendant"),M.removeAttribute("aria-owns");var S=this.completion.cm;this.completion.options.closeOnUnfocus&&(S.off("blur",this.onBlur),S.off("focus",this.onFocus)),S.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var M=this;this.keyMap={Enter:function(){M.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(M,S){if(M>=this.data.list.length?M=S?this.data.list.length-1:0:M<0&&(M=S?0:this.data.list.length-1),this.selectedHint!=M){var I=this.hints.childNodes[this.selectedHint];I&&(I.className=I.className.replace(" "+E,""),I.removeAttribute("aria-selected")),I=this.hints.childNodes[this.selectedHint=M],I.className+=" "+E,I.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",I.id),this.scrollToActive(),v.signal(this.data,"select",this.data.list[this.selectedHint],I)}},scrollToActive:function(){var M=this.getSelectedHintRange(),S=this.hints.childNodes[M.from],I=this.hints.childNodes[M.to],F=this.hints.firstChild;S.offsetTop<this.hints.scrollTop?this.hints.scrollTop=S.offsetTop-F.offsetTop:I.offsetTop+I.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=I.offsetTop+I.offsetHeight-this.hints.clientHeight+F.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var M=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-M),to:Math.min(this.data.list.length-1,this.selectedHint+M)}}};function se(M,S){if(!M.somethingSelected())return S;for(var I=[],F=0;F<S.length;F++)S[F].supportsSelection&&I.push(S[F]);return I}function $(M,S,I,F){if(M.async)M(S,F,I);else{var K=M(S,I);K&&K.then?K.then(F):F(K)}}function k(M,S){var I=M.getHelpers(S,"hint"),F;if(I.length){var K=function(te,j,ie){var H=se(te,I);function Y(ce){if(ce==H.length)return j(null);$(H[ce],te,ie,function(ge){ge&&ge.list.length>0?j(ge):Y(ce+1)})}Y(0)};return K.async=!0,K.supportsSelection=!0,K}else return(F=M.getHelper(M.getCursor(),"hintWords"))?function(te){return v.hint.fromList(te,{words:F})}:v.hint.anyword?function(te,j){return v.hint.anyword(te,j)}:function(){}}v.registerHelper("hint","auto",{resolve:k}),v.registerHelper("hint","fromList",function(M,S){var I=M.getCursor(),F=M.getTokenAt(I),K,te=v.Pos(I.line,F.start),j=I;F.start<I.ch&&/\w/.test(F.string.charAt(I.ch-F.start-1))?K=F.string.substr(0,I.ch-F.start):(K="",te=I);for(var ie=[],H=0;H<S.words.length;H++){var Y=S.words[H];Y.slice(0,K.length)==K&&ie.push(Y)}if(ie.length)return{list:ie,from:te,to:j}}),v.commands.autocomplete=v.showHint;var J={hint:v.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};v.defineOption("hintOptions",null)})},33201:(x,N,f)=>{(function(v){v(f(46944))})(function(v){"use strict";var C="CodeMirror-lint-markers",E="CodeMirror-lint-line-";function P(j,ie,H){var Y=document.createElement("div");Y.className="CodeMirror-lint-tooltip cm-s-"+j.options.theme,Y.appendChild(H.cloneNode(!0)),j.state.lint.options.selfContain?j.getWrapperElement().appendChild(Y):document.body.appendChild(Y);function ce(ge){if(!Y.parentNode)return v.off(document,"mousemove",ce);Y.style.top=Math.max(0,ge.clientY-Y.offsetHeight-5)+"px",Y.style.left=ge.clientX+5+"px"}return v.on(document,"mousemove",ce),ce(ie),Y.style.opacity!=null&&(Y.style.opacity=1),Y}function D(j){j.parentNode&&j.parentNode.removeChild(j)}function R(j){j.parentNode&&(j.style.opacity==null&&D(j),j.style.opacity=0,setTimeout(function(){D(j)},600))}function V(j,ie,H,Y){var ce=P(j,ie,H);function ge(){v.off(Y,"mouseout",ge),ce&&(R(ce),ce=null)}var G=setInterval(function(){if(ce)for(var ve=Y;;ve=ve.parentNode){if(ve&&ve.nodeType==11&&(ve=ve.host),ve==document.body)return;if(!ve){ge();break}}if(!ce)return clearInterval(G)},400);v.on(Y,"mouseout",ge)}function Q(j,ie,H){this.marked=[],ie instanceof Function&&(ie={getAnnotations:ie}),(!ie||ie===!0)&&(ie={}),this.options={},this.linterOptions=ie.options||{};for(var Y in Z)this.options[Y]=Z[Y];for(var Y in ie)Z.hasOwnProperty(Y)?ie[Y]!=null&&(this.options[Y]=ie[Y]):ie.options||(this.linterOptions[Y]=ie[Y]);this.timeout=null,this.hasGutter=H,this.onMouseOver=function(ce){te(j,ce)},this.waitingFor=0}var Z={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function de(j){var ie=j.state.lint;ie.hasGutter&&j.clearGutter(C),ie.options.highlightLines&&re(j);for(var H=0;H<ie.marked.length;++H)ie.marked[H].clear();ie.marked.length=0}function re(j){j.eachLine(function(ie){var H=ie.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(ie.wrapClass);H&&j.removeLineClass(ie,"wrap",H[0])})}function se(j,ie,H,Y,ce){var ge=document.createElement("div"),G=ge;return ge.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+H,Y&&(G=ge.appendChild(document.createElement("div")),G.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),ce!=!1&&v.on(G,"mouseover",function(ve){V(j,ve,ie,G)}),ge}function $(j,ie){return j=="error"?j:ie}function k(j){for(var ie=[],H=0;H<j.length;++H){var Y=j[H],ce=Y.from.line;(ie[ce]||(ie[ce]=[])).push(Y)}return ie}function J(j){var ie=j.severity;ie||(ie="error");var H=document.createElement("div");return H.className="CodeMirror-lint-message CodeMirror-lint-message-"+ie,typeof j.messageHTML<"u"?H.innerHTML=j.messageHTML:H.appendChild(document.createTextNode(j.message)),H}function M(j,ie){var H=j.state.lint,Y=++H.waitingFor;function ce(){Y=-1,j.off("change",ce)}j.on("change",ce),ie(j.getValue(),function(ge,G){j.off("change",ce),H.waitingFor==Y&&(G&&ge instanceof v&&(ge=G),j.operation(function(){I(j,ge)}))},H.linterOptions,j)}function S(j){var ie=j.state.lint;if(ie){var H=ie.options,Y=H.getAnnotations||j.getHelper(v.Pos(0,0),"lint");if(Y)if(H.async||Y.async)M(j,Y);else{var ce=Y(j.getValue(),ie.linterOptions,j);if(!ce)return;ce.then?ce.then(function(ge){j.operation(function(){I(j,ge)})}):j.operation(function(){I(j,ce)})}}}function I(j,ie){var H=j.state.lint;if(H){var Y=H.options;de(j);for(var ce=k(ie),ge=0;ge<ce.length;++ge){var G=ce[ge];if(G){var ve=[];G=G.filter(function(ft){return ve.indexOf(ft.message)>-1?!1:ve.push(ft.message)});for(var ee=null,He=H.hasGutter&&document.createDocumentFragment(),_e=0;_e<G.length;++_e){var ze=G[_e],dt=ze.severity;dt||(dt="error"),ee=$(ee,dt),Y.formatAnnotation&&(ze=Y.formatAnnotation(ze)),H.hasGutter&&He.appendChild(J(ze)),ze.to&&H.marked.push(j.markText(ze.from,ze.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+dt,__annotation:ze}))}H.hasGutter&&j.setGutterMarker(ge,C,se(j,He,ee,ce[ge].length>1,Y.tooltips)),Y.highlightLines&&j.addLineClass(ge,"wrap",E+ee)}}Y.onUpdateLinting&&Y.onUpdateLinting(ie,ce,j)}}function F(j){var ie=j.state.lint;ie&&(clearTimeout(ie.timeout),ie.timeout=setTimeout(function(){S(j)},ie.options.delay))}function K(j,ie,H){for(var Y=H.target||H.srcElement,ce=document.createDocumentFragment(),ge=0;ge<ie.length;ge++){var G=ie[ge];ce.appendChild(J(G))}V(j,H,ce,Y)}function te(j,ie){var H=ie.target||ie.srcElement;if(/\bCodeMirror-lint-mark-/.test(H.className)){for(var Y=H.getBoundingClientRect(),ce=(Y.left+Y.right)/2,ge=(Y.top+Y.bottom)/2,G=j.findMarksAt(j.coordsChar({left:ce,top:ge},"client")),ve=[],ee=0;ee<G.length;++ee){var He=G[ee].__annotation;He&&ve.push(He)}ve.length&&K(j,ve,ie)}}v.defineOption("lint",!1,function(j,ie,H){if(H&&H!=v.Init&&(de(j),j.state.lint.options.lintOnChange!==!1&&j.off("change",F),v.off(j.getWrapperElement(),"mouseover",j.state.lint.onMouseOver),clearTimeout(j.state.lint.timeout),delete j.state.lint),ie){for(var Y=j.getOption("gutters"),ce=!1,ge=0;ge<Y.length;++ge)Y[ge]==C&&(ce=!0);var G=j.state.lint=new Q(j,ie,ce);G.options.lintOnChange&&j.on("change",F),G.options.tooltips!=!1&&G.options.tooltips!="gutter"&&v.on(j.getWrapperElement(),"mouseover",G.onMouseOver),S(j)}}),v.defineExtension("performLint",function(){S(this)})})},71628:(x,N,f)=>{(function(v){v(f(46944))})(function(v){"use strict";var C=v.Pos;function E(S){var I=S.flags;return I??(S.ignoreCase?"i":"")+(S.global?"g":"")+(S.multiline?"m":"")}function P(S,I){for(var F=E(S),K=F,te=0;te<I.length;te++)K.indexOf(I.charAt(te))==-1&&(K+=I.charAt(te));return F==K?S:new RegExp(S.source,K)}function D(S){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(S.source)}function R(S,I,F){I=P(I,"g");for(var K=F.line,te=F.ch,j=S.lastLine();K<=j;K++,te=0){I.lastIndex=te;var ie=S.getLine(K),H=I.exec(ie);if(H)return{from:C(K,H.index),to:C(K,H.index+H[0].length),match:H}}}function V(S,I,F){if(!D(I))return R(S,I,F);I=P(I,"gm");for(var K,te=1,j=F.line,ie=S.lastLine();j<=ie;){for(var H=0;H<te&&!(j>ie);H++){var Y=S.getLine(j++);K=K==null?Y:K+`
8
- `+Y}te=te*2,I.lastIndex=F.ch;var ce=I.exec(K);if(ce){var ge=K.slice(0,ce.index).split(`
9
- `),G=ce[0].split(`
10
- `),ve=F.line+ge.length-1,ee=ge[ge.length-1].length;return{from:C(ve,ee),to:C(ve+G.length-1,G.length==1?ee+G[0].length:G[G.length-1].length),match:ce}}}}function Q(S,I,F){for(var K,te=0;te<=S.length;){I.lastIndex=te;var j=I.exec(S);if(!j)break;var ie=j.index+j[0].length;if(ie>S.length-F)break;(!K||ie>K.index+K[0].length)&&(K=j),te=j.index+1}return K}function Z(S,I,F){I=P(I,"g");for(var K=F.line,te=F.ch,j=S.firstLine();K>=j;K--,te=-1){var ie=S.getLine(K),H=Q(ie,I,te<0?0:ie.length-te);if(H)return{from:C(K,H.index),to:C(K,H.index+H[0].length),match:H}}}function de(S,I,F){if(!D(I))return Z(S,I,F);I=P(I,"gm");for(var K,te=1,j=S.getLine(F.line).length-F.ch,ie=F.line,H=S.firstLine();ie>=H;){for(var Y=0;Y<te&&ie>=H;Y++){var ce=S.getLine(ie--);K=K==null?ce:ce+`
11
- `+K}te*=2;var ge=Q(K,I,j);if(ge){var G=K.slice(0,ge.index).split(`
12
- `),ve=ge[0].split(`
13
- `),ee=ie+G.length,He=G[G.length-1].length;return{from:C(ee,He),to:C(ee+ve.length-1,ve.length==1?He+ve[0].length:ve[ve.length-1].length),match:ge}}}}var re,se;String.prototype.normalize?(re=function(S){return S.normalize("NFD").toLowerCase()},se=function(S){return S.normalize("NFD")}):(re=function(S){return S.toLowerCase()},se=function(S){return S});function $(S,I,F,K){if(S.length==I.length)return F;for(var te=0,j=F+Math.max(0,S.length-I.length);;){if(te==j)return te;var ie=te+j>>1,H=K(S.slice(0,ie)).length;if(H==F)return ie;H>F?j=ie:te=ie+1}}function k(S,I,F,K){if(!I.length)return null;var te=K?re:se,j=te(I).split(/\r|\n\r?/);e:for(var ie=F.line,H=F.ch,Y=S.lastLine()+1-j.length;ie<=Y;ie++,H=0){var ce=S.getLine(ie).slice(H),ge=te(ce);if(j.length==1){var G=ge.indexOf(j[0]);if(G==-1)continue e;var F=$(ce,ge,G,te)+H;return{from:C(ie,$(ce,ge,G,te)+H),to:C(ie,$(ce,ge,G+j[0].length,te)+H)}}else{var ve=ge.length-j[0].length;if(ge.slice(ve)!=j[0])continue e;for(var ee=1;ee<j.length-1;ee++)if(te(S.getLine(ie+ee))!=j[ee])continue e;var He=S.getLine(ie+j.length-1),_e=te(He),ze=j[j.length-1];if(_e.slice(0,ze.length)!=ze)continue e;return{from:C(ie,$(ce,ge,ve,te)+H),to:C(ie+j.length-1,$(He,_e,ze.length,te))}}}}function J(S,I,F,K){if(!I.length)return null;var te=K?re:se,j=te(I).split(/\r|\n\r?/);e:for(var ie=F.line,H=F.ch,Y=S.firstLine()-1+j.length;ie>=Y;ie--,H=-1){var ce=S.getLine(ie);H>-1&&(ce=ce.slice(0,H));var ge=te(ce);if(j.length==1){var G=ge.lastIndexOf(j[0]);if(G==-1)continue e;return{from:C(ie,$(ce,ge,G,te)),to:C(ie,$(ce,ge,G+j[0].length,te))}}else{var ve=j[j.length-1];if(ge.slice(0,ve.length)!=ve)continue e;for(var ee=1,F=ie-j.length+1;ee<j.length-1;ee++)if(te(S.getLine(F+ee))!=j[ee])continue e;var He=S.getLine(ie+1-j.length),_e=te(He);if(_e.slice(_e.length-j[0].length)!=j[0])continue e;return{from:C(ie+1-j.length,$(He,_e,He.length-j[0].length,te)),to:C(ie,$(ce,ge,ve.length,te))}}}}function M(S,I,F,K){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=S,F=F?S.clipPos(F):C(0,0),this.pos={from:F,to:F};var te;typeof K=="object"?te=K.caseFold:(te=K,K=null),typeof I=="string"?(te==null&&(te=!1),this.matches=function(j,ie){return(j?J:k)(S,I,ie,te)}):(I=P(I,"gm"),!K||K.multiline!==!1?this.matches=function(j,ie){return(j?de:V)(S,I,ie)}:this.matches=function(j,ie){return(j?Z:R)(S,I,ie)})}M.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(S){var I=this.doc.clipPos(S?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(I=C(I.line,I.ch),S?(I.ch--,I.ch<0&&(I.line--,I.ch=(this.doc.getLine(I.line)||"").length)):(I.ch++,I.ch>(this.doc.getLine(I.line)||"").length&&(I.ch=0,I.line++)),v.cmpPos(I,this.doc.clipPos(I))!=0))return this.atOccurrence=!1;var F=this.matches(S,I);if(this.afterEmptyMatch=F&&v.cmpPos(F.from,F.to)==0,F)return this.pos=F,this.atOccurrence=!0,this.pos.match||!0;var K=C(S?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:K,to:K},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(S,I){if(this.atOccurrence){var F=v.splitLines(S);this.doc.replaceRange(F,this.pos.from,this.pos.to,I),this.pos.to=C(this.pos.from.line+F.length-1,F[F.length-1].length+(F.length==1?this.pos.from.ch:0))}}},v.defineExtension("getSearchCursor",function(S,I,F){return new M(this.doc,S,I,F)}),v.defineDocExtension("getSearchCursor",function(S,I,F){return new M(this,S,I,F)}),v.defineExtension("selectMatches",function(S,I){for(var F=[],K=this.getSearchCursor(S,this.getCursor("from"),I);K.findNext()&&!(v.cmpPos(K.to(),this.getCursor("to"))>0);)F.push({anchor:K.from(),head:K.to()});F.length&&this.setSelections(F,0)})})},46944:function(x){(function(N,f){x.exports=f()})(this,function(){"use strict";var N=navigator.userAgent,f=navigator.platform,v=/gecko\/\d/i.test(N),C=/MSIE \d/.test(N),E=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(N),P=/Edge\/(\d+)/.exec(N),D=C||E||P,R=D&&(C?document.documentMode||6:+(P||E)[1]),V=!P&&/WebKit\//.test(N),Q=V&&/Qt\/\d+\.\d+/.test(N),Z=!P&&/Chrome\/(\d+)/.exec(N),de=Z&&+Z[1],re=/Opera\//.test(N),se=/Apple Computer/.test(navigator.vendor),$=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(N),k=/PhantomJS/.test(N),J=se&&(/Mobile\/\w+/.test(N)||navigator.maxTouchPoints>2),M=/Android/.test(N),S=J||M||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(N),I=J||/Mac/.test(f),F=/\bCrOS\b/.test(N),K=/win/i.test(f),te=re&&N.match(/Version\/(\d*\.\d*)/);te&&(te=Number(te[1])),te&&te>=15&&(re=!1,V=!0);var j=I&&(Q||re&&(te==null||te<12.11)),ie=v||D&&R>=9;function H(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Y=function(e,r){var a=e.className,o=H(r).exec(a);if(o){var l=a.slice(o.index+o[0].length);e.className=a.slice(0,o.index)+(l?o[1]+l:"")}};function ce(e){for(var r=e.childNodes.length;r>0;--r)e.removeChild(e.firstChild);return e}function ge(e,r){return ce(e).appendChild(r)}function G(e,r,a,o){var l=document.createElement(e);if(a&&(l.className=a),o&&(l.style.cssText=o),typeof r=="string")l.appendChild(document.createTextNode(r));else if(r)for(var d=0;d<r.length;++d)l.appendChild(r[d]);return l}function ve(e,r,a,o){var l=G(e,r,a,o);return l.setAttribute("role","presentation"),l}var ee;document.createRange?ee=function(e,r,a,o){var l=document.createRange();return l.setEnd(o||e,a),l.setStart(e,r),l}:ee=function(e,r,a){var o=document.body.createTextRange();try{o.moveToElementText(e.parentNode)}catch{return o}return o.collapse(!0),o.moveEnd("character",a),o.moveStart("character",r),o};function He(e,r){if(r.nodeType==3&&(r=r.parentNode),e.contains)return e.contains(r);do if(r.nodeType==11&&(r=r.host),r==e)return!0;while(r=r.parentNode)}function _e(e){var r;try{r=e.activeElement}catch{r=e.body||null}for(;r&&r.shadowRoot&&r.shadowRoot.activeElement;)r=r.shadowRoot.activeElement;return r}function ze(e,r){var a=e.className;H(r).test(a)||(e.className+=(a?" ":"")+r)}function dt(e,r){for(var a=e.split(" "),o=0;o<a.length;o++)a[o]&&!H(a[o]).test(r)&&(r+=" "+a[o]);return r}var ft=function(e){e.select()};J?ft=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:D&&(ft=function(e){try{e.select()}catch{}});function at(e){return e.display.wrapper.ownerDocument}function Gt(e){return at(e).defaultView}function ht(e){var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}}function Ot(e,r,a){r||(r={});for(var o in e)e.hasOwnProperty(o)&&(a!==!1||!r.hasOwnProperty(o))&&(r[o]=e[o]);return r}function nt(e,r,a,o,l){r==null&&(r=e.search(/[^\s\u00a0]/),r==-1&&(r=e.length));for(var d=o||0,g=l||0;;){var b=e.indexOf(" ",d);if(b<0||b>=r)return g+(r-d);g+=b-d,g+=a-g%a,d=b+1}}var Ue=function(){this.id=null,this.f=null,this.time=0,this.handler=ht(this.onTimeout,this)};Ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ue.prototype.set=function(e,r){this.f=r;var a=+new Date+e;(!this.id||a<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=a)};function Fe(e,r){for(var a=0;a<e.length;++a)if(e[a]==r)return a;return-1}var Re=50,it={toString:function(){return"CodeMirror.Pass"}},Dt={scroll:!1},qe={origin:"*mouse"},St={origin:"+move"};function Kt(e,r,a){for(var o=0,l=0;;){var d=e.indexOf(" ",o);d==-1&&(d=e.length);var g=d-o;if(d==e.length||l+g>=r)return o+Math.min(g,r-l);if(l+=d-o,l+=a-l%a,o=d+1,l>=r)return o}}var Jt=[""];function pr(e){for(;Jt.length<=e;)Jt.push(Je(Jt)+" ");return Jt[e]}function Je(e){return e[e.length-1]}function xt(e,r){for(var a=[],o=0;o<e.length;o++)a[o]=r(e[o],o);return a}function Lt(e,r,a){for(var o=0,l=a(r);o<e.length&&a(e[o])<=l;)o++;e.splice(o,0,r)}function Or(){}function Ft(e,r){var a;return Object.create?a=Object.create(e):(Or.prototype=e,a=new Or),r&&Ot(r,a),a}var hn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function pn(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||hn.test(e))}function Hr(e,r){return r?r.source.indexOf("\\w")>-1&&pn(e)?!0:r.test(e):pn(e)}function en(e){for(var r in e)if(e.hasOwnProperty(r)&&e[r])return!1;return!0}var kn=/[\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 vn(e){return e.charCodeAt(0)>=768&&kn.test(e)}function Ur(e,r,a){for(;(a<0?r>0:r<e.length)&&vn(e.charAt(r));)r+=a;return r}function gr(e,r,a){for(var o=r>a?-1:1;;){if(r==a)return r;var l=(r+a)/2,d=o<0?Math.ceil(l):Math.floor(l);if(d==r)return e(d)?r:a;e(d)?a=d:r=d+o}}function Er(e,r,a,o){if(!e)return o(r,a,"ltr",0);for(var l=!1,d=0;d<e.length;++d){var g=e[d];(g.from<a&&g.to>r||r==a&&g.to==r)&&(o(Math.max(g.from,r),Math.min(g.to,a),g.level==1?"rtl":"ltr",d),l=!0)}l||o(r,a,"ltr")}var Rt=null;function mt(e,r,a){var o;Rt=null;for(var l=0;l<e.length;++l){var d=e[l];if(d.from<r&&d.to>r)return l;d.to==r&&(d.from!=d.to&&a=="before"?o=l:Rt=l),d.from==r&&(d.from!=d.to&&a!="before"?o=l:Rt=l)}return o??Rt}var st=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function a(O){return O<=247?e.charAt(O):1424<=O&&O<=1524?"R":1536<=O&&O<=1785?r.charAt(O-1536):1774<=O&&O<=2220?"r":8192<=O&&O<=8203?"w":O==8204?"b":"L"}var o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,l=/[stwN]/,d=/[LRr]/,g=/[Lb1n]/,b=/[1n]/;function w(O,U,X){this.level=O,this.from=U,this.to=X}return function(O,U){var X=U=="ltr"?"L":"R";if(O.length==0||U=="ltr"&&!o.test(O))return!1;for(var he=O.length,le=[],xe=0;xe<he;++xe)le.push(a(O.charCodeAt(xe)));for(var Ce=0,Le=X;Ce<he;++Ce){var Me=le[Ce];Me=="m"?le[Ce]=Le:Le=Me}for(var Oe=0,Ne=X;Oe<he;++Oe){var We=le[Oe];We=="1"&&Ne=="r"?le[Oe]="n":d.test(We)&&(Ne=We,We=="r"&&(le[Oe]="R"))}for(var Ye=1,Ke=le[0];Ye<he-1;++Ye){var vt=le[Ye];vt=="+"&&Ke=="1"&&le[Ye+1]=="1"?le[Ye]="1":vt==","&&Ke==le[Ye+1]&&(Ke=="1"||Ke=="n")&&(le[Ye]=Ke),Ke=vt}for(var kt=0;kt<he;++kt){var ar=le[kt];if(ar==",")le[kt]="N";else if(ar=="%"){var Ut=void 0;for(Ut=kt+1;Ut<he&&le[Ut]=="%";++Ut);for(var Ze=kt&&le[kt-1]=="!"||Ut<he&&le[Ut]=="1"?"1":"N",Lr=kt;Lr<Ut;++Lr)le[Lr]=Ze;kt=Ut-1}}for(var Qt=0,Yt=X;Qt<he;++Qt){var Xt=le[Qt];Yt=="L"&&Xt=="1"?le[Qt]="L":d.test(Xt)&&(Yt=Xt)}for(var Mt=0;Mt<he;++Mt)if(l.test(le[Mt])){var zt=void 0;for(zt=Mt+1;zt<he&&l.test(le[zt]);++zt);for(var bt=(Mt?le[Mt-1]:X)=="L",Zt=(zt<he?le[zt]:X)=="L",Qn=bt==Zt?bt?"L":"R":X,fn=Mt;fn<zt;++fn)le[fn]=Qn;Mt=zt-1}for(var ir=[],$r,or=0;or<he;)if(g.test(le[or])){var bo=or;for(++or;or<he&&g.test(le[or]);++or);ir.push(new w(0,bo,or))}else{var Fn=or,xo=ir.length,pi=U=="rtl"?1:0;for(++or;or<he&&le[or]!="L";++or);for(var wr=Fn;wr<or;)if(b.test(le[wr])){Fn<wr&&(ir.splice(xo,0,new w(1,Fn,wr)),xo+=pi);var Zn=wr;for(++wr;wr<or&&b.test(le[wr]);++wr);ir.splice(xo,0,new w(2,Zn,wr)),xo+=pi,Fn=wr}else++wr;Fn<or&&ir.splice(xo,0,new w(1,Fn,or))}return U=="ltr"&&(ir[0].level==1&&($r=O.match(/^\s+/))&&(ir[0].from=$r[0].length,ir.unshift(new w(0,0,$r[0].length))),Je(ir).level==1&&($r=O.match(/\s+$/))&&(Je(ir).to-=$r[0].length,ir.push(new w(0,he-$r[0].length,he)))),U=="rtl"?ir.reverse():ir}}();function Qe(e,r){var a=e.order;return a==null&&(a=e.order=st(e.text,r)),a}var pt=[],ne=function(e,r,a){if(e.addEventListener)e.addEventListener(r,a,!1);else if(e.attachEvent)e.attachEvent("on"+r,a);else{var o=e._handlers||(e._handlers={});o[r]=(o[r]||pt).concat(a)}};function be(e,r){return e._handlers&&e._handlers[r]||pt}function je(e,r,a){if(e.removeEventListener)e.removeEventListener(r,a,!1);else if(e.detachEvent)e.detachEvent("on"+r,a);else{var o=e._handlers,l=o&&o[r];if(l){var d=Fe(l,a);d>-1&&(o[r]=l.slice(0,d).concat(l.slice(d+1)))}}}function tt(e,r){var a=be(e,r);if(a.length)for(var o=Array.prototype.slice.call(arguments,2),l=0;l<a.length;++l)a[l].apply(null,o)}function ct(e,r,a){return typeof r=="string"&&(r={type:r,preventDefault:function(){this.defaultPrevented=!0}}),tt(e,a||r.type,e,r),Wn(r)||r.codemirrorIgnore}function lt(e){var r=e._handlers&&e._handlers.cursorActivity;if(r)for(var a=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),o=0;o<r.length;++o)Fe(a,r[o])==-1&&a.push(r[o])}function _t(e,r){return be(e,r).length>0}function Tr(e){e.prototype.on=function(r,a){ne(this,r,a)},e.prototype.off=function(r,a){je(this,r,a)}}function wt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function er(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Wn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function mr(e){wt(e),er(e)}function yr(e){return e.target||e.srcElement}function Hn(e){var r=e.which;return r==null&&(e.button&1?r=1:e.button&2?r=3:e.button&4&&(r=2)),I&&e.ctrlKey&&r==1&&(r=3),r}var kr=function(){if(D&&R<9)return!1;var e=G("div");return"draggable"in e||"dragDrop"in e}(),Pn;function Ln(e){if(Pn==null){var r=G("span","\u200B");ge(e,G("span",[r,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Pn=r.offsetWidth<=1&&r.offsetHeight>2&&!(D&&R<8))}var a=Pn?G("span","\u200B"):G("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return a.setAttribute("cm-text",""),a}var br;function Un(e){if(br!=null)return br;var r=ge(e,document.createTextNode("A\u062EA")),a=ee(r,0,1).getBoundingClientRect(),o=ee(r,1,2).getBoundingClientRect();return ce(e),!a||a.left==a.right?!1:br=o.right-a.right<3}var gn=`
14
-
15
- b`.split(/\n/).length!=3?function(e){for(var r=0,a=[],o=e.length;r<=o;){var l=e.indexOf(`
16
- `,r);l==-1&&(l=e.length);var d=e.slice(r,e.charAt(l-1)=="\r"?l-1:l),g=d.indexOf("\r");g!=-1?(a.push(d.slice(0,g)),r+=g+1):(a.push(d),r=l+1)}return a}:function(e){return e.split(/\r\n?|\n/)},ni=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var r;try{r=e.ownerDocument.selection.createRange()}catch{}return!r||r.parentElement()!=e?!1:r.compareEndPoints("StartToEnd",r)!=0},Ui=function(){var e=G("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Yr=null;function Ir(e){if(Yr!=null)return Yr;var r=ge(e,G("span","x")),a=r.getBoundingClientRect(),o=ee(r,0,1).getBoundingClientRect();return Yr=Math.abs(a.left-o.left)>1}var Xr={},zr={};function _r(e,r){arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),Xr[e]=r}function Oo(e,r){zr[e]=r}function mn(e){if(typeof e=="string"&&zr.hasOwnProperty(e))e=zr[e];else if(e&&typeof e.name=="string"&&zr.hasOwnProperty(e.name)){var r=zr[e.name];typeof r=="string"&&(r={name:r}),e=Ft(r,e),e.name=r.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return mn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return mn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Mr(e,r){r=mn(r);var a=Xr[r.name];if(!a)return Mr(e,"text/plain");var o=a(e,r);if(tr.hasOwnProperty(r.name)){var l=tr[r.name];for(var d in l)l.hasOwnProperty(d)&&(o.hasOwnProperty(d)&&(o["_"+d]=o[d]),o[d]=l[d])}if(o.name=r.name,r.helperType&&(o.helperType=r.helperType),r.modeProps)for(var g in r.modeProps)o[g]=r.modeProps[g];return o}var tr={};function In(e,r){var a=tr.hasOwnProperty(e)?tr[e]:tr[e]={};Ot(r,a)}function tn(e,r){if(r===!0)return r;if(e.copyState)return e.copyState(r);var a={};for(var o in r){var l=r[o];l instanceof Array&&(l=l.concat([])),a[o]=l}return a}function zi(e,r){for(var a;e.innerMode&&(a=e.innerMode(r),!(!a||a.mode==e));)r=a.state,e=a.mode;return a||{mode:e,state:r}}function ia(e,r,a){return e.startState?e.startState(r,a):!0}var Ht=function(e,r,a){this.pos=this.start=0,this.string=e,this.tabSize=r||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};Ht.prototype.eol=function(){return this.pos>=this.string.length},Ht.prototype.sol=function(){return this.pos==this.lineStart},Ht.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ht.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ht.prototype.eat=function(e){var r=this.string.charAt(this.pos),a;if(typeof e=="string"?a=r==e:a=r&&(e.test?e.test(r):e(r)),a)return++this.pos,r},Ht.prototype.eatWhile=function(e){for(var r=this.pos;this.eat(e););return this.pos>r},Ht.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ht.prototype.skipToEnd=function(){this.pos=this.string.length},Ht.prototype.skipTo=function(e){var r=this.string.indexOf(e,this.pos);if(r>-1)return this.pos=r,!0},Ht.prototype.backUp=function(e){this.pos-=e},Ht.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=nt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?nt(this.string,this.lineStart,this.tabSize):0)},Ht.prototype.indentation=function(){return nt(this.string,null,this.tabSize)-(this.lineStart?nt(this.string,this.lineStart,this.tabSize):0)},Ht.prototype.match=function(e,r,a){if(typeof e=="string"){var o=function(g){return a?g.toLowerCase():g},l=this.string.substr(this.pos,e.length);if(o(l)==o(e))return r!==!1&&(this.pos+=e.length),!0}else{var d=this.string.slice(this.pos).match(e);return d&&d.index>0?null:(d&&r!==!1&&(this.pos+=d[0].length),d)}},Ht.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ht.prototype.hideFirstChars=function(e,r){this.lineStart+=e;try{return r()}finally{this.lineStart-=e}},Ht.prototype.lookAhead=function(e){var r=this.lineOracle;return r&&r.lookAhead(e)},Ht.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ve(e,r){if(r-=e.first,r<0||r>=e.size)throw new Error("There is no line "+(r+e.first)+" in the document.");for(var a=e;!a.lines;)for(var o=0;;++o){var l=a.children[o],d=l.chunkSize();if(r<d){a=l;break}r-=d}return a.lines[r]}function zn(e,r,a){var o=[],l=r.line;return e.iter(r.line,a.line+1,function(d){var g=d.text;l==a.line&&(g=g.slice(0,a.ch)),l==r.line&&(g=g.slice(r.ch)),o.push(g),++l}),o}function mi(e,r,a){var o=[];return e.iter(r,a,function(l){o.push(l.text)}),o}function rn(e,r){var a=r-e.height;if(a)for(var o=e;o;o=o.parent)o.height+=a}function Ct(e){if(e.parent==null)return null;for(var r=e.parent,a=Fe(r.lines,e),o=r.parent;o;r=o,o=o.parent)for(var l=0;o.children[l]!=r;++l)a+=o.children[l].chunkSize();return a+r.first}function _n(e,r){var a=e.first;e:do{for(var o=0;o<e.children.length;++o){var l=e.children[o],d=l.height;if(r<d){e=l;continue e}r-=d,a+=l.chunkSize()}return a}while(!e.lines);for(var g=0;g<e.lines.length;++g){var b=e.lines[g],w=b.height;if(r<w)break;r-=w}return a+g}function yi(e,r){return r>=e.first&&r<e.first+e.size}function _i(e,r){return String(e.lineNumberFormatter(r+e.firstLineNumber))}function A(e,r,a){if(a===void 0&&(a=null),!(this instanceof A))return new A(e,r,a);this.line=e,this.ch=r,this.sticky=a}function z(e,r){return e.line-r.line||e.ch-r.ch}function Se(e,r){return e.sticky==r.sticky&&z(e,r)==0}function Pe(e){return A(e.line,e.ch)}function rt(e,r){return z(e,r)<0?r:e}function yt(e,r){return z(e,r)<0?e:r}function At(e,r){return Math.max(e.first,Math.min(r,e.first+e.size-1))}function $e(e,r){if(r.line<e.first)return A(e.first,0);var a=e.first+e.size-1;return r.line>a?A(a,Ve(e,a).text.length):nn(r,Ve(e,r.line).text.length)}function nn(e,r){var a=e.ch;return a==null||a>r?A(e.line,r):a<0?A(e.line,0):e}function Eo(e,r){for(var a=[],o=0;o<r.length;o++)a[o]=$e(e,r[o]);return a}var oa=function(e,r){this.state=e,this.lookAhead=r},Mn=function(e,r,a,o){this.state=r,this.doc=e,this.line=a,this.maxLookAhead=o||0,this.baseTokens=null,this.baseTokenPos=1};Mn.prototype.lookAhead=function(e){var r=this.doc.getLine(this.line+e);return r!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),r},Mn.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Mn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Mn.fromSaved=function(e,r,a){return r instanceof oa?new Mn(e,tn(e.mode,r.state),a,r.lookAhead):new Mn(e,tn(e.mode,r),a)},Mn.prototype.save=function(e){var r=e!==!1?tn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new oa(r,this.maxLookAhead):r};function el(e,r,a,o){var l=[e.state.modeGen],d={};rl(e,r.text,e.doc.mode,a,function(O,U){return l.push(O,U)},d,o);for(var g=a.state,b=function(O){a.baseTokens=l;var U=e.state.overlays[O],X=1,he=0;a.state=!0,rl(e,r.text,U.mode,a,function(le,xe){for(var Ce=X;he<le;){var Le=l[X];Le>le&&l.splice(X,1,le,l[X+1],Le),X+=2,he=Math.min(le,Le)}if(xe)if(U.opaque)l.splice(Ce,X-Ce,le,"overlay "+xe),X=Ce+2;else for(;Ce<X;Ce+=2){var Me=l[Ce+1];l[Ce+1]=(Me?Me+" ":"")+"overlay "+xe}},d),a.state=g,a.baseTokens=null,a.baseTokenPos=1},w=0;w<e.state.overlays.length;++w)b(w);return{styles:l,classes:d.bgClass||d.textClass?d:null}}function Qa(e,r,a){if(!r.styles||r.styles[0]!=e.state.modeGen){var o=Vi(e,Ct(r)),l=r.text.length>e.options.maxHighlightLength&&tn(e.doc.mode,o.state),d=el(e,r,o);l&&(o.state=l),r.stateAfter=o.save(!l),r.styles=d.styles,d.classes?r.styleClasses=d.classes:r.styleClasses&&(r.styleClasses=null),a===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return r.styles}function Vi(e,r,a){var o=e.doc,l=e.display;if(!o.mode.startState)return new Mn(o,!0,r);var d=Yu(e,r,a),g=d>o.first&&Ve(o,d-1).stateAfter,b=g?Mn.fromSaved(o,g,d):new Mn(o,ia(o.mode),d);return o.iter(d,r,function(w){aa(e,w.text,b);var O=b.line;w.stateAfter=O==r-1||O%5==0||O>=l.viewFrom&&O<l.viewTo?b.save():null,b.nextLine()}),a&&(o.modeFrontier=b.line),b}function aa(e,r,a,o){var l=e.doc.mode,d=new Ht(r,e.options.tabSize,a);for(d.start=d.pos=o||0,r==""&&yn(l,a.state);!d.eol();)Vn(l,d,a.state),d.start=d.pos}function yn(e,r){if(e.blankLine)return e.blankLine(r);if(e.innerMode){var a=zi(e,r);if(a.mode.blankLine)return a.mode.blankLine(a.state)}}function Vn(e,r,a,o){for(var l=0;l<10;l++){o&&(o[0]=zi(e,a).mode);var d=e.token(r,a);if(r.pos>r.start)return d}throw new Error("Mode "+e.name+" failed to advance stream.")}var Nr=function(e,r,a){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=r||null,this.state=a};function bi(e,r,a,o){var l=e.doc,d=l.mode,g;r=$e(l,r);var b=Ve(l,r.line),w=Vi(e,r.line,a),O=new Ht(b.text,e.options.tabSize,w),U;for(o&&(U=[]);(o||O.pos<r.ch)&&!O.eol();)O.start=O.pos,g=Vn(d,O,w.state),o&&U.push(new Nr(O,g,tn(l.mode,w.state)));return o?U:new Nr(O,g,w.state)}function tl(e,r){if(e)for(;;){var a=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!a)break;e=e.slice(0,a.index)+e.slice(a.index+a[0].length);var o=a[1]?"bgClass":"textClass";r[o]==null?r[o]=a[2]:new RegExp("(?:^|\\s)"+a[2]+"(?:$|\\s)").test(r[o])||(r[o]+=" "+a[2])}return e}function rl(e,r,a,o,l,d,g){var b=a.flattenSpans;b==null&&(b=e.options.flattenSpans);var w=0,O=null,U=new Ht(r,e.options.tabSize,o),X,he=e.options.addModeClass&&[null];for(r==""&&tl(yn(a,o.state),d);!U.eol();){if(U.pos>e.options.maxHighlightLength?(b=!1,g&&aa(e,r,o,U.pos),U.pos=r.length,X=null):X=tl(Vn(a,U,o.state,he),d),he){var le=he[0].name;le&&(X="m-"+(X?le+" "+X:le))}if(!b||O!=X){for(;w<U.start;)w=Math.min(U.start,w+5e3),l(w,O);O=X}U.start=U.pos}for(;w<U.pos;){var xe=Math.min(U.pos,w+5e3);l(xe,O),w=xe}}function Yu(e,r,a){for(var o,l,d=e.doc,g=a?-1:r-(e.doc.mode.innerMode?1e3:100),b=r;b>g;--b){if(b<=d.first)return d.first;var w=Ve(d,b-1),O=w.stateAfter;if(O&&(!a||b+(O instanceof oa?O.lookAhead:0)<=d.modeFrontier))return b;var U=nt(w.text,null,e.options.tabSize);(l==null||o>U)&&(l=b-1,o=U)}return l}function nl(e,r){if(e.modeFrontier=Math.min(e.modeFrontier,r),!(e.highlightFrontier<r-10)){for(var a=e.first,o=r-1;o>a;o--){var l=Ve(e,o).stateAfter;if(l&&(!(l instanceof oa)||o+l.lookAhead<r)){a=o+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,a)}}var il=!1,Nn=!1;function ol(){il=!0}function $i(){Nn=!0}function sa(e,r,a){this.marker=e,this.from=r,this.to=a}function Gi(e,r){if(e)for(var a=0;a<e.length;++a){var o=e[a];if(o.marker==r)return o}}function Xe(e,r){for(var a,o=0;o<e.length;++o)e[o]!=r&&(a||(a=[])).push(e[o]);return a}function la(e,r,a){var o=a&&window.WeakSet&&(a.markedSpans||(a.markedSpans=new WeakSet));o&&e.markedSpans&&o.has(e.markedSpans)?e.markedSpans.push(r):(e.markedSpans=e.markedSpans?e.markedSpans.concat([r]):[r],o&&o.add(e.markedSpans)),r.marker.attachLine(e)}function al(e,r,a){var o;if(e)for(var l=0;l<e.length;++l){var d=e[l],g=d.marker,b=d.from==null||(g.inclusiveLeft?d.from<=r:d.from<r);if(b||d.from==r&&g.type=="bookmark"&&(!a||!d.marker.insertLeft)){var w=d.to==null||(g.inclusiveRight?d.to>=r:d.to>r);(o||(o=[])).push(new sa(g,d.from,w?null:d.to))}}return o}function ii(e,r,a){var o;if(e)for(var l=0;l<e.length;++l){var d=e[l],g=d.marker,b=d.to==null||(g.inclusiveRight?d.to>=r:d.to>r);if(b||d.from==r&&g.type=="bookmark"&&(!a||d.marker.insertLeft)){var w=d.from==null||(g.inclusiveLeft?d.from<=r:d.from<r);(o||(o=[])).push(new sa(g,w?null:d.from-r,d.to==null?null:d.to-r))}}return o}function ua(e,r){if(r.full)return null;var a=yi(e,r.from.line)&&Ve(e,r.from.line).markedSpans,o=yi(e,r.to.line)&&Ve(e,r.to.line).markedSpans;if(!a&&!o)return null;var l=r.from.ch,d=r.to.ch,g=z(r.from,r.to)==0,b=al(a,l,g),w=ii(o,d,g),O=r.text.length==1,U=Je(r.text).length+(O?l:0);if(b)for(var X=0;X<b.length;++X){var he=b[X];if(he.to==null){var le=Gi(w,he.marker);le?O&&(he.to=le.to==null?null:le.to+U):he.to=l}}if(w)for(var xe=0;xe<w.length;++xe){var Ce=w[xe];if(Ce.to!=null&&(Ce.to+=U),Ce.from==null){var Le=Gi(b,Ce.marker);Le||(Ce.from=U,O&&(b||(b=[])).push(Ce))}else Ce.from+=U,O&&(b||(b=[])).push(Ce)}b&&(b=xi(b)),w&&w!=b&&(w=xi(w));var Me=[b];if(!O){var Oe=r.text.length-2,Ne;if(Oe>0&&b)for(var We=0;We<b.length;++We)b[We].to==null&&(Ne||(Ne=[])).push(new sa(b[We].marker,null,null));for(var Ye=0;Ye<Oe;++Ye)Me.push(Ne);Me.push(w)}return Me}function xi(e){for(var r=0;r<e.length;++r){var a=e[r];a.from!=null&&a.from==a.to&&a.marker.clearWhenEmpty!==!1&&e.splice(r--,1)}return e.length?e:null}function Za(e,r,a){var o=null;if(e.iter(r.line,a.line+1,function(le){if(le.markedSpans)for(var xe=0;xe<le.markedSpans.length;++xe){var Ce=le.markedSpans[xe].marker;Ce.readOnly&&(!o||Fe(o,Ce)==-1)&&(o||(o=[])).push(Ce)}}),!o)return null;for(var l=[{from:r,to:a}],d=0;d<o.length;++d)for(var g=o[d],b=g.find(0),w=0;w<l.length;++w){var O=l[w];if(!(z(O.to,b.from)<0||z(O.from,b.to)>0)){var U=[w,1],X=z(O.from,b.from),he=z(O.to,b.to);(X<0||!g.inclusiveLeft&&!X)&&U.push({from:O.from,to:b.from}),(he>0||!g.inclusiveRight&&!he)&&U.push({from:b.to,to:O.to}),l.splice.apply(l,U),w+=U.length-3}}return l}function rr(e){var r=e.markedSpans;if(r){for(var a=0;a<r.length;++a)r[a].marker.detachLine(e);e.markedSpans=null}}function To(e,r){if(r){for(var a=0;a<r.length;++a)r[a].marker.attachLine(e);e.markedSpans=r}}function Ki(e){return e.inclusiveLeft?-1:0}function fa(e){return e.inclusiveRight?1:0}function qa(e,r){var a=e.lines.length-r.lines.length;if(a!=0)return a;var o=e.find(),l=r.find(),d=z(o.from,l.from)||Ki(e)-Ki(r);if(d)return-d;var g=z(o.to,l.to)||fa(e)-fa(r);return g||r.id-e.id}function sl(e,r){var a=Nn&&e.markedSpans,o;if(a)for(var l=void 0,d=0;d<a.length;++d)l=a[d],l.marker.collapsed&&(r?l.from:l.to)==null&&(!o||qa(o,l.marker)<0)&&(o=l.marker);return o}function ll(e){return sl(e,!0)}function ca(e){return sl(e,!1)}function ul(e,r){var a=Nn&&e.markedSpans,o;if(a)for(var l=0;l<a.length;++l){var d=a[l];d.marker.collapsed&&(d.from==null||d.from<r)&&(d.to==null||d.to>r)&&(!o||qa(o,d.marker)<0)&&(o=d.marker)}return o}function fl(e,r,a,o,l){var d=Ve(e,r),g=Nn&&d.markedSpans;if(g)for(var b=0;b<g.length;++b){var w=g[b];if(w.marker.collapsed){var O=w.marker.find(0),U=z(O.from,a)||Ki(w.marker)-Ki(l),X=z(O.to,o)||fa(w.marker)-fa(l);if(!(U>=0&&X<=0||U<=0&&X>=0)&&(U<=0&&(w.marker.inclusiveRight&&l.inclusiveLeft?z(O.to,a)>=0:z(O.to,a)>0)||U>=0&&(w.marker.inclusiveRight&&l.inclusiveLeft?z(O.from,o)<=0:z(O.from,o)<0)))return!0}}}function bn(e){for(var r;r=ll(e);)e=r.find(-1,!0).line;return e}function Xu(e){for(var r;r=ca(e);)e=r.find(1,!0).line;return e}function Ju(e){for(var r,a;r=ca(e);)e=r.find(1,!0).line,(a||(a=[])).push(e);return a}function oi(e,r){var a=Ve(e,r),o=bn(a);return a==o?r:Ct(o)}function cl(e,r){if(r>e.lastLine())return r;var a=Ve(e,r),o;if(!$n(e,a))return r;for(;o=ca(a);)a=o.find(1,!0).line;return Ct(a)+1}function $n(e,r){var a=Nn&&r.markedSpans;if(a){for(var o=void 0,l=0;l<a.length;++l)if(o=a[l],!!o.marker.collapsed){if(o.from==null)return!0;if(!o.marker.widgetNode&&o.from==0&&o.marker.inclusiveLeft&&es(e,r,o))return!0}}}function es(e,r,a){if(a.to==null){var o=a.marker.find(1,!0);return es(e,o.line,Gi(o.line.markedSpans,a.marker))}if(a.marker.inclusiveRight&&a.to==r.text.length)return!0;for(var l=void 0,d=0;d<r.markedSpans.length;++d)if(l=r.markedSpans[d],l.marker.collapsed&&!l.marker.widgetNode&&l.from==a.to&&(l.to==null||l.to!=a.from)&&(l.marker.inclusiveLeft||a.marker.inclusiveRight)&&es(e,r,l))return!0}function Gn(e){e=bn(e);for(var r=0,a=e.parent,o=0;o<a.lines.length;++o){var l=a.lines[o];if(l==e)break;r+=l.height}for(var d=a.parent;d;a=d,d=a.parent)for(var g=0;g<d.children.length;++g){var b=d.children[g];if(b==a)break;r+=b.height}return r}function da(e){if(e.height==0)return 0;for(var r=e.text.length,a,o=e;a=ll(o);){var l=a.find(0,!0);o=l.from.line,r+=l.from.ch-l.to.ch}for(o=e;a=ca(o);){var d=a.find(0,!0);r-=o.text.length-d.from.ch,o=d.to.line,r+=o.text.length-d.to.ch}return r}function ts(e){var r=e.display,a=e.doc;r.maxLine=Ve(a,a.first),r.maxLineLength=da(r.maxLine),r.maxLineChanged=!0,a.iter(function(o){var l=da(o);l>r.maxLineLength&&(r.maxLineLength=l,r.maxLine=o)})}var Si=function(e,r,a){this.text=e,To(this,r),this.height=a?a(this):1};Si.prototype.lineNo=function(){return Ct(this)},Tr(Si);function dl(e,r,a,o){e.text=r,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),rr(e),To(e,a);var l=o?o(e):1;l!=e.height&&rn(e,l)}function hl(e){e.parent=null,rr(e)}var rs={},Qu={};function Yi(e,r){if(!e||/^\s*$/.test(e))return null;var a=r.addModeClass?Qu:rs;return a[e]||(a[e]=e.replace(/\S+/g,"cm-$&"))}function pl(e,r){var a=ve("span",null,null,V?"padding-right: .1px":null),o={pre:ve("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};r.measure={};for(var l=0;l<=(r.rest?r.rest.length:0);l++){var d=l?r.rest[l-1]:r.line,g=void 0;o.pos=0,o.addToken=qu,Un(e.display.measure)&&(g=Qe(d,e.doc.direction))&&(o.addToken=ns(o.addToken,g)),o.map=[];var b=r!=e.display.externalMeasured&&Ct(d);tf(d,o,Qa(e,d,b)),d.styleClasses&&(d.styleClasses.bgClass&&(o.bgClass=dt(d.styleClasses.bgClass,o.bgClass||"")),d.styleClasses.textClass&&(o.textClass=dt(d.styleClasses.textClass,o.textClass||""))),o.map.length==0&&o.map.push(0,0,o.content.appendChild(Ln(e.display.measure))),l==0?(r.measure.map=o.map,r.measure.cache={}):((r.measure.maps||(r.measure.maps=[])).push(o.map),(r.measure.caches||(r.measure.caches=[])).push({}))}if(V){var w=o.content.lastChild;(/\bcm-tab\b/.test(w.className)||w.querySelector&&w.querySelector(".cm-tab"))&&(o.content.className="cm-tab-wrap-hack")}return tt(e,"renderLine",e,r.line,o.pre),o.pre.className&&(o.textClass=dt(o.pre.className,o.textClass||"")),o}function Zu(e){var r=G("span","\u2022","cm-invalidchar");return r.title="\\u"+e.charCodeAt(0).toString(16),r.setAttribute("aria-label",r.title),r}function qu(e,r,a,o,l,d,g){if(r){var b=e.splitSpaces?ef(r,e.trailingSpace):r,w=e.cm.state.specialChars,O=!1,U;if(!w.test(r))e.col+=r.length,U=document.createTextNode(b),e.map.push(e.pos,e.pos+r.length,U),D&&R<9&&(O=!0),e.pos+=r.length;else{U=document.createDocumentFragment();for(var X=0;;){w.lastIndex=X;var he=w.exec(r),le=he?he.index-X:r.length-X;if(le){var xe=document.createTextNode(b.slice(X,X+le));D&&R<9?U.appendChild(G("span",[xe])):U.appendChild(xe),e.map.push(e.pos,e.pos+le,xe),e.col+=le,e.pos+=le}if(!he)break;X+=le+1;var Ce=void 0;if(he[0]==" "){var Le=e.cm.options.tabSize,Me=Le-e.col%Le;Ce=U.appendChild(G("span",pr(Me),"cm-tab")),Ce.setAttribute("role","presentation"),Ce.setAttribute("cm-text"," "),e.col+=Me}else he[0]=="\r"||he[0]==`
17
- `?(Ce=U.appendChild(G("span",he[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ce.setAttribute("cm-text",he[0]),e.col+=1):(Ce=e.cm.options.specialCharPlaceholder(he[0]),Ce.setAttribute("cm-text",he[0]),D&&R<9?U.appendChild(G("span",[Ce])):U.appendChild(Ce),e.col+=1);e.map.push(e.pos,e.pos+1,Ce),e.pos++}}if(e.trailingSpace=b.charCodeAt(r.length-1)==32,a||o||l||O||d||g){var Oe=a||"";o&&(Oe+=o),l&&(Oe+=l);var Ne=G("span",[U],Oe,d);if(g)for(var We in g)g.hasOwnProperty(We)&&We!="style"&&We!="class"&&Ne.setAttribute(We,g[We]);return e.content.appendChild(Ne)}e.content.appendChild(U)}}function ef(e,r){if(e.length>1&&!/ /.test(e))return e;for(var a=r,o="",l=0;l<e.length;l++){var d=e.charAt(l);d==" "&&a&&(l==e.length-1||e.charCodeAt(l+1)==32)&&(d="\xA0"),o+=d,a=d==" "}return o}function ns(e,r){return function(a,o,l,d,g,b,w){l=l?l+" cm-force-border":"cm-force-border";for(var O=a.pos,U=O+o.length;;){for(var X=void 0,he=0;he<r.length&&(X=r[he],!(X.to>O&&X.from<=O));he++);if(X.to>=U)return e(a,o,l,d,g,b,w);e(a,o.slice(0,X.to-O),l,d,null,b,w),d=null,o=o.slice(X.to-O),O=X.to}}}function vl(e,r,a,o){var l=!o&&a.widgetNode;l&&e.map.push(e.pos,e.pos+r,l),!o&&e.cm.display.input.needsContentAttribute&&(l||(l=e.content.appendChild(document.createElement("span"))),l.setAttribute("cm-marker",a.id)),l&&(e.cm.display.input.setUneditable(l),e.content.appendChild(l)),e.pos+=r,e.trailingSpace=!1}function tf(e,r,a){var o=e.markedSpans,l=e.text,d=0;if(!o){for(var g=1;g<a.length;g+=2)r.addToken(r,l.slice(d,d=a[g]),Yi(a[g+1],r.cm.options));return}for(var b=l.length,w=0,O=1,U="",X,he,le=0,xe,Ce,Le,Me,Oe;;){if(le==w){xe=Ce=Le=he="",Oe=null,Me=null,le=1/0;for(var Ne=[],We=void 0,Ye=0;Ye<o.length;++Ye){var Ke=o[Ye],vt=Ke.marker;if(vt.type=="bookmark"&&Ke.from==w&&vt.widgetNode)Ne.push(vt);else if(Ke.from<=w&&(Ke.to==null||Ke.to>w||vt.collapsed&&Ke.to==w&&Ke.from==w)){if(Ke.to!=null&&Ke.to!=w&&le>Ke.to&&(le=Ke.to,Ce=""),vt.className&&(xe+=" "+vt.className),vt.css&&(he=(he?he+";":"")+vt.css),vt.startStyle&&Ke.from==w&&(Le+=" "+vt.startStyle),vt.endStyle&&Ke.to==le&&(We||(We=[])).push(vt.endStyle,Ke.to),vt.title&&((Oe||(Oe={})).title=vt.title),vt.attributes)for(var kt in vt.attributes)(Oe||(Oe={}))[kt]=vt.attributes[kt];vt.collapsed&&(!Me||qa(Me.marker,vt)<0)&&(Me=Ke)}else Ke.from>w&&le>Ke.from&&(le=Ke.from)}if(We)for(var ar=0;ar<We.length;ar+=2)We[ar+1]==le&&(Ce+=" "+We[ar]);if(!Me||Me.from==w)for(var Ut=0;Ut<Ne.length;++Ut)vl(r,0,Ne[Ut]);if(Me&&(Me.from||0)==w){if(vl(r,(Me.to==null?b+1:Me.to)-w,Me.marker,Me.from==null),Me.to==null)return;Me.to==w&&(Me=!1)}}if(w>=b)break;for(var Ze=Math.min(b,le);;){if(U){var Lr=w+U.length;if(!Me){var Qt=Lr>Ze?U.slice(0,Ze-w):U;r.addToken(r,Qt,X?X+xe:xe,Le,w+Qt.length==le?Ce:"",he,Oe)}if(Lr>=Ze){U=U.slice(Ze-w),w=Ze;break}w=Lr,Le=""}U=l.slice(d,d=a[O++]),X=Yi(a[O++],r.cm.options)}}}function gl(e,r,a){this.line=r,this.rest=Ju(r),this.size=this.rest?Ct(Je(this.rest))-a+1:1,this.node=this.text=null,this.hidden=$n(e,r)}function ha(e,r,a){for(var o=[],l,d=r;d<a;d=l){var g=new gl(e.doc,Ve(e.doc,d),d);l=d+g.size,o.push(g)}return o}var wi=null;function rf(e){wi?wi.ops.push(e):e.ownsGroup=wi={ops:[e],delayedCallbacks:[]}}function pa(e){var r=e.delayedCallbacks,a=0;do{for(;a<r.length;a++)r[a].call(null);for(var o=0;o<e.ops.length;o++){var l=e.ops[o];if(l.cursorActivityHandlers)for(;l.cursorActivityCalled<l.cursorActivityHandlers.length;)l.cursorActivityHandlers[l.cursorActivityCalled++].call(null,l.cm)}}while(a<r.length)}function nf(e,r){var a=e.ownsGroup;if(a)try{pa(a)}finally{wi=null,r(a)}}var ko=null;function sr(e,r){var a=be(e,r);if(a.length){var o=Array.prototype.slice.call(arguments,2),l;wi?l=wi.delayedCallbacks:ko?l=ko:(l=ko=[],setTimeout(of,0));for(var d=function(b){l.push(function(){return a[b].apply(null,o)})},g=0;g<a.length;++g)d(g)}}function of(){var e=ko;ko=null;for(var r=0;r<e.length;++r)e[r]()}function is(e,r,a,o){for(var l=0;l<r.changes.length;l++){var d=r.changes[l];d=="text"?sf(e,r):d=="gutter"?xr(e,r,a,o):d=="class"?va(e,r):d=="widget"&&lf(e,r,o)}r.changes=null}function Xi(e){return e.node==e.text&&(e.node=G("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),D&&R<8&&(e.node.style.zIndex=2)),e.node}function af(e,r){var a=r.bgClass?r.bgClass+" "+(r.line.bgClass||""):r.line.bgClass;if(a&&(a+=" CodeMirror-linebackground"),r.background)a?r.background.className=a:(r.background.parentNode.removeChild(r.background),r.background=null);else if(a){var o=Xi(r);r.background=o.insertBefore(G("div",null,a),o.firstChild),e.display.input.setUneditable(r.background)}}function os(e,r){var a=e.display.externalMeasured;return a&&a.line==r.line?(e.display.externalMeasured=null,r.measure=a.measure,a.built):pl(e,r)}function sf(e,r){var a=r.text.className,o=os(e,r);r.text==r.node&&(r.node=o.pre),r.text.parentNode.replaceChild(o.pre,r.text),r.text=o.pre,o.bgClass!=r.bgClass||o.textClass!=r.textClass?(r.bgClass=o.bgClass,r.textClass=o.textClass,va(e,r)):a&&(r.text.className=a)}function va(e,r){af(e,r),r.line.wrapClass?Xi(r).className=r.line.wrapClass:r.node!=r.text&&(r.node.className="");var a=r.textClass?r.textClass+" "+(r.line.textClass||""):r.line.textClass;r.text.className=a||""}function xr(e,r,a,o){if(r.gutter&&(r.node.removeChild(r.gutter),r.gutter=null),r.gutterBackground&&(r.node.removeChild(r.gutterBackground),r.gutterBackground=null),r.line.gutterClass){var l=Xi(r);r.gutterBackground=G("div",null,"CodeMirror-gutter-background "+r.line.gutterClass,"left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px; width: "+o.gutterTotalWidth+"px"),e.display.input.setUneditable(r.gutterBackground),l.insertBefore(r.gutterBackground,r.text)}var d=r.line.gutterMarkers;if(e.options.lineNumbers||d){var g=Xi(r),b=r.gutter=G("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px");if(b.setAttribute("aria-hidden","true"),e.display.input.setUneditable(b),g.insertBefore(b,r.text),r.line.gutterClass&&(b.className+=" "+r.line.gutterClass),e.options.lineNumbers&&(!d||!d["CodeMirror-linenumbers"])&&(r.lineNumber=b.appendChild(G("div",_i(e.options,a),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+o.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),d)for(var w=0;w<e.display.gutterSpecs.length;++w){var O=e.display.gutterSpecs[w].className,U=d.hasOwnProperty(O)&&d[O];U&&b.appendChild(G("div",[U],"CodeMirror-gutter-elt","left: "+o.gutterLeft[O]+"px; width: "+o.gutterWidth[O]+"px"))}}}function lf(e,r,a){r.alignable&&(r.alignable=null);for(var o=H("CodeMirror-linewidget"),l=r.node.firstChild,d=void 0;l;l=d)d=l.nextSibling,o.test(l.className)&&r.node.removeChild(l);ml(e,r,a)}function uf(e,r,a,o){var l=os(e,r);return r.text=r.node=l.pre,l.bgClass&&(r.bgClass=l.bgClass),l.textClass&&(r.textClass=l.textClass),va(e,r),xr(e,r,a,o),ml(e,r,o),r.node}function ml(e,r,a){if(yl(e,r.line,r,a,!0),r.rest)for(var o=0;o<r.rest.length;o++)yl(e,r.rest[o],r,a,!1)}function yl(e,r,a,o,l){if(r.widgets)for(var d=Xi(a),g=0,b=r.widgets;g<b.length;++g){var w=b[g],O=G("div",[w.node],"CodeMirror-linewidget"+(w.className?" "+w.className:""));w.handleMouseEvents||O.setAttribute("cm-ignore-events","true"),ff(w,O,a,o),e.display.input.setUneditable(O),l&&w.above?d.insertBefore(O,a.gutter||a.text):d.appendChild(O),sr(w,"redraw")}}function ff(e,r,a,o){if(e.noHScroll){(a.alignable||(a.alignable=[])).push(r);var l=o.wrapperWidth;r.style.left=o.fixedPos+"px",e.coverGutter||(l-=o.gutterTotalWidth,r.style.paddingLeft=o.gutterTotalWidth+"px"),r.style.width=l+"px"}e.coverGutter&&(r.style.zIndex=5,r.style.position="relative",e.noHScroll||(r.style.marginLeft=-o.gutterTotalWidth+"px"))}function Kn(e){if(e.height!=null)return e.height;var r=e.doc.cm;if(!r)return 0;if(!He(document.body,e.node)){var a="position: relative;";e.coverGutter&&(a+="margin-left: -"+r.display.gutters.offsetWidth+"px;"),e.noHScroll&&(a+="width: "+r.display.wrapper.clientWidth+"px;"),ge(r.display.measure,G("div",[e.node],null,a))}return e.height=e.node.parentNode.offsetHeight}function Yn(e,r){for(var a=yr(r);a!=e.wrapper;a=a.parentNode)if(!a||a.nodeType==1&&a.getAttribute("cm-ignore-events")=="true"||a.parentNode==e.sizer&&a!=e.mover)return!0}function Po(e){return e.lineSpace.offsetTop}function Lo(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function bl(e){if(e.cachedPaddingH)return e.cachedPaddingH;var r=ge(e.measure,G("pre","x","CodeMirror-line-like")),a=window.getComputedStyle?window.getComputedStyle(r):r.currentStyle,o={left:parseInt(a.paddingLeft),right:parseInt(a.paddingRight)};return!isNaN(o.left)&&!isNaN(o.right)&&(e.cachedPaddingH=o),o}function Jr(e){return Re-e.display.nativeBarWidth}function xn(e){return e.display.scroller.clientWidth-Jr(e)-e.display.barWidth}function ga(e){return e.display.scroller.clientHeight-Jr(e)-e.display.barHeight}function xl(e,r,a){var o=e.options.lineWrapping,l=o&&xn(e);if(!r.measure.heights||o&&r.measure.width!=l){var d=r.measure.heights=[];if(o){r.measure.width=l;for(var g=r.text.firstChild.getClientRects(),b=0;b<g.length-1;b++){var w=g[b],O=g[b+1];Math.abs(w.bottom-O.bottom)>2&&d.push((w.bottom+O.top)/2-a.top)}}d.push(a.bottom-a.top)}}function Sl(e,r,a){if(e.line==r)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var o=0;o<e.rest.length;o++)if(e.rest[o]==r)return{map:e.measure.maps[o],cache:e.measure.caches[o]};for(var l=0;l<e.rest.length;l++)if(Ct(e.rest[l])>a)return{map:e.measure.maps[l],cache:e.measure.caches[l],before:!0}}}function cf(e,r){r=bn(r);var a=Ct(r),o=e.display.externalMeasured=new gl(e.doc,r,a);o.lineN=a;var l=o.built=pl(e,o);return o.text=l.pre,ge(e.display.lineMeasure,l.pre),o}function Ji(e,r,a,o){return on(e,Ci(e,r),a,o)}function ma(e,r){if(r>=e.display.viewFrom&&r<e.display.viewTo)return e.display.view[Ei(e,r)];var a=e.display.externalMeasured;if(a&&r>=a.lineN&&r<a.lineN+a.size)return a}function Ci(e,r){var a=Ct(r),o=ma(e,a);o&&!o.text?o=null:o&&o.changes&&(is(e,o,a,vs(e)),e.curOp.forceUpdate=!0),o||(o=cf(e,r));var l=Sl(o,r,a);return{line:r,view:o,rect:null,map:l.map,cache:l.cache,before:l.before,hasHeights:!1}}function on(e,r,a,o,l){r.before&&(a=-1);var d=a+(o||""),g;return r.cache.hasOwnProperty(d)?g=r.cache[d]:(r.rect||(r.rect=r.view.text.getBoundingClientRect()),r.hasHeights||(xl(e,r.view,r.rect),r.hasHeights=!0),g=df(e,r,a,o),g.bogus||(r.cache[d]=g)),{left:g.left,right:g.right,top:l?g.rtop:g.top,bottom:l?g.rbottom:g.bottom}}var as={left:0,right:0,top:0,bottom:0};function ss(e,r,a){for(var o,l,d,g,b,w,O=0;O<e.length;O+=3)if(b=e[O],w=e[O+1],r<b?(l=0,d=1,g="left"):r<w?(l=r-b,d=l+1):(O==e.length-3||r==w&&e[O+3]>r)&&(d=w-b,l=d-1,r>=w&&(g="right")),l!=null){if(o=e[O+2],b==w&&a==(o.insertLeft?"left":"right")&&(g=a),a=="left"&&l==0)for(;O&&e[O-2]==e[O-3]&&e[O-1].insertLeft;)o=e[(O-=3)+2],g="left";if(a=="right"&&l==w-b)for(;O<e.length-3&&e[O+3]==e[O+4]&&!e[O+5].insertLeft;)o=e[(O+=3)+2],g="right";break}return{node:o,start:l,end:d,collapse:g,coverStart:b,coverEnd:w}}function Qi(e,r){var a=as;if(r=="left")for(var o=0;o<e.length&&(a=e[o]).left==a.right;o++);else for(var l=e.length-1;l>=0&&(a=e[l]).left==a.right;l--);return a}function df(e,r,a,o){var l=ss(r.map,a,o),d=l.node,g=l.start,b=l.end,w=l.collapse,O;if(d.nodeType==3){for(var U=0;U<4;U++){for(;g&&vn(r.line.text.charAt(l.coverStart+g));)--g;for(;l.coverStart+b<l.coverEnd&&vn(r.line.text.charAt(l.coverStart+b));)++b;if(D&&R<9&&g==0&&b==l.coverEnd-l.coverStart?O=d.parentNode.getBoundingClientRect():O=Qi(ee(d,g,b).getClientRects(),o),O.left||O.right||g==0)break;b=g,g=g-1,w="right"}D&&R<11&&(O=hf(e.display.measure,O))}else{g>0&&(w=o="right");var X;e.options.lineWrapping&&(X=d.getClientRects()).length>1?O=X[o=="right"?X.length-1:0]:O=d.getBoundingClientRect()}if(D&&R<9&&!g&&(!O||!O.left&&!O.right)){var he=d.parentNode.getClientRects()[0];he?O={left:he.left,right:he.left+qi(e.display),top:he.top,bottom:he.bottom}:O=as}for(var le=O.top-r.rect.top,xe=O.bottom-r.rect.top,Ce=(le+xe)/2,Le=r.view.measure.heights,Me=0;Me<Le.length-1&&!(Ce<Le[Me]);Me++);var Oe=Me?Le[Me-1]:0,Ne=Le[Me],We={left:(w=="right"?O.right:O.left)-r.rect.left,right:(w=="left"?O.left:O.right)-r.rect.left,top:Oe,bottom:Ne};return!O.left&&!O.right&&(We.bogus=!0),e.options.singleCursorHeightPerLine||(We.rtop=le,We.rbottom=xe),We}function hf(e,r){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ir(e))return r;var a=screen.logicalXDPI/screen.deviceXDPI,o=screen.logicalYDPI/screen.deviceYDPI;return{left:r.left*a,right:r.right*a,top:r.top*o,bottom:r.bottom*o}}function ls(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var r=0;r<e.rest.length;r++)e.measure.caches[r]={}}function us(e){e.display.externalMeasure=null,ce(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)ls(e.display.view[r])}function Io(e){us(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function fs(e){return Z&&M?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function wl(e){return Z&&M?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function cs(e){var r=bn(e),a=r.widgets,o=0;if(a)for(var l=0;l<a.length;++l)a[l].above&&(o+=Kn(a[l]));return o}function Mo(e,r,a,o,l){if(!l){var d=cs(r);a.top+=d,a.bottom+=d}if(o=="line")return a;o||(o="local");var g=Gn(r);if(o=="local"?g+=Po(e.display):g-=e.display.viewOffset,o=="page"||o=="window"){var b=e.display.lineSpace.getBoundingClientRect();g+=b.top+(o=="window"?0:wl(at(e)));var w=b.left+(o=="window"?0:fs(at(e)));a.left+=w,a.right+=w}return a.top+=g,a.bottom+=g,a}function Cl(e,r,a){if(a=="div")return r;var o=r.left,l=r.top;if(a=="page")o-=fs(at(e)),l-=wl(at(e));else if(a=="local"||!a){var d=e.display.sizer.getBoundingClientRect();o+=d.left,l+=d.top}var g=e.display.lineSpace.getBoundingClientRect();return{left:o-g.left,top:l-g.top}}function ya(e,r,a,o,l){return o||(o=Ve(e.doc,r.line)),Mo(e,o,Ji(e,o,r.ch,l),a)}function an(e,r,a,o,l,d){o=o||Ve(e.doc,r.line),l||(l=Ci(e,o));function g(xe,Ce){var Le=on(e,l,xe,Ce?"right":"left",d);return Ce?Le.left=Le.right:Le.right=Le.left,Mo(e,o,Le,a)}var b=Qe(o,e.doc.direction),w=r.ch,O=r.sticky;if(w>=o.text.length?(w=o.text.length,O="before"):w<=0&&(w=0,O="after"),!b)return g(O=="before"?w-1:w,O=="before");function U(xe,Ce,Le){var Me=b[Ce],Oe=Me.level==1;return g(Le?xe-1:xe,Oe!=Le)}var X=mt(b,w,O),he=Rt,le=U(w,X,O=="before");return he!=null&&(le.other=U(w,he,O!="before")),le}function Dn(e,r){var a=0;r=$e(e.doc,r),e.options.lineWrapping||(a=qi(e.display)*r.ch);var o=Ve(e.doc,r.line),l=Gn(o)+Po(e.display);return{left:a,right:a,top:l,bottom:l+o.height}}function ds(e,r,a,o,l){var d=A(e,r,a);return d.xRel=l,o&&(d.outside=o),d}function No(e,r,a){var o=e.doc;if(a+=e.display.viewOffset,a<0)return ds(o.first,0,null,-1,-1);var l=_n(o,a),d=o.first+o.size-1;if(l>d)return ds(o.first+o.size-1,Ve(o,d).text.length,null,1,1);r<0&&(r=0);for(var g=Ve(o,l);;){var b=ps(e,g,l,r,a),w=ul(g,b.ch+(b.xRel>0||b.outside>0?1:0));if(!w)return b;var O=w.find(1);if(O.line==l)return O;g=Ve(o,l=O.line)}}function Al(e,r,a,o){o-=cs(r);var l=r.text.length,d=gr(function(g){return on(e,a,g-1).bottom<=o},l,0);return l=gr(function(g){return on(e,a,g).top>o},d,l),{begin:d,end:l}}function Ol(e,r,a,o){a||(a=Ci(e,r));var l=Mo(e,r,on(e,a,o),"line").top;return Al(e,r,a,l)}function hs(e,r,a,o){return e.bottom<=a?!1:e.top>a?!0:(o?e.left:e.right)>r}function ps(e,r,a,o,l){l-=Gn(r);var d=Ci(e,r),g=cs(r),b=0,w=r.text.length,O=!0,U=Qe(r,e.doc.direction);if(U){var X=(e.options.lineWrapping?vf:pf)(e,r,a,d,U,o,l);O=X.level!=1,b=O?X.from:X.to-1,w=O?X.to:X.from-1}var he=null,le=null,xe=gr(function(Ye){var Ke=on(e,d,Ye);return Ke.top+=g,Ke.bottom+=g,hs(Ke,o,l,!1)?(Ke.top<=l&&Ke.left<=o&&(he=Ye,le=Ke),!0):!1},b,w),Ce,Le,Me=!1;if(le){var Oe=o-le.left<le.right-o,Ne=Oe==O;xe=he+(Ne?0:1),Le=Ne?"after":"before",Ce=Oe?le.left:le.right}else{!O&&(xe==w||xe==b)&&xe++,Le=xe==0?"after":xe==r.text.length?"before":on(e,d,xe-(O?1:0)).bottom+g<=l==O?"after":"before";var We=an(e,A(a,xe,Le),"line",r,d);Ce=We.left,Me=l<We.top?-1:l>=We.bottom?1:0}return xe=Ur(r.text,xe,1),ds(a,xe,Le,Me,o-Ce)}function pf(e,r,a,o,l,d,g){var b=gr(function(X){var he=l[X],le=he.level!=1;return hs(an(e,A(a,le?he.to:he.from,le?"before":"after"),"line",r,o),d,g,!0)},0,l.length-1),w=l[b];if(b>0){var O=w.level!=1,U=an(e,A(a,O?w.from:w.to,O?"after":"before"),"line",r,o);hs(U,d,g,!0)&&U.top>g&&(w=l[b-1])}return w}function vf(e,r,a,o,l,d,g){var b=Al(e,r,o,g),w=b.begin,O=b.end;/\s/.test(r.text.charAt(O-1))&&O--;for(var U=null,X=null,he=0;he<l.length;he++){var le=l[he];if(!(le.from>=O||le.to<=w)){var xe=le.level!=1,Ce=on(e,o,xe?Math.min(O,le.to)-1:Math.max(w,le.from)).right,Le=Ce<d?d-Ce+1e9:Ce-d;(!U||X>Le)&&(U=le,X=Le)}}return U||(U=l[l.length-1]),U.from<w&&(U={from:w,to:U.to,level:U.level}),U.to>O&&(U={from:U.from,to:O,level:U.level}),U}var Ai;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ai==null){Ai=G("pre",null,"CodeMirror-line-like");for(var r=0;r<49;++r)Ai.appendChild(document.createTextNode("x")),Ai.appendChild(G("br"));Ai.appendChild(document.createTextNode("x"))}ge(e.measure,Ai);var a=Ai.offsetHeight/50;return a>3&&(e.cachedTextHeight=a),ce(e.measure),a||1}function qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var r=G("span","xxxxxxxxxx"),a=G("pre",[r],"CodeMirror-line-like");ge(e.measure,a);var o=r.getBoundingClientRect(),l=(o.right-o.left)/10;return l>2&&(e.cachedCharWidth=l),l||10}function vs(e){for(var r=e.display,a={},o={},l=r.gutters.clientLeft,d=r.gutters.firstChild,g=0;d;d=d.nextSibling,++g){var b=e.display.gutterSpecs[g].className;a[b]=d.offsetLeft+d.clientLeft+l,o[b]=d.clientWidth}return{fixedPos:gs(r),gutterTotalWidth:r.gutters.offsetWidth,gutterLeft:a,gutterWidth:o,wrapperWidth:r.wrapper.clientWidth}}function gs(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function El(e){var r=Zi(e.display),a=e.options.lineWrapping,o=a&&Math.max(5,e.display.scroller.clientWidth/qi(e.display)-3);return function(l){if($n(e.doc,l))return 0;var d=0;if(l.widgets)for(var g=0;g<l.widgets.length;g++)l.widgets[g].height&&(d+=l.widgets[g].height);return a?d+(Math.ceil(l.text.length/o)||1)*r:d+r}}function ms(e){var r=e.doc,a=El(e);r.iter(function(o){var l=a(o);l!=o.height&&rn(o,l)})}function Oi(e,r,a,o){var l=e.display;if(!a&&yr(r).getAttribute("cm-not-content")=="true")return null;var d,g,b=l.lineSpace.getBoundingClientRect();try{d=r.clientX-b.left,g=r.clientY-b.top}catch{return null}var w=No(e,d,g),O;if(o&&w.xRel>0&&(O=Ve(e.doc,w.line).text).length==w.ch){var U=nt(O,O.length,e.options.tabSize)-O.length;w=A(w.line,Math.max(0,Math.round((d-bl(e.display).left)/qi(e.display))-U))}return w}function Ei(e,r){if(r>=e.display.viewTo||(r-=e.display.viewFrom,r<0))return null;for(var a=e.display.view,o=0;o<a.length;o++)if(r-=a[o].size,r<0)return o}function Dr(e,r,a,o){r==null&&(r=e.doc.first),a==null&&(a=e.doc.first+e.doc.size),o||(o=0);var l=e.display;if(o&&a<l.viewTo&&(l.updateLineNumbers==null||l.updateLineNumbers>r)&&(l.updateLineNumbers=r),e.curOp.viewChanged=!0,r>=l.viewTo)Nn&&oi(e.doc,r)<l.viewTo&&si(e);else if(a<=l.viewFrom)Nn&&cl(e.doc,a+o)>l.viewFrom?si(e):(l.viewFrom+=o,l.viewTo+=o);else if(r<=l.viewFrom&&a>=l.viewTo)si(e);else if(r<=l.viewFrom){var d=ba(e,a,a+o,1);d?(l.view=l.view.slice(d.index),l.viewFrom=d.lineN,l.viewTo+=o):si(e)}else if(a>=l.viewTo){var g=ba(e,r,r,-1);g?(l.view=l.view.slice(0,g.index),l.viewTo=g.lineN):si(e)}else{var b=ba(e,r,r,-1),w=ba(e,a,a+o,1);b&&w?(l.view=l.view.slice(0,b.index).concat(ha(e,b.lineN,w.lineN)).concat(l.view.slice(w.index)),l.viewTo+=o):si(e)}var O=l.externalMeasured;O&&(a<O.lineN?O.lineN+=o:r<O.lineN+O.size&&(l.externalMeasured=null))}function ai(e,r,a){e.curOp.viewChanged=!0;var o=e.display,l=e.display.externalMeasured;if(l&&r>=l.lineN&&r<l.lineN+l.size&&(o.externalMeasured=null),!(r<o.viewFrom||r>=o.viewTo)){var d=o.view[Ei(e,r)];if(d.node!=null){var g=d.changes||(d.changes=[]);Fe(g,a)==-1&&g.push(a)}}}function si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ba(e,r,a,o){var l=Ei(e,r),d,g=e.display.view;if(!Nn||a==e.doc.first+e.doc.size)return{index:l,lineN:a};for(var b=e.display.viewFrom,w=0;w<l;w++)b+=g[w].size;if(b!=r){if(o>0){if(l==g.length-1)return null;d=b+g[l].size-r,l++}else d=b-r;r+=d,a+=d}for(;oi(e.doc,a)!=a;){if(l==(o<0?0:g.length-1))return null;a+=o*g[l-(o<0?1:0)].size,l+=o}return{index:l,lineN:a}}function gf(e,r,a){var o=e.display,l=o.view;l.length==0||r>=o.viewTo||a<=o.viewFrom?(o.view=ha(e,r,a),o.viewFrom=r):(o.viewFrom>r?o.view=ha(e,r,o.viewFrom).concat(o.view):o.viewFrom<r&&(o.view=o.view.slice(Ei(e,r))),o.viewFrom=r,o.viewTo<a?o.view=o.view.concat(ha(e,o.viewTo,a)):o.viewTo>a&&(o.view=o.view.slice(0,Ei(e,a)))),o.viewTo=a}function Tl(e){for(var r=e.display.view,a=0,o=0;o<r.length;o++){var l=r[o];!l.hidden&&(!l.node||l.changes)&&++a}return a}function eo(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Do(e,r){r===void 0&&(r=!0);var a=e.doc,o={},l=o.cursors=document.createDocumentFragment(),d=o.selection=document.createDocumentFragment(),g=e.options.$customCursor;g&&(r=!0);for(var b=0;b<a.sel.ranges.length;b++)if(!(!r&&b==a.sel.primIndex)){var w=a.sel.ranges[b];if(!(w.from().line>=e.display.viewTo||w.to().line<e.display.viewFrom)){var O=w.empty();if(g){var U=g(e,w);U&&xa(e,U,l)}else(O||e.options.showCursorWhenSelecting)&&xa(e,w.head,l);O||mf(e,w,d)}}return o}function xa(e,r,a){var o=an(e,r,"div",null,null,!e.options.singleCursorHeightPerLine),l=a.appendChild(G("div","\xA0","CodeMirror-cursor"));if(l.style.left=o.left+"px",l.style.top=o.top+"px",l.style.height=Math.max(0,o.bottom-o.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var d=ya(e,r,"div",null,null),g=d.right-d.left;l.style.width=(g>0?g:e.defaultCharWidth())+"px"}if(o.other){var b=a.appendChild(G("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));b.style.display="",b.style.left=o.other.left+"px",b.style.top=o.other.top+"px",b.style.height=(o.other.bottom-o.other.top)*.85+"px"}}function Sa(e,r){return e.top-r.top||e.left-r.left}function mf(e,r,a){var o=e.display,l=e.doc,d=document.createDocumentFragment(),g=bl(e.display),b=g.left,w=Math.max(o.sizerWidth,xn(e)-o.sizer.offsetLeft)-g.right,O=l.direction=="ltr";function U(Ne,We,Ye,Ke){We<0&&(We=0),We=Math.round(We),Ke=Math.round(Ke),d.appendChild(G("div",null,"CodeMirror-selected","position: absolute; left: "+Ne+`px;
18
- top: `+We+"px; width: "+(Ye??w-Ne)+`px;
19
- height: `+(Ke-We)+"px"))}function X(Ne,We,Ye){var Ke=Ve(l,Ne),vt=Ke.text.length,kt,ar;function Ut(Qt,Yt){return ya(e,A(Ne,Qt),"div",Ke,Yt)}function Ze(Qt,Yt,Xt){var Mt=Ol(e,Ke,null,Qt),zt=Yt=="ltr"==(Xt=="after")?"left":"right",bt=Xt=="after"?Mt.begin:Mt.end-(/\s/.test(Ke.text.charAt(Mt.end-1))?2:1);return Ut(bt,zt)[zt]}var Lr=Qe(Ke,l.direction);return Er(Lr,We||0,Ye??vt,function(Qt,Yt,Xt,Mt){var zt=Xt=="ltr",bt=Ut(Qt,zt?"left":"right"),Zt=Ut(Yt-1,zt?"right":"left"),Qn=We==null&&Qt==0,fn=Ye==null&&Yt==vt,ir=Mt==0,$r=!Lr||Mt==Lr.length-1;if(Zt.top-bt.top<=3){var or=(O?Qn:fn)&&ir,bo=(O?fn:Qn)&&$r,Fn=or?b:(zt?bt:Zt).left,xo=bo?w:(zt?Zt:bt).right;U(Fn,bt.top,xo-Fn,bt.bottom)}else{var pi,wr,Zn,Ua;zt?(pi=O&&Qn&&ir?b:bt.left,wr=O?w:Ze(Qt,Xt,"before"),Zn=O?b:Ze(Yt,Xt,"after"),Ua=O&&fn&&$r?w:Zt.right):(pi=O?Ze(Qt,Xt,"before"):b,wr=!O&&Qn&&ir?w:bt.right,Zn=!O&&fn&&$r?b:Zt.left,Ua=O?Ze(Yt,Xt,"after"):w),U(pi,bt.top,wr-pi,bt.bottom),bt.bottom<Zt.top&&U(b,bt.bottom,null,Zt.top),U(Zn,Zt.top,Ua-Zn,Zt.bottom)}(!kt||Sa(bt,kt)<0)&&(kt=bt),Sa(Zt,kt)<0&&(kt=Zt),(!ar||Sa(bt,ar)<0)&&(ar=bt),Sa(Zt,ar)<0&&(ar=Zt)}),{start:kt,end:ar}}var he=r.from(),le=r.to();if(he.line==le.line)X(he.line,he.ch,le.ch);else{var xe=Ve(l,he.line),Ce=Ve(l,le.line),Le=bn(xe)==bn(Ce),Me=X(he.line,he.ch,Le?xe.text.length+1:null).end,Oe=X(le.line,Le?0:null,le.ch).start;Le&&(Me.top<Oe.top-2?(U(Me.right,Me.top,null,Me.bottom),U(b,Oe.top,Oe.left,Oe.bottom)):U(Me.right,Me.top,Oe.left-Me.right,Me.bottom)),Me.bottom<Oe.top&&U(b,Me.bottom,null,Oe.top)}a.appendChild(d)}function li(e){if(e.state.focused){var r=e.display;clearInterval(r.blinker);var a=!0;r.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?r.blinker=setInterval(function(){e.hasFocus()||to(e),r.cursorDiv.style.visibility=(a=!a)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(r.cursorDiv.style.visibility="hidden")}}function wa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||bs(e))}function ys(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&to(e))},100)}function bs(e,r){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(tt(e,"focus",e,r),e.state.focused=!0,ze(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),V&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),li(e))}function to(e,r){e.state.delayingBlurEvent||(e.state.focused&&(tt(e,"blur",e,r),e.state.focused=!1,Y(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function xs(e){for(var r=e.display,a=r.lineDiv.offsetTop,o=Math.max(0,r.scroller.getBoundingClientRect().top),l=r.lineDiv.getBoundingClientRect().top,d=0,g=0;g<r.view.length;g++){var b=r.view[g],w=e.options.lineWrapping,O=void 0,U=0;if(!b.hidden){if(l+=b.line.height,D&&R<8){var X=b.node.offsetTop+b.node.offsetHeight;O=X-a,a=X}else{var he=b.node.getBoundingClientRect();O=he.bottom-he.top,!w&&b.text.firstChild&&(U=b.text.firstChild.getBoundingClientRect().right-he.left-1)}var le=b.line.height-O;if((le>.005||le<-.005)&&(l<o&&(d-=le),rn(b.line,O),kl(b.line),b.rest))for(var xe=0;xe<b.rest.length;xe++)kl(b.rest[xe]);if(U>e.display.sizerWidth){var Ce=Math.ceil(U/qi(e.display));Ce>e.display.maxLineLength&&(e.display.maxLineLength=Ce,e.display.maxLine=b.line,e.display.maxLineChanged=!0)}}}Math.abs(d)>2&&(r.scroller.scrollTop+=d)}function kl(e){if(e.widgets)for(var r=0;r<e.widgets.length;++r){var a=e.widgets[r],o=a.node.parentNode;o&&(a.height=o.offsetHeight)}}function ro(e,r,a){var o=a&&a.top!=null?Math.max(0,a.top):e.scroller.scrollTop;o=Math.floor(o-Po(e));var l=a&&a.bottom!=null?a.bottom:o+e.wrapper.clientHeight,d=_n(r,o),g=_n(r,l);if(a&&a.ensure){var b=a.ensure.from.line,w=a.ensure.to.line;b<d?(d=b,g=_n(r,Gn(Ve(r,b))+e.wrapper.clientHeight)):Math.min(w,r.lastLine())>=g&&(d=_n(r,Gn(Ve(r,w))-e.wrapper.clientHeight),g=w)}return{from:d,to:Math.max(g,d+1)}}function yf(e,r){if(!ct(e,"scrollCursorIntoView")){var a=e.display,o=a.sizer.getBoundingClientRect(),l=null,d=a.wrapper.ownerDocument;if(r.top+o.top<0?l=!0:r.bottom+o.top>(d.defaultView.innerHeight||d.documentElement.clientHeight)&&(l=!1),l!=null&&!k){var g=G("div","\u200B",null,`position: absolute;
20
- top: `+(r.top-a.viewOffset-Po(e.display))+`px;
21
- height: `+(r.bottom-r.top+Jr(e)+a.barHeight)+`px;
22
- left: `+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;");e.display.lineSpace.appendChild(g),g.scrollIntoView(l),e.display.lineSpace.removeChild(g)}}}function bf(e,r,a,o){o==null&&(o=0);var l;!e.options.lineWrapping&&r==a&&(a=r.sticky=="before"?A(r.line,r.ch+1,"before"):r,r=r.ch?A(r.line,r.sticky=="before"?r.ch-1:r.ch,"after"):r);for(var d=0;d<5;d++){var g=!1,b=an(e,r),w=!a||a==r?b:an(e,a);l={left:Math.min(b.left,w.left),top:Math.min(b.top,w.top)-o,right:Math.max(b.left,w.left),bottom:Math.max(b.bottom,w.bottom)+o};var O=Ss(e,l),U=e.doc.scrollTop,X=e.doc.scrollLeft;if(O.scrollTop!=null&&(io(e,O.scrollTop),Math.abs(e.doc.scrollTop-U)>1&&(g=!0)),O.scrollLeft!=null&&(ki(e,O.scrollLeft),Math.abs(e.doc.scrollLeft-X)>1&&(g=!0)),!g)break}return l}function xf(e,r){var a=Ss(e,r);a.scrollTop!=null&&io(e,a.scrollTop),a.scrollLeft!=null&&ki(e,a.scrollLeft)}function Ss(e,r){var a=e.display,o=Zi(e.display);r.top<0&&(r.top=0);var l=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:a.scroller.scrollTop,d=ga(e),g={};r.bottom-r.top>d&&(r.bottom=r.top+d);var b=e.doc.height+Lo(a),w=r.top<o,O=r.bottom>b-o;if(r.top<l)g.scrollTop=w?0:r.top;else if(r.bottom>l+d){var U=Math.min(r.top,(O?b:r.bottom)-d);U!=l&&(g.scrollTop=U)}var X=e.options.fixedGutter?0:a.gutters.offsetWidth,he=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:a.scroller.scrollLeft-X,le=xn(e)-a.gutters.offsetWidth,xe=r.right-r.left>le;return xe&&(r.right=r.left+le),r.left<10?g.scrollLeft=0:r.left<he?g.scrollLeft=Math.max(0,r.left+X-(xe?0:10)):r.right>le+he-3&&(g.scrollLeft=r.right+(xe?0:10)-le),g}function ws(e,r){r!=null&&(Ca(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+r)}function no(e){Ca(e);var r=e.getCursor();e.curOp.scrollToPos={from:r,to:r,margin:e.options.cursorScrollMargin}}function Ti(e,r,a){(r!=null||a!=null)&&Ca(e),r!=null&&(e.curOp.scrollLeft=r),a!=null&&(e.curOp.scrollTop=a)}function Pl(e,r){Ca(e),e.curOp.scrollToPos=r}function Ca(e){var r=e.curOp.scrollToPos;if(r){e.curOp.scrollToPos=null;var a=Dn(e,r.from),o=Dn(e,r.to);Ll(e,a,o,r.margin)}}function Ll(e,r,a,o){var l=Ss(e,{left:Math.min(r.left,a.left),top:Math.min(r.top,a.top)-o,right:Math.max(r.right,a.right),bottom:Math.max(r.bottom,a.bottom)+o});Ti(e,l.scrollLeft,l.scrollTop)}function io(e,r){Math.abs(e.doc.scrollTop-r)<2||(v||Os(e,{top:r}),Cs(e,r,!0),v&&Os(e),Fo(e,100))}function Cs(e,r,a){r=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,r)),!(e.display.scroller.scrollTop==r&&!a)&&(e.doc.scrollTop=r,e.display.scrollbars.setScrollTop(r),e.display.scroller.scrollTop!=r&&(e.display.scroller.scrollTop=r))}function ki(e,r,a,o){r=Math.max(0,Math.min(r,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((a?r==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-r)<2)&&!o)&&(e.doc.scrollLeft=r,Bl(e),e.display.scroller.scrollLeft!=r&&(e.display.scroller.scrollLeft=r),e.display.scrollbars.setScrollLeft(r))}function oo(e){var r=e.display,a=r.gutters.offsetWidth,o=Math.round(e.doc.height+Lo(e.display));return{clientHeight:r.scroller.clientHeight,viewHeight:r.wrapper.clientHeight,scrollWidth:r.scroller.scrollWidth,clientWidth:r.scroller.clientWidth,viewWidth:r.wrapper.clientWidth,barLeft:e.options.fixedGutter?a:0,docHeight:o,scrollHeight:o+Jr(e)+r.barHeight,nativeBarWidth:r.nativeBarWidth,gutterWidth:a}}var ui=function(e,r,a){this.cm=a;var o=this.vert=G("div",[G("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),l=this.horiz=G("div",[G("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");o.tabIndex=l.tabIndex=-1,e(o),e(l),ne(o,"scroll",function(){o.clientHeight&&r(o.scrollTop,"vertical")}),ne(l,"scroll",function(){l.clientWidth&&r(l.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,D&&R<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ui.prototype.update=function(e){var r=e.scrollWidth>e.clientWidth+1,a=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;if(a){this.vert.style.display="block",this.vert.style.bottom=r?o+"px":"0";var l=e.viewHeight-(r?o:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+l)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(r){this.horiz.style.display="block",this.horiz.style.right=a?o+"px":"0",this.horiz.style.left=e.barLeft+"px";var d=e.viewWidth-e.barLeft-(a?o:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+d)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(o==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:a?o:0,bottom:r?o:0}},ui.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ui.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ui.prototype.zeroWidthHack=function(){var e=I&&!$?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ue,this.disableVert=new Ue},ui.prototype.enableZeroWidthBar=function(e,r,a){e.style.visibility="";function o(){var l=e.getBoundingClientRect(),d=a=="vert"?document.elementFromPoint(l.right-1,(l.top+l.bottom)/2):document.elementFromPoint((l.right+l.left)/2,l.bottom-1);d!=e?e.style.visibility="hidden":r.set(1e3,o)}r.set(1e3,o)},ui.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Aa=function(){};Aa.prototype.update=function(){return{bottom:0,right:0}},Aa.prototype.setScrollLeft=function(){},Aa.prototype.setScrollTop=function(){},Aa.prototype.clear=function(){};function ao(e,r){r||(r=oo(e));var a=e.display.barWidth,o=e.display.barHeight;Il(e,r);for(var l=0;l<4&&a!=e.display.barWidth||o!=e.display.barHeight;l++)a!=e.display.barWidth&&e.options.lineWrapping&&xs(e),Il(e,oo(e)),a=e.display.barWidth,o=e.display.barHeight}function Il(e,r){var a=e.display,o=a.scrollbars.update(r);a.sizer.style.paddingRight=(a.barWidth=o.right)+"px",a.sizer.style.paddingBottom=(a.barHeight=o.bottom)+"px",a.heightForcer.style.borderBottom=o.bottom+"px solid transparent",o.right&&o.bottom?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=o.bottom+"px",a.scrollbarFiller.style.width=o.right+"px"):a.scrollbarFiller.style.display="",o.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(a.gutterFiller.style.display="block",a.gutterFiller.style.height=o.bottom+"px",a.gutterFiller.style.width=r.gutterWidth+"px"):a.gutterFiller.style.display=""}var Ml={native:ui,null:Aa};function Nl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Y(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ml[e.options.scrollbarStyle](function(r){e.display.wrapper.insertBefore(r,e.display.scrollbarFiller),ne(r,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),r.setAttribute("cm-not-content","true")},function(r,a){a=="horizontal"?ki(e,r):io(e,r)},e),e.display.scrollbars.addClass&&ze(e.display.wrapper,e.display.scrollbars.addClass)}var Sf=0;function Pi(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:++Sf,markArrays:null},rf(e.curOp)}function Li(e){var r=e.curOp;r&&nf(r,function(a){for(var o=0;o<a.ops.length;o++)a.ops[o].cm.curOp=null;Oa(a)})}function Oa(e){for(var r=e.ops,a=0;a<r.length;a++)wf(r[a]);for(var o=0;o<r.length;o++)Cf(r[o]);for(var l=0;l<r.length;l++)Af(r[l]);for(var d=0;d<r.length;d++)Of(r[d]);for(var g=0;g<r.length;g++)Ef(r[g])}function wf(e){var r=e.cm,a=r.display;Dl(r),e.updateMaxLine&&ts(r),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<a.viewFrom||e.scrollToPos.to.line>=a.viewTo)||a.maxLineChanged&&r.options.lineWrapping,e.update=e.mustUpdate&&new Ea(r,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Cf(e){e.updatedDisplay=e.mustUpdate&&Fl(e.cm,e.update)}function Af(e){var r=e.cm,a=r.display;e.updatedDisplay&&xs(r),e.barMeasure=oo(r),a.maxLineChanged&&!r.options.lineWrapping&&(e.adjustWidthTo=Ji(r,a.maxLine,a.maxLine.text.length).left+3,r.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(a.scroller.clientWidth,a.sizer.offsetLeft+e.adjustWidthTo+Jr(r)+r.display.barWidth),e.maxScrollLeft=Math.max(0,a.sizer.offsetLeft+e.adjustWidthTo-xn(r))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=a.input.prepareSelection())}function Of(e){var r=e.cm;e.adjustWidthTo!=null&&(r.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<r.doc.scrollLeft&&ki(r,Math.min(r.display.scroller.scrollLeft,e.maxScrollLeft),!0),r.display.maxLineChanged=!1);var a=e.focus&&e.focus==_e(at(r));e.preparedSelection&&r.display.input.showSelection(e.preparedSelection,a),(e.updatedDisplay||e.startHeight!=r.doc.height)&&ao(r,e.barMeasure),e.updatedDisplay&&Rl(r,e.barMeasure),e.selectionChanged&&li(r),r.state.focused&&e.updateInput&&r.display.input.reset(e.typing),a&&wa(e.cm)}function Ef(e){var r=e.cm,a=r.display,o=r.doc;if(e.updatedDisplay&&As(r,e.update),a.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(a.wheelStartX=a.wheelStartY=null),e.scrollTop!=null&&Cs(r,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ki(r,e.scrollLeft,!0,!0),e.scrollToPos){var l=bf(r,$e(o,e.scrollToPos.from),$e(o,e.scrollToPos.to),e.scrollToPos.margin);yf(r,l)}var d=e.maybeHiddenMarkers,g=e.maybeUnhiddenMarkers;if(d)for(var b=0;b<d.length;++b)d[b].lines.length||tt(d[b],"hide");if(g)for(var w=0;w<g.length;++w)g[w].lines.length&&tt(g[w],"unhide");a.wrapper.offsetHeight&&(o.scrollTop=r.display.scroller.scrollTop),e.changeObjs&&tt(r,"changes",r,e.changeObjs),e.update&&e.update.finish()}function Vr(e,r){if(e.curOp)return r();Pi(e);try{return r()}finally{Li(e)}}function lr(e,r){return function(){if(e.curOp)return r.apply(e,arguments);Pi(e);try{return r.apply(e,arguments)}finally{Li(e)}}}function Sr(e){return function(){if(this.curOp)return e.apply(this,arguments);Pi(this);try{return e.apply(this,arguments)}finally{Li(this)}}}function ur(e){return function(){var r=this.cm;if(!r||r.curOp)return e.apply(this,arguments);Pi(r);try{return e.apply(this,arguments)}finally{Li(r)}}}function Fo(e,r){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(r,ht(Tf,e))}function Tf(e){var r=e.doc;if(!(r.highlightFrontier>=e.display.viewTo)){var a=+new Date+e.options.workTime,o=Vi(e,r.highlightFrontier),l=[];r.iter(o.line,Math.min(r.first+r.size,e.display.viewTo+500),function(d){if(o.line>=e.display.viewFrom){var g=d.styles,b=d.text.length>e.options.maxHighlightLength?tn(r.mode,o.state):null,w=el(e,d,o,!0);b&&(o.state=b),d.styles=w.styles;var O=d.styleClasses,U=w.classes;U?d.styleClasses=U:O&&(d.styleClasses=null);for(var X=!g||g.length!=d.styles.length||O!=U&&(!O||!U||O.bgClass!=U.bgClass||O.textClass!=U.textClass),he=0;!X&&he<g.length;++he)X=g[he]!=d.styles[he];X&&l.push(o.line),d.stateAfter=o.save(),o.nextLine()}else d.text.length<=e.options.maxHighlightLength&&aa(e,d.text,o),d.stateAfter=o.line%5==0?o.save():null,o.nextLine();if(+new Date>a)return Fo(e,e.options.workDelay),!0}),r.highlightFrontier=o.line,r.modeFrontier=Math.max(r.modeFrontier,o.line),l.length&&Vr(e,function(){for(var d=0;d<l.length;d++)ai(e,l[d],"text")})}}var Ea=function(e,r,a){var o=e.display;this.viewport=r,this.visible=ro(o,e.doc,r),this.editorIsHidden=!o.wrapper.offsetWidth,this.wrapperHeight=o.wrapper.clientHeight,this.wrapperWidth=o.wrapper.clientWidth,this.oldDisplayWidth=xn(e),this.force=a,this.dims=vs(e),this.events=[]};Ea.prototype.signal=function(e,r){_t(e,r)&&this.events.push(arguments)},Ea.prototype.finish=function(){for(var e=0;e<this.events.length;e++)tt.apply(null,this.events[e])};function Dl(e){var r=e.display;!r.scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=Jr(e)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=Jr(e)+"px",r.scrollbarsClipped=!0)}function kf(e){if(e.hasFocus())return null;var r=_e(at(e));if(!r||!He(e.display.lineDiv,r))return null;var a={activeElt:r};if(window.getSelection){var o=Gt(e).getSelection();o.anchorNode&&o.extend&&He(e.display.lineDiv,o.anchorNode)&&(a.anchorNode=o.anchorNode,a.anchorOffset=o.anchorOffset,a.focusNode=o.focusNode,a.focusOffset=o.focusOffset)}return a}function Pf(e){if(!(!e||!e.activeElt||e.activeElt==_e(e.activeElt.ownerDocument))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&He(document.body,e.anchorNode)&&He(document.body,e.focusNode))){var r=e.activeElt.ownerDocument,a=r.defaultView.getSelection(),o=r.createRange();o.setEnd(e.anchorNode,e.anchorOffset),o.collapse(!1),a.removeAllRanges(),a.addRange(o),a.extend(e.focusNode,e.focusOffset)}}function Fl(e,r){var a=e.display,o=e.doc;if(r.editorIsHidden)return si(e),!1;if(!r.force&&r.visible.from>=a.viewFrom&&r.visible.to<=a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&Tl(e)==0)return!1;jl(e)&&(si(e),r.dims=vs(e));var l=o.first+o.size,d=Math.max(r.visible.from-e.options.viewportMargin,o.first),g=Math.min(l,r.visible.to+e.options.viewportMargin);a.viewFrom<d&&d-a.viewFrom<20&&(d=Math.max(o.first,a.viewFrom)),a.viewTo>g&&a.viewTo-g<20&&(g=Math.min(l,a.viewTo)),Nn&&(d=oi(e.doc,d),g=cl(e.doc,g));var b=d!=a.viewFrom||g!=a.viewTo||a.lastWrapHeight!=r.wrapperHeight||a.lastWrapWidth!=r.wrapperWidth;gf(e,d,g),a.viewOffset=Gn(Ve(e.doc,a.viewFrom)),e.display.mover.style.top=a.viewOffset+"px";var w=Tl(e);if(!b&&w==0&&!r.force&&a.renderedView==a.view&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo))return!1;var O=kf(e);return w>4&&(a.lineDiv.style.display="none"),Lf(e,a.updateLineNumbers,r.dims),w>4&&(a.lineDiv.style.display=""),a.renderedView=a.view,Pf(O),ce(a.cursorDiv),ce(a.selectionDiv),a.gutters.style.height=a.sizer.style.minHeight=0,b&&(a.lastWrapHeight=r.wrapperHeight,a.lastWrapWidth=r.wrapperWidth,Fo(e,400)),a.updateLineNumbers=null,!0}function As(e,r){for(var a=r.viewport,o=!0;;o=!1){if(!o||!e.options.lineWrapping||r.oldDisplayWidth==xn(e)){if(a&&a.top!=null&&(a={top:Math.min(e.doc.height+Lo(e.display)-ga(e),a.top)}),r.visible=ro(e.display,e.doc,a),r.visible.from>=e.display.viewFrom&&r.visible.to<=e.display.viewTo)break}else o&&(r.visible=ro(e.display,e.doc,a));if(!Fl(e,r))break;xs(e);var l=oo(e);eo(e),ao(e,l),Rl(e,l),r.force=!1}r.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(r.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Os(e,r){var a=new Ea(e,r);if(Fl(e,a)){xs(e),As(e,a);var o=oo(e);eo(e),ao(e,o),Rl(e,o),a.finish()}}function Lf(e,r,a){var o=e.display,l=e.options.lineNumbers,d=o.lineDiv,g=d.firstChild;function b(xe){var Ce=xe.nextSibling;return V&&I&&e.display.currentWheelTarget==xe?xe.style.display="none":xe.parentNode.removeChild(xe),Ce}for(var w=o.view,O=o.viewFrom,U=0;U<w.length;U++){var X=w[U];if(!X.hidden)if(!X.node||X.node.parentNode!=d){var he=uf(e,X,O,a);d.insertBefore(he,g)}else{for(;g!=X.node;)g=b(g);var le=l&&r!=null&&r<=O&&X.lineNumber;X.changes&&(Fe(X.changes,"gutter")>-1&&(le=!1),is(e,X,O,a)),le&&(ce(X.lineNumber),X.lineNumber.appendChild(document.createTextNode(_i(e.options,O)))),g=X.node.nextSibling}O+=X.size}for(;g;)g=b(g)}function Es(e){var r=e.gutters.offsetWidth;e.sizer.style.marginLeft=r+"px",sr(e,"gutterChanged",e)}function Rl(e,r){e.display.sizer.style.minHeight=r.docHeight+"px",e.display.heightForcer.style.top=r.docHeight+"px",e.display.gutters.style.height=r.docHeight+e.display.barHeight+Jr(e)+"px"}function Bl(e){var r=e.display,a=r.view;if(!(!r.alignWidgets&&(!r.gutters.firstChild||!e.options.fixedGutter))){for(var o=gs(r)-r.scroller.scrollLeft+e.doc.scrollLeft,l=r.gutters.offsetWidth,d=o+"px",g=0;g<a.length;g++)if(!a[g].hidden){e.options.fixedGutter&&(a[g].gutter&&(a[g].gutter.style.left=d),a[g].gutterBackground&&(a[g].gutterBackground.style.left=d));var b=a[g].alignable;if(b)for(var w=0;w<b.length;w++)b[w].style.left=d}e.options.fixedGutter&&(r.gutters.style.left=o+l+"px")}}function jl(e){if(!e.options.lineNumbers)return!1;var r=e.doc,a=_i(e.options,r.first+r.size-1),o=e.display;if(a.length!=o.lineNumChars){var l=o.measure.appendChild(G("div",[G("div",a)],"CodeMirror-linenumber CodeMirror-gutter-elt")),d=l.firstChild.offsetWidth,g=l.offsetWidth-d;return o.lineGutter.style.width="",o.lineNumInnerWidth=Math.max(d,o.lineGutter.offsetWidth-g)+1,o.lineNumWidth=o.lineNumInnerWidth+g,o.lineNumChars=o.lineNumInnerWidth?a.length:-1,o.lineGutter.style.width=o.lineNumWidth+"px",Es(e.display),!0}return!1}function Ta(e,r){for(var a=[],o=!1,l=0;l<e.length;l++){var d=e[l],g=null;if(typeof d!="string"&&(g=d.style,d=d.className),d=="CodeMirror-linenumbers")if(r)o=!0;else continue;a.push({className:d,style:g})}return r&&!o&&a.push({className:"CodeMirror-linenumbers",style:null}),a}function Wl(e){var r=e.gutters,a=e.gutterSpecs;ce(r),e.lineGutter=null;for(var o=0;o<a.length;++o){var l=a[o],d=l.className,g=l.style,b=r.appendChild(G("div",null,"CodeMirror-gutter "+d));g&&(b.style.cssText=g),d=="CodeMirror-linenumbers"&&(e.lineGutter=b,b.style.width=(e.lineNumWidth||1)+"px")}r.style.display=a.length?"":"none",Es(e)}function so(e){Wl(e.display),Dr(e),Bl(e)}function If(e,r,a,o){var l=this;this.input=a,l.scrollbarFiller=G("div",null,"CodeMirror-scrollbar-filler"),l.scrollbarFiller.setAttribute("cm-not-content","true"),l.gutterFiller=G("div",null,"CodeMirror-gutter-filler"),l.gutterFiller.setAttribute("cm-not-content","true"),l.lineDiv=ve("div",null,"CodeMirror-code"),l.selectionDiv=G("div",null,null,"position: relative; z-index: 1"),l.cursorDiv=G("div",null,"CodeMirror-cursors"),l.measure=G("div",null,"CodeMirror-measure"),l.lineMeasure=G("div",null,"CodeMirror-measure"),l.lineSpace=ve("div",[l.measure,l.lineMeasure,l.selectionDiv,l.cursorDiv,l.lineDiv],null,"position: relative; outline: none");var d=ve("div",[l.lineSpace],"CodeMirror-lines");l.mover=G("div",[d],null,"position: relative"),l.sizer=G("div",[l.mover],"CodeMirror-sizer"),l.sizerWidth=null,l.heightForcer=G("div",null,null,"position: absolute; height: "+Re+"px; width: 1px;"),l.gutters=G("div",null,"CodeMirror-gutters"),l.lineGutter=null,l.scroller=G("div",[l.sizer,l.heightForcer,l.gutters],"CodeMirror-scroll"),l.scroller.setAttribute("tabIndex","-1"),l.wrapper=G("div",[l.scrollbarFiller,l.gutterFiller,l.scroller],"CodeMirror"),Z&&de>=105&&(l.wrapper.style.clipPath="inset(0px)"),l.wrapper.setAttribute("translate","no"),D&&R<8&&(l.gutters.style.zIndex=-1,l.scroller.style.paddingRight=0),!V&&!(v&&S)&&(l.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(l.wrapper):e(l.wrapper)),l.viewFrom=l.viewTo=r.first,l.reportedViewFrom=l.reportedViewTo=r.first,l.view=[],l.renderedView=null,l.externalMeasured=null,l.viewOffset=0,l.lastWrapHeight=l.lastWrapWidth=0,l.updateLineNumbers=null,l.nativeBarWidth=l.barHeight=l.barWidth=0,l.scrollbarsClipped=!1,l.lineNumWidth=l.lineNumInnerWidth=l.lineNumChars=null,l.alignWidgets=!1,l.cachedCharWidth=l.cachedTextHeight=l.cachedPaddingH=null,l.maxLine=null,l.maxLineLength=0,l.maxLineChanged=!1,l.wheelDX=l.wheelDY=l.wheelStartX=l.wheelStartY=null,l.shift=!1,l.selForContextMenu=null,l.activeTouch=null,l.gutterSpecs=Ta(o.gutters,o.lineNumbers),Wl(l),a.init(l)}var ka=0,Xn=null;D?Xn=-.53:v?Xn=15:Z?Xn=-.7:se&&(Xn=-1/3);function Hl(e){var r=e.wheelDeltaX,a=e.wheelDeltaY;return r==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(r=e.detail),a==null&&e.detail&&e.axis==e.VERTICAL_AXIS?a=e.detail:a==null&&(a=e.wheelDelta),{x:r,y:a}}function Mf(e){var r=Hl(e);return r.x*=Xn,r.y*=Xn,r}function Ul(e,r){Z&&de==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var a=Hl(r),o=a.x,l=a.y,d=Xn;r.deltaMode===0&&(o=r.deltaX,l=r.deltaY,d=1);var g=e.display,b=g.scroller,w=b.scrollWidth>b.clientWidth,O=b.scrollHeight>b.clientHeight;if(o&&w||l&&O){if(l&&I&&V){e:for(var U=r.target,X=g.view;U!=b;U=U.parentNode)for(var he=0;he<X.length;he++)if(X[he].node==U){e.display.currentWheelTarget=U;break e}}if(o&&!v&&!re&&d!=null){l&&O&&io(e,Math.max(0,b.scrollTop+l*d)),ki(e,Math.max(0,b.scrollLeft+o*d)),(!l||l&&O)&&wt(r),g.wheelStartX=null;return}if(l&&d!=null){var le=l*d,xe=e.doc.scrollTop,Ce=xe+g.wrapper.clientHeight;le<0?xe=Math.max(0,xe+le-50):Ce=Math.min(e.doc.height,Ce+le+50),Os(e,{top:xe,bottom:Ce})}ka<20&&r.deltaMode!==0&&(g.wheelStartX==null?(g.wheelStartX=b.scrollLeft,g.wheelStartY=b.scrollTop,g.wheelDX=o,g.wheelDY=l,setTimeout(function(){if(g.wheelStartX!=null){var Le=b.scrollLeft-g.wheelStartX,Me=b.scrollTop-g.wheelStartY,Oe=Me&&g.wheelDY&&Me/g.wheelDY||Le&&g.wheelDX&&Le/g.wheelDX;g.wheelStartX=g.wheelStartY=null,Oe&&(Xn=(Xn*ka+Oe)/(ka+1),++ka)}},200)):(g.wheelDX+=o,g.wheelDY+=l))}}var Fr=function(e,r){this.ranges=e,this.primIndex=r};Fr.prototype.primary=function(){return this.ranges[this.primIndex]},Fr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var a=this.ranges[r],o=e.ranges[r];if(!Se(a.anchor,o.anchor)||!Se(a.head,o.head))return!1}return!0},Fr.prototype.deepCopy=function(){for(var e=[],r=0;r<this.ranges.length;r++)e[r]=new Et(Pe(this.ranges[r].anchor),Pe(this.ranges[r].head));return new Fr(e,this.primIndex)},Fr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Fr.prototype.contains=function(e,r){r||(r=e);for(var a=0;a<this.ranges.length;a++){var o=this.ranges[a];if(z(r,o.from())>=0&&z(e,o.to())<=0)return a}return-1};var Et=function(e,r){this.anchor=e,this.head=r};Et.prototype.from=function(){return yt(this.anchor,this.head)},Et.prototype.to=function(){return rt(this.anchor,this.head)},Et.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Sn(e,r,a){var o=e&&e.options.selectionsMayTouch,l=r[a];r.sort(function(he,le){return z(he.from(),le.from())}),a=Fe(r,l);for(var d=1;d<r.length;d++){var g=r[d],b=r[d-1],w=z(b.to(),g.from());if(o&&!g.empty()?w>0:w>=0){var O=yt(b.from(),g.from()),U=rt(b.to(),g.to()),X=b.empty()?g.from()==g.head:b.from()==b.head;d<=a&&--a,r.splice(--d,2,new Et(X?U:O,X?O:U))}}return new Fr(r,a)}function fi(e,r){return new Fr([new Et(e,r||e)],0)}function ci(e){return e.text?A(e.from.line+e.text.length-1,Je(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function zl(e,r){if(z(e,r.from)<0)return e;if(z(e,r.to)<=0)return ci(r);var a=e.line+r.text.length-(r.to.line-r.from.line)-1,o=e.ch;return e.line==r.to.line&&(o+=ci(r).ch-r.to.ch),A(a,o)}function B(e,r){for(var a=[],o=0;o<e.sel.ranges.length;o++){var l=e.sel.ranges[o];a.push(new Et(zl(l.anchor,r),zl(l.head,r)))}return Sn(e.cm,a,e.sel.primIndex)}function Vt(e,r,a){return e.line==r.line?A(a.line,e.ch-r.ch+a.ch):A(a.line+(e.line-r.line),e.ch)}function wn(e,r,a){for(var o=[],l=A(e.first,0),d=l,g=0;g<r.length;g++){var b=r[g],w=Vt(b.from,l,d),O=Vt(ci(b),l,d);if(l=b.to,d=O,a=="around"){var U=e.sel.ranges[g],X=z(U.head,U.anchor)<0;o[g]=new Et(X?O:w,X?w:O)}else o[g]=new Et(w,w)}return new Fr(o,e.sel.primIndex)}function Ts(e){e.doc.mode=Mr(e.options,e.doc.modeOption),Ro(e)}function Ro(e){e.doc.iter(function(r){r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Fo(e,100),e.state.modeGen++,e.curOp&&Dr(e)}function _l(e,r){return r.from.ch==0&&r.to.ch==0&&Je(r.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ks(e,r,a,o){function l(Oe){return a?a[Oe]:null}function d(Oe,Ne,We){dl(Oe,Ne,We,o),sr(Oe,"change",Oe,r)}function g(Oe,Ne){for(var We=[],Ye=Oe;Ye<Ne;++Ye)We.push(new Si(O[Ye],l(Ye),o));return We}var b=r.from,w=r.to,O=r.text,U=Ve(e,b.line),X=Ve(e,w.line),he=Je(O),le=l(O.length-1),xe=w.line-b.line;if(r.full)e.insert(0,g(0,O.length)),e.remove(O.length,e.size-O.length);else if(_l(e,r)){var Ce=g(0,O.length-1);d(X,X.text,le),xe&&e.remove(b.line,xe),Ce.length&&e.insert(b.line,Ce)}else if(U==X)if(O.length==1)d(U,U.text.slice(0,b.ch)+he+U.text.slice(w.ch),le);else{var Le=g(1,O.length-1);Le.push(new Si(he+U.text.slice(w.ch),le,o)),d(U,U.text.slice(0,b.ch)+O[0],l(0)),e.insert(b.line+1,Le)}else if(O.length==1)d(U,U.text.slice(0,b.ch)+O[0]+X.text.slice(w.ch),l(0)),e.remove(b.line+1,xe);else{d(U,U.text.slice(0,b.ch)+O[0],l(0)),d(X,he+X.text.slice(w.ch),le);var Me=g(1,O.length-1);xe>1&&e.remove(b.line+1,xe-1),e.insert(b.line+1,Me)}sr(e,"change",e,r)}function di(e,r,a){function o(l,d,g){if(l.linked)for(var b=0;b<l.linked.length;++b){var w=l.linked[b];if(w.doc!=d){var O=g&&w.sharedHist;a&&!O||(r(w.doc,O),o(w.doc,l,O))}}}o(e,null,!0)}function Vl(e,r){if(r.cm)throw new Error("This document is already in use.");e.doc=r,r.cm=e,ms(e),Ts(e),Ps(e),e.options.direction=r.direction,e.options.lineWrapping||ts(e),e.options.mode=r.modeOption,Dr(e)}function Ps(e){(e.doc.direction=="rtl"?ze:Y)(e.display.lineDiv,"CodeMirror-rtl")}function Nf(e){Vr(e,function(){Ps(e),Dr(e)})}function Pa(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 La(e,r){var a={from:Pe(r.from),to:ci(r),text:zn(e,r.from,r.to)};return Cn(e,a,r.from.line,r.to.line+1),di(e,function(o){return Cn(o,a,r.from.line,r.to.line+1)},!0),a}function $l(e){for(;e.length;){var r=Je(e);if(r.ranges)e.pop();else break}}function Df(e,r){if(r)return $l(e.done),Je(e.done);if(e.done.length&&!Je(e.done).ranges)return Je(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Je(e.done)}function Gl(e,r,a,o){var l=e.history;l.undone.length=0;var d=+new Date,g,b;if((l.lastOp==o||l.lastOrigin==r.origin&&r.origin&&(r.origin.charAt(0)=="+"&&l.lastModTime>d-(e.cm?e.cm.options.historyEventDelay:500)||r.origin.charAt(0)=="*"))&&(g=Df(l,l.lastOp==o)))b=Je(g.changes),z(r.from,r.to)==0&&z(r.from,b.to)==0?b.to=ci(r):g.changes.push(La(e,r));else{var w=Je(l.done);for((!w||!w.ranges)&&Ii(e.sel,l.done),g={changes:[La(e,r)],generation:l.generation},l.done.push(g);l.done.length>l.undoDepth;)l.done.shift(),l.done[0].ranges||l.done.shift()}l.done.push(a),l.generation=++l.maxGeneration,l.lastModTime=l.lastSelTime=d,l.lastOp=l.lastSelOp=o,l.lastOrigin=l.lastSelOrigin=r.origin,b||tt(e,"historyAdded")}function Ff(e,r,a,o){var l=r.charAt(0);return l=="*"||l=="+"&&a.ranges.length==o.ranges.length&&a.somethingSelected()==o.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Rf(e,r,a,o){var l=e.history,d=o&&o.origin;a==l.lastSelOp||d&&l.lastSelOrigin==d&&(l.lastModTime==l.lastSelTime&&l.lastOrigin==d||Ff(e,d,Je(l.done),r))?l.done[l.done.length-1]=r:Ii(r,l.done),l.lastSelTime=+new Date,l.lastSelOrigin=d,l.lastSelOp=a,o&&o.clearRedo!==!1&&$l(l.undone)}function Ii(e,r){var a=Je(r);a&&a.ranges&&a.equals(e)||r.push(e)}function Cn(e,r,a,o){var l=r["spans_"+e.id],d=0;e.iter(Math.max(e.first,a),Math.min(e.first+e.size,o),function(g){g.markedSpans&&((l||(l=r["spans_"+e.id]={}))[d]=g.markedSpans),++d})}function Kl(e){if(!e)return null;for(var r,a=0;a<e.length;++a)e[a].marker.explicitlyCleared?r||(r=e.slice(0,a)):r&&r.push(e[a]);return r?r.length?r:null:e}function Yl(e,r){var a=r["spans_"+e.id];if(!a)return null;for(var o=[],l=0;l<r.text.length;++l)o.push(Kl(a[l]));return o}function Xl(e,r){var a=Yl(e,r),o=ua(e,r);if(!a)return o;if(!o)return a;for(var l=0;l<a.length;++l){var d=a[l],g=o[l];if(d&&g)e:for(var b=0;b<g.length;++b){for(var w=g[b],O=0;O<d.length;++O)if(d[O].marker==w.marker)continue e;d.push(w)}else g&&(a[l]=g)}return a}function Mi(e,r,a){for(var o=[],l=0;l<e.length;++l){var d=e[l];if(d.ranges){o.push(a?Fr.prototype.deepCopy.call(d):d);continue}var g=d.changes,b=[];o.push({changes:b});for(var w=0;w<g.length;++w){var O=g[w],U=void 0;if(b.push({from:O.from,to:O.to,text:O.text}),r)for(var X in O)(U=X.match(/^spans_(\d+)$/))&&Fe(r,Number(U[1]))>-1&&(Je(b)[X]=O[X],delete O[X])}}return o}function Ia(e,r,a,o){if(o){var l=e.anchor;if(a){var d=z(r,l)<0;d!=z(a,l)<0?(l=r,r=a):d!=z(r,a)<0&&(r=a)}return new Et(l,r)}else return new Et(a||r,r)}function Ni(e,r,a,o,l){l==null&&(l=e.cm&&(e.cm.display.shift||e.extend)),fr(e,new Fr([Ia(e.sel.primary(),r,a,l)],0),o)}function Jl(e,r,a){for(var o=[],l=e.cm&&(e.cm.display.shift||e.extend),d=0;d<e.sel.ranges.length;d++)o[d]=Ia(e.sel.ranges[d],r[d],null,l);var g=Sn(e.cm,o,e.sel.primIndex);fr(e,g,a)}function Ma(e,r,a,o){var l=e.sel.ranges.slice(0);l[r]=a,fr(e,Sn(e.cm,l,e.sel.primIndex),o)}function Ls(e,r,a,o){fr(e,fi(r,a),o)}function Ql(e,r,a){var o={ranges:r.ranges,update:function(l){this.ranges=[];for(var d=0;d<l.length;d++)this.ranges[d]=new Et($e(e,l[d].anchor),$e(e,l[d].head))},origin:a&&a.origin};return tt(e,"beforeSelectionChange",e,o),e.cm&&tt(e.cm,"beforeSelectionChange",e.cm,o),o.ranges!=r.ranges?Sn(e.cm,o.ranges,o.ranges.length-1):r}function Zl(e,r,a){var o=e.history.done,l=Je(o);l&&l.ranges?(o[o.length-1]=r,gt(e,r,a)):fr(e,r,a)}function fr(e,r,a){gt(e,r,a),Rf(e,e.sel,e.cm?e.cm.curOp.id:NaN,a)}function gt(e,r,a){(_t(e,"beforeSelectionChange")||e.cm&&_t(e.cm,"beforeSelectionChange"))&&(r=Ql(e,r,a));var o=a&&a.bias||(z(r.primary().head,e.sel.primary().head)<0?-1:1);Tt(e,Qr(e,r,o,!0)),!(a&&a.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&no(e.cm)}function Tt(e,r){r.equals(e.sel)||(e.sel=r,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,lt(e.cm)),sr(e,"cursorActivity",e))}function ot(e){Tt(e,Qr(e,e.sel,null,!1))}function Qr(e,r,a,o){for(var l,d=0;d<r.ranges.length;d++){var g=r.ranges[d],b=r.ranges.length==e.sel.ranges.length&&e.sel.ranges[d],w=An(e,g.anchor,b&&b.anchor,a,o),O=g.head==g.anchor?w:An(e,g.head,b&&b.head,a,o);(l||w!=g.anchor||O!=g.head)&&(l||(l=r.ranges.slice(0,d)),l[d]=new Et(w,O))}return l?Sn(e.cm,l,r.primIndex):r}function lo(e,r,a,o,l){var d=Ve(e,r.line);if(d.markedSpans)for(var g=0;g<d.markedSpans.length;++g){var b=d.markedSpans[g],w=b.marker,O="selectLeft"in w?!w.selectLeft:w.inclusiveLeft,U="selectRight"in w?!w.selectRight:w.inclusiveRight;if((b.from==null||(O?b.from<=r.ch:b.from<r.ch))&&(b.to==null||(U?b.to>=r.ch:b.to>r.ch))){if(l&&(tt(w,"beforeCursorEnter"),w.explicitlyCleared))if(d.markedSpans){--g;continue}else break;if(!w.atomic)continue;if(a){var X=w.find(o<0?1:-1),he=void 0;if((o<0?U:O)&&(X=ql(e,X,-o,X&&X.line==r.line?d:null)),X&&X.line==r.line&&(he=z(X,a))&&(o<0?he<0:he>0))return lo(e,X,r,o,l)}var le=w.find(o<0?-1:1);return(o<0?O:U)&&(le=ql(e,le,o,le.line==r.line?d:null)),le?lo(e,le,r,o,l):null}}return r}function An(e,r,a,o,l){var d=o||1,g=lo(e,r,a,d,l)||!l&&lo(e,r,a,d,!0)||lo(e,r,a,-d,l)||!l&&lo(e,r,a,-d,!0);return g||(e.cantEdit=!0,A(e.first,0))}function ql(e,r,a,o){return a<0&&r.ch==0?r.line>e.first?$e(e,A(r.line-1)):null:a>0&&r.ch==(o||Ve(e,r.line)).text.length?r.line<e.first+e.size-1?A(r.line+1,0):null:new A(r.line,r.ch+a)}function eu(e){e.setSelection(A(e.firstLine(),0),A(e.lastLine()),Dt)}function tu(e,r,a){var o={canceled:!1,from:r.from,to:r.to,text:r.text,origin:r.origin,cancel:function(){return o.canceled=!0}};return a&&(o.update=function(l,d,g,b){l&&(o.from=$e(e,l)),d&&(o.to=$e(e,d)),g&&(o.text=g),b!==void 0&&(o.origin=b)}),tt(e,"beforeChange",e,o),e.cm&&tt(e.cm,"beforeChange",e.cm,o),o.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function Di(e,r,a){if(e.cm){if(!e.cm.curOp)return lr(e.cm,Di)(e,r,a);if(e.cm.state.suppressEdits)return}if(!((_t(e,"beforeChange")||e.cm&&_t(e.cm,"beforeChange"))&&(r=tu(e,r,!0),!r))){var o=il&&!a&&Za(e,r.from,r.to);if(o)for(var l=o.length-1;l>=0;--l)Is(e,{from:o[l].from,to:o[l].to,text:l?[""]:r.text,origin:r.origin});else Is(e,r)}}function Is(e,r){if(!(r.text.length==1&&r.text[0]==""&&z(r.from,r.to)==0)){var a=B(e,r);Gl(e,r,a,e.cm?e.cm.curOp.id:NaN),Bo(e,r,a,ua(e,r));var o=[];di(e,function(l,d){!d&&Fe(o,l.history)==-1&&(Ms(l.history,r),o.push(l.history)),Bo(l,r,null,ua(l,r))})}}function Na(e,r,a){var o=e.cm&&e.cm.state.suppressEdits;if(!(o&&!a)){for(var l=e.history,d,g=e.sel,b=r=="undo"?l.done:l.undone,w=r=="undo"?l.undone:l.done,O=0;O<b.length&&(d=b[O],!(a?d.ranges&&!d.equals(e.sel):!d.ranges));O++);if(O!=b.length){for(l.lastOrigin=l.lastSelOrigin=null;;)if(d=b.pop(),d.ranges){if(Ii(d,w),a&&!d.equals(e.sel)){fr(e,d,{clearRedo:!1});return}g=d}else if(o){b.push(d);return}else break;var U=[];Ii(g,w),w.push({changes:U,generation:l.generation}),l.generation=d.generation||++l.maxGeneration;for(var X=_t(e,"beforeChange")||e.cm&&_t(e.cm,"beforeChange"),he=function(Ce){var Le=d.changes[Ce];if(Le.origin=r,X&&!tu(e,Le,!1))return b.length=0,{};U.push(La(e,Le));var Me=Ce?B(e,Le):Je(b);Bo(e,Le,Me,Xl(e,Le)),!Ce&&e.cm&&e.cm.scrollIntoView({from:Le.from,to:ci(Le)});var Oe=[];di(e,function(Ne,We){!We&&Fe(Oe,Ne.history)==-1&&(Ms(Ne.history,Le),Oe.push(Ne.history)),Bo(Ne,Le,null,Xl(Ne,Le))})},le=d.changes.length-1;le>=0;--le){var xe=he(le);if(xe)return xe.v}}}}function Da(e,r){if(r!=0&&(e.first+=r,e.sel=new Fr(xt(e.sel.ranges,function(l){return new Et(A(l.anchor.line+r,l.anchor.ch),A(l.head.line+r,l.head.ch))}),e.sel.primIndex),e.cm)){Dr(e.cm,e.first,e.first-r,r);for(var a=e.cm.display,o=a.viewFrom;o<a.viewTo;o++)ai(e.cm,o,"gutter")}}function Bo(e,r,a,o){if(e.cm&&!e.cm.curOp)return lr(e.cm,Bo)(e,r,a,o);if(r.to.line<e.first){Da(e,r.text.length-1-(r.to.line-r.from.line));return}if(!(r.from.line>e.lastLine())){if(r.from.line<e.first){var l=r.text.length-1-(e.first-r.from.line);Da(e,l),r={from:A(e.first,0),to:A(r.to.line+l,r.to.ch),text:[Je(r.text)],origin:r.origin}}var d=e.lastLine();r.to.line>d&&(r={from:r.from,to:A(d,Ve(e,d).text.length),text:[r.text[0]],origin:r.origin}),r.removed=zn(e,r.from,r.to),a||(a=B(e,r)),e.cm?ru(e.cm,r,o):ks(e,r,o),gt(e,a,Dt),e.cantEdit&&An(e,A(e.firstLine(),0))&&(e.cantEdit=!1)}}function ru(e,r,a){var o=e.doc,l=e.display,d=r.from,g=r.to,b=!1,w=d.line;e.options.lineWrapping||(w=Ct(bn(Ve(o,d.line))),o.iter(w,g.line+1,function(le){if(le==l.maxLine)return b=!0,!0})),o.sel.contains(r.from,r.to)>-1&&lt(e),ks(o,r,a,El(e)),e.options.lineWrapping||(o.iter(w,d.line+r.text.length,function(le){var xe=da(le);xe>l.maxLineLength&&(l.maxLine=le,l.maxLineLength=xe,l.maxLineChanged=!0,b=!1)}),b&&(e.curOp.updateMaxLine=!0)),nl(o,d.line),Fo(e,400);var O=r.text.length-(g.line-d.line)-1;r.full?Dr(e):d.line==g.line&&r.text.length==1&&!_l(e.doc,r)?ai(e,d.line,"text"):Dr(e,d.line,g.line+1,O);var U=_t(e,"changes"),X=_t(e,"change");if(X||U){var he={from:d,to:g,text:r.text,removed:r.removed,origin:r.origin};X&&sr(e,"change",e,he),U&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(he)}e.display.selForContextMenu=null}function uo(e,r,a,o,l){var d;o||(o=a),z(o,a)<0&&(d=[o,a],a=d[0],o=d[1]),typeof r=="string"&&(r=e.splitLines(r)),Di(e,{from:a,to:o,text:r,origin:l})}function nu(e,r,a,o){a<e.line?e.line+=o:r<e.line&&(e.line=r,e.ch=0)}function iu(e,r,a,o){for(var l=0;l<e.length;++l){var d=e[l],g=!0;if(d.ranges){d.copied||(d=e[l]=d.deepCopy(),d.copied=!0);for(var b=0;b<d.ranges.length;b++)nu(d.ranges[b].anchor,r,a,o),nu(d.ranges[b].head,r,a,o);continue}for(var w=0;w<d.changes.length;++w){var O=d.changes[w];if(a<O.from.line)O.from=A(O.from.line+o,O.from.ch),O.to=A(O.to.line+o,O.to.ch);else if(r<=O.to.line){g=!1;break}}g||(e.splice(0,l+1),l=0)}}function Ms(e,r){var a=r.from.line,o=r.to.line,l=r.text.length-(o-a)-1;iu(e.done,a,o,l),iu(e.undone,a,o,l)}function jo(e,r,a,o){var l=r,d=r;return typeof r=="number"?d=Ve(e,At(e,r)):l=Ct(r),l==null?null:(o(d,l)&&e.cm&&ai(e.cm,l,a),d)}function Fi(e){this.lines=e,this.parent=null;for(var r=0,a=0;a<e.length;++a)e[a].parent=this,r+=e[a].height;this.height=r}Fi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,r){for(var a=e,o=e+r;a<o;++a){var l=this.lines[a];this.height-=l.height,hl(l),sr(l,"delete")}this.lines.splice(e,r)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,r,a){this.height+=a,this.lines=this.lines.slice(0,e).concat(r).concat(this.lines.slice(e));for(var o=0;o<r.length;++o)r[o].parent=this},iterN:function(e,r,a){for(var o=e+r;e<o;++e)if(a(this.lines[e]))return!0}};function fo(e){this.children=e;for(var r=0,a=0,o=0;o<e.length;++o){var l=e[o];r+=l.chunkSize(),a+=l.height,l.parent=this}this.size=r,this.height=a,this.parent=null}fo.prototype={chunkSize:function(){return this.size},removeInner:function(e,r){this.size-=r;for(var a=0;a<this.children.length;++a){var o=this.children[a],l=o.chunkSize();if(e<l){var d=Math.min(r,l-e),g=o.height;if(o.removeInner(e,d),this.height-=g-o.height,l==d&&(this.children.splice(a--,1),o.parent=null),(r-=d)==0)break;e=0}else e-=l}if(this.size-r<25&&(this.children.length>1||!(this.children[0]instanceof Fi))){var b=[];this.collapse(b),this.children=[new Fi(b)],this.children[0].parent=this}},collapse:function(e){for(var r=0;r<this.children.length;++r)this.children[r].collapse(e)},insertInner:function(e,r,a){this.size+=r.length,this.height+=a;for(var o=0;o<this.children.length;++o){var l=this.children[o],d=l.chunkSize();if(e<=d){if(l.insertInner(e,r,a),l.lines&&l.lines.length>50){for(var g=l.lines.length%25+25,b=g;b<l.lines.length;){var w=new Fi(l.lines.slice(b,b+=25));l.height-=w.height,this.children.splice(++o,0,w),w.parent=this}l.lines=l.lines.slice(0,g),this.maybeSpill()}break}e-=d}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var r=e.children.splice(e.children.length-5,5),a=new fo(r);if(e.parent){e.size-=a.size,e.height-=a.height;var l=Fe(e.parent.children,e);e.parent.children.splice(l+1,0,a)}else{var o=new fo(e.children);o.parent=e,e.children=[o,a],e=o}a.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,r,a){for(var o=0;o<this.children.length;++o){var l=this.children[o],d=l.chunkSize();if(e<d){var g=Math.min(r,d-e);if(l.iterN(e,g,a))return!0;if((r-=g)==0)break;e=0}else e-=d}}};var Wo=function(e,r,a){if(a)for(var o in a)a.hasOwnProperty(o)&&(this[o]=a[o]);this.doc=e,this.node=r};Wo.prototype.clear=function(){var e=this.doc.cm,r=this.line.widgets,a=this.line,o=Ct(a);if(!(o==null||!r)){for(var l=0;l<r.length;++l)r[l]==this&&r.splice(l--,1);r.length||(a.widgets=null);var d=Kn(this);rn(a,Math.max(0,a.height-d)),e&&(Vr(e,function(){ou(e,a,-d),ai(e,o,"widget")}),sr(e,"lineWidgetCleared",e,this,o))}},Wo.prototype.changed=function(){var e=this,r=this.height,a=this.doc.cm,o=this.line;this.height=null;var l=Kn(this)-r;l&&($n(this.doc,o)||rn(o,o.height+l),a&&Vr(a,function(){a.curOp.forceUpdate=!0,ou(a,o,l),sr(a,"lineWidgetChanged",a,e,Ct(o))}))},Tr(Wo);function ou(e,r,a){Gn(r)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ws(e,a)}function Bf(e,r,a,o){var l=new Wo(e,a,o),d=e.cm;return d&&l.noHScroll&&(d.display.alignWidgets=!0),jo(e,r,"widget",function(g){var b=g.widgets||(g.widgets=[]);if(l.insertAt==null?b.push(l):b.splice(Math.min(b.length,Math.max(0,l.insertAt)),0,l),l.line=g,d&&!$n(e,g)){var w=Gn(g)<e.scrollTop;rn(g,g.height+Kn(l)),w&&ws(d,l.height),d.curOp.forceUpdate=!0}return!0}),d&&sr(d,"lineWidgetAdded",d,l,typeof r=="number"?r:Ct(r)),l}var au=0,Zr=function(e,r){this.lines=[],this.type=r,this.doc=e,this.id=++au};Zr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,r=e&&!e.curOp;if(r&&Pi(e),_t(this,"clear")){var a=this.find();a&&sr(this,"clear",a.from,a.to)}for(var o=null,l=null,d=0;d<this.lines.length;++d){var g=this.lines[d],b=Gi(g.markedSpans,this);e&&!this.collapsed?ai(e,Ct(g),"text"):e&&(b.to!=null&&(l=Ct(g)),b.from!=null&&(o=Ct(g))),g.markedSpans=Xe(g.markedSpans,b),b.from==null&&this.collapsed&&!$n(this.doc,g)&&e&&rn(g,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var w=0;w<this.lines.length;++w){var O=bn(this.lines[w]),U=da(O);U>e.display.maxLineLength&&(e.display.maxLine=O,e.display.maxLineLength=U,e.display.maxLineChanged=!0)}o!=null&&e&&this.collapsed&&Dr(e,o,l+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ot(e.doc)),e&&sr(e,"markerCleared",e,this,o,l),r&&Li(e),this.parent&&this.parent.clear()}},Zr.prototype.find=function(e,r){e==null&&this.type=="bookmark"&&(e=1);for(var a,o,l=0;l<this.lines.length;++l){var d=this.lines[l],g=Gi(d.markedSpans,this);if(g.from!=null&&(a=A(r?d:Ct(d),g.from),e==-1))return a;if(g.to!=null&&(o=A(r?d:Ct(d),g.to),e==1))return o}return a&&{from:a,to:o}},Zr.prototype.changed=function(){var e=this,r=this.find(-1,!0),a=this,o=this.doc.cm;!r||!o||Vr(o,function(){var l=r.line,d=Ct(r.line),g=ma(o,d);if(g&&(ls(g),o.curOp.selectionChanged=o.curOp.forceUpdate=!0),o.curOp.updateMaxLine=!0,!$n(a.doc,l)&&a.height!=null){var b=a.height;a.height=null;var w=Kn(a)-b;w&&rn(l,l.height+w)}sr(o,"markerChanged",o,e)})},Zr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;(!r.maybeHiddenMarkers||Fe(r.maybeHiddenMarkers,this)==-1)&&(r.maybeUnhiddenMarkers||(r.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Zr.prototype.detachLine=function(e){if(this.lines.splice(Fe(this.lines,e),1),!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;(r.maybeHiddenMarkers||(r.maybeHiddenMarkers=[])).push(this)}},Tr(Zr);function sn(e,r,a,o,l){if(o&&o.shared)return jf(e,r,a,o,l);if(e.cm&&!e.cm.curOp)return lr(e.cm,sn)(e,r,a,o,l);var d=new Zr(e,l),g=z(r,a);if(o&&Ot(o,d,!1),g>0||g==0&&d.clearWhenEmpty!==!1)return d;if(d.replacedWith&&(d.collapsed=!0,d.widgetNode=ve("span",[d.replacedWith],"CodeMirror-widget"),o.handleMouseEvents||d.widgetNode.setAttribute("cm-ignore-events","true"),o.insertLeft&&(d.widgetNode.insertLeft=!0)),d.collapsed){if(fl(e,r.line,r,a,d)||r.line!=a.line&&fl(e,a.line,r,a,d))throw new Error("Inserting collapsed marker partially overlapping an existing one");$i()}d.addToHistory&&Gl(e,{from:r,to:a,origin:"markText"},e.sel,NaN);var b=r.line,w=e.cm,O;if(e.iter(b,a.line+1,function(X){w&&d.collapsed&&!w.options.lineWrapping&&bn(X)==w.display.maxLine&&(O=!0),d.collapsed&&b!=r.line&&rn(X,0),la(X,new sa(d,b==r.line?r.ch:null,b==a.line?a.ch:null),e.cm&&e.cm.curOp),++b}),d.collapsed&&e.iter(r.line,a.line+1,function(X){$n(e,X)&&rn(X,0)}),d.clearOnEnter&&ne(d,"beforeCursorEnter",function(){return d.clear()}),d.readOnly&&(ol(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),d.collapsed&&(d.id=++au,d.atomic=!0),w){if(O&&(w.curOp.updateMaxLine=!0),d.collapsed)Dr(w,r.line,a.line+1);else if(d.className||d.startStyle||d.endStyle||d.css||d.attributes||d.title)for(var U=r.line;U<=a.line;U++)ai(w,U,"text");d.atomic&&ot(w.doc),sr(w,"markerAdded",w,d)}return d}var Ho=function(e,r){this.markers=e,this.primary=r;for(var a=0;a<e.length;++a)e[a].parent=this};Ho.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sr(this,"clear")}},Ho.prototype.find=function(e,r){return this.primary.find(e,r)},Tr(Ho);function jf(e,r,a,o,l){o=Ot(o),o.shared=!1;var d=[sn(e,r,a,o,l)],g=d[0],b=o.widgetNode;return di(e,function(w){b&&(o.widgetNode=b.cloneNode(!0)),d.push(sn(w,$e(w,r),$e(w,a),o,l));for(var O=0;O<w.linked.length;++O)if(w.linked[O].isParent)return;g=Je(d)}),new Ho(d,g)}function su(e){return e.findMarks(A(e.first,0),e.clipPos(A(e.lastLine())),function(r){return r.parent})}function lu(e,r){for(var a=0;a<r.length;a++){var o=r[a],l=o.find(),d=e.clipPos(l.from),g=e.clipPos(l.to);if(z(d,g)){var b=sn(e,d,g,o.primary,o.primary.type);o.markers.push(b),b.parent=o}}}function Wf(e){for(var r=function(o){var l=e[o],d=[l.primary.doc];di(l.primary.doc,function(w){return d.push(w)});for(var g=0;g<l.markers.length;g++){var b=l.markers[g];Fe(d,b.doc)==-1&&(b.parent=null,l.markers.splice(g--,1))}},a=0;a<e.length;a++)r(a)}var Hf=0,Pr=function(e,r,a,o,l){if(!(this instanceof Pr))return new Pr(e,r,a,o,l);a==null&&(a=0),fo.call(this,[new Fi([new Si("",null)])]),this.first=a,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=a;var d=A(a,0);this.sel=fi(d),this.history=new Pa(null),this.id=++Hf,this.modeOption=r,this.lineSep=o,this.direction=l=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ks(this,{from:d,to:d,text:e}),fr(this,fi(d),Dt)};Pr.prototype=Ft(fo.prototype,{constructor:Pr,iter:function(e,r,a){a?this.iterN(e-this.first,r-e,a):this.iterN(this.first,this.first+this.size,e)},insert:function(e,r){for(var a=0,o=0;o<r.length;++o)a+=r[o].height;this.insertInner(e-this.first,r,a)},remove:function(e,r){this.removeInner(e-this.first,r)},getValue:function(e){var r=mi(this,this.first,this.first+this.size);return e===!1?r:r.join(e||this.lineSeparator())},setValue:ur(function(e){var r=A(this.first,0),a=this.first+this.size-1;Di(this,{from:r,to:A(a,Ve(this,a).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ti(this.cm,0,0),fr(this,fi(r),Dt)}),replaceRange:function(e,r,a,o){r=$e(this,r),a=a?$e(this,a):r,uo(this,e,r,a,o)},getRange:function(e,r,a){var o=zn(this,$e(this,e),$e(this,r));return a===!1?o:a===""?o.join(""):o.join(a||this.lineSeparator())},getLine:function(e){var r=this.getLineHandle(e);return r&&r.text},getLineHandle:function(e){if(yi(this,e))return Ve(this,e)},getLineNumber:function(e){return Ct(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ve(this,e)),bn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return $e(this,e)},getCursor:function(e){var r=this.sel.primary(),a;return e==null||e=="head"?a=r.head:e=="anchor"?a=r.anchor:e=="end"||e=="to"||e===!1?a=r.to():a=r.from(),a},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ur(function(e,r,a){Ls(this,$e(this,typeof e=="number"?A(e,r||0):e),null,a)}),setSelection:ur(function(e,r,a){Ls(this,$e(this,e),$e(this,r||e),a)}),extendSelection:ur(function(e,r,a){Ni(this,$e(this,e),r&&$e(this,r),a)}),extendSelections:ur(function(e,r){Jl(this,Eo(this,e),r)}),extendSelectionsBy:ur(function(e,r){var a=xt(this.sel.ranges,e);Jl(this,Eo(this,a),r)}),setSelections:ur(function(e,r,a){if(e.length){for(var o=[],l=0;l<e.length;l++)o[l]=new Et($e(this,e[l].anchor),$e(this,e[l].head||e[l].anchor));r==null&&(r=Math.min(e.length-1,this.sel.primIndex)),fr(this,Sn(this.cm,o,r),a)}}),addSelection:ur(function(e,r,a){var o=this.sel.ranges.slice(0);o.push(new Et($e(this,e),$e(this,r||e))),fr(this,Sn(this.cm,o,o.length-1),a)}),getSelection:function(e){for(var r=this.sel.ranges,a,o=0;o<r.length;o++){var l=zn(this,r[o].from(),r[o].to());a=a?a.concat(l):l}return e===!1?a:a.join(e||this.lineSeparator())},getSelections:function(e){for(var r=[],a=this.sel.ranges,o=0;o<a.length;o++){var l=zn(this,a[o].from(),a[o].to());e!==!1&&(l=l.join(e||this.lineSeparator())),r[o]=l}return r},replaceSelection:function(e,r,a){for(var o=[],l=0;l<this.sel.ranges.length;l++)o[l]=e;this.replaceSelections(o,r,a||"+input")},replaceSelections:ur(function(e,r,a){for(var o=[],l=this.sel,d=0;d<l.ranges.length;d++){var g=l.ranges[d];o[d]={from:g.from(),to:g.to(),text:this.splitLines(e[d]),origin:a}}for(var b=r&&r!="end"&&wn(this,o,r),w=o.length-1;w>=0;w--)Di(this,o[w]);b?Zl(this,b):this.cm&&no(this.cm)}),undo:ur(function(){Na(this,"undo")}),redo:ur(function(){Na(this,"redo")}),undoSelection:ur(function(){Na(this,"undo",!0)}),redoSelection:ur(function(){Na(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,r=0,a=0,o=0;o<e.done.length;o++)e.done[o].ranges||++r;for(var l=0;l<e.undone.length;l++)e.undone[l].ranges||++a;return{undo:r,redo:a}},clearHistory:function(){var e=this;this.history=new Pa(this.history),di(this,function(r){return r.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:Mi(this.history.done),undone:Mi(this.history.undone)}},setHistory:function(e){var r=this.history=new Pa(this.history);r.done=Mi(e.done.slice(0),null,!0),r.undone=Mi(e.undone.slice(0),null,!0)},setGutterMarker:ur(function(e,r,a){return jo(this,e,"gutter",function(o){var l=o.gutterMarkers||(o.gutterMarkers={});return l[r]=a,!a&&en(l)&&(o.gutterMarkers=null),!0})}),clearGutter:ur(function(e){var r=this;this.iter(function(a){a.gutterMarkers&&a.gutterMarkers[e]&&jo(r,a,"gutter",function(){return a.gutterMarkers[e]=null,en(a.gutterMarkers)&&(a.gutterMarkers=null),!0})})}),lineInfo:function(e){var r;if(typeof e=="number"){if(!yi(this,e)||(r=e,e=Ve(this,e),!e))return null}else if(r=Ct(e),r==null)return null;return{line:r,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ur(function(e,r,a){return jo(this,e,r=="gutter"?"gutter":"class",function(o){var l=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass";if(!o[l])o[l]=a;else{if(H(a).test(o[l]))return!1;o[l]+=" "+a}return!0})}),removeLineClass:ur(function(e,r,a){return jo(this,e,r=="gutter"?"gutter":"class",function(o){var l=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass",d=o[l];if(d)if(a==null)o[l]=null;else{var g=d.match(H(a));if(!g)return!1;var b=g.index+g[0].length;o[l]=d.slice(0,g.index)+(!g.index||b==d.length?"":" ")+d.slice(b)||null}else return!1;return!0})}),addLineWidget:ur(function(e,r,a){return Bf(this,e,r,a)}),removeLineWidget:function(e){e.clear()},markText:function(e,r,a){return sn(this,$e(this,e),$e(this,r),a,a&&a.type||"range")},setBookmark:function(e,r){var a={replacedWith:r&&(r.nodeType==null?r.widget:r),insertLeft:r&&r.insertLeft,clearWhenEmpty:!1,shared:r&&r.shared,handleMouseEvents:r&&r.handleMouseEvents};return e=$e(this,e),sn(this,e,e,a,"bookmark")},findMarksAt:function(e){e=$e(this,e);var r=[],a=Ve(this,e.line).markedSpans;if(a)for(var o=0;o<a.length;++o){var l=a[o];(l.from==null||l.from<=e.ch)&&(l.to==null||l.to>=e.ch)&&r.push(l.marker.parent||l.marker)}return r},findMarks:function(e,r,a){e=$e(this,e),r=$e(this,r);var o=[],l=e.line;return this.iter(e.line,r.line+1,function(d){var g=d.markedSpans;if(g)for(var b=0;b<g.length;b++){var w=g[b];!(w.to!=null&&l==e.line&&e.ch>=w.to||w.from==null&&l!=e.line||w.from!=null&&l==r.line&&w.from>=r.ch)&&(!a||a(w.marker))&&o.push(w.marker.parent||w.marker)}++l}),o},getAllMarks:function(){var e=[];return this.iter(function(r){var a=r.markedSpans;if(a)for(var o=0;o<a.length;++o)a[o].from!=null&&e.push(a[o].marker)}),e},posFromIndex:function(e){var r,a=this.first,o=this.lineSeparator().length;return this.iter(function(l){var d=l.text.length+o;if(d>e)return r=e,!0;e-=d,++a}),$e(this,A(a,r))},indexFromPos:function(e){e=$e(this,e);var r=e.ch;if(e.line<this.first||e.ch<0)return 0;var a=this.lineSeparator().length;return this.iter(this.first,e.line,function(o){r+=o.text.length+a}),r},copy:function(e){var r=new Pr(mi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return r.scrollTop=this.scrollTop,r.scrollLeft=this.scrollLeft,r.sel=this.sel,r.extend=!1,e&&(r.history.undoDepth=this.history.undoDepth,r.setHistory(this.getHistory())),r},linkedDoc:function(e){e||(e={});var r=this.first,a=this.first+this.size;e.from!=null&&e.from>r&&(r=e.from),e.to!=null&&e.to<a&&(a=e.to);var o=new Pr(mi(this,r,a),e.mode||this.modeOption,r,this.lineSep,this.direction);return e.sharedHist&&(o.history=this.history),(this.linked||(this.linked=[])).push({doc:o,sharedHist:e.sharedHist}),o.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],lu(o,su(this)),o},unlinkDoc:function(e){if(e instanceof Wt&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var a=this.linked[r];if(a.doc==e){this.linked.splice(r,1),e.unlinkDoc(this),Wf(su(this));break}}if(e.history==this.history){var o=[e.id];di(e,function(l){return o.push(l.id)},!0),e.history=new Pa(null),e.history.done=Mi(this.history.done,o),e.history.undone=Mi(this.history.undone,o)}},iterLinkedDocs:function(e){di(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):gn(e)},lineSeparator:function(){return this.lineSep||`
23
- `},setDirection:ur(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(r){return r.order=null}),this.cm&&Nf(this.cm))})}),Pr.prototype.eachLine=Pr.prototype.iter;var co=0;function Uf(e){var r=this;if(ln(r),!(ct(r,e)||Yn(r.display,e))){wt(e),D&&(co=+new Date);var a=Oi(r,e,!0),o=e.dataTransfer.files;if(!(!a||r.isReadOnly()))if(o&&o.length&&window.FileReader&&window.File)for(var l=o.length,d=Array(l),g=0,b=function(){++g==l&&lr(r,function(){a=$e(r.doc,a);var le={from:a,to:a,text:r.doc.splitLines(d.filter(function(xe){return xe!=null}).join(r.doc.lineSeparator())),origin:"paste"};Di(r.doc,le),Zl(r.doc,fi($e(r.doc,a),$e(r.doc,ci(le))))})()},w=function(le,xe){if(r.options.allowDropFileTypes&&Fe(r.options.allowDropFileTypes,le.type)==-1){b();return}var Ce=new FileReader;Ce.onerror=function(){return b()},Ce.onload=function(){var Le=Ce.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Le)){b();return}d[xe]=Le,b()},Ce.readAsText(le)},O=0;O<o.length;O++)w(o[O],O);else{if(r.state.draggingText&&r.doc.sel.contains(a)>-1){r.state.draggingText(e),setTimeout(function(){return r.display.input.focus()},20);return}try{var U=e.dataTransfer.getData("Text");if(U){var X;if(r.state.draggingText&&!r.state.draggingText.copy&&(X=r.listSelections()),gt(r.doc,fi(a,a)),X)for(var he=0;he<X.length;++he)uo(r.doc,"",X[he].anchor,X[he].head,"drag");r.replaceSelection(U,"around","paste"),r.display.input.focus()}}catch{}}}}function Fa(e,r){if(D&&(!e.state.draggingText||+new Date-co<100)){mr(r);return}if(!(ct(e,r)||Yn(e.display,r))&&(r.dataTransfer.setData("Text",e.getSelection()),r.dataTransfer.effectAllowed="copyMove",r.dataTransfer.setDragImage&&!se)){var a=G("img",null,null,"position: fixed; left: 0; top: 0;");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",re&&(a.width=a.height=1,e.display.wrapper.appendChild(a),a._top=a.offsetTop),r.dataTransfer.setDragImage(a,0,0),re&&a.parentNode.removeChild(a)}}function uu(e,r){var a=Oi(e,r);if(a){var o=document.createDocumentFragment();xa(e,a,o),e.display.dragCursor||(e.display.dragCursor=G("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ge(e.display.dragCursor,o)}}function ln(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function zf(e){if(document.getElementsByClassName){for(var r=document.getElementsByClassName("CodeMirror"),a=[],o=0;o<r.length;o++){var l=r[o].CodeMirror;l&&a.push(l)}a.length&&a[0].operation(function(){for(var d=0;d<a.length;d++)e(a[d])})}}var Ns=!1;function fu(){Ns||(Uo(),Ns=!0)}function Uo(){var e;ne(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,zf(Ge)},100))}),ne(window,"blur",function(){return zf(to)})}function Ge(e){var r=e.display;r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.scrollbarsClipped=!1,e.setSize()}for(var hi={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"},Bt=0;Bt<10;Bt++)hi[Bt+48]=hi[Bt+96]=String(Bt);for(var Ra=65;Ra<=90;Ra++)hi[Ra]=String.fromCharCode(Ra);for(var zo=1;zo<=12;zo++)hi[zo+111]=hi[zo+63235]="F"+zo;var Jn={};Jn.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"},Jn.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"},Jn.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"},Jn.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"]},Jn.default=I?Jn.macDefault:Jn.pcDefault;function _f(e){var r=e.split(/-(?!$)/);e=r[r.length-1];for(var a,o,l,d,g=0;g<r.length-1;g++){var b=r[g];if(/^(cmd|meta|m)$/i.test(b))d=!0;else if(/^a(lt)?$/i.test(b))a=!0;else if(/^(c|ctrl|control)$/i.test(b))o=!0;else if(/^s(hift)?$/i.test(b))l=!0;else throw new Error("Unrecognized modifier name: "+b)}return a&&(e="Alt-"+e),o&&(e="Ctrl-"+e),d&&(e="Cmd-"+e),l&&(e="Shift-"+e),e}function Vf(e){var r={};for(var a in e)if(e.hasOwnProperty(a)){var o=e[a];if(/^(name|fallthrough|(de|at)tach)$/.test(a))continue;if(o=="..."){delete e[a];continue}for(var l=xt(a.split(" "),_f),d=0;d<l.length;d++){var g=void 0,b=void 0;d==l.length-1?(b=l.join(" "),g=o):(b=l.slice(0,d+1).join(" "),g="...");var w=r[b];if(!w)r[b]=g;else if(w!=g)throw new Error("Inconsistent bindings for "+b)}delete e[a]}for(var O in r)e[O]=r[O];return e}function Ri(e,r,a,o){r=_o(r);var l=r.call?r.call(e,o):r[e];if(l===!1)return"nothing";if(l==="...")return"multi";if(l!=null&&a(l))return"handled";if(r.fallthrough){if(Object.prototype.toString.call(r.fallthrough)!="[object Array]")return Ri(e,r.fallthrough,a,o);for(var d=0;d<r.fallthrough.length;d++){var g=Ri(e,r.fallthrough[d],a,o);if(g)return g}}}function cu(e){var r=typeof e=="string"?e:hi[e.keyCode];return r=="Ctrl"||r=="Alt"||r=="Shift"||r=="Mod"}function du(e,r,a){var o=e;return r.altKey&&o!="Alt"&&(e="Alt-"+e),(j?r.metaKey:r.ctrlKey)&&o!="Ctrl"&&(e="Ctrl-"+e),(j?r.ctrlKey:r.metaKey)&&o!="Mod"&&(e="Cmd-"+e),!a&&r.shiftKey&&o!="Shift"&&(e="Shift-"+e),e}function Ds(e,r){if(re&&e.keyCode==34&&e.char)return!1;var a=hi[e.keyCode];return a==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(a=e.code),du(a,e,r))}function _o(e){return typeof e=="string"?Jn[e]:e}function Bi(e,r){for(var a=e.doc.sel.ranges,o=[],l=0;l<a.length;l++){for(var d=r(a[l]);o.length&&z(d.from,Je(o).to)<=0;){var g=o.pop();if(z(g.from,d.from)<0){d.from=g.from;break}}o.push(d)}Vr(e,function(){for(var b=o.length-1;b>=0;b--)uo(e.doc,"",o[b].from,o[b].to,"+delete");no(e)})}function Fs(e,r,a){var o=Ur(e.text,r+a,a);return o<0||o>e.text.length?null:o}function Rs(e,r,a){var o=Fs(e,r.ch,a);return o==null?null:new A(r.line,o,a<0?"after":"before")}function Bs(e,r,a,o,l){if(e){r.doc.direction=="rtl"&&(l=-l);var d=Qe(a,r.doc.direction);if(d){var g=l<0?Je(d):d[0],b=l<0==(g.level==1),w=b?"after":"before",O;if(g.level>0||r.doc.direction=="rtl"){var U=Ci(r,a);O=l<0?a.text.length-1:0;var X=on(r,U,O).top;O=gr(function(he){return on(r,U,he).top==X},l<0==(g.level==1)?g.from:g.to-1,O),w=="before"&&(O=Fs(a,O,1))}else O=l<0?g.to:g.from;return new A(o,O,w)}}return new A(o,l<0?a.text.length:0,l<0?"before":"after")}function hu(e,r,a,o){var l=Qe(r,e.doc.direction);if(!l)return Rs(r,a,o);a.ch>=r.text.length?(a.ch=r.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var d=mt(l,a.ch,a.sticky),g=l[d];if(e.doc.direction=="ltr"&&g.level%2==0&&(o>0?g.to>a.ch:g.from<a.ch))return Rs(r,a,o);var b=function(Me,Oe){return Fs(r,Me instanceof A?Me.ch:Me,Oe)},w,O=function(Me){return e.options.lineWrapping?(w=w||Ci(e,r),Ol(e,r,w,Me)):{begin:0,end:r.text.length}},U=O(a.sticky=="before"?b(a,-1):a.ch);if(e.doc.direction=="rtl"||g.level==1){var X=g.level==1==o<0,he=b(a,X?1:-1);if(he!=null&&(X?he<=g.to&&he<=U.end:he>=g.from&&he>=U.begin)){var le=X?"before":"after";return new A(a.line,he,le)}}var xe=function(Me,Oe,Ne){for(var We=function(kt,ar){return ar?new A(a.line,b(kt,1),"before"):new A(a.line,kt,"after")};Me>=0&&Me<l.length;Me+=Oe){var Ye=l[Me],Ke=Oe>0==(Ye.level!=1),vt=Ke?Ne.begin:b(Ne.end,-1);if(Ye.from<=vt&&vt<Ye.to||(vt=Ke?Ye.from:b(Ye.to,-1),Ne.begin<=vt&&vt<Ne.end))return We(vt,Ke)}},Ce=xe(d+o,o,U);if(Ce)return Ce;var Le=o>0?U.end:b(U.begin,-1);return Le!=null&&!(o>0&&Le==r.text.length)&&(Ce=xe(o>0?0:l.length-1,o,O(Le)),Ce)?Ce:null}var Vo={selectAll:eu,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Dt)},killLine:function(e){return Bi(e,function(r){if(r.empty()){var a=Ve(e.doc,r.head.line).text.length;return r.head.ch==a&&r.head.line<e.lastLine()?{from:r.head,to:A(r.head.line+1,0)}:{from:r.head,to:A(r.head.line,a)}}else return{from:r.from(),to:r.to()}})},deleteLine:function(e){return Bi(e,function(r){return{from:A(r.from().line,0),to:$e(e.doc,A(r.to().line+1,0))}})},delLineLeft:function(e){return Bi(e,function(r){return{from:A(r.from().line,0),to:r.from()}})},delWrappedLineLeft:function(e){return Bi(e,function(r){var a=e.charCoords(r.head,"div").top+5,o=e.coordsChar({left:0,top:a},"div");return{from:o,to:r.from()}})},delWrappedLineRight:function(e){return Bi(e,function(r){var a=e.charCoords(r.head,"div").top+5,o=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div");return{from:r.from(),to:o}})},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(A(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(A(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(r){return pu(e,r.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(r){return $o(e,r.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(r){return $f(e,r.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(r){var a=e.cursorCoords(r.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div")},St)},goLineLeft:function(e){return e.extendSelectionsBy(function(r){var a=e.cursorCoords(r.head,"div").top+5;return e.coordsChar({left:0,top:a},"div")},St)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(r){var a=e.cursorCoords(r.head,"div").top+5,o=e.coordsChar({left:0,top:a},"div");return o.ch<e.getLine(o.line).search(/\S/)?$o(e,r.head):o},St)},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 r=[],a=e.listSelections(),o=e.options.tabSize,l=0;l<a.length;l++){var d=a[l].from(),g=nt(e.getLine(d.line),d.ch,o);r.push(pr(o-g%o))}e.replaceSelections(r)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Vr(e,function(){for(var r=e.listSelections(),a=[],o=0;o<r.length;o++)if(r[o].empty()){var l=r[o].head,d=Ve(e.doc,l.line).text;if(d){if(l.ch==d.length&&(l=new A(l.line,l.ch-1)),l.ch>0)l=new A(l.line,l.ch+1),e.replaceRange(d.charAt(l.ch-1)+d.charAt(l.ch-2),A(l.line,l.ch-2),l,"+transpose");else if(l.line>e.doc.first){var g=Ve(e.doc,l.line-1).text;g&&(l=new A(l.line,1),e.replaceRange(d.charAt(0)+e.doc.lineSeparator()+g.charAt(g.length-1),A(l.line-1,g.length-1),l,"+transpose"))}}a.push(new Et(l,l))}e.setSelections(a)})},newlineAndIndent:function(e){return Vr(e,function(){for(var r=e.listSelections(),a=r.length-1;a>=0;a--)e.replaceRange(e.doc.lineSeparator(),r[a].anchor,r[a].head,"+input");r=e.listSelections();for(var o=0;o<r.length;o++)e.indentLine(r[o].from().line,null,!0);no(e)})},openLine:function(e){return e.replaceSelection(`
24
- `,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function pu(e,r){var a=Ve(e.doc,r),o=bn(a);return o!=a&&(r=Ct(o)),Bs(!0,e,o,r,1)}function $f(e,r){var a=Ve(e.doc,r),o=Xu(a);return o!=a&&(r=Ct(o)),Bs(!0,e,a,r,-1)}function $o(e,r){var a=pu(e,r.line),o=Ve(e.doc,a.line),l=Qe(o,e.doc.direction);if(!l||l[0].level==0){var d=Math.max(a.ch,o.text.search(/\S/)),g=r.line==a.line&&r.ch<=d&&r.ch;return A(a.line,g?0:d,a.sticky)}return a}function Go(e,r,a){if(typeof r=="string"&&(r=Vo[r],!r))return!1;e.display.input.ensurePolled();var o=e.display.shift,l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a&&(e.display.shift=!1),l=r(e)!=it}finally{e.display.shift=o,e.state.suppressEdits=!1}return l}function vu(e,r,a){for(var o=0;o<e.state.keyMaps.length;o++){var l=Ri(r,e.state.keyMaps[o],a,e);if(l)return l}return e.options.extraKeys&&Ri(r,e.options.extraKeys,a,e)||Ri(r,e.options.keyMap,a,e)}var gu=new Ue;function Ko(e,r,a,o){var l=e.state.keySeq;if(l){if(cu(r))return"handled";if(/\'$/.test(r)?e.state.keySeq=null:gu.set(50,function(){e.state.keySeq==l&&(e.state.keySeq=null,e.display.input.reset())}),mu(e,l+" "+r,a,o))return!0}return mu(e,r,a,o)}function mu(e,r,a,o){var l=vu(e,r,o);return l=="multi"&&(e.state.keySeq=r),l=="handled"&&sr(e,"keyHandled",e,r,a),(l=="handled"||l=="multi")&&(wt(a),li(e)),!!l}function yu(e,r){var a=Ds(r,!0);return a?r.shiftKey&&!e.state.keySeq?Ko(e,"Shift-"+a,r,function(o){return Go(e,o,!0)})||Ko(e,a,r,function(o){if(typeof o=="string"?/^go[A-Z]/.test(o):o.motion)return Go(e,o)}):Ko(e,a,r,function(o){return Go(e,o)}):!1}function js(e,r,a){return Ko(e,"'"+a+"'",r,function(o){return Go(e,o,!0)})}var Ws=null;function bu(e){var r=this;if(!(e.target&&e.target!=r.display.input.getField())&&(r.curOp.focus=_e(at(r)),!ct(r,e))){D&&R<11&&e.keyCode==27&&(e.returnValue=!1);var a=e.keyCode;r.display.shift=a==16||e.shiftKey;var o=yu(r,e);re&&(Ws=o?a:null,!o&&a==88&&!Ui&&(I?e.metaKey:e.ctrlKey)&&r.replaceSelection("",null,"cut")),v&&!I&&!o&&a==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),a==18&&!/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)&&Gf(r)}}function Gf(e){var r=e.display.lineDiv;ze(r,"CodeMirror-crosshair");function a(o){(o.keyCode==18||!o.altKey)&&(Y(r,"CodeMirror-crosshair"),je(document,"keyup",a),je(document,"mouseover",a))}ne(document,"keyup",a),ne(document,"mouseover",a)}function xu(e){e.keyCode==16&&(this.doc.sel.shift=!1),ct(this,e)}function Su(e){var r=this;if(!(e.target&&e.target!=r.display.input.getField())&&!(Yn(r.display,e)||ct(r,e)||e.ctrlKey&&!e.altKey||I&&e.metaKey)){var a=e.keyCode,o=e.charCode;if(re&&a==Ws){Ws=null,wt(e);return}if(!(re&&(!e.which||e.which<10)&&yu(r,e))){var l=String.fromCharCode(o??a);l!="\b"&&(js(r,e,l)||r.display.input.onKeyPress(e))}}}var Ba=400,Yo=function(e,r,a){this.time=e,this.pos=r,this.button=a};Yo.prototype.compare=function(e,r,a){return this.time+Ba>e&&z(r,this.pos)==0&&a==this.button};var Xo,Jo;function ja(e,r){var a=+new Date;return Jo&&Jo.compare(a,e,r)?(Xo=Jo=null,"triple"):Xo&&Xo.compare(a,e,r)?(Jo=new Yo(a,e,r),Xo=null,"double"):(Xo=new Yo(a,e,r),Jo=null,"single")}function Hs(e){var r=this,a=r.display;if(!(ct(r,e)||a.activeTouch&&a.input.supportsTouch())){if(a.input.ensurePolled(),a.shift=e.shiftKey,Yn(a,e)){V||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if(!zs(r,e)){var o=Oi(r,e),l=Hn(e),d=o?ja(o,l):"single";Gt(r).focus(),l==1&&r.state.selectingText&&r.state.selectingText(e),!(o&&wu(r,l,o,d,e))&&(l==1?o?Kf(r,o,d,e):yr(e)==a.scroller&&wt(e):l==2?(o&&Ni(r.doc,o),setTimeout(function(){return a.input.focus()},20)):l==3&&(ie?r.display.input.onContextMenu(e):ys(r)))}}}function wu(e,r,a,o,l){var d="Click";return o=="double"?d="Double"+d:o=="triple"&&(d="Triple"+d),d=(r==1?"Left":r==2?"Middle":"Right")+d,Ko(e,du(d,l),l,function(g){if(typeof g=="string"&&(g=Vo[g]),!g)return!1;var b=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),b=g(e,a)!=it}finally{e.state.suppressEdits=!1}return b})}function Cu(e,r,a){var o=e.getOption("configureMouse"),l=o?o(e,r,a):{};if(l.unit==null){var d=F?a.shiftKey&&a.metaKey:a.altKey;l.unit=d?"rectangle":r=="single"?"char":r=="double"?"word":"line"}return(l.extend==null||e.doc.extend)&&(l.extend=e.doc.extend||a.shiftKey),l.addNew==null&&(l.addNew=I?a.metaKey:a.ctrlKey),l.moveOnDrag==null&&(l.moveOnDrag=!(I?a.altKey:a.ctrlKey)),l}function Kf(e,r,a,o){D?setTimeout(ht(wa,e),0):e.curOp.focus=_e(at(e));var l=Cu(e,a,o),d=e.doc.sel,g;e.options.dragDrop&&kr&&!e.isReadOnly()&&a=="single"&&(g=d.contains(r))>-1&&(z((g=d.ranges[g]).from(),r)<0||r.xRel>0)&&(z(g.to(),r)>0||r.xRel<0)?Au(e,o,r,l):Eu(e,o,r,l)}function Au(e,r,a,o){var l=e.display,d=!1,g=lr(e,function(O){V&&(l.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ys(e)),je(l.wrapper.ownerDocument,"mouseup",g),je(l.wrapper.ownerDocument,"mousemove",b),je(l.scroller,"dragstart",w),je(l.scroller,"drop",g),d||(wt(O),o.addNew||Ni(e.doc,a,null,null,o.extend),V&&!se||D&&R==9?setTimeout(function(){l.wrapper.ownerDocument.body.focus({preventScroll:!0}),l.input.focus()},20):l.input.focus())}),b=function(O){d=d||Math.abs(r.clientX-O.clientX)+Math.abs(r.clientY-O.clientY)>=10},w=function(){return d=!0};V&&(l.scroller.draggable=!0),e.state.draggingText=g,g.copy=!o.moveOnDrag,ne(l.wrapper.ownerDocument,"mouseup",g),ne(l.wrapper.ownerDocument,"mousemove",b),ne(l.scroller,"dragstart",w),ne(l.scroller,"drop",g),e.state.delayingBlurEvent=!0,setTimeout(function(){return l.input.focus()},20),l.scroller.dragDrop&&l.scroller.dragDrop()}function Ou(e,r,a){if(a=="char")return new Et(r,r);if(a=="word")return e.findWordAt(r);if(a=="line")return new Et(A(r.line,0),$e(e.doc,A(r.line+1,0)));var o=a(e,r);return new Et(o.from,o.to)}function Eu(e,r,a,o){D&&ys(e);var l=e.display,d=e.doc;wt(r);var g,b,w=d.sel,O=w.ranges;if(o.addNew&&!o.extend?(b=d.sel.contains(a),b>-1?g=O[b]:g=new Et(a,a)):(g=d.sel.primary(),b=d.sel.primIndex),o.unit=="rectangle")o.addNew||(g=new Et(a,a)),a=Oi(e,r,!0,!0),b=-1;else{var U=Ou(e,a,o.unit);o.extend?g=Ia(g,U.anchor,U.head,o.extend):g=U}o.addNew?b==-1?(b=O.length,fr(d,Sn(e,O.concat([g]),b),{scroll:!1,origin:"*mouse"})):O.length>1&&O[b].empty()&&o.unit=="char"&&!o.extend?(fr(d,Sn(e,O.slice(0,b).concat(O.slice(b+1)),0),{scroll:!1,origin:"*mouse"}),w=d.sel):Ma(d,b,g,qe):(b=0,fr(d,new Fr([g],0),qe),w=d.sel);var X=a;function he(Ne){if(z(X,Ne)!=0)if(X=Ne,o.unit=="rectangle"){for(var We=[],Ye=e.options.tabSize,Ke=nt(Ve(d,a.line).text,a.ch,Ye),vt=nt(Ve(d,Ne.line).text,Ne.ch,Ye),kt=Math.min(Ke,vt),ar=Math.max(Ke,vt),Ut=Math.min(a.line,Ne.line),Ze=Math.min(e.lastLine(),Math.max(a.line,Ne.line));Ut<=Ze;Ut++){var Lr=Ve(d,Ut).text,Qt=Kt(Lr,kt,Ye);kt==ar?We.push(new Et(A(Ut,Qt),A(Ut,Qt))):Lr.length>Qt&&We.push(new Et(A(Ut,Qt),A(Ut,Kt(Lr,ar,Ye))))}We.length||We.push(new Et(a,a)),fr(d,Sn(e,w.ranges.slice(0,b).concat(We),b),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ne)}else{var Yt=g,Xt=Ou(e,Ne,o.unit),Mt=Yt.anchor,zt;z(Xt.anchor,Mt)>0?(zt=Xt.head,Mt=yt(Yt.from(),Xt.anchor)):(zt=Xt.anchor,Mt=rt(Yt.to(),Xt.head));var bt=w.ranges.slice(0);bt[b]=Us(e,new Et($e(d,Mt),zt)),fr(d,Sn(e,bt,b),qe)}}var le=l.wrapper.getBoundingClientRect(),xe=0;function Ce(Ne){var We=++xe,Ye=Oi(e,Ne,!0,o.unit=="rectangle");if(Ye)if(z(Ye,X)!=0){e.curOp.focus=_e(at(e)),he(Ye);var Ke=ro(l,d);(Ye.line>=Ke.to||Ye.line<Ke.from)&&setTimeout(lr(e,function(){xe==We&&Ce(Ne)}),150)}else{var vt=Ne.clientY<le.top?-20:Ne.clientY>le.bottom?20:0;vt&&setTimeout(lr(e,function(){xe==We&&(l.scroller.scrollTop+=vt,Ce(Ne))}),50)}}function Le(Ne){e.state.selectingText=!1,xe=1/0,Ne&&(wt(Ne),l.input.focus()),je(l.wrapper.ownerDocument,"mousemove",Me),je(l.wrapper.ownerDocument,"mouseup",Oe),d.history.lastSelOrigin=null}var Me=lr(e,function(Ne){Ne.buttons===0||!Hn(Ne)?Le(Ne):Ce(Ne)}),Oe=lr(e,Le);e.state.selectingText=Oe,ne(l.wrapper.ownerDocument,"mousemove",Me),ne(l.wrapper.ownerDocument,"mouseup",Oe)}function Us(e,r){var a=r.anchor,o=r.head,l=Ve(e.doc,a.line);if(z(a,o)==0&&a.sticky==o.sticky)return r;var d=Qe(l);if(!d)return r;var g=mt(d,a.ch,a.sticky),b=d[g];if(b.from!=a.ch&&b.to!=a.ch)return r;var w=g+(b.from==a.ch==(b.level!=1)?0:1);if(w==0||w==d.length)return r;var O;if(o.line!=a.line)O=(o.line-a.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var U=mt(d,o.ch,o.sticky),X=U-g||(o.ch-a.ch)*(b.level==1?-1:1);U==w-1||U==w?O=X<0:O=X>0}var he=d[w+(O?-1:0)],le=O==(he.level==1),xe=le?he.from:he.to,Ce=le?"after":"before";return a.ch==xe&&a.sticky==Ce?r:new Et(new A(a.line,xe,Ce),o)}function Tu(e,r,a,o){var l,d;if(r.touches)l=r.touches[0].clientX,d=r.touches[0].clientY;else try{l=r.clientX,d=r.clientY}catch{return!1}if(l>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;o&&wt(r);var g=e.display,b=g.lineDiv.getBoundingClientRect();if(d>b.bottom||!_t(e,a))return Wn(r);d-=b.top-g.viewOffset;for(var w=0;w<e.display.gutterSpecs.length;++w){var O=g.gutters.childNodes[w];if(O&&O.getBoundingClientRect().right>=l){var U=_n(e.doc,d),X=e.display.gutterSpecs[w];return tt(e,a,e,U,X.className,r),Wn(r)}}}function zs(e,r){return Tu(e,r,"gutterClick",!0)}function ku(e,r){Yn(e.display,r)||Pu(e,r)||ct(e,r,"contextmenu")||ie||e.display.input.onContextMenu(r)}function Pu(e,r){return _t(e,"gutterContextMenu")?Tu(e,r,"gutterContextMenu",!1):!1}function _s(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Io(e)}var ho={toString:function(){return"CodeMirror.Init"}},Qo={},po={};function Zo(e){var r=e.optionHandlers;function a(o,l,d,g){e.defaults[o]=l,d&&(r[o]=g?function(b,w,O){O!=ho&&d(b,w,O)}:d)}e.defineOption=a,e.Init=ho,a("value","",function(o,l){return o.setValue(l)},!0),a("mode",null,function(o,l){o.doc.modeOption=l,Ts(o)},!0),a("indentUnit",2,Ts,!0),a("indentWithTabs",!1),a("smartIndent",!0),a("tabSize",4,function(o){Ro(o),Io(o),Dr(o)},!0),a("lineSeparator",null,function(o,l){if(o.doc.lineSep=l,!!l){var d=[],g=o.doc.first;o.doc.iter(function(w){for(var O=0;;){var U=w.text.indexOf(l,O);if(U==-1)break;O=U+l.length,d.push(A(g,U))}g++});for(var b=d.length-1;b>=0;b--)uo(o.doc,l,d[b],A(d[b].line,d[b].ch+l.length))}}),a("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(o,l,d){o.state.specialChars=new RegExp(l.source+(l.test(" ")?"":"| "),"g"),d!=ho&&o.refresh()}),a("specialCharPlaceholder",Zu,function(o){return o.refresh()},!0),a("electricChars",!0),a("inputStyle",S?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),a("spellcheck",!1,function(o,l){return o.getInputField().spellcheck=l},!0),a("autocorrect",!1,function(o,l){return o.getInputField().autocorrect=l},!0),a("autocapitalize",!1,function(o,l){return o.getInputField().autocapitalize=l},!0),a("rtlMoveVisually",!K),a("wholeLineUpdateBefore",!0),a("theme","default",function(o){_s(o),so(o)},!0),a("keyMap","default",function(o,l,d){var g=_o(l),b=d!=ho&&_o(d);b&&b.detach&&b.detach(o,g),g.attach&&g.attach(o,b||null)}),a("extraKeys",null),a("configureMouse",null),a("lineWrapping",!1,Yf,!0),a("gutters",[],function(o,l){o.display.gutterSpecs=Ta(l,o.options.lineNumbers),so(o)},!0),a("fixedGutter",!0,function(o,l){o.display.gutters.style.left=l?gs(o.display)+"px":"0",o.refresh()},!0),a("coverGutterNextToScrollbar",!1,function(o){return ao(o)},!0),a("scrollbarStyle","native",function(o){Nl(o),ao(o),o.display.scrollbars.setScrollTop(o.doc.scrollTop),o.display.scrollbars.setScrollLeft(o.doc.scrollLeft)},!0),a("lineNumbers",!1,function(o,l){o.display.gutterSpecs=Ta(o.options.gutters,l),so(o)},!0),a("firstLineNumber",1,so,!0),a("lineNumberFormatter",function(o){return o},so,!0),a("showCursorWhenSelecting",!1,eo,!0),a("resetSelectionOnContextMenu",!0),a("lineWiseCopyCut",!0),a("pasteLinesPerSelection",!0),a("selectionsMayTouch",!1),a("readOnly",!1,function(o,l){l=="nocursor"&&(to(o),o.display.input.blur()),o.display.input.readOnlyChanged(l)}),a("screenReaderLabel",null,function(o,l){l=l===""?null:l,o.display.input.screenReaderLabelChanged(l)}),a("disableInput",!1,function(o,l){l||o.display.input.reset()},!0),a("dragDrop",!0,vo),a("allowDropFileTypes",null),a("cursorBlinkRate",530),a("cursorScrollMargin",0),a("cursorHeight",1,eo,!0),a("singleCursorHeightPerLine",!0,eo,!0),a("workTime",100),a("workDelay",100),a("flattenSpans",!0,Ro,!0),a("addModeClass",!1,Ro,!0),a("pollInterval",100),a("undoDepth",200,function(o,l){return o.doc.history.undoDepth=l}),a("historyEventDelay",1250),a("viewportMargin",10,function(o){return o.refresh()},!0),a("maxHighlightLength",1e4,Ro,!0),a("moveInputWithCursor",!0,function(o,l){l||o.display.input.resetPosition()}),a("tabindex",null,function(o,l){return o.display.input.getField().tabIndex=l||""}),a("autofocus",null),a("direction","ltr",function(o,l){return o.doc.setDirection(l)},!0),a("phrases",null)}function vo(e,r,a){var o=a&&a!=ho;if(!r!=!o){var l=e.display.dragFunctions,d=r?ne:je;d(e.display.scroller,"dragstart",l.start),d(e.display.scroller,"dragenter",l.enter),d(e.display.scroller,"dragover",l.over),d(e.display.scroller,"dragleave",l.leave),d(e.display.scroller,"drop",l.drop)}}function Yf(e){e.options.lineWrapping?(ze(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Y(e.display.wrapper,"CodeMirror-wrap"),ts(e)),ms(e),Dr(e),Io(e),setTimeout(function(){return ao(e)},100)}function Wt(e,r){var a=this;if(!(this instanceof Wt))return new Wt(e,r);this.options=r=r?Ot(r):{},Ot(Qo,r,!1);var o=r.value;typeof o=="string"?o=new Pr(o,r.mode,null,r.lineSeparator,r.direction):r.mode&&(o.modeOption=r.mode),this.doc=o;var l=new Wt.inputStyles[r.inputStyle](this),d=this.display=new If(e,o,l,r);d.wrapper.CodeMirror=this,_s(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Nl(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 Ue,keySeq:null,specialChars:null},r.autofocus&&!S&&d.input.focus(),D&&R<11&&setTimeout(function(){return a.display.input.reset(!0)},20),Xf(this),fu(),Pi(this),this.curOp.forceUpdate=!0,Vl(this,o),r.autofocus&&!S||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&bs(a)},20):to(this);for(var g in po)po.hasOwnProperty(g)&&po[g](this,r[g],ho);jl(this),r.finishInit&&r.finishInit(this);for(var b=0;b<Vs.length;++b)Vs[b](this);Li(this),V&&r.lineWrapping&&getComputedStyle(d.lineDiv).textRendering=="optimizelegibility"&&(d.lineDiv.style.textRendering="auto")}Wt.defaults=Qo,Wt.optionHandlers=po;function Xf(e){var r=e.display;ne(r.scroller,"mousedown",lr(e,Hs)),D&&R<11?ne(r.scroller,"dblclick",lr(e,function(w){if(!ct(e,w)){var O=Oi(e,w);if(!(!O||zs(e,w)||Yn(e.display,w))){wt(w);var U=e.findWordAt(O);Ni(e.doc,U.anchor,U.head)}}})):ne(r.scroller,"dblclick",function(w){return ct(e,w)||wt(w)}),ne(r.scroller,"contextmenu",function(w){return ku(e,w)}),ne(r.input.getField(),"contextmenu",function(w){r.scroller.contains(w.target)||ku(e,w)});var a,o={end:0};function l(){r.activeTouch&&(a=setTimeout(function(){return r.activeTouch=null},1e3),o=r.activeTouch,o.end=+new Date)}function d(w){if(w.touches.length!=1)return!1;var O=w.touches[0];return O.radiusX<=1&&O.radiusY<=1}function g(w,O){if(O.left==null)return!0;var U=O.left-w.left,X=O.top-w.top;return U*U+X*X>20*20}ne(r.scroller,"touchstart",function(w){if(!ct(e,w)&&!d(w)&&!zs(e,w)){r.input.ensurePolled(),clearTimeout(a);var O=+new Date;r.activeTouch={start:O,moved:!1,prev:O-o.end<=300?o:null},w.touches.length==1&&(r.activeTouch.left=w.touches[0].pageX,r.activeTouch.top=w.touches[0].pageY)}}),ne(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),ne(r.scroller,"touchend",function(w){var O=r.activeTouch;if(O&&!Yn(r,w)&&O.left!=null&&!O.moved&&new Date-O.start<300){var U=e.coordsChar(r.activeTouch,"page"),X;!O.prev||g(O,O.prev)?X=new Et(U,U):!O.prev.prev||g(O,O.prev.prev)?X=e.findWordAt(U):X=new Et(A(U.line,0),$e(e.doc,A(U.line+1,0))),e.setSelection(X.anchor,X.head),e.focus(),wt(w)}l()}),ne(r.scroller,"touchcancel",l),ne(r.scroller,"scroll",function(){r.scroller.clientHeight&&(io(e,r.scroller.scrollTop),ki(e,r.scroller.scrollLeft,!0),tt(e,"scroll",e))}),ne(r.scroller,"mousewheel",function(w){return Ul(e,w)}),ne(r.scroller,"DOMMouseScroll",function(w){return Ul(e,w)}),ne(r.wrapper,"scroll",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(w){ct(e,w)||mr(w)},over:function(w){ct(e,w)||(uu(e,w),mr(w))},start:function(w){return Fa(e,w)},drop:lr(e,Uf),leave:function(w){ct(e,w)||ln(e)}};var b=r.input.getField();ne(b,"keyup",function(w){return xu.call(e,w)}),ne(b,"keydown",lr(e,bu)),ne(b,"keypress",lr(e,Su)),ne(b,"focus",function(w){return bs(e,w)}),ne(b,"blur",function(w){return to(e,w)})}var Vs=[];Wt.defineInitHook=function(e){return Vs.push(e)};function go(e,r,a,o){var l=e.doc,d;a==null&&(a="add"),a=="smart"&&(l.mode.indent?d=Vi(e,r).state:a="prev");var g=e.options.tabSize,b=Ve(l,r),w=nt(b.text,null,g);b.stateAfter&&(b.stateAfter=null);var O=b.text.match(/^\s*/)[0],U;if(!o&&!/\S/.test(b.text))U=0,a="not";else if(a=="smart"&&(U=l.mode.indent(d,b.text.slice(O.length),b.text),U==it||U>150)){if(!o)return;a="prev"}a=="prev"?r>l.first?U=nt(Ve(l,r-1).text,null,g):U=0:a=="add"?U=w+e.options.indentUnit:a=="subtract"?U=w-e.options.indentUnit:typeof a=="number"&&(U=w+a),U=Math.max(0,U);var X="",he=0;if(e.options.indentWithTabs)for(var le=Math.floor(U/g);le;--le)he+=g,X+=" ";if(he<U&&(X+=pr(U-he)),X!=O)return uo(l,X,A(r,0),A(r,O.length),"+input"),b.stateAfter=null,!0;for(var xe=0;xe<l.sel.ranges.length;xe++){var Ce=l.sel.ranges[xe];if(Ce.head.line==r&&Ce.head.ch<O.length){var Le=A(r,O.length);Ma(l,xe,new Et(Le,Le));break}}}var Rr=null;function Wa(e){Rr=e}function $s(e,r,a,o,l){var d=e.doc;e.display.shift=!1,o||(o=d.sel);var g=+new Date-200,b=l=="paste"||e.state.pasteIncoming>g,w=gn(r),O=null;if(b&&o.ranges.length>1)if(Rr&&Rr.text.join(`
25
- `)==r){if(o.ranges.length%Rr.text.length==0){O=[];for(var U=0;U<Rr.text.length;U++)O.push(d.splitLines(Rr.text[U]))}}else w.length==o.ranges.length&&e.options.pasteLinesPerSelection&&(O=xt(w,function(Me){return[Me]}));for(var X=e.curOp.updateInput,he=o.ranges.length-1;he>=0;he--){var le=o.ranges[he],xe=le.from(),Ce=le.to();le.empty()&&(a&&a>0?xe=A(xe.line,xe.ch-a):e.state.overwrite&&!b?Ce=A(Ce.line,Math.min(Ve(d,Ce.line).text.length,Ce.ch+Je(w).length)):b&&Rr&&Rr.lineWise&&Rr.text.join(`
26
- `)==w.join(`
27
- `)&&(xe=Ce=A(xe.line,0)));var Le={from:xe,to:Ce,text:O?O[he%O.length]:w,origin:l||(b?"paste":e.state.cutIncoming>g?"cut":"+input")};Di(e.doc,Le),sr(e,"inputRead",e,Le)}r&&!b&&Iu(e,r),no(e),e.curOp.updateInput<2&&(e.curOp.updateInput=X),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Lu(e,r){var a=e.clipboardData&&e.clipboardData.getData("Text");if(a)return e.preventDefault(),!r.isReadOnly()&&!r.options.disableInput&&r.hasFocus()&&Vr(r,function(){return $s(r,a,0,null,"paste")}),!0}function Iu(e,r){if(!(!e.options.electricChars||!e.options.smartIndent))for(var a=e.doc.sel,o=a.ranges.length-1;o>=0;o--){var l=a.ranges[o];if(!(l.head.ch>100||o&&a.ranges[o-1].head.line==l.head.line)){var d=e.getModeAt(l.head),g=!1;if(d.electricChars){for(var b=0;b<d.electricChars.length;b++)if(r.indexOf(d.electricChars.charAt(b))>-1){g=go(e,l.head.line,"smart");break}}else d.electricInput&&d.electricInput.test(Ve(e.doc,l.head.line).text.slice(0,l.head.ch))&&(g=go(e,l.head.line,"smart"));g&&sr(e,"electricInput",e,l.head.line)}}}function Gs(e){for(var r=[],a=[],o=0;o<e.doc.sel.ranges.length;o++){var l=e.doc.sel.ranges[o].head.line,d={anchor:A(l,0),head:A(l+1,0)};a.push(d),r.push(e.getRange(d.anchor,d.head))}return{text:r,ranges:a}}function qo(e,r,a,o){e.setAttribute("autocorrect",a?"on":"off"),e.setAttribute("autocapitalize",o?"on":"off"),e.setAttribute("spellcheck",!!r)}function Mu(){var e=G("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),r=G("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return V?e.style.width="1000px":e.setAttribute("wrap","off"),J&&(e.style.border="1px solid black"),r}function Nu(e){var r=e.optionHandlers,a=e.helpers={};e.prototype={constructor:e,focus:function(){Gt(this).focus(),this.display.input.focus()},setOption:function(o,l){var d=this.options,g=d[o];d[o]==l&&o!="mode"||(d[o]=l,r.hasOwnProperty(o)&&lr(this,r[o])(this,l,g),tt(this,"optionChange",this,o))},getOption:function(o){return this.options[o]},getDoc:function(){return this.doc},addKeyMap:function(o,l){this.state.keyMaps[l?"push":"unshift"](_o(o))},removeKeyMap:function(o){for(var l=this.state.keyMaps,d=0;d<l.length;++d)if(l[d]==o||l[d].name==o)return l.splice(d,1),!0},addOverlay:Sr(function(o,l){var d=o.token?o:e.getMode(this.options,o);if(d.startState)throw new Error("Overlays may not be stateful.");Lt(this.state.overlays,{mode:d,modeSpec:o,opaque:l&&l.opaque,priority:l&&l.priority||0},function(g){return g.priority}),this.state.modeGen++,Dr(this)}),removeOverlay:Sr(function(o){for(var l=this.state.overlays,d=0;d<l.length;++d){var g=l[d].modeSpec;if(g==o||typeof o=="string"&&g.name==o){l.splice(d,1),this.state.modeGen++,Dr(this);return}}}),indentLine:Sr(function(o,l,d){typeof l!="string"&&typeof l!="number"&&(l==null?l=this.options.smartIndent?"smart":"prev":l=l?"add":"subtract"),yi(this.doc,o)&&go(this,o,l,d)}),indentSelection:Sr(function(o){for(var l=this.doc.sel.ranges,d=-1,g=0;g<l.length;g++){var b=l[g];if(b.empty())b.head.line>d&&(go(this,b.head.line,o,!0),d=b.head.line,g==this.doc.sel.primIndex&&no(this));else{var w=b.from(),O=b.to(),U=Math.max(d,w.line);d=Math.min(this.lastLine(),O.line-(O.ch?0:1))+1;for(var X=U;X<d;++X)go(this,X,o);var he=this.doc.sel.ranges;w.ch==0&&l.length==he.length&&he[g].from().ch>0&&Ma(this.doc,g,new Et(w,he[g].to()),Dt)}}}),getTokenAt:function(o,l){return bi(this,o,l)},getLineTokens:function(o,l){return bi(this,A(o),l,!0)},getTokenTypeAt:function(o){o=$e(this.doc,o);var l=Qa(this,Ve(this.doc,o.line)),d=0,g=(l.length-1)/2,b=o.ch,w;if(b==0)w=l[2];else for(;;){var O=d+g>>1;if((O?l[O*2-1]:0)>=b)g=O;else if(l[O*2+1]<b)d=O+1;else{w=l[O*2+2];break}}var U=w?w.indexOf("overlay "):-1;return U<0?w:U==0?null:w.slice(0,U-1)},getModeAt:function(o){var l=this.doc.mode;return l.innerMode?e.innerMode(l,this.getTokenAt(o).state).mode:l},getHelper:function(o,l){return this.getHelpers(o,l)[0]},getHelpers:function(o,l){var d=[];if(!a.hasOwnProperty(l))return d;var g=a[l],b=this.getModeAt(o);if(typeof b[l]=="string")g[b[l]]&&d.push(g[b[l]]);else if(b[l])for(var w=0;w<b[l].length;w++){var O=g[b[l][w]];O&&d.push(O)}else b.helperType&&g[b.helperType]?d.push(g[b.helperType]):g[b.name]&&d.push(g[b.name]);for(var U=0;U<g._global.length;U++){var X=g._global[U];X.pred(b,this)&&Fe(d,X.val)==-1&&d.push(X.val)}return d},getStateAfter:function(o,l){var d=this.doc;return o=At(d,o??d.first+d.size-1),Vi(this,o+1,l).state},cursorCoords:function(o,l){var d,g=this.doc.sel.primary();return o==null?d=g.head:typeof o=="object"?d=$e(this.doc,o):d=o?g.from():g.to(),an(this,d,l||"page")},charCoords:function(o,l){return ya(this,$e(this.doc,o),l||"page")},coordsChar:function(o,l){return o=Cl(this,o,l||"page"),No(this,o.left,o.top)},lineAtHeight:function(o,l){return o=Cl(this,{top:o,left:0},l||"page").top,_n(this.doc,o+this.display.viewOffset)},heightAtLine:function(o,l,d){var g=!1,b;if(typeof o=="number"){var w=this.doc.first+this.doc.size-1;o<this.doc.first?o=this.doc.first:o>w&&(o=w,g=!0),b=Ve(this.doc,o)}else b=o;return Mo(this,b,{top:0,left:0},l||"page",d||g).top+(g?this.doc.height-Gn(b):0)},defaultTextHeight:function(){return Zi(this.display)},defaultCharWidth:function(){return qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(o,l,d,g,b){var w=this.display;o=an(this,$e(this.doc,o));var O=o.bottom,U=o.left;if(l.style.position="absolute",l.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(l),w.sizer.appendChild(l),g=="over")O=o.top;else if(g=="above"||g=="near"){var X=Math.max(w.wrapper.clientHeight,this.doc.height),he=Math.max(w.sizer.clientWidth,w.lineSpace.clientWidth);(g=="above"||o.bottom+l.offsetHeight>X)&&o.top>l.offsetHeight?O=o.top-l.offsetHeight:o.bottom+l.offsetHeight<=X&&(O=o.bottom),U+l.offsetWidth>he&&(U=he-l.offsetWidth)}l.style.top=O+"px",l.style.left=l.style.right="",b=="right"?(U=w.sizer.clientWidth-l.offsetWidth,l.style.right="0px"):(b=="left"?U=0:b=="middle"&&(U=(w.sizer.clientWidth-l.offsetWidth)/2),l.style.left=U+"px"),d&&xf(this,{left:U,top:O,right:U+l.offsetWidth,bottom:O+l.offsetHeight})},triggerOnKeyDown:Sr(bu),triggerOnKeyPress:Sr(Su),triggerOnKeyUp:xu,triggerOnMouseDown:Sr(Hs),execCommand:function(o){if(Vo.hasOwnProperty(o))return Vo[o].call(null,this)},triggerElectric:Sr(function(o){Iu(this,o)}),findPosH:function(o,l,d,g){var b=1;l<0&&(b=-1,l=-l);for(var w=$e(this.doc,o),O=0;O<l&&(w=mo(this.doc,w,b,d,g),!w.hitSide);++O);return w},moveH:Sr(function(o,l){var d=this;this.extendSelectionsBy(function(g){return d.display.shift||d.doc.extend||g.empty()?mo(d.doc,g.head,o,l,d.options.rtlMoveVisually):o<0?g.from():g.to()},St)}),deleteH:Sr(function(o,l){var d=this.doc.sel,g=this.doc;d.somethingSelected()?g.replaceSelection("",null,"+delete"):Bi(this,function(b){var w=mo(g,b.head,o,l,!1);return o<0?{from:w,to:b.head}:{from:b.head,to:w}})}),findPosV:function(o,l,d,g){var b=1,w=g;l<0&&(b=-1,l=-l);for(var O=$e(this.doc,o),U=0;U<l;++U){var X=an(this,O,"div");if(w==null?w=X.left:X.left=w,O=Du(this,X,b,d),O.hitSide)break}return O},moveV:Sr(function(o,l){var d=this,g=this.doc,b=[],w=!this.display.shift&&!g.extend&&g.sel.somethingSelected();if(g.extendSelectionsBy(function(U){if(w)return o<0?U.from():U.to();var X=an(d,U.head,"div");U.goalColumn!=null&&(X.left=U.goalColumn),b.push(X.left);var he=Du(d,X,o,l);return l=="page"&&U==g.sel.primary()&&ws(d,ya(d,he,"div").top-X.top),he},St),b.length)for(var O=0;O<g.sel.ranges.length;O++)g.sel.ranges[O].goalColumn=b[O]}),findWordAt:function(o){var l=this.doc,d=Ve(l,o.line).text,g=o.ch,b=o.ch;if(d){var w=this.getHelper(o,"wordChars");(o.sticky=="before"||b==d.length)&&g?--g:++b;for(var O=d.charAt(g),U=Hr(O,w)?function(X){return Hr(X,w)}:/\s/.test(O)?function(X){return/\s/.test(X)}:function(X){return!/\s/.test(X)&&!Hr(X)};g>0&&U(d.charAt(g-1));)--g;for(;b<d.length&&U(d.charAt(b));)++b}return new Et(A(o.line,g),A(o.line,b))},toggleOverwrite:function(o){o!=null&&o==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?ze(this.display.cursorDiv,"CodeMirror-overwrite"):Y(this.display.cursorDiv,"CodeMirror-overwrite"),tt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==_e(at(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Sr(function(o,l){Ti(this,o,l)}),getScrollInfo:function(){var o=this.display.scroller;return{left:o.scrollLeft,top:o.scrollTop,height:o.scrollHeight-Jr(this)-this.display.barHeight,width:o.scrollWidth-Jr(this)-this.display.barWidth,clientHeight:ga(this),clientWidth:xn(this)}},scrollIntoView:Sr(function(o,l){o==null?(o={from:this.doc.sel.primary().head,to:null},l==null&&(l=this.options.cursorScrollMargin)):typeof o=="number"?o={from:A(o,0),to:null}:o.from==null&&(o={from:o,to:null}),o.to||(o.to=o.from),o.margin=l||0,o.from.line!=null?Pl(this,o):Ll(this,o.from,o.to,o.margin)}),setSize:Sr(function(o,l){var d=this,g=function(w){return typeof w=="number"||/^\d+$/.test(String(w))?w+"px":w};o!=null&&(this.display.wrapper.style.width=g(o)),l!=null&&(this.display.wrapper.style.height=g(l)),this.options.lineWrapping&&us(this);var b=this.display.viewFrom;this.doc.iter(b,this.display.viewTo,function(w){if(w.widgets){for(var O=0;O<w.widgets.length;O++)if(w.widgets[O].noHScroll){ai(d,b,"widget");break}}++b}),this.curOp.forceUpdate=!0,tt(this,"refresh",this)}),operation:function(o){return Vr(this,o)},startOperation:function(){return Pi(this)},endOperation:function(){return Li(this)},refresh:Sr(function(){var o=this.display.cachedTextHeight;Dr(this),this.curOp.forceUpdate=!0,Io(this),Ti(this,this.doc.scrollLeft,this.doc.scrollTop),Es(this.display),(o==null||Math.abs(o-Zi(this.display))>.5||this.options.lineWrapping)&&ms(this),tt(this,"refresh",this)}),swapDoc:Sr(function(o){var l=this.doc;return l.cm=null,this.state.selectingText&&this.state.selectingText(),Vl(this,o),Io(this),this.display.input.reset(),Ti(this,o.scrollLeft,o.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,l),l}),phrase:function(o){var l=this.options.phrases;return l&&Object.prototype.hasOwnProperty.call(l,o)?l[o]:o},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}},Tr(e),e.registerHelper=function(o,l,d){a.hasOwnProperty(o)||(a[o]=e[o]={_global:[]}),a[o][l]=d},e.registerGlobalHelper=function(o,l,d,g){e.registerHelper(o,l,g),a[o]._global.push({pred:d,val:g})}}function mo(e,r,a,o,l){var d=r,g=a,b=Ve(e,r.line),w=l&&e.direction=="rtl"?-a:a;function O(){var Oe=r.line+w;return Oe<e.first||Oe>=e.first+e.size?!1:(r=new A(Oe,r.ch,r.sticky),b=Ve(e,Oe))}function U(Oe){var Ne;if(o=="codepoint"){var We=b.text.charCodeAt(r.ch+(a>0?0:-1));if(isNaN(We))Ne=null;else{var Ye=a>0?We>=55296&&We<56320:We>=56320&&We<57343;Ne=new A(r.line,Math.max(0,Math.min(b.text.length,r.ch+a*(Ye?2:1))),-a)}}else l?Ne=hu(e.cm,b,r,a):Ne=Rs(b,r,a);if(Ne==null)if(!Oe&&O())r=Bs(l,e.cm,b,r.line,w);else return!1;else r=Ne;return!0}if(o=="char"||o=="codepoint")U();else if(o=="column")U(!0);else if(o=="word"||o=="group")for(var X=null,he=o=="group",le=e.cm&&e.cm.getHelper(r,"wordChars"),xe=!0;!(a<0&&!U(!xe));xe=!1){var Ce=b.text.charAt(r.ch)||`
28
- `,Le=Hr(Ce,le)?"w":he&&Ce==`
29
- `?"n":!he||/\s/.test(Ce)?null:"p";if(he&&!xe&&!Le&&(Le="s"),X&&X!=Le){a<0&&(a=1,U(),r.sticky="after");break}if(Le&&(X=Le),a>0&&!U(!xe))break}var Me=An(e,r,d,g,!0);return Se(d,Me)&&(Me.hitSide=!0),Me}function Du(e,r,a,o){var l=e.doc,d=r.left,g;if(o=="page"){var b=Math.min(e.display.wrapper.clientHeight,Gt(e).innerHeight||l(e).documentElement.clientHeight),w=Math.max(b-.5*Zi(e.display),3);g=(a>0?r.bottom:r.top)+a*w}else o=="line"&&(g=a>0?r.bottom+3:r.top-3);for(var O;O=No(e,d,g),!!O.outside;){if(a<0?g<=0:g>=l.height){O.hitSide=!0;break}g+=a*5}return O}var It=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ue,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};It.prototype.init=function(e){var r=this,a=this,o=a.cm,l=a.div=e.lineDiv;l.contentEditable=!0,qo(l,o.options.spellcheck,o.options.autocorrect,o.options.autocapitalize);function d(b){for(var w=b.target;w;w=w.parentNode){if(w==l)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(w.className))break}return!1}ne(l,"paste",function(b){!d(b)||ct(o,b)||Lu(b,o)||R<=11&&setTimeout(lr(o,function(){return r.updateFromDOM()}),20)}),ne(l,"compositionstart",function(b){r.composing={data:b.data,done:!1}}),ne(l,"compositionupdate",function(b){r.composing||(r.composing={data:b.data,done:!1})}),ne(l,"compositionend",function(b){r.composing&&(b.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),ne(l,"touchstart",function(){return a.forceCompositionEnd()}),ne(l,"input",function(){r.composing||r.readFromDOMSoon()});function g(b){if(!(!d(b)||ct(o,b))){if(o.somethingSelected())Wa({lineWise:!1,text:o.getSelections()}),b.type=="cut"&&o.replaceSelection("",null,"cut");else if(o.options.lineWiseCopyCut){var w=Gs(o);Wa({lineWise:!0,text:w.text}),b.type=="cut"&&o.operation(function(){o.setSelections(w.ranges,0,Dt),o.replaceSelection("",null,"cut")})}else return;if(b.clipboardData){b.clipboardData.clearData();var O=Rr.text.join(`
30
- `);if(b.clipboardData.setData("Text",O),b.clipboardData.getData("Text")==O){b.preventDefault();return}}var U=Mu(),X=U.firstChild;qo(X),o.display.lineSpace.insertBefore(U,o.display.lineSpace.firstChild),X.value=Rr.text.join(`
31
- `);var he=_e(l.ownerDocument);ft(X),setTimeout(function(){o.display.lineSpace.removeChild(U),he.focus(),he==l&&a.showPrimarySelection()},50)}}ne(l,"copy",g),ne(l,"cut",g)},It.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},It.prototype.prepareSelection=function(){var e=Do(this.cm,!1);return e.focus=_e(this.div.ownerDocument)==this.div,e},It.prototype.showSelection=function(e,r){!e||!this.cm.display.view.length||((e.focus||r)&&this.showPrimarySelection(),this.showMultipleSelections(e))},It.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},It.prototype.showPrimarySelection=function(){var e=this.getSelection(),r=this.cm,a=r.doc.sel.primary(),o=a.from(),l=a.to();if(r.display.viewTo==r.display.viewFrom||o.line>=r.display.viewTo||l.line<r.display.viewFrom){e.removeAllRanges();return}var d=Ks(r,e.anchorNode,e.anchorOffset),g=Ks(r,e.focusNode,e.focusOffset);if(!(d&&!d.bad&&g&&!g.bad&&z(yt(d,g),o)==0&&z(rt(d,g),l)==0)){var b=r.display.view,w=o.line>=r.display.viewFrom&&Jf(r,o)||{node:b[0].measure.map[2],offset:0},O=l.line<r.display.viewTo&&Jf(r,l);if(!O){var U=b[b.length-1].measure,X=U.maps?U.maps[U.maps.length-1]:U.map;O={node:X[X.length-1],offset:X[X.length-2]-X[X.length-3]}}if(!w||!O){e.removeAllRanges();return}var he=e.rangeCount&&e.getRangeAt(0),le;try{le=ee(w.node,w.offset,O.offset,O.node)}catch{}le&&(!v&&r.state.focused?(e.collapse(w.node,w.offset),le.collapsed||(e.removeAllRanges(),e.addRange(le))):(e.removeAllRanges(),e.addRange(le)),he&&e.anchorNode==null?e.addRange(he):v&&this.startGracePeriod()),this.rememberSelection()}},It.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)},It.prototype.showMultipleSelections=function(e){ge(this.cm.display.cursorDiv,e.cursors),ge(this.cm.display.selectionDiv,e.selection)},It.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},It.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var r=e.getRangeAt(0).commonAncestorContainer;return He(this.div,r)},It.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||_e(this.div.ownerDocument)!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},It.prototype.blur=function(){this.div.blur()},It.prototype.getField=function(){return this.div},It.prototype.supportsTouch=function(){return!0},It.prototype.receivedFocus=function(){var e=this,r=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Vr(this.cm,function(){return r.cm.curOp.selectionChanged=!0});function a(){r.cm.state.focused&&(r.pollSelection(),r.polling.set(r.cm.options.pollInterval,a))}this.polling.set(this.cm.options.pollInterval,a)},It.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},It.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),r=this.cm;if(M&&Z&&this.cm.display.gutterSpecs.length&&Qf(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var a=Ks(r,e.anchorNode,e.anchorOffset),o=Ks(r,e.focusNode,e.focusOffset);a&&o&&Vr(r,function(){fr(r.doc,fi(a,o),Dt),(a.bad||o.bad)&&(r.curOp.selectionChanged=!0)})}}},It.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,r=e.display,a=e.doc.sel.primary(),o=a.from(),l=a.to();if(o.ch==0&&o.line>e.firstLine()&&(o=A(o.line-1,Ve(e.doc,o.line-1).length)),l.ch==Ve(e.doc,l.line).text.length&&l.line<e.lastLine()&&(l=A(l.line+1,0)),o.line<r.viewFrom||l.line>r.viewTo-1)return!1;var d,g,b;o.line==r.viewFrom||(d=Ei(e,o.line))==0?(g=Ct(r.view[0].line),b=r.view[0].node):(g=Ct(r.view[d].line),b=r.view[d-1].node.nextSibling);var w=Ei(e,l.line),O,U;if(w==r.view.length-1?(O=r.viewTo-1,U=r.lineDiv.lastChild):(O=Ct(r.view[w+1].line)-1,U=r.view[w+1].node.previousSibling),!b)return!1;for(var X=e.doc.splitLines(Fu(e,b,U,g,O)),he=zn(e.doc,A(g,0),A(O,Ve(e.doc,O).text.length));X.length>1&&he.length>1;)if(Je(X)==Je(he))X.pop(),he.pop(),O--;else if(X[0]==he[0])X.shift(),he.shift(),g++;else break;for(var le=0,xe=0,Ce=X[0],Le=he[0],Me=Math.min(Ce.length,Le.length);le<Me&&Ce.charCodeAt(le)==Le.charCodeAt(le);)++le;for(var Oe=Je(X),Ne=Je(he),We=Math.min(Oe.length-(X.length==1?le:0),Ne.length-(he.length==1?le:0));xe<We&&Oe.charCodeAt(Oe.length-xe-1)==Ne.charCodeAt(Ne.length-xe-1);)++xe;if(X.length==1&&he.length==1&&g==o.line)for(;le&&le>o.ch&&Oe.charCodeAt(Oe.length-xe-1)==Ne.charCodeAt(Ne.length-xe-1);)le--,xe++;X[X.length-1]=Oe.slice(0,Oe.length-xe).replace(/^\u200b+/,""),X[0]=X[0].slice(le).replace(/\u200b+$/,"");var Ye=A(g,le),Ke=A(O,he.length?Je(he).length-xe:0);if(X.length>1||X[0]||z(Ye,Ke))return uo(e.doc,X,Ye,Ke,"+input"),!0},It.prototype.ensurePolled=function(){this.forceCompositionEnd()},It.prototype.reset=function(){this.forceCompositionEnd()},It.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},It.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))},It.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Vr(this.cm,function(){return Dr(e.cm)})},It.prototype.setUneditable=function(e){e.contentEditable="false"},It.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||lr(this.cm,$s)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},It.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},It.prototype.onContextMenu=function(){},It.prototype.resetPosition=function(){},It.prototype.needsContentAttribute=!0;function Jf(e,r){var a=ma(e,r.line);if(!a||a.hidden)return null;var o=Ve(e.doc,r.line),l=Sl(a,o,r.line),d=Qe(o,e.doc.direction),g="left";if(d){var b=mt(d,r.ch);g=b%2?"right":"left"}var w=ss(l.map,r.ch,g);return w.offset=w.collapse=="right"?w.end:w.start,w}function Qf(e){for(var r=e;r;r=r.parentNode)if(/CodeMirror-gutter-wrapper/.test(r.className))return!0;return!1}function un(e,r){return r&&(e.bad=!0),e}function Fu(e,r,a,o,l){var d="",g=!1,b=e.doc.lineSeparator(),w=!1;function O(le){return function(xe){return xe.id==le}}function U(){g&&(d+=b,w&&(d+=b),g=w=!1)}function X(le){le&&(U(),d+=le)}function he(le){if(le.nodeType==1){var xe=le.getAttribute("cm-text");if(xe){X(xe);return}var Ce=le.getAttribute("cm-marker"),Le;if(Ce){var Me=e.findMarks(A(o,0),A(l+1,0),O(+Ce));Me.length&&(Le=Me[0].find(0))&&X(zn(e.doc,Le.from,Le.to).join(b));return}if(le.getAttribute("contenteditable")=="false")return;var Oe=/^(pre|div|p|li|table|br)$/i.test(le.nodeName);if(!/^br$/i.test(le.nodeName)&&le.textContent.length==0)return;Oe&&U();for(var Ne=0;Ne<le.childNodes.length;Ne++)he(le.childNodes[Ne]);/^(pre|p)$/i.test(le.nodeName)&&(w=!0),Oe&&(g=!0)}else le.nodeType==3&&X(le.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;he(r),r!=a;)r=r.nextSibling,w=!1;return d}function Ks(e,r,a){var o;if(r==e.display.lineDiv){if(o=e.display.lineDiv.childNodes[a],!o)return un(e.clipPos(A(e.display.viewTo-1)),!0);r=null,a=0}else for(o=r;;o=o.parentNode){if(!o||o==e.display.lineDiv)return null;if(o.parentNode&&o.parentNode==e.display.lineDiv)break}for(var l=0;l<e.display.view.length;l++){var d=e.display.view[l];if(d.node==o)return yo(d,r,a)}}function yo(e,r,a){var o=e.text.firstChild,l=!1;if(!r||!He(o,r))return un(A(Ct(e.line),0),!0);if(r==o&&(l=!0,r=o.childNodes[a],a=0,!r)){var d=e.rest?Je(e.rest):e.line;return un(A(Ct(d),d.text.length),l)}var g=r.nodeType==3?r:null,b=r;for(!g&&r.childNodes.length==1&&r.firstChild.nodeType==3&&(g=r.firstChild,a&&(a=g.nodeValue.length));b.parentNode!=o;)b=b.parentNode;var w=e.measure,O=w.maps;function U(Le,Me,Oe){for(var Ne=-1;Ne<(O?O.length:0);Ne++)for(var We=Ne<0?w.map:O[Ne],Ye=0;Ye<We.length;Ye+=3){var Ke=We[Ye+2];if(Ke==Le||Ke==Me){var vt=Ct(Ne<0?e.line:e.rest[Ne]),kt=We[Ye]+Oe;return(Oe<0||Ke!=Le)&&(kt=We[Ye+(Oe?1:0)]),A(vt,kt)}}}var X=U(g,b,a);if(X)return un(X,l);for(var he=b.nextSibling,le=g?g.nodeValue.length-a:0;he;he=he.nextSibling){if(X=U(he,he.firstChild,0),X)return un(A(X.line,X.ch-le),l);le+=he.textContent.length}for(var xe=b.previousSibling,Ce=a;xe;xe=xe.previousSibling){if(X=U(xe,xe.firstChild,-1),X)return un(A(X.line,X.ch+Ce),l);Ce+=xe.textContent.length}}var nr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ue,this.hasSelection=!1,this.composing=null,this.resetting=!1};nr.prototype.init=function(e){var r=this,a=this,o=this.cm;this.createField(e);var l=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),J&&(l.style.width="0px"),ne(l,"input",function(){D&&R>=9&&r.hasSelection&&(r.hasSelection=null),a.poll()}),ne(l,"paste",function(g){ct(o,g)||Lu(g,o)||(o.state.pasteIncoming=+new Date,a.fastPoll())});function d(g){if(!ct(o,g)){if(o.somethingSelected())Wa({lineWise:!1,text:o.getSelections()});else if(o.options.lineWiseCopyCut){var b=Gs(o);Wa({lineWise:!0,text:b.text}),g.type=="cut"?o.setSelections(b.ranges,null,Dt):(a.prevInput="",l.value=b.text.join(`
32
- `),ft(l))}else return;g.type=="cut"&&(o.state.cutIncoming=+new Date)}}ne(l,"cut",d),ne(l,"copy",d),ne(e.scroller,"paste",function(g){if(!(Yn(e,g)||ct(o,g))){if(!l.dispatchEvent){o.state.pasteIncoming=+new Date,a.focus();return}var b=new Event("paste");b.clipboardData=g.clipboardData,l.dispatchEvent(b)}}),ne(e.lineSpace,"selectstart",function(g){Yn(e,g)||wt(g)}),ne(l,"compositionstart",function(){var g=o.getCursor("from");a.composing&&a.composing.range.clear(),a.composing={start:g,range:o.markText(g,o.getCursor("to"),{className:"CodeMirror-composing"})}}),ne(l,"compositionend",function(){a.composing&&(a.poll(),a.composing.range.clear(),a.composing=null)})},nr.prototype.createField=function(e){this.wrapper=Mu(),this.textarea=this.wrapper.firstChild;var r=this.cm.options;qo(this.textarea,r.spellcheck,r.autocorrect,r.autocapitalize)},nr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},nr.prototype.prepareSelection=function(){var e=this.cm,r=e.display,a=e.doc,o=Do(e);if(e.options.moveInputWithCursor){var l=an(e,a.sel.primary().head,"div"),d=r.wrapper.getBoundingClientRect(),g=r.lineDiv.getBoundingClientRect();o.teTop=Math.max(0,Math.min(r.wrapper.clientHeight-10,l.top+g.top-d.top)),o.teLeft=Math.max(0,Math.min(r.wrapper.clientWidth-10,l.left+g.left-d.left))}return o},nr.prototype.showSelection=function(e){var r=this.cm,a=r.display;ge(a.cursorDiv,e.cursors),ge(a.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},nr.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var r=this.cm;if(this.resetting=!0,r.somethingSelected()){this.prevInput="";var a=r.getSelection();this.textarea.value=a,r.state.focused&&ft(this.textarea),D&&R>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",D&&R>=9&&(this.hasSelection=null));this.resetting=!1}},nr.prototype.getField=function(){return this.textarea},nr.prototype.supportsTouch=function(){return!1},nr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!S||_e(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch{}},nr.prototype.blur=function(){this.textarea.blur()},nr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},nr.prototype.receivedFocus=function(){this.slowPoll()},nr.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},nr.prototype.fastPoll=function(){var e=!1,r=this;r.pollingFast=!0;function a(){var o=r.poll();!o&&!e?(e=!0,r.polling.set(60,a)):(r.pollingFast=!1,r.slowPoll())}r.polling.set(20,a)},nr.prototype.poll=function(){var e=this,r=this.cm,a=this.textarea,o=this.prevInput;if(this.contextMenuPending||this.resetting||!r.state.focused||ni(a)&&!o&&!this.composing||r.isReadOnly()||r.options.disableInput||r.state.keySeq)return!1;var l=a.value;if(l==o&&!r.somethingSelected())return!1;if(D&&R>=9&&this.hasSelection===l||I&&/[\uf700-\uf7ff]/.test(l))return r.display.input.reset(),!1;if(r.doc.sel==r.display.selForContextMenu){var d=l.charCodeAt(0);if(d==8203&&!o&&(o="\u200B"),d==8666)return this.reset(),this.cm.execCommand("undo")}for(var g=0,b=Math.min(o.length,l.length);g<b&&o.charCodeAt(g)==l.charCodeAt(g);)++g;return Vr(r,function(){$s(r,l.slice(g),o.length-g,null,e.composing?"*compose":null),l.length>1e3||l.indexOf(`
33
- `)>-1?a.value=e.prevInput="":e.prevInput=l,e.composing&&(e.composing.range.clear(),e.composing.range=r.markText(e.composing.start,r.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},nr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},nr.prototype.onKeyPress=function(){D&&R>=9&&(this.hasSelection=null),this.fastPoll()},nr.prototype.onContextMenu=function(e){var r=this,a=r.cm,o=a.display,l=r.textarea;r.contextMenuPending&&r.contextMenuPending();var d=Oi(a,e),g=o.scroller.scrollTop;if(!d||re)return;var b=a.options.resetSelectionOnContextMenu;b&&a.doc.sel.contains(d)==-1&&lr(a,fr)(a.doc,fi(d),Dt);var w=l.style.cssText,O=r.wrapper.style.cssText,U=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static",l.style.cssText=`position: absolute; width: 30px; height: 30px;
34
- top: `+(e.clientY-U.top-5)+"px; left: "+(e.clientX-U.left-5)+`px;
35
- z-index: 1000; background: `+(D?"rgba(255, 255, 255, .05)":"transparent")+`;
36
- outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var X;V&&(X=l.ownerDocument.defaultView.scrollY),o.input.focus(),V&&l.ownerDocument.defaultView.scrollTo(null,X),o.input.reset(),a.somethingSelected()||(l.value=r.prevInput=" "),r.contextMenuPending=le,o.selForContextMenu=a.doc.sel,clearTimeout(o.detectingSelectAll);function he(){if(l.selectionStart!=null){var Ce=a.somethingSelected(),Le="\u200B"+(Ce?l.value:"");l.value="\u21DA",l.value=Le,r.prevInput=Ce?"":"\u200B",l.selectionStart=1,l.selectionEnd=Le.length,o.selForContextMenu=a.doc.sel}}function le(){if(r.contextMenuPending==le&&(r.contextMenuPending=!1,r.wrapper.style.cssText=O,l.style.cssText=w,D&&R<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=g),l.selectionStart!=null)){(!D||D&&R<9)&&he();var Ce=0,Le=function(){o.selForContextMenu==a.doc.sel&&l.selectionStart==0&&l.selectionEnd>0&&r.prevInput=="\u200B"?lr(a,eu)(a):Ce++<10?o.detectingSelectAll=setTimeout(Le,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(Le,200)}}if(D&&R>=9&&he(),ie){mr(e);var xe=function(){je(window,"mouseup",xe),setTimeout(le,20)};ne(window,"mouseup",xe)}else setTimeout(le,50)},nr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},nr.prototype.setUneditable=function(){},nr.prototype.needsContentAttribute=!1;function Zf(e,r){if(r=r?Ot(r):{},r.value=e.value,!r.tabindex&&e.tabIndex&&(r.tabindex=e.tabIndex),!r.placeholder&&e.placeholder&&(r.placeholder=e.placeholder),r.autofocus==null){var a=_e(e.ownerDocument);r.autofocus=a==e||e.getAttribute("autofocus")!=null&&a==document.body}function o(){e.value=b.getValue()}var l;if(e.form&&(ne(e.form,"submit",o),!r.leaveSubmitMethodAlone)){var d=e.form;l=d.submit;try{var g=d.submit=function(){o(),d.submit=l,d.submit(),d.submit=g}}catch{}}r.finishInit=function(w){w.save=o,w.getTextArea=function(){return e},w.toTextArea=function(){w.toTextArea=isNaN,o(),e.parentNode.removeChild(w.getWrapperElement()),e.style.display="",e.form&&(je(e.form,"submit",o),!r.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=l))}},e.style.display="none";var b=Wt(function(w){return e.parentNode.insertBefore(w,e.nextSibling)},r);return b}function gc(e){e.off=je,e.on=ne,e.wheelEventPixels=Mf,e.Doc=Pr,e.splitLines=gn,e.countColumn=nt,e.findColumn=Kt,e.isWordChar=pn,e.Pass=it,e.signal=tt,e.Line=Si,e.changeEnd=ci,e.scrollbarModel=Ml,e.Pos=A,e.cmpPos=z,e.modes=Xr,e.mimeModes=zr,e.resolveMode=mn,e.getMode=Mr,e.modeExtensions=tr,e.extendMode=In,e.copyState=tn,e.startState=ia,e.innerMode=zi,e.commands=Vo,e.keyMap=Jn,e.keyName=Ds,e.isModifierKey=cu,e.lookupKey=Ri,e.normalizeKeyMap=Vf,e.StringStream=Ht,e.SharedTextMarker=Ho,e.TextMarker=Zr,e.LineWidget=Wo,e.e_preventDefault=wt,e.e_stopPropagation=er,e.e_stop=mr,e.addClass=ze,e.contains=He,e.rmClass=Y,e.keyNames=hi}Zo(Wt),Nu(Wt);var mc="iter insert remove copy getEditor constructor".split(" ");for(var Ha in Pr.prototype)Pr.prototype.hasOwnProperty(Ha)&&Fe(mc,Ha)<0&&(Wt.prototype[Ha]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pr.prototype[Ha]));return Tr(Pr),Wt.inputStyles={textarea:nr,contenteditable:It},Wt.defineMode=function(e){!Wt.defaults.mode&&e!="null"&&(Wt.defaults.mode=e),_r.apply(this,arguments)},Wt.defineMIME=Oo,Wt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Wt.defineMIME("text/plain","null"),Wt.defineExtension=function(e,r){Wt.prototype[e]=r},Wt.defineDocExtension=function(e,r){Pr.prototype[e]=r},Wt.fromTextArea=Zf,gc(Wt),Wt.version="5.65.12",Wt})},13156:(x,N,f)=>{(function(v){v(f(46944))})(function(v){"use strict";v.defineMode("javascript",function(C,E){var P=C.indentUnit,D=E.statementIndent,R=E.jsonld,V=E.json||R,Q=E.trackScope!==!1,Z=E.typescript,de=E.wordCharacters||/[\w$\xa1-\uffff]/,re=function(){function A($e){return{type:$e,style:"keyword"}}var z=A("keyword a"),Se=A("keyword b"),Pe=A("keyword c"),rt=A("keyword d"),yt=A("operator"),At={type:"atom",style:"atom"};return{if:A("if"),while:z,with:z,else:Se,do:Se,try:Se,finally:Se,return:rt,break:rt,continue:rt,new:A("new"),delete:Pe,void:Pe,throw:Pe,debugger:A("debugger"),var:A("var"),const:A("var"),let:A("var"),function:A("function"),catch:A("catch"),for:A("for"),switch:A("switch"),case:A("case"),default:A("default"),in:yt,typeof:yt,instanceof:yt,true:At,false:At,null:At,undefined:At,NaN:At,Infinity:At,this:A("this"),class:A("class"),super:A("atom"),yield:Pe,export:A("export"),import:A("import"),extends:Pe,await:Pe}}(),se=/[+\-*&%=<>!?|~^@]/,$=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function k(A){for(var z=!1,Se,Pe=!1;(Se=A.next())!=null;){if(!z){if(Se=="/"&&!Pe)return;Se=="["?Pe=!0:Pe&&Se=="]"&&(Pe=!1)}z=!z&&Se=="\\"}}var J,M;function S(A,z,Se){return J=A,M=Se,z}function I(A,z){var Se=A.next();if(Se=='"'||Se=="'")return z.tokenize=F(Se),z.tokenize(A,z);if(Se=="."&&A.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return S("number","number");if(Se=="."&&A.match(".."))return S("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(Se))return S(Se);if(Se=="="&&A.eat(">"))return S("=>","operator");if(Se=="0"&&A.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return S("number","number");if(/\d/.test(Se))return A.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),S("number","number");if(Se=="/")return A.eat("*")?(z.tokenize=K,K(A,z)):A.eat("/")?(A.skipToEnd(),S("comment","comment")):_i(A,z,1)?(k(A),A.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),S("regexp","string-2")):(A.eat("="),S("operator","operator",A.current()));if(Se=="`")return z.tokenize=te,te(A,z);if(Se=="#"&&A.peek()=="!")return A.skipToEnd(),S("meta","meta");if(Se=="#"&&A.eatWhile(de))return S("variable","property");if(Se=="<"&&A.match("!--")||Se=="-"&&A.match("->")&&!/\S/.test(A.string.slice(0,A.start)))return A.skipToEnd(),S("comment","comment");if(se.test(Se))return(Se!=">"||!z.lexical||z.lexical.type!=">")&&(A.eat("=")?(Se=="!"||Se=="=")&&A.eat("="):/[<>*+\-|&?]/.test(Se)&&(A.eat(Se),Se==">"&&A.eat(Se))),Se=="?"&&A.eat(".")?S("."):S("operator","operator",A.current());if(de.test(Se)){A.eatWhile(de);var Pe=A.current();if(z.lastType!="."){if(re.propertyIsEnumerable(Pe)){var rt=re[Pe];return S(rt.type,rt.style,Pe)}if(Pe=="async"&&A.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return S("async","keyword",Pe)}return S("variable","variable",Pe)}}function F(A){return function(z,Se){var Pe=!1,rt;if(R&&z.peek()=="@"&&z.match($))return Se.tokenize=I,S("jsonld-keyword","meta");for(;(rt=z.next())!=null&&!(rt==A&&!Pe);)Pe=!Pe&&rt=="\\";return Pe||(Se.tokenize=I),S("string","string")}}function K(A,z){for(var Se=!1,Pe;Pe=A.next();){if(Pe=="/"&&Se){z.tokenize=I;break}Se=Pe=="*"}return S("comment","comment")}function te(A,z){for(var Se=!1,Pe;(Pe=A.next())!=null;){if(!Se&&(Pe=="`"||Pe=="$"&&A.eat("{"))){z.tokenize=I;break}Se=!Se&&Pe=="\\"}return S("quasi","string-2",A.current())}var j="([{}])";function ie(A,z){z.fatArrowAt&&(z.fatArrowAt=null);var Se=A.string.indexOf("=>",A.start);if(!(Se<0)){if(Z){var Pe=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(A.string.slice(A.start,Se));Pe&&(Se=Pe.index)}for(var rt=0,yt=!1,At=Se-1;At>=0;--At){var $e=A.string.charAt(At),nn=j.indexOf($e);if(nn>=0&&nn<3){if(!rt){++At;break}if(--rt==0){$e=="("&&(yt=!0);break}}else if(nn>=3&&nn<6)++rt;else if(de.test($e))yt=!0;else if(/["'\/`]/.test($e))for(;;--At){if(At==0)return;var Eo=A.string.charAt(At-1);if(Eo==$e&&A.string.charAt(At-2)!="\\"){At--;break}}else if(yt&&!rt){++At;break}}yt&&!rt&&(z.fatArrowAt=At)}}var H={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function Y(A,z,Se,Pe,rt,yt){this.indented=A,this.column=z,this.type=Se,this.prev=rt,this.info=yt,Pe!=null&&(this.align=Pe)}function ce(A,z){if(!Q)return!1;for(var Se=A.localVars;Se;Se=Se.next)if(Se.name==z)return!0;for(var Pe=A.context;Pe;Pe=Pe.prev)for(var Se=Pe.vars;Se;Se=Se.next)if(Se.name==z)return!0}function ge(A,z,Se,Pe,rt){var yt=A.cc;for(G.state=A,G.stream=rt,G.marked=null,G.cc=yt,G.style=z,A.lexical.hasOwnProperty("align")||(A.lexical.align=!0);;){var At=yt.length?yt.pop():V?qe:it;if(At(Se,Pe)){for(;yt.length&&yt[yt.length-1].lex;)yt.pop()();return G.marked?G.marked:Se=="variable"&&ce(A,Pe)?"variable-2":z}}}var G={state:null,column:null,marked:null,cc:null};function ve(){for(var A=arguments.length-1;A>=0;A--)G.cc.push(arguments[A])}function ee(){return ve.apply(null,arguments),!0}function He(A,z){for(var Se=z;Se;Se=Se.next)if(Se.name==A)return!0;return!1}function _e(A){var z=G.state;if(G.marked="def",!!Q){if(z.context){if(z.lexical.info=="var"&&z.context&&z.context.block){var Se=ze(A,z.context);if(Se!=null){z.context=Se;return}}else if(!He(A,z.localVars)){z.localVars=new at(A,z.localVars);return}}E.globalVars&&!He(A,z.globalVars)&&(z.globalVars=new at(A,z.globalVars))}}function ze(A,z){if(z)if(z.block){var Se=ze(A,z.prev);return Se?Se==z.prev?z:new ft(Se,z.vars,!0):null}else return He(A,z.vars)?z:new ft(z.prev,new at(A,z.vars),!1);else return null}function dt(A){return A=="public"||A=="private"||A=="protected"||A=="abstract"||A=="readonly"}function ft(A,z,Se){this.prev=A,this.vars=z,this.block=Se}function at(A,z){this.name=A,this.next=z}var Gt=new at("this",new at("arguments",null));function ht(){G.state.context=new ft(G.state.context,G.state.localVars,!1),G.state.localVars=Gt}function Ot(){G.state.context=new ft(G.state.context,G.state.localVars,!0),G.state.localVars=null}ht.lex=Ot.lex=!0;function nt(){G.state.localVars=G.state.context.vars,G.state.context=G.state.context.prev}nt.lex=!0;function Ue(A,z){var Se=function(){var Pe=G.state,rt=Pe.indented;if(Pe.lexical.type=="stat")rt=Pe.lexical.indented;else for(var yt=Pe.lexical;yt&&yt.type==")"&&yt.align;yt=yt.prev)rt=yt.indented;Pe.lexical=new Y(rt,G.stream.column(),A,null,Pe.lexical,z)};return Se.lex=!0,Se}function Fe(){var A=G.state;A.lexical.prev&&(A.lexical.type==")"&&(A.indented=A.lexical.indented),A.lexical=A.lexical.prev)}Fe.lex=!0;function Re(A){function z(Se){return Se==A?ee():A==";"||Se=="}"||Se==")"||Se=="]"?ve():ee(z)}return z}function it(A,z){return A=="var"?ee(Ue("vardef",z),Hn,Re(";"),Fe):A=="keyword a"?ee(Ue("form"),Kt,it,Fe):A=="keyword b"?ee(Ue("form"),it,Fe):A=="keyword d"?G.stream.match(/^\s*$/,!1)?ee():ee(Ue("stat"),pr,Re(";"),Fe):A=="debugger"?ee(Re(";")):A=="{"?ee(Ue("}"),Ot,st,Fe,nt):A==";"?ee():A=="if"?(G.state.lexical.info=="else"&&G.state.cc[G.state.cc.length-1]==Fe&&G.state.cc.pop()(),ee(Ue("form"),Kt,it,Fe,gn)):A=="function"?ee(Ir):A=="for"?ee(Ue("form"),Ot,ni,it,nt,Fe):A=="class"||Z&&z=="interface"?(G.marked="keyword",ee(Ue("form",A=="class"?A:z),mn,Fe)):A=="variable"?Z&&z=="declare"?(G.marked="keyword",ee(it)):Z&&(z=="module"||z=="enum"||z=="type")&&G.stream.match(/^\s*\w/,!1)?(G.marked="keyword",z=="enum"?ee(Ct):z=="type"?ee(zr,Re("operator"),je,Re(";")):ee(Ue("form"),kr,Re("{"),Ue("}"),st,Fe,Fe)):Z&&z=="namespace"?(G.marked="keyword",ee(Ue("form"),qe,it,Fe)):Z&&z=="abstract"?(G.marked="keyword",ee(it)):ee(Ue("stat"),kn):A=="switch"?ee(Ue("form"),Kt,Re("{"),Ue("}","switch"),Ot,st,Fe,Fe,nt):A=="case"?ee(qe,Re(":")):A=="default"?ee(Re(":")):A=="catch"?ee(Ue("form"),ht,Dt,it,Fe,nt):A=="export"?ee(Ue("stat"),tn,Fe):A=="import"?ee(Ue("stat"),ia,Fe):A=="async"?ee(it):z=="@"?ee(qe,it):ve(Ue("stat"),qe,Re(";"),Fe)}function Dt(A){if(A=="(")return ee(_r,Re(")"))}function qe(A,z){return Jt(A,z,!1)}function St(A,z){return Jt(A,z,!0)}function Kt(A){return A!="("?ve():ee(Ue(")"),pr,Re(")"),Fe)}function Jt(A,z,Se){if(G.state.fatArrowAt==G.stream.start){var Pe=Se?hn:Ft;if(A=="(")return ee(ht,Ue(")"),Rt(_r,")"),Fe,Re("=>"),Pe,nt);if(A=="variable")return ve(ht,kr,Re("=>"),Pe,nt)}var rt=Se?xt:Je;return H.hasOwnProperty(A)?ee(rt):A=="function"?ee(Ir,rt):A=="class"||Z&&z=="interface"?(G.marked="keyword",ee(Ue("form"),Oo,Fe)):A=="keyword c"||A=="async"?ee(Se?St:qe):A=="("?ee(Ue(")"),pr,Re(")"),Fe,rt):A=="operator"||A=="spread"?ee(Se?St:qe):A=="["?ee(Ue("]"),rn,Fe,rt):A=="{"?mt(Ur,"}",null,rt):A=="quasi"?ve(Lt,rt):A=="new"?ee(pn(Se)):ee()}function pr(A){return A.match(/[;\}\)\],]/)?ve():ve(qe)}function Je(A,z){return A==","?ee(pr):xt(A,z,!1)}function xt(A,z,Se){var Pe=Se==!1?Je:xt,rt=Se==!1?qe:St;if(A=="=>")return ee(ht,Se?hn:Ft,nt);if(A=="operator")return/\+\+|--/.test(z)||Z&&z=="!"?ee(Pe):Z&&z=="<"&&G.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?ee(Ue(">"),Rt(je,">"),Fe,Pe):z=="?"?ee(qe,Re(":"),rt):ee(rt);if(A=="quasi")return ve(Lt,Pe);if(A!=";"){if(A=="(")return mt(St,")","call",Pe);if(A==".")return ee(vn,Pe);if(A=="[")return ee(Ue("]"),pr,Re("]"),Fe,Pe);if(Z&&z=="as")return G.marked="keyword",ee(je,Pe);if(A=="regexp")return G.state.lastType=G.marked="operator",G.stream.backUp(G.stream.pos-G.stream.start-1),ee(rt)}}function Lt(A,z){return A!="quasi"?ve():z.slice(z.length-2)!="${"?ee(Lt):ee(pr,Or)}function Or(A){if(A=="}")return G.marked="string-2",G.state.tokenize=te,ee(Lt)}function Ft(A){return ie(G.stream,G.state),ve(A=="{"?it:qe)}function hn(A){return ie(G.stream,G.state),ve(A=="{"?it:St)}function pn(A){return function(z){return z=="."?ee(A?en:Hr):z=="variable"&&Z?ee(Wn,A?xt:Je):ve(A?St:qe)}}function Hr(A,z){if(z=="target")return G.marked="keyword",ee(Je)}function en(A,z){if(z=="target")return G.marked="keyword",ee(xt)}function kn(A){return A==":"?ee(Fe,it):ve(Je,Re(";"),Fe)}function vn(A){if(A=="variable")return G.marked="property",ee()}function Ur(A,z){if(A=="async")return G.marked="property",ee(Ur);if(A=="variable"||G.style=="keyword"){if(G.marked="property",z=="get"||z=="set")return ee(gr);var Se;return Z&&G.state.fatArrowAt==G.stream.start&&(Se=G.stream.match(/^\s*:\s*/,!1))&&(G.state.fatArrowAt=G.stream.pos+Se[0].length),ee(Er)}else{if(A=="number"||A=="string")return G.marked=R?"property":G.style+" property",ee(Er);if(A=="jsonld-keyword")return ee(Er);if(Z&&dt(z))return G.marked="keyword",ee(Ur);if(A=="[")return ee(qe,Qe,Re("]"),Er);if(A=="spread")return ee(St,Er);if(z=="*")return G.marked="keyword",ee(Ur);if(A==":")return ve(Er)}}function gr(A){return A!="variable"?ve(Er):(G.marked="property",ee(Ir))}function Er(A){if(A==":")return ee(St);if(A=="(")return ve(Ir)}function Rt(A,z,Se){function Pe(rt,yt){if(Se?Se.indexOf(rt)>-1:rt==","){var At=G.state.lexical;return At.info=="call"&&(At.pos=(At.pos||0)+1),ee(function($e,nn){return $e==z||nn==z?ve():ve(A)},Pe)}return rt==z||yt==z?ee():Se&&Se.indexOf(";")>-1?ve(A):ee(Re(z))}return function(rt,yt){return rt==z||yt==z?ee():ve(A,Pe)}}function mt(A,z,Se){for(var Pe=3;Pe<arguments.length;Pe++)G.cc.push(arguments[Pe]);return ee(Ue(z,Se),Rt(A,z),Fe)}function st(A){return A=="}"?ee():ve(it,st)}function Qe(A,z){if(Z){if(A==":")return ee(je);if(z=="?")return ee(Qe)}}function pt(A,z){if(Z&&(A==":"||z=="in"))return ee(je)}function ne(A){if(Z&&A==":")return G.stream.match(/^\s*\w+\s+is\b/,!1)?ee(qe,be,je):ee(je)}function be(A,z){if(z=="is")return G.marked="keyword",ee()}function je(A,z){if(z=="keyof"||z=="typeof"||z=="infer"||z=="readonly")return G.marked="keyword",ee(z=="typeof"?St:je);if(A=="variable"||z=="void")return G.marked="type",ee(er);if(z=="|"||z=="&")return ee(je);if(A=="string"||A=="number"||A=="atom")return ee(er);if(A=="[")return ee(Ue("]"),Rt(je,"]",","),Fe,er);if(A=="{")return ee(Ue("}"),ct,Fe,er);if(A=="(")return ee(Rt(wt,")"),tt,er);if(A=="<")return ee(Rt(je,">"),je);if(A=="quasi")return ve(_t,er)}function tt(A){if(A=="=>")return ee(je)}function ct(A){return A.match(/[\}\)\]]/)?ee():A==","||A==";"?ee(ct):ve(lt,ct)}function lt(A,z){if(A=="variable"||G.style=="keyword")return G.marked="property",ee(lt);if(z=="?"||A=="number"||A=="string")return ee(lt);if(A==":")return ee(je);if(A=="[")return ee(Re("variable"),pt,Re("]"),lt);if(A=="(")return ve(Xr,lt);if(!A.match(/[;\}\)\],]/))return ee()}function _t(A,z){return A!="quasi"?ve():z.slice(z.length-2)!="${"?ee(_t):ee(je,Tr)}function Tr(A){if(A=="}")return G.marked="string-2",G.state.tokenize=te,ee(_t)}function wt(A,z){return A=="variable"&&G.stream.match(/^\s*[?:]/,!1)||z=="?"?ee(wt):A==":"?ee(je):A=="spread"?ee(wt):ve(je)}function er(A,z){if(z=="<")return ee(Ue(">"),Rt(je,">"),Fe,er);if(z=="|"||A=="."||z=="&")return ee(je);if(A=="[")return ee(je,Re("]"),er);if(z=="extends"||z=="implements")return G.marked="keyword",ee(je);if(z=="?")return ee(je,Re(":"),je)}function Wn(A,z){if(z=="<")return ee(Ue(">"),Rt(je,">"),Fe,er)}function mr(){return ve(je,yr)}function yr(A,z){if(z=="=")return ee(je)}function Hn(A,z){return z=="enum"?(G.marked="keyword",ee(Ct)):ve(kr,Qe,br,Un)}function kr(A,z){if(Z&&dt(z))return G.marked="keyword",ee(kr);if(A=="variable")return _e(z),ee();if(A=="spread")return ee(kr);if(A=="[")return mt(Ln,"]");if(A=="{")return mt(Pn,"}")}function Pn(A,z){return A=="variable"&&!G.stream.match(/^\s*:/,!1)?(_e(z),ee(br)):(A=="variable"&&(G.marked="property"),A=="spread"?ee(kr):A=="}"?ve():A=="["?ee(qe,Re("]"),Re(":"),Pn):ee(Re(":"),kr,br))}function Ln(){return ve(kr,br)}function br(A,z){if(z=="=")return ee(St)}function Un(A){if(A==",")return ee(Hn)}function gn(A,z){if(A=="keyword b"&&z=="else")return ee(Ue("form","else"),it,Fe)}function ni(A,z){if(z=="await")return ee(ni);if(A=="(")return ee(Ue(")"),Ui,Fe)}function Ui(A){return A=="var"?ee(Hn,Yr):A=="variable"?ee(Yr):ve(Yr)}function Yr(A,z){return A==")"?ee():A==";"?ee(Yr):z=="in"||z=="of"?(G.marked="keyword",ee(qe,Yr)):ve(qe,Yr)}function Ir(A,z){if(z=="*")return G.marked="keyword",ee(Ir);if(A=="variable")return _e(z),ee(Ir);if(A=="(")return ee(ht,Ue(")"),Rt(_r,")"),Fe,ne,it,nt);if(Z&&z=="<")return ee(Ue(">"),Rt(mr,">"),Fe,Ir)}function Xr(A,z){if(z=="*")return G.marked="keyword",ee(Xr);if(A=="variable")return _e(z),ee(Xr);if(A=="(")return ee(ht,Ue(")"),Rt(_r,")"),Fe,ne,nt);if(Z&&z=="<")return ee(Ue(">"),Rt(mr,">"),Fe,Xr)}function zr(A,z){if(A=="keyword"||A=="variable")return G.marked="type",ee(zr);if(z=="<")return ee(Ue(">"),Rt(mr,">"),Fe)}function _r(A,z){return z=="@"&&ee(qe,_r),A=="spread"?ee(_r):Z&&dt(z)?(G.marked="keyword",ee(_r)):Z&&A=="this"?ee(Qe,br):ve(kr,Qe,br)}function Oo(A,z){return A=="variable"?mn(A,z):Mr(A,z)}function mn(A,z){if(A=="variable")return _e(z),ee(Mr)}function Mr(A,z){if(z=="<")return ee(Ue(">"),Rt(mr,">"),Fe,Mr);if(z=="extends"||z=="implements"||Z&&A==",")return z=="implements"&&(G.marked="keyword"),ee(Z?je:qe,Mr);if(A=="{")return ee(Ue("}"),tr,Fe)}function tr(A,z){if(A=="async"||A=="variable"&&(z=="static"||z=="get"||z=="set"||Z&&dt(z))&&G.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return G.marked="keyword",ee(tr);if(A=="variable"||G.style=="keyword")return G.marked="property",ee(In,tr);if(A=="number"||A=="string")return ee(In,tr);if(A=="[")return ee(qe,Qe,Re("]"),In,tr);if(z=="*")return G.marked="keyword",ee(tr);if(Z&&A=="(")return ve(Xr,tr);if(A==";"||A==",")return ee(tr);if(A=="}")return ee();if(z=="@")return ee(qe,tr)}function In(A,z){if(z=="!"||z=="?")return ee(In);if(A==":")return ee(je,br);if(z=="=")return ee(St);var Se=G.state.lexical.prev,Pe=Se&&Se.info=="interface";return ve(Pe?Xr:Ir)}function tn(A,z){return z=="*"?(G.marked="keyword",ee(mi,Re(";"))):z=="default"?(G.marked="keyword",ee(qe,Re(";"))):A=="{"?ee(Rt(zi,"}"),mi,Re(";")):ve(it)}function zi(A,z){if(z=="as")return G.marked="keyword",ee(Re("variable"));if(A=="variable")return ve(St,zi)}function ia(A){return A=="string"?ee():A=="("?ve(qe):A=="."?ve(Je):ve(Ht,Ve,mi)}function Ht(A,z){return A=="{"?mt(Ht,"}"):(A=="variable"&&_e(z),z=="*"&&(G.marked="keyword"),ee(zn))}function Ve(A){if(A==",")return ee(Ht,Ve)}function zn(A,z){if(z=="as")return G.marked="keyword",ee(Ht)}function mi(A,z){if(z=="from")return G.marked="keyword",ee(qe)}function rn(A){return A=="]"?ee():ve(Rt(St,"]"))}function Ct(){return ve(Ue("form"),kr,Re("{"),Ue("}"),Rt(_n,"}"),Fe,Fe)}function _n(){return ve(kr,br)}function yi(A,z){return A.lastType=="operator"||A.lastType==","||se.test(z.charAt(0))||/[,.]/.test(z.charAt(0))}function _i(A,z,Se){return z.tokenize==I&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(z.lastType)||z.lastType=="quasi"&&/\{\s*$/.test(A.string.slice(0,A.pos-(Se||0)))}return{startState:function(A){var z={tokenize:I,lastType:"sof",cc:[],lexical:new Y((A||0)-P,0,"block",!1),localVars:E.localVars,context:E.localVars&&new ft(null,null,!1),indented:A||0};return E.globalVars&&typeof E.globalVars=="object"&&(z.globalVars=E.globalVars),z},token:function(A,z){if(A.sol()&&(z.lexical.hasOwnProperty("align")||(z.lexical.align=!1),z.indented=A.indentation(),ie(A,z)),z.tokenize!=K&&A.eatSpace())return null;var Se=z.tokenize(A,z);return J=="comment"?Se:(z.lastType=J=="operator"&&(M=="++"||M=="--")?"incdec":J,ge(z,Se,J,M,A))},indent:function(A,z){if(A.tokenize==K||A.tokenize==te)return v.Pass;if(A.tokenize!=I)return 0;var Se=z&&z.charAt(0),Pe=A.lexical,rt;if(!/^\s*else\b/.test(z))for(var yt=A.cc.length-1;yt>=0;--yt){var At=A.cc[yt];if(At==Fe)Pe=Pe.prev;else if(At!=gn&&At!=nt)break}for(;(Pe.type=="stat"||Pe.type=="form")&&(Se=="}"||(rt=A.cc[A.cc.length-1])&&(rt==Je||rt==xt)&&!/^[,\.=+\-*:?[\(]/.test(z));)Pe=Pe.prev;D&&Pe.type==")"&&Pe.prev.type=="stat"&&(Pe=Pe.prev);var $e=Pe.type,nn=Se==$e;return $e=="vardef"?Pe.indented+(A.lastType=="operator"||A.lastType==","?Pe.info.length+1:0):$e=="form"&&Se=="{"?Pe.indented:$e=="form"?Pe.indented+P:$e=="stat"?Pe.indented+(yi(A,z)?D||P:0):Pe.info=="switch"&&!nn&&E.doubleIndentSwitch!=!1?Pe.indented+(/^(?:case|default)\b/.test(z)?P:2*P):Pe.align?Pe.column+(nn?0:1):Pe.indented+(nn?0:P)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:V?null:"/*",blockCommentEnd:V?null:"*/",blockCommentContinue:V?null:" * ",lineComment:V?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:V?"json":"javascript",jsonldMode:R,jsonMode:V,expressionAllowed:_i,skipExpression:function(A){ge(A,"atom","atom","true",new v.StringStream("",2,null))}}}),v.registerHelper("wordChars","javascript",/[\w$]/),v.defineMIME("text/javascript","javascript"),v.defineMIME("text/ecmascript","javascript"),v.defineMIME("application/javascript","javascript"),v.defineMIME("application/x-javascript","javascript"),v.defineMIME("application/ecmascript","javascript"),v.defineMIME("application/json",{name:"javascript",json:!0}),v.defineMIME("application/x-json",{name:"javascript",json:!0}),v.defineMIME("application/manifest+json",{name:"javascript",json:!0}),v.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),v.defineMIME("text/typescript",{name:"javascript",typescript:!0}),v.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},26179:(x,N)=>{"use strict";/*!
5
+ * Version: "3.0.0-alpha.76"
6
+ */(this.webpackChunkRedoclyOpenAPIDocs=this.webpackChunkRedoclyOpenAPIDocs||[]).push([[290],{26179:(v,C)=>{"use strict";/*!
37
7
  * cookie
38
8
  * Copyright(c) 2012-2014 Roman Shtylman
39
9
  * Copyright(c) 2015 Douglas Christopher Wilson
40
10
  * MIT Licensed
41
- */N.parse=C,N.serialize=E;var f=Object.prototype.toString,v=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function C(Q,Z){if(typeof Q!="string")throw new TypeError("argument str must be a string");for(var de={},re=Z||{},se=re.decode||P,$=0;$<Q.length;){var k=Q.indexOf("=",$);if(k===-1)break;var J=Q.indexOf(";",$);if(J===-1)J=Q.length;else if(J<k){$=Q.lastIndexOf(";",k-1)+1;continue}var M=Q.slice($,k).trim();if(de[M]===void 0){var S=Q.slice(k+1,J).trim();S.charCodeAt(0)===34&&(S=S.slice(1,-1)),de[M]=V(S,se)}$=J+1}return de}function E(Q,Z,de){var re=de||{},se=re.encode||D;if(typeof se!="function")throw new TypeError("option encode is invalid");if(!v.test(Q))throw new TypeError("argument name is invalid");var $=se(Z);if($&&!v.test($))throw new TypeError("argument val is invalid");var k=Q+"="+$;if(re.maxAge!=null){var J=re.maxAge-0;if(isNaN(J)||!isFinite(J))throw new TypeError("option maxAge is invalid");k+="; Max-Age="+Math.floor(J)}if(re.domain){if(!v.test(re.domain))throw new TypeError("option domain is invalid");k+="; Domain="+re.domain}if(re.path){if(!v.test(re.path))throw new TypeError("option path is invalid");k+="; Path="+re.path}if(re.expires){var M=re.expires;if(!R(M)||isNaN(M.valueOf()))throw new TypeError("option expires is invalid");k+="; Expires="+M.toUTCString()}if(re.httpOnly&&(k+="; HttpOnly"),re.secure&&(k+="; Secure"),re.priority){var S=typeof re.priority=="string"?re.priority.toLowerCase():re.priority;switch(S){case"low":k+="; Priority=Low";break;case"medium":k+="; Priority=Medium";break;case"high":k+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(re.sameSite){var I=typeof re.sameSite=="string"?re.sameSite.toLowerCase():re.sameSite;switch(I){case!0:k+="; SameSite=Strict";break;case"lax":k+="; SameSite=Lax";break;case"strict":k+="; SameSite=Strict";break;case"none":k+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return k}function P(Q){return Q.indexOf("%")!==-1?decodeURIComponent(Q):Q}function D(Q){return encodeURIComponent(Q)}function R(Q){return f.call(Q)==="[object Date]"||Q instanceof Date}function V(Q,Z){try{return Z(Q)}catch{return Q}}},97529:(x,N,f)=>{var v=f(44928);x.exports=v},75342:(x,N,f)=>{var v=f(26087);x.exports=v},64218:(x,N,f)=>{var v=f(11783);x.exports=v},95050:(x,N,f)=>{var v=f(88462);x.exports=v},84779:(x,N,f)=>{var v=f(83531);x.exports=v},17190:(x,N,f)=>{var v=f(19941);x.exports=v},96589:(x,N,f)=>{var v=f(25081);x.exports=v},32276:(x,N,f)=>{var v=f(22145);x.exports=v},15064:(x,N,f)=>{var v=f(93690);x.exports=v},31986:(x,N,f)=>{var v=f(8429);f(42319),x.exports=v},69635:(x,N,f)=>{var v=f(13099);x.exports=v},3529:(x,N,f)=>{var v=f(44931);x.exports=v},85373:(x,N,f)=>{f(17802);var v=f(70291);x.exports=v("Array").filter},94537:(x,N,f)=>{f(64009);var v=f(70291);x.exports=v("Array").forEach},27794:(x,N,f)=>{f(32449);var v=f(70291);x.exports=v("Array").indexOf},55794:(x,N,f)=>{var v=f(15166),C=f(85373),E=Array.prototype;x.exports=function(P){var D=P.filter;return P===E||v(E,P)&&D===E.filter?C:D}},85838:(x,N,f)=>{var v=f(15166),C=f(27794),E=Array.prototype;x.exports=function(P){var D=P.indexOf;return P===E||v(E,P)&&D===E.indexOf?C:D}},95617:(x,N,f)=>{f(28135);var v=f(59921),C=v.Object,E=x.exports=function(D,R){return C.defineProperties(D,R)};C.defineProperties.sham&&(E.sham=!0)},11906:(x,N,f)=>{f(70829);var v=f(59921),C=v.Object,E=x.exports=function(D,R,V){return C.defineProperty(D,R,V)};C.defineProperty.sham&&(E.sham=!0)},59123:(x,N,f)=>{f(51964);var v=f(59921),C=v.Object,E=x.exports=function(D,R){return C.getOwnPropertyDescriptor(D,R)};C.getOwnPropertyDescriptor.sham&&(E.sham=!0)},63332:(x,N,f)=>{f(723);var v=f(59921);x.exports=v.Object.getOwnPropertyDescriptors},83606:(x,N,f)=>{f(68030);var v=f(59921);x.exports=v.Object.getOwnPropertySymbols},90660:(x,N,f)=>{f(38339);var v=f(59921);x.exports=v.Object.keys},49198:(x,N,f)=>{f(69825),f(97829),f(68030),f(95353),f(63906),f(39542),f(47882),f(84911),f(88725),f(47954),f(67703),f(2220),f(48990),f(50240),f(99921),f(3502),f(80220),f(23870),f(5828),f(5708);var v=f(59921);x.exports=v.Symbol},15413:(x,N,f)=>{f(44390),f(97829),f(27626),f(84911);var v=f(39378);x.exports=v.f("iterator")},4793:(x,N,f)=>{f(91667),f(99921);var v=f(39378);x.exports=v.f("toPrimitive")},24018:(x,N,f)=>{x.exports=f(11226)},27411:(x,N,f)=>{x.exports=f(39743)},79155:(x,N,f)=>{x.exports=f(17018)},13375:(x,N,f)=>{x.exports=f(45057)},95442:(x,N,f)=>{x.exports=f(97947)},55334:(x,N,f)=>{x.exports=f(26452)},48261:(x,N,f)=>{x.exports=f(4477)},92864:(x,N,f)=>{x.exports=f(74013)},27923:(x,N,f)=>{x.exports=f(17685)},89225:(x,N,f)=>{x.exports=f(2371)},95281:(x,N,f)=>{x.exports=f(89061)},55468:(x,N,f)=>{x.exports=f(51553)},11226:(x,N,f)=>{var v=f(97529);x.exports=v},39743:(x,N,f)=>{var v=f(75342);x.exports=v},17018:(x,N,f)=>{var v=f(64218);x.exports=v},45057:(x,N,f)=>{var v=f(95050);x.exports=v},97947:(x,N,f)=>{var v=f(84779);x.exports=v},26452:(x,N,f)=>{var v=f(17190);x.exports=v},4477:(x,N,f)=>{var v=f(96589);x.exports=v},74013:(x,N,f)=>{var v=f(32276);x.exports=v},17685:(x,N,f)=>{var v=f(15064);x.exports=v},2371:(x,N,f)=>{var v=f(31986);f(45987),f(58052),f(90181),f(25129),f(90397),f(18097),f(82793),f(52100),f(99742),x.exports=v},89061:(x,N,f)=>{var v=f(69635);x.exports=v},51553:(x,N,f)=>{var v=f(3529);x.exports=v},81970:(x,N,f)=>{var v=f(43152),C=f(18342),E=TypeError;x.exports=function(P){if(v(P))return P;throw E(C(P)+" is not a function")}},72185:(x,N,f)=>{var v=f(43152),C=String,E=TypeError;x.exports=function(P){if(typeof P=="object"||v(P))return P;throw E("Can't set "+C(P)+" as a prototype")}},20844:x=>{x.exports=function(){}},35970:(x,N,f)=>{var v=f(92548),C=String,E=TypeError;x.exports=function(P){if(v(P))return P;throw E(C(P)+" is not an object")}},24782:(x,N,f)=>{"use strict";var v=f(93935).forEach,C=f(10454),E=C("forEach");x.exports=E?[].forEach:function(D){return v(this,D,arguments.length>1?arguments[1]:void 0)}},66322:(x,N,f)=>{var v=f(88966),C=f(13249),E=f(53387),P=function(D){return function(R,V,Q){var Z=v(R),de=E(Z),re=C(Q,de),se;if(D&&V!=V){for(;de>re;)if(se=Z[re++],se!=se)return!0}else for(;de>re;re++)if((D||re in Z)&&Z[re]===V)return D||re||0;return!D&&-1}};x.exports={includes:P(!0),indexOf:P(!1)}},93935:(x,N,f)=>{var v=f(7416),C=f(90406),E=f(38622),P=f(53254),D=f(53387),R=f(69573),V=C([].push),Q=function(Z){var de=Z==1,re=Z==2,se=Z==3,$=Z==4,k=Z==6,J=Z==7,M=Z==5||k;return function(S,I,F,K){for(var te=P(S),j=E(te),ie=v(I,F),H=D(j),Y=0,ce=K||R,ge=de?ce(S,H):re||J?ce(S,0):void 0,G,ve;H>Y;Y++)if((M||Y in j)&&(G=j[Y],ve=ie(G,Y,te),Z))if(de)ge[Y]=ve;else if(ve)switch(Z){case 3:return!0;case 5:return G;case 6:return Y;case 2:V(ge,G)}else switch(Z){case 4:return!1;case 7:V(ge,G)}return k?-1:se||$?$:ge}};x.exports={forEach:Q(0),map:Q(1),filter:Q(2),some:Q(3),every:Q(4),find:Q(5),findIndex:Q(6),filterReject:Q(7)}},36844:(x,N,f)=>{var v=f(31982),C=f(33538),E=f(32438),P=C("species");x.exports=function(D){return E>=51||!v(function(){var R=[],V=R.constructor={};return V[P]=function(){return{foo:1}},R[D](Boolean).foo!==1})}},10454:(x,N,f)=>{"use strict";var v=f(31982);x.exports=function(C,E){var P=[][C];return!!P&&v(function(){P.call(null,E||function(){return 1},1)})}},67932:(x,N,f)=>{var v=f(13249),C=f(53387),E=f(53437),P=Array,D=Math.max;x.exports=function(R,V,Q){for(var Z=C(R),de=v(V,Z),re=v(Q===void 0?Z:Q,Z),se=P(D(re-de,0)),$=0;de<re;de++,$++)E(se,$,R[de]);return se.length=$,se}},53160:(x,N,f)=>{var v=f(90406);x.exports=v([].slice)},76562:(x,N,f)=>{var v=f(93053),C=f(43455),E=f(92548),P=f(33538),D=P("species"),R=Array;x.exports=function(V){var Q;return v(V)&&(Q=V.constructor,C(Q)&&(Q===R||v(Q.prototype))?Q=void 0:E(Q)&&(Q=Q[D],Q===null&&(Q=void 0))),Q===void 0?R:Q}},69573:(x,N,f)=>{var v=f(76562);x.exports=function(C,E){return new(v(C))(E===0?0:E)}},58310:(x,N,f)=>{var v=f(90406),C=v({}.toString),E=v("".slice);x.exports=function(P){return E(C(P),8,-1)}},82059:(x,N,f)=>{var v=f(48448),C=f(43152),E=f(58310),P=f(33538),D=P("toStringTag"),R=Object,V=E(function(){return arguments}())=="Arguments",Q=function(Z,de){try{return Z[de]}catch{}};x.exports=v?E:function(Z){var de,re,se;return Z===void 0?"Undefined":Z===null?"Null":typeof(re=Q(de=R(Z),D))=="string"?re:V?E(de):(se=E(de))=="Object"&&C(de.callee)?"Arguments":se}},74838:(x,N,f)=>{var v=f(31982);x.exports=!v(function(){function C(){}return C.prototype.constructor=null,Object.getPrototypeOf(new C)!==C.prototype})},10248:x=>{x.exports=function(N,f){return{value:N,done:f}}},20410:(x,N,f)=>{var v=f(56049),C=f(36133),E=f(54686);x.exports=v?function(P,D,R){return C.f(P,D,E(1,R))}:function(P,D,R){return P[D]=R,P}},54686:x=>{x.exports=function(N,f){return{enumerable:!(N&1),configurable:!(N&2),writable:!(N&4),value:f}}},53437:(x,N,f)=>{"use strict";var v=f(5135),C=f(36133),E=f(54686);x.exports=function(P,D,R){var V=v(D);V in P?C.f(P,V,E(0,R)):P[V]=R}},37912:(x,N,f)=>{var v=f(36133);x.exports=function(C,E,P){return v.f(C,E,P)}},27519:(x,N,f)=>{var v=f(20410);x.exports=function(C,E,P,D){return D&&D.enumerable?C[E]=P:v(C,E,P),C}},9267:(x,N,f)=>{var v=f(62447),C=Object.defineProperty;x.exports=function(E,P){try{C(v,E,{value:P,configurable:!0,writable:!0})}catch{v[E]=P}return P}},56049:(x,N,f)=>{var v=f(31982);x.exports=!v(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},51647:x=>{var N=typeof document=="object"&&document.all,f=typeof N>"u"&&N!==void 0;x.exports={all:N,IS_HTMLDDA:f}},45511:(x,N,f)=>{var v=f(62447),C=f(92548),E=v.document,P=C(E)&&C(E.createElement);x.exports=function(D){return P?E.createElement(D):{}}},11452:x=>{var N=TypeError,f=9007199254740991;x.exports=function(v){if(v>f)throw N("Maximum allowed index exceeded");return v}},81595:x=>{x.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},90740:x=>{x.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},32438:(x,N,f)=>{var v=f(62447),C=f(90740),E=v.process,P=v.Deno,D=E&&E.versions||P&&P.version,R=D&&D.v8,V,Q;R&&(V=R.split("."),Q=V[0]>0&&V[0]<4?1:+(V[0]+V[1])),!Q&&C&&(V=C.match(/Edge\/(\d+)/),(!V||V[1]>=74)&&(V=C.match(/Chrome\/(\d+)/),V&&(Q=+V[1]))),x.exports=Q},70291:(x,N,f)=>{var v=f(59921);x.exports=function(C){return v[C+"Prototype"]}},11792:x=>{x.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},30080:(x,N,f)=>{"use strict";var v=f(62447),C=f(82768),E=f(57953),P=f(43152),D=f(80016).f,R=f(51585),V=f(59921),Q=f(7416),Z=f(20410),de=f(18768),re=function(se){var $=function(k,J,M){if(this instanceof $){switch(arguments.length){case 0:return new se;case 1:return new se(k);case 2:return new se(k,J)}return new se(k,J,M)}return C(se,this,arguments)};return $.prototype=se.prototype,$};x.exports=function(se,$){var k=se.target,J=se.global,M=se.stat,S=se.proto,I=J?v:M?v[k]:(v[k]||{}).prototype,F=J?V:V[k]||Z(V,k,{})[k],K=F.prototype,te,j,ie,H,Y,ce,ge,G,ve;for(H in $)te=R(J?H:k+(M?".":"#")+H,se.forced),j=!te&&I&&de(I,H),ce=F[H],j&&(se.dontCallGetSet?(ve=D(I,H),ge=ve&&ve.value):ge=I[H]),Y=j&&ge?ge:$[H],!(j&&typeof ce==typeof Y)&&(se.bind&&j?G=Q(Y,v):se.wrap&&j?G=re(Y):S&&P(Y)?G=E(Y):G=Y,(se.sham||Y&&Y.sham||ce&&ce.sham)&&Z(G,"sham",!0),Z(F,H,G),S&&(ie=k+"Prototype",de(V,ie)||Z(V,ie,{}),Z(V[ie],H,Y),se.real&&K&&(te||!K[H])&&Z(K,H,Y)))}},31982:x=>{x.exports=function(N){try{return!!N()}catch{return!0}}},82768:(x,N,f)=>{var v=f(97966),C=Function.prototype,E=C.apply,P=C.call;x.exports=typeof Reflect=="object"&&Reflect.apply||(v?P.bind(E):function(){return P.apply(E,arguments)})},7416:(x,N,f)=>{var v=f(57953),C=f(81970),E=f(97966),P=v(v.bind);x.exports=function(D,R){return C(D),R===void 0?D:E?P(D,R):function(){return D.apply(R,arguments)}}},97966:(x,N,f)=>{var v=f(31982);x.exports=!v(function(){var C=function(){}.bind();return typeof C!="function"||C.hasOwnProperty("prototype")})},12461:(x,N,f)=>{var v=f(97966),C=Function.prototype.call;x.exports=v?C.bind(C):function(){return C.apply(C,arguments)}},58100:(x,N,f)=>{var v=f(56049),C=f(18768),E=Function.prototype,P=v&&Object.getOwnPropertyDescriptor,D=C(E,"name"),R=D&&function(){}.name==="something",V=D&&(!v||v&&P(E,"name").configurable);x.exports={EXISTS:D,PROPER:R,CONFIGURABLE:V}},54518:(x,N,f)=>{var v=f(90406),C=f(81970);x.exports=function(E,P,D){try{return v(C(Object.getOwnPropertyDescriptor(E,P)[D]))}catch{}}},57953:(x,N,f)=>{var v=f(58310),C=f(90406);x.exports=function(E){if(v(E)==="Function")return C(E)}},90406:(x,N,f)=>{var v=f(97966),C=Function.prototype,E=C.call,P=v&&C.bind.bind(E,E);x.exports=v?P:function(D){return function(){return E.apply(D,arguments)}}},97080:(x,N,f)=>{var v=f(59921),C=f(62447),E=f(43152),P=function(D){return E(D)?D:void 0};x.exports=function(D,R){return arguments.length<2?P(v[D])||P(C[D]):v[D]&&v[D][R]||C[D]&&C[D][R]}},82850:(x,N,f)=>{var v=f(90406),C=f(93053),E=f(43152),P=f(58310),D=f(46025),R=v([].push);x.exports=function(V){if(E(V))return V;if(C(V)){for(var Q=V.length,Z=[],de=0;de<Q;de++){var re=V[de];typeof re=="string"?R(Z,re):(typeof re=="number"||P(re)=="Number"||P(re)=="String")&&R(Z,D(re))}var se=Z.length,$=!0;return function(k,J){if($)return $=!1,J;if(C(this))return J;for(var M=0;M<se;M++)if(Z[M]===k)return J}}}},27529:(x,N,f)=>{var v=f(81970),C=f(71365);x.exports=function(E,P){var D=E[P];return C(D)?void 0:v(D)}},62447:(x,N,f)=>{var v=function(C){return C&&C.Math==Math&&C};x.exports=v(typeof globalThis=="object"&&globalThis)||v(typeof window=="object"&&window)||v(typeof self=="object"&&self)||v(typeof f.g=="object"&&f.g)||function(){return this}()||Function("return this")()},18768:(x,N,f)=>{var v=f(90406),C=f(53254),E=v({}.hasOwnProperty);x.exports=Object.hasOwn||function(D,R){return E(C(D),R)}},13477:x=>{x.exports={}},19552:(x,N,f)=>{var v=f(97080);x.exports=v("document","documentElement")},11314:(x,N,f)=>{var v=f(56049),C=f(31982),E=f(45511);x.exports=!v&&!C(function(){return Object.defineProperty(E("div"),"a",{get:function(){return 7}}).a!=7})},38622:(x,N,f)=>{var v=f(90406),C=f(31982),E=f(58310),P=Object,D=v("".split);x.exports=C(function(){return!P("z").propertyIsEnumerable(0)})?function(R){return E(R)=="String"?D(R,""):P(R)}:P},41524:(x,N,f)=>{var v=f(90406),C=f(43152),E=f(70716),P=v(Function.toString);C(E.inspectSource)||(E.inspectSource=function(D){return P(D)}),x.exports=E.inspectSource},44083:(x,N,f)=>{var v=f(57761),C=f(62447),E=f(92548),P=f(20410),D=f(18768),R=f(70716),V=f(4580),Q=f(13477),Z="Object already initialized",de=C.TypeError,re=C.WeakMap,se,$,k,J=function(F){return k(F)?$(F):se(F,{})},M=function(F){return function(K){var te;if(!E(K)||(te=$(K)).type!==F)throw de("Incompatible receiver, "+F+" required");return te}};if(v||R.state){var S=R.state||(R.state=new re);S.get=S.get,S.has=S.has,S.set=S.set,se=function(F,K){if(S.has(F))throw de(Z);return K.facade=F,S.set(F,K),K},$=function(F){return S.get(F)||{}},k=function(F){return S.has(F)}}else{var I=V("state");Q[I]=!0,se=function(F,K){if(D(F,I))throw de(Z);return K.facade=F,P(F,I,K),K},$=function(F){return D(F,I)?F[I]:{}},k=function(F){return D(F,I)}}x.exports={set:se,get:$,has:k,enforce:J,getterFor:M}},93053:(x,N,f)=>{var v=f(58310);x.exports=Array.isArray||function(E){return v(E)=="Array"}},43152:(x,N,f)=>{var v=f(51647),C=v.all;x.exports=v.IS_HTMLDDA?function(E){return typeof E=="function"||E===C}:function(E){return typeof E=="function"}},43455:(x,N,f)=>{var v=f(90406),C=f(31982),E=f(43152),P=f(82059),D=f(97080),R=f(41524),V=function(){},Q=[],Z=D("Reflect","construct"),de=/^\s*(?:class|function)\b/,re=v(de.exec),se=!de.exec(V),$=function(M){if(!E(M))return!1;try{return Z(V,Q,M),!0}catch{return!1}},k=function(M){if(!E(M))return!1;switch(P(M)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return se||!!re(de,R(M))}catch{return!0}};k.sham=!0,x.exports=!Z||C(function(){var J;return $($.call)||!$(Object)||!$(function(){J=!0})||J})?k:$},51585:(x,N,f)=>{var v=f(31982),C=f(43152),E=/#|\.prototype\./,P=function(Z,de){var re=R[D(Z)];return re==Q?!0:re==V?!1:C(de)?v(de):!!de},D=P.normalize=function(Z){return String(Z).replace(E,".").toLowerCase()},R=P.data={},V=P.NATIVE="N",Q=P.POLYFILL="P";x.exports=P},71365:x=>{x.exports=function(N){return N==null}},92548:(x,N,f)=>{var v=f(43152),C=f(51647),E=C.all;x.exports=C.IS_HTMLDDA?function(P){return typeof P=="object"?P!==null:v(P)||P===E}:function(P){return typeof P=="object"?P!==null:v(P)}},39839:x=>{x.exports=!0},28609:(x,N,f)=>{var v=f(97080),C=f(43152),E=f(15166),P=f(27237),D=Object;x.exports=P?function(R){return typeof R=="symbol"}:function(R){var V=v("Symbol");return C(V)&&E(V.prototype,D(R))}},41709:(x,N,f)=>{"use strict";var v=f(98488).IteratorPrototype,C=f(73270),E=f(54686),P=f(98889),D=f(94609),R=function(){return this};x.exports=function(V,Q,Z,de){var re=Q+" Iterator";return V.prototype=C(v,{next:E(+!de,Z)}),P(V,re,!1,!0),D[re]=R,V}},78107:(x,N,f)=>{"use strict";var v=f(30080),C=f(12461),E=f(39839),P=f(58100),D=f(43152),R=f(41709),V=f(90851),Q=f(70738),Z=f(98889),de=f(20410),re=f(27519),se=f(33538),$=f(94609),k=f(98488),J=P.PROPER,M=P.CONFIGURABLE,S=k.IteratorPrototype,I=k.BUGGY_SAFARI_ITERATORS,F=se("iterator"),K="keys",te="values",j="entries",ie=function(){return this};x.exports=function(H,Y,ce,ge,G,ve,ee){R(ce,Y,ge);var He=function(Ue){if(Ue===G&&at)return at;if(!I&&Ue in dt)return dt[Ue];switch(Ue){case K:return function(){return new ce(this,Ue)};case te:return function(){return new ce(this,Ue)};case j:return function(){return new ce(this,Ue)}}return function(){return new ce(this)}},_e=Y+" Iterator",ze=!1,dt=H.prototype,ft=dt[F]||dt["@@iterator"]||G&&dt[G],at=!I&&ft||He(G),Gt=Y=="Array"&&dt.entries||ft,ht,Ot,nt;if(Gt&&(ht=V(Gt.call(new H)),ht!==Object.prototype&&ht.next&&(!E&&V(ht)!==S&&(Q?Q(ht,S):D(ht[F])||re(ht,F,ie)),Z(ht,_e,!0,!0),E&&($[_e]=ie))),J&&G==te&&ft&&ft.name!==te&&(!E&&M?de(dt,"name",te):(ze=!0,at=function(){return C(ft,this)})),G)if(Ot={values:He(te),keys:ve?at:He(K),entries:He(j)},ee)for(nt in Ot)(I||ze||!(nt in dt))&&re(dt,nt,Ot[nt]);else v({target:Y,proto:!0,forced:I||ze},Ot);return(!E||ee)&&dt[F]!==at&&re(dt,F,at,{name:G}),$[Y]=at,Ot}},98488:(x,N,f)=>{"use strict";var v=f(31982),C=f(43152),E=f(92548),P=f(73270),D=f(90851),R=f(27519),V=f(33538),Q=f(39839),Z=V("iterator"),de=!1,re,se,$;[].keys&&($=[].keys(),"next"in $?(se=D(D($)),se!==Object.prototype&&(re=se)):de=!0);var k=!E(re)||v(function(){var J={};return re[Z].call(J)!==J});k?re={}:Q&&(re=P(re)),C(re[Z])||R(re,Z,function(){return this}),x.exports={IteratorPrototype:re,BUGGY_SAFARI_ITERATORS:de}},94609:x=>{x.exports={}},53387:(x,N,f)=>{var v=f(62567);x.exports=function(C){return v(C.length)}},99295:x=>{var N=Math.ceil,f=Math.floor;x.exports=Math.trunc||function(C){var E=+C;return(E>0?f:N)(E)}},73270:(x,N,f)=>{var v=f(35970),C=f(98911),E=f(11792),P=f(13477),D=f(19552),R=f(45511),V=f(4580),Q=">",Z="<",de="prototype",re="script",se=V("IE_PROTO"),$=function(){},k=function(F){return Z+re+Q+F+Z+"/"+re+Q},J=function(F){F.write(k("")),F.close();var K=F.parentWindow.Object;return F=null,K},M=function(){var F=R("iframe"),K="java"+re+":",te;return F.style.display="none",D.appendChild(F),F.src=String(K),te=F.contentWindow.document,te.open(),te.write(k("document.F=Object")),te.close(),te.F},S,I=function(){try{S=new ActiveXObject("htmlfile")}catch{}I=typeof document<"u"?document.domain&&S?J(S):M():J(S);for(var F=E.length;F--;)delete I[de][E[F]];return I()};P[se]=!0,x.exports=Object.create||function(K,te){var j;return K!==null?($[de]=v(K),j=new $,$[de]=null,j[se]=K):j=I(),te===void 0?j:C.f(j,te)}},98911:(x,N,f)=>{var v=f(56049),C=f(98715),E=f(36133),P=f(35970),D=f(88966),R=f(16619);N.f=v&&!C?Object.defineProperties:function(Q,Z){P(Q);for(var de=D(Z),re=R(Z),se=re.length,$=0,k;se>$;)E.f(Q,k=re[$++],de[k]);return Q}},36133:(x,N,f)=>{var v=f(56049),C=f(11314),E=f(98715),P=f(35970),D=f(5135),R=TypeError,V=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,Z="enumerable",de="configurable",re="writable";N.f=v?E?function($,k,J){if(P($),k=D(k),P(J),typeof $=="function"&&k==="prototype"&&"value"in J&&re in J&&!J[re]){var M=Q($,k);M&&M[re]&&($[k]=J.value,J={configurable:de in J?J[de]:M[de],enumerable:Z in J?J[Z]:M[Z],writable:!1})}return V($,k,J)}:V:function($,k,J){if(P($),k=D(k),P(J),C)try{return V($,k,J)}catch{}if("get"in J||"set"in J)throw R("Accessors not supported");return"value"in J&&($[k]=J.value),$}},80016:(x,N,f)=>{var v=f(56049),C=f(12461),E=f(16457),P=f(54686),D=f(88966),R=f(5135),V=f(18768),Q=f(11314),Z=Object.getOwnPropertyDescriptor;N.f=v?Z:function(re,se){if(re=D(re),se=R(se),Q)try{return Z(re,se)}catch{}if(V(re,se))return P(!C(E.f,re,se),re[se])}},53515:(x,N,f)=>{var v=f(58310),C=f(88966),E=f(51203).f,P=f(67932),D=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],R=function(V){try{return E(V)}catch{return P(D)}};x.exports.f=function(Q){return D&&v(Q)=="Window"?R(Q):E(C(Q))}},51203:(x,N,f)=>{var v=f(4541),C=f(11792),E=C.concat("length","prototype");N.f=Object.getOwnPropertyNames||function(D){return v(D,E)}},97620:(x,N)=>{N.f=Object.getOwnPropertySymbols},90851:(x,N,f)=>{var v=f(18768),C=f(43152),E=f(53254),P=f(4580),D=f(74838),R=P("IE_PROTO"),V=Object,Q=V.prototype;x.exports=D?V.getPrototypeOf:function(Z){var de=E(Z);if(v(de,R))return de[R];var re=de.constructor;return C(re)&&de instanceof re?re.prototype:de instanceof V?Q:null}},15166:(x,N,f)=>{var v=f(90406);x.exports=v({}.isPrototypeOf)},4541:(x,N,f)=>{var v=f(90406),C=f(18768),E=f(88966),P=f(66322).indexOf,D=f(13477),R=v([].push);x.exports=function(V,Q){var Z=E(V),de=0,re=[],se;for(se in Z)!C(D,se)&&C(Z,se)&&R(re,se);for(;Q.length>de;)C(Z,se=Q[de++])&&(~P(re,se)||R(re,se));return re}},16619:(x,N,f)=>{var v=f(4541),C=f(11792);x.exports=Object.keys||function(P){return v(P,C)}},16457:(x,N)=>{"use strict";var f={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,C=v&&!f.call({1:2},1);N.f=C?function(P){var D=v(this,P);return!!D&&D.enumerable}:f},70738:(x,N,f)=>{var v=f(54518),C=f(35970),E=f(72185);x.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var P=!1,D={},R;try{R=v(Object.prototype,"__proto__","set"),R(D,[]),P=D instanceof Array}catch{}return function(Q,Z){return C(Q),E(Z),P?R(Q,Z):Q.__proto__=Z,Q}}():void 0)},68399:(x,N,f)=>{"use strict";var v=f(48448),C=f(82059);x.exports=v?{}.toString:function(){return"[object "+C(this)+"]"}},96380:(x,N,f)=>{var v=f(12461),C=f(43152),E=f(92548),P=TypeError;x.exports=function(D,R){var V,Q;if(R==="string"&&C(V=D.toString)&&!E(Q=v(V,D))||C(V=D.valueOf)&&!E(Q=v(V,D))||R!=="string"&&C(V=D.toString)&&!E(Q=v(V,D)))return Q;throw P("Can't convert object to primitive value")}},47813:(x,N,f)=>{var v=f(97080),C=f(90406),E=f(51203),P=f(97620),D=f(35970),R=C([].concat);x.exports=v("Reflect","ownKeys")||function(Q){var Z=E.f(D(Q)),de=P.f;return de?R(Z,de(Q)):Z}},59921:x=>{x.exports={}},31251:(x,N,f)=>{var v=f(71365),C=TypeError;x.exports=function(E){if(v(E))throw C("Can't call method on "+E);return E}},98889:(x,N,f)=>{var v=f(48448),C=f(36133).f,E=f(20410),P=f(18768),D=f(68399),R=f(33538),V=R("toStringTag");x.exports=function(Q,Z,de,re){if(Q){var se=de?Q:Q.prototype;P(se,V)||C(se,V,{configurable:!0,value:Z}),re&&!v&&E(se,"toString",D)}}},4580:(x,N,f)=>{var v=f(95976),C=f(91248),E=v("keys");x.exports=function(P){return E[P]||(E[P]=C(P))}},70716:(x,N,f)=>{var v=f(62447),C=f(9267),E="__core-js_shared__",P=v[E]||C(E,{});x.exports=P},95976:(x,N,f)=>{var v=f(39839),C=f(70716);(x.exports=function(E,P){return C[E]||(C[E]=P!==void 0?P:{})})("versions",[]).push({version:"3.29.1",mode:v?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE",source:"https://github.com/zloirock/core-js"})},18143:(x,N,f)=>{var v=f(90406),C=f(32041),E=f(46025),P=f(31251),D=v("".charAt),R=v("".charCodeAt),V=v("".slice),Q=function(Z){return function(de,re){var se=E(P(de)),$=C(re),k=se.length,J,M;return $<0||$>=k?Z?"":void 0:(J=R(se,$),J<55296||J>56319||$+1===k||(M=R(se,$+1))<56320||M>57343?Z?D(se,$):J:Z?V(se,$,$+2):(J-55296<<10)+(M-56320)+65536)}};x.exports={codeAt:Q(!1),charAt:Q(!0)}},71775:(x,N,f)=>{var v=f(32438),C=f(31982);x.exports=!!Object.getOwnPropertySymbols&&!C(function(){var E=Symbol();return!String(E)||!(Object(E)instanceof Symbol)||!Symbol.sham&&v&&v<41})},95679:(x,N,f)=>{var v=f(12461),C=f(97080),E=f(33538),P=f(27519);x.exports=function(){var D=C("Symbol"),R=D&&D.prototype,V=R&&R.valueOf,Q=E("toPrimitive");R&&!R[Q]&&P(R,Q,function(Z){return v(V,this)},{arity:1})}},82294:(x,N,f)=>{var v=f(71775);x.exports=v&&!!Symbol.for&&!!Symbol.keyFor},13249:(x,N,f)=>{var v=f(32041),C=Math.max,E=Math.min;x.exports=function(P,D){var R=v(P);return R<0?C(R+D,0):E(R,D)}},88966:(x,N,f)=>{var v=f(38622),C=f(31251);x.exports=function(E){return v(C(E))}},32041:(x,N,f)=>{var v=f(99295);x.exports=function(C){var E=+C;return E!==E||E===0?0:v(E)}},62567:(x,N,f)=>{var v=f(32041),C=Math.min;x.exports=function(E){return E>0?C(v(E),9007199254740991):0}},53254:(x,N,f)=>{var v=f(31251),C=Object;x.exports=function(E){return C(v(E))}},37505:(x,N,f)=>{var v=f(12461),C=f(92548),E=f(28609),P=f(27529),D=f(96380),R=f(33538),V=TypeError,Q=R("toPrimitive");x.exports=function(Z,de){if(!C(Z)||E(Z))return Z;var re=P(Z,Q),se;if(re){if(de===void 0&&(de="default"),se=v(re,Z,de),!C(se)||E(se))return se;throw V("Can't convert object to primitive value")}return de===void 0&&(de="number"),D(Z,de)}},5135:(x,N,f)=>{var v=f(37505),C=f(28609);x.exports=function(E){var P=v(E,"string");return C(P)?P:P+""}},48448:(x,N,f)=>{var v=f(33538),C=v("toStringTag"),E={};E[C]="z",x.exports=String(E)==="[object z]"},46025:(x,N,f)=>{var v=f(82059),C=String;x.exports=function(E){if(v(E)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return C(E)}},18342:x=>{var N=String;x.exports=function(f){try{return N(f)}catch{return"Object"}}},91248:(x,N,f)=>{var v=f(90406),C=0,E=Math.random(),P=v(1 .toString);x.exports=function(D){return"Symbol("+(D===void 0?"":D)+")_"+P(++C+E,36)}},27237:(x,N,f)=>{var v=f(71775);x.exports=v&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},98715:(x,N,f)=>{var v=f(56049),C=f(31982);x.exports=v&&C(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})},57761:(x,N,f)=>{var v=f(62447),C=f(43152),E=v.WeakMap;x.exports=C(E)&&/native code/.test(String(E))},64832:(x,N,f)=>{var v=f(59921),C=f(18768),E=f(39378),P=f(36133).f;x.exports=function(D){var R=v.Symbol||(v.Symbol={});C(R,D)||P(R,D,{value:E.f(D)})}},39378:(x,N,f)=>{var v=f(33538);N.f=v},33538:(x,N,f)=>{var v=f(62447),C=f(95976),E=f(18768),P=f(91248),D=f(71775),R=f(27237),V=v.Symbol,Q=C("wks"),Z=R?V.for||V:V&&V.withoutSetter||P;x.exports=function(de){return E(Q,de)||(Q[de]=D&&E(V,de)?V[de]:Z("Symbol."+de)),Q[de]}},69825:(x,N,f)=>{"use strict";var v=f(30080),C=f(31982),E=f(93053),P=f(92548),D=f(53254),R=f(53387),V=f(11452),Q=f(53437),Z=f(69573),de=f(36844),re=f(33538),se=f(32438),$=re("isConcatSpreadable"),k=se>=51||!C(function(){var S=[];return S[$]=!1,S.concat()[0]!==S}),J=function(S){if(!P(S))return!1;var I=S[$];return I!==void 0?!!I:E(S)},M=!k||!de("concat");v({target:"Array",proto:!0,arity:1,forced:M},{concat:function(I){var F=D(this),K=Z(F,0),te=0,j,ie,H,Y,ce;for(j=-1,H=arguments.length;j<H;j++)if(ce=j===-1?F:arguments[j],J(ce))for(Y=R(ce),V(te+Y),ie=0;ie<Y;ie++,te++)ie in ce&&Q(K,te,ce[ie]);else V(te+1),Q(K,te++,ce);return K.length=te,K}})},17802:(x,N,f)=>{"use strict";var v=f(30080),C=f(93935).filter,E=f(36844),P=E("filter");v({target:"Array",proto:!0,forced:!P},{filter:function(R){return C(this,R,arguments.length>1?arguments[1]:void 0)}})},64009:(x,N,f)=>{"use strict";var v=f(30080),C=f(24782);v({target:"Array",proto:!0,forced:[].forEach!=C},{forEach:C})},32449:(x,N,f)=>{"use strict";var v=f(30080),C=f(57953),E=f(66322).indexOf,P=f(10454),D=C([].indexOf),R=!!D&&1/D([1],1,-0)<0,V=R||!P("indexOf");v({target:"Array",proto:!0,forced:V},{indexOf:function(Z){var de=arguments.length>1?arguments[1]:void 0;return R?D(this,Z,de)||0:E(this,Z,de)}})},44390:(x,N,f)=>{"use strict";var v=f(88966),C=f(20844),E=f(94609),P=f(44083),D=f(36133).f,R=f(78107),V=f(10248),Q=f(39839),Z=f(56049),de="Array Iterator",re=P.set,se=P.getterFor(de);x.exports=R(Array,"Array",function(k,J){re(this,{type:de,target:v(k),index:0,kind:J})},function(){var k=se(this),J=k.target,M=k.kind,S=k.index++;return!J||S>=J.length?(k.target=void 0,V(void 0,!0)):M=="keys"?V(S,!1):M=="values"?V(J[S],!1):V([S,J[S]],!1)},"values");var $=E.Arguments=E.Array;if(C("keys"),C("values"),C("entries"),!Q&&Z&&$.name!=="values")try{D($,"name",{value:"values"})}catch{}},91667:()=>{},9754:(x,N,f)=>{var v=f(30080),C=f(97080),E=f(82768),P=f(12461),D=f(90406),R=f(31982),V=f(43152),Q=f(28609),Z=f(53160),de=f(82850),re=f(71775),se=String,$=C("JSON","stringify"),k=D(/./.exec),J=D("".charAt),M=D("".charCodeAt),S=D("".replace),I=D(1 .toString),F=/[\uD800-\uDFFF]/g,K=/^[\uD800-\uDBFF]$/,te=/^[\uDC00-\uDFFF]$/,j=!re||R(function(){var ce=C("Symbol")();return $([ce])!="[null]"||$({a:ce})!="{}"||$(Object(ce))!="{}"}),ie=R(function(){return $("\uDF06\uD834")!=='"\\udf06\\ud834"'||$("\uDEAD")!=='"\\udead"'}),H=function(ce,ge){var G=Z(arguments),ve=de(ge);if(!(!V(ve)&&(ce===void 0||Q(ce))))return G[1]=function(ee,He){if(V(ve)&&(He=P(ve,this,se(ee),He)),!Q(He))return He},E($,null,G)},Y=function(ce,ge,G){var ve=J(G,ge-1),ee=J(G,ge+1);return k(K,ce)&&!k(te,ee)||k(te,ce)&&!k(K,ve)?"\\u"+I(M(ce,0),16):ce};$&&v({target:"JSON",stat:!0,arity:3,forced:j||ie},{stringify:function(ge,G,ve){var ee=Z(arguments),He=E(j?H:$,null,ee);return ie&&typeof He=="string"?S(He,F,Y):He}})},23870:(x,N,f)=>{var v=f(62447),C=f(98889);C(v.JSON,"JSON",!0)},5828:()=>{},28135:(x,N,f)=>{var v=f(30080),C=f(56049),E=f(98911).f;v({target:"Object",stat:!0,forced:Object.defineProperties!==E,sham:!C},{defineProperties:E})},70829:(x,N,f)=>{var v=f(30080),C=f(56049),E=f(36133).f;v({target:"Object",stat:!0,forced:Object.defineProperty!==E,sham:!C},{defineProperty:E})},51964:(x,N,f)=>{var v=f(30080),C=f(31982),E=f(88966),P=f(80016).f,D=f(56049),R=!D||C(function(){P(1)});v({target:"Object",stat:!0,forced:R,sham:!D},{getOwnPropertyDescriptor:function(Q,Z){return P(E(Q),Z)}})},723:(x,N,f)=>{var v=f(30080),C=f(56049),E=f(47813),P=f(88966),D=f(80016),R=f(53437);v({target:"Object",stat:!0,sham:!C},{getOwnPropertyDescriptors:function(Q){for(var Z=P(Q),de=D.f,re=E(Z),se={},$=0,k,J;re.length>$;)J=de(Z,k=re[$++]),J!==void 0&&R(se,k,J);return se}})},86884:(x,N,f)=>{var v=f(30080),C=f(71775),E=f(31982),P=f(97620),D=f(53254),R=!C||E(function(){P.f(1)});v({target:"Object",stat:!0,forced:R},{getOwnPropertySymbols:function(Q){var Z=P.f;return Z?Z(D(Q)):[]}})},38339:(x,N,f)=>{var v=f(30080),C=f(53254),E=f(16619),P=f(31982),D=P(function(){E(1)});v({target:"Object",stat:!0,forced:D},{keys:function(V){return E(C(V))}})},97829:()=>{},5708:()=>{},27626:(x,N,f)=>{"use strict";var v=f(18143).charAt,C=f(46025),E=f(44083),P=f(78107),D=f(10248),R="String Iterator",V=E.set,Q=E.getterFor(R);P(String,"String",function(Z){V(this,{type:R,string:C(Z),index:0})},function(){var de=Q(this),re=de.string,se=de.index,$;return se>=re.length?D(void 0,!0):($=v(re,se),de.index+=$.length,D($,!1))})},95353:(x,N,f)=>{var v=f(64832);v("asyncIterator")},16212:(x,N,f)=>{"use strict";var v=f(30080),C=f(62447),E=f(12461),P=f(90406),D=f(39839),R=f(56049),V=f(71775),Q=f(31982),Z=f(18768),de=f(15166),re=f(35970),se=f(88966),$=f(5135),k=f(46025),J=f(54686),M=f(73270),S=f(16619),I=f(51203),F=f(53515),K=f(97620),te=f(80016),j=f(36133),ie=f(98911),H=f(16457),Y=f(27519),ce=f(37912),ge=f(95976),G=f(4580),ve=f(13477),ee=f(91248),He=f(33538),_e=f(39378),ze=f(64832),dt=f(95679),ft=f(98889),at=f(44083),Gt=f(93935).forEach,ht=G("hidden"),Ot="Symbol",nt="prototype",Ue=at.set,Fe=at.getterFor(Ot),Re=Object[nt],it=C.Symbol,Dt=it&&it[nt],qe=C.TypeError,St=C.QObject,Kt=te.f,Jt=j.f,pr=F.f,Je=H.f,xt=P([].push),Lt=ge("symbols"),Or=ge("op-symbols"),Ft=ge("wks"),hn=!St||!St[nt]||!St[nt].findChild,pn=R&&Q(function(){return M(Jt({},"a",{get:function(){return Jt(this,"a",{value:7}).a}})).a!=7})?function(mt,st,Qe){var pt=Kt(Re,st);pt&&delete Re[st],Jt(mt,st,Qe),pt&&mt!==Re&&Jt(Re,st,pt)}:Jt,Hr=function(mt,st){var Qe=Lt[mt]=M(Dt);return Ue(Qe,{type:Ot,tag:mt,description:st}),R||(Qe.description=st),Qe},en=function(st,Qe,pt){st===Re&&en(Or,Qe,pt),re(st);var ne=$(Qe);return re(pt),Z(Lt,ne)?(pt.enumerable?(Z(st,ht)&&st[ht][ne]&&(st[ht][ne]=!1),pt=M(pt,{enumerable:J(0,!1)})):(Z(st,ht)||Jt(st,ht,J(1,{})),st[ht][ne]=!0),pn(st,ne,pt)):Jt(st,ne,pt)},kn=function(st,Qe){re(st);var pt=se(Qe),ne=S(pt).concat(Rt(pt));return Gt(ne,function(be){(!R||E(Ur,pt,be))&&en(st,be,pt[be])}),st},vn=function(st,Qe){return Qe===void 0?M(st):kn(M(st),Qe)},Ur=function(st){var Qe=$(st),pt=E(Je,this,Qe);return this===Re&&Z(Lt,Qe)&&!Z(Or,Qe)?!1:pt||!Z(this,Qe)||!Z(Lt,Qe)||Z(this,ht)&&this[ht][Qe]?pt:!0},gr=function(st,Qe){var pt=se(st),ne=$(Qe);if(!(pt===Re&&Z(Lt,ne)&&!Z(Or,ne))){var be=Kt(pt,ne);return be&&Z(Lt,ne)&&!(Z(pt,ht)&&pt[ht][ne])&&(be.enumerable=!0),be}},Er=function(st){var Qe=pr(se(st)),pt=[];return Gt(Qe,function(ne){!Z(Lt,ne)&&!Z(ve,ne)&&xt(pt,ne)}),pt},Rt=function(mt){var st=mt===Re,Qe=pr(st?Or:se(mt)),pt=[];return Gt(Qe,function(ne){Z(Lt,ne)&&(!st||Z(Re,ne))&&xt(pt,Lt[ne])}),pt};V||(it=function(){if(de(Dt,this))throw qe("Symbol is not a constructor");var st=!arguments.length||arguments[0]===void 0?void 0:k(arguments[0]),Qe=ee(st),pt=function(ne){this===Re&&E(pt,Or,ne),Z(this,ht)&&Z(this[ht],Qe)&&(this[ht][Qe]=!1),pn(this,Qe,J(1,ne))};return R&&hn&&pn(Re,Qe,{configurable:!0,set:pt}),Hr(Qe,st)},Dt=it[nt],Y(Dt,"toString",function(){return Fe(this).tag}),Y(it,"withoutSetter",function(mt){return Hr(ee(mt),mt)}),H.f=Ur,j.f=en,ie.f=kn,te.f=gr,I.f=F.f=Er,K.f=Rt,_e.f=function(mt){return Hr(He(mt),mt)},R&&(ce(Dt,"description",{configurable:!0,get:function(){return Fe(this).description}}),D||Y(Re,"propertyIsEnumerable",Ur,{unsafe:!0}))),v({global:!0,constructor:!0,wrap:!0,forced:!V,sham:!V},{Symbol:it}),Gt(S(Ft),function(mt){ze(mt)}),v({target:Ot,stat:!0,forced:!V},{useSetter:function(){hn=!0},useSimple:function(){hn=!1}}),v({target:"Object",stat:!0,forced:!V,sham:!R},{create:vn,defineProperty:en,defineProperties:kn,getOwnPropertyDescriptor:gr}),v({target:"Object",stat:!0,forced:!V},{getOwnPropertyNames:Er}),dt(),ft(it,Ot),ve[ht]=!0},63906:()=>{},3598:(x,N,f)=>{var v=f(30080),C=f(97080),E=f(18768),P=f(46025),D=f(95976),R=f(82294),V=D("string-to-symbol-registry"),Q=D("symbol-to-string-registry");v({target:"Symbol",stat:!0,forced:!R},{for:function(Z){var de=P(Z);if(E(V,de))return V[de];var re=C("Symbol")(de);return V[de]=re,Q[re]=de,re}})},39542:(x,N,f)=>{var v=f(64832);v("hasInstance")},47882:(x,N,f)=>{var v=f(64832);v("isConcatSpreadable")},84911:(x,N,f)=>{var v=f(64832);v("iterator")},68030:(x,N,f)=>{f(16212),f(3598),f(50338),f(9754),f(86884)},50338:(x,N,f)=>{var v=f(30080),C=f(18768),E=f(28609),P=f(18342),D=f(95976),R=f(82294),V=D("symbol-to-string-registry");v({target:"Symbol",stat:!0,forced:!R},{keyFor:function(Z){if(!E(Z))throw TypeError(P(Z)+" is not a symbol");if(C(V,Z))return V[Z]}})},47954:(x,N,f)=>{var v=f(64832);v("matchAll")},88725:(x,N,f)=>{var v=f(64832);v("match")},67703:(x,N,f)=>{var v=f(64832);v("replace")},2220:(x,N,f)=>{var v=f(64832);v("search")},48990:(x,N,f)=>{var v=f(64832);v("species")},50240:(x,N,f)=>{var v=f(64832);v("split")},99921:(x,N,f)=>{var v=f(64832),C=f(95679);v("toPrimitive"),C()},3502:(x,N,f)=>{var v=f(97080),C=f(64832),E=f(98889);C("toStringTag"),E(v("Symbol"),"Symbol")},80220:(x,N,f)=>{var v=f(64832);v("unscopables")},45987:(x,N,f)=>{var v=f(64832);v("asyncDispose")},42319:(x,N,f)=>{var v=f(64832);v("dispose")},58052:(x,N,f)=>{var v=f(30080),C=f(97080),E=f(90406),P=C("Symbol"),D=P.keyFor,R=E(P.prototype.valueOf);v({target:"Symbol",stat:!0},{isRegistered:function(Q){try{return D(R(Q))!==void 0}catch{return!1}}})},90181:(x,N,f)=>{for(var v=f(30080),C=f(95976),E=f(97080),P=f(90406),D=f(28609),R=f(33538),V=E("Symbol"),Q=V.isWellKnown,Z=E("Object","getOwnPropertyNames"),de=P(V.prototype.valueOf),re=C("wks"),se=0,$=Z(V),k=$.length;se<k;se++)try{var J=$[se];D(V[J])&&R(J)}catch{}v({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(S){if(Q&&Q(S))return!0;try{for(var I=de(S),F=0,K=Z(re),te=K.length;F<te;F++)if(re[K[F]]==I)return!0}catch{}return!1}})},25129:(x,N,f)=>{var v=f(64832);v("matcher")},90397:(x,N,f)=>{var v=f(64832);v("metadataKey")},82793:(x,N,f)=>{var v=f(64832);v("metadata")},18097:(x,N,f)=>{var v=f(64832);v("observable")},52100:(x,N,f)=>{var v=f(64832);v("patternMatch")},99742:(x,N,f)=>{var v=f(64832);v("replaceAll")},48713:(x,N,f)=>{f(44390);var v=f(81595),C=f(62447),E=f(82059),P=f(20410),D=f(94609),R=f(33538),V=R("toStringTag");for(var Q in v){var Z=C[Q],de=Z&&Z.prototype;de&&E(de)!==V&&P(de,V,Q),D[Q]=D.Array}},41544:(x,N,f)=>{var v=f(94537);x.exports=v},44928:(x,N,f)=>{var v=f(55794);x.exports=v},26087:(x,N,f)=>{f(48713);var v=f(82059),C=f(18768),E=f(15166),P=f(41544),D=Array.prototype,R={DOMTokenList:!0,NodeList:!0};x.exports=function(V){var Q=V.forEach;return V===D||E(D,V)&&Q===D.forEach||C(R,v(V))?P:Q}},11783:(x,N,f)=>{var v=f(85838);x.exports=v},88462:(x,N,f)=>{var v=f(95617);x.exports=v},83531:(x,N,f)=>{var v=f(11906);x.exports=v},19941:(x,N,f)=>{var v=f(59123);x.exports=v},25081:(x,N,f)=>{var v=f(63332);x.exports=v},22145:(x,N,f)=>{var v=f(83606);x.exports=v},93690:(x,N,f)=>{var v=f(90660);x.exports=v},8429:(x,N,f)=>{var v=f(49198);f(48713),x.exports=v},13099:(x,N,f)=>{var v=f(15413);f(48713),x.exports=v},44931:(x,N,f)=>{var v=f(4793);x.exports=v},81933:function(){(function(x){var N=function(f){var v={searchParams:"URLSearchParams"in x,iterable:"Symbol"in x&&"iterator"in Symbol,blob:"FileReader"in x&&"Blob"in x&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in x,arrayBuffer:"ArrayBuffer"in x};function C(H){return H&&DataView.prototype.isPrototypeOf(H)}if(v.arrayBuffer)var E=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],P=ArrayBuffer.isView||function(H){return H&&E.indexOf(Object.prototype.toString.call(H))>-1};function D(H){if(typeof H!="string"&&(H=String(H)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(H))throw new TypeError("Invalid character in header field name");return H.toLowerCase()}function R(H){return typeof H!="string"&&(H=String(H)),H}function V(H){var Y={next:function(){var ce=H.shift();return{done:ce===void 0,value:ce}}};return v.iterable&&(Y[Symbol.iterator]=function(){return Y}),Y}function Q(H){this.map={},H instanceof Q?H.forEach(function(Y,ce){this.append(ce,Y)},this):Array.isArray(H)?H.forEach(function(Y){this.append(Y[0],Y[1])},this):H&&Object.getOwnPropertyNames(H).forEach(function(Y){this.append(Y,H[Y])},this)}Q.prototype.append=function(H,Y){H=D(H),Y=R(Y);var ce=this.map[H];this.map[H]=ce?ce+", "+Y:Y},Q.prototype.delete=function(H){delete this.map[D(H)]},Q.prototype.get=function(H){return H=D(H),this.has(H)?this.map[H]:null},Q.prototype.has=function(H){return this.map.hasOwnProperty(D(H))},Q.prototype.set=function(H,Y){this.map[D(H)]=R(Y)},Q.prototype.forEach=function(H,Y){for(var ce in this.map)this.map.hasOwnProperty(ce)&&H.call(Y,this.map[ce],ce,this)},Q.prototype.keys=function(){var H=[];return this.forEach(function(Y,ce){H.push(ce)}),V(H)},Q.prototype.values=function(){var H=[];return this.forEach(function(Y){H.push(Y)}),V(H)},Q.prototype.entries=function(){var H=[];return this.forEach(function(Y,ce){H.push([ce,Y])}),V(H)},v.iterable&&(Q.prototype[Symbol.iterator]=Q.prototype.entries);function Z(H){if(H.bodyUsed)return Promise.reject(new TypeError("Already read"));H.bodyUsed=!0}function de(H){return new Promise(function(Y,ce){H.onload=function(){Y(H.result)},H.onerror=function(){ce(H.error)}})}function re(H){var Y=new FileReader,ce=de(Y);return Y.readAsArrayBuffer(H),ce}function se(H){var Y=new FileReader,ce=de(Y);return Y.readAsText(H),ce}function $(H){for(var Y=new Uint8Array(H),ce=new Array(Y.length),ge=0;ge<Y.length;ge++)ce[ge]=String.fromCharCode(Y[ge]);return ce.join("")}function k(H){if(H.slice)return H.slice(0);var Y=new Uint8Array(H.byteLength);return Y.set(new Uint8Array(H)),Y.buffer}function J(){return this.bodyUsed=!1,this._initBody=function(H){this._bodyInit=H,H?typeof H=="string"?this._bodyText=H:v.blob&&Blob.prototype.isPrototypeOf(H)?this._bodyBlob=H:v.formData&&FormData.prototype.isPrototypeOf(H)?this._bodyFormData=H:v.searchParams&&URLSearchParams.prototype.isPrototypeOf(H)?this._bodyText=H.toString():v.arrayBuffer&&v.blob&&C(H)?(this._bodyArrayBuffer=k(H.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):v.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(H)||P(H))?this._bodyArrayBuffer=k(H):this._bodyText=H=Object.prototype.toString.call(H):this._bodyText="",this.headers.get("content-type")||(typeof H=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):v.searchParams&&URLSearchParams.prototype.isPrototypeOf(H)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},v.blob&&(this.blob=function(){var H=Z(this);if(H)return H;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?Z(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(re)}),this.text=function(){var H=Z(this);if(H)return H;if(this._bodyBlob)return se(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve($(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},v.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var M=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function S(H){var Y=H.toUpperCase();return M.indexOf(Y)>-1?Y:H}function I(H,Y){Y=Y||{};var ce=Y.body;if(H instanceof I){if(H.bodyUsed)throw new TypeError("Already read");this.url=H.url,this.credentials=H.credentials,Y.headers||(this.headers=new Q(H.headers)),this.method=H.method,this.mode=H.mode,this.signal=H.signal,!ce&&H._bodyInit!=null&&(ce=H._bodyInit,H.bodyUsed=!0)}else this.url=String(H);if(this.credentials=Y.credentials||this.credentials||"same-origin",(Y.headers||!this.headers)&&(this.headers=new Q(Y.headers)),this.method=S(Y.method||this.method||"GET"),this.mode=Y.mode||this.mode||null,this.signal=Y.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ce)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ce)}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function F(H){var Y=new FormData;return H.trim().split("&").forEach(function(ce){if(ce){var ge=ce.split("="),G=ge.shift().replace(/\+/g," "),ve=ge.join("=").replace(/\+/g," ");Y.append(decodeURIComponent(G),decodeURIComponent(ve))}}),Y}function K(H){var Y=new Q,ce=H.replace(/\r?\n[\t ]+/g," ");return ce.split(/\r?\n/).forEach(function(ge){var G=ge.split(":"),ve=G.shift().trim();if(ve){var ee=G.join(":").trim();Y.append(ve,ee)}}),Y}J.call(I.prototype);function te(H,Y){Y||(Y={}),this.type="default",this.status=Y.status===void 0?200:Y.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in Y?Y.statusText:"OK",this.headers=new Q(Y.headers),this.url=Y.url||"",this._initBody(H)}J.call(te.prototype),te.prototype.clone=function(){return new te(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Q(this.headers),url:this.url})},te.error=function(){var H=new te(null,{status:0,statusText:""});return H.type="error",H};var j=[301,302,303,307,308];te.redirect=function(H,Y){if(j.indexOf(Y)===-1)throw new RangeError("Invalid status code");return new te(null,{status:Y,headers:{location:H}})},f.DOMException=x.DOMException;try{new f.DOMException}catch{f.DOMException=function(Y,ce){this.message=Y,this.name=ce;var ge=Error(Y);this.stack=ge.stack},f.DOMException.prototype=Object.create(Error.prototype),f.DOMException.prototype.constructor=f.DOMException}function ie(H,Y){return new Promise(function(ce,ge){var G=new I(H,Y);if(G.signal&&G.signal.aborted)return ge(new f.DOMException("Aborted","AbortError"));var ve=new XMLHttpRequest;function ee(){ve.abort()}ve.onload=function(){var He={status:ve.status,statusText:ve.statusText,headers:K(ve.getAllResponseHeaders()||"")};He.url="responseURL"in ve?ve.responseURL:He.headers.get("X-Request-URL");var _e="response"in ve?ve.response:ve.responseText;ce(new te(_e,He))},ve.onerror=function(){ge(new TypeError("Network request failed"))},ve.ontimeout=function(){ge(new TypeError("Network request failed"))},ve.onabort=function(){ge(new f.DOMException("Aborted","AbortError"))},ve.open(G.method,G.url,!0),G.credentials==="include"?ve.withCredentials=!0:G.credentials==="omit"&&(ve.withCredentials=!1),"responseType"in ve&&v.blob&&(ve.responseType="blob"),G.headers.forEach(function(He,_e){ve.setRequestHeader(_e,He)}),G.signal&&(G.signal.addEventListener("abort",ee),ve.onreadystatechange=function(){ve.readyState===4&&G.signal.removeEventListener("abort",ee)}),ve.send(typeof G._bodyInit>"u"?null:G._bodyInit)})}return ie.polyfill=!0,x.fetch||(x.fetch=ie,x.Headers=Q,x.Request=I,x.Response=te),f.Headers=Q,f.Request=I,f.Response=te,f.fetch=ie,Object.defineProperty(f,"__esModule",{value:!0}),f}({})})(typeof self<"u"?self:this)},20788:(x,N,f)=>{"use strict";f.r(N),f.d(N,{default:()=>R});var v=f(64737),C=f.n(v),E=f(62578),P=f.n(E),D=P()(C());D.push([x.id,`.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px #0003;border-radius:3px;border:1px solid silver;background:white;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto;box-sizing:border-box}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}
42
- `,""]);const R=D},15218:(x,N,f)=>{"use strict";f.r(N),f.d(N,{default:()=>I});var v=f(64737),C=f.n(v),E=f(62578),P=f.n(E),D=f(7125),R=f.n(D),V=new URL(f(17735),f.b),Q=new URL(f(56089),f.b),Z=new URL(f(46050),f.b),de=new URL(f(71090),f.b),re=new URL(f(96192),f.b),se=P()(C()),$=R()(V),k=R()(Q),J=R()(Z),M=R()(de),S=R()(re);se.push([x.id,".CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px;color:#000;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url("+$+")}.CodeMirror-lint-mark-error{background-image:url("+k+")}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url("+J+")}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url("+M+")}.CodeMirror-lint-marker-multiple{background-image:url("+S+`);background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-lint-line-error{background-color:#b74c5114}.CodeMirror-lint-line-warning{background-color:#ffd3001a}
43
- `,""]);const I=se},80766:(x,N,f)=>{"use strict";f.r(N),f.d(N,{default:()=>R});var v=f(64737),C=f.n(v),E=f(62578),P=f.n(E),D=P()(C());D.push([x.id,`.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;inset:-50px 0 0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;inset:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}
44
- `,""]);const R=D},62459:(x,N,f)=>{"use strict";f.r(N),f.d(N,{default:()=>R});var v=f(64737),C=f.n(v),E=f(62578),P=f.n(E),D=P()(C());D.push([x.id,`.cm-s-material.CodeMirror{background-color:#263238;color:#eff}.cm-s-material .CodeMirror-gutters{background:#263238;color:#546e7a;border:none}.cm-s-material .CodeMirror-guttermarker,.cm-s-material .CodeMirror-guttermarker-subtle,.cm-s-material .CodeMirror-linenumber{color:#546e7a}.cm-s-material .CodeMirror-cursor{border-left:1px solid #FFCC00}.cm-s-material.cm-fat-cursor .CodeMirror-cursor,.cm-s-material .cm-animate-fat-cursor{background-color:#5d6d5c80!important}.cm-s-material div.CodeMirror-selected,.cm-s-material.CodeMirror-focused div.CodeMirror-selected{background:rgba(128,203,196,.2)}.cm-s-material .CodeMirror-line::selection,.cm-s-material .CodeMirror-line>span::selection,.cm-s-material .CodeMirror-line>span>span::selection{background:rgba(128,203,196,.2)}.cm-s-material .CodeMirror-line::-moz-selection,.cm-s-material .CodeMirror-line>span::-moz-selection,.cm-s-material .CodeMirror-line>span>span::-moz-selection{background:rgba(128,203,196,.2)}.cm-s-material .CodeMirror-activeline-background{background:rgba(0,0,0,.5)}.cm-s-material .cm-keyword{color:#c792ea}.cm-s-material .cm-operator{color:#89ddff}.cm-s-material .cm-variable-2{color:#eff}.cm-s-material .cm-variable-3,.cm-s-material .cm-type{color:#f07178}.cm-s-material .cm-builtin{color:#ffcb6b}.cm-s-material .cm-atom{color:#f78c6c}.cm-s-material .cm-number{color:#ff5370}.cm-s-material .cm-def{color:#82aaff}.cm-s-material .cm-string{color:#c3e88d}.cm-s-material .cm-string-2{color:#f07178}.cm-s-material .cm-comment{color:#546e7a}.cm-s-material .cm-variable{color:#f07178}.cm-s-material .cm-tag{color:#ff5370}.cm-s-material .cm-meta{color:#ffcb6b}.cm-s-material .cm-attribute,.cm-s-material .cm-property{color:#c792ea}.cm-s-material .cm-qualifier,.cm-s-material .cm-variable-3,.cm-s-material .cm-type{color:#decb6b}.cm-s-material .cm-error{color:#fff;background-color:#ff5370}.cm-s-material .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
45
- `,""]);const R=D},7125:x=>{"use strict";x.exports=function(N,f){return f||(f={}),N&&(N=String(N.__esModule?N.default:N),/^['"].*['"]$/.test(N)&&(N=N.slice(1,-1)),f.hash&&(N+=f.hash),/["'() \t\n]|(%20)/.test(N)||f.needQuotes?'"'.concat(N.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):N)}},99561:(x,N,f)=>{"use strict";f.r(N),f.d(N,{Console:()=>vv});var v={};f.r(v),f.d(v,{cookie:()=>Ef,header:()=>Of,path:()=>wf,query:()=>Cf});var C=f(10954),E=f(70762),P=f(93652),D=f(11099),R=f(10017),V=f(86351),Q=f(86751),Z=f(12953),de=f(55839),re=f(23422);function se(t){return se=typeof de=="function"&&typeof re=="symbol"?function(n){return typeof n}:function(n){return n&&typeof de=="function"&&n.constructor===de&&n!==de.prototype?"symbol":typeof n},se(t)}var $=f(47319);function k(t,n){if(se(t)!=="object"||t===null)return t;var i=t[$];if(i!==void 0){var s=i.call(t,n||"default");if(se(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}function J(t){var n=k(t,"string");return se(n)==="symbol"?n:String(n)}function M(t,n,i){return n=J(n),n in t?Z(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function S(t,n){var i=C(t);if(E){var s=E(t);n&&(s=P(s).call(s,function(u){return D(t,u).enumerable})),i.push.apply(i,s)}return i}function I(t){for(var n=1;n<arguments.length;n++){var i,s,u=arguments[n]!=null?arguments[n]:{};n%2?R(i=S(Object(u),!0)).call(i,function(c){M(t,c,u[c])}):V?Q(t,V(u)):R(s=S(Object(u))).call(s,function(c){Z(t,c,D(u,c))})}return t}var F=f(34961);function K(t,n){if(t==null)return{};var i={},s=C(t),u,c;for(c=0;c<s.length;c++)u=s[c],!(F(n).call(n,u)>=0)&&(i[u]=t[u]);return i}function te(t,n){if(t==null)return{};var i=K(t,n),s,u;if(E){var c=E(t);for(u=0;u<c.length;u++)s=c[u],!(F(n).call(n,s)>=0)&&Object.prototype.propertyIsEnumerable.call(t,s)&&(i[s]=t[s])}return i}var j=f(13546),ie=f.n(j),H=f(51121),Y=f(26179);/*!
11
+ */C.parse=b,C.serialize=x;var f=Object.prototype.toString,g=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function b(I,B){if(typeof I!="string")throw new TypeError("argument str must be a string");for(var z={},Y=B||{},_=Y.decode||k,X=0;X<I.length;){var G=I.indexOf("=",X);if(G===-1)break;var te=I.indexOf(";",X);if(te===-1)te=I.length;else if(te<G){X=I.lastIndexOf(";",G-1)+1;continue}var se=I.slice(X,G).trim();if(z[se]===void 0){var R=I.slice(G+1,te).trim();R.charCodeAt(0)===34&&(R=R.slice(1,-1)),z[se]=N(R,_)}X=te+1}return z}function x(I,B,z){var Y=z||{},_=Y.encode||O;if(typeof _!="function")throw new TypeError("option encode is invalid");if(!g.test(I))throw new TypeError("argument name is invalid");var X=_(B);if(X&&!g.test(X))throw new TypeError("argument val is invalid");var G=I+"="+X;if(Y.maxAge!=null){var te=Y.maxAge-0;if(isNaN(te)||!isFinite(te))throw new TypeError("option maxAge is invalid");G+="; Max-Age="+Math.floor(te)}if(Y.domain){if(!g.test(Y.domain))throw new TypeError("option domain is invalid");G+="; Domain="+Y.domain}if(Y.path){if(!g.test(Y.path))throw new TypeError("option path is invalid");G+="; Path="+Y.path}if(Y.expires){var se=Y.expires;if(!E(se)||isNaN(se.valueOf()))throw new TypeError("option expires is invalid");G+="; Expires="+se.toUTCString()}if(Y.httpOnly&&(G+="; HttpOnly"),Y.secure&&(G+="; Secure"),Y.priority){var R=typeof Y.priority=="string"?Y.priority.toLowerCase():Y.priority;switch(R){case"low":G+="; Priority=Low";break;case"medium":G+="; Priority=Medium";break;case"high":G+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(Y.sameSite){var ee=typeof Y.sameSite=="string"?Y.sameSite.toLowerCase():Y.sameSite;switch(ee){case!0:G+="; SameSite=Strict";break;case"lax":G+="; SameSite=Lax";break;case"strict":G+="; SameSite=Strict";break;case"none":G+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return G}function k(I){return I.indexOf("%")!==-1?decodeURIComponent(I):I}function O(I){return encodeURIComponent(I)}function E(I){return f.call(I)==="[object Date]"||I instanceof Date}function N(I,B){try{return B(I)}catch{return I}}},97529:(v,C,f)=>{var g=f(44928);v.exports=g},75342:(v,C,f)=>{var g=f(26087);v.exports=g},64218:(v,C,f)=>{var g=f(11783);v.exports=g},95050:(v,C,f)=>{var g=f(88462);v.exports=g},84779:(v,C,f)=>{var g=f(83531);v.exports=g},17190:(v,C,f)=>{var g=f(19941);v.exports=g},96589:(v,C,f)=>{var g=f(25081);v.exports=g},32276:(v,C,f)=>{var g=f(22145);v.exports=g},15064:(v,C,f)=>{var g=f(93690);v.exports=g},31986:(v,C,f)=>{var g=f(8429);f(42319),v.exports=g},69635:(v,C,f)=>{var g=f(13099);v.exports=g},3529:(v,C,f)=>{var g=f(44931);v.exports=g},85373:(v,C,f)=>{f(17802);var g=f(70291);v.exports=g("Array").filter},94537:(v,C,f)=>{f(64009);var g=f(70291);v.exports=g("Array").forEach},27794:(v,C,f)=>{f(32449);var g=f(70291);v.exports=g("Array").indexOf},55794:(v,C,f)=>{var g=f(15166),b=f(85373),x=Array.prototype;v.exports=function(k){var O=k.filter;return k===x||g(x,k)&&O===x.filter?b:O}},85838:(v,C,f)=>{var g=f(15166),b=f(27794),x=Array.prototype;v.exports=function(k){var O=k.indexOf;return k===x||g(x,k)&&O===x.indexOf?b:O}},95617:(v,C,f)=>{f(28135);var g=f(59921),b=g.Object,x=v.exports=function(O,E){return b.defineProperties(O,E)};b.defineProperties.sham&&(x.sham=!0)},11906:(v,C,f)=>{f(70829);var g=f(59921),b=g.Object,x=v.exports=function(O,E,N){return b.defineProperty(O,E,N)};b.defineProperty.sham&&(x.sham=!0)},59123:(v,C,f)=>{f(51964);var g=f(59921),b=g.Object,x=v.exports=function(O,E){return b.getOwnPropertyDescriptor(O,E)};b.getOwnPropertyDescriptor.sham&&(x.sham=!0)},63332:(v,C,f)=>{f(723);var g=f(59921);v.exports=g.Object.getOwnPropertyDescriptors},83606:(v,C,f)=>{f(68030);var g=f(59921);v.exports=g.Object.getOwnPropertySymbols},90660:(v,C,f)=>{f(38339);var g=f(59921);v.exports=g.Object.keys},49198:(v,C,f)=>{f(69825),f(97829),f(68030),f(95353),f(63906),f(39542),f(47882),f(84911),f(88725),f(47954),f(67703),f(2220),f(48990),f(50240),f(99921),f(3502),f(80220),f(23870),f(5828),f(5708);var g=f(59921);v.exports=g.Symbol},15413:(v,C,f)=>{f(44390),f(97829),f(27626),f(84911);var g=f(39378);v.exports=g.f("iterator")},4793:(v,C,f)=>{f(91667),f(99921);var g=f(39378);v.exports=g.f("toPrimitive")},24018:(v,C,f)=>{v.exports=f(11226)},27411:(v,C,f)=>{v.exports=f(39743)},79155:(v,C,f)=>{v.exports=f(17018)},13375:(v,C,f)=>{v.exports=f(45057)},95442:(v,C,f)=>{v.exports=f(97947)},55334:(v,C,f)=>{v.exports=f(26452)},48261:(v,C,f)=>{v.exports=f(4477)},92864:(v,C,f)=>{v.exports=f(74013)},27923:(v,C,f)=>{v.exports=f(17685)},89225:(v,C,f)=>{v.exports=f(2371)},95281:(v,C,f)=>{v.exports=f(89061)},55468:(v,C,f)=>{v.exports=f(51553)},11226:(v,C,f)=>{var g=f(97529);v.exports=g},39743:(v,C,f)=>{var g=f(75342);v.exports=g},17018:(v,C,f)=>{var g=f(64218);v.exports=g},45057:(v,C,f)=>{var g=f(95050);v.exports=g},97947:(v,C,f)=>{var g=f(84779);v.exports=g},26452:(v,C,f)=>{var g=f(17190);v.exports=g},4477:(v,C,f)=>{var g=f(96589);v.exports=g},74013:(v,C,f)=>{var g=f(32276);v.exports=g},17685:(v,C,f)=>{var g=f(15064);v.exports=g},2371:(v,C,f)=>{var g=f(31986);f(45987),f(58052),f(90181),f(25129),f(90397),f(18097),f(82793),f(52100),f(99742),v.exports=g},89061:(v,C,f)=>{var g=f(69635);v.exports=g},51553:(v,C,f)=>{var g=f(3529);v.exports=g},81970:(v,C,f)=>{var g=f(43152),b=f(18342),x=TypeError;v.exports=function(k){if(g(k))return k;throw x(b(k)+" is not a function")}},72185:(v,C,f)=>{var g=f(43152),b=String,x=TypeError;v.exports=function(k){if(typeof k=="object"||g(k))return k;throw x("Can't set "+b(k)+" as a prototype")}},20844:v=>{v.exports=function(){}},35970:(v,C,f)=>{var g=f(92548),b=String,x=TypeError;v.exports=function(k){if(g(k))return k;throw x(b(k)+" is not an object")}},24782:(v,C,f)=>{"use strict";var g=f(93935).forEach,b=f(10454),x=b("forEach");v.exports=x?[].forEach:function(O){return g(this,O,arguments.length>1?arguments[1]:void 0)}},66322:(v,C,f)=>{var g=f(88966),b=f(13249),x=f(53387),k=function(O){return function(E,N,I){var B=g(E),z=x(B),Y=b(I,z),_;if(O&&N!=N){for(;z>Y;)if(_=B[Y++],_!=_)return!0}else for(;z>Y;Y++)if((O||Y in B)&&B[Y]===N)return O||Y||0;return!O&&-1}};v.exports={includes:k(!0),indexOf:k(!1)}},93935:(v,C,f)=>{var g=f(7416),b=f(90406),x=f(38622),k=f(53254),O=f(53387),E=f(69573),N=b([].push),I=function(B){var z=B==1,Y=B==2,_=B==3,X=B==4,G=B==6,te=B==7,se=B==5||G;return function(R,ee,U,re){for(var ne=k(R),ae=x(ne),ce=g(ee,U),V=O(ae),K=0,le=re||E,pe=z?le(R,V):Y||te?le(R,0):void 0,ge,me;V>K;K++)if((se||K in ae)&&(ge=ae[K],me=ce(ge,K,ne),B))if(z)pe[K]=me;else if(me)switch(B){case 3:return!0;case 5:return ge;case 6:return K;case 2:N(pe,ge)}else switch(B){case 4:return!1;case 7:N(pe,ge)}return G?-1:_||X?X:pe}};v.exports={forEach:I(0),map:I(1),filter:I(2),some:I(3),every:I(4),find:I(5),findIndex:I(6),filterReject:I(7)}},36844:(v,C,f)=>{var g=f(31982),b=f(33538),x=f(32438),k=b("species");v.exports=function(O){return x>=51||!g(function(){var E=[],N=E.constructor={};return N[k]=function(){return{foo:1}},E[O](Boolean).foo!==1})}},10454:(v,C,f)=>{"use strict";var g=f(31982);v.exports=function(b,x){var k=[][b];return!!k&&g(function(){k.call(null,x||function(){return 1},1)})}},67932:(v,C,f)=>{var g=f(13249),b=f(53387),x=f(53437),k=Array,O=Math.max;v.exports=function(E,N,I){for(var B=b(E),z=g(N,B),Y=g(I===void 0?B:I,B),_=k(O(Y-z,0)),X=0;z<Y;z++,X++)x(_,X,E[z]);return _.length=X,_}},53160:(v,C,f)=>{var g=f(90406);v.exports=g([].slice)},76562:(v,C,f)=>{var g=f(93053),b=f(43455),x=f(92548),k=f(33538),O=k("species"),E=Array;v.exports=function(N){var I;return g(N)&&(I=N.constructor,b(I)&&(I===E||g(I.prototype))?I=void 0:x(I)&&(I=I[O],I===null&&(I=void 0))),I===void 0?E:I}},69573:(v,C,f)=>{var g=f(76562);v.exports=function(b,x){return new(g(b))(x===0?0:x)}},58310:(v,C,f)=>{var g=f(90406),b=g({}.toString),x=g("".slice);v.exports=function(k){return x(b(k),8,-1)}},82059:(v,C,f)=>{var g=f(48448),b=f(43152),x=f(58310),k=f(33538),O=k("toStringTag"),E=Object,N=x(function(){return arguments}())=="Arguments",I=function(B,z){try{return B[z]}catch{}};v.exports=g?x:function(B){var z,Y,_;return B===void 0?"Undefined":B===null?"Null":typeof(Y=I(z=E(B),O))=="string"?Y:N?x(z):(_=x(z))=="Object"&&b(z.callee)?"Arguments":_}},74838:(v,C,f)=>{var g=f(31982);v.exports=!g(function(){function b(){}return b.prototype.constructor=null,Object.getPrototypeOf(new b)!==b.prototype})},10248:v=>{v.exports=function(C,f){return{value:C,done:f}}},20410:(v,C,f)=>{var g=f(56049),b=f(36133),x=f(54686);v.exports=g?function(k,O,E){return b.f(k,O,x(1,E))}:function(k,O,E){return k[O]=E,k}},54686:v=>{v.exports=function(C,f){return{enumerable:!(C&1),configurable:!(C&2),writable:!(C&4),value:f}}},53437:(v,C,f)=>{"use strict";var g=f(5135),b=f(36133),x=f(54686);v.exports=function(k,O,E){var N=g(O);N in k?b.f(k,N,x(0,E)):k[N]=E}},37912:(v,C,f)=>{var g=f(36133);v.exports=function(b,x,k){return g.f(b,x,k)}},27519:(v,C,f)=>{var g=f(20410);v.exports=function(b,x,k,O){return O&&O.enumerable?b[x]=k:g(b,x,k),b}},9267:(v,C,f)=>{var g=f(62447),b=Object.defineProperty;v.exports=function(x,k){try{b(g,x,{value:k,configurable:!0,writable:!0})}catch{g[x]=k}return k}},56049:(v,C,f)=>{var g=f(31982);v.exports=!g(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},51647:v=>{var C=typeof document=="object"&&document.all,f=typeof C>"u"&&C!==void 0;v.exports={all:C,IS_HTMLDDA:f}},45511:(v,C,f)=>{var g=f(62447),b=f(92548),x=g.document,k=b(x)&&b(x.createElement);v.exports=function(O){return k?x.createElement(O):{}}},11452:v=>{var C=TypeError,f=9007199254740991;v.exports=function(g){if(g>f)throw C("Maximum allowed index exceeded");return g}},81595:v=>{v.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},90740:v=>{v.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},32438:(v,C,f)=>{var g=f(62447),b=f(90740),x=g.process,k=g.Deno,O=x&&x.versions||k&&k.version,E=O&&O.v8,N,I;E&&(N=E.split("."),I=N[0]>0&&N[0]<4?1:+(N[0]+N[1])),!I&&b&&(N=b.match(/Edge\/(\d+)/),(!N||N[1]>=74)&&(N=b.match(/Chrome\/(\d+)/),N&&(I=+N[1]))),v.exports=I},70291:(v,C,f)=>{var g=f(59921);v.exports=function(b){return g[b+"Prototype"]}},11792:v=>{v.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},30080:(v,C,f)=>{"use strict";var g=f(62447),b=f(82768),x=f(57953),k=f(43152),O=f(80016).f,E=f(51585),N=f(59921),I=f(7416),B=f(20410),z=f(18768),Y=function(_){var X=function(G,te,se){if(this instanceof X){switch(arguments.length){case 0:return new _;case 1:return new _(G);case 2:return new _(G,te)}return new _(G,te,se)}return b(_,this,arguments)};return X.prototype=_.prototype,X};v.exports=function(_,X){var G=_.target,te=_.global,se=_.stat,R=_.proto,ee=te?g:se?g[G]:(g[G]||{}).prototype,U=te?N:N[G]||B(N,G,{})[G],re=U.prototype,ne,ae,ce,V,K,le,pe,ge,me;for(V in X)ne=E(te?V:G+(se?".":"#")+V,_.forced),ae=!ne&&ee&&z(ee,V),le=U[V],ae&&(_.dontCallGetSet?(me=O(ee,V),pe=me&&me.value):pe=ee[V]),K=ae&&pe?pe:X[V],!(ae&&typeof le==typeof K)&&(_.bind&&ae?ge=I(K,g):_.wrap&&ae?ge=Y(K):R&&k(K)?ge=x(K):ge=K,(_.sham||K&&K.sham||le&&le.sham)&&B(ge,"sham",!0),B(U,V,ge),R&&(ce=G+"Prototype",z(N,ce)||B(N,ce,{}),B(N[ce],V,K),_.real&&re&&(ne||!re[V])&&B(re,V,K)))}},31982:v=>{v.exports=function(C){try{return!!C()}catch{return!0}}},82768:(v,C,f)=>{var g=f(97966),b=Function.prototype,x=b.apply,k=b.call;v.exports=typeof Reflect=="object"&&Reflect.apply||(g?k.bind(x):function(){return k.apply(x,arguments)})},7416:(v,C,f)=>{var g=f(57953),b=f(81970),x=f(97966),k=g(g.bind);v.exports=function(O,E){return b(O),E===void 0?O:x?k(O,E):function(){return O.apply(E,arguments)}}},97966:(v,C,f)=>{var g=f(31982);v.exports=!g(function(){var b=function(){}.bind();return typeof b!="function"||b.hasOwnProperty("prototype")})},12461:(v,C,f)=>{var g=f(97966),b=Function.prototype.call;v.exports=g?b.bind(b):function(){return b.apply(b,arguments)}},58100:(v,C,f)=>{var g=f(56049),b=f(18768),x=Function.prototype,k=g&&Object.getOwnPropertyDescriptor,O=b(x,"name"),E=O&&function(){}.name==="something",N=O&&(!g||g&&k(x,"name").configurable);v.exports={EXISTS:O,PROPER:E,CONFIGURABLE:N}},54518:(v,C,f)=>{var g=f(90406),b=f(81970);v.exports=function(x,k,O){try{return g(b(Object.getOwnPropertyDescriptor(x,k)[O]))}catch{}}},57953:(v,C,f)=>{var g=f(58310),b=f(90406);v.exports=function(x){if(g(x)==="Function")return b(x)}},90406:(v,C,f)=>{var g=f(97966),b=Function.prototype,x=b.call,k=g&&b.bind.bind(x,x);v.exports=g?k:function(O){return function(){return x.apply(O,arguments)}}},97080:(v,C,f)=>{var g=f(59921),b=f(62447),x=f(43152),k=function(O){return x(O)?O:void 0};v.exports=function(O,E){return arguments.length<2?k(g[O])||k(b[O]):g[O]&&g[O][E]||b[O]&&b[O][E]}},82850:(v,C,f)=>{var g=f(90406),b=f(93053),x=f(43152),k=f(58310),O=f(46025),E=g([].push);v.exports=function(N){if(x(N))return N;if(b(N)){for(var I=N.length,B=[],z=0;z<I;z++){var Y=N[z];typeof Y=="string"?E(B,Y):(typeof Y=="number"||k(Y)=="Number"||k(Y)=="String")&&E(B,O(Y))}var _=B.length,X=!0;return function(G,te){if(X)return X=!1,te;if(b(this))return te;for(var se=0;se<_;se++)if(B[se]===G)return te}}}},27529:(v,C,f)=>{var g=f(81970),b=f(71365);v.exports=function(x,k){var O=x[k];return b(O)?void 0:g(O)}},62447:(v,C,f)=>{var g=function(b){return b&&b.Math==Math&&b};v.exports=g(typeof globalThis=="object"&&globalThis)||g(typeof window=="object"&&window)||g(typeof self=="object"&&self)||g(typeof f.g=="object"&&f.g)||function(){return this}()||Function("return this")()},18768:(v,C,f)=>{var g=f(90406),b=f(53254),x=g({}.hasOwnProperty);v.exports=Object.hasOwn||function(O,E){return x(b(O),E)}},13477:v=>{v.exports={}},19552:(v,C,f)=>{var g=f(97080);v.exports=g("document","documentElement")},11314:(v,C,f)=>{var g=f(56049),b=f(31982),x=f(45511);v.exports=!g&&!b(function(){return Object.defineProperty(x("div"),"a",{get:function(){return 7}}).a!=7})},38622:(v,C,f)=>{var g=f(90406),b=f(31982),x=f(58310),k=Object,O=g("".split);v.exports=b(function(){return!k("z").propertyIsEnumerable(0)})?function(E){return x(E)=="String"?O(E,""):k(E)}:k},41524:(v,C,f)=>{var g=f(90406),b=f(43152),x=f(70716),k=g(Function.toString);b(x.inspectSource)||(x.inspectSource=function(O){return k(O)}),v.exports=x.inspectSource},44083:(v,C,f)=>{var g=f(57761),b=f(62447),x=f(92548),k=f(20410),O=f(18768),E=f(70716),N=f(4580),I=f(13477),B="Object already initialized",z=b.TypeError,Y=b.WeakMap,_,X,G,te=function(U){return G(U)?X(U):_(U,{})},se=function(U){return function(re){var ne;if(!x(re)||(ne=X(re)).type!==U)throw z("Incompatible receiver, "+U+" required");return ne}};if(g||E.state){var R=E.state||(E.state=new Y);R.get=R.get,R.has=R.has,R.set=R.set,_=function(U,re){if(R.has(U))throw z(B);return re.facade=U,R.set(U,re),re},X=function(U){return R.get(U)||{}},G=function(U){return R.has(U)}}else{var ee=N("state");I[ee]=!0,_=function(U,re){if(O(U,ee))throw z(B);return re.facade=U,k(U,ee,re),re},X=function(U){return O(U,ee)?U[ee]:{}},G=function(U){return O(U,ee)}}v.exports={set:_,get:X,has:G,enforce:te,getterFor:se}},93053:(v,C,f)=>{var g=f(58310);v.exports=Array.isArray||function(x){return g(x)=="Array"}},43152:(v,C,f)=>{var g=f(51647),b=g.all;v.exports=g.IS_HTMLDDA?function(x){return typeof x=="function"||x===b}:function(x){return typeof x=="function"}},43455:(v,C,f)=>{var g=f(90406),b=f(31982),x=f(43152),k=f(82059),O=f(97080),E=f(41524),N=function(){},I=[],B=O("Reflect","construct"),z=/^\s*(?:class|function)\b/,Y=g(z.exec),_=!z.exec(N),X=function(se){if(!x(se))return!1;try{return B(N,I,se),!0}catch{return!1}},G=function(se){if(!x(se))return!1;switch(k(se)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _||!!Y(z,E(se))}catch{return!0}};G.sham=!0,v.exports=!B||b(function(){var te;return X(X.call)||!X(Object)||!X(function(){te=!0})||te})?G:X},51585:(v,C,f)=>{var g=f(31982),b=f(43152),x=/#|\.prototype\./,k=function(B,z){var Y=E[O(B)];return Y==I?!0:Y==N?!1:b(z)?g(z):!!z},O=k.normalize=function(B){return String(B).replace(x,".").toLowerCase()},E=k.data={},N=k.NATIVE="N",I=k.POLYFILL="P";v.exports=k},71365:v=>{v.exports=function(C){return C==null}},92548:(v,C,f)=>{var g=f(43152),b=f(51647),x=b.all;v.exports=b.IS_HTMLDDA?function(k){return typeof k=="object"?k!==null:g(k)||k===x}:function(k){return typeof k=="object"?k!==null:g(k)}},39839:v=>{v.exports=!0},28609:(v,C,f)=>{var g=f(97080),b=f(43152),x=f(15166),k=f(27237),O=Object;v.exports=k?function(E){return typeof E=="symbol"}:function(E){var N=g("Symbol");return b(N)&&x(N.prototype,O(E))}},41709:(v,C,f)=>{"use strict";var g=f(98488).IteratorPrototype,b=f(73270),x=f(54686),k=f(98889),O=f(94609),E=function(){return this};v.exports=function(N,I,B,z){var Y=I+" Iterator";return N.prototype=b(g,{next:x(+!z,B)}),k(N,Y,!1,!0),O[Y]=E,N}},78107:(v,C,f)=>{"use strict";var g=f(30080),b=f(12461),x=f(39839),k=f(58100),O=f(43152),E=f(41709),N=f(90851),I=f(70738),B=f(98889),z=f(20410),Y=f(27519),_=f(33538),X=f(94609),G=f(98488),te=k.PROPER,se=k.CONFIGURABLE,R=G.IteratorPrototype,ee=G.BUGGY_SAFARI_ITERATORS,U=_("iterator"),re="keys",ne="values",ae="entries",ce=function(){return this};v.exports=function(V,K,le,pe,ge,me,$e){E(le,K,pe);var Ve=function(Ot){if(Ot===ge&&At)return At;if(!ee&&Ot in at)return at[Ot];switch(Ot){case re:return function(){return new le(this,Ot)};case ne:return function(){return new le(this,Ot)};case ae:return function(){return new le(this,Ot)}}return function(){return new le(this)}},Ye=K+" Iterator",Fe=!1,at=V.prototype,Dt=at[U]||at["@@iterator"]||ge&&at[ge],At=!ee&&Dt||Ve(ge),qt=K=="Array"&&at.entries||Dt,Xe,Ct,xt;if(qt&&(Xe=N(qt.call(new V)),Xe!==Object.prototype&&Xe.next&&(!x&&N(Xe)!==R&&(I?I(Xe,R):O(Xe[U])||Y(Xe,U,ce)),B(Xe,Ye,!0,!0),x&&(X[Ye]=ce))),te&&ge==ne&&Dt&&Dt.name!==ne&&(!x&&se?z(at,"name",ne):(Fe=!0,At=function(){return b(Dt,this)})),ge)if(Ct={values:Ve(ne),keys:me?At:Ve(re),entries:Ve(ae)},$e)for(xt in Ct)(ee||Fe||!(xt in at))&&Y(at,xt,Ct[xt]);else g({target:K,proto:!0,forced:ee||Fe},Ct);return(!x||$e)&&at[U]!==At&&Y(at,U,At,{name:ge}),X[K]=At,Ct}},98488:(v,C,f)=>{"use strict";var g=f(31982),b=f(43152),x=f(92548),k=f(73270),O=f(90851),E=f(27519),N=f(33538),I=f(39839),B=N("iterator"),z=!1,Y,_,X;[].keys&&(X=[].keys(),"next"in X?(_=O(O(X)),_!==Object.prototype&&(Y=_)):z=!0);var G=!x(Y)||g(function(){var te={};return Y[B].call(te)!==te});G?Y={}:I&&(Y=k(Y)),b(Y[B])||E(Y,B,function(){return this}),v.exports={IteratorPrototype:Y,BUGGY_SAFARI_ITERATORS:z}},94609:v=>{v.exports={}},53387:(v,C,f)=>{var g=f(62567);v.exports=function(b){return g(b.length)}},99295:v=>{var C=Math.ceil,f=Math.floor;v.exports=Math.trunc||function(b){var x=+b;return(x>0?f:C)(x)}},73270:(v,C,f)=>{var g=f(35970),b=f(98911),x=f(11792),k=f(13477),O=f(19552),E=f(45511),N=f(4580),I=">",B="<",z="prototype",Y="script",_=N("IE_PROTO"),X=function(){},G=function(U){return B+Y+I+U+B+"/"+Y+I},te=function(U){U.write(G("")),U.close();var re=U.parentWindow.Object;return U=null,re},se=function(){var U=E("iframe"),re="java"+Y+":",ne;return U.style.display="none",O.appendChild(U),U.src=String(re),ne=U.contentWindow.document,ne.open(),ne.write(G("document.F=Object")),ne.close(),ne.F},R,ee=function(){try{R=new ActiveXObject("htmlfile")}catch{}ee=typeof document<"u"?document.domain&&R?te(R):se():te(R);for(var U=x.length;U--;)delete ee[z][x[U]];return ee()};k[_]=!0,v.exports=Object.create||function(re,ne){var ae;return re!==null?(X[z]=g(re),ae=new X,X[z]=null,ae[_]=re):ae=ee(),ne===void 0?ae:b.f(ae,ne)}},98911:(v,C,f)=>{var g=f(56049),b=f(98715),x=f(36133),k=f(35970),O=f(88966),E=f(16619);C.f=g&&!b?Object.defineProperties:function(I,B){k(I);for(var z=O(B),Y=E(B),_=Y.length,X=0,G;_>X;)x.f(I,G=Y[X++],z[G]);return I}},36133:(v,C,f)=>{var g=f(56049),b=f(11314),x=f(98715),k=f(35970),O=f(5135),E=TypeError,N=Object.defineProperty,I=Object.getOwnPropertyDescriptor,B="enumerable",z="configurable",Y="writable";C.f=g?x?function(X,G,te){if(k(X),G=O(G),k(te),typeof X=="function"&&G==="prototype"&&"value"in te&&Y in te&&!te[Y]){var se=I(X,G);se&&se[Y]&&(X[G]=te.value,te={configurable:z in te?te[z]:se[z],enumerable:B in te?te[B]:se[B],writable:!1})}return N(X,G,te)}:N:function(X,G,te){if(k(X),G=O(G),k(te),b)try{return N(X,G,te)}catch{}if("get"in te||"set"in te)throw E("Accessors not supported");return"value"in te&&(X[G]=te.value),X}},80016:(v,C,f)=>{var g=f(56049),b=f(12461),x=f(16457),k=f(54686),O=f(88966),E=f(5135),N=f(18768),I=f(11314),B=Object.getOwnPropertyDescriptor;C.f=g?B:function(Y,_){if(Y=O(Y),_=E(_),I)try{return B(Y,_)}catch{}if(N(Y,_))return k(!b(x.f,Y,_),Y[_])}},53515:(v,C,f)=>{var g=f(58310),b=f(88966),x=f(51203).f,k=f(67932),O=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],E=function(N){try{return x(N)}catch{return k(O)}};v.exports.f=function(I){return O&&g(I)=="Window"?E(I):x(b(I))}},51203:(v,C,f)=>{var g=f(4541),b=f(11792),x=b.concat("length","prototype");C.f=Object.getOwnPropertyNames||function(O){return g(O,x)}},97620:(v,C)=>{C.f=Object.getOwnPropertySymbols},90851:(v,C,f)=>{var g=f(18768),b=f(43152),x=f(53254),k=f(4580),O=f(74838),E=k("IE_PROTO"),N=Object,I=N.prototype;v.exports=O?N.getPrototypeOf:function(B){var z=x(B);if(g(z,E))return z[E];var Y=z.constructor;return b(Y)&&z instanceof Y?Y.prototype:z instanceof N?I:null}},15166:(v,C,f)=>{var g=f(90406);v.exports=g({}.isPrototypeOf)},4541:(v,C,f)=>{var g=f(90406),b=f(18768),x=f(88966),k=f(66322).indexOf,O=f(13477),E=g([].push);v.exports=function(N,I){var B=x(N),z=0,Y=[],_;for(_ in B)!b(O,_)&&b(B,_)&&E(Y,_);for(;I.length>z;)b(B,_=I[z++])&&(~k(Y,_)||E(Y,_));return Y}},16619:(v,C,f)=>{var g=f(4541),b=f(11792);v.exports=Object.keys||function(k){return g(k,b)}},16457:(v,C)=>{"use strict";var f={}.propertyIsEnumerable,g=Object.getOwnPropertyDescriptor,b=g&&!f.call({1:2},1);C.f=b?function(k){var O=g(this,k);return!!O&&O.enumerable}:f},70738:(v,C,f)=>{var g=f(54518),b=f(35970),x=f(72185);v.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var k=!1,O={},E;try{E=g(Object.prototype,"__proto__","set"),E(O,[]),k=O instanceof Array}catch{}return function(I,B){return b(I),x(B),k?E(I,B):I.__proto__=B,I}}():void 0)},68399:(v,C,f)=>{"use strict";var g=f(48448),b=f(82059);v.exports=g?{}.toString:function(){return"[object "+b(this)+"]"}},96380:(v,C,f)=>{var g=f(12461),b=f(43152),x=f(92548),k=TypeError;v.exports=function(O,E){var N,I;if(E==="string"&&b(N=O.toString)&&!x(I=g(N,O))||b(N=O.valueOf)&&!x(I=g(N,O))||E!=="string"&&b(N=O.toString)&&!x(I=g(N,O)))return I;throw k("Can't convert object to primitive value")}},47813:(v,C,f)=>{var g=f(97080),b=f(90406),x=f(51203),k=f(97620),O=f(35970),E=b([].concat);v.exports=g("Reflect","ownKeys")||function(I){var B=x.f(O(I)),z=k.f;return z?E(B,z(I)):B}},59921:v=>{v.exports={}},31251:(v,C,f)=>{var g=f(71365),b=TypeError;v.exports=function(x){if(g(x))throw b("Can't call method on "+x);return x}},98889:(v,C,f)=>{var g=f(48448),b=f(36133).f,x=f(20410),k=f(18768),O=f(68399),E=f(33538),N=E("toStringTag");v.exports=function(I,B,z,Y){if(I){var _=z?I:I.prototype;k(_,N)||b(_,N,{configurable:!0,value:B}),Y&&!g&&x(_,"toString",O)}}},4580:(v,C,f)=>{var g=f(95976),b=f(91248),x=g("keys");v.exports=function(k){return x[k]||(x[k]=b(k))}},70716:(v,C,f)=>{var g=f(62447),b=f(9267),x="__core-js_shared__",k=g[x]||b(x,{});v.exports=k},95976:(v,C,f)=>{var g=f(39839),b=f(70716);(v.exports=function(x,k){return b[x]||(b[x]=k!==void 0?k:{})})("versions",[]).push({version:"3.29.1",mode:g?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE",source:"https://github.com/zloirock/core-js"})},18143:(v,C,f)=>{var g=f(90406),b=f(32041),x=f(46025),k=f(31251),O=g("".charAt),E=g("".charCodeAt),N=g("".slice),I=function(B){return function(z,Y){var _=x(k(z)),X=b(Y),G=_.length,te,se;return X<0||X>=G?B?"":void 0:(te=E(_,X),te<55296||te>56319||X+1===G||(se=E(_,X+1))<56320||se>57343?B?O(_,X):te:B?N(_,X,X+2):(te-55296<<10)+(se-56320)+65536)}};v.exports={codeAt:I(!1),charAt:I(!0)}},71775:(v,C,f)=>{var g=f(32438),b=f(31982);v.exports=!!Object.getOwnPropertySymbols&&!b(function(){var x=Symbol();return!String(x)||!(Object(x)instanceof Symbol)||!Symbol.sham&&g&&g<41})},95679:(v,C,f)=>{var g=f(12461),b=f(97080),x=f(33538),k=f(27519);v.exports=function(){var O=b("Symbol"),E=O&&O.prototype,N=E&&E.valueOf,I=x("toPrimitive");E&&!E[I]&&k(E,I,function(B){return g(N,this)},{arity:1})}},82294:(v,C,f)=>{var g=f(71775);v.exports=g&&!!Symbol.for&&!!Symbol.keyFor},13249:(v,C,f)=>{var g=f(32041),b=Math.max,x=Math.min;v.exports=function(k,O){var E=g(k);return E<0?b(E+O,0):x(E,O)}},88966:(v,C,f)=>{var g=f(38622),b=f(31251);v.exports=function(x){return g(b(x))}},32041:(v,C,f)=>{var g=f(99295);v.exports=function(b){var x=+b;return x!==x||x===0?0:g(x)}},62567:(v,C,f)=>{var g=f(32041),b=Math.min;v.exports=function(x){return x>0?b(g(x),9007199254740991):0}},53254:(v,C,f)=>{var g=f(31251),b=Object;v.exports=function(x){return b(g(x))}},37505:(v,C,f)=>{var g=f(12461),b=f(92548),x=f(28609),k=f(27529),O=f(96380),E=f(33538),N=TypeError,I=E("toPrimitive");v.exports=function(B,z){if(!b(B)||x(B))return B;var Y=k(B,I),_;if(Y){if(z===void 0&&(z="default"),_=g(Y,B,z),!b(_)||x(_))return _;throw N("Can't convert object to primitive value")}return z===void 0&&(z="number"),O(B,z)}},5135:(v,C,f)=>{var g=f(37505),b=f(28609);v.exports=function(x){var k=g(x,"string");return b(k)?k:k+""}},48448:(v,C,f)=>{var g=f(33538),b=g("toStringTag"),x={};x[b]="z",v.exports=String(x)==="[object z]"},46025:(v,C,f)=>{var g=f(82059),b=String;v.exports=function(x){if(g(x)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return b(x)}},18342:v=>{var C=String;v.exports=function(f){try{return C(f)}catch{return"Object"}}},91248:(v,C,f)=>{var g=f(90406),b=0,x=Math.random(),k=g(1 .toString);v.exports=function(O){return"Symbol("+(O===void 0?"":O)+")_"+k(++b+x,36)}},27237:(v,C,f)=>{var g=f(71775);v.exports=g&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},98715:(v,C,f)=>{var g=f(56049),b=f(31982);v.exports=g&&b(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})},57761:(v,C,f)=>{var g=f(62447),b=f(43152),x=g.WeakMap;v.exports=b(x)&&/native code/.test(String(x))},64832:(v,C,f)=>{var g=f(59921),b=f(18768),x=f(39378),k=f(36133).f;v.exports=function(O){var E=g.Symbol||(g.Symbol={});b(E,O)||k(E,O,{value:x.f(O)})}},39378:(v,C,f)=>{var g=f(33538);C.f=g},33538:(v,C,f)=>{var g=f(62447),b=f(95976),x=f(18768),k=f(91248),O=f(71775),E=f(27237),N=g.Symbol,I=b("wks"),B=E?N.for||N:N&&N.withoutSetter||k;v.exports=function(z){return x(I,z)||(I[z]=O&&x(N,z)?N[z]:B("Symbol."+z)),I[z]}},69825:(v,C,f)=>{"use strict";var g=f(30080),b=f(31982),x=f(93053),k=f(92548),O=f(53254),E=f(53387),N=f(11452),I=f(53437),B=f(69573),z=f(36844),Y=f(33538),_=f(32438),X=Y("isConcatSpreadable"),G=_>=51||!b(function(){var R=[];return R[X]=!1,R.concat()[0]!==R}),te=function(R){if(!k(R))return!1;var ee=R[X];return ee!==void 0?!!ee:x(R)},se=!G||!z("concat");g({target:"Array",proto:!0,arity:1,forced:se},{concat:function(ee){var U=O(this),re=B(U,0),ne=0,ae,ce,V,K,le;for(ae=-1,V=arguments.length;ae<V;ae++)if(le=ae===-1?U:arguments[ae],te(le))for(K=E(le),N(ne+K),ce=0;ce<K;ce++,ne++)ce in le&&I(re,ne,le[ce]);else N(ne+1),I(re,ne++,le);return re.length=ne,re}})},17802:(v,C,f)=>{"use strict";var g=f(30080),b=f(93935).filter,x=f(36844),k=x("filter");g({target:"Array",proto:!0,forced:!k},{filter:function(E){return b(this,E,arguments.length>1?arguments[1]:void 0)}})},64009:(v,C,f)=>{"use strict";var g=f(30080),b=f(24782);g({target:"Array",proto:!0,forced:[].forEach!=b},{forEach:b})},32449:(v,C,f)=>{"use strict";var g=f(30080),b=f(57953),x=f(66322).indexOf,k=f(10454),O=b([].indexOf),E=!!O&&1/O([1],1,-0)<0,N=E||!k("indexOf");g({target:"Array",proto:!0,forced:N},{indexOf:function(B){var z=arguments.length>1?arguments[1]:void 0;return E?O(this,B,z)||0:x(this,B,z)}})},44390:(v,C,f)=>{"use strict";var g=f(88966),b=f(20844),x=f(94609),k=f(44083),O=f(36133).f,E=f(78107),N=f(10248),I=f(39839),B=f(56049),z="Array Iterator",Y=k.set,_=k.getterFor(z);v.exports=E(Array,"Array",function(G,te){Y(this,{type:z,target:g(G),index:0,kind:te})},function(){var G=_(this),te=G.target,se=G.kind,R=G.index++;return!te||R>=te.length?(G.target=void 0,N(void 0,!0)):se=="keys"?N(R,!1):se=="values"?N(te[R],!1):N([R,te[R]],!1)},"values");var X=x.Arguments=x.Array;if(b("keys"),b("values"),b("entries"),!I&&B&&X.name!=="values")try{O(X,"name",{value:"values"})}catch{}},91667:()=>{},9754:(v,C,f)=>{var g=f(30080),b=f(97080),x=f(82768),k=f(12461),O=f(90406),E=f(31982),N=f(43152),I=f(28609),B=f(53160),z=f(82850),Y=f(71775),_=String,X=b("JSON","stringify"),G=O(/./.exec),te=O("".charAt),se=O("".charCodeAt),R=O("".replace),ee=O(1 .toString),U=/[\uD800-\uDFFF]/g,re=/^[\uD800-\uDBFF]$/,ne=/^[\uDC00-\uDFFF]$/,ae=!Y||E(function(){var le=b("Symbol")();return X([le])!="[null]"||X({a:le})!="{}"||X(Object(le))!="{}"}),ce=E(function(){return X("\uDF06\uD834")!=='"\\udf06\\ud834"'||X("\uDEAD")!=='"\\udead"'}),V=function(le,pe){var ge=B(arguments),me=z(pe);if(!(!N(me)&&(le===void 0||I(le))))return ge[1]=function($e,Ve){if(N(me)&&(Ve=k(me,this,_($e),Ve)),!I(Ve))return Ve},x(X,null,ge)},K=function(le,pe,ge){var me=te(ge,pe-1),$e=te(ge,pe+1);return G(re,le)&&!G(ne,$e)||G(ne,le)&&!G(re,me)?"\\u"+ee(se(le,0),16):le};X&&g({target:"JSON",stat:!0,arity:3,forced:ae||ce},{stringify:function(pe,ge,me){var $e=B(arguments),Ve=x(ae?V:X,null,$e);return ce&&typeof Ve=="string"?R(Ve,U,K):Ve}})},23870:(v,C,f)=>{var g=f(62447),b=f(98889);b(g.JSON,"JSON",!0)},5828:()=>{},28135:(v,C,f)=>{var g=f(30080),b=f(56049),x=f(98911).f;g({target:"Object",stat:!0,forced:Object.defineProperties!==x,sham:!b},{defineProperties:x})},70829:(v,C,f)=>{var g=f(30080),b=f(56049),x=f(36133).f;g({target:"Object",stat:!0,forced:Object.defineProperty!==x,sham:!b},{defineProperty:x})},51964:(v,C,f)=>{var g=f(30080),b=f(31982),x=f(88966),k=f(80016).f,O=f(56049),E=!O||b(function(){k(1)});g({target:"Object",stat:!0,forced:E,sham:!O},{getOwnPropertyDescriptor:function(I,B){return k(x(I),B)}})},723:(v,C,f)=>{var g=f(30080),b=f(56049),x=f(47813),k=f(88966),O=f(80016),E=f(53437);g({target:"Object",stat:!0,sham:!b},{getOwnPropertyDescriptors:function(I){for(var B=k(I),z=O.f,Y=x(B),_={},X=0,G,te;Y.length>X;)te=z(B,G=Y[X++]),te!==void 0&&E(_,G,te);return _}})},86884:(v,C,f)=>{var g=f(30080),b=f(71775),x=f(31982),k=f(97620),O=f(53254),E=!b||x(function(){k.f(1)});g({target:"Object",stat:!0,forced:E},{getOwnPropertySymbols:function(I){var B=k.f;return B?B(O(I)):[]}})},38339:(v,C,f)=>{var g=f(30080),b=f(53254),x=f(16619),k=f(31982),O=k(function(){x(1)});g({target:"Object",stat:!0,forced:O},{keys:function(N){return x(b(N))}})},97829:()=>{},5708:()=>{},27626:(v,C,f)=>{"use strict";var g=f(18143).charAt,b=f(46025),x=f(44083),k=f(78107),O=f(10248),E="String Iterator",N=x.set,I=x.getterFor(E);k(String,"String",function(B){N(this,{type:E,string:b(B),index:0})},function(){var z=I(this),Y=z.string,_=z.index,X;return _>=Y.length?O(void 0,!0):(X=g(Y,_),z.index+=X.length,O(X,!1))})},95353:(v,C,f)=>{var g=f(64832);g("asyncIterator")},16212:(v,C,f)=>{"use strict";var g=f(30080),b=f(62447),x=f(12461),k=f(90406),O=f(39839),E=f(56049),N=f(71775),I=f(31982),B=f(18768),z=f(15166),Y=f(35970),_=f(88966),X=f(5135),G=f(46025),te=f(54686),se=f(73270),R=f(16619),ee=f(51203),U=f(53515),re=f(97620),ne=f(80016),ae=f(36133),ce=f(98911),V=f(16457),K=f(27519),le=f(37912),pe=f(95976),ge=f(4580),me=f(13477),$e=f(91248),Ve=f(33538),Ye=f(39378),Fe=f(64832),at=f(95679),Dt=f(98889),At=f(44083),qt=f(93935).forEach,Xe=ge("hidden"),Ct="Symbol",xt="prototype",Ot=At.set,fr=At.getterFor(Ct),Ne=Object[xt],wt=b.Symbol,$t=wt&&wt[xt],ht=b.TypeError,Tr=b.QObject,hr=ne.f,Vr=ae.f,Ri=U.f,Pr=V.f,dr=k([].push),pr=pe("symbols"),Kr=pe("op-symbols"),dt=pe("wks"),In=!Tr||!Tr[xt]||!Tr[xt].findChild,ui=E&&I(function(){return se(Vr({},"a",{get:function(){return Vr(this,"a",{value:7}).a}})).a!=7})?function(Ze,Ce,Le){var Pe=hr(Ne,Ce);Pe&&delete Ne[Ce],Vr(Ze,Ce,Le),Pe&&Ze!==Ne&&Vr(Ne,Ce,Pe)}:Vr,bn=function(Ze,Ce){var Le=pr[Ze]=se($t);return Ot(Le,{type:Ct,tag:Ze,description:Ce}),E||(Le.description=Ce),Le},xn=function(Ce,Le,Pe){Ce===Ne&&xn(Kr,Le,Pe),Y(Ce);var $=X(Le);return Y(Pe),B(pr,$)?(Pe.enumerable?(B(Ce,Xe)&&Ce[Xe][$]&&(Ce[Xe][$]=!1),Pe=se(Pe,{enumerable:te(0,!1)})):(B(Ce,Xe)||Vr(Ce,Xe,te(1,{})),Ce[Xe][$]=!0),ui(Ce,$,Pe)):Vr(Ce,$,Pe)},Dn=function(Ce,Le){Y(Ce);var Pe=_(Le),$=R(Pe).concat(hi(Pe));return qt($,function(Z){(!E||x(Nn,Pe,Z))&&xn(Ce,Z,Pe[Z])}),Ce},fi=function(Ce,Le){return Le===void 0?se(Ce):Dn(se(Ce),Le)},Nn=function(Ce){var Le=X(Ce),Pe=x(Pr,this,Le);return this===Ne&&B(pr,Le)&&!B(Kr,Le)?!1:Pe||!B(this,Le)||!B(pr,Le)||B(this,Xe)&&this[Xe][Le]?Pe:!0},Wr=function(Ce,Le){var Pe=_(Ce),$=X(Le);if(!(Pe===Ne&&B(pr,$)&&!B(Kr,$))){var Z=hr(Pe,$);return Z&&B(pr,$)&&!(B(Pe,Xe)&&Pe[Xe][$])&&(Z.enumerable=!0),Z}},Rn=function(Ce){var Le=Ri(_(Ce)),Pe=[];return qt(Le,function($){!B(pr,$)&&!B(me,$)&&dr(Pe,$)}),Pe},hi=function(Ze){var Ce=Ze===Ne,Le=Ri(Ce?Kr:_(Ze)),Pe=[];return qt(Le,function($){B(pr,$)&&(!Ce||B(Ne,$))&&dr(Pe,pr[$])}),Pe};N||(wt=function(){if(z($t,this))throw ht("Symbol is not a constructor");var Ce=!arguments.length||arguments[0]===void 0?void 0:G(arguments[0]),Le=$e(Ce),Pe=function($){this===Ne&&x(Pe,Kr,$),B(this,Xe)&&B(this[Xe],Le)&&(this[Xe][Le]=!1),ui(this,Le,te(1,$))};return E&&In&&ui(Ne,Le,{configurable:!0,set:Pe}),bn(Le,Ce)},$t=wt[xt],K($t,"toString",function(){return fr(this).tag}),K(wt,"withoutSetter",function(Ze){return bn($e(Ze),Ze)}),V.f=Nn,ae.f=xn,ce.f=Dn,ne.f=Wr,ee.f=U.f=Rn,re.f=hi,Ye.f=function(Ze){return bn(Ve(Ze),Ze)},E&&(le($t,"description",{configurable:!0,get:function(){return fr(this).description}}),O||K(Ne,"propertyIsEnumerable",Nn,{unsafe:!0}))),g({global:!0,constructor:!0,wrap:!0,forced:!N,sham:!N},{Symbol:wt}),qt(R(dt),function(Ze){Fe(Ze)}),g({target:Ct,stat:!0,forced:!N},{useSetter:function(){In=!0},useSimple:function(){In=!1}}),g({target:"Object",stat:!0,forced:!N,sham:!E},{create:fi,defineProperty:xn,defineProperties:Dn,getOwnPropertyDescriptor:Wr}),g({target:"Object",stat:!0,forced:!N},{getOwnPropertyNames:Rn}),at(),Dt(wt,Ct),me[Xe]=!0},63906:()=>{},3598:(v,C,f)=>{var g=f(30080),b=f(97080),x=f(18768),k=f(46025),O=f(95976),E=f(82294),N=O("string-to-symbol-registry"),I=O("symbol-to-string-registry");g({target:"Symbol",stat:!0,forced:!E},{for:function(B){var z=k(B);if(x(N,z))return N[z];var Y=b("Symbol")(z);return N[z]=Y,I[Y]=z,Y}})},39542:(v,C,f)=>{var g=f(64832);g("hasInstance")},47882:(v,C,f)=>{var g=f(64832);g("isConcatSpreadable")},84911:(v,C,f)=>{var g=f(64832);g("iterator")},68030:(v,C,f)=>{f(16212),f(3598),f(50338),f(9754),f(86884)},50338:(v,C,f)=>{var g=f(30080),b=f(18768),x=f(28609),k=f(18342),O=f(95976),E=f(82294),N=O("symbol-to-string-registry");g({target:"Symbol",stat:!0,forced:!E},{keyFor:function(B){if(!x(B))throw TypeError(k(B)+" is not a symbol");if(b(N,B))return N[B]}})},47954:(v,C,f)=>{var g=f(64832);g("matchAll")},88725:(v,C,f)=>{var g=f(64832);g("match")},67703:(v,C,f)=>{var g=f(64832);g("replace")},2220:(v,C,f)=>{var g=f(64832);g("search")},48990:(v,C,f)=>{var g=f(64832);g("species")},50240:(v,C,f)=>{var g=f(64832);g("split")},99921:(v,C,f)=>{var g=f(64832),b=f(95679);g("toPrimitive"),b()},3502:(v,C,f)=>{var g=f(97080),b=f(64832),x=f(98889);b("toStringTag"),x(g("Symbol"),"Symbol")},80220:(v,C,f)=>{var g=f(64832);g("unscopables")},45987:(v,C,f)=>{var g=f(64832);g("asyncDispose")},42319:(v,C,f)=>{var g=f(64832);g("dispose")},58052:(v,C,f)=>{var g=f(30080),b=f(97080),x=f(90406),k=b("Symbol"),O=k.keyFor,E=x(k.prototype.valueOf);g({target:"Symbol",stat:!0},{isRegistered:function(I){try{return O(E(I))!==void 0}catch{return!1}}})},90181:(v,C,f)=>{for(var g=f(30080),b=f(95976),x=f(97080),k=f(90406),O=f(28609),E=f(33538),N=x("Symbol"),I=N.isWellKnown,B=x("Object","getOwnPropertyNames"),z=k(N.prototype.valueOf),Y=b("wks"),_=0,X=B(N),G=X.length;_<G;_++)try{var te=X[_];O(N[te])&&E(te)}catch{}g({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(R){if(I&&I(R))return!0;try{for(var ee=z(R),U=0,re=B(Y),ne=re.length;U<ne;U++)if(Y[re[U]]==ee)return!0}catch{}return!1}})},25129:(v,C,f)=>{var g=f(64832);g("matcher")},90397:(v,C,f)=>{var g=f(64832);g("metadataKey")},82793:(v,C,f)=>{var g=f(64832);g("metadata")},18097:(v,C,f)=>{var g=f(64832);g("observable")},52100:(v,C,f)=>{var g=f(64832);g("patternMatch")},99742:(v,C,f)=>{var g=f(64832);g("replaceAll")},48713:(v,C,f)=>{f(44390);var g=f(81595),b=f(62447),x=f(82059),k=f(20410),O=f(94609),E=f(33538),N=E("toStringTag");for(var I in g){var B=b[I],z=B&&B.prototype;z&&x(z)!==N&&k(z,N,I),O[I]=O.Array}},41544:(v,C,f)=>{var g=f(94537);v.exports=g},44928:(v,C,f)=>{var g=f(55794);v.exports=g},26087:(v,C,f)=>{f(48713);var g=f(82059),b=f(18768),x=f(15166),k=f(41544),O=Array.prototype,E={DOMTokenList:!0,NodeList:!0};v.exports=function(N){var I=N.forEach;return N===O||x(O,N)&&I===O.forEach||b(E,g(N))?k:I}},11783:(v,C,f)=>{var g=f(85838);v.exports=g},88462:(v,C,f)=>{var g=f(95617);v.exports=g},83531:(v,C,f)=>{var g=f(11906);v.exports=g},19941:(v,C,f)=>{var g=f(59123);v.exports=g},25081:(v,C,f)=>{var g=f(63332);v.exports=g},22145:(v,C,f)=>{var g=f(83606);v.exports=g},93690:(v,C,f)=>{var g=f(90660);v.exports=g},8429:(v,C,f)=>{var g=f(49198);f(48713),v.exports=g},13099:(v,C,f)=>{var g=f(15413);f(48713),v.exports=g},44931:(v,C,f)=>{var g=f(4793);v.exports=g},81933:function(){(function(v){var C=function(f){var g={searchParams:"URLSearchParams"in v,iterable:"Symbol"in v&&"iterator"in Symbol,blob:"FileReader"in v&&"Blob"in v&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in v,arrayBuffer:"ArrayBuffer"in v};function b(V){return V&&DataView.prototype.isPrototypeOf(V)}if(g.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],k=ArrayBuffer.isView||function(V){return V&&x.indexOf(Object.prototype.toString.call(V))>-1};function O(V){if(typeof V!="string"&&(V=String(V)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(V))throw new TypeError("Invalid character in header field name");return V.toLowerCase()}function E(V){return typeof V!="string"&&(V=String(V)),V}function N(V){var K={next:function(){var le=V.shift();return{done:le===void 0,value:le}}};return g.iterable&&(K[Symbol.iterator]=function(){return K}),K}function I(V){this.map={},V instanceof I?V.forEach(function(K,le){this.append(le,K)},this):Array.isArray(V)?V.forEach(function(K){this.append(K[0],K[1])},this):V&&Object.getOwnPropertyNames(V).forEach(function(K){this.append(K,V[K])},this)}I.prototype.append=function(V,K){V=O(V),K=E(K);var le=this.map[V];this.map[V]=le?le+", "+K:K},I.prototype.delete=function(V){delete this.map[O(V)]},I.prototype.get=function(V){return V=O(V),this.has(V)?this.map[V]:null},I.prototype.has=function(V){return this.map.hasOwnProperty(O(V))},I.prototype.set=function(V,K){this.map[O(V)]=E(K)},I.prototype.forEach=function(V,K){for(var le in this.map)this.map.hasOwnProperty(le)&&V.call(K,this.map[le],le,this)},I.prototype.keys=function(){var V=[];return this.forEach(function(K,le){V.push(le)}),N(V)},I.prototype.values=function(){var V=[];return this.forEach(function(K){V.push(K)}),N(V)},I.prototype.entries=function(){var V=[];return this.forEach(function(K,le){V.push([le,K])}),N(V)},g.iterable&&(I.prototype[Symbol.iterator]=I.prototype.entries);function B(V){if(V.bodyUsed)return Promise.reject(new TypeError("Already read"));V.bodyUsed=!0}function z(V){return new Promise(function(K,le){V.onload=function(){K(V.result)},V.onerror=function(){le(V.error)}})}function Y(V){var K=new FileReader,le=z(K);return K.readAsArrayBuffer(V),le}function _(V){var K=new FileReader,le=z(K);return K.readAsText(V),le}function X(V){for(var K=new Uint8Array(V),le=new Array(K.length),pe=0;pe<K.length;pe++)le[pe]=String.fromCharCode(K[pe]);return le.join("")}function G(V){if(V.slice)return V.slice(0);var K=new Uint8Array(V.byteLength);return K.set(new Uint8Array(V)),K.buffer}function te(){return this.bodyUsed=!1,this._initBody=function(V){this._bodyInit=V,V?typeof V=="string"?this._bodyText=V:g.blob&&Blob.prototype.isPrototypeOf(V)?this._bodyBlob=V:g.formData&&FormData.prototype.isPrototypeOf(V)?this._bodyFormData=V:g.searchParams&&URLSearchParams.prototype.isPrototypeOf(V)?this._bodyText=V.toString():g.arrayBuffer&&g.blob&&b(V)?(this._bodyArrayBuffer=G(V.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):g.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(V)||k(V))?this._bodyArrayBuffer=G(V):this._bodyText=V=Object.prototype.toString.call(V):this._bodyText="",this.headers.get("content-type")||(typeof V=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):g.searchParams&&URLSearchParams.prototype.isPrototypeOf(V)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},g.blob&&(this.blob=function(){var V=B(this);if(V)return V;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?B(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Y)}),this.text=function(){var V=B(this);if(V)return V;if(this._bodyBlob)return _(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(X(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},g.formData&&(this.formData=function(){return this.text().then(U)}),this.json=function(){return this.text().then(JSON.parse)},this}var se=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function R(V){var K=V.toUpperCase();return se.indexOf(K)>-1?K:V}function ee(V,K){K=K||{};var le=K.body;if(V instanceof ee){if(V.bodyUsed)throw new TypeError("Already read");this.url=V.url,this.credentials=V.credentials,K.headers||(this.headers=new I(V.headers)),this.method=V.method,this.mode=V.mode,this.signal=V.signal,!le&&V._bodyInit!=null&&(le=V._bodyInit,V.bodyUsed=!0)}else this.url=String(V);if(this.credentials=K.credentials||this.credentials||"same-origin",(K.headers||!this.headers)&&(this.headers=new I(K.headers)),this.method=R(K.method||this.method||"GET"),this.mode=K.mode||this.mode||null,this.signal=K.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&le)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(le)}ee.prototype.clone=function(){return new ee(this,{body:this._bodyInit})};function U(V){var K=new FormData;return V.trim().split("&").forEach(function(le){if(le){var pe=le.split("="),ge=pe.shift().replace(/\+/g," "),me=pe.join("=").replace(/\+/g," ");K.append(decodeURIComponent(ge),decodeURIComponent(me))}}),K}function re(V){var K=new I,le=V.replace(/\r?\n[\t ]+/g," ");return le.split(/\r?\n/).forEach(function(pe){var ge=pe.split(":"),me=ge.shift().trim();if(me){var $e=ge.join(":").trim();K.append(me,$e)}}),K}te.call(ee.prototype);function ne(V,K){K||(K={}),this.type="default",this.status=K.status===void 0?200:K.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in K?K.statusText:"OK",this.headers=new I(K.headers),this.url=K.url||"",this._initBody(V)}te.call(ne.prototype),ne.prototype.clone=function(){return new ne(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new I(this.headers),url:this.url})},ne.error=function(){var V=new ne(null,{status:0,statusText:""});return V.type="error",V};var ae=[301,302,303,307,308];ne.redirect=function(V,K){if(ae.indexOf(K)===-1)throw new RangeError("Invalid status code");return new ne(null,{status:K,headers:{location:V}})},f.DOMException=v.DOMException;try{new f.DOMException}catch{f.DOMException=function(K,le){this.message=K,this.name=le;var pe=Error(K);this.stack=pe.stack},f.DOMException.prototype=Object.create(Error.prototype),f.DOMException.prototype.constructor=f.DOMException}function ce(V,K){return new Promise(function(le,pe){var ge=new ee(V,K);if(ge.signal&&ge.signal.aborted)return pe(new f.DOMException("Aborted","AbortError"));var me=new XMLHttpRequest;function $e(){me.abort()}me.onload=function(){var Ve={status:me.status,statusText:me.statusText,headers:re(me.getAllResponseHeaders()||"")};Ve.url="responseURL"in me?me.responseURL:Ve.headers.get("X-Request-URL");var Ye="response"in me?me.response:me.responseText;le(new ne(Ye,Ve))},me.onerror=function(){pe(new TypeError("Network request failed"))},me.ontimeout=function(){pe(new TypeError("Network request failed"))},me.onabort=function(){pe(new f.DOMException("Aborted","AbortError"))},me.open(ge.method,ge.url,!0),ge.credentials==="include"?me.withCredentials=!0:ge.credentials==="omit"&&(me.withCredentials=!1),"responseType"in me&&g.blob&&(me.responseType="blob"),ge.headers.forEach(function(Ve,Ye){me.setRequestHeader(Ye,Ve)}),ge.signal&&(ge.signal.addEventListener("abort",$e),me.onreadystatechange=function(){me.readyState===4&&ge.signal.removeEventListener("abort",$e)}),me.send(typeof ge._bodyInit>"u"?null:ge._bodyInit)})}return ce.polyfill=!0,v.fetch||(v.fetch=ce,v.Headers=I,v.Request=ee,v.Response=ne),f.Headers=I,f.Request=ee,f.Response=ne,f.fetch=ce,Object.defineProperty(f,"__esModule",{value:!0}),f}({})})(typeof self<"u"?self:this)},16068:(v,C,f)=>{"use strict";f.r(C),f.d(C,{Console:()=>WI});var g={};f.r(g),f.d(g,{cookie:()=>Fx,header:()=>Bx,path:()=>Nx,query:()=>Rx});var b=f(10954),x=f(70762),k=f(93652),O=f(11099),E=f(10017),N=f(86351),I=f(86751),B=f(12953),z=f(55839),Y=f(23422);function _(r){return _=typeof z=="function"&&typeof Y=="symbol"?function(e){return typeof e}:function(e){return e&&typeof z=="function"&&e.constructor===z&&e!==z.prototype?"symbol":typeof e},_(r)}var X=f(47319);function G(r,e){if(_(r)!=="object"||r===null)return r;var t=r[X];if(t!==void 0){var n=t.call(r,e||"default");if(_(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function te(r){var e=G(r,"string");return _(e)==="symbol"?e:String(e)}function se(r,e,t){return e=te(e),e in r?B(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function R(r,e){var t=b(r);if(x){var n=x(r);e&&(n=k(n).call(n,function(i){return O(r,i).enumerable})),t.push.apply(t,n)}return t}function ee(r){for(var e=1;e<arguments.length;e++){var t,n,i=arguments[e]!=null?arguments[e]:{};e%2?E(t=R(Object(i),!0)).call(t,function(s){se(r,s,i[s])}):N?I(r,N(i)):E(n=R(Object(i))).call(n,function(s){B(r,s,O(i,s))})}return r}var U=f(34961);function re(r,e){if(r==null)return{};var t={},n=b(r),i,s;for(s=0;s<n.length;s++)i=n[s],!(U(e).call(e,i)>=0)&&(t[i]=r[i]);return t}function ne(r,e){if(r==null)return{};var t=re(r,e),n,i;if(x){var s=x(r);for(i=0;i<s.length;i++)n=s[i],!(U(e).call(e,n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}var ae=f(13546),ce=f.n(ae),V=f(51121),K=f(26179);/*!
46
12
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
47
13
  *
48
14
  * Copyright (c) 2014-2017, Jon Schlinkert.
49
15
  * Released under the MIT License.
50
- */function ce(t){return Object.prototype.toString.call(t)==="[object Object]"}function ge(t){var n,i;return ce(t)===!1?!1:(n=t.constructor,n===void 0?!0:(i=n.prototype,!(ce(i)===!1||i.hasOwnProperty("isPrototypeOf")===!1)))}var G=f(81933),ve=f(67905),ee=f.n(ve);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function He(t){return typeof t>"u"||t===null}function _e(t){return typeof t=="object"&&t!==null}function ze(t){return Array.isArray(t)?t:He(t)?[]:[t]}function dt(t,n){var i,s,u,c;if(n)for(c=Object.keys(n),i=0,s=c.length;i<s;i+=1)u=c[i],t[u]=n[u];return t}function ft(t,n){var i="",s;for(s=0;s<n;s+=1)i+=t;return i}function at(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var Gt=He,ht=_e,Ot=ze,nt=ft,Ue=at,Fe=dt,Re={isNothing:Gt,isObject:ht,toArray:Ot,repeat:nt,isNegativeZero:Ue,extend:Fe};function it(t,n){var i="",s=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(i+='in "'+t.mark.name+'" '),i+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!n&&t.mark.snippet&&(i+=`
16
+ */function le(r){return Object.prototype.toString.call(r)==="[object Object]"}function pe(r){var e,t;return le(r)===!1?!1:(e=r.constructor,e===void 0?!0:(t=e.prototype,!(le(t)===!1||t.hasOwnProperty("isPrototypeOf")===!1)))}var ge=f(81933),me=f(67905),$e=f.n(me);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ve(r){return typeof r>"u"||r===null}function Ye(r){return typeof r=="object"&&r!==null}function Fe(r){return Array.isArray(r)?r:Ve(r)?[]:[r]}function at(r,e){var t,n,i,s;if(e)for(s=Object.keys(e),t=0,n=s.length;t<n;t+=1)i=s[t],r[i]=e[i];return r}function Dt(r,e){var t="",n;for(n=0;n<e;n+=1)t+=r;return t}function At(r){return r===0&&Number.NEGATIVE_INFINITY===1/r}var qt=Ve,Xe=Ye,Ct=Fe,xt=Dt,Ot=At,fr=at,Ne={isNothing:qt,isObject:Xe,toArray:Ct,repeat:xt,isNegativeZero:Ot,extend:fr};function wt(r,e){var t="",n=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(t+='in "'+r.mark.name+'" '),t+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!e&&r.mark.snippet&&(t+=`
51
17
 
52
- `+t.mark.snippet),s+" "+i):s}function Dt(t,n){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=n,this.message=it(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Dt.prototype=Object.create(Error.prototype),Dt.prototype.constructor=Dt,Dt.prototype.toString=function(n){return this.name+": "+it(this,n)};var qe=Dt;function St(t,n,i,s,u){var c="",h="",m=Math.floor(u/2)-1;return s-n>m&&(c=" ... ",n=s-m+c.length),i-s>m&&(h=" ...",i=s+m-h.length),{str:c+t.slice(n,i).replace(/\t/g,"\u2192")+h,pos:s-n+c.length}}function Kt(t,n){return Re.repeat(" ",n-t.length)+t}function Jt(t,n){if(n=Object.create(n||null),!t.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i=/\r?\n|\r|\0/g,s=[0],u=[],c,h=-1;c=i.exec(t.buffer);)u.push(c.index),s.push(c.index+c[0].length),t.position<=c.index&&h<0&&(h=s.length-2);h<0&&(h=s.length-1);var m="",p,y,T=Math.min(t.line+n.linesAfter,u.length).toString().length,L=n.maxLength-(n.indent+T+3);for(p=1;p<=n.linesBefore&&!(h-p<0);p++)y=St(t.buffer,s[h-p],u[h-p],t.position-(s[h]-s[h-p]),L),m=Re.repeat(" ",n.indent)+Kt((t.line-p+1).toString(),T)+" | "+y.str+`
53
- `+m;for(y=St(t.buffer,s[h],u[h],t.position,L),m+=Re.repeat(" ",n.indent)+Kt((t.line+1).toString(),T)+" | "+y.str+`
54
- `,m+=Re.repeat("-",n.indent+T+3+y.pos)+`^
55
- `,p=1;p<=n.linesAfter&&!(h+p>=u.length);p++)y=St(t.buffer,s[h+p],u[h+p],t.position-(s[h]-s[h+p]),L),m+=Re.repeat(" ",n.indent)+Kt((t.line+p+1).toString(),T)+" | "+y.str+`
56
- `;return m.replace(/\n$/,"")}var pr=Jt,Je=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],xt=["scalar","sequence","mapping"];function Lt(t){var n={};return t!==null&&Object.keys(t).forEach(function(i){t[i].forEach(function(s){n[String(s)]=i})}),n}function Or(t,n){if(n=n||{},Object.keys(n).forEach(function(i){if(Je.indexOf(i)===-1)throw new qe('Unknown option "'+i+'" is met in definition of "'+t+'" YAML type.')}),this.options=n,this.tag=t,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Lt(n.styleAliases||null),xt.indexOf(this.kind)===-1)throw new qe('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var Ft=Or;function hn(t,n){var i=[];return t[n].forEach(function(s){var u=i.length;i.forEach(function(c,h){c.tag===s.tag&&c.kind===s.kind&&c.multi===s.multi&&(u=h)}),i[u]=s}),i}function pn(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function s(u){u.multi?(t.multi[u.kind].push(u),t.multi.fallback.push(u)):t[u.kind][u.tag]=t.fallback[u.tag]=u}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(s);return t}function Hr(t){return this.extend(t)}Hr.prototype.extend=function(n){var i=[],s=[];if(n instanceof Ft)s.push(n);else if(Array.isArray(n))s=s.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(s=s.concat(n.explicit));else throw new qe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(c){if(!(c instanceof Ft))throw new qe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(c.loadKind&&c.loadKind!=="scalar")throw new qe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(c.multi)throw new qe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),s.forEach(function(c){if(!(c instanceof Ft))throw new qe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var u=Object.create(Hr.prototype);return u.implicit=(this.implicit||[]).concat(i),u.explicit=(this.explicit||[]).concat(s),u.compiledImplicit=hn(u,"implicit"),u.compiledExplicit=hn(u,"explicit"),u.compiledTypeMap=pn(u.compiledImplicit,u.compiledExplicit),u};var en=Hr,kn=new Ft("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),vn=new Ft("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Ur=new Ft("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),gr=new en({explicit:[kn,vn,Ur]});function Er(t){if(t===null)return!0;var n=t.length;return n===1&&t==="~"||n===4&&(t==="null"||t==="Null"||t==="NULL")}function Rt(){return null}function mt(t){return t===null}var st=new Ft("tag:yaml.org,2002:null",{kind:"scalar",resolve:Er,construct:Rt,predicate:mt,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Qe(t){if(t===null)return!1;var n=t.length;return n===4&&(t==="true"||t==="True"||t==="TRUE")||n===5&&(t==="false"||t==="False"||t==="FALSE")}function pt(t){return t==="true"||t==="True"||t==="TRUE"}function ne(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var be=new Ft("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Qe,construct:pt,predicate:ne,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function je(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function tt(t){return 48<=t&&t<=55}function ct(t){return 48<=t&&t<=57}function lt(t){if(t===null)return!1;var n=t.length,i=0,s=!1,u;if(!n)return!1;if(u=t[i],(u==="-"||u==="+")&&(u=t[++i]),u==="0"){if(i+1===n)return!0;if(u=t[++i],u==="b"){for(i++;i<n;i++)if(u=t[i],u!=="_"){if(u!=="0"&&u!=="1")return!1;s=!0}return s&&u!=="_"}if(u==="x"){for(i++;i<n;i++)if(u=t[i],u!=="_"){if(!je(t.charCodeAt(i)))return!1;s=!0}return s&&u!=="_"}if(u==="o"){for(i++;i<n;i++)if(u=t[i],u!=="_"){if(!tt(t.charCodeAt(i)))return!1;s=!0}return s&&u!=="_"}}if(u==="_")return!1;for(;i<n;i++)if(u=t[i],u!=="_"){if(!ct(t.charCodeAt(i)))return!1;s=!0}return!(!s||u==="_")}function _t(t){var n=t,i=1,s;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),s=n[0],(s==="-"||s==="+")&&(s==="-"&&(i=-1),n=n.slice(1),s=n[0]),n==="0")return 0;if(s==="0"){if(n[1]==="b")return i*parseInt(n.slice(2),2);if(n[1]==="x")return i*parseInt(n.slice(2),16);if(n[1]==="o")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function Tr(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!Re.isNegativeZero(t)}var wt=new Ft("tag:yaml.org,2002:int",{kind:"scalar",resolve:lt,construct:_t,predicate:Tr,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),er=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Wn(t){return!(t===null||!er.test(t)||t[t.length-1]==="_")}function mr(t){var n,i;return n=t.replace(/_/g,"").toLowerCase(),i=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)}var yr=/^[-+]?[0-9]+e/;function Hn(t,n){var i;if(isNaN(t))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Re.isNegativeZero(t))return"-0.0";return i=t.toString(10),yr.test(i)?i.replace("e",".e"):i}function kr(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Re.isNegativeZero(t))}var Pn=new Ft("tag:yaml.org,2002:float",{kind:"scalar",resolve:Wn,construct:mr,predicate:kr,represent:Hn,defaultStyle:"lowercase"}),Ln=gr.extend({implicit:[st,be,wt,Pn]}),br=Ln,Un=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),gn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function ni(t){return t===null?!1:Un.exec(t)!==null||gn.exec(t)!==null}function Ui(t){var n,i,s,u,c,h,m,p=0,y=null,T,L,q;if(n=Un.exec(t),n===null&&(n=gn.exec(t)),n===null)throw new Error("Date resolve error");if(i=+n[1],s=+n[2]-1,u=+n[3],!n[4])return new Date(Date.UTC(i,s,u));if(c=+n[4],h=+n[5],m=+n[6],n[7]){for(p=n[7].slice(0,3);p.length<3;)p+="0";p=+p}return n[9]&&(T=+n[10],L=+(n[11]||0),y=(T*60+L)*6e4,n[9]==="-"&&(y=-y)),q=new Date(Date.UTC(i,s,u,c,h,m,p)),y&&q.setTime(q.getTime()-y),q}function Yr(t){return t.toISOString()}var Ir=new Ft("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ni,construct:Ui,instanceOf:Date,represent:Yr});function Xr(t){return t==="<<"||t===null}var zr=new Ft("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Xr}),_r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
57
- \r`;function Oo(t){if(t===null)return!1;var n,i,s=0,u=t.length,c=_r;for(i=0;i<u;i++)if(n=c.indexOf(t.charAt(i)),!(n>64)){if(n<0)return!1;s+=6}return s%8===0}function mn(t){var n,i,s=t.replace(/[\r\n=]/g,""),u=s.length,c=_r,h=0,m=[];for(n=0;n<u;n++)n%4===0&&n&&(m.push(h>>16&255),m.push(h>>8&255),m.push(h&255)),h=h<<6|c.indexOf(s.charAt(n));return i=u%4*6,i===0?(m.push(h>>16&255),m.push(h>>8&255),m.push(h&255)):i===18?(m.push(h>>10&255),m.push(h>>2&255)):i===12&&m.push(h>>4&255),new Uint8Array(m)}function Mr(t){var n="",i=0,s,u,c=t.length,h=_r;for(s=0;s<c;s++)s%3===0&&s&&(n+=h[i>>18&63],n+=h[i>>12&63],n+=h[i>>6&63],n+=h[i&63]),i=(i<<8)+t[s];return u=c%3,u===0?(n+=h[i>>18&63],n+=h[i>>12&63],n+=h[i>>6&63],n+=h[i&63]):u===2?(n+=h[i>>10&63],n+=h[i>>4&63],n+=h[i<<2&63],n+=h[64]):u===1&&(n+=h[i>>2&63],n+=h[i<<4&63],n+=h[64],n+=h[64]),n}function tr(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var In=new Ft("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Oo,construct:mn,predicate:tr,represent:Mr}),tn=Object.prototype.hasOwnProperty,zi=Object.prototype.toString;function ia(t){if(t===null)return!0;var n=[],i,s,u,c,h,m=t;for(i=0,s=m.length;i<s;i+=1){if(u=m[i],h=!1,zi.call(u)!=="[object Object]")return!1;for(c in u)if(tn.call(u,c))if(!h)h=!0;else return!1;if(!h)return!1;if(n.indexOf(c)===-1)n.push(c);else return!1}return!0}function Ht(t){return t!==null?t:[]}var Ve=new Ft("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ia,construct:Ht}),zn=Object.prototype.toString;function mi(t){if(t===null)return!0;var n,i,s,u,c,h=t;for(c=new Array(h.length),n=0,i=h.length;n<i;n+=1){if(s=h[n],zn.call(s)!=="[object Object]"||(u=Object.keys(s),u.length!==1))return!1;c[n]=[u[0],s[u[0]]]}return!0}function rn(t){if(t===null)return[];var n,i,s,u,c,h=t;for(c=new Array(h.length),n=0,i=h.length;n<i;n+=1)s=h[n],u=Object.keys(s),c[n]=[u[0],s[u[0]]];return c}var Ct=new Ft("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:mi,construct:rn}),_n=Object.prototype.hasOwnProperty;function yi(t){if(t===null)return!0;var n,i=t;for(n in i)if(_n.call(i,n)&&i[n]!==null)return!1;return!0}function _i(t){return t!==null?t:{}}var A=new Ft("tag:yaml.org,2002:set",{kind:"mapping",resolve:yi,construct:_i}),z=br.extend({implicit:[Ir,zr],explicit:[In,Ve,Ct,A]}),Se=Object.prototype.hasOwnProperty,Pe=1,rt=2,yt=3,At=4,$e=1,nn=2,Eo=3,oa=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Mn=/[\x85\u2028\u2029]/,el=/[,\[\]\{\}]/,Qa=/^(?:!|!!|![a-z\-]+!)$/i,Vi=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function aa(t){return Object.prototype.toString.call(t)}function yn(t){return t===10||t===13}function Vn(t){return t===9||t===32}function Nr(t){return t===9||t===32||t===10||t===13}function bi(t){return t===44||t===91||t===93||t===123||t===125}function tl(t){var n;return 48<=t&&t<=57?t-48:(n=t|32,97<=n&&n<=102?n-97+10:-1)}function rl(t){return t===120?2:t===117?4:t===85?8:0}function Yu(t){return 48<=t&&t<=57?t-48:-1}function nl(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
58
- `:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function il(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}for(var Nn=new Array(256),ol=new Array(256),$i=0;$i<256;$i++)Nn[$i]=nl($i)?1:0,ol[$i]=nl($i);function sa(t,n){this.input=t,this.filename=n.filename||null,this.schema=n.schema||z,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Gi(t,n){var i={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return i.snippet=pr(i),new qe(n,i)}function Xe(t,n){throw Gi(t,n)}function la(t,n){t.onWarning&&t.onWarning.call(null,Gi(t,n))}var al={YAML:function(n,i,s){var u,c,h;n.version!==null&&Xe(n,"duplication of %YAML directive"),s.length!==1&&Xe(n,"YAML directive accepts exactly one argument"),u=/^([0-9]+)\.([0-9]+)$/.exec(s[0]),u===null&&Xe(n,"ill-formed argument of the YAML directive"),c=parseInt(u[1],10),h=parseInt(u[2],10),c!==1&&Xe(n,"unacceptable YAML version of the document"),n.version=s[0],n.checkLineBreaks=h<2,h!==1&&h!==2&&la(n,"unsupported YAML version of the document")},TAG:function(n,i,s){var u,c;s.length!==2&&Xe(n,"TAG directive accepts exactly two arguments"),u=s[0],c=s[1],Qa.test(u)||Xe(n,"ill-formed tag handle (first argument) of the TAG directive"),Se.call(n.tagMap,u)&&Xe(n,'there is a previously declared suffix for "'+u+'" tag handle'),Vi.test(c)||Xe(n,"ill-formed tag prefix (second argument) of the TAG directive");try{c=decodeURIComponent(c)}catch{Xe(n,"tag prefix is malformed: "+c)}n.tagMap[u]=c}};function ii(t,n,i,s){var u,c,h,m;if(n<i){if(m=t.input.slice(n,i),s)for(u=0,c=m.length;u<c;u+=1)h=m.charCodeAt(u),h===9||32<=h&&h<=1114111||Xe(t,"expected valid JSON character");else oa.test(m)&&Xe(t,"the stream contains non-printable characters");t.result+=m}}function ua(t,n,i,s){var u,c,h,m;for(Re.isObject(i)||Xe(t,"cannot merge mappings; the provided source object is unacceptable"),u=Object.keys(i),h=0,m=u.length;h<m;h+=1)c=u[h],Se.call(n,c)||(n[c]=i[c],s[c]=!0)}function xi(t,n,i,s,u,c,h,m,p){var y,T;if(Array.isArray(u))for(u=Array.prototype.slice.call(u),y=0,T=u.length;y<T;y+=1)Array.isArray(u[y])&&Xe(t,"nested arrays are not supported inside keys"),typeof u=="object"&&aa(u[y])==="[object Object]"&&(u[y]="[object Object]");if(typeof u=="object"&&aa(u)==="[object Object]"&&(u="[object Object]"),u=String(u),n===null&&(n={}),s==="tag:yaml.org,2002:merge")if(Array.isArray(c))for(y=0,T=c.length;y<T;y+=1)ua(t,n,c[y],i);else ua(t,n,c,i);else!t.json&&!Se.call(i,u)&&Se.call(n,u)&&(t.line=h||t.line,t.lineStart=m||t.lineStart,t.position=p||t.position,Xe(t,"duplicated mapping key")),u==="__proto__"?Object.defineProperty(n,u,{configurable:!0,enumerable:!0,writable:!0,value:c}):n[u]=c,delete i[u];return n}function Za(t){var n;n=t.input.charCodeAt(t.position),n===10?t.position++:n===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):Xe(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function rr(t,n,i){for(var s=0,u=t.input.charCodeAt(t.position);u!==0;){for(;Vn(u);)u===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),u=t.input.charCodeAt(++t.position);if(n&&u===35)do u=t.input.charCodeAt(++t.position);while(u!==10&&u!==13&&u!==0);if(yn(u))for(Za(t),u=t.input.charCodeAt(t.position),s++,t.lineIndent=0;u===32;)t.lineIndent++,u=t.input.charCodeAt(++t.position);else break}return i!==-1&&s!==0&&t.lineIndent<i&&la(t,"deficient indentation"),s}function To(t){var n=t.position,i;return i=t.input.charCodeAt(n),!!((i===45||i===46)&&i===t.input.charCodeAt(n+1)&&i===t.input.charCodeAt(n+2)&&(n+=3,i=t.input.charCodeAt(n),i===0||Nr(i)))}function Ki(t,n){n===1?t.result+=" ":n>1&&(t.result+=Re.repeat(`
59
- `,n-1))}function fa(t,n,i){var s,u,c,h,m,p,y,T,L=t.kind,q=t.result,W;if(W=t.input.charCodeAt(t.position),Nr(W)||bi(W)||W===35||W===38||W===42||W===33||W===124||W===62||W===39||W===34||W===37||W===64||W===96||(W===63||W===45)&&(u=t.input.charCodeAt(t.position+1),Nr(u)||i&&bi(u)))return!1;for(t.kind="scalar",t.result="",c=h=t.position,m=!1;W!==0;){if(W===58){if(u=t.input.charCodeAt(t.position+1),Nr(u)||i&&bi(u))break}else if(W===35){if(s=t.input.charCodeAt(t.position-1),Nr(s))break}else{if(t.position===t.lineStart&&To(t)||i&&bi(W))break;if(yn(W))if(p=t.line,y=t.lineStart,T=t.lineIndent,rr(t,!1,-1),t.lineIndent>=n){m=!0,W=t.input.charCodeAt(t.position);continue}else{t.position=h,t.line=p,t.lineStart=y,t.lineIndent=T;break}}m&&(ii(t,c,h,!1),Ki(t,t.line-p),c=h=t.position,m=!1),Vn(W)||(h=t.position+1),W=t.input.charCodeAt(++t.position)}return ii(t,c,h,!1),t.result?!0:(t.kind=L,t.result=q,!1)}function qa(t,n){var i,s,u;if(i=t.input.charCodeAt(t.position),i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,s=u=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(ii(t,s,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)s=t.position,t.position++,u=t.position;else return!0;else yn(i)?(ii(t,s,u,!0),Ki(t,rr(t,!1,n)),s=u=t.position):t.position===t.lineStart&&To(t)?Xe(t,"unexpected end of the document within a single quoted scalar"):(t.position++,u=t.position);Xe(t,"unexpected end of the stream within a single quoted scalar")}function sl(t,n){var i,s,u,c,h,m;if(m=t.input.charCodeAt(t.position),m!==34)return!1;for(t.kind="scalar",t.result="",t.position++,i=s=t.position;(m=t.input.charCodeAt(t.position))!==0;){if(m===34)return ii(t,i,t.position,!0),t.position++,!0;if(m===92){if(ii(t,i,t.position,!0),m=t.input.charCodeAt(++t.position),yn(m))rr(t,!1,n);else if(m<256&&Nn[m])t.result+=ol[m],t.position++;else if((h=rl(m))>0){for(u=h,c=0;u>0;u--)m=t.input.charCodeAt(++t.position),(h=tl(m))>=0?c=(c<<4)+h:Xe(t,"expected hexadecimal character");t.result+=il(c),t.position++}else Xe(t,"unknown escape sequence");i=s=t.position}else yn(m)?(ii(t,i,s,!0),Ki(t,rr(t,!1,n)),i=s=t.position):t.position===t.lineStart&&To(t)?Xe(t,"unexpected end of the document within a double quoted scalar"):(t.position++,s=t.position)}Xe(t,"unexpected end of the stream within a double quoted scalar")}function ll(t,n){var i=!0,s,u,c,h=t.tag,m,p=t.anchor,y,T,L,q,W,_=Object.create(null),fe,ae,oe,ue;if(ue=t.input.charCodeAt(t.position),ue===91)T=93,W=!1,m=[];else if(ue===123)T=125,W=!0,m={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=m),ue=t.input.charCodeAt(++t.position);ue!==0;){if(rr(t,!0,n),ue=t.input.charCodeAt(t.position),ue===T)return t.position++,t.tag=h,t.anchor=p,t.kind=W?"mapping":"sequence",t.result=m,!0;i?ue===44&&Xe(t,"expected the node content, but found ','"):Xe(t,"missed comma between flow collection entries"),ae=fe=oe=null,L=q=!1,ue===63&&(y=t.input.charCodeAt(t.position+1),Nr(y)&&(L=q=!0,t.position++,rr(t,!0,n))),s=t.line,u=t.lineStart,c=t.position,oi(t,n,Pe,!1,!0),ae=t.tag,fe=t.result,rr(t,!0,n),ue=t.input.charCodeAt(t.position),(q||t.line===s)&&ue===58&&(L=!0,ue=t.input.charCodeAt(++t.position),rr(t,!0,n),oi(t,n,Pe,!1,!0),oe=t.result),W?xi(t,m,_,ae,fe,oe,s,u,c):L?m.push(xi(t,null,_,ae,fe,oe,s,u,c)):m.push(fe),rr(t,!0,n),ue=t.input.charCodeAt(t.position),ue===44?(i=!0,ue=t.input.charCodeAt(++t.position)):i=!1}Xe(t,"unexpected end of the stream within a flow collection")}function ca(t,n){var i,s,u=$e,c=!1,h=!1,m=n,p=0,y=!1,T,L;if(L=t.input.charCodeAt(t.position),L===124)s=!1;else if(L===62)s=!0;else return!1;for(t.kind="scalar",t.result="";L!==0;)if(L=t.input.charCodeAt(++t.position),L===43||L===45)$e===u?u=L===43?Eo:nn:Xe(t,"repeat of a chomping mode identifier");else if((T=Yu(L))>=0)T===0?Xe(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):h?Xe(t,"repeat of an indentation width identifier"):(m=n+T-1,h=!0);else break;if(Vn(L)){do L=t.input.charCodeAt(++t.position);while(Vn(L));if(L===35)do L=t.input.charCodeAt(++t.position);while(!yn(L)&&L!==0)}for(;L!==0;){for(Za(t),t.lineIndent=0,L=t.input.charCodeAt(t.position);(!h||t.lineIndent<m)&&L===32;)t.lineIndent++,L=t.input.charCodeAt(++t.position);if(!h&&t.lineIndent>m&&(m=t.lineIndent),yn(L)){p++;continue}if(t.lineIndent<m){u===Eo?t.result+=Re.repeat(`
60
- `,c?1+p:p):u===$e&&c&&(t.result+=`
61
- `);break}for(s?Vn(L)?(y=!0,t.result+=Re.repeat(`
62
- `,c?1+p:p)):y?(y=!1,t.result+=Re.repeat(`
63
- `,p+1)):p===0?c&&(t.result+=" "):t.result+=Re.repeat(`
64
- `,p):t.result+=Re.repeat(`
65
- `,c?1+p:p),c=!0,h=!0,p=0,i=t.position;!yn(L)&&L!==0;)L=t.input.charCodeAt(++t.position);ii(t,i,t.position,!1)}return!0}function ul(t,n){var i,s=t.tag,u=t.anchor,c=[],h,m=!1,p;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=c),p=t.input.charCodeAt(t.position);p!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Xe(t,"tab characters must not be used in indentation")),!(p!==45||(h=t.input.charCodeAt(t.position+1),!Nr(h))));){if(m=!0,t.position++,rr(t,!0,-1)&&t.lineIndent<=n){c.push(null),p=t.input.charCodeAt(t.position);continue}if(i=t.line,oi(t,n,yt,!1,!0),c.push(t.result),rr(t,!0,-1),p=t.input.charCodeAt(t.position),(t.line===i||t.lineIndent>n)&&p!==0)Xe(t,"bad indentation of a sequence entry");else if(t.lineIndent<n)break}return m?(t.tag=s,t.anchor=u,t.kind="sequence",t.result=c,!0):!1}function fl(t,n,i){var s,u,c,h,m,p,y=t.tag,T=t.anchor,L={},q=Object.create(null),W=null,_=null,fe=null,ae=!1,oe=!1,ue;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=L),ue=t.input.charCodeAt(t.position);ue!==0;){if(!ae&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Xe(t,"tab characters must not be used in indentation")),s=t.input.charCodeAt(t.position+1),c=t.line,(ue===63||ue===58)&&Nr(s))ue===63?(ae&&(xi(t,L,q,W,_,null,h,m,p),W=_=fe=null),oe=!0,ae=!0,u=!0):ae?(ae=!1,u=!0):Xe(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,ue=s;else{if(h=t.line,m=t.lineStart,p=t.position,!oi(t,i,rt,!1,!0))break;if(t.line===c){for(ue=t.input.charCodeAt(t.position);Vn(ue);)ue=t.input.charCodeAt(++t.position);if(ue===58)ue=t.input.charCodeAt(++t.position),Nr(ue)||Xe(t,"a whitespace character is expected after the key-value separator within a block mapping"),ae&&(xi(t,L,q,W,_,null,h,m,p),W=_=fe=null),oe=!0,ae=!1,u=!1,W=t.tag,_=t.result;else if(oe)Xe(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=y,t.anchor=T,!0}else if(oe)Xe(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=y,t.anchor=T,!0}if((t.line===c||t.lineIndent>n)&&(ae&&(h=t.line,m=t.lineStart,p=t.position),oi(t,n,At,!0,u)&&(ae?_=t.result:fe=t.result),ae||(xi(t,L,q,W,_,fe,h,m,p),W=_=fe=null),rr(t,!0,-1),ue=t.input.charCodeAt(t.position)),(t.line===c||t.lineIndent>n)&&ue!==0)Xe(t,"bad indentation of a mapping entry");else if(t.lineIndent<n)break}return ae&&xi(t,L,q,W,_,null,h,m,p),oe&&(t.tag=y,t.anchor=T,t.kind="mapping",t.result=L),oe}function bn(t){var n,i=!1,s=!1,u,c,h;if(h=t.input.charCodeAt(t.position),h!==33)return!1;if(t.tag!==null&&Xe(t,"duplication of a tag property"),h=t.input.charCodeAt(++t.position),h===60?(i=!0,h=t.input.charCodeAt(++t.position)):h===33?(s=!0,u="!!",h=t.input.charCodeAt(++t.position)):u="!",n=t.position,i){do h=t.input.charCodeAt(++t.position);while(h!==0&&h!==62);t.position<t.length?(c=t.input.slice(n,t.position),h=t.input.charCodeAt(++t.position)):Xe(t,"unexpected end of the stream within a verbatim tag")}else{for(;h!==0&&!Nr(h);)h===33&&(s?Xe(t,"tag suffix cannot contain exclamation marks"):(u=t.input.slice(n-1,t.position+1),Qa.test(u)||Xe(t,"named tag handle cannot contain such characters"),s=!0,n=t.position+1)),h=t.input.charCodeAt(++t.position);c=t.input.slice(n,t.position),el.test(c)&&Xe(t,"tag suffix cannot contain flow indicator characters")}c&&!Vi.test(c)&&Xe(t,"tag name cannot contain such characters: "+c);try{c=decodeURIComponent(c)}catch{Xe(t,"tag name is malformed: "+c)}return i?t.tag=c:Se.call(t.tagMap,u)?t.tag=t.tagMap[u]+c:u==="!"?t.tag="!"+c:u==="!!"?t.tag="tag:yaml.org,2002:"+c:Xe(t,'undeclared tag handle "'+u+'"'),!0}function Xu(t){var n,i;if(i=t.input.charCodeAt(t.position),i!==38)return!1;for(t.anchor!==null&&Xe(t,"duplication of an anchor property"),i=t.input.charCodeAt(++t.position),n=t.position;i!==0&&!Nr(i)&&!bi(i);)i=t.input.charCodeAt(++t.position);return t.position===n&&Xe(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(n,t.position),!0}function Ju(t){var n,i,s;if(s=t.input.charCodeAt(t.position),s!==42)return!1;for(s=t.input.charCodeAt(++t.position),n=t.position;s!==0&&!Nr(s)&&!bi(s);)s=t.input.charCodeAt(++t.position);return t.position===n&&Xe(t,"name of an alias node must contain at least one character"),i=t.input.slice(n,t.position),Se.call(t.anchorMap,i)||Xe(t,'unidentified alias "'+i+'"'),t.result=t.anchorMap[i],rr(t,!0,-1),!0}function oi(t,n,i,s,u){var c,h,m,p=1,y=!1,T=!1,L,q,W,_,fe,ae;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,c=h=m=At===i||yt===i,s&&rr(t,!0,-1)&&(y=!0,t.lineIndent>n?p=1:t.lineIndent===n?p=0:t.lineIndent<n&&(p=-1)),p===1)for(;bn(t)||Xu(t);)rr(t,!0,-1)?(y=!0,m=c,t.lineIndent>n?p=1:t.lineIndent===n?p=0:t.lineIndent<n&&(p=-1)):m=!1;if(m&&(m=y||u),(p===1||At===i)&&(Pe===i||rt===i?fe=n:fe=n+1,ae=t.position-t.lineStart,p===1?m&&(ul(t,ae)||fl(t,ae,fe))||ll(t,fe)?T=!0:(h&&ca(t,fe)||qa(t,fe)||sl(t,fe)?T=!0:Ju(t)?(T=!0,(t.tag!==null||t.anchor!==null)&&Xe(t,"alias node should not have any properties")):fa(t,fe,Pe===i)&&(T=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):p===0&&(T=m&&ul(t,ae))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&Xe(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),L=0,q=t.implicitTypes.length;L<q;L+=1)if(_=t.implicitTypes[L],_.resolve(t.result)){t.result=_.construct(t.result),t.tag=_.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(Se.call(t.typeMap[t.kind||"fallback"],t.tag))_=t.typeMap[t.kind||"fallback"][t.tag];else for(_=null,W=t.typeMap.multi[t.kind||"fallback"],L=0,q=W.length;L<q;L+=1)if(t.tag.slice(0,W[L].tag.length)===W[L].tag){_=W[L];break}_||Xe(t,"unknown tag !<"+t.tag+">"),t.result!==null&&_.kind!==t.kind&&Xe(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+_.kind+'", not "'+t.kind+'"'),_.resolve(t.result,t.tag)?(t.result=_.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Xe(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||T}function cl(t){var n=t.position,i,s,u,c=!1,h;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(h=t.input.charCodeAt(t.position))!==0&&(rr(t,!0,-1),h=t.input.charCodeAt(t.position),!(t.lineIndent>0||h!==37));){for(c=!0,h=t.input.charCodeAt(++t.position),i=t.position;h!==0&&!Nr(h);)h=t.input.charCodeAt(++t.position);for(s=t.input.slice(i,t.position),u=[],s.length<1&&Xe(t,"directive name must not be less than one character in length");h!==0;){for(;Vn(h);)h=t.input.charCodeAt(++t.position);if(h===35){do h=t.input.charCodeAt(++t.position);while(h!==0&&!yn(h));break}if(yn(h))break;for(i=t.position;h!==0&&!Nr(h);)h=t.input.charCodeAt(++t.position);u.push(t.input.slice(i,t.position))}h!==0&&Za(t),Se.call(al,s)?al[s](t,s,u):la(t,'unknown document directive "'+s+'"')}if(rr(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,rr(t,!0,-1)):c&&Xe(t,"directives end mark is expected"),oi(t,t.lineIndent-1,At,!1,!0),rr(t,!0,-1),t.checkLineBreaks&&Mn.test(t.input.slice(n,t.position))&&la(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&To(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,rr(t,!0,-1));return}if(t.position<t.length-1)Xe(t,"end of the stream or a document separator is expected");else return}function $n(t,n){t=String(t),n=n||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
66
- `),t.charCodeAt(0)===65279&&(t=t.slice(1)));var i=new sa(t,n),s=t.indexOf("\0");for(s!==-1&&(i.position=s,Xe(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)cl(i);return i.documents}function es(t,n,i){n!==null&&typeof n=="object"&&typeof i>"u"&&(i=n,n=null);var s=$n(t,i);if(typeof n!="function")return s;for(var u=0,c=s.length;u<c;u+=1)n(s[u])}function Gn(t,n){var i=$n(t,n);if(i.length!==0){if(i.length===1)return i[0];throw new qe("expected a single document in the stream, but found more")}}var da=es,ts=Gn,Si={loadAll:da,load:ts},dl=Object.prototype.toString,hl=Object.prototype.hasOwnProperty,rs=65279,Qu=9,Yi=10,pl=13,Zu=32,qu=33,ef=34,ns=35,vl=37,tf=38,gl=39,ha=42,wi=44,rf=45,pa=58,nf=61,ko=62,sr=63,of=64,is=91,Xi=93,af=96,os=123,sf=124,va=125,xr={};xr[0]="\\0",xr[7]="\\a",xr[8]="\\b",xr[9]="\\t",xr[10]="\\n",xr[11]="\\v",xr[12]="\\f",xr[13]="\\r",xr[27]="\\e",xr[34]='\\"',xr[92]="\\\\",xr[133]="\\N",xr[160]="\\_",xr[8232]="\\L",xr[8233]="\\P";var lf=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],uf=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ml(t,n){var i,s,u,c,h,m,p;if(n===null)return{};for(i={},s=Object.keys(n),u=0,c=s.length;u<c;u+=1)h=s[u],m=String(n[h]),h.slice(0,2)==="!!"&&(h="tag:yaml.org,2002:"+h.slice(2)),p=t.compiledTypeMap.fallback[h],p&&hl.call(p.styleAliases,m)&&(m=p.styleAliases[m]),i[h]=m;return i}function yl(t){var n,i,s;if(n=t.toString(16).toUpperCase(),t<=255)i="x",s=2;else if(t<=65535)i="u",s=4;else if(t<=4294967295)i="U",s=8;else throw new qe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+Re.repeat("0",s-n.length)+n}var ff=1,Kn=2;function Yn(t){this.schema=t.schema||z,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Re.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=ml(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Kn:ff,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Po(t,n){for(var i=Re.repeat(" ",n),s=0,u=-1,c="",h,m=t.length;s<m;)u=t.indexOf(`
67
- `,s),u===-1?(h=t.slice(s),s=m):(h=t.slice(s,u+1),s=u+1),h.length&&h!==`
68
- `&&(c+=i),c+=h;return c}function Lo(t,n){return`
69
- `+Re.repeat(" ",t.indent*n)}function bl(t,n){var i,s,u;for(i=0,s=t.implicitTypes.length;i<s;i+=1)if(u=t.implicitTypes[i],u.resolve(n))return!0;return!1}function Jr(t){return t===Zu||t===Qu}function xn(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==rs||65536<=t&&t<=1114111}function ga(t){return xn(t)&&t!==rs&&t!==pl&&t!==Yi}function xl(t,n,i){var s=ga(t),u=s&&!Jr(t);return(i?s:s&&t!==wi&&t!==is&&t!==Xi&&t!==os&&t!==va)&&t!==ns&&!(n===pa&&!u)||ga(n)&&!Jr(n)&&t===ns||n===pa&&u}function Sl(t){return xn(t)&&t!==rs&&!Jr(t)&&t!==rf&&t!==sr&&t!==pa&&t!==wi&&t!==is&&t!==Xi&&t!==os&&t!==va&&t!==ns&&t!==tf&&t!==ha&&t!==qu&&t!==sf&&t!==nf&&t!==ko&&t!==gl&&t!==ef&&t!==vl&&t!==of&&t!==af}function cf(t){return!Jr(t)&&t!==pa}function Ji(t,n){var i=t.charCodeAt(n),s;return i>=55296&&i<=56319&&n+1<t.length&&(s=t.charCodeAt(n+1),s>=56320&&s<=57343)?(i-55296)*1024+s-56320+65536:i}function ma(t){var n=/^\n* /;return n.test(t)}var Ci=1,on=2,as=3,ss=4,Qi=5;function df(t,n,i,s,u,c,h,m){var p,y=0,T=null,L=!1,q=!1,W=s!==-1,_=-1,fe=Sl(Ji(t,0))&&cf(Ji(t,t.length-1));if(n||h)for(p=0;p<t.length;y>=65536?p+=2:p++){if(y=Ji(t,p),!xn(y))return Qi;fe=fe&&xl(y,T,m),T=y}else{for(p=0;p<t.length;y>=65536?p+=2:p++){if(y=Ji(t,p),y===Yi)L=!0,W&&(q=q||p-_-1>s&&t[_+1]!==" ",_=p);else if(!xn(y))return Qi;fe=fe&&xl(y,T,m),T=y}q=q||W&&p-_-1>s&&t[_+1]!==" "}return!L&&!q?fe&&!h&&!u(t)?Ci:c===Kn?Qi:on:i>9&&ma(t)?Qi:h?c===Kn?Qi:on:q?ss:as}function hf(t,n,i,s,u){t.dump=function(){if(n.length===0)return t.quotingType===Kn?'""':"''";if(!t.noCompatMode&&(lf.indexOf(n)!==-1||uf.test(n)))return t.quotingType===Kn?'"'+n+'"':"'"+n+"'";var c=t.indent*Math.max(1,i),h=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-c),m=s||t.flowLevel>-1&&i>=t.flowLevel;function p(y){return bl(t,y)}switch(df(n,m,t.indent,h,p,t.quotingType,t.forceQuotes&&!s,u)){case Ci:return n;case on:return"'"+n.replace(/'/g,"''")+"'";case as:return"|"+ls(n,t.indent)+us(Po(n,c));case ss:return">"+ls(n,t.indent)+us(Po(Io(n,h),c));case Qi:return'"'+wl(n)+'"';default:throw new qe("impossible error: invalid scalar style")}}()}function ls(t,n){var i=ma(t)?String(n):"",s=t[t.length-1]===`
70
- `,u=s&&(t[t.length-2]===`
71
- `||t===`
72
- `),c=u?"+":s?"":"-";return i+c+`
73
- `}function us(t){return t[t.length-1]===`
74
- `?t.slice(0,-1):t}function Io(t,n){for(var i=/(\n+)([^\n]*)/g,s=function(){var y=t.indexOf(`
75
- `);return y=y!==-1?y:t.length,i.lastIndex=y,fs(t.slice(0,y),n)}(),u=t[0]===`
76
- `||t[0]===" ",c,h;h=i.exec(t);){var m=h[1],p=h[2];c=p[0]===" ",s+=m+(!u&&!c&&p!==""?`
77
- `:"")+fs(p,n),u=c}return s}function fs(t,n){if(t===""||t[0]===" ")return t;for(var i=/ [^ ]/g,s,u=0,c,h=0,m=0,p="";s=i.exec(t);)m=s.index,m-u>n&&(c=h>u?h:m,p+=`
78
- `+t.slice(u,c),u=c+1),h=m;return p+=`
79
- `,t.length-u>n&&h>u?p+=t.slice(u,h)+`
80
- `+t.slice(h+1):p+=t.slice(u),p.slice(1)}function wl(t){for(var n="",i=0,s,u=0;u<t.length;i>=65536?u+=2:u++)i=Ji(t,u),s=xr[i],!s&&xn(i)?(n+=t[u],i>=65536&&(n+=t[u+1])):n+=s||yl(i);return n}function cs(t,n,i){var s="",u=t.tag,c,h,m;for(c=0,h=i.length;c<h;c+=1)m=i[c],t.replacer&&(m=t.replacer.call(i,String(c),m)),(Dn(t,n,m,!1,!1)||typeof m>"u"&&Dn(t,n,null,!1,!1))&&(s!==""&&(s+=","+(t.condenseFlow?"":" ")),s+=t.dump);t.tag=u,t.dump="["+s+"]"}function Mo(t,n,i,s){var u="",c=t.tag,h,m,p;for(h=0,m=i.length;h<m;h+=1)p=i[h],t.replacer&&(p=t.replacer.call(i,String(h),p)),(Dn(t,n+1,p,!0,!0,!1,!0)||typeof p>"u"&&Dn(t,n+1,null,!0,!0,!1,!0))&&((!s||u!=="")&&(u+=Lo(t,n)),t.dump&&Yi===t.dump.charCodeAt(0)?u+="-":u+="- ",u+=t.dump);t.tag=c,t.dump=u||"[]"}function Cl(t,n,i){var s="",u=t.tag,c=Object.keys(i),h,m,p,y,T;for(h=0,m=c.length;h<m;h+=1)T="",s!==""&&(T+=", "),t.condenseFlow&&(T+='"'),p=c[h],y=i[p],t.replacer&&(y=t.replacer.call(i,p,y)),Dn(t,n,p,!1,!1)&&(t.dump.length>1024&&(T+="? "),T+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Dn(t,n,y,!1,!1)&&(T+=t.dump,s+=T));t.tag=u,t.dump="{"+s+"}"}function ya(t,n,i,s){var u="",c=t.tag,h=Object.keys(i),m,p,y,T,L,q;if(t.sortKeys===!0)h.sort();else if(typeof t.sortKeys=="function")h.sort(t.sortKeys);else if(t.sortKeys)throw new qe("sortKeys must be a boolean or a function");for(m=0,p=h.length;m<p;m+=1)q="",(!s||u!=="")&&(q+=Lo(t,n)),y=h[m],T=i[y],t.replacer&&(T=t.replacer.call(i,y,T)),Dn(t,n+1,y,!0,!0,!0)&&(L=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,L&&(t.dump&&Yi===t.dump.charCodeAt(0)?q+="?":q+="? "),q+=t.dump,L&&(q+=Lo(t,n)),Dn(t,n+1,T,!0,L)&&(t.dump&&Yi===t.dump.charCodeAt(0)?q+=":":q+=": ",q+=t.dump,u+=q));t.tag=c,t.dump=u||"{}"}function an(t,n,i){var s,u,c,h,m,p;for(u=i?t.explicitTypes:t.implicitTypes,c=0,h=u.length;c<h;c+=1)if(m=u[c],(m.instanceOf||m.predicate)&&(!m.instanceOf||typeof n=="object"&&n instanceof m.instanceOf)&&(!m.predicate||m.predicate(n))){if(i?m.multi&&m.representName?t.tag=m.representName(n):t.tag=m.tag:t.tag="?",m.represent){if(p=t.styleMap[m.tag]||m.defaultStyle,dl.call(m.represent)==="[object Function]")s=m.represent(n,p);else if(hl.call(m.represent,p))s=m.represent[p](n,p);else throw new qe("!<"+m.tag+'> tag resolver accepts not "'+p+'" style');t.dump=s}return!0}return!1}function Dn(t,n,i,s,u,c,h){t.tag=null,t.dump=i,an(t,i,!1)||an(t,i,!0);var m=dl.call(t.dump),p=s,y;s&&(s=t.flowLevel<0||t.flowLevel>n);var T=m==="[object Object]"||m==="[object Array]",L,q;if(T&&(L=t.duplicates.indexOf(i),q=L!==-1),(t.tag!==null&&t.tag!=="?"||q||t.indent!==2&&n>0)&&(u=!1),q&&t.usedDuplicates[L])t.dump="*ref_"+L;else{if(T&&q&&!t.usedDuplicates[L]&&(t.usedDuplicates[L]=!0),m==="[object Object]")s&&Object.keys(t.dump).length!==0?(ya(t,n,t.dump,u),q&&(t.dump="&ref_"+L+t.dump)):(Cl(t,n,t.dump),q&&(t.dump="&ref_"+L+" "+t.dump));else if(m==="[object Array]")s&&t.dump.length!==0?(t.noArrayIndent&&!h&&n>0?Mo(t,n-1,t.dump,u):Mo(t,n,t.dump,u),q&&(t.dump="&ref_"+L+t.dump)):(cs(t,n,t.dump),q&&(t.dump="&ref_"+L+" "+t.dump));else if(m==="[object String]")t.tag!=="?"&&hf(t,t.dump,n,c,p);else{if(m==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new qe("unacceptable kind of an object to dump "+m)}t.tag!==null&&t.tag!=="?"&&(y=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?y="!"+y:y.slice(0,18)==="tag:yaml.org,2002:"?y="!!"+y.slice(18):y="!<"+y+">",t.dump=y+" "+t.dump)}return!0}function ds(t,n){var i=[],s=[],u,c;for(No(t,i,s),u=0,c=s.length;u<c;u+=1)n.duplicates.push(i[s[u]]);n.usedDuplicates=new Array(c)}function No(t,n,i){var s,u,c;if(t!==null&&typeof t=="object")if(u=n.indexOf(t),u!==-1)i.indexOf(u)===-1&&i.push(u);else if(n.push(t),Array.isArray(t))for(u=0,c=t.length;u<c;u+=1)No(t[u],n,i);else for(s=Object.keys(t),u=0,c=s.length;u<c;u+=1)No(t[s[u]],n,i)}function Al(t,n){n=n||{};var i=new Yn(n);i.noRefs||ds(t,i);var s=t;return i.replacer&&(s=i.replacer.call({"":s},"",s)),Dn(i,0,s,!0,!0)?i.dump+`
81
- `:""}var Ol=Al,hs={dump:Ol};function ps(t,n){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var pf=Ft,vf=en,Ai=gr,Zi=Ln,qi=br,vs=z,gs=Si.load,El=Si.loadAll,ms=hs.dump,Oi=qe,Ei={binary:In,float:Pn,map:Ur,null:st,pairs:Ct,set:A,timestamp:Ir,bool:be,int:wt,merge:zr,omap:Ve,seq:vn,str:kn},Dr=ps("safeLoad","load"),ai=ps("safeLoadAll","loadAll"),si=ps("safeDump","dump"),ba={Type:pf,Schema:vf,FAILSAFE_SCHEMA:Ai,JSON_SCHEMA:Zi,CORE_SCHEMA:qi,DEFAULT_SCHEMA:vs,load:gs,loadAll:El,dump:ms,YAMLException:Oi,types:Ei,safeLoad:Dr,safeLoadAll:ai,safeDump:si};const gf=ba,Tl=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:window}(),{FormData:eo,Blob:Do,File:xa}=Tl,Sa=t=>":/?#[]@!$&'()*+,;=".indexOf(t)>-1,mf=t=>/^[a-z0-9\-._~]+$/i.test(t);function li(t){let{escape:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return typeof t=="number"&&(t=t.toString()),typeof t!="string"||!t.length||!n?t:i?JSON.parse(t):[...t].map(s=>{if(mf(s)||Sa(s)&&n==="unsafe")return s;const u=new TextEncoder;return Array.from(u.encode(s)).map(h=>`0${h.toString(16).toUpperCase()}`.slice(-2)).map(h=>`%${h}`).join("")}).join("")}function wa(t){const{value:n}=t;return Array.isArray(n)?ys(t):typeof n=="object"?bs(t):to(t)}function ys(t){let{key:n,value:i,style:s,explode:u,escape:c}=t;const h=m=>li(m,{escape:c});if(s==="simple")return i.map(m=>h(m)).join(",");if(s==="label")return`.${i.map(m=>h(m)).join(".")}`;if(s==="matrix")return i.map(m=>h(m)).reduce((m,p)=>!m||u?`${m||""};${n}=${p}`:`${m},${p}`,"");if(s==="form"){const m=u?`&${n}=`:",";return i.map(p=>h(p)).join(m)}if(s==="spaceDelimited"){const m=u?`${n}=`:"";return i.map(p=>h(p)).join(` ${m}`)}if(s==="pipeDelimited"){const m=u?`${n}=`:"";return i.map(p=>h(p)).join(`|${m}`)}}function bs(t){let{key:n,value:i,style:s,explode:u,escape:c}=t;const h=p=>li(p,{escape:c}),m=Object.keys(i);if(s==="simple")return m.reduce((p,y)=>{const T=h(i[y]),L=u?"=":",";return`${p?`${p},`:""}${y}${L}${T}`},"");if(s==="label")return m.reduce((p,y)=>{const T=h(i[y]),L=u?"=":".";return`${p?`${p}.`:"."}${y}${L}${T}`},"");if(s==="matrix"&&u)return m.reduce((p,y)=>{const T=h(i[y]);return`${p?`${p};`:";"}${y}=${T}`},"");if(s==="matrix")return m.reduce((p,y)=>{const T=h(i[y]);return`${p?`${p},`:`;${n}=`}${y},${T}`},"");if(s==="form")return m.reduce((p,y)=>{const T=h(i[y]);return`${p?`${p}${u?"&":","}`:""}${y}${u?"=":","}${T}`},"")}function to(t){let{key:n,value:i,style:s,escape:u}=t;const c=h=>li(h,{escape:u});if(s==="simple")return c(i);if(s==="label")return`.${c(i)}`;if(s==="matrix")return`;${n}=${c(i)}`;if(s==="form")return c(i);if(s==="deepObject")return c(i,{},!0)}const kl=(t,n)=>{n.body=t},ro={serializeRes:Ss,mergeInQueryOrForm:ui};async function yf(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof t=="object"&&(n=t,t=n.url),n.headers=n.headers||{},ro.mergeInQueryOrForm(n),n.headers&&Object.keys(n.headers).forEach(u=>{const c=n.headers[u];typeof c=="string"&&(n.headers[u]=c.replace(/\n+/g," "))}),n.requestInterceptor&&(n=await n.requestInterceptor(n)||n);const i=n.headers["content-type"]||n.headers["Content-Type"];/multipart\/form-data/i.test(i)&&n.body instanceof eo&&(delete n.headers["content-type"],delete n.headers["Content-Type"]);let s;try{s=await(n.userFetch||fetch)(n.url,n),s=await ro.serializeRes(s,t,n),n.responseInterceptor&&(s=await n.responseInterceptor(s)||s)}catch(u){if(!s)throw u;const c=new Error(s.statusText||`response status is ${s.status}`);throw c.status=s.status,c.statusCode=s.status,c.responseError=u,c}if(!s.ok){const u=new Error(s.statusText||`response status is ${s.status}`);throw u.status=s.status,u.statusCode=s.status,u.response=s,u}return s}const bf=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(t)};function xf(t,n){return n&&(n.indexOf("application/json")===0||n.indexOf("+json")>0)?JSON.parse(t):gf.load(t)}function Ss(t,n){let{loadSpec:i=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s={ok:t.ok,url:t.url||n,status:t.status,statusText:t.statusText,headers:no(t.headers)},u=s.headers["content-type"],c=i||bf(u);return(c?t.text:t.blob||t.buffer).call(t).then(m=>{if(s.text=m,s.data=m,c)try{const p=xf(m,u);s.body=p,s.obj=p}catch(p){s.parseError=p}return s})}function ws(t){return t.includes(", ")?t.split(", "):t}function no(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return typeof t.entries!="function"?{}:Array.from(t.entries()).reduce((n,i)=>{let[s,u]=i;return n[s]=ws(u),n},{})}function Ti(t,n){return!n&&typeof navigator<"u"&&(n=navigator),n&&n.product==="ReactNative"?!!(t&&typeof t=="object"&&typeof t.uri=="string"):typeof xa<"u"&&t instanceof xa||typeof Do<"u"&&t instanceof Do||ArrayBuffer.isView(t)?!0:t!==null&&typeof t=="object"&&typeof t.pipe=="function"}function Pl(t,n){return Array.isArray(t)&&t.some(i=>Ti(i,n))}const Ca={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Ll={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function io(t,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{collectionFormat:s,allowEmptyValue:u,serializationOption:c,encoding:h}=n,m=typeof n=="object"&&!Array.isArray(n)?n.value:n,p=i?T=>T.toString():T=>encodeURIComponent(T),y=p(t);if(typeof m>"u"&&u)return[[y,""]];if(Ti(m)||Pl(m))return[[y,m]];if(c)return Cs(t,m,i,c);if(h){if([typeof h.style,typeof h.explode,typeof h.allowReserved].some(T=>T!=="undefined")){const{style:T,explode:L,allowReserved:q}=h;return Cs(t,m,i,{style:T,explode:L,allowReserved:q})}if(h.contentType){if(h.contentType==="application/json"){const T=typeof m=="string"?m:JSON.stringify(m);return[[y,p(T)]]}return[[y,p(m.toString())]]}return typeof m!="object"?[[y,p(m)]]:Array.isArray(m)&&m.every(T=>typeof T!="object")?[[y,m.map(p).join(",")]]:[[y,p(JSON.stringify(m))]]}return typeof m!="object"?[[y,p(m)]]:Array.isArray(m)?s==="multi"?[[y,m.map(p)]]:[[y,m.map(p).join(Ll[s||"csv"])]]:[[y,""]]}function Cs(t,n,i,s){const u=s.style||"form",c=typeof s.explode>"u"?u==="form":s.explode,h=i?!1:s&&s.allowReserved?"unsafe":"reserved",m=y=>li(y,{escape:h}),p=i?y=>y:y=>li(y,{escape:h});return typeof n!="object"?[[p(t),m(n)]]:Array.isArray(n)?c?[[p(t),n.map(m)]]:[[p(t),n.map(m).join(Ca[u])]]:u==="deepObject"?Object.keys(n).map(y=>[p(`${t}[${y}]`),m(n[y])]):c?Object.keys(n).map(y=>[p(y),m(n[y])]):[[p(t),Object.keys(n).map(y=>[`${p(y)},${m(n[y])}`]).join(",")]]}function ki(t){return Object.entries(t).reduce((n,i)=>{let[s,u]=i;for(const[c,h]of io(s,u,!0))if(Array.isArray(h))for(const m of h)if(ArrayBuffer.isView(m)){const p=new Do([m]);n.append(c,p)}else n.append(c,m);else if(ArrayBuffer.isView(h)){const m=new Do([h]);n.append(c,m)}else n.append(c,h);return n},new eo)}function oo(t){const n=Object.keys(t).reduce((i,s)=>{for(const[u,c]of io(s,t[s]))i[u]=c;return i},{});return ee().stringify(n,{encode:!1,indices:!1})||""}function ui(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{url:n="",query:i,form:s}=t,u=function(){for(var c=arguments.length,h=new Array(c),m=0;m<c;m++)h[m]=arguments[m];const p=h.filter(y=>y).join("&");return p?`?${p}`:""};if(s){const c=Object.keys(s).some(m=>{const{value:p}=s[m];return Ti(p)||Pl(p)}),h=t.headers["content-type"]||t.headers["Content-Type"];if(c||/multipart\/form-data/i.test(h)){const m=ki(t.form);kl(m,t)}else t.body=oo(s);delete t.form}if(i){const[c,h]=n.split("?");let m="";if(h){const y=ee().parse(h);Object.keys(i).forEach(L=>delete y[L]),m=ee().stringify(y,{encode:!0})}const p=u(m,oo(i));t.url=c+p,delete t.query}return t}function Aa(t,n,i){return i=i||(s=>s),n=n||(s=>s),s=>(typeof s=="string"&&(s={url:s}),ro.mergeInQueryOrForm(s),s=n(s),i(t(s)))}function ao(t,n){function i(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];[this.message]=u,n&&n.apply(this,u)}return i.prototype=new Error,i.prototype.name=t,i.prototype.constructor=i,i}const Il={body:Ml,header:Sf,query:Li,path:Pi,formData:Nl};function Ml(t){let{req:n,value:i}=t;n.body=i}function Nl(t){let{req:n,value:i,parameter:s}=t;(i||s.allowEmptyValue)&&(n.form=n.form||{},n.form[s.name]={value:i,allowEmptyValue:s.allowEmptyValue,collectionFormat:s.collectionFormat})}function Sf(t){let{req:n,parameter:i,value:s}=t;n.headers=n.headers||{},typeof s<"u"&&(n.headers[i.name]=s)}function Pi(t){let{req:n,value:i,parameter:s}=t;n.url=n.url.split(`{${s.name}}`).join(encodeURIComponent(i))}function Li(t){let{req:n,value:i,parameter:s}=t;if(n.query=n.query||{},i===!1&&s.type==="boolean"&&(i="false"),i===0&&["number","integer"].indexOf(s.type)>-1&&(i="0"),i)n.query[s.name]={collectionFormat:s.collectionFormat,value:i};else if(s.allowEmptyValue&&i!==void 0){const u=s.name;n.query[u]=n.query[u]||{},n.query[u].allowEmptyValue=!0}}function Oa(t,n){return n.includes("application/json")?typeof t=="string"?t:JSON.stringify(t):t.toString()}function wf(t){let{req:n,value:i,parameter:s}=t;const{name:u,style:c,explode:h,content:m}=s;if(m){const y=Object.keys(m)[0];n.url=n.url.split(`{${u}}`).join(li(Oa(i,y),{escape:!0}));return}const p=wa({key:s.name,value:i,style:c||"simple",explode:h||!1,escape:!0});n.url=n.url.split(`{${u}}`).join(p)}function Cf(t){let{req:n,value:i,parameter:s}=t;if(n.query=n.query||{},s.content){const u=Object.keys(s.content)[0],c=Oa(i,u);if(c)n.query[s.name]=c;else if(s.allowEmptyValue&&i!==void 0){const h=s.name;n.query[h]=n.query[h]||{},n.query[h].allowEmptyValue=!0}return}if(i===!1&&(i="false"),i===0&&(i="0"),i){const{style:u,explode:c,allowReserved:h}=s;n.query[s.name]={value:i,serializationOption:{style:u,explode:c,allowReserved:h}}}else if(s.allowEmptyValue&&i!==void 0){const u=s.name;n.query[u]=n.query[u]||{},n.query[u].allowEmptyValue=!0}}const Af=["accept","authorization","content-type"];function Of(t){let{req:n,parameter:i,value:s}=t;if(n.headers=n.headers||{},!(Af.indexOf(i.name.toLowerCase())>-1)){if(i.content){const u=Object.keys(i.content)[0];n.headers[i.name]=Oa(s,u);return}typeof s<"u"&&(n.headers[i.name]=wa({key:i.name,value:s,style:i.style||"simple",explode:typeof i.explode>"u"?!1:i.explode,escape:!1}))}}function Ef(t){let{req:n,parameter:i,value:s}=t;n.headers=n.headers||{};const u=typeof s;if(i.content){const c=Object.keys(i.content)[0];n.headers.Cookie=`${i.name}=${Oa(s,c)}`;return}if(u!=="undefined"){const c=u==="object"&&!Array.isArray(s)&&i.explode?"":`${i.name}=`;n.headers.Cookie=c+wa({key:i.name,value:s,escape:!1,style:i.style||"form",explode:typeof i.explode>"u"?!1:i.explode})}}const Vr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:window)(),{btoa:lr}=Vr,Sr=lr;function ur(t,n){const{operation:i,requestBody:s,securities:u,spec:c,attachContentTypeForEmptyPayload:h}=t;let{requestContentType:m}=t;n=Fo({request:n,securities:u,operation:i,spec:c});const p=i.requestBody||{},y=Object.keys(p.content||{}),T=m&&y.indexOf(m)>-1;if(s||h){if(m&&T)n.headers["Content-Type"]=m;else if(!m){const L=y[0];L&&(n.headers["Content-Type"]=L,m=L)}}else m&&T&&(n.headers["Content-Type"]=m);if(!t.responseContentType&&i.responses){const L=Object.entries(i.responses).filter(q=>{let[W,_]=q;const fe=parseInt(W,10);return fe>=200&&fe<300&&ge(_.content)}).reduce((q,W)=>{let[,_]=W;return q.concat(Object.keys(_.content))},[]);L.length>0&&(n.headers.accept=L.join(", "))}if(s)if(m){if(y.indexOf(m)>-1)if(m==="application/x-www-form-urlencoded"||m==="multipart/form-data")if(typeof s=="object"){const L=(p.content[m]||{}).encoding||{};n.form={},Object.keys(s).forEach(q=>{n.form[q]={value:s[q],encoding:L[q]||{}}})}else n.form=s;else n.body=s}else n.body=s;return n}function Fo(t){let{request:n,securities:i={},operation:s={},spec:u}=t;const c=I({},n),{authorized:h={}}=i,m=s.security||u.security||[],p=h&&!!Object.keys(h).length,y=ie()(u,["components","securitySchemes"])||{};return c.headers=c.headers||{},c.query=c.query||{},!Object.keys(i).length||!p||!m||Array.isArray(s.security)&&!s.security.length?n:(m.forEach(T=>{Object.keys(T).forEach(L=>{const q=h[L],W=y[L];if(!q)return;const _=q.value||q,{type:fe}=W;if(q){if(fe==="apiKey")W.in==="query"&&(c.query[W.name]=_),W.in==="header"&&(c.headers[W.name]=_),W.in==="cookie"&&(c.cookies[W.name]=_);else if(fe==="http"){if(/^basic$/i.test(W.scheme)){const ae=_.username||"",oe=_.password||"",ue=Sr(`${ae}:${oe}`);c.headers.Authorization=`Basic ${ue}`}/^bearer$/i.test(W.scheme)&&(c.headers.Authorization=`Bearer ${_}`)}else if(fe==="oauth2"||fe==="openIdConnect"){const ae=q.token||{},oe=W["x-tokenName"]||"access_token",ue=ae[oe];let ye=ae.token_type;(!ye||ye.toLowerCase()==="bearer")&&(ye="Bearer"),c.headers.Authorization=`${ye} ${ue}`}}})}),c)}function Tf(t,n){const{spec:i,operation:s,securities:u,requestContentType:c,responseContentType:h,attachContentTypeForEmptyPayload:m}=t;if(n=Ea({request:n,securities:u,operation:s,spec:i}),n.body||n.form||m)c?n.headers["Content-Type"]=c:Array.isArray(s.consumes)?[n.headers["Content-Type"]]=s.consumes:Array.isArray(i.consumes)?[n.headers["Content-Type"]]=i.consumes:s.parameters&&s.parameters.filter(p=>p.type==="file").length?n.headers["Content-Type"]="multipart/form-data":s.parameters&&s.parameters.filter(p=>p.in==="formData").length&&(n.headers["Content-Type"]="application/x-www-form-urlencoded");else if(c){const p=s.parameters&&s.parameters.filter(T=>T.in==="body").length>0,y=s.parameters&&s.parameters.filter(T=>T.in==="formData").length>0;(p||y)&&(n.headers["Content-Type"]=c)}return!h&&Array.isArray(s.produces)&&s.produces.length>0&&(n.headers.accept=s.produces.join(", ")),n}function Ea(t){let{request:n,securities:i={},operation:s={},spec:u}=t;const c=I({},n),{authorized:h={},specSecurity:m=[]}=i,p=s.security||m,y=h&&!!Object.keys(h).length,T=u.securityDefinitions;return c.headers=c.headers||{},c.query=c.query||{},!Object.keys(i).length||!y||!p||Array.isArray(s.security)&&!s.security.length?n:(p.forEach(L=>{Object.keys(L).forEach(q=>{const W=h[q];if(!W)return;const{token:_}=W,fe=W.value||W,ae=T[q],{type:oe}=ae,ue=ae["x-tokenName"]||"access_token",ye=_&&_[ue];let Ae=_&&_.token_type;if(W)if(oe==="apiKey"){const we=ae.in==="query"?"query":"headers";c[we]=c[we]||{},c[we][ae.name]=fe}else if(oe==="basic")if(fe.header)c.headers.authorization=fe.header;else{const we=fe.username||"",ke=fe.password||"";fe.base64=Sr(`${we}:${ke}`),c.headers.authorization=`Basic ${fe.base64}`}else oe==="oauth2"&&ye&&(Ae=!Ae||Ae.toLowerCase()==="bearer"?"Bearer":Ae,c.headers.authorization=`${Ae} ${ye}`)})}),c)}function Dl(t,n){return`${n.toLowerCase()}-${t}`}function kf(t,n,i){if(!t||typeof t!="object"||!t.paths||typeof t.paths!="object")return null;const{paths:s}=t;for(const u in s)for(const c in s[u]){if(c.toUpperCase()==="PARAMETERS")continue;const h=s[u][c];if(!h||typeof h!="object")continue;const m={spec:t,pathName:u,method:c.toUpperCase(),operation:h},p=n(m);if(i&&p)return m}}function Pf(t,n){return kf(t,n,!0)||null}const As=t=>t.replace(/\W/gi,"_");function Os(t,n){let{v2OperationIdCompatibilityMode:i}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(i){let s=`${n.toLowerCase()}_${t}`.replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return s=s||`${t.substring(1)}_${n}`,s.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return`${n.toLowerCase()}${As(t)}`}function Lf(t,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",{v2OperationIdCompatibilityMode:s}=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return!t||typeof t!="object"?null:(t.operationId||"").replace(/\s/g,"").length?As(t.operationId):Os(n,i,{v2OperationIdCompatibilityMode:s})}function Es(t,n){return!t||!t.paths?null:Pf(t,i=>{let{pathName:s,method:u,operation:c}=i;if(!c||typeof c!="object")return!1;const h=c.operationId,m=Lf(c,s,u),p=Dl(s,u);return[m,p,h].some(y=>y&&y===n)})}const Rl=t=>{try{const{swagger:n}=t;return n==="2.0"}catch{return!1}},Bl=t=>{try{const{openapi:n}=t;return typeof n=="string"&&/^3\.0\.([0123])(?:-rc[012])?$/.test(n)}catch{return!1}},jl=t=>{try{const{openapi:n}=t;return typeof n=="string"&&/^3\.1\.(?:[1-9]\d*|0)$/.test(n)}catch{return!1}},Ta=t=>Bl(t)||jl(t),Wl=["http","fetch","spec","operationId","pathName","method","parameters","securities"],so=t=>Array.isArray(t)?t:[],If=ao("OperationNotFoundError",function(n,i,s){this.originalError=s,Object.assign(this,i||{})}),ka=(t,n)=>n.filter(i=>i.name===t),Xn=t=>{const n={};t.forEach(s=>{n[s.in]||(n[s.in]={}),n[s.in][s.name]=s});const i=[];return Object.keys(n).forEach(s=>{Object.keys(n[s]).forEach(u=>{i.push(n[s][u])})}),i},Hl={buildRequest:Ul};function Mf(t){let{http:n,fetch:i,spec:s,operationId:u,pathName:c,method:h,parameters:m,securities:p}=t,y=te(t,Wl);const T=n||i||yf;c&&h&&!u&&(u=Dl(c,h));const L=Hl.buildRequest(I({spec:s,operationId:u,parameters:m,securities:p,http:T},y));return L.body&&(ge(L.body)||Array.isArray(L.body))&&(L.body=JSON.stringify(L.body)),T(L)}function Ul(t){const{spec:n,operationId:i,responseContentType:s,scheme:u,requestInterceptor:c,responseInterceptor:h,contextUrl:m,userFetch:p,server:y,serverVariables:T,http:L,signal:q}=t;let{parameters:W,parameterBuilders:_}=t;const fe=Ta(n);_||(fe?_=v:_=Il);let oe={url:"",credentials:L&&L.withCredentials?"include":"same-origin",headers:{},cookies:{}};q&&(oe.signal=q),c&&(oe.requestInterceptor=c),h&&(oe.responseInterceptor=h),p&&(oe.userFetch=p);const ue=Es(n,i);if(!ue)throw new If(`Operation ${i} not found`);const{operation:ye={},method:Ae,pathName:we}=ue;if(oe.url+=Et({spec:n,scheme:u,contextUrl:m,server:y,serverVariables:T,pathName:we,method:Ae}),!i)return delete oe.cookies,oe;oe.url+=we,oe.method=`${Ae}`.toUpperCase(),W=W||{};const ke=n.paths[we]||{};s&&(oe.headers.accept=s);const Te=Xn([].concat(so(ye.parameters)).concat(so(ke.parameters)));Te.forEach(pe=>{const Ie=_[pe.in];let Ee;if(pe.in==="body"&&pe.schema&&pe.schema.properties&&(Ee=W),Ee=pe&&pe.name&&W[pe.name],typeof Ee>"u"?Ee=pe&&pe.name&&W[`${pe.in}.${pe.name}`]:ka(pe.name,Te).length>1&&console.warn(`Parameter '${pe.name}' is ambiguous because the defined spec has more than one parameter with the name: '${pe.name}' and the passed-in parameter values did not define an 'in' value.`),Ee!==null){if(typeof pe.default<"u"&&typeof Ee>"u"&&(Ee=pe.default),typeof Ee>"u"&&pe.required&&!pe.allowEmptyValue)throw new Error(`Required parameter ${pe.name} is not provided`);if(fe&&pe.schema&&pe.schema.type==="object"&&typeof Ee=="string")try{Ee=JSON.parse(Ee)}catch{throw new Error("Could not parse object parameter value string as JSON")}Ie&&Ie({req:oe,parameter:pe,value:Ee,operation:ye,spec:n})}});const De=I(I({},t),{},{operation:ye});if(fe?oe=ur(De,oe):oe=Tf(De,oe),oe.cookies&&Object.keys(oe.cookies).length){const pe=Object.keys(oe.cookies).reduce((Ie,Ee)=>{const Be=oe.cookies[Ee],et=Ie?"&":"",jt=Y.serialize(Ee,Be);return Ie+et+jt},"");oe.headers.Cookie=pe}return oe.cookies&&delete oe.cookies,ui(oe),oe}const Fr=t=>t?t.replace(/\W/g,""):null;function Et(t){return Ta(t.spec)?Sn(t):zl(t)}function Sn(t){let{spec:n,pathName:i,method:s,server:u,contextUrl:c,serverVariables:h={}}=t;const m=ie()(n,["paths",i,(s||"").toLowerCase(),"servers"])||ie()(n,["paths",i,"servers"])||ie()(n,["servers"]);let p="",y=null;if(u&&m&&m.length){const T=m.map(L=>L.url);T.indexOf(u)>-1&&(p=u,y=m[T.indexOf(u)])}return!p&&m&&m.length&&(p=m[0].url,[y]=m),p.indexOf("{")>-1&&ci(p).forEach(L=>{if(y.variables&&y.variables[L]){const q=y.variables[L],W=h[L]||q.default,_=new RegExp(`{${L}}`,"g");p=p.replace(_,W)}}),fi(p,c)}function fi(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const i=t&&n?H.parse(H.resolve(n,t)):H.parse(t),s=H.parse(n),u=Fr(i.protocol)||Fr(s.protocol)||"",c=i.host||s.host,h=i.pathname||"";let m;return u&&c?m=`${u}://${c+h}`:m=h,m[m.length-1]==="/"?m.slice(0,-1):m}function ci(t){const n=[],i=/{([^}]+)}/g;let s;for(;s=i.exec(t);)n.push(s[1]);return n}function zl(t){let{spec:n,scheme:i,contextUrl:s=""}=t;const u=H.parse(s),c=Array.isArray(n.schemes)?n.schemes[0]:null,h=i||c||Fr(u.protocol)||"http",m=n.host||u.host||"",p=n.basePath||"";let y;return h&&m?y=`${h}://${m+p}`:y=p,y[y.length-1]==="/"?y.slice(0,-1):y}var B=f(29901),Vt=f(20202),wn=f(44411),Ts=f(81570),Ro=f(74025),_l=f(2526),ks=Object.defineProperty,di=Object.defineProperties,Vl=Object.getOwnPropertyDescriptors,Ps=Object.getOwnPropertySymbols,Nf=Object.prototype.hasOwnProperty,Pa=Object.prototype.propertyIsEnumerable,La=(t,n,i)=>n in t?ks(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,$l=(t,n)=>{for(var i in n||(n={}))Nf.call(n,i)&&La(t,i,n[i]);if(Ps)for(var i of Ps(n))Pa.call(n,i)&&La(t,i,n[i]);return t},Df=(t,n)=>di(t,Vl(n)),Gl=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});function Ff(t,n){return Gl(this,null,function*(){var i,s,u,c;const h=JSON.parse(JSON.stringify(n)),m=h.openapi?{openapi:h.openapi}:h.swagger?{swagger:h.swagger}:{},p=Df($l({},m),{components:h.components,paths:{[t.path]:{[t.httpVerb]:(s=(i=h.paths)==null?void 0:i[t.path])==null?void 0:s[t.httpVerb],parameters:(c=(u=h.paths)==null?void 0:u[t.path])==null?void 0:c.parameters}}}),y=new Ro.Config({}),T=(0,_l.I)(p),L={config:y,doc:T,dereference:!0};return yield(0,Ts.bundle)(L),h})}var Rf=f(98910),Ii=f(84862),Cn=f(53134),Kl=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});const Yl=Object.values(Cn.FileUploadFormats),Xl=["application/octet-stream","application/pdf","application/gzip","application/zip"],Mi=["image/","audio/","video/"];function Ia(t){if(Mi.some(n=>t.startsWith(n)))return t}function Ni(t){return Xl.includes(t)?!0:Mi.some(n=>t.startsWith(n))}function Jl(t){const n=t.type==="array"?t.items:t;if(!n||!n.type||n?.type==="any")return!0;const i=n.contentMediaType||"",s=n.format||n.contentEncoding||(Ni(i)?"binary":"");return n.type===Cn.DefinitionTypes.STRING&&Yl.includes(s)}function Ma(t,n){if(!t||!t.type||t.type==="any")return Ni(n);const i=t.format||t.contentEncoding||"";return t.type===Cn.DefinitionTypes.STRING&&Yl.includes(i)}function Ls(t){return new Promise((n,i)=>{const s=new FileReader;s.onload=()=>{const c=s.result.replace(/data:.*\/.*;base64,/g,"");n(c)},s.onerror=()=>i(s.error),s.readAsDataURL(t)})}function Ql({format:t,contentEncoding:n,contentMediaType:i}){return[t,n,i].includes(Cn.FileUploadFormats.BASE64)}function Zl(t,n){return Kl(this,null,function*(){const i=Object.values(t);let s=i.length===1?i[0]:i;return n.type===Cn.DefinitionTypes.STRING&&Ql(n)?s=yield Ls(i[0]):n.type===Cn.DefinitionTypes.ARRAY&&n.items&&(Ql(n.items)?s=yield Promise.all(i.map(c=>Kl(this,null,function*(){return yield Ls(c)}))):s=i),s})}var fr=f(84622),gt=f(38612),Tt=f(97495),ot=f(85739),Qr=f(71608),lo=f(64393),An=f(60991);function ql({response:t}){const{jsonSampleExpandLevel:n}=(0,wn.Dv)(An.qd);return B.createElement(B.Fragment,null,B.createElement(Qr.EE,null," Body: "),eu(t,n))}function eu(t,n){return t.body?B.createElement(Vt.JsonViewer,{data:t.body,jsonSampleExpandLevel:n}):t.fileInfo?B.createElement(lo.s,{fileInfo:t.fileInfo}):t.data!==null?t.data?B.createElement(Vt.CodeBlock,{lang:(0,ot.M)(t.headers["Content-Type"]||"text/plain"),source:t.data,header:{controls:{copy:{}}}}):B.createElement(Vt.CodeBlockContainer,{withControls:!0},B.createElement("i",null,"(no content)")):null}function tu({headers:t}){const n=(0,wn.Dv)(An.qd),[i,s]=(0,B.useState)(!0),{maxResponseHeadersToShowInTryIt:u}=n,c=Object.keys(t),h=!!u&&c.length>u,m=h&&i?[...c].splice(0,u):[...c],p=()=>{s(!i)};return B.createElement(B.Fragment,null,B.createElement(Qr.EE,null," Headers: "),B.createElement(Vt.CodeBlockContainer,{withControls:!0},m.map(y=>B.createElement("div",{key:y},B.createElement(Di,null,y,":"),B.createElement("code",null,t[y]))),h&&B.createElement(Is,{onClick:p},i?"Show more...":"Hide headers")))}const Di=Tt.ZP.strong`
18
+ `+r.mark.snippet),n+" "+t):n}function $t(r,e){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=e,this.message=wt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}$t.prototype=Object.create(Error.prototype),$t.prototype.constructor=$t,$t.prototype.toString=function(e){return this.name+": "+wt(this,e)};var ht=$t;function Tr(r,e,t,n,i){var s="",o="",a=Math.floor(i/2)-1;return n-e>a&&(s=" ... ",e=n-a+s.length),t-n>a&&(o=" ...",t=n+a-o.length),{str:s+r.slice(e,t).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function hr(r,e){return Ne.repeat(" ",e-r.length)+r}function Vr(r,e){if(e=Object.create(e||null),!r.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;s=t.exec(r.buffer);)i.push(s.index),n.push(s.index+s[0].length),r.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var a="",l,c,u=Math.min(r.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+u+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)c=Tr(r.buffer,n[o-l],i[o-l],r.position-(n[o]-n[o-l]),h),a=Ne.repeat(" ",e.indent)+hr((r.line-l+1).toString(),u)+" | "+c.str+`
19
+ `+a;for(c=Tr(r.buffer,n[o],i[o],r.position,h),a+=Ne.repeat(" ",e.indent)+hr((r.line+1).toString(),u)+" | "+c.str+`
20
+ `,a+=Ne.repeat("-",e.indent+u+3+c.pos)+`^
21
+ `,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)c=Tr(r.buffer,n[o+l],i[o+l],r.position-(n[o]-n[o+l]),h),a+=Ne.repeat(" ",e.indent)+hr((r.line+l+1).toString(),u)+" | "+c.str+`
22
+ `;return a.replace(/\n$/,"")}var Ri=Vr,Pr=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],dr=["scalar","sequence","mapping"];function pr(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(n){e[String(n)]=t})}),e}function Kr(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(Pr.indexOf(t)===-1)throw new ht('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.options=e,this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=pr(e.styleAliases||null),dr.indexOf(this.kind)===-1)throw new ht('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}var dt=Kr;function In(r,e){var t=[];return r[e].forEach(function(n){var i=t.length;t.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=o)}),t[i]=n}),t}function ui(){var r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,t;function n(i){i.multi?(r.multi[i.kind].push(i),r.multi.fallback.push(i)):r[i.kind][i.tag]=r.fallback[i.tag]=i}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(n);return r}function bn(r){return this.extend(r)}bn.prototype.extend=function(e){var t=[],n=[];if(e instanceof dt)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new ht("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(s){if(!(s instanceof dt))throw new ht("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new ht("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new ht("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof dt))throw new ht("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(bn.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=In(i,"implicit"),i.compiledExplicit=In(i,"explicit"),i.compiledTypeMap=ui(i.compiledImplicit,i.compiledExplicit),i};var xn=bn,Dn=new dt("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}}),fi=new dt("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}}),Nn=new dt("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}}),Wr=new xn({explicit:[Dn,fi,Nn]});function Rn(r){if(r===null)return!0;var e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function hi(){return null}function Ze(r){return r===null}var Ce=new dt("tag:yaml.org,2002:null",{kind:"scalar",resolve:Rn,construct:hi,predicate:Ze,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Le(r){if(r===null)return!1;var e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function Pe(r){return r==="true"||r==="True"||r==="TRUE"}function $(r){return Object.prototype.toString.call(r)==="[object Boolean]"}var Z=new dt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Le,construct:Pe,predicate:$,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE":"FALSE"},camelcase:function(r){return r?"True":"False"}},defaultStyle:"lowercase"});function ze(r){return 48<=r&&r<=57||65<=r&&r<=70||97<=r&&r<=102}function _e(r){return 48<=r&&r<=55}function lt(r){return 48<=r&&r<=57}function Me(r){if(r===null)return!1;var e=r.length,t=0,n=!1,i;if(!e)return!1;if(i=r[t],(i==="-"||i==="+")&&(i=r[++t]),i==="0"){if(t+1===e)return!0;if(i=r[++t],i==="b"){for(t++;t<e;t++)if(i=r[t],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(t++;t<e;t++)if(i=r[t],i!=="_"){if(!ze(r.charCodeAt(t)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(t++;t<e;t++)if(i=r[t],i!=="_"){if(!_e(r.charCodeAt(t)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;t<e;t++)if(i=r[t],i!=="_"){if(!lt(r.charCodeAt(t)))return!1;n=!0}return!(!n||i==="_")}function Yr(r){var e=r,t=1,n;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),n=e[0],(n==="-"||n==="+")&&(n==="-"&&(t=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return t*parseInt(e.slice(2),2);if(e[1]==="x")return t*parseInt(e.slice(2),16);if(e[1]==="o")return t*parseInt(e.slice(2),8)}return t*parseInt(e,10)}function wn(r){return Object.prototype.toString.call(r)==="[object Number]"&&r%1===0&&!Ne.isNegativeZero(r)}var Ht=new dt("tag:yaml.org,2002:int",{kind:"scalar",resolve:Me,construct:Yr,predicate:wn,represent:{binary:function(r){return r>=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0o"+r.toString(8):"-0o"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Jr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ts(r){return!(r===null||!Jr.test(r)||r[r.length-1]==="_")}function Ln(r){var e,t;return e=r.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:t*parseFloat(e,10)}var gr=/^[-+]?[0-9]+e/;function Vo(r,e){var t;if(isNaN(r))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ne.isNegativeZero(r))return"-0.0";return t=r.toString(10),gr.test(t)?t.replace("e",".e"):t}function Wo(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!==0||Ne.isNegativeZero(r))}var Ps=new dt("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ts,construct:Ln,predicate:Wo,represent:Vo,defaultStyle:"lowercase"}),Bn=Wr.extend({implicit:[Ce,Z,Ht,Ps]}),Li=Bn,di=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Bi=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Ms(r){return r===null?!1:di.exec(r)!==null||Bi.exec(r)!==null}function $o(r){var e,t,n,i,s,o,a,l=0,c=null,u,h,d;if(e=di.exec(r),e===null&&(e=Bi.exec(r)),e===null)throw new Error("Date resolve error");if(t=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(t,n,i));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(u=+e[10],h=+(e[11]||0),c=(u*60+h)*6e4,e[9]==="-"&&(c=-c)),d=new Date(Date.UTC(t,n,i,s,o,a,l)),c&&d.setTime(d.getTime()-c),d}function Ho(r){return r.toISOString()}var Fi=new dt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Ms,construct:$o,instanceOf:Date,represent:Ho});function zo(r){return r==="<<"||r===null}var ji=new dt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:zo}),Vi=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
23
+ \r`;function Yl(r){if(r===null)return!1;var e,t,n=0,i=r.length,s=Vi;for(t=0;t<i;t++)if(e=s.indexOf(r.charAt(t)),!(e>64)){if(e<0)return!1;n+=6}return n%8===0}function Is(r){var e,t,n=r.replace(/[\r\n=]/g,""),i=n.length,s=Vi,o=0,a=[];for(e=0;e<i;e++)e%4===0&&e&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(n.charAt(e));return t=i%4*6,t===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):t===18?(a.push(o>>10&255),a.push(o>>2&255)):t===12&&a.push(o>>4&255),new Uint8Array(a)}function Fn(r){var e="",t=0,n,i,s=r.length,o=Vi;for(n=0;n<s;n++)n%3===0&&n&&(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[n];return i=s%3,i===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):i===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):i===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function Wi(r){return Object.prototype.toString.call(r)==="[object Uint8Array]"}var Uo=new dt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Yl,construct:Is,predicate:Wi,represent:Fn}),Go=Object.prototype.hasOwnProperty,Rb=Object.prototype.toString;function Lb(r){if(r===null)return!0;var e=[],t,n,i,s,o,a=r;for(t=0,n=a.length;t<n;t+=1){if(i=a[t],o=!1,Rb.call(i)!=="[object Object]")return!1;for(s in i)if(Go.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function Bb(r){return r!==null?r:[]}var Jf=new dt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Lb,construct:Bb}),Fb=Object.prototype.toString;function jb(r){if(r===null)return!0;var e,t,n,i,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1){if(n=o[e],Fb.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;s[e]=[i[0],n[i[0]]]}return!0}function Vb(r){if(r===null)return[];var e,t,n,i,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1)n=o[e],i=Object.keys(n),s[e]=[i[0],n[i[0]]];return s}var Qf=new dt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:jb,construct:Vb}),Wb=Object.prototype.hasOwnProperty;function $b(r){if(r===null)return!0;var e,t=r;for(e in t)if(Wb.call(t,e)&&t[e]!==null)return!1;return!0}function Hb(r){return r!==null?r:{}}var Xf=new dt("tag:yaml.org,2002:set",{kind:"mapping",resolve:$b,construct:Hb}),Jl=Li.extend({implicit:[Fi,ji],explicit:[Uo,Jf,Qf,Xf]}),jn=Object.prototype.hasOwnProperty,Ko=1,Zf=2,_f=3,Yo=4,Ql=1,zb=2,qf=3,Ub=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Gb=/[\x85\u2028\u2029]/,Kb=/[,\[\]\{\}]/,eh=/^(?:!|!!|![a-z\-]+!)$/i,th=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function rh(r){return Object.prototype.toString.call(r)}function Qr(r){return r===10||r===13}function pi(r){return r===9||r===32}function or(r){return r===9||r===32||r===10||r===13}function $i(r){return r===44||r===91||r===93||r===123||r===125}function Yb(r){var e;return 48<=r&&r<=57?r-48:(e=r|32,97<=e&&e<=102?e-97+10:-1)}function Jb(r){return r===120?2:r===117?4:r===85?8:0}function Qb(r){return 48<=r&&r<=57?r-48:-1}function nh(r){return r===48?"\0":r===97?"\x07":r===98?"\b":r===116||r===9?" ":r===110?`
24
+ `:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"\x1B":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"\x85":r===95?"\xA0":r===76?"\u2028":r===80?"\u2029":""}function Xb(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}for(var ih=new Array(256),sh=new Array(256),Hi=0;Hi<256;Hi++)ih[Hi]=nh(Hi)?1:0,sh[Hi]=nh(Hi);function Zb(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||Jl,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function oh(r,e){var t={name:r.filename,buffer:r.input.slice(0,-1),position:r.position,line:r.line,column:r.position-r.lineStart};return t.snippet=Ri(t),new ht(e,t)}function xe(r,e){throw oh(r,e)}function Jo(r,e){r.onWarning&&r.onWarning.call(null,oh(r,e))}var ah={YAML:function(e,t,n){var i,s,o;e.version!==null&&xe(e,"duplication of %YAML directive"),n.length!==1&&xe(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&xe(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&xe(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Jo(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,s;n.length!==2&&xe(e,"TAG directive accepts exactly two arguments"),i=n[0],s=n[1],eh.test(i)||xe(e,"ill-formed tag handle (first argument) of the TAG directive"),jn.call(e.tagMap,i)&&xe(e,'there is a previously declared suffix for "'+i+'" tag handle'),th.test(s)||xe(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{xe(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s}};function Vn(r,e,t,n){var i,s,o,a;if(e<t){if(a=r.input.slice(e,t),n)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||xe(r,"expected valid JSON character");else Ub.test(a)&&xe(r,"the stream contains non-printable characters");r.result+=a}}function lh(r,e,t,n){var i,s,o,a;for(Ne.isObject(t)||xe(r,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),o=0,a=i.length;o<a;o+=1)s=i[o],jn.call(e,s)||(e[s]=t[s],n[s]=!0)}function zi(r,e,t,n,i,s,o,a,l){var c,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,u=i.length;c<u;c+=1)Array.isArray(i[c])&&xe(r,"nested arrays are not supported inside keys"),typeof i=="object"&&rh(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&rh(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,u=s.length;c<u;c+=1)lh(r,e,s[c],t);else lh(r,e,s,t);else!r.json&&!jn.call(t,i)&&jn.call(e,i)&&(r.line=o||r.line,r.lineStart=a||r.lineStart,r.position=l||r.position,xe(r,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(e,i,{configurable:!0,enumerable:!0,writable:!0,value:s}):e[i]=s,delete t[i];return e}function Xl(r){var e;e=r.input.charCodeAt(r.position),e===10?r.position++:e===13?(r.position++,r.input.charCodeAt(r.position)===10&&r.position++):xe(r,"a line break is expected"),r.line+=1,r.lineStart=r.position,r.firstTabInLine=-1}function St(r,e,t){for(var n=0,i=r.input.charCodeAt(r.position);i!==0;){for(;pi(i);)i===9&&r.firstTabInLine===-1&&(r.firstTabInLine=r.position),i=r.input.charCodeAt(++r.position);if(e&&i===35)do i=r.input.charCodeAt(++r.position);while(i!==10&&i!==13&&i!==0);if(Qr(i))for(Xl(r),i=r.input.charCodeAt(r.position),n++,r.lineIndent=0;i===32;)r.lineIndent++,i=r.input.charCodeAt(++r.position);else break}return t!==-1&&n!==0&&r.lineIndent<t&&Jo(r,"deficient indentation"),n}function Qo(r){var e=r.position,t;return t=r.input.charCodeAt(e),!!((t===45||t===46)&&t===r.input.charCodeAt(e+1)&&t===r.input.charCodeAt(e+2)&&(e+=3,t=r.input.charCodeAt(e),t===0||or(t)))}function Zl(r,e){e===1?r.result+=" ":e>1&&(r.result+=Ne.repeat(`
25
+ `,e-1))}function _b(r,e,t){var n,i,s,o,a,l,c,u,h=r.kind,d=r.result,p;if(p=r.input.charCodeAt(r.position),or(p)||$i(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=r.input.charCodeAt(r.position+1),or(i)||t&&$i(i)))return!1;for(r.kind="scalar",r.result="",s=o=r.position,a=!1;p!==0;){if(p===58){if(i=r.input.charCodeAt(r.position+1),or(i)||t&&$i(i))break}else if(p===35){if(n=r.input.charCodeAt(r.position-1),or(n))break}else{if(r.position===r.lineStart&&Qo(r)||t&&$i(p))break;if(Qr(p))if(l=r.line,c=r.lineStart,u=r.lineIndent,St(r,!1,-1),r.lineIndent>=e){a=!0,p=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=c,r.lineIndent=u;break}}a&&(Vn(r,s,o,!1),Zl(r,r.line-l),s=o=r.position,a=!1),pi(p)||(o=r.position+1),p=r.input.charCodeAt(++r.position)}return Vn(r,s,o,!1),r.result?!0:(r.kind=h,r.result=d,!1)}function qb(r,e){var t,n,i;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,n=i=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(Vn(r,n,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)n=r.position,r.position++,i=r.position;else return!0;else Qr(t)?(Vn(r,n,i,!0),Zl(r,St(r,!1,e)),n=i=r.position):r.position===r.lineStart&&Qo(r)?xe(r,"unexpected end of the document within a single quoted scalar"):(r.position++,i=r.position);xe(r,"unexpected end of the stream within a single quoted scalar")}function e1(r,e){var t,n,i,s,o,a;if(a=r.input.charCodeAt(r.position),a!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=n=r.position;(a=r.input.charCodeAt(r.position))!==0;){if(a===34)return Vn(r,t,r.position,!0),r.position++,!0;if(a===92){if(Vn(r,t,r.position,!0),a=r.input.charCodeAt(++r.position),Qr(a))St(r,!1,e);else if(a<256&&ih[a])r.result+=sh[a],r.position++;else if((o=Jb(a))>0){for(i=o,s=0;i>0;i--)a=r.input.charCodeAt(++r.position),(o=Yb(a))>=0?s=(s<<4)+o:xe(r,"expected hexadecimal character");r.result+=Xb(s),r.position++}else xe(r,"unknown escape sequence");t=n=r.position}else Qr(a)?(Vn(r,t,n,!0),Zl(r,St(r,!1,e)),t=n=r.position):r.position===r.lineStart&&Qo(r)?xe(r,"unexpected end of the document within a double quoted scalar"):(r.position++,n=r.position)}xe(r,"unexpected end of the stream within a double quoted scalar")}function t1(r,e){var t=!0,n,i,s,o=r.tag,a,l=r.anchor,c,u,h,d,p,m=Object.create(null),y,w,A,T;if(T=r.input.charCodeAt(r.position),T===91)u=93,p=!1,a=[];else if(T===123)u=125,p=!0,a={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=a),T=r.input.charCodeAt(++r.position);T!==0;){if(St(r,!0,e),T=r.input.charCodeAt(r.position),T===u)return r.position++,r.tag=o,r.anchor=l,r.kind=p?"mapping":"sequence",r.result=a,!0;t?T===44&&xe(r,"expected the node content, but found ','"):xe(r,"missed comma between flow collection entries"),w=y=A=null,h=d=!1,T===63&&(c=r.input.charCodeAt(r.position+1),or(c)&&(h=d=!0,r.position++,St(r,!0,e))),n=r.line,i=r.lineStart,s=r.position,Ui(r,e,Ko,!1,!0),w=r.tag,y=r.result,St(r,!0,e),T=r.input.charCodeAt(r.position),(d||r.line===n)&&T===58&&(h=!0,T=r.input.charCodeAt(++r.position),St(r,!0,e),Ui(r,e,Ko,!1,!0),A=r.result),p?zi(r,a,m,w,y,A,n,i,s):h?a.push(zi(r,null,m,w,y,A,n,i,s)):a.push(y),St(r,!0,e),T=r.input.charCodeAt(r.position),T===44?(t=!0,T=r.input.charCodeAt(++r.position)):t=!1}xe(r,"unexpected end of the stream within a flow collection")}function r1(r,e){var t,n,i=Ql,s=!1,o=!1,a=e,l=0,c=!1,u,h;if(h=r.input.charCodeAt(r.position),h===124)n=!1;else if(h===62)n=!0;else return!1;for(r.kind="scalar",r.result="";h!==0;)if(h=r.input.charCodeAt(++r.position),h===43||h===45)Ql===i?i=h===43?qf:zb:xe(r,"repeat of a chomping mode identifier");else if((u=Qb(h))>=0)u===0?xe(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?xe(r,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(pi(h)){do h=r.input.charCodeAt(++r.position);while(pi(h));if(h===35)do h=r.input.charCodeAt(++r.position);while(!Qr(h)&&h!==0)}for(;h!==0;){for(Xl(r),r.lineIndent=0,h=r.input.charCodeAt(r.position);(!o||r.lineIndent<a)&&h===32;)r.lineIndent++,h=r.input.charCodeAt(++r.position);if(!o&&r.lineIndent>a&&(a=r.lineIndent),Qr(h)){l++;continue}if(r.lineIndent<a){i===qf?r.result+=Ne.repeat(`
26
+ `,s?1+l:l):i===Ql&&s&&(r.result+=`
27
+ `);break}for(n?pi(h)?(c=!0,r.result+=Ne.repeat(`
28
+ `,s?1+l:l)):c?(c=!1,r.result+=Ne.repeat(`
29
+ `,l+1)):l===0?s&&(r.result+=" "):r.result+=Ne.repeat(`
30
+ `,l):r.result+=Ne.repeat(`
31
+ `,s?1+l:l),s=!0,o=!0,l=0,t=r.position;!Qr(h)&&h!==0;)h=r.input.charCodeAt(++r.position);Vn(r,t,r.position,!1)}return!0}function ch(r,e){var t,n=r.tag,i=r.anchor,s=[],o,a=!1,l;if(r.firstTabInLine!==-1)return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),l=r.input.charCodeAt(r.position);l!==0&&(r.firstTabInLine!==-1&&(r.position=r.firstTabInLine,xe(r,"tab characters must not be used in indentation")),!(l!==45||(o=r.input.charCodeAt(r.position+1),!or(o))));){if(a=!0,r.position++,St(r,!0,-1)&&r.lineIndent<=e){s.push(null),l=r.input.charCodeAt(r.position);continue}if(t=r.line,Ui(r,e,_f,!1,!0),s.push(r.result),St(r,!0,-1),l=r.input.charCodeAt(r.position),(r.line===t||r.lineIndent>e)&&l!==0)xe(r,"bad indentation of a sequence entry");else if(r.lineIndent<e)break}return a?(r.tag=n,r.anchor=i,r.kind="sequence",r.result=s,!0):!1}function n1(r,e,t){var n,i,s,o,a,l,c=r.tag,u=r.anchor,h={},d=Object.create(null),p=null,m=null,y=null,w=!1,A=!1,T;if(r.firstTabInLine!==-1)return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=h),T=r.input.charCodeAt(r.position);T!==0;){if(!w&&r.firstTabInLine!==-1&&(r.position=r.firstTabInLine,xe(r,"tab characters must not be used in indentation")),n=r.input.charCodeAt(r.position+1),s=r.line,(T===63||T===58)&&or(n))T===63?(w&&(zi(r,h,d,p,m,null,o,a,l),p=m=y=null),A=!0,w=!0,i=!0):w?(w=!1,i=!0):xe(r,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),r.position+=1,T=n;else{if(o=r.line,a=r.lineStart,l=r.position,!Ui(r,t,Zf,!1,!0))break;if(r.line===s){for(T=r.input.charCodeAt(r.position);pi(T);)T=r.input.charCodeAt(++r.position);if(T===58)T=r.input.charCodeAt(++r.position),or(T)||xe(r,"a whitespace character is expected after the key-value separator within a block mapping"),w&&(zi(r,h,d,p,m,null,o,a,l),p=m=y=null),A=!0,w=!1,i=!1,p=r.tag,m=r.result;else if(A)xe(r,"can not read an implicit mapping pair; a colon is missed");else return r.tag=c,r.anchor=u,!0}else if(A)xe(r,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.tag=c,r.anchor=u,!0}if((r.line===s||r.lineIndent>e)&&(w&&(o=r.line,a=r.lineStart,l=r.position),Ui(r,e,Yo,!0,i)&&(w?m=r.result:y=r.result),w||(zi(r,h,d,p,m,y,o,a,l),p=m=y=null),St(r,!0,-1),T=r.input.charCodeAt(r.position)),(r.line===s||r.lineIndent>e)&&T!==0)xe(r,"bad indentation of a mapping entry");else if(r.lineIndent<e)break}return w&&zi(r,h,d,p,m,null,o,a,l),A&&(r.tag=c,r.anchor=u,r.kind="mapping",r.result=h),A}function i1(r){var e,t=!1,n=!1,i,s,o;if(o=r.input.charCodeAt(r.position),o!==33)return!1;if(r.tag!==null&&xe(r,"duplication of a tag property"),o=r.input.charCodeAt(++r.position),o===60?(t=!0,o=r.input.charCodeAt(++r.position)):o===33?(n=!0,i="!!",o=r.input.charCodeAt(++r.position)):i="!",e=r.position,t){do o=r.input.charCodeAt(++r.position);while(o!==0&&o!==62);r.position<r.length?(s=r.input.slice(e,r.position),o=r.input.charCodeAt(++r.position)):xe(r,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!or(o);)o===33&&(n?xe(r,"tag suffix cannot contain exclamation marks"):(i=r.input.slice(e-1,r.position+1),eh.test(i)||xe(r,"named tag handle cannot contain such characters"),n=!0,e=r.position+1)),o=r.input.charCodeAt(++r.position);s=r.input.slice(e,r.position),Kb.test(s)&&xe(r,"tag suffix cannot contain flow indicator characters")}s&&!th.test(s)&&xe(r,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{xe(r,"tag name is malformed: "+s)}return t?r.tag=s:jn.call(r.tagMap,i)?r.tag=r.tagMap[i]+s:i==="!"?r.tag="!"+s:i==="!!"?r.tag="tag:yaml.org,2002:"+s:xe(r,'undeclared tag handle "'+i+'"'),!0}function s1(r){var e,t;if(t=r.input.charCodeAt(r.position),t!==38)return!1;for(r.anchor!==null&&xe(r,"duplication of an anchor property"),t=r.input.charCodeAt(++r.position),e=r.position;t!==0&&!or(t)&&!$i(t);)t=r.input.charCodeAt(++r.position);return r.position===e&&xe(r,"name of an anchor node must contain at least one character"),r.anchor=r.input.slice(e,r.position),!0}function o1(r){var e,t,n;if(n=r.input.charCodeAt(r.position),n!==42)return!1;for(n=r.input.charCodeAt(++r.position),e=r.position;n!==0&&!or(n)&&!$i(n);)n=r.input.charCodeAt(++r.position);return r.position===e&&xe(r,"name of an alias node must contain at least one character"),t=r.input.slice(e,r.position),jn.call(r.anchorMap,t)||xe(r,'unidentified alias "'+t+'"'),r.result=r.anchorMap[t],St(r,!0,-1),!0}function Ui(r,e,t,n,i){var s,o,a,l=1,c=!1,u=!1,h,d,p,m,y,w;if(r.listener!==null&&r.listener("open",r),r.tag=null,r.anchor=null,r.kind=null,r.result=null,s=o=a=Yo===t||_f===t,n&&St(r,!0,-1)&&(c=!0,r.lineIndent>e?l=1:r.lineIndent===e?l=0:r.lineIndent<e&&(l=-1)),l===1)for(;i1(r)||s1(r);)St(r,!0,-1)?(c=!0,a=s,r.lineIndent>e?l=1:r.lineIndent===e?l=0:r.lineIndent<e&&(l=-1)):a=!1;if(a&&(a=c||i),(l===1||Yo===t)&&(Ko===t||Zf===t?y=e:y=e+1,w=r.position-r.lineStart,l===1?a&&(ch(r,w)||n1(r,w,y))||t1(r,y)?u=!0:(o&&r1(r,y)||qb(r,y)||e1(r,y)?u=!0:o1(r)?(u=!0,(r.tag!==null||r.anchor!==null)&&xe(r,"alias node should not have any properties")):_b(r,y,Ko===t)&&(u=!0,r.tag===null&&(r.tag="?")),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):l===0&&(u=a&&ch(r,w))),r.tag===null)r.anchor!==null&&(r.anchorMap[r.anchor]=r.result);else if(r.tag==="?"){for(r.result!==null&&r.kind!=="scalar"&&xe(r,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+r.kind+'"'),h=0,d=r.implicitTypes.length;h<d;h+=1)if(m=r.implicitTypes[h],m.resolve(r.result)){r.result=m.construct(r.result),r.tag=m.tag,r.anchor!==null&&(r.anchorMap[r.anchor]=r.result);break}}else if(r.tag!=="!"){if(jn.call(r.typeMap[r.kind||"fallback"],r.tag))m=r.typeMap[r.kind||"fallback"][r.tag];else for(m=null,p=r.typeMap.multi[r.kind||"fallback"],h=0,d=p.length;h<d;h+=1)if(r.tag.slice(0,p[h].tag.length)===p[h].tag){m=p[h];break}m||xe(r,"unknown tag !<"+r.tag+">"),r.result!==null&&m.kind!==r.kind&&xe(r,"unacceptable node kind for !<"+r.tag+'> tag; it should be "'+m.kind+'", not "'+r.kind+'"'),m.resolve(r.result,r.tag)?(r.result=m.construct(r.result,r.tag),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):xe(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")}return r.listener!==null&&r.listener("close",r),r.tag!==null||r.anchor!==null||u}function a1(r){var e=r.position,t,n,i,s=!1,o;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap=Object.create(null),r.anchorMap=Object.create(null);(o=r.input.charCodeAt(r.position))!==0&&(St(r,!0,-1),o=r.input.charCodeAt(r.position),!(r.lineIndent>0||o!==37));){for(s=!0,o=r.input.charCodeAt(++r.position),t=r.position;o!==0&&!or(o);)o=r.input.charCodeAt(++r.position);for(n=r.input.slice(t,r.position),i=[],n.length<1&&xe(r,"directive name must not be less than one character in length");o!==0;){for(;pi(o);)o=r.input.charCodeAt(++r.position);if(o===35){do o=r.input.charCodeAt(++r.position);while(o!==0&&!Qr(o));break}if(Qr(o))break;for(t=r.position;o!==0&&!or(o);)o=r.input.charCodeAt(++r.position);i.push(r.input.slice(t,r.position))}o!==0&&Xl(r),jn.call(ah,n)?ah[n](r,n,i):Jo(r,'unknown document directive "'+n+'"')}if(St(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,St(r,!0,-1)):s&&xe(r,"directives end mark is expected"),Ui(r,r.lineIndent-1,Yo,!1,!0),St(r,!0,-1),r.checkLineBreaks&&Gb.test(r.input.slice(e,r.position))&&Jo(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&Qo(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,St(r,!0,-1));return}if(r.position<r.length-1)xe(r,"end of the stream or a document separator is expected");else return}function uh(r,e){r=String(r),e=e||{},r.length!==0&&(r.charCodeAt(r.length-1)!==10&&r.charCodeAt(r.length-1)!==13&&(r+=`
32
+ `),r.charCodeAt(0)===65279&&(r=r.slice(1)));var t=new Zb(r,e),n=r.indexOf("\0");for(n!==-1&&(t.position=n,xe(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)a1(t);return t.documents}function l1(r,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);var n=uh(r,t);if(typeof e!="function")return n;for(var i=0,s=n.length;i<s;i+=1)e(n[i])}function c1(r,e){var t=uh(r,e);if(t.length!==0){if(t.length===1)return t[0];throw new ht("expected a single document in the stream, but found more")}}var u1=l1,f1=c1,fh={loadAll:u1,load:f1},hh=Object.prototype.toString,dh=Object.prototype.hasOwnProperty,_l=65279,h1=9,Ds=10,d1=13,p1=32,g1=33,m1=34,ql=35,v1=37,y1=38,b1=39,x1=42,ph=44,w1=45,Xo=58,S1=61,k1=62,A1=63,C1=64,gh=91,mh=93,O1=96,vh=123,E1=124,yh=125,zt={};zt[0]="\\0",zt[7]="\\a",zt[8]="\\b",zt[9]="\\t",zt[10]="\\n",zt[11]="\\v",zt[12]="\\f",zt[13]="\\r",zt[27]="\\e",zt[34]='\\"',zt[92]="\\\\",zt[133]="\\N",zt[160]="\\_",zt[8232]="\\L",zt[8233]="\\P";var T1=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],P1=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function M1(r,e){var t,n,i,s,o,a,l;if(e===null)return{};for(t={},n=Object.keys(e),i=0,s=n.length;i<s;i+=1)o=n[i],a=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=r.compiledTypeMap.fallback[o],l&&dh.call(l.styleAliases,a)&&(a=l.styleAliases[a]),t[o]=a;return t}function I1(r){var e,t,n;if(e=r.toString(16).toUpperCase(),r<=255)t="x",n=2;else if(r<=65535)t="u",n=4;else if(r<=4294967295)t="U",n=8;else throw new ht("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+Ne.repeat("0",n-e.length)+e}var D1=1,Ns=2;function N1(r){this.schema=r.schema||Jl,this.indent=Math.max(1,r.indent||2),this.noArrayIndent=r.noArrayIndent||!1,this.skipInvalid=r.skipInvalid||!1,this.flowLevel=Ne.isNothing(r.flowLevel)?-1:r.flowLevel,this.styleMap=M1(this.schema,r.styles||null),this.sortKeys=r.sortKeys||!1,this.lineWidth=r.lineWidth||80,this.noRefs=r.noRefs||!1,this.noCompatMode=r.noCompatMode||!1,this.condenseFlow=r.condenseFlow||!1,this.quotingType=r.quotingType==='"'?Ns:D1,this.forceQuotes=r.forceQuotes||!1,this.replacer=typeof r.replacer=="function"?r.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function bh(r,e){for(var t=Ne.repeat(" ",e),n=0,i=-1,s="",o,a=r.length;n<a;)i=r.indexOf(`
33
+ `,n),i===-1?(o=r.slice(n),n=a):(o=r.slice(n,i+1),n=i+1),o.length&&o!==`
34
+ `&&(s+=t),s+=o;return s}function ec(r,e){return`
35
+ `+Ne.repeat(" ",r.indent*e)}function R1(r,e){var t,n,i;for(t=0,n=r.implicitTypes.length;t<n;t+=1)if(i=r.implicitTypes[t],i.resolve(e))return!0;return!1}function Zo(r){return r===p1||r===h1}function Rs(r){return 32<=r&&r<=126||161<=r&&r<=55295&&r!==8232&&r!==8233||57344<=r&&r<=65533&&r!==_l||65536<=r&&r<=1114111}function xh(r){return Rs(r)&&r!==_l&&r!==d1&&r!==Ds}function wh(r,e,t){var n=xh(r),i=n&&!Zo(r);return(t?n:n&&r!==ph&&r!==gh&&r!==mh&&r!==vh&&r!==yh)&&r!==ql&&!(e===Xo&&!i)||xh(e)&&!Zo(e)&&r===ql||e===Xo&&i}function L1(r){return Rs(r)&&r!==_l&&!Zo(r)&&r!==w1&&r!==A1&&r!==Xo&&r!==ph&&r!==gh&&r!==mh&&r!==vh&&r!==yh&&r!==ql&&r!==y1&&r!==x1&&r!==g1&&r!==E1&&r!==S1&&r!==k1&&r!==b1&&r!==m1&&r!==v1&&r!==C1&&r!==O1}function B1(r){return!Zo(r)&&r!==Xo}function Ls(r,e){var t=r.charCodeAt(e),n;return t>=55296&&t<=56319&&e+1<r.length&&(n=r.charCodeAt(e+1),n>=56320&&n<=57343)?(t-55296)*1024+n-56320+65536:t}function Sh(r){var e=/^\n* /;return e.test(r)}var kh=1,tc=2,Ah=3,Ch=4,Gi=5;function F1(r,e,t,n,i,s,o,a){var l,c=0,u=null,h=!1,d=!1,p=n!==-1,m=-1,y=L1(Ls(r,0))&&B1(Ls(r,r.length-1));if(e||o)for(l=0;l<r.length;c>=65536?l+=2:l++){if(c=Ls(r,l),!Rs(c))return Gi;y=y&&wh(c,u,a),u=c}else{for(l=0;l<r.length;c>=65536?l+=2:l++){if(c=Ls(r,l),c===Ds)h=!0,p&&(d=d||l-m-1>n&&r[m+1]!==" ",m=l);else if(!Rs(c))return Gi;y=y&&wh(c,u,a),u=c}d=d||p&&l-m-1>n&&r[m+1]!==" "}return!h&&!d?y&&!o&&!i(r)?kh:s===Ns?Gi:tc:t>9&&Sh(r)?Gi:o?s===Ns?Gi:tc:d?Ch:Ah}function j1(r,e,t,n,i){r.dump=function(){if(e.length===0)return r.quotingType===Ns?'""':"''";if(!r.noCompatMode&&(T1.indexOf(e)!==-1||P1.test(e)))return r.quotingType===Ns?'"'+e+'"':"'"+e+"'";var s=r.indent*Math.max(1,t),o=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-s),a=n||r.flowLevel>-1&&t>=r.flowLevel;function l(c){return R1(r,c)}switch(F1(e,a,r.indent,o,l,r.quotingType,r.forceQuotes&&!n,i)){case kh:return e;case tc:return"'"+e.replace(/'/g,"''")+"'";case Ah:return"|"+Oh(e,r.indent)+Eh(bh(e,s));case Ch:return">"+Oh(e,r.indent)+Eh(bh(V1(e,o),s));case Gi:return'"'+W1(e)+'"';default:throw new ht("impossible error: invalid scalar style")}}()}function Oh(r,e){var t=Sh(r)?String(e):"",n=r[r.length-1]===`
36
+ `,i=n&&(r[r.length-2]===`
37
+ `||r===`
38
+ `),s=i?"+":n?"":"-";return t+s+`
39
+ `}function Eh(r){return r[r.length-1]===`
40
+ `?r.slice(0,-1):r}function V1(r,e){for(var t=/(\n+)([^\n]*)/g,n=function(){var c=r.indexOf(`
41
+ `);return c=c!==-1?c:r.length,t.lastIndex=c,Th(r.slice(0,c),e)}(),i=r[0]===`
42
+ `||r[0]===" ",s,o;o=t.exec(r);){var a=o[1],l=o[2];s=l[0]===" ",n+=a+(!i&&!s&&l!==""?`
43
+ `:"")+Th(l,e),i=s}return n}function Th(r,e){if(r===""||r[0]===" ")return r;for(var t=/ [^ ]/g,n,i=0,s,o=0,a=0,l="";n=t.exec(r);)a=n.index,a-i>e&&(s=o>i?o:a,l+=`
44
+ `+r.slice(i,s),i=s+1),o=a;return l+=`
45
+ `,r.length-i>e&&o>i?l+=r.slice(i,o)+`
46
+ `+r.slice(o+1):l+=r.slice(i),l.slice(1)}function W1(r){for(var e="",t=0,n,i=0;i<r.length;t>=65536?i+=2:i++)t=Ls(r,i),n=zt[t],!n&&Rs(t)?(e+=r[i],t>=65536&&(e+=r[i+1])):e+=n||I1(t);return e}function $1(r,e,t){var n="",i=r.tag,s,o,a;for(s=0,o=t.length;s<o;s+=1)a=t[s],r.replacer&&(a=r.replacer.call(t,String(s),a)),(Sn(r,e,a,!1,!1)||typeof a>"u"&&Sn(r,e,null,!1,!1))&&(n!==""&&(n+=","+(r.condenseFlow?"":" ")),n+=r.dump);r.tag=i,r.dump="["+n+"]"}function Ph(r,e,t,n){var i="",s=r.tag,o,a,l;for(o=0,a=t.length;o<a;o+=1)l=t[o],r.replacer&&(l=r.replacer.call(t,String(o),l)),(Sn(r,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&Sn(r,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=ec(r,e)),r.dump&&Ds===r.dump.charCodeAt(0)?i+="-":i+="- ",i+=r.dump);r.tag=s,r.dump=i||"[]"}function H1(r,e,t){var n="",i=r.tag,s=Object.keys(t),o,a,l,c,u;for(o=0,a=s.length;o<a;o+=1)u="",n!==""&&(u+=", "),r.condenseFlow&&(u+='"'),l=s[o],c=t[l],r.replacer&&(c=r.replacer.call(t,l,c)),Sn(r,e,l,!1,!1)&&(r.dump.length>1024&&(u+="? "),u+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),Sn(r,e,c,!1,!1)&&(u+=r.dump,n+=u));r.tag=i,r.dump="{"+n+"}"}function z1(r,e,t,n){var i="",s=r.tag,o=Object.keys(t),a,l,c,u,h,d;if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new ht("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)d="",(!n||i!=="")&&(d+=ec(r,e)),c=o[a],u=t[c],r.replacer&&(u=r.replacer.call(t,c,u)),Sn(r,e+1,c,!0,!0,!0)&&(h=r.tag!==null&&r.tag!=="?"||r.dump&&r.dump.length>1024,h&&(r.dump&&Ds===r.dump.charCodeAt(0)?d+="?":d+="? "),d+=r.dump,h&&(d+=ec(r,e)),Sn(r,e+1,u,!0,h)&&(r.dump&&Ds===r.dump.charCodeAt(0)?d+=":":d+=": ",d+=r.dump,i+=d));r.tag=s,r.dump=i||"{}"}function Mh(r,e,t){var n,i,s,o,a,l;for(i=t?r.explicitTypes:r.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(t?a.multi&&a.representName?r.tag=a.representName(e):r.tag=a.tag:r.tag="?",a.represent){if(l=r.styleMap[a.tag]||a.defaultStyle,hh.call(a.represent)==="[object Function]")n=a.represent(e,l);else if(dh.call(a.represent,l))n=a.represent[l](e,l);else throw new ht("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');r.dump=n}return!0}return!1}function Sn(r,e,t,n,i,s,o){r.tag=null,r.dump=t,Mh(r,t,!1)||Mh(r,t,!0);var a=hh.call(r.dump),l=n,c;n&&(n=r.flowLevel<0||r.flowLevel>e);var u=a==="[object Object]"||a==="[object Array]",h,d;if(u&&(h=r.duplicates.indexOf(t),d=h!==-1),(r.tag!==null&&r.tag!=="?"||d||r.indent!==2&&e>0)&&(i=!1),d&&r.usedDuplicates[h])r.dump="*ref_"+h;else{if(u&&d&&!r.usedDuplicates[h]&&(r.usedDuplicates[h]=!0),a==="[object Object]")n&&Object.keys(r.dump).length!==0?(z1(r,e,r.dump,i),d&&(r.dump="&ref_"+h+r.dump)):(H1(r,e,r.dump),d&&(r.dump="&ref_"+h+" "+r.dump));else if(a==="[object Array]")n&&r.dump.length!==0?(r.noArrayIndent&&!o&&e>0?Ph(r,e-1,r.dump,i):Ph(r,e,r.dump,i),d&&(r.dump="&ref_"+h+r.dump)):($1(r,e,r.dump),d&&(r.dump="&ref_"+h+" "+r.dump));else if(a==="[object String]")r.tag!=="?"&&j1(r,r.dump,e,s,l);else{if(a==="[object Undefined]")return!1;if(r.skipInvalid)return!1;throw new ht("unacceptable kind of an object to dump "+a)}r.tag!==null&&r.tag!=="?"&&(c=encodeURI(r.tag[0]==="!"?r.tag.slice(1):r.tag).replace(/!/g,"%21"),r.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",r.dump=c+" "+r.dump)}return!0}function U1(r,e){var t=[],n=[],i,s;for(rc(r,t,n),i=0,s=n.length;i<s;i+=1)e.duplicates.push(t[n[i]]);e.usedDuplicates=new Array(s)}function rc(r,e,t){var n,i,s;if(r!==null&&typeof r=="object")if(i=e.indexOf(r),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(e.push(r),Array.isArray(r))for(i=0,s=r.length;i<s;i+=1)rc(r[i],e,t);else for(n=Object.keys(r),i=0,s=n.length;i<s;i+=1)rc(r[n[i]],e,t)}function G1(r,e){e=e||{};var t=new N1(e);t.noRefs||U1(r,t);var n=r;return t.replacer&&(n=t.replacer.call({"":n},"",n)),Sn(t,0,n,!0,!0)?t.dump+`
47
+ `:""}var K1=G1,Y1={dump:K1};function nc(r,e){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var J1=dt,Q1=xn,X1=Wr,Z1=Bn,_1=Li,q1=Jl,ex=fh.load,tx=fh.loadAll,rx=Y1.dump,nx=ht,ix={binary:Uo,float:Ps,map:Nn,null:Ce,pairs:Qf,set:Xf,timestamp:Fi,bool:Z,int:Ht,merge:ji,omap:Jf,seq:fi,str:Dn},sx=nc("safeLoad","load"),ox=nc("safeLoadAll","loadAll"),ax=nc("safeDump","dump"),lx={Type:J1,Schema:Q1,FAILSAFE_SCHEMA:X1,JSON_SCHEMA:Z1,CORE_SCHEMA:_1,DEFAULT_SCHEMA:q1,load:ex,loadAll:tx,dump:rx,YAMLException:nx,types:ix,safeLoad:sx,safeLoadAll:ox,safeDump:ax};const cx=lx,ux=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:window}(),{FormData:Ih,Blob:_o,File:Dh}=ux,fx=r=>":/?#[]@!$&'()*+,;=".indexOf(r)>-1,hx=r=>/^[a-z0-9\-._~]+$/i.test(r);function Ki(r){let{escape:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;return typeof r=="number"&&(r=r.toString()),typeof r!="string"||!r.length||!e?r:t?JSON.parse(r):[...r].map(n=>{if(hx(n)||fx(n)&&e==="unsafe")return n;const i=new TextEncoder;return Array.from(i.encode(n)).map(o=>`0${o.toString(16).toUpperCase()}`.slice(-2)).map(o=>`%${o}`).join("")}).join("")}function ic(r){const{value:e}=r;return Array.isArray(e)?dx(r):typeof e=="object"?px(r):gx(r)}function dx(r){let{key:e,value:t,style:n,explode:i,escape:s}=r;const o=a=>Ki(a,{escape:s});if(n==="simple")return t.map(a=>o(a)).join(",");if(n==="label")return`.${t.map(a=>o(a)).join(".")}`;if(n==="matrix")return t.map(a=>o(a)).reduce((a,l)=>!a||i?`${a||""};${e}=${l}`:`${a},${l}`,"");if(n==="form"){const a=i?`&${e}=`:",";return t.map(l=>o(l)).join(a)}if(n==="spaceDelimited"){const a=i?`${e}=`:"";return t.map(l=>o(l)).join(` ${a}`)}if(n==="pipeDelimited"){const a=i?`${e}=`:"";return t.map(l=>o(l)).join(`|${a}`)}}function px(r){let{key:e,value:t,style:n,explode:i,escape:s}=r;const o=l=>Ki(l,{escape:s}),a=Object.keys(t);if(n==="simple")return a.reduce((l,c)=>{const u=o(t[c]),h=i?"=":",";return`${l?`${l},`:""}${c}${h}${u}`},"");if(n==="label")return a.reduce((l,c)=>{const u=o(t[c]),h=i?"=":".";return`${l?`${l}.`:"."}${c}${h}${u}`},"");if(n==="matrix"&&i)return a.reduce((l,c)=>{const u=o(t[c]);return`${l?`${l};`:";"}${c}=${u}`},"");if(n==="matrix")return a.reduce((l,c)=>{const u=o(t[c]);return`${l?`${l},`:`;${e}=`}${c},${u}`},"");if(n==="form")return a.reduce((l,c)=>{const u=o(t[c]);return`${l?`${l}${i?"&":","}`:""}${c}${i?"=":","}${u}`},"")}function gx(r){let{key:e,value:t,style:n,escape:i}=r;const s=o=>Ki(o,{escape:i});if(n==="simple")return s(t);if(n==="label")return`.${s(t)}`;if(n==="matrix")return`;${e}=${s(t)}`;if(n==="form")return s(t);if(n==="deepObject")return s(t,{},!0)}const mx=(r,e)=>{e.body=r},sc={serializeRes:xx,mergeInQueryOrForm:Fh};async function vx(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof r=="object"&&(e=r,r=e.url),e.headers=e.headers||{},sc.mergeInQueryOrForm(e),e.headers&&Object.keys(e.headers).forEach(i=>{const s=e.headers[i];typeof s=="string"&&(e.headers[i]=s.replace(/\n+/g," "))}),e.requestInterceptor&&(e=await e.requestInterceptor(e)||e);const t=e.headers["content-type"]||e.headers["Content-Type"];/multipart\/form-data/i.test(t)&&e.body instanceof Ih&&(delete e.headers["content-type"],delete e.headers["Content-Type"]);let n;try{n=await(e.userFetch||fetch)(e.url,e),n=await sc.serializeRes(n,r,e),e.responseInterceptor&&(n=await e.responseInterceptor(n)||n)}catch(i){if(!n)throw i;const s=new Error(n.statusText||`response status is ${n.status}`);throw s.status=n.status,s.statusCode=n.status,s.responseError=i,s}if(!n.ok){const i=new Error(n.statusText||`response status is ${n.status}`);throw i.status=n.status,i.statusCode=n.status,i.response=n,i}return n}const yx=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(r)};function bx(r,e){return e&&(e.indexOf("application/json")===0||e.indexOf("+json")>0)?JSON.parse(r):cx.load(r)}function xx(r,e){let{loadSpec:t=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n={ok:r.ok,url:r.url||e,status:r.status,statusText:r.statusText,headers:Sx(r.headers)},i=n.headers["content-type"],s=t||yx(i);return(s?r.text:r.blob||r.buffer).call(r).then(a=>{if(n.text=a,n.data=a,s)try{const l=bx(a,i);n.body=l,n.obj=l}catch(l){n.parseError=l}return n})}function wx(r){return r.includes(", ")?r.split(", "):r}function Sx(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return typeof r.entries!="function"?{}:Array.from(r.entries()).reduce((e,t)=>{let[n,i]=t;return e[n]=wx(i),e},{})}function oc(r,e){return!e&&typeof navigator<"u"&&(e=navigator),e&&e.product==="ReactNative"?!!(r&&typeof r=="object"&&typeof r.uri=="string"):typeof Dh<"u"&&r instanceof Dh||typeof _o<"u"&&r instanceof _o||ArrayBuffer.isView(r)?!0:r!==null&&typeof r=="object"&&typeof r.pipe=="function"}function Nh(r,e){return Array.isArray(r)&&r.some(t=>oc(t,e))}const kx={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Ax={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function Rh(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{collectionFormat:n,allowEmptyValue:i,serializationOption:s,encoding:o}=e,a=typeof e=="object"&&!Array.isArray(e)?e.value:e,l=t?u=>u.toString():u=>encodeURIComponent(u),c=l(r);if(typeof a>"u"&&i)return[[c,""]];if(oc(a)||Nh(a))return[[c,a]];if(s)return Lh(r,a,t,s);if(o){if([typeof o.style,typeof o.explode,typeof o.allowReserved].some(u=>u!=="undefined")){const{style:u,explode:h,allowReserved:d}=o;return Lh(r,a,t,{style:u,explode:h,allowReserved:d})}if(o.contentType){if(o.contentType==="application/json"){const u=typeof a=="string"?a:JSON.stringify(a);return[[c,l(u)]]}return[[c,l(a.toString())]]}return typeof a!="object"?[[c,l(a)]]:Array.isArray(a)&&a.every(u=>typeof u!="object")?[[c,a.map(l).join(",")]]:[[c,l(JSON.stringify(a))]]}return typeof a!="object"?[[c,l(a)]]:Array.isArray(a)?n==="multi"?[[c,a.map(l)]]:[[c,a.map(l).join(Ax[n||"csv"])]]:[[c,""]]}function Lh(r,e,t,n){const i=n.style||"form",s=typeof n.explode>"u"?i==="form":n.explode,o=t?!1:n&&n.allowReserved?"unsafe":"reserved",a=c=>Ki(c,{escape:o}),l=t?c=>c:c=>Ki(c,{escape:o});return typeof e!="object"?[[l(r),a(e)]]:Array.isArray(e)?s?[[l(r),e.map(a)]]:[[l(r),e.map(a).join(kx[i])]]:i==="deepObject"?Object.keys(e).map(c=>[l(`${r}[${c}]`),a(e[c])]):s?Object.keys(e).map(c=>[l(c),a(e[c])]):[[l(r),Object.keys(e).map(c=>[`${l(c)},${a(e[c])}`]).join(",")]]}function Cx(r){return Object.entries(r).reduce((e,t)=>{let[n,i]=t;for(const[s,o]of Rh(n,i,!0))if(Array.isArray(o))for(const a of o)if(ArrayBuffer.isView(a)){const l=new _o([a]);e.append(s,l)}else e.append(s,a);else if(ArrayBuffer.isView(o)){const a=new _o([o]);e.append(s,a)}else e.append(s,o);return e},new Ih)}function Bh(r){const e=Object.keys(r).reduce((t,n)=>{for(const[i,s]of Rh(n,r[n]))t[i]=s;return t},{});return $e().stringify(e,{encode:!1,indices:!1})||""}function Fh(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{url:e="",query:t,form:n}=r,i=function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];const l=o.filter(c=>c).join("&");return l?`?${l}`:""};if(n){const s=Object.keys(n).some(a=>{const{value:l}=n[a];return oc(l)||Nh(l)}),o=r.headers["content-type"]||r.headers["Content-Type"];if(s||/multipart\/form-data/i.test(o)){const a=Cx(r.form);mx(a,r)}else r.body=Bh(n);delete r.form}if(t){const[s,o]=e.split("?");let a="";if(o){const c=$e().parse(o);Object.keys(t).forEach(h=>delete c[h]),a=$e().stringify(c,{encode:!0})}const l=i(a,Bh(t));r.url=s+l,delete r.query}return r}function UI(r,e,t){return t=t||(n=>n),e=e||(n=>n),n=>(typeof n=="string"&&(n={url:n}),sc.mergeInQueryOrForm(n),n=e(n),t(r(n)))}function Ox(r,e){function t(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];[this.message]=i,e&&e.apply(this,i)}return t.prototype=new Error,t.prototype.name=r,t.prototype.constructor=t,t}const Ex={body:Tx,header:Mx,query:Dx,path:Ix,formData:Px};function Tx(r){let{req:e,value:t}=r;e.body=t}function Px(r){let{req:e,value:t,parameter:n}=r;(t||n.allowEmptyValue)&&(e.form=e.form||{},e.form[n.name]={value:t,allowEmptyValue:n.allowEmptyValue,collectionFormat:n.collectionFormat})}function Mx(r){let{req:e,parameter:t,value:n}=r;e.headers=e.headers||{},typeof n<"u"&&(e.headers[t.name]=n)}function Ix(r){let{req:e,value:t,parameter:n}=r;e.url=e.url.split(`{${n.name}}`).join(encodeURIComponent(t))}function Dx(r){let{req:e,value:t,parameter:n}=r;if(e.query=e.query||{},t===!1&&n.type==="boolean"&&(t="false"),t===0&&["number","integer"].indexOf(n.type)>-1&&(t="0"),t)e.query[n.name]={collectionFormat:n.collectionFormat,value:t};else if(n.allowEmptyValue&&t!==void 0){const i=n.name;e.query[i]=e.query[i]||{},e.query[i].allowEmptyValue=!0}}function qo(r,e){return e.includes("application/json")?typeof r=="string"?r:JSON.stringify(r):r.toString()}function Nx(r){let{req:e,value:t,parameter:n}=r;const{name:i,style:s,explode:o,content:a}=n;if(a){const c=Object.keys(a)[0];e.url=e.url.split(`{${i}}`).join(Ki(qo(t,c),{escape:!0}));return}const l=ic({key:n.name,value:t,style:s||"simple",explode:o||!1,escape:!0});e.url=e.url.split(`{${i}}`).join(l)}function Rx(r){let{req:e,value:t,parameter:n}=r;if(e.query=e.query||{},n.content){const i=Object.keys(n.content)[0],s=qo(t,i);if(s)e.query[n.name]=s;else if(n.allowEmptyValue&&t!==void 0){const o=n.name;e.query[o]=e.query[o]||{},e.query[o].allowEmptyValue=!0}return}if(t===!1&&(t="false"),t===0&&(t="0"),t){const{style:i,explode:s,allowReserved:o}=n;e.query[n.name]={value:t,serializationOption:{style:i,explode:s,allowReserved:o}}}else if(n.allowEmptyValue&&t!==void 0){const i=n.name;e.query[i]=e.query[i]||{},e.query[i].allowEmptyValue=!0}}const Lx=["accept","authorization","content-type"];function Bx(r){let{req:e,parameter:t,value:n}=r;if(e.headers=e.headers||{},!(Lx.indexOf(t.name.toLowerCase())>-1)){if(t.content){const i=Object.keys(t.content)[0];e.headers[t.name]=qo(n,i);return}typeof n<"u"&&(e.headers[t.name]=ic({key:t.name,value:n,style:t.style||"simple",explode:typeof t.explode>"u"?!1:t.explode,escape:!1}))}}function Fx(r){let{req:e,parameter:t,value:n}=r;e.headers=e.headers||{};const i=typeof n;if(t.content){const s=Object.keys(t.content)[0];e.headers.Cookie=`${t.name}=${qo(n,s)}`;return}if(i!=="undefined"){const s=i==="object"&&!Array.isArray(n)&&t.explode?"":`${t.name}=`;e.headers.Cookie=s+ic({key:t.name,value:n,escape:!1,style:t.style||"form",explode:typeof t.explode>"u"?!1:t.explode})}}const jx=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:window)(),{btoa:Vx}=jx,jh=Vx;function Wx(r,e){const{operation:t,requestBody:n,securities:i,spec:s,attachContentTypeForEmptyPayload:o}=r;let{requestContentType:a}=r;e=$x({request:e,securities:i,operation:t,spec:s});const l=t.requestBody||{},c=Object.keys(l.content||{}),u=a&&c.indexOf(a)>-1;if(n||o){if(a&&u)e.headers["Content-Type"]=a;else if(!a){const h=c[0];h&&(e.headers["Content-Type"]=h,a=h)}}else a&&u&&(e.headers["Content-Type"]=a);if(!r.responseContentType&&t.responses){const h=Object.entries(t.responses).filter(d=>{let[p,m]=d;const y=parseInt(p,10);return y>=200&&y<300&&pe(m.content)}).reduce((d,p)=>{let[,m]=p;return d.concat(Object.keys(m.content))},[]);h.length>0&&(e.headers.accept=h.join(", "))}if(n)if(a){if(c.indexOf(a)>-1)if(a==="application/x-www-form-urlencoded"||a==="multipart/form-data")if(typeof n=="object"){const h=(l.content[a]||{}).encoding||{};e.form={},Object.keys(n).forEach(d=>{e.form[d]={value:n[d],encoding:h[d]||{}}})}else e.form=n;else e.body=n}else e.body=n;return e}function $x(r){let{request:e,securities:t={},operation:n={},spec:i}=r;const s=ee({},e),{authorized:o={}}=t,a=n.security||i.security||[],l=o&&!!Object.keys(o).length,c=ce()(i,["components","securitySchemes"])||{};return s.headers=s.headers||{},s.query=s.query||{},!Object.keys(t).length||!l||!a||Array.isArray(n.security)&&!n.security.length?e:(a.forEach(u=>{Object.keys(u).forEach(h=>{const d=o[h],p=c[h];if(!d)return;const m=d.value||d,{type:y}=p;if(d){if(y==="apiKey")p.in==="query"&&(s.query[p.name]=m),p.in==="header"&&(s.headers[p.name]=m),p.in==="cookie"&&(s.cookies[p.name]=m);else if(y==="http"){if(/^basic$/i.test(p.scheme)){const w=m.username||"",A=m.password||"",T=jh(`${w}:${A}`);s.headers.Authorization=`Basic ${T}`}/^bearer$/i.test(p.scheme)&&(s.headers.Authorization=`Bearer ${m}`)}else if(y==="oauth2"||y==="openIdConnect"){const w=d.token||{},A=p["x-tokenName"]||"access_token",T=w[A];let P=w.token_type;(!P||P.toLowerCase()==="bearer")&&(P="Bearer"),s.headers.Authorization=`${P} ${T}`}}})}),s)}function Hx(r,e){const{spec:t,operation:n,securities:i,requestContentType:s,responseContentType:o,attachContentTypeForEmptyPayload:a}=r;if(e=zx({request:e,securities:i,operation:n,spec:t}),e.body||e.form||a)s?e.headers["Content-Type"]=s:Array.isArray(n.consumes)?[e.headers["Content-Type"]]=n.consumes:Array.isArray(t.consumes)?[e.headers["Content-Type"]]=t.consumes:n.parameters&&n.parameters.filter(l=>l.type==="file").length?e.headers["Content-Type"]="multipart/form-data":n.parameters&&n.parameters.filter(l=>l.in==="formData").length&&(e.headers["Content-Type"]="application/x-www-form-urlencoded");else if(s){const l=n.parameters&&n.parameters.filter(u=>u.in==="body").length>0,c=n.parameters&&n.parameters.filter(u=>u.in==="formData").length>0;(l||c)&&(e.headers["Content-Type"]=s)}return!o&&Array.isArray(n.produces)&&n.produces.length>0&&(e.headers.accept=n.produces.join(", ")),e}function zx(r){let{request:e,securities:t={},operation:n={},spec:i}=r;const s=ee({},e),{authorized:o={},specSecurity:a=[]}=t,l=n.security||a,c=o&&!!Object.keys(o).length,u=i.securityDefinitions;return s.headers=s.headers||{},s.query=s.query||{},!Object.keys(t).length||!c||!l||Array.isArray(n.security)&&!n.security.length?e:(l.forEach(h=>{Object.keys(h).forEach(d=>{const p=o[d];if(!p)return;const{token:m}=p,y=p.value||p,w=u[d],{type:A}=w,T=w["x-tokenName"]||"access_token",P=m&&m[T];let L=m&&m.token_type;if(p)if(A==="apiKey"){const D=w.in==="query"?"query":"headers";s[D]=s[D]||{},s[D][w.name]=y}else if(A==="basic")if(y.header)s.headers.authorization=y.header;else{const D=y.username||"",j=y.password||"";y.base64=jh(`${D}:${j}`),s.headers.authorization=`Basic ${y.base64}`}else A==="oauth2"&&P&&(L=!L||L.toLowerCase()==="bearer"?"Bearer":L,s.headers.authorization=`${L} ${P}`)})}),s)}function Vh(r,e){return`${e.toLowerCase()}-${r}`}function Ux(r,e,t){if(!r||typeof r!="object"||!r.paths||typeof r.paths!="object")return null;const{paths:n}=r;for(const i in n)for(const s in n[i]){if(s.toUpperCase()==="PARAMETERS")continue;const o=n[i][s];if(!o||typeof o!="object")continue;const a={spec:r,pathName:i,method:s.toUpperCase(),operation:o},l=e(a);if(t&&l)return a}}function Gx(r,e){return Ux(r,e,!0)||null}const Wh=r=>r.replace(/\W/gi,"_");function Kx(r,e){let{v2OperationIdCompatibilityMode:t}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t){let n=`${e.toLowerCase()}_${r}`.replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return n=n||`${r.substring(1)}_${e}`,n.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return`${e.toLowerCase()}${Wh(r)}`}function Yx(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",{v2OperationIdCompatibilityMode:n}=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return!r||typeof r!="object"?null:(r.operationId||"").replace(/\s/g,"").length?Wh(r.operationId):Kx(e,t,{v2OperationIdCompatibilityMode:n})}function Jx(r,e){return!r||!r.paths?null:Gx(r,t=>{let{pathName:n,method:i,operation:s}=t;if(!s||typeof s!="object")return!1;const o=s.operationId,a=Yx(s,n,i),l=Vh(n,i);return[a,l,o].some(c=>c&&c===e)})}const KI=r=>{try{const{swagger:e}=r;return e==="2.0"}catch{return!1}},Qx=r=>{try{const{openapi:e}=r;return typeof e=="string"&&/^3\.0\.([0123])(?:-rc[012])?$/.test(e)}catch{return!1}},Xx=r=>{try{const{openapi:e}=r;return typeof e=="string"&&/^3\.1\.(?:[1-9]\d*|0)$/.test(e)}catch{return!1}},$h=r=>Qx(r)||Xx(r),Zx=["http","fetch","spec","operationId","pathName","method","parameters","securities"],Hh=r=>Array.isArray(r)?r:[],_x=Ox("OperationNotFoundError",function(e,t,n){this.originalError=n,Object.assign(this,t||{})}),qx=(r,e)=>e.filter(t=>t.name===r),ew=r=>{const e={};r.forEach(n=>{e[n.in]||(e[n.in]={}),e[n.in][n.name]=n});const t=[];return Object.keys(e).forEach(n=>{Object.keys(e[n]).forEach(i=>{t.push(e[n][i])})}),t},tw={buildRequest:nw};function rw(r){let{http:e,fetch:t,spec:n,operationId:i,pathName:s,method:o,parameters:a,securities:l}=r,c=ne(r,Zx);const u=e||t||vx;s&&o&&!i&&(i=Vh(s,o));const h=tw.buildRequest(ee({spec:n,operationId:i,parameters:a,securities:l,http:u},c));return h.body&&(pe(h.body)||Array.isArray(h.body))&&(h.body=JSON.stringify(h.body)),u(h)}function nw(r){const{spec:e,operationId:t,responseContentType:n,scheme:i,requestInterceptor:s,responseInterceptor:o,contextUrl:a,userFetch:l,server:c,serverVariables:u,http:h,signal:d}=r;let{parameters:p,parameterBuilders:m}=r;const y=$h(e);m||(y?m=g:m=Ex);let A={url:"",credentials:h&&h.withCredentials?"include":"same-origin",headers:{},cookies:{}};d&&(A.signal=d),s&&(A.requestInterceptor=s),o&&(A.responseInterceptor=o),l&&(A.userFetch=l);const T=Jx(e,t);if(!T)throw new _x(`Operation ${t} not found`);const{operation:P={},method:L,pathName:D}=T;if(A.url+=iw({spec:e,scheme:i,contextUrl:a,server:c,serverVariables:u,pathName:D,method:L}),!t)return delete A.cookies,A;A.url+=D,A.method=`${L}`.toUpperCase(),p=p||{};const j=e.paths[D]||{};n&&(A.headers.accept=n);const W=ew([].concat(Hh(P.parameters)).concat(Hh(j.parameters)));W.forEach(F=>{const H=m[F.in];let Q;if(F.in==="body"&&F.schema&&F.schema.properties&&(Q=p),Q=F&&F.name&&p[F.name],typeof Q>"u"?Q=F&&F.name&&p[`${F.in}.${F.name}`]:qx(F.name,W).length>1&&console.warn(`Parameter '${F.name}' is ambiguous because the defined spec has more than one parameter with the name: '${F.name}' and the passed-in parameter values did not define an 'in' value.`),Q!==null){if(typeof F.default<"u"&&typeof Q>"u"&&(Q=F.default),typeof Q>"u"&&F.required&&!F.allowEmptyValue)throw new Error(`Required parameter ${F.name} is not provided`);if(y&&F.schema&&F.schema.type==="object"&&typeof Q=="string")try{Q=JSON.parse(Q)}catch{throw new Error("Could not parse object parameter value string as JSON")}H&&H({req:A,parameter:F,value:Q,operation:P,spec:e})}});const q=ee(ee({},r),{},{operation:P});if(y?A=Wx(q,A):A=Hx(q,A),A.cookies&&Object.keys(A.cookies).length){const F=Object.keys(A.cookies).reduce((H,Q)=>{const oe=A.cookies[Q],fe=H?"&":"",be=K.serialize(Q,oe);return H+fe+be},"");A.headers.Cookie=F}return A.cookies&&delete A.cookies,Fh(A),A}const ac=r=>r?r.replace(/\W/g,""):null;function iw(r){return $h(r.spec)?sw(r):lw(r)}function sw(r){let{spec:e,pathName:t,method:n,server:i,contextUrl:s,serverVariables:o={}}=r;const a=ce()(e,["paths",t,(n||"").toLowerCase(),"servers"])||ce()(e,["paths",t,"servers"])||ce()(e,["servers"]);let l="",c=null;if(i&&a&&a.length){const u=a.map(h=>h.url);u.indexOf(i)>-1&&(l=i,c=a[u.indexOf(i)])}return!l&&a&&a.length&&(l=a[0].url,[c]=a),l.indexOf("{")>-1&&aw(l).forEach(h=>{if(c.variables&&c.variables[h]){const d=c.variables[h],p=o[h]||d.default,m=new RegExp(`{${h}}`,"g");l=l.replace(m,p)}}),ow(l,s)}function ow(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const t=r&&e?V.parse(V.resolve(e,r)):V.parse(r),n=V.parse(e),i=ac(t.protocol)||ac(n.protocol)||"",s=t.host||n.host,o=t.pathname||"";let a;return i&&s?a=`${i}://${s+o}`:a=o,a[a.length-1]==="/"?a.slice(0,-1):a}function aw(r){const e=[],t=/{([^}]+)}/g;let n;for(;n=t.exec(r);)e.push(n[1]);return e}function lw(r){let{spec:e,scheme:t,contextUrl:n=""}=r;const i=V.parse(n),s=Array.isArray(e.schemes)?e.schemes[0]:null,o=t||s||ac(i.protocol)||"http",a=e.host||i.host||"",l=e.basePath||"";let c;return o&&a?c=`${o}://${a+l}`:c=l,c[c.length-1]==="/"?c.slice(0,-1):c}var S=f(29901),pt=f(20202),$r=f(44411),gt=f(88606),cw=f(81570),uw=f(74025),fw=f(2526),hw=Object.defineProperty,dw=Object.defineProperties,pw=Object.getOwnPropertyDescriptors,zh=Object.getOwnPropertySymbols,gw=Object.prototype.hasOwnProperty,mw=Object.prototype.propertyIsEnumerable,Uh=(r,e,t)=>e in r?hw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,vw=(r,e)=>{for(var t in e||(e={}))gw.call(e,t)&&Uh(r,t,e[t]);if(zh)for(var t of zh(e))mw.call(e,t)&&Uh(r,t,e[t]);return r},yw=(r,e)=>dw(r,pw(e)),bw=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});function xw(r,e){return bw(this,null,function*(){var t,n,i,s;const o=JSON.parse(JSON.stringify(e)),a=o.openapi?{openapi:o.openapi}:o.swagger?{swagger:o.swagger}:{},l=yw(vw({},a),{components:o.components,paths:{[r.path]:{[r.httpVerb]:(n=(t=o.paths)==null?void 0:t[r.path])==null?void 0:n[r.httpVerb],parameters:(s=(i=o.paths)==null?void 0:i[r.path])==null?void 0:s.parameters}}}),c=new uw.Config({}),u=(0,fw.I)(l),h={config:c,doc:u,dereference:!0};return yield(0,cw.bundle)(h),o})}var ww=f(98910),ea=f(84862),Xr=f(53134),Gh=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});const Kh=Object.values(Xr.FileUploadFormats),Sw=["application/octet-stream","application/pdf","application/gzip","application/zip"],Yh=["image/","audio/","video/"];function Jh(r){if(Yh.some(e=>r.startsWith(e)))return r}function ta(r){return Sw.includes(r)?!0:Yh.some(e=>r.startsWith(e))}function kw(r){const e=r.type==="array"?r.items:r;if(!e||!e.type||e?.type==="any")return!0;const t=e.contentMediaType||"",n=e.format||e.contentEncoding||(ta(t)?"binary":"");return e.type===Xr.DefinitionTypes.STRING&&Kh.includes(n)}function Qh(r,e){if(!r||!r.type||r.type==="any")return ta(e);const t=r.format||r.contentEncoding||"";return r.type===Xr.DefinitionTypes.STRING&&Kh.includes(t)}function Xh(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>{const s=n.result.replace(/data:.*\/.*;base64,/g,"");e(s)},n.onerror=()=>t(n.error),n.readAsDataURL(r)})}function Zh({format:r,contentEncoding:e,contentMediaType:t}){return[r,e,t].includes(Xr.FileUploadFormats.BASE64)}function Aw(r,e){return Gh(this,null,function*(){const t=Object.values(r);let n=t.length===1?t[0]:t;return e.type===Xr.DefinitionTypes.STRING&&Zh(e)?n=yield Xh(t[0]):e.type===Xr.DefinitionTypes.ARRAY&&e.items&&(Zh(e.items)?n=yield Promise.all(t.map(s=>Gh(this,null,function*(){return yield Xh(s)}))):n=t),n})}var lc=f(84622),je=f(38612),Je=f(97495),Ee=f(85739),Mr=f(71608),Cw=f(64393),Wn=f(60991);function Ow({response:r}){const{jsonSampleExpandLevel:e}=(0,$r.Dv)(Wn.qd);return S.createElement(S.Fragment,null,S.createElement(Mr.EE,null," Body: "),Ew(r,e))}function Ew(r,e){return r.body?S.createElement(pt.JsonViewer,{data:r.body,jsonSampleExpandLevel:e}):r.fileInfo?S.createElement(Cw.s,{fileInfo:r.fileInfo}):r.data!==null?r.data?S.createElement(pt.CodeBlock,{lang:(0,Ee.M)(r.headers["Content-Type"]||"text/plain"),source:r.data,header:{controls:{copy:{}}}}):S.createElement(pt.CodeBlockContainer,{withControls:!0},S.createElement("i",null,"(no content)")):null}function Tw({headers:r}){const e=(0,$r.Dv)(Wn.qd),[t,n]=(0,S.useState)(!0),{maxResponseHeadersToShowInTryIt:i}=e,s=Object.keys(r),o=!!i&&s.length>i,a=o&&t?[...s].splice(0,i):[...s],l=()=>{n(!t)};return S.createElement(S.Fragment,null,S.createElement(Mr.EE,null," Headers: "),S.createElement(pt.CodeBlockContainer,{withControls:!0},a.map(c=>S.createElement("div",{key:c},S.createElement(_h,null,c,":"),S.createElement("code",null,r[c]))),o&&S.createElement(qh,{onClick:l},t?"Show more...":"Hide headers")))}const _h=Je.ZP.strong`
82
48
  text-transform: capitalize;
83
49
  display: inline-block;
84
50
  padding-right: 5px;
85
- `,Is=Tt.ZP.div`
51
+ `,qh=Je.ZP.div`
86
52
  cursor: pointer;
87
53
  margin-top: 5px;
88
54
  font-size: 14px;
89
- `;Di.displayName="HeaderName",Is.displayName="StyledShowMoreLabel";const Na=Tt.ZP.div`
55
+ `;_h.displayName="HeaderName",qh.displayName="StyledShowMoreLabel";const Pw=Je.ZP.div`
90
56
  margin-bottom: 10px;
91
- `,Da=Tt.ZP.div`
57
+ `,cc=Je.ZP.div`
92
58
  display: inline-block;
93
59
  margin-right: 20px;
94
60
  padding: 2px 0;
95
61
  text-align: center;
96
62
  color: var(--text-primary);
97
- `,Bo=(0,Tt.ZP)(Da)`
98
- color: ${({code:t})=>t>=200&&t<300?"var(--response-success-text-color)":t>=300&&t<400?"var(--response-redirect-text-color)":t>400?"var(--response-error-text-color)":"var(--response-info-text-color)"};
99
- `,ru=Tt.ZP.header`
63
+ `,Mw=(0,Je.ZP)(cc)`
64
+ color: ${({code:r})=>r>=200&&r<300?"var(--response-success-text-color)":r>=300&&r<400?"var(--response-redirect-text-color)":r>400?"var(--response-error-text-color)":"var(--response-info-text-color)"};
65
+ `,ed=Je.ZP.header`
100
66
  font-weight: bold;
101
67
  margin-bottom: 10px;
102
- `,uo=Tt.ZP.code`
68
+ `,Iw=Je.ZP.code`
103
69
  border-left: 3px solid #ff4040;
104
70
  padding-left: 5px;
105
- `,nu=({error:t,response:n,time:i})=>{const s=n||t&&t.response,u=s&&s.data&&s.data.length||0;let c;return u>1e6?c=(u/1e6).toFixed(2)+" MB":u>1e3?c=(u/1e3).toFixed(2)+" KB":c=u+" B",t&&!t.response||!s?B.createElement(B.Fragment,null,B.createElement(ru,null," Could not get any response "),B.createElement(uo,null,t&&t.message||"Unknown error"),B.createElement("br",null),B.createElement(ru,null," Why this might have happened:"),B.createElement("div",null," - CORS is misconfigured on the server"),B.createElement("div",null," - The server couldn't send a response"),B.createElement("div",null," - No internet access"),B.createElement("div",null," - Documentation issue - contact API owner"),B.createElement("div",null," - Misconfigured security definition")):s?B.createElement(B.Fragment,null,B.createElement(Na,null,B.createElement(Bo,{code:s.status},B.createElement("span",null," Status: "),s.status," ",s.statusText),B.createElement(Da,null,B.createElement("span",null," Time: "),i,"ms"),B.createElement(Da,null,B.createElement("span",null," Size: "),c)),B.createElement("div",null,B.createElement(tu,{headers:s.headers}),B.createElement(ql,{response:s}))):B.createElement(B.Fragment,null,"Something went wrong")},iu=Tt.ZP.div`
71
+ `,Dw=({error:r,response:e,time:t})=>{const n=e||r&&r.response,i=n&&n.data&&n.data.length||0;let s;return i>1e6?s=(i/1e6).toFixed(2)+" MB":i>1e3?s=(i/1e3).toFixed(2)+" KB":s=i+" B",r&&!r.response||!n?S.createElement(S.Fragment,null,S.createElement(ed,null," Could not get any response "),S.createElement(Iw,null,r&&r.message||"Unknown error"),S.createElement("br",null),S.createElement(ed,null," Why this might have happened:"),S.createElement("div",null," - CORS is misconfigured on the server"),S.createElement("div",null," - The server couldn't send a response"),S.createElement("div",null," - No internet access"),S.createElement("div",null," - Documentation issue - contact API owner"),S.createElement("div",null," - Misconfigured security definition")):n?S.createElement(S.Fragment,null,S.createElement(Pw,null,S.createElement(Mw,{code:n.status},S.createElement("span",null," Status: "),n.status," ",n.statusText),S.createElement(cc,null,S.createElement("span",null," Time: "),t,"ms"),S.createElement(cc,null,S.createElement("span",null," Size: "),s)),S.createElement("div",null,S.createElement(Tw,{headers:n.headers}),S.createElement(Ow,{response:n}))):S.createElement(S.Fragment,null,"Something went wrong")},Nw=Je.ZP.div`
106
72
  display: flex;
107
73
  font-size: 12px;
108
74
  button {
109
75
  margin: 0;
110
76
  }
111
- `,Ms=Tt.ZP.button`
77
+ `,td=Je.ZP.button`
112
78
  outline: none;
113
79
  border: none;
114
80
  background-color: var(--panel-try-it-tabs-background-color);
@@ -128,131 +94,141 @@ b`.split(/\n/).length!=3?function(e){for(var r=0,a=[],o=e.length;r<=o;){var l=e.
128
94
  color: var(--panel-try-it-tabs-hover-text-color);
129
95
  }
130
96
 
131
- ${({active:t})=>t&&(0,Tt.iv)`
97
+ ${({active:r})=>r&&(0,Je.iv)`
132
98
  background-color: var(--panel-try-it-tabs-active-background-color);
133
99
  color: var(--panel-try-it-tabs-active-text-color);
134
100
  `||""}
135
101
 
136
- ${({disabled:t})=>t&&(0,Tt.iv)`
102
+ ${({disabled:r})=>r&&(0,Je.iv)`
137
103
  cursor: default;
138
104
  background-color: var(--panel-try-it-tabs-disabled-background-color);
139
105
  color: var(--panel-try-it-tabs-disabled-text-color);
140
106
  `||""}
141
- `;function jo({onChange:t,active:n,hasResponse:i}){return B.createElement(iu,null,B.createElement(Ms,{onClick:()=>t(0),active:n===0},i?"Edit Request":"Request"),B.createElement(Ms,{onClick:()=>i&&t(1),active:n===1,disabled:!i}," ","Response"," "))}var Fi=f(82155),fo=f(79198);function Wo(t,n,i){const s=n.path||{},u=n.query||{},c=Object.keys(u);let h=(0,gt.v5)(t,s);const m=p=>i.find(y=>y.name===p&&y.in==="query");return c.length&&(h+="?"+c.map(p=>{if(!u[p])return"";const y=m(p);return y?(0,ot.d$)(y,u[p]):`${p}=${encodeURIComponent(u[p])}`}).filter(Boolean).join("&")),h}const ou=({loading:t,operation:n,hasResponse:i,execute:s,params:u={}})=>B.createElement(Ii.k1,null,B.createElement(Fi.__,null,B.createElement(fo.FH,{color:n.httpVerb},n.httpVerb),B.createElement(Fi.y$,{wrap:"true"},Wo(n.path,u,n.parameters))),B.createElement(Bf,{"data-cy":"send-button",color:"primary",blinking:t,onClick:()=>!t&&s()},t?"Sending...":i?"Resend":"Send")),Bf=(0,Tt.ZP)(Fi.ev)`
107
+ `;function Rw({onChange:r,active:e,hasResponse:t}){return S.createElement(Nw,null,S.createElement(td,{onClick:()=>r(0),active:e===0},t?"Edit Request":"Request"),S.createElement(td,{onClick:()=>t&&r(1),active:e===1,disabled:!t}," ","Response"," "))}var uc=f(82155),rd=f(79198);function Lw(r,e,t){const n=e.path||{},i=e.query||{},s=Object.keys(i);let o=(0,je.v5)(r,n);const a=l=>t.find(c=>c.name===l&&c.in==="query");return s.length&&(o+="?"+s.map(l=>{if(!i[l])return"";const c=a(l);return c?(0,Ee.d$)(c,i[l]):`${l}=${encodeURIComponent(i[l])}`}).filter(Boolean).join("&")),o}const Bw=({loading:r,operation:e,hasResponse:t,onSubmit:n,params:i={}})=>S.createElement(ea.k1,null,S.createElement(uc.__,null,S.createElement(rd.FH,{color:e.httpVerb},e.httpVerb),S.createElement(uc.y$,{wrap:"true"},Lw(e.path,i,e.parameters))),S.createElement(Fw,{"data-cy":"send-button",color:"primary",type:"submit",blinking:r,onClick:()=>!r&&n()},r?"Sending...":t?"Resend":"Send")),Fw=(0,Je.ZP)(uc.ev)`
142
108
  width: var(--panel-try-it-action-button-width);
143
- `,au=(0,B.memo)(ou);var Zr=f(82302),sn=f(26225),Ho=Object.defineProperty,jf=Object.defineProperties,su=Object.getOwnPropertyDescriptors,lu=Object.getOwnPropertySymbols,Wf=Object.prototype.hasOwnProperty,Hf=Object.prototype.propertyIsEnumerable,Pr=(t,n,i)=>n in t?Ho(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,co=(t,n)=>{for(var i in n||(n={}))Wf.call(n,i)&&Pr(t,i,n[i]);if(lu)for(var i of lu(n))Hf.call(n,i)&&Pr(t,i,n[i]);return t},Uf=(t,n)=>jf(t,su(n)),Fa=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});const uu="/oauth2-redirect.html";class ln{static authorizeImplicit({authorizationUrl:n,clientId:i,scopes:s,extraParams:u={},routingBasePath:c,redirectUri:h,successCallback:m,errorCallback:p}){const y=(0,sn.p8)({date:new Date().toString()}),T=new URL(n),L=c==="/"?"":c,q=`${window.location.origin}${L}${uu}`;T.searchParams.set("client_id",i),T.searchParams.set("redirect_uri",h||q),T.searchParams.set("response_type","token"),T.searchParams.set("state",y),Array.isArray(s)&&T.searchParams.set("scope",s.join(" "));for(const W in u)T.searchParams.set(W,u[W]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:n,clientId:i,scopes:s},state:y,successCallback:W=>{m(W),ln.clearRedirectData("implicit")},errorCallback:W=>{p(W),ln.clearRedirectData("implicit")}},window.open(T.toString())}static authorizeAuthorizationCode({authorizationUrl:n,tokenUrl:i,clientId:s,clientSecret:u,codeVerifier:c,codeChallenge:h,scopes:m,extraParams:p={},extraHeaders:y={},routingBasePath:T,redirectUri:L,successCallback:q,errorCallback:W}){const _=new URL(n),fe=T==="/"?"":T,ae=`${window.location.origin}${fe}${uu}`,oe=(0,sn.p8)({date:new Date().toString()});_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",L||ae),_.searchParams.set("response_type","code"),_.searchParams.set("state",oe),Array.isArray(m)&&_.searchParams.set("scope",m.join(" ")),h&&(_.searchParams.set("code_challenge",h),_.searchParams.set("code_challenge_method","S256"));for(const ue in p)_.searchParams.set(ue,p[ue]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:n,clientId:s,scopes:m},state:oe,successCallback:ue=>Fa(this,[ue],function*({auth_code:ye}){try{const Ae=yield fetch(i,{method:"POST",headers:co({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},y),body:ot.uM.stringify(co(Uf(co({client_id:s,client_secret:u},c&&{code_verifier:c}),{code:ye,grant_type:"authorization_code",redirect_uri:L||ae}),p))});yield Ns(Ae,q,W)}catch(Ae){W(Ae)}ln.clearRedirectData("authorizationCode")}),errorCallback:ue=>{W(ue),ln.clearRedirectData("authorizationCode")}},window.open(_.toString())}static clearRedirectData(n){window.redirectOAuth2={flow:n,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(n){return Fa(this,arguments,function*({tokenUrl:i,clientId:s,clientSecret:u,scopes:c=[],extraParams:h={},extraHeaders:m={},successCallback:p,errorCallback:y}){try{const T=JSON.parse(JSON.stringify(co({client_id:s,client_secret:u,grant_type:"client_credentials",scope:Array.isArray(c)&&c.length?c.join(" "):void 0},h))),L=yield fetch(i,{method:"POST",headers:co({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},m),body:ot.uM.stringify(T)});yield Ns(L,p,y)}catch(T){y(T)}})}}const zf=new ln;function Ns(t,n,i){return Fa(this,null,function*(){if(t.ok){const s=yield t.json();n(s)}else i(new Error((t.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield t.json()):yield t.text()))})}function fu(t){return Fa(this,null,function*(){return(0,sn.rS)(yield(0,sn.JQ)(t))})}var Uo=f(95709),Ge=f(9612),hi=f(39012),Bt=f(54597);function Ra({name:t,value:n,description:i,variableEnum:s,onChange:u,defaultValue:c}){const h=(0,B.useCallback)(y=>u(y.target.value),[u]),m=(0,B.useCallback)(y=>u(y.value),[u]),p=s?s.map((y,T)=>({value:y,idx:T})):[];return B.createElement(Ge.NI,null,B.createElement(Ge.lX,null,t,":"),p&&p.length?B.createElement(Qr.VD,{fullWidth:!0,variant:"dark",value:n,options:p,onChange:m}):B.createElement(Bt.nv,{fullWidth:!0,value:n,onChange:h,placeholder:c,panel:"try-it"}),i&&B.createElement(zo,{source:i}))}const zo=(0,Tt.ZP)(hi.Markdown)`
109
+ `,jw=(0,S.memo)(Bw);var gi=f(26225),Vw=Object.defineProperty,Ww=Object.defineProperties,$w=Object.getOwnPropertyDescriptors,nd=Object.getOwnPropertySymbols,Hw=Object.prototype.hasOwnProperty,zw=Object.prototype.propertyIsEnumerable,id=(r,e,t)=>e in r?Vw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Bs=(r,e)=>{for(var t in e||(e={}))Hw.call(e,t)&&id(r,t,e[t]);if(nd)for(var t of nd(e))zw.call(e,t)&&id(r,t,e[t]);return r},Uw=(r,e)=>Ww(r,$w(e)),ra=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});const sd="/oauth2-redirect.html";class Hr{static authorizeImplicit({authorizationUrl:e,clientId:t,scopes:n,extraParams:i={},routingBasePath:s,redirectUri:o,successCallback:a,errorCallback:l}){const c=(0,gi.p8)({date:new Date().toString()}),u=new URL(e),h=s==="/"?"":s,d=`${window.location.origin}${h}${sd}`;u.searchParams.set("client_id",t),u.searchParams.set("redirect_uri",o||d),u.searchParams.set("response_type","token"),u.searchParams.set("state",c),Array.isArray(n)&&u.searchParams.set("scope",n.join(" "));for(const p in i)u.searchParams.set(p,i[p]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:e,clientId:t,scopes:n},state:c,successCallback:p=>{a(p),Hr.clearRedirectData("implicit")},errorCallback:p=>{l(p),Hr.clearRedirectData("implicit")}},window.open(u.toString())}static authorizeAuthorizationCode({authorizationUrl:e,tokenUrl:t,clientId:n,clientSecret:i,codeVerifier:s,codeChallenge:o,scopes:a,extraParams:l={},extraHeaders:c={},routingBasePath:u,redirectUri:h,successCallback:d,errorCallback:p}){const m=new URL(e),y=u==="/"?"":u,w=`${window.location.origin}${y}${sd}`,A=(0,gi.p8)({date:new Date().toString()});m.searchParams.set("client_id",n),m.searchParams.set("redirect_uri",h||w),m.searchParams.set("response_type","code"),m.searchParams.set("state",A),Array.isArray(a)&&m.searchParams.set("scope",a.join(" ")),o&&(m.searchParams.set("code_challenge",o),m.searchParams.set("code_challenge_method","S256"));for(const T in l)m.searchParams.set(T,l[T]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:e,clientId:n,scopes:a},state:A,successCallback:T=>ra(this,[T],function*({auth_code:P}){try{const L=yield fetch(t,{method:"POST",headers:Bs({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},c),body:Ee.uM.stringify(Bs(Uw(Bs({client_id:n,client_secret:i},s&&{code_verifier:s}),{code:P,grant_type:"authorization_code",redirect_uri:h||w}),l))});yield od(L,d,p)}catch(L){p(L)}Hr.clearRedirectData("authorizationCode")}),errorCallback:T=>{p(T),Hr.clearRedirectData("authorizationCode")}},window.open(m.toString())}static clearRedirectData(e){window.redirectOAuth2={flow:e,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(e){return ra(this,arguments,function*({tokenUrl:t,clientId:n,clientSecret:i,scopes:s=[],extraParams:o={},extraHeaders:a={},successCallback:l,errorCallback:c}){try{const u=JSON.parse(JSON.stringify(Bs({client_id:n,client_secret:i,grant_type:"client_credentials",scope:Array.isArray(s)&&s.length?s.join(" "):void 0},o))),h=yield fetch(t,{method:"POST",headers:Bs({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},a),body:Ee.uM.stringify(u)});yield od(h,l,c)}catch(u){c(u)}})}}const YI=new Hr;function od(r,e,t){return ra(this,null,function*(){if(r.ok){const n=yield r.json();e(n)}else t(new Error((r.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield r.json()):yield r.text()))})}function ad(r){return ra(this,null,function*(){return(0,gi.rS)(yield(0,gi.JQ)(r))})}var Fs=f(95709),ve=f(9612),Gw=f(39012),it=f(54597);function Kw({name:r,value:e,description:t,variableEnum:n,onChange:i,defaultValue:s}){const o=(0,S.useCallback)(c=>i(c.target.value),[i]),a=(0,S.useCallback)(c=>i(c.value),[i]),l=n?n.map((c,u)=>({value:c,idx:u})):[];return S.createElement(ve.NI,null,S.createElement(ve.lX,null,r,":"),l&&l.length?S.createElement(Mr.VD,{fullWidth:!0,variant:"dark",value:e,options:l,onChange:a}):S.createElement(it.nv,{fullWidth:!0,value:e,onChange:o,placeholder:s,panel:"try-it"}),t&&S.createElement(Yw,{source:t}))}const Yw=(0,Je.ZP)(Gw.Markdown)`
144
110
  margin-top: 5px;
145
111
  color: #d0d0d0;
146
- `;var Jn=Object.defineProperty,_f=Object.defineProperties,Vf=Object.getOwnPropertyDescriptors,Ri=Object.getOwnPropertySymbols,cu=Object.prototype.hasOwnProperty,du=Object.prototype.propertyIsEnumerable,Ds=(t,n,i)=>n in t?Jn(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,_o=(t,n)=>{for(var i in n||(n={}))cu.call(n,i)&&Ds(t,i,n[i]);if(Ri)for(var i of Ri(n))du.call(n,i)&&Ds(t,i,n[i]);return t},Bi=(t,n)=>_f(t,Vf(n));function Fs({operation:t,onChange:n}){const{events:i}=(0,wn.Dv)(An.qd),{servers:s}=t,u=(0,ot.YQ)("serverUrl"),c=s.findIndex(_=>_.url===u),[h,m]=(0,B.useState)(c<0?0:c),[p,y]=(0,B.useState)({});(0,Vt.useMount)(()=>{const _=(0,gt.fz)(s,h);n(_),y(_.variables)});const T=({serverUrl:_=""})=>{var fe;const ae=s.find(Ae=>Ae.url===_),oe=s.findIndex(Ae=>Ae.url===_),ue=(0,gt.mj)(ae);n({url:_,variables:ue}),(0,ot.WW)("serverUrl",_),m(oe),y(ue);const ye=(0,fr.Ze)({operation:t,serverUrl:_});(fe=i.targetServerSwitch)==null||fe.call(i,ye)},L=(_,fe)=>{const ae=s[h],oe=fe||fe===""?fe:(0,gt.mj)(ae)[_],ue=Bi(_o({},p),{[_]:oe});y(ue),(0,gt.UY)(_,oe),n(Bi(_o({},ae),{variables:ue}))},q=s.map((_,fe)=>({idx:fe,serverUrl:_.url,value:`
147
- ${(0,gt.nq)((0,gt.v5)(_.url,p),_.variables)}
148
- - ${(0,ot.bG)(_.description)||"Default"}
149
- `})),W=Object.keys(p);return B.createElement(Bs,{"data-cy":"console-target-server"},B.createElement(Ge.lX,{htmlFor:"server"},"Target server: "),B.createElement(Ge.NI,null,B.createElement(Qr.VD,{variant:"dark",value:q[h].value,options:q,fullWidth:!0,onChange:T})),W?.map(_=>{var fe;const ae=(fe=s[h].variables)==null?void 0:fe[_];if(ae)return B.createElement(Ra,{key:_,name:_,value:p[_],defaultValue:ae.default,onChange:oe=>L(_,oe),variableEnum:ae.enum,description:ae.description})}))}const Rs=(0,B.memo)(Fs),Bs=Tt.ZP.div`
112
+ `;var Jw=Object.defineProperty,Qw=Object.defineProperties,Xw=Object.getOwnPropertyDescriptors,ld=Object.getOwnPropertySymbols,Zw=Object.prototype.hasOwnProperty,_w=Object.prototype.propertyIsEnumerable,cd=(r,e,t)=>e in r?Jw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ud=(r,e)=>{for(var t in e||(e={}))Zw.call(e,t)&&cd(r,t,e[t]);if(ld)for(var t of ld(e))_w.call(e,t)&&cd(r,t,e[t]);return r},fd=(r,e)=>Qw(r,Xw(e));function qw({operation:r,onChange:e}){var t;const{control:n,watch:i}=(0,gt.Gc)(),{events:s}=(0,$r.Dv)(Wn.qd),{servers:o}=r,a=i("server");(0,pt.useMount)(()=>{const d=(0,Ee.YQ)("serverUrl"),p=o.findIndex(y=>y.url===d),m=(0,je.fz)(o,p<0?0:p);e(m)});const l=(0,S.useCallback)(({serverUrl:d=""})=>{var p;const m=o.find(A=>A.url===d),y=(0,je.mj)(m);e({url:d,variables:y}),(0,Ee.WW)("serverUrl",d);const w=(0,lc.Ze)({operation:r,serverUrl:d});(p=s.targetServerSwitch)==null||p.call(s,w)},[e,s,r,o]),c=(d,p)=>{const m=p||p===""?p:(0,je.mj)(a)[d],y=fd(ud({},a.variables),{[d]:m});(0,je.UY)(d,m),e(fd(ud({},a),{variables:y}))},u=(0,S.useMemo)(()=>o.map((d,p)=>({idx:p,serverUrl:d.url,value:`
113
+ ${(0,je.nq)((0,je.v5)(d.url,d.variables),d.variables)}
114
+ - ${(0,Ee.bG)(d.description)||"Default"}
115
+ `})),[o]),h=Object.keys(((t=o.find(({url:d})=>d===a?.url))==null?void 0:t.variables)||{});return S.createElement(tS,{"data-cy":"console-target-server"},S.createElement(ve.lX,{htmlFor:"server"},"Target server: "),S.createElement(ve.NI,null,S.createElement(gt.Qr,{control:n,name:"server",render:({field:{value:d}})=>{var p;const m=(p=u.find(({serverUrl:y})=>y===d?.url))==null?void 0:p.value;return S.createElement(Mr.VD,{variant:"dark",value:m,options:u,fullWidth:!0,onChange:l})}})),h?.map(d=>{var p;const m=(p=a?.variables)==null?void 0:p[d];return S.createElement(Kw,{key:d,name:d,value:a.variables[d],defaultValue:m.default,onChange:y=>c(d,y),variableEnum:m.enum,description:m.description})}))}const eS=(0,S.memo)(qw),tS=Je.ZP.div`
150
116
  margin-bottom: 20px;
151
- `;var hu=f(86220),Vo=Object.defineProperty,pu=Object.defineProperties,$f=Object.getOwnPropertyDescriptors,$o=Object.getOwnPropertySymbols,Go=Object.prototype.hasOwnProperty,vu=Object.prototype.propertyIsEnumerable,gu=(t,n,i)=>n in t?Vo(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,Ko=(t,n)=>{for(var i in n||(n={}))Go.call(n,i)&&gu(t,i,n[i]);if($o)for(var i of $o(n))vu.call(n,i)&&gu(t,i,n[i]);return t},mu=(t,n)=>pu(t,$f(n)),yu=(t,n)=>{var i={};for(var s in t)Go.call(t,s)&&n.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&$o)for(var s of $o(t))n.indexOf(s)<0&&vu.call(t,s)&&(i[s]=t[s]);return i};function js(t){var n=t,{header:i,error:s,success:u}=n,c=yu(n,["header","error","success"]);const h=({toggle:m,expanded:p=!1})=>B.createElement(Vt.PanelHeader,{onClick:m,expanded:p,"data-cy":c["data-cy"]},B.createElement(Ii.xz,null,B.createElement(Vt.PanelHeaderTitle,null,i),B.createElement(Vt.ShelfIcon,{direction:p?"down":"right"})),s&&B.createElement(hu.CrossIcon,{size:"14px",color:"--color-error"})||null,u&&B.createElement(hu.LockIcon,{size:"14px",color:"--color-success"})||null);return B.createElement(Ws,mu(Ko({className:"panel-try-it-nested"},c),{header:h}))}const Ws=(0,Tt.ZP)(Vt.Panel)`
152
- ${Vt.PanelHeader} {
117
+ `;var hd=f(86220),rS=Object.defineProperty,nS=Object.defineProperties,iS=Object.getOwnPropertyDescriptors,na=Object.getOwnPropertySymbols,dd=Object.prototype.hasOwnProperty,pd=Object.prototype.propertyIsEnumerable,gd=(r,e,t)=>e in r?rS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,sS=(r,e)=>{for(var t in e||(e={}))dd.call(e,t)&&gd(r,t,e[t]);if(na)for(var t of na(e))pd.call(e,t)&&gd(r,t,e[t]);return r},oS=(r,e)=>nS(r,iS(e)),aS=(r,e)=>{var t={};for(var n in r)dd.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&na)for(var n of na(r))e.indexOf(n)<0&&pd.call(r,n)&&(t[n]=r[n]);return t};function fc(r){var e=r,{header:t,error:n,success:i}=e,s=aS(e,["header","error","success"]);const o=({toggle:a,expanded:l=!1})=>S.createElement(pt.PanelHeader,{onClick:a,expanded:l,"data-cy":s["data-cy"]},S.createElement(ea.xz,null,S.createElement(pt.PanelHeaderTitle,null,t),S.createElement(pt.ShelfIcon,{direction:l?"down":"right"})),n&&S.createElement(hd.CrossIcon,{size:"14px",color:"--color-error"})||null,i&&S.createElement(hd.LockIcon,{size:"14px",color:"--color-success"})||null);return S.createElement(lS,oS(sS({className:"panel-try-it-nested"},s),{header:o}))}const lS=(0,Je.ZP)(pt.Panel)`
118
+ ${pt.PanelHeader} {
153
119
  border: 1px solid
154
- ${({error:t})=>t?"var(--color-error-border)":"var(--panel-try-it-nested-heading-border-color)"};
120
+ ${({error:r})=>r?"var(--color-error-border)":"var(--panel-try-it-nested-heading-border-color)"};
155
121
  padding: 10px;
156
122
  }
157
123
 
158
- ${Vt.PanelBody} {
124
+ ${pt.PanelBody} {
159
125
  border: 1px solid
160
- ${({error:t})=>t?"var(--color-error-border)":"var(--panel-try-it-nested-body-border-color)"};
126
+ ${({error:r})=>r?"var(--color-error-border)":"var(--panel-try-it-nested-body-border-color)"};
161
127
  border-top: 0;
162
128
  }
163
- `;var bu=f(4296),Gf=f(62701),xu=f(18373);const Su=(0,Tt.ZP)(fo.A3)`
129
+ `;var cS=f(4296),uS=f(62701),fS=f(18373);const hS=(0,Je.ZP)(rd.A3)`
164
130
  border-radius: var(--panel-border-radius);
165
131
  margin-bottom: 10px;
166
- `;var Ba=f(42112),Yo=f(34716),Xo=f(54955),Jo=Object.defineProperty,ja=Object.getOwnPropertySymbols,Hs=Object.prototype.hasOwnProperty,wu=Object.prototype.propertyIsEnumerable,Cu=(t,n,i)=>n in t?Jo(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,Kf=(t,n)=>{for(var i in n||(n={}))Hs.call(n,i)&&Cu(t,i,n[i]);if(ja)for(var i of ja(n))wu.call(n,i)&&Cu(t,i,n[i]);return t},Au=(t,n)=>{var i={};for(var s in t)Hs.call(t,s)&&n.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&ja)for(var s of ja(t))n.indexOf(s)<0&&wu.call(t,s)&&(i[s]=t[s]);return i},Ou=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});const Eu=(0,B.forwardRef)((t,n)=>{var i=Au(t,[]);const s=i,{schema:u,contentName:c,onChange:h,name:m}=s,p=Au(s,["schema","contentName","onChange","name"]),{render:y}=(0,Zr.U$)(Kf({field:m},p)),T=L=>Ou(void 0,null,function*(){const q=yield Zl(L.target.files,u);h(c,q)});return y(B.createElement("input",{"data-cy":"file-upload-input",type:"file",id:i.id,className:i.className,name:i.name,onChange:T,multiple:i.multiple,accept:i.accept,ref:n}))});Eu.displayName="FileUpload";var Us=f(21156);function Tu({mediaType:t,onChange:n,formApi:i}){var s;const u=t.examples||{},{exampleKey:c}=(0,Yo.C6)(t.operation,u),h=(s=u[c])==null?void 0:s.rawValue,m=ku(t);(0,B.useEffect)(()=>i&&m.forEach(y=>{var T,L;const q=h?.[y.name],W=(L=(T=y.example)!=null?T:q?.example)!=null?L:q,_=typeof W=="object"?JSON.stringify(W):W;W!==void 0&&i.setValue("body."+y.name,`${_}`)}),[c]);const p=t.schema||{};return Ma(p,t.name)?B.createElement(Pu,null,B.createElement(Ge.NI,null,B.createElement(_s,{fullWidth:!0,id:`body.${t.name}`,name:`body.${t.name}`,accept:Ia(t.name),schema:p,contentName:t.name,onChange:n}))):p.type!==Cn.DefinitionTypes.OBJECT&&!m?(console.warn(`Invalid schema for request body and mime type: "${t.name}"`,p),null):B.createElement(Pu,null,m.map(y=>{const T=y.schema||{contentMediaType:"",type:"",description:""},L=t.name===Ba.Tr.MULTIPART&&Jl(T),q=T.contentMediaType||"",W=L?B.createElement(_s,{fullWidth:!0,id:"body."+y.name,name:"body."+y.name,accept:Ia(q),multiple:T.type==="array",schema:T,contentName:y.name,onChange:n}):B.createElement(Bt.Xn,{fullWidth:!0,id:"body."+y.name,field:"body."+y.name,placeholder:(0,ot.bG)(T.description)||y.name,panel:"try-it"});return B.createElement(Ge.NI,{key:y.name},B.createElement(Ge.lX,null,y.name,":"),W)}))}const zs=(0,B.memo)(Tu);function ku(t){var n,i,s,u,c,h;const{activeOneOf:m}=(0,Xo.Sb)((0,Us.N)(t.operation.pointer)),p=(i=m[((n=t.schema)==null?void 0:n.pointer)||""])!=null?i:0;return((u=(s=t.schema)==null?void 0:s.oneOf)!=null&&u.length?((c=t.schema)==null?void 0:c.oneOf[p].fields)||[]:((h=t.schema)==null?void 0:h.fields)||[]).filter(y=>!y.schema.readOnly)}const Pu=Tt.ZP.div`
132
+ `;var ia=f(42112),hc=f(34716),dS=f(54955),pS=Object.defineProperty,gS=Object.defineProperties,mS=Object.getOwnPropertyDescriptors,md=Object.getOwnPropertySymbols,vS=Object.prototype.hasOwnProperty,yS=Object.prototype.propertyIsEnumerable,vd=(r,e,t)=>e in r?pS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,bS=(r,e)=>{for(var t in e||(e={}))vS.call(e,t)&&vd(r,t,e[t]);if(md)for(var t of md(e))yS.call(e,t)&&vd(r,t,e[t]);return r},xS=(r,e)=>gS(r,mS(e)),wS=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});const yd=(0,S.forwardRef)(({schema:r,contentName:e,onChange:t,fieldName:n,className:i,accept:s,multiple:o},a)=>{const{register:l}=(0,gt.Gc)(),c=u=>wS(void 0,null,function*(){const h=yield Aw(u.target.files,r);t(e,h)});return S.createElement("input",xS(bS({},l(n)),{"data-cy":"file-upload-input",type:"file",id:n,className:i,name:n,onChange:c,multiple:o,accept:s,ref:a}))});yd.displayName="FileUpload";var dc=f(21156);function SS({mediaType:r,onChange:e}){var t;const{setValue:n}=(0,gt.Gc)(),i=r.examples||{},{exampleKey:s}=(0,hc.C6)(r.operation,i),o=(t=i[s])==null?void 0:t.rawValue,a=AS(r);(0,S.useEffect)(()=>n&&a.forEach(c=>{var u,h;const d=o?.[c.name],p=(h=(u=c.example)!=null?u:d?.example)!=null?h:d,m=typeof p=="object"?JSON.stringify(p):p;p!==void 0&&n("body."+c.name,`${m}`)}),[s]);const l=r.schema||{};return Qh(l,r.name)?S.createElement(bd,null,S.createElement(ve.NI,null,S.createElement(xd,{fullWidth:!0,fieldName:`body.${r.name}`,accept:Jh(r.name),schema:l,contentName:r.name,onChange:e}))):l.type!==Xr.DefinitionTypes.OBJECT&&!a?(console.warn(`Invalid schema for request body and mime type: "${r.name}"`,l),null):S.createElement(bd,null,a.map(c=>{const u=c.schema||{contentMediaType:"",type:"",description:""},h=r.name===ia.Tr.MULTIPART&&kw(u),d=u.contentMediaType||"",p=h?S.createElement(xd,{fullWidth:!0,fieldName:"body."+c.name,accept:Jh(d),multiple:u.type==="array",schema:u,contentName:c.name,onChange:e}):S.createElement(it.Xn,{fullWidth:!0,id:"body."+c.name,fieldName:"body."+c.name,placeholder:(0,Ee.bG)(u.description)||c.name,panel:"try-it"});return S.createElement(ve.NI,{key:c.name},S.createElement(ve.lX,null,c.name,":"),p)}))}const kS=(0,S.memo)(SS);function AS(r){var e,t,n,i,s,o;const{activeOneOf:a}=(0,dS.Sb)((0,dc.N)(r.operation.pointer)),l=(t=a[((e=r.schema)==null?void 0:e.pointer)||""])!=null?t:0;return((i=(n=r.schema)==null?void 0:n.oneOf)!=null&&i.length?((s=r.schema)==null?void 0:s.oneOf[l].fields)||[]:((o=r.schema)==null?void 0:o.fields)||[]).filter(c=>!c.schema.readOnly)}const bd=Je.ZP.div`
167
133
  > div {
168
134
  margin-top: 10px;
169
135
  }
170
- `,_s=(0,Tt.ZP)(Eu)`
171
- ${(0,Bt.Hu)("try-it")};
172
- ${({inputType:t})=>t==="password"?"padding-right: 40px;":""};
173
- ${({fullWidth:t})=>t?"width: 100%;":""}
174
- `;var ho=f(99913);function Qo(t,n){n===void 0&&(n=!1);var i=t.length,s=0,u="",c=0,h=16,m=0,p=0,y=0,T=0,L=0;function q(ye,Ae){for(var we=0,ke=0;we<ye||!Ae;){var Te=t.charCodeAt(s);if(Te>=48&&Te<=57)ke=ke*16+Te-48;else if(Te>=65&&Te<=70)ke=ke*16+Te-65+10;else if(Te>=97&&Te<=102)ke=ke*16+Te-97+10;else break;s++,we++}return we<ye&&(ke=-1),ke}function W(ye){s=ye,u="",c=0,h=16,L=0}function _(){var ye=s;if(t.charCodeAt(s)===48)s++;else for(s++;s<t.length&&vo(t.charCodeAt(s));)s++;if(s<t.length&&t.charCodeAt(s)===46)if(s++,s<t.length&&vo(t.charCodeAt(s)))for(s++;s<t.length&&vo(t.charCodeAt(s));)s++;else return L=3,t.substring(ye,s);var Ae=s;if(s<t.length&&(t.charCodeAt(s)===69||t.charCodeAt(s)===101))if(s++,(s<t.length&&t.charCodeAt(s)===43||t.charCodeAt(s)===45)&&s++,s<t.length&&vo(t.charCodeAt(s))){for(s++;s<t.length&&vo(t.charCodeAt(s));)s++;Ae=s}else L=3;return t.substring(ye,Ae)}function fe(){for(var ye="",Ae=s;;){if(s>=i){ye+=t.substring(Ae,s),L=2;break}var we=t.charCodeAt(s);if(we===34){ye+=t.substring(Ae,s),s++;break}if(we===92){if(ye+=t.substring(Ae,s),s++,s>=i){L=2;break}var ke=t.charCodeAt(s++);switch(ke){case 34:ye+='"';break;case 92:ye+="\\";break;case 47:ye+="/";break;case 98:ye+="\b";break;case 102:ye+="\f";break;case 110:ye+=`
175
- `;break;case 114:ye+="\r";break;case 116:ye+=" ";break;case 117:var Te=q(4,!0);Te>=0?ye+=String.fromCharCode(Te):L=4;break;default:L=5}Ae=s;continue}if(we>=0&&we<=31)if(Zo(we)){ye+=t.substring(Ae,s),L=2;break}else L=6;s++}return ye}function ae(){if(u="",L=0,c=s,p=m,T=y,s>=i)return c=i,h=17;var ye=t.charCodeAt(s);if(po(ye)){do s++,u+=String.fromCharCode(ye),ye=t.charCodeAt(s);while(po(ye));return h=15}if(Zo(ye))return s++,u+=String.fromCharCode(ye),ye===13&&t.charCodeAt(s)===10&&(s++,u+=`
176
- `),m++,y=s,h=14;switch(ye){case 123:return s++,h=1;case 125:return s++,h=2;case 91:return s++,h=3;case 93:return s++,h=4;case 58:return s++,h=6;case 44:return s++,h=5;case 34:return s++,u=fe(),h=10;case 47:var Ae=s-1;if(t.charCodeAt(s+1)===47){for(s+=2;s<i&&!Zo(t.charCodeAt(s));)s++;return u=t.substring(Ae,s),h=12}if(t.charCodeAt(s+1)===42){s+=2;for(var we=i-1,ke=!1;s<we;){var Te=t.charCodeAt(s);if(Te===42&&t.charCodeAt(s+1)===47){s+=2,ke=!0;break}s++,Zo(Te)&&(Te===13&&t.charCodeAt(s)===10&&s++,m++,y=s)}return ke||(s++,L=1),u=t.substring(Ae,s),h=13}return u+=String.fromCharCode(ye),s++,h=16;case 45:if(u+=String.fromCharCode(ye),s++,s===i||!vo(t.charCodeAt(s)))return h=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return u+=_(),h=11;default:for(;s<i&&oe(ye);)s++,ye=t.charCodeAt(s);if(c!==s){switch(u=t.substring(c,s),u){case"true":return h=8;case"false":return h=9;case"null":return h=7}return h=16}return u+=String.fromCharCode(ye),s++,h=16}}function oe(ye){if(po(ye)||Zo(ye))return!1;switch(ye){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function ue(){var ye;do ye=ae();while(ye>=12&&ye<=15);return ye}return{setPosition:W,getPosition:function(){return s},scan:n?ue:ae,getToken:function(){return h},getTokenValue:function(){return u},getTokenOffset:function(){return c},getTokenLength:function(){return s-c},getTokenStartLine:function(){return p},getTokenStartCharacter:function(){return c-T},getTokenError:function(){return L}}}function po(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 Zo(t){return t===10||t===13||t===8232||t===8233}function vo(t){return t>=48&&t<=57}function Yf(t,n,i){var s,u,c,h,m;if(n){for(h=n.offset,m=h+n.length,c=h;c>0&&!go(t,c-1);)c--;for(var p=m;p<t.length&&!go(t,p);)p++;u=t.substring(c,p),s=Xf(u,i)}else u=t,s=0,c=0,h=0,m=t.length;var y=Vs(i,t),T=!1,L=0,q;i.insertSpaces?q=Wt(" ",i.tabSize||4):q=" ";var W=Qo(u,!1),_=!1;function fe(){return y+Wt(q,s+L)}function ae(){var Ee=W.scan();for(T=!1;Ee===15||Ee===14;)T=T||Ee===14,Ee=W.scan();return _=Ee===16||W.getTokenError()!==0,Ee}var oe=[];function ue(Ee,Be,et){!_&&Be<m&&et>h&&t.substring(Be,et)!==Ee&&oe.push({offset:Be,length:et-Be,content:Ee})}var ye=ae();if(ye!==17){var Ae=W.getTokenOffset()+c,we=Wt(q,s);ue(we,c,Ae)}for(;ye!==17;){for(var ke=W.getTokenOffset()+W.getTokenLength()+c,Te=ae(),De="";!T&&(Te===12||Te===13);){var pe=W.getTokenOffset()+c;ue(" ",ke,pe),ke=W.getTokenOffset()+W.getTokenLength()+c,De=Te===12?fe():"",Te=ae()}if(Te===2)ye!==1&&(L--,De=fe());else if(Te===4)ye!==3&&(L--,De=fe());else{switch(ye){case 3:case 1:L++,De=fe();break;case 5:case 12:De=fe();break;case 13:T?De=fe():De=" ";break;case 6:De=" ";break;case 10:if(Te===6){De="";break}case 7:case 8:case 9:case 11:case 2:case 4:Te===12||Te===13?De=" ":Te!==5&&Te!==17&&(_=!0);break;case 16:_=!0;break}T&&(Te===12||Te===13)&&(De=fe())}var Ie=W.getTokenOffset()+c;ue(De,ke,Ie),ye=Te}return oe}function Wt(t,n){for(var i="",s=0;s<n;s++)i+=t;return i}function Xf(t,n){for(var i=0,s=0,u=n.tabSize||4;i<t.length;){var c=t.charAt(i);if(c===" ")s++;else if(c===" ")s+=u;else break;i++}return Math.floor(s/u)}function Vs(t,n){for(var i=0;i<n.length;i++){var s=n.charAt(i);if(s==="\r")return i+1<n.length&&n.charAt(i+1)===`
177
- `?`\r
178
- `:"\r";if(s===`
179
- `)return`
180
- `}return t&&t.eol||`
181
- `}function go(t,n){return`\r
182
- `.indexOf(t.charAt(n))!==-1}var Rr;(function(t){t.DEFAULT={allowTrailingComma:!1}})(Rr||(Rr={}));function Wa(t,n){var i=[],s=new Object,u=void 0,c={value:{},offset:0,length:0,type:"object",parent:void 0},h=!1;function m(p,y,T,L){c.value=p,c.offset=y,c.length=T,c.type=L,c.colonOffset=void 0,u=c}try{mo(t,{onObjectBegin:function(p,y){if(n<=p)throw s;u=void 0,h=n>p,i.push("")},onObjectProperty:function(p,y,T){if(n<y||(m(p,y,T,"property"),i[i.length-1]=p,n<=y+T))throw s},onObjectEnd:function(p,y){if(n<=p)throw s;u=void 0,i.pop()},onArrayBegin:function(p,y){if(n<=p)throw s;u=void 0,i.push(0)},onArrayEnd:function(p,y){if(n<=p)throw s;u=void 0,i.pop()},onLiteralValue:function(p,y,T){if(n<y||(m(p,y,T,It(p)),n<=y+T))throw s},onSeparator:function(p,y,T){if(n<=y)throw s;if(p===":"&&u&&u.type==="property")u.colonOffset=y,h=!1,u=void 0;else if(p===","){var L=i[i.length-1];typeof L=="number"?i[i.length-1]=L+1:(h=!0,i[i.length-1]=""),u=void 0}}})}catch(p){if(p!==s)throw p}return{path:i,previousNode:u,isAtPropertyKey:h,matches:function(p){for(var y=0,T=0;y<p.length&&T<i.length;T++)if(p[y]===i[T]||p[y]==="*")y++;else if(p[y]!=="**")return!1;return y===p.length}}}function $s(t,n,i){n===void 0&&(n=[]),i===void 0&&(i=Rr.DEFAULT);var s=null,u=[],c=[];function h(p){Array.isArray(u)?u.push(p):s!==null&&(u[s]=p)}var m={onObjectBegin:function(){var p={};h(p),c.push(u),u=p,s=null},onObjectProperty:function(p){s=p},onObjectEnd:function(){u=c.pop()},onArrayBegin:function(){var p=[];h(p),c.push(u),u=p,s=null},onArrayEnd:function(){u=c.pop()},onLiteralValue:h,onError:function(p,y,T){n.push({error:p,offset:y,length:T})}};return mo(t,m,i),u[0]}function Lu(t,n,i){n===void 0&&(n=[]),i===void 0&&(i=Rr.DEFAULT);var s={type:"array",offset:-1,length:-1,children:[],parent:void 0};function u(p){s.type==="property"&&(s.length=p-s.offset,s=s.parent)}function c(p){return s.children.push(p),p}var h={onObjectBegin:function(p){s=c({type:"object",offset:p,length:-1,parent:s,children:[]})},onObjectProperty:function(p,y,T){s=c({type:"property",offset:y,length:-1,parent:s,children:[]}),s.children.push({type:"string",value:p,offset:y,length:T,parent:s})},onObjectEnd:function(p,y){u(p+y),s.length=p+y-s.offset,s=s.parent,u(p+y)},onArrayBegin:function(p,y){s=c({type:"array",offset:p,length:-1,parent:s,children:[]})},onArrayEnd:function(p,y){s.length=p+y-s.offset,s=s.parent,u(p+y)},onLiteralValue:function(p,y,T){c({type:It(p),offset:y,length:T,parent:s,value:p}),u(y+T)},onSeparator:function(p,y,T){s.type==="property"&&(p===":"?s.colonOffset=y:p===","&&u(y))},onError:function(p,y,T){n.push({error:p,offset:y,length:T})}};mo(t,h,i);var m=s.children[0];return m&&delete m.parent,m}function Iu(t,n){if(t){for(var i=t,s=0,u=n;s<u.length;s++){var c=u[s];if(typeof c=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;for(var h=!1,m=0,p=i.children;m<p.length;m++){var y=p[m];if(Array.isArray(y.children)&&y.children[0].value===c){i=y.children[1],h=!0;break}}if(!h)return}else{var T=c;if(i.type!=="array"||T<0||!Array.isArray(i.children)||T>=i.children.length)return;i=i.children[T]}}return i}}function Gs(t){if(!t.parent||!t.parent.children)return[];var n=Gs(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;n.push(i)}else if(t.parent.type==="array"){var s=t.parent.children.indexOf(t);s!==-1&&n.push(s)}return n}function qo(t){switch(t.type){case"array":return t.children.map(qo);case"object":for(var n=Object.create(null),i=0,s=t.children;i<s.length;i++){var u=s[i],c=u.children[1];c&&(n[u.children[0].value]=qo(c))}return n;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function Mu(t,n,i){return i===void 0&&(i=!1),n>=t.offset&&n<t.offset+t.length||i&&n===t.offset+t.length}function Nu(t,n,i){if(i===void 0&&(i=!1),Mu(t,n,i)){var s=t.children;if(Array.isArray(s))for(var u=0;u<s.length&&s[u].offset<=n;u++){var c=Nu(s[u],n,i);if(c)return c}return t}}function mo(t,n,i){i===void 0&&(i=Rr.DEFAULT);var s=Qo(t,!1);function u(pe){return pe?function(){return pe(s.getTokenOffset(),s.getTokenLength(),s.getTokenStartLine(),s.getTokenStartCharacter())}:function(){return!0}}function c(pe){return pe?function(Ie){return pe(Ie,s.getTokenOffset(),s.getTokenLength(),s.getTokenStartLine(),s.getTokenStartCharacter())}:function(){return!0}}var h=u(n.onObjectBegin),m=c(n.onObjectProperty),p=u(n.onObjectEnd),y=u(n.onArrayBegin),T=u(n.onArrayEnd),L=c(n.onLiteralValue),q=c(n.onSeparator),W=u(n.onComment),_=c(n.onError),fe=i&&i.disallowComments,ae=i&&i.allowTrailingComma;function oe(){for(;;){var pe=s.scan();switch(s.getTokenError()){case 4:ue(14);break;case 5:ue(15);break;case 3:ue(13);break;case 1:fe||ue(11);break;case 2:ue(12);break;case 6:ue(16);break}switch(pe){case 12:case 13:fe?ue(10):W();break;case 16:ue(1);break;case 15:case 14:break;default:return pe}}}function ue(pe,Ie,Ee){if(Ie===void 0&&(Ie=[]),Ee===void 0&&(Ee=[]),_(pe),Ie.length+Ee.length>0)for(var Be=s.getToken();Be!==17;){if(Ie.indexOf(Be)!==-1){oe();break}else if(Ee.indexOf(Be)!==-1)break;Be=oe()}}function ye(pe){var Ie=s.getTokenValue();return pe?L(Ie):m(Ie),oe(),!0}function Ae(){switch(s.getToken()){case 11:var pe=s.getTokenValue(),Ie=Number(pe);isNaN(Ie)&&(ue(2),Ie=0),L(Ie);break;case 7:L(null);break;case 8:L(!0);break;case 9:L(!1);break;default:return!1}return oe(),!0}function we(){return s.getToken()!==10?(ue(3,[],[2,5]),!1):(ye(!1),s.getToken()===6?(q(":"),oe(),De()||ue(4,[],[2,5])):ue(5,[],[2,5]),!0)}function ke(){h(),oe();for(var pe=!1;s.getToken()!==2&&s.getToken()!==17;){if(s.getToken()===5){if(pe||ue(4,[],[]),q(","),oe(),s.getToken()===2&&ae)break}else pe&&ue(6,[],[]);we()||ue(4,[],[2,5]),pe=!0}return p(),s.getToken()!==2?ue(7,[2],[]):oe(),!0}function Te(){y(),oe();for(var pe=!1;s.getToken()!==4&&s.getToken()!==17;){if(s.getToken()===5){if(pe||ue(4,[],[]),q(","),oe(),s.getToken()===4&&ae)break}else pe&&ue(6,[],[]);De()||ue(4,[],[4,5]),pe=!0}return T(),s.getToken()!==4?ue(8,[4],[]):oe(),!0}function De(){switch(s.getToken()){case 3:return Te();case 1:return ke();case 10:return ye(!0);default:return Ae()}}return oe(),s.getToken()===17?i.allowEmptyContent?!0:(ue(4,[],[]),!1):De()?(s.getToken()!==17&&ue(9,[],[]),!0):(ue(4,[],[]),!1)}function Du(t,n){var i=Qo(t),s=[],u,c=0,h;do switch(h=i.getPosition(),u=i.scan(),u){case 12:case 13:case 17:c!==h&&s.push(t.substring(c,h)),n!==void 0&&s.push(i.getTokenValue().replace(/[^\r\n]/g,n)),c=i.getPosition();break}while(u!==17);return s.join("")}function It(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 Jf(t,n,i){return Qf(t,n,void 0,i)}function Qf(t,n,i,s){for(var u,c=n.slice(),h=[],m=parseTree(t,h),p=void 0,y=void 0;c.length>0&&(y=c.pop(),p=findNodeAtLocation(m,c),p===void 0&&i!==void 0);)typeof y=="string"?i=(u={},u[y]=i,u):i=[i];if(p)if(p.type==="object"&&typeof y=="string"&&Array.isArray(p.children)){var T=findNodeAtLocation(p,[y]);if(T!==void 0)if(i===void 0){if(!T.parent)throw new Error("Malformed AST");var L=p.children.indexOf(T.parent),q=void 0,W=T.parent.offset+T.parent.length;if(L>0){var _=p.children[L-1];q=_.offset+_.length}else if(q=p.offset+1,p.children.length>1){var fe=p.children[1];W=fe.offset}return un(t,{offset:q,length:W-q,content:""},s)}else return un(t,{offset:T.offset,length:T.length,content:JSON.stringify(i)},s);else{if(i===void 0)return[];var ae=JSON.stringify(y)+": "+JSON.stringify(i),oe=s.getInsertionIndex?s.getInsertionIndex(p.children.map(function(pe){return pe.children[0].value})):p.children.length,ue=void 0;if(oe>0){var _=p.children[oe-1];ue={offset:_.offset+_.length,length:0,content:","+ae}}else p.children.length===0?ue={offset:p.offset+1,length:0,content:ae}:ue={offset:p.offset+1,length:0,content:ae+","};return un(t,ue,s)}}else if(p.type==="array"&&typeof y=="number"&&Array.isArray(p.children)){var ye=y;if(ye===-1){var ae=""+JSON.stringify(i),ue=void 0;if(p.children.length===0)ue={offset:p.offset+1,length:0,content:ae};else{var _=p.children[p.children.length-1];ue={offset:_.offset+_.length,length:0,content:","+ae}}return un(t,ue,s)}else if(i===void 0&&p.children.length>=0){var Ae=y,we=p.children[Ae],ue=void 0;if(p.children.length===1)ue={offset:p.offset+1,length:p.length-2,content:""};else if(p.children.length-1===Ae){var _=p.children[Ae-1],ke=_.offset+_.length,Te=p.offset+p.length;ue={offset:ke,length:Te-2-ke,content:""}}else ue={offset:we.offset,length:p.children[Ae+1].offset-we.offset,content:""};return un(t,ue,s)}else if(i!==void 0){var ue=void 0,ae=""+JSON.stringify(i);if(!s.isArrayInsertion&&p.children.length>y){var De=p.children[y];ue={offset:De.offset,length:De.length,content:ae}}else if(p.children.length===0||y===0)ue={offset:p.offset+1,length:0,content:p.children.length===0?ae:ae+","};else{var oe=y>p.children.length?p.children.length:y,_=p.children[oe-1];ue={offset:_.offset+_.length,length:0,content:","+ae}}return un(t,ue,s)}else throw new Error("Can not "+(i===void 0?"remove":s.isArrayInsertion?"insert":"modify")+" Array index "+ye+" as length is not sufficient")}else throw new Error("Can not add "+(typeof y!="number"?"index":"property")+" to parent of type "+p.type);else{if(i===void 0)throw new Error("Can not delete in empty document");return un(t,{offset:m?m.offset:0,length:m?m.length:0,content:JSON.stringify(i)},s)}}function un(t,n,i){if(!i.formattingOptions)return[n];var s=Fu(t,n),u=n.offset,c=n.offset+n.content.length;if(n.length===0||n.content.length===0){for(;u>0&&!isEOL(s,u-1);)u--;for(;c<s.length&&!isEOL(s,c);)c++}for(var h=format(s,{offset:u,length:c-u},i.formattingOptions),m=h.length-1;m>=0;m--){var p=h[m];s=Fu(s,p),u=Math.min(u,p.offset),c=Math.max(c,p.offset+p.length),c+=p.content.length-p.length}var y=t.length-(s.length-c)-u;return[{offset:u,length:y,content:s.substring(u,c)}]}function Fu(t,n){return t.substring(0,n.offset)+n.content+t.substring(n.offset+n.length)}function Ks(t,n){return`\r
183
- `.indexOf(t.charAt(n))!==-1}var yo=Qo,nr=Wa,Zf=$s,gc=Lu,mc=Iu,Ha=Nu,e=Gs,r=qo,a=mo,o=Du;function l(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 d(t,n,i){return Yf(t,n,i)}function g(t,n,i,s){return edit.setProperty(t,n,i,s)}function b(t,n){for(var i=n.length-1;i>=0;i--)t=edit.applyEdit(t,n[i]);return t}function w(t,n){if(t===n)return!0;if(t==null||n===null||n===void 0||typeof t!=typeof n||typeof t!="object"||Array.isArray(t)!==Array.isArray(n))return!1;var i,s;if(Array.isArray(t)){if(t.length!==n.length)return!1;for(i=0;i<t.length;i++)if(!w(t[i],n[i]))return!1}else{var u=[];for(s in t)u.push(s);u.sort();var c=[];for(s in n)c.push(s);if(c.sort(),!w(u,c))return!1;for(i=0;i<u.length;i++)if(!w(t[u[i]],n[u[i]]))return!1}return!0}function O(t){return typeof t=="number"}function U(t){return typeof t<"u"}function X(t){return typeof t=="boolean"}function he(t){return typeof t=="string"}var le;(function(t){function n(i){return typeof i=="string"}t.is=n})(le||(le={}));var xe;(function(t){function n(i){return typeof i=="string"}t.is=n})(xe||(xe={}));var Ce;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&t.MIN_VALUE<=i&&i<=t.MAX_VALUE}t.is=n})(Ce||(Ce={}));var Le;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&t.MIN_VALUE<=i&&i<=t.MAX_VALUE}t.is=n})(Le||(Le={}));var Me;(function(t){function n(s,u){return s===Number.MAX_VALUE&&(s=Le.MAX_VALUE),u===Number.MAX_VALUE&&(u=Le.MAX_VALUE),{line:s,character:u}}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&me.uinteger(u.line)&&me.uinteger(u.character)}t.is=i})(Me||(Me={}));var Oe;(function(t){function n(s,u,c,h){if(me.uinteger(s)&&me.uinteger(u)&&me.uinteger(c)&&me.uinteger(h))return{start:Me.create(s,u),end:Me.create(c,h)};if(Me.is(s)&&Me.is(u))return{start:s,end:u};throw new Error("Range#create called with invalid arguments[".concat(s,", ").concat(u,", ").concat(c,", ").concat(h,"]"))}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&Me.is(u.start)&&Me.is(u.end)}t.is=i})(Oe||(Oe={}));var Ne;(function(t){function n(s,u){return{uri:s,range:u}}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&Oe.is(u.range)&&(me.string(u.uri)||me.undefined(u.uri))}t.is=i})(Ne||(Ne={}));var We;(function(t){function n(s,u,c,h){return{targetUri:s,targetRange:u,targetSelectionRange:c,originSelectionRange:h}}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&Oe.is(u.targetRange)&&me.string(u.targetUri)&&Oe.is(u.targetSelectionRange)&&(Oe.is(u.originSelectionRange)||me.undefined(u.originSelectionRange))}t.is=i})(We||(We={}));var Ye;(function(t){function n(s,u,c,h){return{red:s,green:u,blue:c,alpha:h}}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&me.numberRange(u.red,0,1)&&me.numberRange(u.green,0,1)&&me.numberRange(u.blue,0,1)&&me.numberRange(u.alpha,0,1)}t.is=i})(Ye||(Ye={}));var Ke;(function(t){function n(s,u){return{range:s,color:u}}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&Oe.is(u.range)&&Ye.is(u.color)}t.is=i})(Ke||(Ke={}));var vt;(function(t){function n(s,u,c){return{label:s,textEdit:u,additionalTextEdits:c}}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&me.string(u.label)&&(me.undefined(u.textEdit)||Mt.is(u))&&(me.undefined(u.additionalTextEdits)||me.typedArray(u.additionalTextEdits,Mt.is))}t.is=i})(vt||(vt={}));var kt;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(kt||(kt={}));var ar;(function(t){function n(s,u,c,h,m,p){var y={startLine:s,endLine:u};return me.defined(c)&&(y.startCharacter=c),me.defined(h)&&(y.endCharacter=h),me.defined(m)&&(y.kind=m),me.defined(p)&&(y.collapsedText=p),y}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&me.uinteger(u.startLine)&&me.uinteger(u.startLine)&&(me.undefined(u.startCharacter)||me.uinteger(u.startCharacter))&&(me.undefined(u.endCharacter)||me.uinteger(u.endCharacter))&&(me.undefined(u.kind)||me.string(u.kind))}t.is=i})(ar||(ar={}));var Ut;(function(t){function n(s,u){return{location:s,message:u}}t.create=n;function i(s){var u=s;return me.defined(u)&&Ne.is(u.location)&&me.string(u.message)}t.is=i})(Ut||(Ut={}));var Ze;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Ze||(Ze={}));var Lr;(function(t){t.Unnecessary=1,t.Deprecated=2})(Lr||(Lr={}));var Qt;(function(t){function n(i){var s=i;return me.objectLiteral(s)&&me.string(s.href)}t.is=n})(Qt||(Qt={}));var Yt;(function(t){function n(s,u,c,h,m,p){var y={range:s,message:u};return me.defined(c)&&(y.severity=c),me.defined(h)&&(y.code=h),me.defined(m)&&(y.source=m),me.defined(p)&&(y.relatedInformation=p),y}t.create=n;function i(s){var u,c=s;return me.defined(c)&&Oe.is(c.range)&&me.string(c.message)&&(me.number(c.severity)||me.undefined(c.severity))&&(me.integer(c.code)||me.string(c.code)||me.undefined(c.code))&&(me.undefined(c.codeDescription)||me.string((u=c.codeDescription)===null||u===void 0?void 0:u.href))&&(me.string(c.source)||me.undefined(c.source))&&(me.undefined(c.relatedInformation)||me.typedArray(c.relatedInformation,Ut.is))}t.is=i})(Yt||(Yt={}));var Xt;(function(t){function n(s,u){for(var c=[],h=2;h<arguments.length;h++)c[h-2]=arguments[h];var m={title:s,command:u};return me.defined(c)&&c.length>0&&(m.arguments=c),m}t.create=n;function i(s){var u=s;return me.defined(u)&&me.string(u.title)&&me.string(u.command)}t.is=i})(Xt||(Xt={}));var Mt;(function(t){function n(c,h){return{range:c,newText:h}}t.replace=n;function i(c,h){return{range:{start:c,end:c},newText:h}}t.insert=i;function s(c){return{range:c,newText:""}}t.del=s;function u(c){var h=c;return me.objectLiteral(h)&&me.string(h.newText)&&Oe.is(h.range)}t.is=u})(Mt||(Mt={}));var zt;(function(t){function n(s,u,c){var h={label:s};return u!==void 0&&(h.needsConfirmation=u),c!==void 0&&(h.description=c),h}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&me.string(u.label)&&(me.boolean(u.needsConfirmation)||u.needsConfirmation===void 0)&&(me.string(u.description)||u.description===void 0)}t.is=i})(zt||(zt={}));var bt;(function(t){function n(i){var s=i;return me.string(s)}t.is=n})(bt||(bt={}));var Zt;(function(t){function n(c,h,m){return{range:c,newText:h,annotationId:m}}t.replace=n;function i(c,h,m){return{range:{start:c,end:c},newText:h,annotationId:m}}t.insert=i;function s(c,h){return{range:c,newText:"",annotationId:h}}t.del=s;function u(c){var h=c;return Mt.is(h)&&(zt.is(h.annotationId)||bt.is(h.annotationId))}t.is=u})(Zt||(Zt={}));var Qn;(function(t){function n(s,u){return{textDocument:s,edits:u}}t.create=n;function i(s){var u=s;return me.defined(u)&&Zn.is(u.textDocument)&&Array.isArray(u.edits)}t.is=i})(Qn||(Qn={}));var fn;(function(t){function n(s,u,c){var h={kind:"create",uri:s};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(h.options=u),c!==void 0&&(h.annotationId=c),h}t.create=n;function i(s){var u=s;return u&&u.kind==="create"&&me.string(u.uri)&&(u.options===void 0||(u.options.overwrite===void 0||me.boolean(u.options.overwrite))&&(u.options.ignoreIfExists===void 0||me.boolean(u.options.ignoreIfExists)))&&(u.annotationId===void 0||bt.is(u.annotationId))}t.is=i})(fn||(fn={}));var ir;(function(t){function n(s,u,c,h){var m={kind:"rename",oldUri:s,newUri:u};return c!==void 0&&(c.overwrite!==void 0||c.ignoreIfExists!==void 0)&&(m.options=c),h!==void 0&&(m.annotationId=h),m}t.create=n;function i(s){var u=s;return u&&u.kind==="rename"&&me.string(u.oldUri)&&me.string(u.newUri)&&(u.options===void 0||(u.options.overwrite===void 0||me.boolean(u.options.overwrite))&&(u.options.ignoreIfExists===void 0||me.boolean(u.options.ignoreIfExists)))&&(u.annotationId===void 0||bt.is(u.annotationId))}t.is=i})(ir||(ir={}));var $r;(function(t){function n(s,u,c){var h={kind:"delete",uri:s};return u!==void 0&&(u.recursive!==void 0||u.ignoreIfNotExists!==void 0)&&(h.options=u),c!==void 0&&(h.annotationId=c),h}t.create=n;function i(s){var u=s;return u&&u.kind==="delete"&&me.string(u.uri)&&(u.options===void 0||(u.options.recursive===void 0||me.boolean(u.options.recursive))&&(u.options.ignoreIfNotExists===void 0||me.boolean(u.options.ignoreIfNotExists)))&&(u.annotationId===void 0||bt.is(u.annotationId))}t.is=i})($r||($r={}));var or;(function(t){function n(i){var s=i;return s&&(s.changes!==void 0||s.documentChanges!==void 0)&&(s.documentChanges===void 0||s.documentChanges.every(function(u){return me.string(u.kind)?fn.is(u)||ir.is(u)||$r.is(u):Qn.is(u)}))}t.is=n})(or||(or={}));var bo=function(){function t(n,i){this.edits=n,this.changeAnnotations=i}return t.prototype.insert=function(n,i,s){var u,c;if(s===void 0?u=Mt.insert(n,i):bt.is(s)?(c=s,u=Zt.insert(n,i,s)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(s),u=Zt.insert(n,i,c)),this.edits.push(u),c!==void 0)return c},t.prototype.replace=function(n,i,s){var u,c;if(s===void 0?u=Mt.replace(n,i):bt.is(s)?(c=s,u=Zt.replace(n,i,s)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(s),u=Zt.replace(n,i,c)),this.edits.push(u),c!==void 0)return c},t.prototype.delete=function(n,i){var s,u;if(i===void 0?s=Mt.del(n):bt.is(i)?(u=i,s=Zt.del(n,i)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(i),s=Zt.del(n,u)),this.edits.push(s),u!==void 0)return u},t.prototype.add=function(n){this.edits.push(n)},t.prototype.all=function(){return this.edits},t.prototype.clear=function(){this.edits.splice(0,this.edits.length)},t.prototype.assertChangeAnnotations=function(n){if(n===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},t}(),Fn=function(){function t(n){this._annotations=n===void 0?Object.create(null):n,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(n,i){var s;if(bt.is(n)?s=n:(s=this.nextId(),i=n),this._annotations[s]!==void 0)throw new Error("Id ".concat(s," is already in use."));if(i===void 0)throw new Error("No annotation provided for id ".concat(s));return this._annotations[s]=i,this._size++,s},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),xo=function(){function t(n){var i=this;this._textEditChanges=Object.create(null),n!==void 0?(this._workspaceEdit=n,n.documentChanges?(this._changeAnnotations=new Fn(n.changeAnnotations),n.changeAnnotations=this._changeAnnotations.all(),n.documentChanges.forEach(function(s){if(Qn.is(s)){var u=new bo(s.edits,i._changeAnnotations);i._textEditChanges[s.textDocument.uri]=u}})):n.changes&&Object.keys(n.changes).forEach(function(s){var u=new bo(n.changes[s]);i._textEditChanges[s]=u})):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(n){if(Zn.is(n)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:n.uri,version:n.version},s=this._textEditChanges[i.uri];if(!s){var u=[],c={textDocument:i,edits:u};this._workspaceEdit.documentChanges.push(c),s=new bo(u,this._changeAnnotations),this._textEditChanges[i.uri]=s}return s}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var s=this._textEditChanges[n];if(!s){var u=[];this._workspaceEdit.changes[n]=u,s=new bo(u),this._textEditChanges[n]=s}return s}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Fn,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(n,i,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var u;zt.is(i)||bt.is(i)?u=i:s=i;var c,h;if(u===void 0?c=fn.create(n,s):(h=bt.is(u)?u:this._changeAnnotations.manage(u),c=fn.create(n,s,h)),this._workspaceEdit.documentChanges.push(c),h!==void 0)return h},t.prototype.renameFile=function(n,i,s,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var c;zt.is(s)||bt.is(s)?c=s:u=s;var h,m;if(c===void 0?h=ir.create(n,i,u):(m=bt.is(c)?c:this._changeAnnotations.manage(c),h=ir.create(n,i,u,m)),this._workspaceEdit.documentChanges.push(h),m!==void 0)return m},t.prototype.deleteFile=function(n,i,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var u;zt.is(i)||bt.is(i)?u=i:s=i;var c,h;if(u===void 0?c=$r.create(n,s):(h=bt.is(u)?u:this._changeAnnotations.manage(u),c=$r.create(n,s,h)),this._workspaceEdit.documentChanges.push(c),h!==void 0)return h},t}(),pi;(function(t){function n(s){return{uri:s}}t.create=n;function i(s){var u=s;return me.defined(u)&&me.string(u.uri)}t.is=i})(pi||(pi={}));var wr;(function(t){function n(s,u){return{uri:s,version:u}}t.create=n;function i(s){var u=s;return me.defined(u)&&me.string(u.uri)&&me.integer(u.version)}t.is=i})(wr||(wr={}));var Zn;(function(t){function n(s,u){return{uri:s,version:u}}t.create=n;function i(s){var u=s;return me.defined(u)&&me.string(u.uri)&&(u.version===null||me.integer(u.version))}t.is=i})(Zn||(Zn={}));var Ua;(function(t){function n(s,u,c,h){return{uri:s,languageId:u,version:c,text:h}}t.create=n;function i(s){var u=s;return me.defined(u)&&me.string(u.uri)&&me.string(u.languageId)&&me.integer(u.version)&&me.string(u.text)}t.is=i})(Ua||(Ua={}));var ea;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function n(i){var s=i;return s===t.PlainText||s===t.Markdown}t.is=n})(ea||(ea={}));var Ys;(function(t){function n(i){var s=i;return me.objectLiteral(i)&&ea.is(s.kind)&&me.string(s.value)}t.is=n})(Ys||(Ys={}));var On;(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})(On||(On={}));var Cr;(function(t){t.PlainText=1,t.Snippet=2})(Cr||(Cr={}));var yc;(function(t){t.Deprecated=1})(yc||(yc={}));var bc;(function(t){function n(s,u,c){return{newText:s,insert:u,replace:c}}t.create=n;function i(s){var u=s;return u&&me.string(u.newText)&&Oe.is(u.insert)&&Oe.is(u.replace)}t.is=i})(bc||(bc={}));var xc;(function(t){t.asIs=1,t.adjustIndentation=2})(xc||(xc={}));var Sc;(function(t){function n(i){var s=i;return s&&(me.string(s.detail)||s.detail===void 0)&&(me.string(s.description)||s.description===void 0)}t.is=n})(Sc||(Sc={}));var qf;(function(t){function n(i){return{label:i}}t.create=n})(qf||(qf={}));var wc;(function(t){function n(i,s){return{items:i||[],isIncomplete:!!s}}t.create=n})(wc||(wc={}));var Ru;(function(t){function n(s){return s.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=n;function i(s){var u=s;return me.string(u)||me.objectLiteral(u)&&me.string(u.language)&&me.string(u.value)}t.is=i})(Ru||(Ru={}));var Cc;(function(t){function n(i){var s=i;return!!s&&me.objectLiteral(s)&&(Ys.is(s.contents)||Ru.is(s.contents)||me.typedArray(s.contents,Ru.is))&&(i.range===void 0||Oe.is(i.range))}t.is=n})(Cc||(Cc={}));var Ac;(function(t){function n(i,s){return s?{label:i,documentation:s}:{label:i}}t.create=n})(Ac||(Ac={}));var Oc;(function(t){function n(i,s){for(var u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];var h={label:i};return me.defined(s)&&(h.documentation=s),me.defined(u)?h.parameters=u:h.parameters=[],h}t.create=n})(Oc||(Oc={}));var Ec;(function(t){t.Text=1,t.Read=2,t.Write=3})(Ec||(Ec={}));var Tc;(function(t){function n(i,s){var u={range:i};return me.number(s)&&(u.kind=s),u}t.create=n})(Tc||(Tc={}));var vi;(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})(vi||(vi={}));var kc;(function(t){t.Deprecated=1})(kc||(kc={}));var Pc;(function(t){function n(i,s,u,c,h){var m={name:i,kind:s,location:{uri:c,range:u}};return h&&(m.containerName=h),m}t.create=n})(Pc||(Pc={}));var Lc;(function(t){function n(i,s,u,c){return c!==void 0?{name:i,kind:s,location:{uri:u,range:c}}:{name:i,kind:s,location:{uri:u}}}t.create=n})(Lc||(Lc={}));var Ic;(function(t){function n(s,u,c,h,m,p){var y={name:s,detail:u,kind:c,range:h,selectionRange:m};return p!==void 0&&(y.children=p),y}t.create=n;function i(s){var u=s;return u&&me.string(u.name)&&me.number(u.kind)&&Oe.is(u.range)&&Oe.is(u.selectionRange)&&(u.detail===void 0||me.string(u.detail))&&(u.deprecated===void 0||me.boolean(u.deprecated))&&(u.children===void 0||Array.isArray(u.children))&&(u.tags===void 0||Array.isArray(u.tags))}t.is=i})(Ic||(Ic={}));var Mc;(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"})(Mc||(Mc={}));var Bu;(function(t){t.Invoked=1,t.Automatic=2})(Bu||(Bu={}));var Nc;(function(t){function n(s,u,c){var h={diagnostics:s};return u!=null&&(h.only=u),c!=null&&(h.triggerKind=c),h}t.create=n;function i(s){var u=s;return me.defined(u)&&me.typedArray(u.diagnostics,Yt.is)&&(u.only===void 0||me.typedArray(u.only,me.string))&&(u.triggerKind===void 0||u.triggerKind===Bu.Invoked||u.triggerKind===Bu.Automatic)}t.is=i})(Nc||(Nc={}));var Dc;(function(t){function n(s,u,c){var h={title:s},m=!0;return typeof u=="string"?(m=!1,h.kind=u):Xt.is(u)?h.command=u:h.edit=u,m&&c!==void 0&&(h.kind=c),h}t.create=n;function i(s){var u=s;return u&&me.string(u.title)&&(u.diagnostics===void 0||me.typedArray(u.diagnostics,Yt.is))&&(u.kind===void 0||me.string(u.kind))&&(u.edit!==void 0||u.command!==void 0)&&(u.command===void 0||Xt.is(u.command))&&(u.isPreferred===void 0||me.boolean(u.isPreferred))&&(u.edit===void 0||or.is(u.edit))}t.is=i})(Dc||(Dc={}));var Fc;(function(t){function n(s,u){var c={range:s};return me.defined(u)&&(c.data=u),c}t.create=n;function i(s){var u=s;return me.defined(u)&&Oe.is(u.range)&&(me.undefined(u.command)||Xt.is(u.command))}t.is=i})(Fc||(Fc={}));var Rc;(function(t){function n(s,u){return{tabSize:s,insertSpaces:u}}t.create=n;function i(s){var u=s;return me.defined(u)&&me.uinteger(u.tabSize)&&me.boolean(u.insertSpaces)}t.is=i})(Rc||(Rc={}));var Bc;(function(t){function n(s,u,c){return{range:s,target:u,data:c}}t.create=n;function i(s){var u=s;return me.defined(u)&&Oe.is(u.range)&&(me.undefined(u.target)||me.string(u.target))}t.is=i})(Bc||(Bc={}));var ju;(function(t){function n(s,u){return{range:s,parent:u}}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&Oe.is(u.range)&&(u.parent===void 0||t.is(u.parent))}t.is=i})(ju||(ju={}));var jc;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(jc||(jc={}));var Wc;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Wc||(Wc={}));var Hc;(function(t){function n(i){var s=i;return me.objectLiteral(s)&&(s.resultId===void 0||typeof s.resultId=="string")&&Array.isArray(s.data)&&(s.data.length===0||typeof s.data[0]=="number")}t.is=n})(Hc||(Hc={}));var Uc;(function(t){function n(s,u){return{range:s,text:u}}t.create=n;function i(s){var u=s;return u!=null&&Oe.is(u.range)&&me.string(u.text)}t.is=i})(Uc||(Uc={}));var zc;(function(t){function n(s,u,c){return{range:s,variableName:u,caseSensitiveLookup:c}}t.create=n;function i(s){var u=s;return u!=null&&Oe.is(u.range)&&me.boolean(u.caseSensitiveLookup)&&(me.string(u.variableName)||u.variableName===void 0)}t.is=i})(zc||(zc={}));var _c;(function(t){function n(s,u){return{range:s,expression:u}}t.create=n;function i(s){var u=s;return u!=null&&Oe.is(u.range)&&(me.string(u.expression)||u.expression===void 0)}t.is=i})(_c||(_c={}));var Vc;(function(t){function n(s,u){return{frameId:s,stoppedLocation:u}}t.create=n;function i(s){var u=s;return me.defined(u)&&Oe.is(s.stoppedLocation)}t.is=i})(Vc||(Vc={}));var ec;(function(t){t.Type=1,t.Parameter=2;function n(i){return i===1||i===2}t.is=n})(ec||(ec={}));var tc;(function(t){function n(s){return{value:s}}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&(u.tooltip===void 0||me.string(u.tooltip)||Ys.is(u.tooltip))&&(u.location===void 0||Ne.is(u.location))&&(u.command===void 0||Xt.is(u.command))}t.is=i})(tc||(tc={}));var $c;(function(t){function n(s,u,c){var h={position:s,label:u};return c!==void 0&&(h.kind=c),h}t.create=n;function i(s){var u=s;return me.objectLiteral(u)&&Me.is(u.position)&&(me.string(u.label)||me.typedArray(u.label,tc.is))&&(u.kind===void 0||ec.is(u.kind))&&u.textEdits===void 0||me.typedArray(u.textEdits,Mt.is)&&(u.tooltip===void 0||me.string(u.tooltip)||Ys.is(u.tooltip))&&(u.paddingLeft===void 0||me.boolean(u.paddingLeft))&&(u.paddingRight===void 0||me.boolean(u.paddingRight))}t.is=i})($c||($c={}));var Gc;(function(t){function n(i){var s=i;return me.objectLiteral(s)&&xe.is(s.uri)&&me.string(s.name)}t.is=n})(Gc||(Gc={}));var bv=null,Kc;(function(t){function n(c,h,m,p){return new zd(c,h,m,p)}t.create=n;function i(c){var h=c;return!!(me.defined(h)&&me.string(h.uri)&&(me.undefined(h.languageId)||me.string(h.languageId))&&me.uinteger(h.lineCount)&&me.func(h.getText)&&me.func(h.positionAt)&&me.func(h.offsetAt))}t.is=i;function s(c,h){for(var m=c.getText(),p=u(h,function(_,fe){var ae=_.range.start.line-fe.range.start.line;return ae===0?_.range.start.character-fe.range.start.character:ae}),y=m.length,T=p.length-1;T>=0;T--){var L=p[T],q=c.offsetAt(L.range.start),W=c.offsetAt(L.range.end);if(W<=y)m=m.substring(0,q)+L.newText+m.substring(W,m.length);else throw new Error("Overlapping edit");y=q}return m}t.applyEdits=s;function u(c,h){if(c.length<=1)return c;var m=c.length/2|0,p=c.slice(0,m),y=c.slice(m);u(p,h),u(y,h);for(var T=0,L=0,q=0;T<p.length&&L<y.length;){var W=h(p[T],y[L]);W<=0?c[q++]=p[T++]:c[q++]=y[L++]}for(;T<p.length;)c[q++]=p[T++];for(;L<y.length;)c[q++]=y[L++];return c}})(Kc||(Kc={}));var zd=function(){function t(n,i,s,u){this._uri=n,this._languageId=i,this._version=s,this._content=u,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(n){if(n){var i=this.offsetAt(n.start),s=this.offsetAt(n.end);return this._content.substring(i,s)}return this._content},t.prototype.update=function(n,i){this._content=n.text,this._version=i,this._lineOffsets=void 0},t.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var n=[],i=this._content,s=!0,u=0;u<i.length;u++){s&&(n.push(u),s=!1);var c=i.charAt(u);s=c==="\r"||c===`
184
- `,c==="\r"&&u+1<i.length&&i.charAt(u+1)===`
185
- `&&u++}s&&i.length>0&&n.push(i.length),this._lineOffsets=n}return this._lineOffsets},t.prototype.positionAt=function(n){n=Math.max(Math.min(n,this._content.length),0);var i=this.getLineOffsets(),s=0,u=i.length;if(u===0)return Me.create(0,n);for(;s<u;){var c=Math.floor((s+u)/2);i[c]>n?u=c:s=c+1}var h=s-1;return Me.create(h,n-i[h])},t.prototype.offsetAt=function(n){var i=this.getLineOffsets();if(n.line>=i.length)return this._content.length;if(n.line<0)return 0;var s=i[n.line],u=n.line+1<i.length?i[n.line+1]:this._content.length;return Math.max(Math.min(s+n.character,u),s)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),me;(function(t){var n=Object.prototype.toString;function i(W){return typeof W<"u"}t.defined=i;function s(W){return typeof W>"u"}t.undefined=s;function u(W){return W===!0||W===!1}t.boolean=u;function c(W){return n.call(W)==="[object String]"}t.string=c;function h(W){return n.call(W)==="[object Number]"}t.number=h;function m(W,_,fe){return n.call(W)==="[object Number]"&&_<=W&&W<=fe}t.numberRange=m;function p(W){return n.call(W)==="[object Number]"&&-2147483648<=W&&W<=2147483647}t.integer=p;function y(W){return n.call(W)==="[object Number]"&&0<=W&&W<=2147483647}t.uinteger=y;function T(W){return n.call(W)==="[object Function]"}t.func=T;function L(W){return W!==null&&typeof W=="object"}t.objectLiteral=L;function q(W,_){return Array.isArray(W)&&W.every(_)}t.typedArray=q})(me||(me={}));var _d=function(t,n,i){if(i||arguments.length===2)for(var s=0,u=n.length,c;s<u;s++)(c||!(s in n))&&(c||(c=Array.prototype.slice.call(n,0,s)),c[s]=n[s]);return t.concat(c||Array.prototype.slice.call(n))},Yc=function(){function t(n,i,s,u){this._uri=n,this._languageId=i,this._version=s,this._content=u,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(n){if(n){var i=this.offsetAt(n.start),s=this.offsetAt(n.end);return this._content.substring(i,s)}return this._content},t.prototype.update=function(n,i){for(var s=0,u=n;s<u.length;s++){var c=u[s];if(t.isIncremental(c)){var h=Jc(c.range),m=this.offsetAt(h.start),p=this.offsetAt(h.end);this._content=this._content.substring(0,m)+c.text+this._content.substring(p,this._content.length);var y=Math.max(h.start.line,0),T=Math.max(h.end.line,0),L=this._lineOffsets,q=Xc(c.text,!1,m);if(T-y===q.length)for(var W=0,_=q.length;W<_;W++)L[W+y+1]=q[W];else q.length<1e4?L.splice.apply(L,_d([y+1,T-y],q,!1)):this._lineOffsets=L=L.slice(0,y+1).concat(q,L.slice(T+1));var fe=c.text.length-(p-m);if(fe!==0)for(var W=y+1+q.length,_=L.length;W<_;W++)L[W]=L[W]+fe}else if(t.isFull(c))this._content=c.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=Xc(this._content,!0)),this._lineOffsets},t.prototype.positionAt=function(n){n=Math.max(Math.min(n,this._content.length),0);var i=this.getLineOffsets(),s=0,u=i.length;if(u===0)return{line:0,character:n};for(;s<u;){var c=Math.floor((s+u)/2);i[c]>n?u=c:s=c+1}var h=s-1;return{line:h,character:n-i[h]}},t.prototype.offsetAt=function(n){var i=this.getLineOffsets();if(n.line>=i.length)return this._content.length;if(n.line<0)return 0;var s=i[n.line],u=n.line+1<i.length?i[n.line+1]:this._content.length;return Math.max(Math.min(s+n.character,u),s)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t.isIncremental=function(n){var i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")},t.isFull=function(n){var i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0},t}(),Wu;(function(t){function n(u,c,h,m){return new Yc(u,c,h,m)}t.create=n;function i(u,c,h){if(u instanceof Yc)return u.update(c,h),u;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function s(u,c){for(var h=u.getText(),m=rc(c.map(Vd),function(_,fe){var ae=_.range.start.line-fe.range.start.line;return ae===0?_.range.start.character-fe.range.start.character:ae}),p=0,y=[],T=0,L=m;T<L.length;T++){var q=L[T],W=u.offsetAt(q.range.start);if(W<p)throw new Error("Overlapping edit");W>p&&y.push(h.substring(p,W)),q.newText.length&&y.push(q.newText),p=u.offsetAt(q.range.end)}return y.push(h.substr(p)),y.join("")}t.applyEdits=s})(Wu||(Wu={}));function rc(t,n){if(t.length<=1)return t;var i=t.length/2|0,s=t.slice(0,i),u=t.slice(i);rc(s,n),rc(u,n);for(var c=0,h=0,m=0;c<s.length&&h<u.length;){var p=n(s[c],u[h]);p<=0?t[m++]=s[c++]:t[m++]=u[h++]}for(;c<s.length;)t[m++]=s[c++];for(;h<u.length;)t[m++]=u[h++];return t}function Xc(t,n,i){i===void 0&&(i=0);for(var s=n?[i]:[],u=0;u<t.length;u++){var c=t.charCodeAt(u);(c===13||c===10)&&(c===13&&u+1<t.length&&t.charCodeAt(u+1)===10&&u++,s.push(i+u+1))}return s}function Jc(t){var n=t.start,i=t.end;return n.line>i.line||n.line===i.line&&n.character>i.character?{start:i,end:n}:t}function Vd(t){var n=Jc(t.range);return n!==t.range?{newText:t.newText,range:n}:t}var Pt;(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"})(Pt||(Pt={}));var Qc;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[ea.Markdown,ea.PlainText],commitCharactersSupport:!0}}}}})(Qc||(Qc={}));var ta=function(){var t=function(n,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var c in u)u.hasOwnProperty(c)&&(s[c]=u[c])},t(n,i)};return function(n,i){t(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)}}(),$d={"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,}))$/}},ra=function(){function t(n,i,s){this.offset=i,this.length=s,this.parent=n}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}(),Gd=function(t){ta(n,t);function n(i,s){var u=t.call(this,i,s)||this;return u.type="null",u.value=null,u}return n}(ra),Zc=function(t){ta(n,t);function n(i,s,u){var c=t.call(this,i,u)||this;return c.type="boolean",c.value=s,c}return n}(ra),Kd=function(t){ta(n,t);function n(i,s){var u=t.call(this,i,s)||this;return u.type="array",u.items=[],u}return Object.defineProperty(n.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),n}(ra),Yd=function(t){ta(n,t);function n(i,s){var u=t.call(this,i,s)||this;return u.type="number",u.isInteger=!0,u.value=Number.NaN,u}return n}(ra),qc=function(t){ta(n,t);function n(i,s,u){var c=t.call(this,i,s,u)||this;return c.type="string",c.value="",c}return n}(ra),Xd=function(t){ta(n,t);function n(i,s){var u=t.call(this,i,s)||this;return u.type="property",u.colonOffset=-1,u}return Object.defineProperty(n.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),n}(ra),Jd=function(t){ta(n,t);function n(i,s){var u=t.call(this,i,s)||this;return u.type="object",u.properties=[],u}return Object.defineProperty(n.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),n}(ra);function cn(t){return X(t)?t?{}:{not:{}}:t}var ed;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(ed||(ed={}));var Qd=function(){function t(n,i){n===void 0&&(n=-1),i===void 0&&(i=null),this.focusOffset=n,this.exclude=i,this.schemas=[]}return t.prototype.add=function(n){this.schemas.push(n)},t.prototype.merge=function(n){var i;(i=this.schemas).push.apply(i,n.schemas)},t.prototype.include=function(n){return(this.focusOffset===-1||td(n,this.focusOffset))&&n!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),nc=function(){function t(){}return Object.defineProperty(t.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.add=function(n){},t.prototype.merge=function(n){},t.prototype.include=function(n){return!0},t.prototype.newSub=function(){return this},t.instance=new t,t}(),dn=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(n){for(var i=0,s=n;i<s.length;i++){var u=s[i];this.merge(u)}},t.prototype.merge=function(n){this.problems=this.problems.concat(n.problems)},t.prototype.mergeEnumValues=function(n){if(!this.enumValueMatch&&!n.enumValueMatch&&this.enumValues&&n.enumValues){this.enumValues=this.enumValues.concat(n.enumValues);for(var i=0,s=this.problems;i<s.length;i++){var u=s[i];u.code===Pt.EnumValueMismatch&&(u.message="Value is not accepted. Valid values: "+this.enumValues.map(function(c){return JSON.stringify(c)}).join(", ")+".")}}},t.prototype.mergePropertyMatch=function(n){this.merge(n),this.propertiesMatches++,(n.enumValueMatch||!n.hasProblems()&&n.propertiesMatches)&&this.propertiesValueMatches++,n.enumValueMatch&&n.enumValues&&n.enumValues.length===1&&this.primaryValueMatches++},t.prototype.compare=function(n){var i=this.hasProblems();return i!==n.hasProblems()?i?-1:1:this.enumValueMatch!==n.enumValueMatch?n.enumValueMatch?-1:1:this.primaryValueMatches!==n.primaryValueMatches?this.primaryValueMatches-n.primaryValueMatches:this.propertiesValueMatches!==n.propertiesValueMatches?this.propertiesValueMatches-n.propertiesValueMatches:this.propertiesMatches-n.propertiesMatches},t}();function Zd(t,n){return n===void 0&&(n=[]),new rd(t,n,[])}function So(t){return r(t)}function ic(t){return e(t)}function td(t,n,i){return i===void 0&&(i=!1),n>=t.offset&&n<t.offset+t.length||i&&n===t.offset+t.length}var rd=function(){function t(n,i,s){i===void 0&&(i=[]),s===void 0&&(s=[]),this.root=n,this.syntaxErrors=i,this.comments=s}return t.prototype.getNodeFromOffset=function(n,i){if(i===void 0&&(i=!1),this.root)return Ha(this.root,n,i)},t.prototype.visit=function(n){if(this.root){var i=function(s){var u=n(s),c=s.children;if(Array.isArray(c))for(var h=0;h<c.length&&u;h++)u=i(c[h]);return u};i(this.root)}},t.prototype.validate=function(n,i){if(this.root&&i){var s=new dn;return Br(this.root,i,s,nc.instance),s.problems.map(function(u){var c=Oe.create(n.positionAt(u.location.offset),n.positionAt(u.location.offset+u.location.length));return Yt.create(c,u.message,u.severity,u.code)})}return null},t.prototype.getMatchingSchemas=function(n,i,s){i===void 0&&(i=-1),s===void 0&&(s=null);var u=new Qd(i,s);return this.root&&n&&Br(this.root,n,new dn,u),u.schemas},t}();function Br(t,n,i,s){if(!t||!s.include(t))return;switch(t.type){case"object":p(t,n,i,s);break;case"array":m(t,n,i,s);break;case"string":h(t,n,i,s);break;case"number":c(t,n,i,s);break;case"property":return Br(t.valueNode,n,i,s)}u(),s.add({node:t,schema:n});function u(){function y(Be){return t.type===Be||Be==="integer"&&t.type==="number"&&t.isInteger||n.nullable&&t.value===null}if(Array.isArray(n.type)?n.type.some(y)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ze.Warning,message:n.errorMessage||"Incorrect type. Expected one of "+n.type.join(", ")+"."}):n.type&&(y(n.type)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ze.Warning,message:n.errorMessage||'Incorrect type. Expected "'+n.type+'".'})),Array.isArray(n.allOf))for(var T=0,L=n.allOf;T<L.length;T++){var q=L[T];Br(t,cn(q),i,s)}var W=cn(n.not);if(W){var _=new dn,fe=s.newSub();Br(t,W,_,fe),_.hasProblems()||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ze.Warning,message:"Matches a schema that is not allowed."});for(var ae=0,oe=fe.schemas;ae<oe.length;ae++){var ue=oe[ae];ue.inverted=!ue.inverted,s.add(ue)}}var ye=function(Be,et){for(var jt=[],ut=null,jr=0,ei=Be;jr<ei.length;jr++){var ji=ei[jr],ti=cn(ji),Wr=new dn,En=s.newSub();if(Br(t,ti,Wr,En),Wr.hasProblems()||jt.push(ti),!ut)ut={schema:ti,validationResult:Wr,matchingSchemas:En};else if(!et&&!Wr.hasProblems()&&!ut.validationResult.hasProblems())ut.matchingSchemas.merge(En),ut.validationResult.propertiesMatches+=Wr.propertiesMatches,ut.validationResult.propertiesValueMatches+=Wr.propertiesValueMatches;else{var qt=Wr.compare(ut.validationResult);qt>0?ut={schema:ti,validationResult:Wr,matchingSchemas:En}:qt===0&&(ut.matchingSchemas.merge(En),ut.validationResult.mergeEnumValues(Wr))}}return jt.length>1&&et&&i.problems.push({location:{offset:t.offset,length:1},severity:Ze.Warning,message:"Matches multiple schemas when only one must validate."}),ut!==null&&(i.merge(ut.validationResult),i.propertiesMatches+=ut.validationResult.propertiesMatches,i.propertiesValueMatches+=ut.validationResult.propertiesValueMatches,s.merge(ut.matchingSchemas)),jt.length};Array.isArray(n.anyOf)&&ye(n.anyOf,!1),Array.isArray(n.oneOf)&&ye(n.oneOf,!0);var Ae=function(Be){var et=new dn,jt=s.newSub();Br(t,cn(Be),et,jt),i.merge(et),i.propertiesMatches+=et.propertiesMatches,i.propertiesValueMatches+=et.propertiesValueMatches,s.merge(jt)},we=function(Be,et,jt){var ut=cn(Be),jr=new dn,ei=s.newSub();Br(t,ut,jr,ei),s.merge(ei),jr.hasProblems()?jt&&Ae(jt):et&&Ae(et)},ke=cn(n.if);if(ke&&we(ke,cn(n.then),cn(n.else)),Array.isArray(n.enum)){for(var Te=So(t),De=!1,pe=0,Ie=n.enum;pe<Ie.length;pe++){var Ee=Ie[pe];if(w(Te,Ee)){De=!0;break}}i.enumValues=n.enum,i.enumValueMatch=De,De||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ze.Warning,code:Pt.EnumValueMismatch,message:n.errorMessage||"Value is not accepted. Valid values: "+n.enum.map(function(Be){return JSON.stringify(Be)}).join(", ")+"."})}if(U(n.const)){var Te=So(t);w(Te,n.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:t.offset,length:t.length},severity:Ze.Warning,code:Pt.EnumValueMismatch,message:n.errorMessage||"Value must be "+JSON.stringify(n.const)+"."}),i.enumValueMatch=!1),i.enumValues=[n.const]}n.deprecationMessage&&t.parent&&i.problems.push({location:{offset:t.parent.offset,length:t.parent.length},severity:Ze.Warning,message:n.deprecationMessage})}function c(y,T,L,q){var W=y.value;O(T.multipleOf)&&W%T.multipleOf!==0&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Value is not divisible by "+T.multipleOf+"."});function _(Ae,we){if(O(we))return we;if(X(we)&&we)return Ae}function fe(Ae,we){if(!X(we)||!we)return Ae}var ae=_(T.minimum,T.exclusiveMinimum);O(ae)&&W<=ae&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Value is below the exclusive minimum of "+ae+"."});var oe=_(T.maximum,T.exclusiveMaximum);O(oe)&&W>=oe&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Value is above the exclusive maximum of "+oe+"."});var ue=fe(T.minimum,T.exclusiveMinimum);O(ue)&&W<ue&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Value is below the minimum of "+ue+"."});var ye=fe(T.maximum,T.exclusiveMaximum);O(ye)&&W>ye&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Value is above the maximum of "+ye+"."})}function h(y,T,L,q){if(O(T.minLength)&&y.value.length<T.minLength&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"String is shorter than the minimum length of "+T.minLength+"."}),O(T.maxLength)&&y.value.length>T.maxLength&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"String is longer than the maximum length of "+T.maxLength+"."}),he(T.pattern)){var W=new RegExp(T.pattern);W.test(y.value)||L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:T.patternErrorMessage||T.errorMessage||'String does not match the pattern of "'+T.pattern+'".'})}if(T.format)switch(T.format){case"uri":case"uri-reference":{var _=void 0;if(!y.value)_="URI expected.";else{var fe=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(y.value);fe?!fe[2]&&T.format==="uri"&&(_="URI with a scheme is expected."):_="URI is expected."}_&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:T.patternErrorMessage||T.errorMessage||"String is not a URI: "+_})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var ae=$d[T.format];(!y.value||!ae.pattern.exec(y.value))&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:T.patternErrorMessage||T.errorMessage||ae.errorMessage});break;default:}}function m(y,T,L,q){if(Array.isArray(T.items)){for(var W=T.items,_=0;_<W.length;_++){var fe=W[_],ae=cn(fe),oe=new dn,ue=y.items[_];ue?(Br(ue,ae,oe,q),L.mergePropertyMatch(oe)):y.items.length>=W.length&&L.propertiesValueMatches++}if(y.items.length>W.length)if(typeof T.additionalItems=="object")for(var ye=W.length;ye<y.items.length;ye++){var oe=new dn;Br(y.items[ye],T.additionalItems,oe,q),L.mergePropertyMatch(oe)}else T.additionalItems===!1&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Array has too many items according to schema. Expected "+W.length+" or fewer."})}else{var Ae=cn(T.items);if(Ae)for(var we=0,ke=y.items;we<ke.length;we++){var ue=ke[we],oe=new dn;Br(ue,Ae,oe,q),L.mergePropertyMatch(oe)}}var Te=cn(T.contains);if(Te){var De=y.items.some(function(Ee){var Be=new dn;return Br(Ee,Te,Be,nc.instance),!Be.hasProblems()});De||L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:T.errorMessage||"Array does not contain required item."})}if(O(T.minItems)&&y.items.length<T.minItems&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Array has too few items. Expected "+T.minItems+" or more."}),O(T.maxItems)&&y.items.length>T.maxItems&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Array has too many items. Expected "+T.maxItems+" or fewer."}),T.uniqueItems===!0){var pe=So(y),Ie=pe.some(function(Ee,Be){return Be!==pe.lastIndexOf(Ee)});Ie&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Array has duplicate items."})}}function p(y,T,L,q){for(var W=Object.create(null),_=[],fe=0,ae=y.properties;fe<ae.length;fe++){var oe=ae[fe],ue=oe.keyNode.value;W[ue]=oe.valueNode,_.push(ue)}if(Array.isArray(T.required))for(var ye=0,Ae=T.required;ye<Ae.length;ye++){var we=Ae[ye];if(!W[we]){var ke=y.parent&&y.parent.type==="property"&&y.parent.keyNode,Te=ke?{offset:ke.offset,length:ke.length}:{offset:y.offset,length:1};L.problems.push({location:Te,severity:Ze.Warning,message:'Missing property "'+we+'".'})}}var De=function(Zs){for(var Ka=_.indexOf(Zs);Ka>=0;)_.splice(Ka,1),Ka=_.indexOf(Zs)};if(T.properties)for(var pe=0,Ie=Object.keys(T.properties);pe<Ie.length;pe++){var we=Ie[pe];De(we);var Ee=T.properties[we],Be=W[we];if(Be)if(X(Ee))if(Ee)L.propertiesMatches++,L.propertiesValueMatches++;else{var oe=Be.parent;L.problems.push({location:{offset:oe.keyNode.offset,length:oe.keyNode.length},severity:Ze.Warning,message:T.errorMessage||"Property "+we+" is not allowed."})}else{var et=new dn;Br(Be,Ee,et,q),L.mergePropertyMatch(et)}}if(T.patternProperties)for(var jt=0,ut=Object.keys(T.patternProperties);jt<ut.length;jt++)for(var jr=ut[jt],ei=new RegExp(jr),ji=0,ti=_.slice(0);ji<ti.length;ji++){var we=ti[ji];if(ei.test(we)){De(we);var Be=W[we];if(Be){var Ee=T.patternProperties[jr];if(X(Ee))if(Ee)L.propertiesMatches++,L.propertiesValueMatches++;else{var oe=Be.parent;L.problems.push({location:{offset:oe.keyNode.offset,length:oe.keyNode.length},severity:Ze.Warning,message:T.errorMessage||"Property "+we+" is not allowed."})}else{var et=new dn;Br(Be,Ee,et,q),L.mergePropertyMatch(et)}}}}if(typeof T.additionalProperties=="object")for(var Wr=0,En=_;Wr<En.length;Wr++){var we=En[Wr],Be=W[we];if(Be){var et=new dn;Br(Be,T.additionalProperties,et,q),L.mergePropertyMatch(et)}}else if(T.additionalProperties===!1&&_.length>0)for(var qt=0,Gr=_;qt<Gr.length;qt++){var we=Gr[qt],Be=W[we];if(Be){var oe=Be.parent;L.problems.push({location:{offset:oe.keyNode.offset,length:oe.keyNode.length},severity:Ze.Warning,message:T.errorMessage||"Property "+we+" is not allowed."})}}if(O(T.maxProperties)&&y.properties.length>T.maxProperties&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Object has more properties than limit of "+T.maxProperties+"."}),O(T.minProperties)&&y.properties.length<T.minProperties&&L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Object has fewer properties than the required number of "+T.minProperties}),T.dependencies)for(var Ar=0,Tn=Object.keys(T.dependencies);Ar<Tn.length;Ar++){var ue=Tn[Ar],Rn=W[ue];if(Rn){var hr=T.dependencies[ue];if(Array.isArray(hr))for(var Kr=0,Bn=hr;Kr<Bn.length;Kr++){var na=Bn[Kr];W[na]?L.propertiesValueMatches++:L.problems.push({location:{offset:y.offset,length:y.length},severity:Ze.Warning,message:"Object is missing property "+na+" required by property {$key}."})}else{var Ee=cn(hr);if(Ee){var et=new dn;Br(y,Ee,et,q),L.mergePropertyMatch(et)}}}}var Ao=cn(T.propertyNames);if(Ao)for(var ri=0,Qs=y.properties;ri<Qs.length;ri++){var Gu=Qs[ri],ue=Gu.keyNode;ue&&Br(ue,Ao,L,nc.instance)}}}function qd(t,n){var i=[],s=-1,u=t.getText(),c=yo(u,!1),h=n&&n.collectComments?[]:void 0;function m(){for(;;){var ke=c.scan();switch(L(),ke){case 12:case 13:Array.isArray(h)&&h.push(Oe.create(t.positionAt(c.getTokenOffset()),t.positionAt(c.getTokenOffset()+c.getTokenLength())));break;case 15:case 14:break;default:return ke}}}function p(ke){return c.getToken()===ke?(m(),!0):!1}function y(ke,Te,De,pe,Ie){if(Ie===void 0&&(Ie=Ze.Error),i.length===0||De!==s){var Ee=Oe.create(t.positionAt(De),t.positionAt(pe));i.push(Yt.create(Ee,ke,Ie,Te,t.languageId)),s=De}}function T(ke,Te,De,pe,Ie){De===void 0&&(De=null),pe===void 0&&(pe=[]),Ie===void 0&&(Ie=[]);var Ee=c.getTokenOffset(),Be=c.getTokenOffset()+c.getTokenLength();if(Ee===Be&&Ee>0){for(Ee--;Ee>0&&/\s/.test(u.charAt(Ee));)Ee--;Be=Ee+1}if(y(ke,Te,Ee,Be),De&&q(De,!1),pe.length+Ie.length>0)for(var et=c.getToken();et!==17;){if(pe.indexOf(et)!==-1){m();break}else if(Ie.indexOf(et)!==-1)break;et=m()}return De}function L(){switch(c.getTokenError()){case 4:return T("Invalid unicode sequence in string.",Pt.InvalidUnicode),!0;case 5:return T("Invalid escape character in string.",Pt.InvalidEscapeCharacter),!0;case 3:return T("Unexpected end of number.",Pt.UnexpectedEndOfNumber),!0;case 1:return T("Unexpected end of comment.",Pt.UnexpectedEndOfComment),!0;case 2:return T("Unexpected end of string.",Pt.UnexpectedEndOfString),!0;case 6:return T("Invalid characters in string. Control characters must be escaped.",Pt.InvalidCharacter),!0}return!1}function q(ke,Te){return ke.length=c.getTokenOffset()+c.getTokenLength()-ke.offset,Te&&m(),ke}function W(ke){if(c.getToken()!==3)return null;var Te=new Kd(ke,c.getTokenOffset());m();for(var De=0,pe=!1;c.getToken()!==4&&c.getToken()!==17;){if(c.getToken()===5){pe||T("Value expected",Pt.ValueExpected);var Ie=c.getTokenOffset();if(m(),c.getToken()===4){pe&&y("Trailing comma",Pt.TrailingComma,Ie,Ie+1);continue}}else pe&&T("Expected comma",Pt.CommaExpected);var Ee=ye(Te,De++);Ee?Te.items.push(Ee):T("Value expected",Pt.ValueExpected,null,[],[4,5]),pe=!0}return c.getToken()!==4?T("Expected comma or closing bracket",Pt.CommaOrCloseBacketExpected,Te):q(Te,!0)}function _(ke,Te){var De=new Xd(ke,c.getTokenOffset()),pe=ae(De);if(!pe)if(c.getToken()===16){T("Property keys must be doublequoted",Pt.Undefined);var Ie=new qc(De,c.getTokenOffset(),c.getTokenLength());Ie.value=c.getTokenValue(),pe=Ie,m()}else return null;De.keyNode=pe;var Ee=Te[pe.value];if(Ee?(y("Duplicate object key",Pt.DuplicateKey,De.keyNode.offset,De.keyNode.offset+De.keyNode.length,Ze.Warning),typeof Ee=="object"&&y("DuplicateKeyWarning",Pt.DuplicateKey,Ee.keyNode.offset,Ee.keyNode.offset+Ee.keyNode.length,Ze.Warning),Te[pe.value]=!0):Te[pe.value]=De,c.getToken()===6)De.colonOffset=c.getTokenOffset(),m();else if(T("Colon expected",Pt.ColonExpected),c.getToken()===10&&t.positionAt(pe.offset+pe.length).line<t.positionAt(c.getTokenOffset()).line)return De.length=pe.length,De;var Be=ye(De,pe.value);return Be?(De.valueNode=Be,De.length=Be.offset+Be.length-De.offset,De):T("Value expected",Pt.ValueExpected,De,[],[2,5])}function fe(ke){if(c.getToken()!==1)return null;var Te=new Jd(ke,c.getTokenOffset()),De=Object.create(null);m();for(var pe=!1;c.getToken()!==2&&c.getToken()!==17;){if(c.getToken()===5){pe||T("Property expected",Pt.PropertyExpected);var Ie=c.getTokenOffset();if(m(),c.getToken()===2){pe&&y("Trailing comma",Pt.TrailingComma,Ie,Ie+1);continue}}else pe&&T("Expected comma",Pt.CommaExpected);var Ee=_(Te,De);Ee?Te.properties.push(Ee):T("Property expected",Pt.PropertyExpected,null,[],[2,5]),pe=!0}return c.getToken()!==2?T("Expected comma or closing brace",Pt.CommaOrCloseBraceExpected,Te):q(Te,!0)}function ae(ke){if(c.getToken()!==10)return null;var Te=new qc(ke,c.getTokenOffset());return Te.value=c.getTokenValue(),q(Te,!0)}function oe(ke){if(c.getToken()!==11)return null;var Te=new Yd(ke,c.getTokenOffset());if(c.getTokenError()===0){var De=c.getTokenValue();try{var pe=JSON.parse(De);if(!O(pe))return T("Invalid number format.",Pt.Undefined,Te);Te.value=pe}catch{return T("Invalid number format.",Pt.Undefined,Te)}Te.isInteger=De.indexOf(".")===-1}return q(Te,!0)}function ue(ke){var Te;switch(c.getToken()){case 7:return q(new Gd(ke,c.getTokenOffset()),!0);case 8:return q(new Zc(ke,!0,c.getTokenOffset()),!0);case 9:return q(new Zc(ke,!1,c.getTokenOffset()),!0);default:return null}}function ye(ke,Te){return W(ke)||fe(ke)||ae(ke)||oe(ke)||ue(ke)}var Ae=null,we=m();return we!==17&&(Ae=ye(null,null),Ae?c.getToken()!==17&&T("End of file expected.",Pt.Undefined):T("Expected a JSON object, array or literal.",Pt.Undefined)),new rd(Ae,i,h)}function oc(t,n,i){if(t!==null&&typeof t=="object"){var s=n+" ";if(Array.isArray(t)){if(t.length===0)return"[]";for(var u=`[
186
- `,c=0;c<t.length;c++)u+=s+oc(t[c],s,i),c<t.length-1&&(u+=","),u+=`
187
- `;return u+=n+"]",u}else{var h=Object.keys(t);if(h.length===0)return"{}";for(var u=`{
188
- `,c=0;c<h.length;c++){var m=h[c];u+=s+JSON.stringify(m)+": "+oc(t[m],s,i),c<h.length-1&&(u+=","),u+=`
189
- `}return u+=n+"}",u}}return i(t)}function eh(t,n){if(t.length<n.length)return!1;for(var i=0;i<n.length;i++)if(t[i]!==n[i])return!1;return!0}function ac(t,n){var i=t.length-n.length;return i>0?t.lastIndexOf(n)===i:i===0?t===n:!1}function th(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function xv(t,n){for(var i="";n>0;)(n&1)===1&&(i+=t),t+=t,n=n>>>1;return i}var rh=[",","}","]"],nh=[":"],ih=function(){function t(n,i,s,u){i===void 0&&(i=[]),s===void 0&&(s=Promise),u===void 0&&(u={}),this.schemaService=n,this.contributions=i,this.promiseConstructor=s,this.clientCapabilities=u,this.templateVarIdCounter=0}return t.prototype.doResolve=function(n){for(var i=this.contributions.length-1;i>=0;i--)if(this.contributions[i].resolveCompletion){var s=this.contributions[i].resolveCompletion(n);if(s)return s}return this.promiseConstructor.resolve(n)},t.prototype.doComplete=function(n,i,s){var u=this,c={items:[],isIncomplete:!1},h=n.getText(),m=n.offsetAt(i),p=s.getNodeFromOffset(m,!0);if(this.isInComment(n,p?p.offset:0,m))return Promise.resolve(c);if(p&&m===p.offset+p.length&&m>0){var y=h[m-1];(p.type==="object"&&y==="}"||p.type==="array"&&y==="]")&&(p=p.parent)}var T=this.getCurrentWord(n,m),L=null;if(p&&(p.type==="string"||p.type==="number"||p.type==="boolean"||p.type==="null"))L=Oe.create(n.positionAt(p.offset),n.positionAt(p.offset+p.length));else{var q=m-T.length;q>0&&h[q-1]==='"'&&q--,L=Oe.create(n.positionAt(q),i)}var W=this.doesSupportsCommitCharacters(),_={},fe={add:function(ae){var oe=_[ae.label];oe?oe.documentation||(oe.documentation=ae.documentation):(_[ae.label]=ae,L&&(ae.textEdit=Mt.replace(L,ae.insertText)),W&&(ae.commitCharacters=ae.kind===On.Property?nh:rh),c.items.push(ae))},setAsIncomplete:function(){c.isIncomplete=!0},error:function(ae){console.error(ae)},log:function(ae){console.log(ae)},getNumberOfProposals:function(){return c.items.length}};return this.schemaService.getSchemaForResource(n.uri,s).then(function(ae){var oe=[],ue=!0,ye="",Ae=null;if(p&&p.type==="string"){var we=p.parent;we&&we.type==="property"&&we.keyNode===p&&(ue=!we.valueNode,Ae=we,ye=h.substr(p.offset+1,p.length-2),we&&(p=we.parent))}if(p&&p.type==="object"){if(p.offset===m)return c;var ke=p.properties;ke.forEach(function(Ie){(!Ae||Ae!==Ie)&&(_[Ie.keyNode.value]=qf.create("__"))});var Te="";ue&&(Te=u.evaluateSeparatorAfter(n,n.offsetAt(L.end))),ae?u.getPropertyCompletions(ae,s,p,ue,Te,fe):u.getSchemaLessPropertyCompletions(s,p,ye,fe);var De=ic(p);u.contributions.forEach(function(Ie){var Ee=Ie.collectPropertyCompletions(n.uri,De,T,ue,Te==="",fe);Ee&&oe.push(Ee)}),!ae&&T.length>0&&h.charAt(m-T.length-1)!=='"'&&(fe.add({kind:On.Property,label:u.getLabelForValue(T),insertText:u.getInsertTextForProperty(T,null,!1,Te),insertTextFormat:Cr.Snippet,documentation:""}),fe.setAsIncomplete())}var pe={};return ae?u.getValueCompletions(ae,s,p,m,n,fe,pe):u.getSchemaLessValueCompletions(s,p,m,n,fe),u.contributions.length>0&&u.getContributedValueCompletions(s,p,m,n,fe,oe),u.promiseConstructor.all(oe).then(function(){if(fe.getNumberOfProposals()===0){var Ie=m;p&&(p.type==="string"||p.type==="number"||p.type==="boolean"||p.type==="null")&&(Ie=p.offset+p.length);var Ee=u.evaluateSeparatorAfter(n,Ie);u.addFillerValueCompletions(pe,Ee,fe)}return c})})},t.prototype.getPropertyCompletions=function(n,i,s,u,c,h){var m=this,p=i.getMatchingSchemas(n.schema,s.offset);p.forEach(function(y){if(y.node===s&&!y.inverted){var T=y.schema.properties;T&&Object.keys(T).forEach(function(L){var q=T[L],W=!1;if(typeof q=="object"&&q.allOf)for(var _=0,fe=q.allOf;_<fe.length;_++){var ae=fe[_];if(ae.readOnly){W=!0;break}}if(typeof q=="object"&&!q.deprecationMessage&&!q.doNotSuggest&&!W){var oe={kind:On.Property,label:m.sanitizeLabel(L),insertText:m.getInsertTextForProperty(L,q,u,c),insertTextFormat:Cr.Snippet,filterText:m.getFilterTextForValue(L),documentation:m.fromMarkup(q.markdownDescription)||q.description||""};ac(oe.insertText,"$1"+c)&&(oe.command={title:"Suggest",command:"editor.action.triggerSuggest"}),h.add(oe)}})}})},t.prototype.getSchemaLessPropertyCompletions=function(n,i,s,u){var c=this,h=function(p){p.properties.forEach(function(y){var T=y.keyNode.value;u.add({kind:On.Property,label:c.sanitizeLabel(T),insertText:c.getInsertTextForValue(T,""),insertTextFormat:Cr.Snippet,filterText:c.getFilterTextForValue(T),documentation:""})})};if(i.parent)if(i.parent.type==="property"){var m=i.parent.keyNode.value;n.visit(function(p){return p.type==="property"&&p!==i.parent&&p.keyNode.value===m&&p.valueNode&&p.valueNode.type==="object"&&h(p.valueNode),!0})}else i.parent.type==="array"&&i.parent.items.forEach(function(p){p.type==="object"&&p!==i&&h(p)});else i.type==="object"&&u.add({kind:On.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:Cr.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},t.prototype.getSchemaLessValueCompletions=function(n,i,s,u,c){var h=this,m=s;if(i&&(i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(m=i.offset+i.length,i=i.parent),!i){c.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Cr.Snippet,documentation:""}),c.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Cr.Snippet,documentation:""});return}var p=this.evaluateSeparatorAfter(u,m),y=function(W){td(W.parent,s,!0)||c.add({kind:h.getSuggestionKind(W.type),label:h.getLabelTextForMatchingNode(W,u),insertText:h.getInsertTextForMatchingNode(W,u,p),insertTextFormat:Cr.Snippet,documentation:""}),W.type==="boolean"&&h.addBooleanValueCompletion(!W.value,p,c)};if(i.type==="property"&&s>i.colonOffset){var T=i.valueNode;if(T&&(s>T.offset+T.length||T.type==="object"||T.type==="array"))return;var L=i.keyNode.value;n.visit(function(W){return W.type==="property"&&W.keyNode.value===L&&W.valueNode&&y(W.valueNode),!0}),L==="$schema"&&i.parent&&!i.parent.parent&&this.addDollarSchemaCompletions(p,c)}if(i.type==="array")if(i.parent&&i.parent.type==="property"){var q=i.parent.keyNode.value;n.visit(function(W){return W.type==="property"&&W.keyNode.value===q&&W.valueNode&&W.valueNode.type==="array"&&W.valueNode.items.forEach(y),!0})}else i.items.forEach(y)},t.prototype.getValueCompletions=function(n,i,s,u,c,h,m){var p=this,y=u,T=null,L=null;if(s&&(s.type==="string"||s.type==="number"||s.type==="boolean"||s.type==="null")&&(y=s.offset+s.length,L=s,s=s.parent),!s){this.addSchemaValueCompletions(n.schema,"",h,m);return}if(s.type==="property"&&u>s.colonOffset){var q=s.valueNode;if(q&&u>q.offset+q.length)return;T=s.keyNode.value,s=s.parent}if(s&&(T!==null||s.type==="array")){var W=this.evaluateSeparatorAfter(c,y),_=i.getMatchingSchemas(n.schema,s.offset,L);_.forEach(function(fe){if(fe.node===s&&!fe.inverted&&fe.schema){if(s.type==="array"&&fe.schema.items)if(Array.isArray(fe.schema.items)){var ae=p.findItemAtOffset(s,c,u);ae<fe.schema.items.length&&p.addSchemaValueCompletions(fe.schema.items[ae],W,h,m)}else p.addSchemaValueCompletions(fe.schema.items,W,h,m);if(fe.schema.properties){var oe=fe.schema.properties[T];oe&&p.addSchemaValueCompletions(oe,W,h,m)}}}),T==="$schema"&&!s.parent&&this.addDollarSchemaCompletions(W,h),m.boolean&&(this.addBooleanValueCompletion(!0,W,h),this.addBooleanValueCompletion(!1,W,h)),m.null&&this.addNullValueCompletion(W,h)}},t.prototype.getContributedValueCompletions=function(n,i,s,u,c,h){if(!i)this.contributions.forEach(function(T){var L=T.collectDefaultCompletions(u.uri,c);L&&h.push(L)});else if((i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(i=i.parent),i.type==="property"&&s>i.colonOffset){var m=i.keyNode.value,p=i.valueNode;if(!p||s<=p.offset+p.length){var y=ic(i.parent);this.contributions.forEach(function(T){var L=T.collectValueCompletions(u.uri,y,m,c);L&&h.push(L)})}}},t.prototype.addSchemaValueCompletions=function(n,i,s,u){var c=this;typeof n=="object"&&(this.addEnumValueCompletions(n,i,s),this.addDefaultValueCompletions(n,i,s),this.collectTypes(n,u),Array.isArray(n.allOf)&&n.allOf.forEach(function(h){return c.addSchemaValueCompletions(h,i,s,u)}),Array.isArray(n.anyOf)&&n.anyOf.forEach(function(h){return c.addSchemaValueCompletions(h,i,s,u)}),Array.isArray(n.oneOf)&&n.oneOf.forEach(function(h){return c.addSchemaValueCompletions(h,i,s,u)}))},t.prototype.addDefaultValueCompletions=function(n,i,s,u){var c=this;u===void 0&&(u=0);var h=!1;if(U(n.default)){for(var m=n.type,p=n.default,y=u;y>0;y--)p=[p],m="array";s.add({kind:this.getSuggestionKind(m),label:this.getLabelForValue(p),insertText:this.getInsertTextForValue(p,i),insertTextFormat:Cr.Snippet}),h=!0}Array.isArray(n.examples)&&n.examples.forEach(function(T){for(var L=n.type,q=T,W=u;W>0;W--)q=[q],L="array";s.add({kind:c.getSuggestionKind(L),label:c.getLabelForValue(q),insertText:c.getInsertTextForValue(q,i),insertTextFormat:Cr.Snippet}),h=!0}),Array.isArray(n.defaultSnippets)&&n.defaultSnippets.forEach(function(T){var L=n.type,q=T.body,W=T.label,_,fe;if(U(q)){for(var ae=n.type,oe=u;oe>0;oe--)q=[q],ae="array";_=c.getInsertTextForSnippetValue(q,i),fe=c.getFilterTextForSnippetValue(q),W=W||c.getLabelForSnippetValue(q)}else if(typeof T.bodyText=="string"){for(var ue="",ye="",Ae="",oe=u;oe>0;oe--)ue=ue+Ae+`[
190
- `,ye=ye+`
191
- `+Ae+"]",Ae+=" ",L="array";_=ue+Ae+T.bodyText.split(`
192
- `).join(`
193
- `+Ae)+ye+i,W=W||c.sanitizeLabel(_),fe=_.replace(/[\n]/g,"")}s.add({kind:c.getSuggestionKind(L),label:W,documentation:c.fromMarkup(T.markdownDescription)||T.description,insertText:_,insertTextFormat:Cr.Snippet,filterText:fe}),h=!0}),!h&&typeof n.items=="object"&&!Array.isArray(n.items)&&this.addDefaultValueCompletions(n.items,i,s,u+1)},t.prototype.addEnumValueCompletions=function(n,i,s){if(U(n.const)&&s.add({kind:this.getSuggestionKind(n.type),label:this.getLabelForValue(n.const),insertText:this.getInsertTextForValue(n.const,i),insertTextFormat:Cr.Snippet,documentation:this.fromMarkup(n.markdownDescription)||n.description}),Array.isArray(n.enum))for(var u=0,c=n.enum.length;u<c;u++){var h=n.enum[u],m=this.fromMarkup(n.markdownDescription)||n.description;n.markdownEnumDescriptions&&u<n.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?m=this.fromMarkup(n.markdownEnumDescriptions[u]):n.enumDescriptions&&u<n.enumDescriptions.length&&(m=n.enumDescriptions[u]),s.add({kind:this.getSuggestionKind(n.type),label:this.getLabelForValue(h),insertText:this.getInsertTextForValue(h,i),insertTextFormat:Cr.Snippet,documentation:m})}},t.prototype.collectTypes=function(n,i){if(!(Array.isArray(n.enum)||U(n.const))){var s=n.type;Array.isArray(s)?s.forEach(function(u){return i[u]=!0}):i[s]=!0}},t.prototype.addFillerValueCompletions=function(n,i,s){n.object&&s.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},i),insertTextFormat:Cr.Snippet,detail:"New object",documentation:""}),n.array&&s.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],i),insertTextFormat:Cr.Snippet,detail:"New array",documentation:""})},t.prototype.addBooleanValueCompletion=function(n,i,s){s.add({kind:this.getSuggestionKind("boolean"),label:n?"true":"false",insertText:this.getInsertTextForValue(n,i),insertTextFormat:Cr.Snippet,documentation:""})},t.prototype.addNullValueCompletion=function(n,i){i.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+n,insertTextFormat:Cr.Snippet,documentation:""})},t.prototype.addDollarSchemaCompletions=function(n,i){var s=this,u=this.schemaService.getRegisteredSchemaIds(function(c){return c==="http"||c==="https"});u.forEach(function(c){return i.add({kind:On.Module,label:s.getLabelForValue(c),filterText:s.getFilterTextForValue(c),insertText:s.getInsertTextForValue(c,n),insertTextFormat:Cr.Snippet,documentation:""})})},t.prototype.sanitizeLabel=function(n){return n=n.replace(/[\n]/g,"\u21B5"),n.length>57&&(n=n.substr(0,57).trim()+"..."),n},t.prototype.getLabelForValue=function(n){return this.sanitizeLabel(JSON.stringify(n))},t.prototype.getFilterTextForValue=function(n){return JSON.stringify(n)},t.prototype.getFilterTextForSnippetValue=function(n){return JSON.stringify(n).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},t.prototype.getLabelForSnippetValue=function(n){var i=JSON.stringify(n);return i=i.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1"),this.sanitizeLabel(i)},t.prototype.getInsertTextForPlainText=function(n){return n.replace(/[\\\$\}]/g,"\\$&")},t.prototype.getInsertTextForValue=function(n,i){var s=JSON.stringify(n,null," ");return s==="{}"?"{$1}"+i:s==="[]"?"[$1]"+i:this.getInsertTextForPlainText(s+i)},t.prototype.getInsertTextForSnippetValue=function(n,i){var s=function(u){return typeof u=="string"&&u[0]==="^"?u.substr(1):JSON.stringify(u)};return oc(n,"",s)+i},t.prototype.getInsertTextForGuessedValue=function(n,i){switch(typeof n){case"object":return n===null?"${1:null}"+i:this.getInsertTextForValue(n,i);case"string":var s=JSON.stringify(n);return s=s.substr(1,s.length-2),s=this.getInsertTextForPlainText(s),'"${1:'+s+'}"'+i;case"number":case"boolean":return"${1:"+JSON.stringify(n)+"}"+i}return this.getInsertTextForValue(n,i)},t.prototype.getSuggestionKind=function(n){if(Array.isArray(n)){var i=n;n=i.length>0?i[0]:null}if(!n)return On.Value;switch(n){case"string":return On.Value;case"object":return On.Module;case"property":return On.Property;default:return On.Value}},t.prototype.getLabelTextForMatchingNode=function(n,i){switch(n.type){case"array":return"[]";case"object":return"{}";default:var s=i.getText().substr(n.offset,n.length);return s}},t.prototype.getInsertTextForMatchingNode=function(n,i,s){switch(n.type){case"array":return this.getInsertTextForValue([],s);case"object":return this.getInsertTextForValue({},s);default:var u=i.getText().substr(n.offset,n.length)+s;return this.getInsertTextForPlainText(u)}},t.prototype.getInsertTextForProperty=function(n,i,s,u){var c=this.getInsertTextForValue(n,"");if(!s)return c;var h=c+": ",m,p=0;if(i){if(Array.isArray(i.defaultSnippets)){if(i.defaultSnippets.length===1){var y=i.defaultSnippets[0].body;U(y)&&(m=this.getInsertTextForSnippetValue(y,""))}p+=i.defaultSnippets.length}if(i.enum&&(!m&&i.enum.length===1&&(m=this.getInsertTextForGuessedValue(i.enum[0],"")),p+=i.enum.length),U(i.default)&&(m||(m=this.getInsertTextForGuessedValue(i.default,"")),p++),p===0){var T=Array.isArray(i.type)?i.type[0]:i.type;switch(T||(i.properties?T="object":i.items&&(T="array")),T){case"boolean":m="$1";break;case"string":m='"$1"';break;case"object":m="{$1}";break;case"array":m="[$1]";break;case"number":case"integer":m="${1:0}";break;case"null":m="${1:null}";break;default:return c}}}return(!m||p>1)&&(m="$1"),h+m+u},t.prototype.getCurrentWord=function(n,i){for(var s=i-1,u=n.getText();s>=0&&`
194
- \r\v":{[,]}`.indexOf(u.charAt(s))===-1;)s--;return u.substring(s+1,i)},t.prototype.evaluateSeparatorAfter=function(n,i){var s=yo(n.getText(),!0);s.setPosition(i);var u=s.scan();switch(u){case 5:case 2:case 4:case 17:return"";default:return","}},t.prototype.findItemAtOffset=function(n,i,s){for(var u=yo(i.getText(),!0),c=n.items,h=c.length-1;h>=0;h--){var m=c[h];if(s>m.offset+m.length){u.setPosition(m.offset+m.length);var p=u.scan();return p===5&&s>=u.getTokenOffset()+u.getTokenLength()?h+1:h}else if(s>=m.offset)return h}return 0},t.prototype.isInComment=function(n,i,s){var u=yo(n.getText(),!1);u.setPosition(i);for(var c=u.scan();c!==17&&u.getTokenOffset()+u.getTokenLength()<s;)c=u.scan();return(c===12||c===13)&&u.getTokenOffset()<=s},t.prototype.fromMarkup=function(n){if(n&&this.doesSupportMarkdown())return{kind:ea.Markdown,value:n}},t.prototype.doesSupportMarkdown=function(){if(!U(this.supportsMarkdown)){var n=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=n&&n.completionItem&&Array.isArray(n.completionItem.documentationFormat)&&n.completionItem.documentationFormat.indexOf(ea.Markdown)!==-1}return this.supportsMarkdown},t.prototype.doesSupportsCommitCharacters=function(){if(!U(this.supportsCommitCharacters)){var n=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsCommitCharacters=n&&n.completionItem&&!!n.completionItem.commitCharactersSupport}return this.supportsCommitCharacters},t}(),oh=function(){function t(n,i,s){i===void 0&&(i=[]),this.schemaService=n,this.contributions=i,this.promise=s||Promise}return t.prototype.doHover=function(n,i,s){var u=n.offsetAt(i),c=s.getNodeFromOffset(u);if(!c||(c.type==="object"||c.type==="array")&&u>c.offset+1&&u<c.offset+c.length-1)return this.promise.resolve(null);var h=c;if(c.type==="string"){var m=c.parent;if(m&&m.type==="property"&&m.keyNode===c&&(c=m.valueNode,!c))return this.promise.resolve(null)}for(var p=Oe.create(n.positionAt(h.offset),n.positionAt(h.offset+h.length)),y=function(_){var fe={contents:_,range:p};return fe},T=ic(c),L=this.contributions.length-1;L>=0;L--){var q=this.contributions[L],W=q.getInfoContribution(n.uri,T);if(W)return W.then(function(_){return y(_)})}return this.schemaService.getSchemaForResource(n.uri,s).then(function(_){if(_){var fe=s.getMatchingSchemas(_.schema,c.offset),ae=null,oe=null,ue=null,ye=null;fe.every(function(we){if(we.node===c&&!we.inverted&&we.schema&&(ae=ae||we.schema.title,oe=oe||we.schema.markdownDescription||sc(we.schema.description),we.schema.enum)){var ke=we.schema.enum.indexOf(So(c));we.schema.markdownEnumDescriptions?ue=we.schema.markdownEnumDescriptions[ke]:we.schema.enumDescriptions&&(ue=sc(we.schema.enumDescriptions[ke])),ue&&(ye=we.schema.enum[ke],typeof ye!="string"&&(ye=JSON.stringify(ye)))}return!0});var Ae="";return ae&&(Ae=sc(ae)),oe&&(Ae.length>0&&(Ae+=`
195
-
196
- `),Ae+=oe),ue&&(Ae.length>0&&(Ae+=`
197
-
198
- `),Ae+="`"+ah(ye)+"`: "+ue),y([Ae])}return null})},t}();function sc(t){if(t){var n=t.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
136
+ `,xd=(0,Je.ZP)(yd)`
137
+ ${(0,it.Hu)("try-it")};
138
+ ${({inputType:r})=>r==="password"?"padding-right: 40px;":""};
139
+ ${({fullWidth:r})=>r?"width: 100%;":""}
140
+ `,wd=1024;let CS=0;class Ir{constructor(e,t){this.from=e,this.to=t}}class Be{constructor(e={}){this.id=CS++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=er.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}Be.closedBy=new Be({deserialize:r=>r.split(" ")}),Be.openedBy=new Be({deserialize:r=>r.split(" ")}),Be.group=new Be({deserialize:r=>r.split(" ")}),Be.contextHash=new Be({perNode:!0}),Be.lookAhead=new Be({perNode:!0}),Be.mounted=new Be({perNode:!0});class js{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Be.mounted.id]}}const OS=Object.create(null);class er{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):OS,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new er(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Be.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return n=>{for(let i=n.prop(Be.group),s=-1;s<(i?i.length:0);s++){let o=t[s<0?n.name:i[s]];if(o)return o}}}}er.none=new er("",Object.create(null),0,8);class sa{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let i=null;for(let s of e){let o=s(n);o&&(i||(i=Object.assign({},n.props)),i[o[0].id]=o[1])}t.push(i?new er(n.name,i,n.id,n.flags):n)}return new sa(t)}}const oa=new WeakMap,Sd=new WeakMap;var st;(function(r){r[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays"})(st||(st={}));class ct{constructor(e,t,n,i,s){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=js.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let n of this.children){let i=n.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new aa(this.topNode,e)}cursorAt(e,t=0,n=0){let i=oa.get(this)||this.topNode,s=new aa(i);return s.moveTo(e,t),oa.set(this,s._tree),s}get topNode(){return new tr(this,0,0,null)}resolve(e,t=0){let n=Vs(oa.get(this)||this.topNode,e,t,!1);return oa.set(this,n),n}resolveInner(e,t=0){let n=Vs(Sd.get(this)||this.topNode,e,t,!0);return Sd.set(this,n),n}resolveStack(e,t=0){return PS(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&st.IncludeAnonymous)>0;for(let l=this.cursor(o|st.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&n&&(a||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:vc(er.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,i)=>new ct(this.type,t,n,i,this.propValues),e.makeTree||((t,n,i)=>new ct(er.none,t,n,i)))}static build(e){return MS(e)}}ct.empty=new ct(er.none,[],[],0);class pc{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new pc(this.buffer,this.index)}}class mi{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return er.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,n==e)return s;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,n,i,s){let{buffer:o}=this,a=-1;for(let l=e;l!=t&&!(kd(s,i,o[l+1],o[l+2])&&(a=l,n>0));l=o[l+3]);return a}slice(e,t,n){let i=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a<t;){s[l++]=i[a++],s[l++]=i[a++]-n;let c=s[l++]=i[a++]-n;s[l++]=i[a++]-e,o=Math.max(o,c)}return new mi(s,o,this.set)}}function kd(r,e,t,n){switch(r){case-2:return t<e;case-1:return n>=e&&t<e;case 0:return t<e&&n>e;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function Vs(r,e,t,n){for(var i;r.from==r.to||(t<1?r.from>=e:r.from>e)||(t>-1?r.to<=e:r.to<e);){let o=!n&&r instanceof tr&&r.index<0?null:r.parent;if(!o)return r;r=o}let s=n?0:st.IgnoreOverlays;if(n)for(let o=r,a=o.parent;a;o=a,a=o.parent)o instanceof tr&&o.index<0&&((i=a.enter(e,t,s))===null||i===void 0?void 0:i.from)!=o.from&&(r=a);for(;;){let o=r.enter(e,t,s);if(!o)return r;r=o}}class Ad{cursor(e=0){return new aa(this,e)}getChild(e,t=null,n=null){let i=Cd(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return Cd(this,e,t,n)}resolve(e,t=0){return Vs(this,e,t,!1)}resolveInner(e,t=0){return Vs(this,e,t,!0)}matchContext(e){return gc(this,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}get node(){return this}get next(){return this.parent}}class tr extends Ad{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,i,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=t>0?a.length:-1;e!=c;e+=t){let u=a[e],h=l[e]+o.from;if(kd(i,n,h,h+u.length)){if(u instanceof mi){if(s&st.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,t,n-h,i);if(d>-1)return new Zr(new ES(o,u,e,h),null,d)}else if(s&st.IncludeAnonymous||!u.type.isAnonymous||mc(u)){let d;if(!(s&st.IgnoreMounts)&&(d=js.get(u))&&!d.overlay)return new tr(d.tree,h,e,o);let p=new tr(u,h,e,o);return s&st.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?u.children.length-1:0,t,n,i)}}}if(s&st.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let i;if(!(n&st.IgnoreOverlays)&&(i=js.get(this._tree))&&i.overlay){let s=e-this.from;for(let{from:o,to:a}of i.overlay)if((t>0?o<=s:o<s)&&(t<0?a>=s:a>s))return new tr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Cd(r,e,t,n){let i=r.cursor(),s=[];if(!i.firstChild())return s;if(t!=null){for(;!i.type.is(t);)if(!i.nextSibling())return s}for(;;){if(n!=null&&i.type.is(n))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return n==null?s:[]}}function gc(r,e,t=e.length-1){for(let n=r.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class ES{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class Zr extends Ad{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new Zr(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&st.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Zr(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Zr(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Zr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,s=n.buffer[this.index+3];if(s>i){let o=n.buffer[this.index+1];e.push(n.slice(i,s,o)),t.push(0)}return new ct(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Od(r){if(!r.length)return null;if(r.length==1)return r[0];let e=0,t=r[0];for(let s=1;s<r.length;s++){let o=r[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let n=t instanceof tr&&t.index<0?null:t.parent,i=r.slice();return n?i[e]=n:i.splice(e,1),new TS(i,t)}class TS{constructor(e,t){this.heads=e,this.node=t}get next(){return Od(this.heads)}}function PS(r,e,t){let n=r.resolveInner(e,t),i=null;for(let s=n instanceof tr?n:n.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[n])).push(o.resolve(e,t)),s=o}else{let o=js.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new tr(o.tree,o.overlay[0].from+s.from,0,null);(i||(i=[n])).push(Vs(a,e,t,!1))}}return i?Od(i):n}class aa{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof tr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof tr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&st.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&st.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&st.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let a=n._tree.children[s];if(this.mode&st.IncludeAnonymous||a instanceof mi||!a.type.isAnonymous||mc(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,n=s+1;break e}i=this.stack[--s]}for(let i=n;i<this.stack.length;i++)t=new Zr(this.buffer,t,this.stack[i]);return this.bufferNode=new Zr(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;i&&t&&t(this),i=this.type.isAnonymous,!this.nextSibling();){if(!n)return;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return gc(this.node,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return gc(this.node,e,i);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function mc(r){return r.children.some(e=>e instanceof mi||!e.type.isAnonymous||mc(e))}function MS(r){var e;let{buffer:t,nodeSet:n,maxBufferLength:i=wd,reused:s=[],minRepeatType:o=n.types.length}=r,a=Array.isArray(t)?new pc(t,t.length):t,l=n.types,c=0,u=0;function h(L,D,j,W,q){let{id:F,start:H,end:Q,size:oe}=a,fe=u;for(;oe<0;)if(a.next(),oe==-1){let Oe=s[F];j.push(Oe),W.push(H-L);return}else if(oe==-3){c=F;return}else if(oe==-4){u=F;return}else throw new RangeError(`Unrecognized record size: ${oe}`);let be=l[F],ke,Re,Se=H-L;if(Q-H<=i&&(Re=y(a.pos-D,q))){let Oe=new Uint16Array(Re.size-Re.skip),Te=a.pos-Re.size,De=Oe.length;for(;a.pos>Te;)De=w(Re.start,Oe,De);ke=new mi(Oe,Q-Re.start,n),Se=Re.start-L}else{let Oe=a.pos-oe;a.next();let Te=[],De=[],bt=F>=o?F:-1,Rt=0,ir=Q;for(;a.pos>Oe;)bt>=0&&a.id==bt&&a.size>=0?(a.end<=ir-i&&(p(Te,De,H,Rt,a.end,ir,bt,fe),Rt=Te.length,ir=a.end),a.next()):h(H,Oe,Te,De,bt);if(bt>=0&&Rt>0&&Rt<Te.length&&p(Te,De,H,Rt,H,ir,bt,fe),Te.reverse(),De.reverse(),bt>-1&&Rt>0){let jr=d(be);ke=vc(be,Te,De,0,Te.length,0,Q-H,jr,jr)}else ke=m(be,Te,De,Q-H,fe-Q)}j.push(ke),W.push(Se)}function d(L){return(D,j,W)=>{let q=0,F=D.length-1,H,Q;if(F>=0&&(H=D[F])instanceof ct){if(!F&&H.type==L&&H.length==W)return H;(Q=H.prop(Be.lookAhead))&&(q=j[F]+H.length+Q)}return m(L,D,j,W,q)}}function p(L,D,j,W,q,F,H,Q){let oe=[],fe=[];for(;L.length>W;)oe.push(L.pop()),fe.push(D.pop()+j-q);L.push(m(n.types[H],oe,fe,F-q,Q-F)),D.push(q-j)}function m(L,D,j,W,q=0,F){if(c){let H=[Be.contextHash,c];F=F?[H].concat(F):[H]}if(q>25){let H=[Be.lookAhead,q];F=F?[H].concat(F):[H]}return new ct(L,D,j,W,F)}function y(L,D){let j=a.fork(),W=0,q=0,F=0,H=j.end-i,Q={size:0,start:0,skip:0};e:for(let oe=j.pos-L;j.pos>oe;){let fe=j.size;if(j.id==D&&fe>=0){Q.size=W,Q.start=q,Q.skip=F,F+=4,W+=4,j.next();continue}let be=j.pos-fe;if(fe<0||be<oe||j.start<H)break;let ke=j.id>=o?4:0,Re=j.start;for(j.next();j.pos>be;){if(j.size<0)if(j.size==-3)ke+=4;else break e;else j.id>=o&&(ke+=4);j.next()}q=Re,W+=fe,F+=ke}return(D<0||W==L)&&(Q.size=W,Q.start=q,Q.skip=F),Q.size>4?Q:void 0}function w(L,D,j){let{id:W,start:q,end:F,size:H}=a;if(a.next(),H>=0&&W<o){let Q=j;if(H>4){let oe=a.pos-(H-4);for(;a.pos>oe;)j=w(L,D,j)}D[--j]=Q,D[--j]=F-L,D[--j]=q-L,D[--j]=W}else H==-3?c=W:H==-4&&(u=W);return j}let A=[],T=[];for(;a.pos>0;)h(r.start||0,r.bufferStart||0,A,T,-1);let P=(e=r.length)!==null&&e!==void 0?e:A.length?T[0]+A[0].length:0;return new ct(l[r.topID],A.reverse(),T.reverse(),P)}const Ed=new WeakMap;function la(r,e){if(!r.isAnonymous||e instanceof mi||e.type!=r)return 1;let t=Ed.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=r||!(n instanceof ct)){t=1;break}t+=la(r,n)}Ed.set(e,t)}return t}function vc(r,e,t,n,i,s,o,a,l){let c=0;for(let m=n;m<i;m++)c+=la(r,e[m]);let u=Math.ceil(c*1.5/8),h=[],d=[];function p(m,y,w,A,T){for(let P=w;P<A;){let L=P,D=y[P],j=la(r,m[P]);for(P++;P<A;P++){let W=la(r,m[P]);if(j+W>=u)break;j+=W}if(P==L+1){if(j>u){let W=m[L];p(W.children,W.positions,0,W.children.length,y[L]+T);continue}h.push(m[L])}else{let W=y[P-1]+m[P-1].length-D;h.push(vc(r,m,y,L,P,D,W,null,l))}d.push(D+T-s)}}return p(e,t,n,i,0),(a||l)(h,d,o)}class JI{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof Zr?this.setBuffer(e.context.buffer,e.index,t):e instanceof tr&&this.map.set(e.tree,t)}get(e){return e instanceof Zr?this.getBuffer(e.context.buffer,e.index):e instanceof tr?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class kn{constructor(e,t,n,i,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let i=[new kn(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&i.push(s);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<t.length?t[a]:null,h=u?u.fromA:1e9;if(h-l>=n)for(;o&&o.from<h;){let d=o;if(l>=d.from||h<=d.to||c){let p=Math.max(d.from,l)-c,m=Math.min(d.to,h)-c;d=p>=m?null:new kn(p,m,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),o.to>h)break;o=s<e.length?e[s++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class Td{startParse(e,t,n){return typeof e=="string"&&(e=new IS(e)),n=n?n.length?n.map(i=>new Ir(i.from,i.to)):[new Ir(0,0)]:[new Ir(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let s=i.advance();if(s)return s}}}class IS{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function QI(r){return(e,t,n,i)=>new NS(e,r,t,n,i)}class Pd{constructor(e,t,n,i,s){if(this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.ranges=s,!s.length||s.some(o=>o.from>=o.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}}class DS{constructor(e,t,n,i,s,o,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const yc=new Be({perNode:!0});class NS{constructor(e,t,n,i,s){this.nest=t,this.input=n,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new ct(n.type,n.children,n.positions,n.length,n.propValues.concat([[yc,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Be.mounted.id]=new js(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].ranges[0].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new BS(this.fragments),t=null,n=null,i=new aa(new tr(this.baseTree,this.ranges[0].from,0,null),st.IncludeAnonymous|st.IgnoreMounts);e:for(let s,o;this.stoppedAt==null||i.from<this.stoppedAt;){let a=!0,l;if(e.hasNode(i)){if(t){let c=t.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let h=u.from+c.pos,d=u.to+c.pos;h>=i.from&&d<=i.to&&!t.ranges.some(p=>p.from<d&&p.to>h)&&t.ranges.push({from:h,to:d})}}a=!1}else if(n&&(o=RS(n.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&i.from<i.to&&(s=this.nest(i,this.input))){i.tree||LS(i);let c=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")t=new DS(s.parser,s.overlay,c,this.inner.length,i.from,i.tree,t);else{let u=Dd(this.ranges,s.overlay||[new Ir(i.from,i.to)]);u.length&&this.inner.push(new Pd(s.parser,s.parser.startParse(this.input,Nd(c,u),u),s.overlay?s.overlay.map(h=>new Ir(h.from-i.from,h.to-i.from)):null,i.tree,u)),s.overlay?u.length&&(n={ranges:u,depth:0,prev:n}):a=!1}}else t&&(l=t.predicate(i))&&(l===!0&&(l=new Ir(i.from,i.to)),l.from<l.to&&t.ranges.push(l));if(a&&i.firstChild())t&&t.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let c=Dd(this.ranges,t.ranges);c.length&&this.inner.splice(t.index,0,new Pd(t.parser,t.parser.startParse(this.input,Nd(t.mounts,c),c),t.ranges.map(u=>new Ir(u.from-t.start,u.to-t.start)),t.target,c)),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function RS(r,e,t){for(let n of r){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Md(r,e,t,n,i,s){if(e<t){let o=r.buffer[e+1];n.push(r.slice(e,t,o)),i.push(o-s)}}function LS(r){let{node:e}=r,t=0;do r.parent(),t++;while(!r.tree);let n=0,i=r.tree,s=0;for(;s=i.positions[n]+r.from,!(s<=e.from&&s+i.children[n].length>=e.to);n++);let o=i.children[n],a=o.buffer;function l(c,u,h,d,p){let m=c;for(;a[m+2]+s<=e.from;)m=a[m+3];let y=[],w=[];Md(o,c,m,y,w,d);let A=a[m+1],T=a[m+2],P=A+s==e.from&&T+s==e.to&&a[m]==e.type.id;return y.push(P?e.toTree():l(m+4,a[m+3],o.set.types[a[m]],A,T-A)),w.push(A-d),Md(o,a[m+3],u,y,w,d),new ct(h,y,w,p)}i.children[n]=l(0,a.length,er.none,0,o.length);for(let c=0;c<=t;c++)r.childAfter(e.from)}class Id{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(st.IncludeAnonymous|st.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)t.to>=e&&t.enter(n,1,st.IgnoreOverlays|st.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof ct)t=t.children[0];else break}return!1}}class BS{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(yc))!==null&&t!==void 0?t:n.to,this.inner=new Id(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(yc))!==null&&e!==void 0?e:t.to,this.inner=new Id(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(Be.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=s.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:s.from-l.offset,mount:o})}}}return i}}function Dd(r,e){let t=null,n=e;for(let i=1,s=0;i<r.length;i++){let o=r[i-1].to,a=r[i].from;for(;s<n.length;s++){let l=n[s];if(l.from>=a)break;l.to<=o||(t||(n=t=e.slice()),l.from<o?(t[s]=new Ir(l.from,o),l.to>a&&t.splice(s+1,0,new Ir(a,l.to))):l.to>a?t[s--]=new Ir(a,l.to):t.splice(s--,1))}}return n}function FS(r,e,t,n){let i=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==r.length?1e9:o?r[i].to:r[i].from,h=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let d=Math.max(l,t),p=Math.min(u,h,n);d<p&&c.push(new Ir(d,p))}if(l=Math.min(u,h),l==1e9)break;u==l&&(o?(o=!1,i++):o=!0),h==l&&(a?(a=!1,s++):a=!0)}return c}function Nd(r,e){let t=[];for(let{pos:n,mount:i,frag:s}of r){let o=n+(i.overlay?i.overlay[0].from:0),a=o+i.tree.length,l=Math.max(s.from,o),c=Math.min(s.to,a);if(i.overlay){let u=i.overlay.map(d=>new Ir(d.from+n,d.to+n)),h=FS(e,u,l,c);for(let d=0,p=l;;d++){let m=d==h.length,y=m?c:h[d].from;if(y>p&&t.push(new kn(p,y,i.tree,-o,s.from>=p||s.openStart,s.to<=y||s.openEnd)),m)break;p=h[d].to}}else t.push(new kn(l,c,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}class ca{constructor(e,t,n,i,s,o,a,l,c,u=0,h){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=h}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new ca(e,[],t,n,n,0,[],0,i?new Rd(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,i=e&65535,{parser:s}=this.p,o=s.dynamicPrecedence(i);if(o&&(this.score+=o),n==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,4,!0),this.reduceContext(i,this.reducePos);return}let a=this.stack.length-(n-1)*3-(e&262144?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(!((t=this.p.parser.nodeSet.types[i])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let u=a?this.stack[a-1]:0,h=this.bufferBase+this.buffer.length-u;if(i<s.minRepeatTerm||e&131072){let d=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,l,d,h+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=s.getGoto(d,i,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,n,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,a=this.buffer.length;if(a==0&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(t==n)return;if(o.buffer[a-2]>=t){o.buffer[a-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,i);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4);this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=i}}shift(e,t,n,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4);else{let s=e,{parser:o}=this.p;(i>this.pos||t<=o.maxNode)&&(this.pos=i,o.stateFlag(s,1)||(this.reducePos=i)),this.pushState(s,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,i,4)}}apply(e,t,n,i){e&65536?this.reduce(e):this.shift(e,t,n,i)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new ca(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new jS(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>4<<1||this.stack.length>=120){let i=[];for(let s=0,o;s<t.length;s+=2)(o=t[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&i.push(t[s],o);if(this.stack.length<120)for(let s=0;i.length<4<<1&&s<t.length;s+=2){let o=t[s+1];i.some((a,l)=>l&1&&a==o)||i.push(t[s],o)}t=i}let n=[];for(let i=0;i<t.length&&n.length<4;i+=2){let s=t[i+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[i],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,i=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(i,s)=>{if(!t.includes(i))return t.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=n(o,s+1);if(a!=null)return a}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Rd(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Rd{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class jS{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class ua{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new ua(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ua(this.stack,this.pos,this.index)}}function Ws(r,e=Uint16Array){if(typeof r!="string")return r;let t=null;for(let n=0,i=0;n<r.length;){let s=0;for(;;){let o=r.charCodeAt(n++),a=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[i++]=s:t=new e(s)}return t}class fa{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ld=new fa;class VS{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ld,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<n.from;){if(!i)return null;let o=this.ranges[--i];s-=n.from-o.to,n=o}for(;t<0?s>n.to:s>=n.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,i;if(t>=0&&t<this.chunk.length)n=this.pos+e,i=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(n=s,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let o=this.rangeIndex,a=this.range;for(;a.to<=n;)a=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Ld,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class Yi{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Bd(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Yi.prototype.contextual=Yi.prototype.fallback=Yi.prototype.extend=!1;class WS{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?Ws(e):e}token(e,t){let n=e.pos,i=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(Bd(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}WS.prototype.contextual=Yi.prototype.fallback=Yi.prototype.extend=!1;class XI{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Bd(r,e,t,n,i,s){let o=0,a=1<<n,{dialect:l}=t.p.parser;e:for(;a&r[o];){let c=r[o+1];for(let p=o+3;p<c;p+=2)if((r[p+1]&a)>0){let m=r[p];if(l.allows(m)&&(e.token.value==-1||e.token.value==m||$S(m,e.token.value,i,s))){e.acceptToken(m);break}}let u=e.next,h=0,d=r[o+2];if(e.next<0&&d>h&&r[c+d*3-3]==65535&&r[c+d*3-3]==65535){o=r[c+d*3-1];continue e}for(;h<d;){let p=h+d>>1,m=c+p+(p<<1),y=r[m],w=r[m+1]||65536;if(u<y)d=p;else if(u>=w)h=p+1;else{o=r[m+2],e.advance();continue e}}break}}function Fd(r,e,t){for(let n=e,i;(i=r[n])!=65535;n++)if(i==t)return n-e;return-1}function $S(r,e,t,n){let i=Fd(t,n,e);return i<0||Fd(t,n,r)<i}const mr=typeof process<"u"&&{}&&/\bparse\b/.test({}.LOG);let bc=null;function jd(r,e,t){let n=r.cursor(st.IncludeAnonymous);for(n.moveTo(e);;)if(!(t<0?n.childBefore(e):n.childAfter(e)))for(;;){if((t<0?n.to<e:n.from>e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(r.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:r.length}}class HS{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?jd(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?jd(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],i=this.index[t];if(i==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=n.children[i],o=this.start[t]+n.positions[i];if(o>e)return this.nextStart=o,null;if(s instanceof ct){if(o==e){if(o<this.safeFrom)return null;let a=o+s.length;if(a<=this.safeTo){let l=s.prop(Be.lookAhead);if(!l||a+l<this.fragment.to)return s}}this.index[t]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}}class zS{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new fa)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<s.length;c++){if(!(1<<c&o))continue;let u=s[c],h=this.tokens[c];if(!(n&&!u.fallback)&&((u.contextual||h.start!=e.pos||h.mask!=o||h.context!=a)&&(this.updateCachedToken(h,u,e),h.mask=o,h.context=a),h.lookAhead>h.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let d=t;if(h.extended>-1&&(t=this.addActions(e,h.extended,h.end,t)),t=this.addActions(e,h.value,h.end,t),!u.extend&&(n=h,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new fa,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new fa,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let a=s.specializers[o](this.stream.read(e.start,e.end),n);if(a>=0&&n.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=n,i}addActions(e,t,n,i){let{state:s}=e,{parser:o}=e.p,{data:a}=o;for(let l=0;l<2;l++)for(let c=o.stateSlot(s,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=An(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(An(a,c+2),t,n,i));break}a[c]==t&&(i=this.putAction(An(a,c+1),t,n,i))}return i}}class US{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new VS(t,i),this.tokens=new zS(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[ca.start(this,e.top[0],s)],this.fragments=n.length&&this.stream.end-s>e.bufferLength*4?new HS(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let a=e[o];for(;;){if(this.tokens.mainToken=null,a.pos>t)n.push(a);else{if(this.advanceStack(a,n,e))continue;{i||(i=[],s=[]),i.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!n.length){let o=i&&KS(i);if(o)return mr&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw mr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,n);if(o)return mr&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((a,l)=>l.score-a.score);n.length>o;)n.pop();n.some(a=>a.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o<n.length-1;o++){let a=n[o];for(let l=o+1;l<n.length;l++){let c=n[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)n.splice(l--,1);else{n.splice(o--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let o=1;o<n.length;o++)n[o].pos<this.minStackPos&&(this.minStackPos=n[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let i=e.pos,{parser:s}=this,o=mr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let h=this.fragments.nodeAt(i);h;){let d=this.parser.nodeSet.types[h.type.id]==h.type?s.getGoto(e.state,h.type.id):-1;if(d>-1&&h.length&&(!c||(h.prop(Be.contextHash)||0)==u))return e.useNode(h,d),mr&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(h.type.id)})`),!0;if(!(h instanceof ct)||h.children.length==0||h.positions[0]>0)break;let p=h.children[0];if(p instanceof ct&&h.positions[0]==0)h=p;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),mr&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=9e3)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],h=l[c++],d=l[c++],p=c==l.length||!n,m=p?e:e.split(),y=this.tokens.mainToken;if(m.apply(u,h,y?y.start:m.pos,d),mr&&console.log(o+this.stackID(m)+` (via ${u&65536?`reduce of ${s.getName(u&65535)}`:"shift"} for ${s.getName(h)} @ ${i}${m==e?"":", split"})`),p)return!0;m.pos>i?t.push(m):n.push(m)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Vd(e,t),!0}}runRecovery(e,t,n){let i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o],l=t[o<<1],c=t[(o<<1)+1],u=mr?this.stackID(a)+" -> ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),mr&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let h=a.split(),d=u;for(let p=0;h.forceReduce()&&p<10&&(mr&&console.log(d+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,n));p++)mr&&(d=this.stackID(h)+" -> ");for(let p of a.recoverByInsert(l))mr&&console.log(u+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,n);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),mr&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Vd(a,n)):(!i||i.score<a.score)&&(i=a)}return i}stackToTree(e){return e.close(),ct.build({buffer:ua.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(bc||(bc=new WeakMap)).get(e);return t||bc.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function Vd(r,e){for(let t=0;t<e.length;t++){let n=e[t];if(n.pos==r.pos&&n.sameState(r)){e[t].score<r.score&&(e[t]=r);return}}e.push(r)}class GS{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}const xc=r=>r;class ZI{constructor(e){this.start=e.start,this.shift=e.shift||xc,this.reduce=e.reduce||xc,this.reuse=e.reuse||xc,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class ha extends Td{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;a<e.repeatNodeCount;a++)t.push("");let n=Object.keys(e.topRules).map(a=>e.topRules[a][1]),i=[];for(let a=0;a<t.length;a++)i.push([]);function s(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=Be[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)s(u,l,a[c++]);else{let h=a[c+-u];for(let d=-u;d>0;d--)s(a[c++],l,h);c++}}}this.nodeSet=new sa(t.map((a,l)=>er.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=wd;let o=Ws(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(Wd),this.states=Ws(e.states,Uint32Array),this.data=Ws(e.stateData),this.goto=Ws(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Yi(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new US(this,e,t,n);for(let s of this.wrappers)i=s(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return-1;for(let s=i[t+1];;){let o=i[s++],a=o&1,l=i[s++];if(a&&n)return l;for(let c=s+(o>>1);s<c;s++)if(i[s]==e)return l;if(a)return-1}}hasAction(e,t){let n=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),o;;s+=3){if((o=n[s])==65535)if(n[s+1]==1)o=n[s=An(n,s+2)];else{if(n[s+1]==2)return An(n,s+2);break}if(o==t||o==0)return An(n,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=An(this.data,s+2);else break;i=t(An(this.data,s+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=An(this.data,n+2);else break;if(!(this.data[n+2]&1)){let i=this.data[n+1];t.some((s,o)=>o&1&&s==i)||t.push(this.data[n],i)}}return t}configure(e){let t=Object.assign(Object.create(ha.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let i=e.tokenizers.find(s=>s.from==n);return i?i.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let s=e.specializers.find(a=>a.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[i]=Wd(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let i=null;for(let s=0;s<t.length;s++)if(!n[s])for(let o=this.dialects[t[s]],a;(a=this.data[o++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new GS(e,n,i)}static deserialize(e){return new ha(e)}}function An(r,e){return r[e]|r[e+1]<<16}function KS(r){let e=null;for(let t of r){let n=t.p.stoppedAt;(t.pos==t.p.stream.end||n!=null&&t.pos>n)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function Wd(r){if(r.external){let e=r.extend?1:0;return(t,n)=>r.external(t,n)<<1|e}return r.get}let YS=0;class _r{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=YS++}static define(e){if(e?.base)throw new Error("Can not derive from a modified tag");let t=new _r([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new da;return t=>t.modified.indexOf(e)>-1?t:da.get(t.base||t,t.modified.concat(e).sort((n,i)=>n.id-i.id))}}let JS=0;class da{constructor(){this.instances=[],this.id=JS++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(a=>a.base==e&&QS(t,a.modified));if(n)return n;let i=[],s=new _r(i,e,t);for(let a of t)a.instances.push(s);let o=XS(t);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(da.get(a,l));return s}}function QS(r,e){return r.length==e.length&&r.every((t,n)=>t==e[n])}function XS(r){let e=[[]];for(let t=0;t<r.length;t++)for(let n=0,i=e.length;n<i;n++)e.push(e[n].concat(r[t]));return e.sort((t,n)=>n.length-t.length)}function $d(r){let e=Object.create(null);for(let t in r){let n=r[t];Array.isArray(n)||(n=[n]);for(let i of t.split(" "))if(i){let s=[],o=2,a=i;for(let h=0;;){if(a=="..."&&h>0&&h+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),h+=d[0].length,h==i.length)break;let p=i[h++];if(h==i.length&&p=="!"){o=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);a=i.slice(h)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new pa(n,o,l>0?s.slice(0,l):null);e[c]=u.sort(e[c])}}return Hd.add(e)}const Hd=new Be;class pa{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}pa.empty=new pa([],2,null);function zd(r,e){let t=Object.create(null);for(let s of r)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:n,all:i=null}=e||{};return{style:s=>{let o=i;for(let a of s)for(let l of a.set){let c=t[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:n}}function ZS(r,e){let t=null;for(let n of r){let i=n.style(e);i&&(t=t?t+" "+i:i)}return t}function _S(r,e,t,n=0,i=r.length){let s=new qS(n,Array.isArray(e)?e:[e],t);s.highlightRange(r.cursor(),n,i,"",s.highlighters),s.flush(i)}class qS{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,s){let{type:o,from:a,to:l}=e;if(a>=n||l<=t)return;o.isTop&&(s=this.highlighters.filter(p=>!p.scope||p.scope(o)));let c=i,u=ek(e)||pa.empty,h=ZS(s,u.tags);if(h&&(c&&(c+=" "),c+=h,u.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(t,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(Be.mounted);if(d&&d.overlay){let p=e.node.enter(d.overlay[0].from+a,1),m=this.highlighters.filter(w=>!w.scope||w.scope(d.tree.type)),y=e.firstChild();for(let w=0,A=a;;w++){let T=w<d.overlay.length?d.overlay[w]:null,P=T?T.from+a:l,L=Math.max(t,A),D=Math.min(n,P);if(L<D&&y)for(;e.from<D&&(this.highlightRange(e,L,D,i,s),this.startSpan(Math.min(D,e.to),c),!(e.to>=P||!e.nextSibling())););if(!T||P>n)break;A=T.to+a,A>t&&(this.highlightRange(p.cursor(),Math.max(t,T.from+a),Math.min(n,A),"",m),this.startSpan(Math.min(n,A),c))}y&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,s),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function ek(r){let e=r.type.prop(Hd);for(;e&&e.context&&!r.matchContext(e.context);)e=e.next;return e||null}const ue=_r.define,ga=ue(),$n=ue(),Ud=ue($n),Gd=ue($n),Hn=ue(),ma=ue(Hn),wc=ue(Hn),qr=ue(),vi=ue(qr),en=ue(),tn=ue(),Sc=ue(),$s=ue(Sc),va=ue(),M={comment:ga,lineComment:ue(ga),blockComment:ue(ga),docComment:ue(ga),name:$n,variableName:ue($n),typeName:Ud,tagName:ue(Ud),propertyName:Gd,attributeName:ue(Gd),className:ue($n),labelName:ue($n),namespace:ue($n),macroName:ue($n),literal:Hn,string:ma,docString:ue(ma),character:ue(ma),attributeValue:ue(ma),number:wc,integer:ue(wc),float:ue(wc),bool:ue(Hn),regexp:ue(Hn),escape:ue(Hn),color:ue(Hn),url:ue(Hn),keyword:en,self:ue(en),null:ue(en),atom:ue(en),unit:ue(en),modifier:ue(en),operatorKeyword:ue(en),controlKeyword:ue(en),definitionKeyword:ue(en),moduleKeyword:ue(en),operator:tn,derefOperator:ue(tn),arithmeticOperator:ue(tn),logicOperator:ue(tn),bitwiseOperator:ue(tn),compareOperator:ue(tn),updateOperator:ue(tn),definitionOperator:ue(tn),typeOperator:ue(tn),controlOperator:ue(tn),punctuation:Sc,separator:ue(Sc),bracket:$s,angleBracket:ue($s),squareBracket:ue($s),paren:ue($s),brace:ue($s),content:qr,heading:vi,heading1:ue(vi),heading2:ue(vi),heading3:ue(vi),heading4:ue(vi),heading5:ue(vi),heading6:ue(vi),contentSeparator:ue(qr),list:ue(qr),quote:ue(qr),emphasis:ue(qr),strong:ue(qr),link:ue(qr),monospace:ue(qr),strikethrough:ue(qr),inserted:ue(),deleted:ue(),changed:ue(),invalid:ue(),meta:va,documentMeta:ue(va),annotation:ue(va),processingInstruction:ue(va),definition:_r.defineModifier(),constant:_r.defineModifier(),function:_r.defineModifier(),standard:_r.defineModifier(),local:_r.defineModifier(),special:_r.defineModifier()},_I=zd([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]),tk=$d({String:M.string,Number:M.number,"True False":M.bool,PropertyName:M.propertyName,Null:M.null,",":M.separator,"[ ]":M.squareBracket,"{ }":M.brace}),rk=ha.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[tk],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});class Qe{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),rn.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),rn.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Hs(this),s=new Hs(e);for(let o=t,a=t;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=n)return!0}}iter(e=1){return new Hs(this,e)}iterRange(e,t=this.length){return new Yd(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Jd(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Qe.empty:e.length<=32?new mt(e):rn.from(mt.split(e,[]))}}class mt extends Qe{constructor(e,t=nk(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((t?n:a)>=e)return new ik(i,a,n,o);i=a+1,n++}}decompose(e,t,n,i){let s=e<=0&&t>=this.length?this:new mt(Kd(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let o=n.pop(),a=ya(s.text,o.text.slice(),0,s.length);if(a.length<=32)n.push(new mt(a,o.length+s.length));else{let l=a.length>>1;n.push(new mt(a.slice(0,l)),new mt(a.slice(l)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof mt))return super.replace(e,t,n);let i=ya(this.text,ya(n.text,Kd(this.text,0,e)),t),s=this.length+n.length-(t-e);return i.length<=32?new mt(i,s):rn.from(mt.split(i,[]),s)}sliceString(e,t=this.length,n=`
141
+ `){let i="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(i+=n),e<l&&t>s&&(i+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let s of e)n.push(s),i+=s.length+1,n.length==32&&(t.push(new mt(n,i)),n=[],i=-1);return i>-1&&t.push(new mt(n,i)),t}}class rn extends Qe{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=n+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,n,i);i=a+1,n=l+1}}decompose(e,t,n,i){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&t>=o){let c=i&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!c?n.push(a):a.decompose(e-o,t-o,n,c)}o=l+1}}replace(e,t,n){if(n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&t<=a){let l=o.replace(e-s,t-s,n),c=this.lines-o.lines+l.lines;if(l.lines<c>>5-1&&l.lines>c>>5+1){let u=this.children.slice();return u[i]=l,new rn(u,this.length-(t-e)+n.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
142
+ `){let i="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(i+=n),e<l&&t>o&&(i+=a.sliceString(e-o,t-o,n)),o=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof rn))return 0;let n=0,[i,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==o||s==a)return n;let l=this.children[i],c=e.children[s];if(l!=c)return n+l.scanIdentical(c,t);n+=l.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let p of e)n+=p.lines;if(n<32){let p=[];for(let m of e)m.flatten(p);return new mt(p,t)}let i=Math.max(32,n>>5),s=i<<1,o=i>>1,a=[],l=0,c=-1,u=[];function h(p){let m;if(p.lines>s&&p instanceof rn)for(let y of p.children)h(y);else p.lines>o&&(l>o||!l)?(d(),a.push(p)):p instanceof mt&&l&&(m=u[u.length-1])instanceof mt&&p.lines+m.lines<=32?(l+=p.lines,c+=p.length+1,u[u.length-1]=new mt(m.text.concat(p.text),m.length+1+p.length)):(l+p.lines>i&&d(),l+=p.lines,c+=p.length+1,u.push(p))}function d(){l!=0&&(a.push(u.length==1?u[0]:rn.from(u,c)),c=-1,l=u.length=0)}for(let p of e)h(p);return d(),a.length==1?a[0]:new rn(a,t)}}Qe.empty=new mt([""],0);function nk(r){let e=-1;for(let t of r)e+=t.length+1;return e}function ya(r,e,t=0,n=1e9){for(let i=0,s=0,o=!0;s<r.length&&i<=n;s++){let a=r[s],l=i+a.length;l>=t&&(l>n&&(a=a.slice(0,n-i)),i<t&&(a=a.slice(t-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=l+1}return e}function Kd(r,e,t){return ya(r,[""],e,t)}class Hs{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof mt?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],s=this.offsets[n],o=s>>1,a=i instanceof mt?i.text.length:i.children.length;if(o==(t>0?a:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
143
+ `,this;e--}else if(i instanceof mt){let l=i.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof mt?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Yd{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Hs(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Jd{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Qe.prototype[Symbol.iterator]=function(){return this.iter()},Hs.prototype[Symbol.iterator]=Yd.prototype[Symbol.iterator]=Jd.prototype[Symbol.iterator]=function(){return this});class ik{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}let Ji="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(r=>r?parseInt(r,36):1);for(let r=1;r<Ji.length;r++)Ji[r]+=Ji[r-1];function sk(r){for(let e=1;e<Ji.length;e+=2)if(Ji[e]>r)return Ji[e-1]<=r;return!1}function Qd(r){return r>=127462&&r<=127487}const Xd=8205;function Ut(r,e,t=!0,n=!0){return(t?Zd:ok)(r,e,n)}function Zd(r,e,t){if(e==r.length)return e;e&&_d(r.charCodeAt(e))&&qd(r.charCodeAt(e-1))&&e--;let n=Lt(r,e);for(e+=Dr(n);e<r.length;){let i=Lt(r,e);if(n==Xd||i==Xd||t&&sk(i))e+=Dr(i),n=i;else if(Qd(i)){let s=0,o=e-2;for(;o>=0&&Qd(Lt(r,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function ok(r,e,t){for(;e>0;){let n=Zd(r,e-2,t);if(n<e)return n;e--}return 0}function _d(r){return r>=56320&&r<57344}function qd(r){return r>=55296&&r<56320}function Lt(r,e){let t=r.charCodeAt(e);if(!qd(t)||e+1==r.length)return t;let n=r.charCodeAt(e+1);return _d(n)?(t-55296<<10)+(n-56320)+65536:t}function kc(r){return r<=65535?String.fromCharCode(r):(r-=65536,String.fromCharCode((r>>10)+55296,(r&1023)+56320))}function Dr(r){return r<65536?1:2}const Ac=/\r\n?|\n/;var rr=function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r}(rr||(rr={}));class nn{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(n,i,s),i+=s):i+=o,n+=s}}iterChangedRanges(e,t=!1){Cc(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new nn(e)}composeDesc(e){return this.empty?e:e.empty?this:ep(this,e)}mapDesc(e,t=!1){return e.empty?this:Oc(this,e,t)}mapPos(e,t=-1,n=rr.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=i+a;if(l<0){if(c>e)return s+(e-i);s+=a}else{if(n!=rr.Simple&&c>=e&&(n==rr.TrackDel&&i<e&&c>e||n==rr.TrackBefore&&i<e||n==rr.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!a)return e==i||t<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let s=this.sections[n++],o=this.sections[n++],a=i+s;if(o>=0&&i<=t&&a>=e)return i<e&&a>t?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new nn(e)}static create(e){return new nn(e)}}class Et extends nn{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Cc(this,(t,n,i,s,o)=>e=e.replace(i,i+(n-t),o),!1),e}mapDesc(e,t=!1){return Oc(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,s=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let l=i>>1;for(;n.length<l;)n.push(Qe.empty);n.push(o?e.slice(s,s+o):Qe.empty)}s+=o}return new Et(t,n)}compose(e){return this.empty?e:e.empty?this:ep(this,e,!0)}map(e,t=!1){return e.empty?this:Oc(this,e,t,!0)}iterChanges(e,t=!1){Cc(this,e,t)}get desc(){return nn.create(this.sections)}filter(e){let t=[],n=[],i=[],s=new zs(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,l-a);Gt(i,u,-1);let h=s.ins==-1?-1:s.off==0?s.ins:0;Gt(t,u,h),h>0&&zn(n,t,s.text),s.forward(u),a+=u}let c=e[o++];for(;a<c;){if(s.done)break e;let u=Math.min(s.len,c-a);Gt(t,u,-1),Gt(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),a+=u}}return{changes:new Et(t,n),filtered:nn.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):i==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],s=[],o=0,a=null;function l(u=!1){if(!u&&!i.length)return;o<t&&Gt(i,t-o,-1);let h=new Et(i,s);a=a?a.compose(h.map(a)):h,i=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let h of u)c(h);else if(u instanceof Et){if(u.length!=t)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${t})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:h,to:d=h,insert:p}=u;if(h>d||h<0||d>t)throw new RangeError(`Invalid change range ${h} to ${d} (in doc of length ${t})`);let m=p?typeof p=="string"?Qe.of(p.split(n||Ac)):p:Qe.empty,y=m.length;if(h==d&&y==0)return;h<o&&l(),h>o&&Gt(i,h-o,-1),Gt(i,d-h,y),zn(s,i,m),o=d}}return c(e),l(!a),a}static empty(e){return new Et(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length<i;)n.push(Qe.empty);n[i]=Qe.of(s.slice(1)),t.push(s[0],n[i].length)}}}return new Et(t,n)}static createSet(e,t){return new Et(e,t)}}function Gt(r,e,t,n=!1){if(e==0&&t<=0)return;let i=r.length-2;i>=0&&t<=0&&t==r[i+1]?r[i]+=e:e==0&&r[i]==0?r[i+1]+=t:n?(r[i]+=e,r[i+1]+=t):r.push(e,t)}function zn(r,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<r.length)r[r.length-1]=r[r.length-1].append(t);else{for(;r.length<n;)r.push(Qe.empty);r.push(t)}}function Cc(r,e,t){let n=r.inserted;for(let i=0,s=0,o=0;o<r.sections.length;){let a=r.sections[o++],l=r.sections[o++];if(l<0)i+=a,s+=a;else{let c=i,u=s,h=Qe.empty;for(;c+=a,u+=l,l&&n&&(h=h.append(n[o-2>>1])),!(t||o==r.sections.length||r.sections[o+1]<0);)a=r.sections[o++],l=r.sections[o++];e(i,c,s,u,h),i=c,s=u}}}function Oc(r,e,t,n=!1){let i=[],s=n?[]:null,o=new zs(r),a=new zs(e);for(let l=-1;;)if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);Gt(i,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!t))){let c=a.len;for(Gt(i,a.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=u&&(Gt(i,0,o.ins),s&&zn(s,i,o.text),l=o.i),o.forward(u),c-=u}a.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(a.ins==-1){let h=Math.min(u,a.len);c+=h,u-=h,a.forward(h)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;Gt(i,c,l<o.i?o.ins:0),s&&l<o.i&&zn(s,i,o.text),l=o.i,o.forward(o.len-u)}else{if(o.done&&a.done)return s?Et.createSet(i,s):nn.create(i);throw new Error("Mismatched change set lengths")}}function ep(r,e,t=!1){let n=[],i=t?[]:null,s=new zs(r),o=new zs(e);for(let a=!1;;){if(s.done&&o.done)return i?Et.createSet(n,i):nn.create(n);if(s.ins==0)Gt(n,s.len,0,a),s.next();else if(o.len==0&&!o.done)Gt(n,0,o.ins,a),i&&zn(i,n,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,o.len),c=n.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;Gt(n,l,u,a),i&&u&&zn(i,n,o.text)}else o.ins==-1?(Gt(n,s.off?0:s.len,l,a),i&&zn(i,n,s.textBit(l))):(Gt(n,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&zn(i,n,o.text));a=(s.ins>l||o.ins>=0&&o.len>l)&&(a||n.length>c),s.forward2(l),o.forward(l)}}}}class zs{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Qe.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Qe.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class yi{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new yi(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return ie.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return ie.range(this.anchor,n)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ie.range(e.anchor,e.head)}static create(e,t,n){return new yi(e,t,n)}}class ie{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:ie.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;t<this.ranges.length;t++)if(!this.ranges[t].eq(e.ranges[t]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ie([this.main],0)}addRange(e,t=!0){return ie.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,ie.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ie(e.ranges.map(t=>yi.fromJSON(t)),e.main)}static single(e,t=e){return new ie([ie.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=n:s.from<n)return ie.normalized(e.slice(),t);n=s.to}return new ie(e,t)}static cursor(e,t=0,n,i){return yi.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(i??16777215)<<6)}static range(e,t,n,i){let s=(n??16777215)<<6|(i==null?7:Math.min(6,i));return t<e?yi.create(t,e,48|s):yi.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(n);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,l=Math.max(s.to,o.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?ie.range(l,a):ie.range(a,l))}}return new ie(e,t)}}function tp(r,e){for(let t of r.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Ec=0;class de{constructor(e,t,n,i,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=Ec++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new de(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:Tc),!!e.static,e.enables)}of(e){return new ba([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ba(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ba(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function Tc(r,e){return r==e||r.length==e.length&&r.every((t,n)=>t===e[n])}class ba{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=Ec++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?c=!0:((t=e[h.id])!==null&&t!==void 0?t:1)&1||u.push(e[h.id]);return{create(h){return h.values[o]=n(h),1},update(h,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||Pc(h,u)){let p=n(h);if(a?!rp(p,h.values[o],i):!i(p,h.values[o]))return h.values[o]=p,1}return 0},reconfigure:(h,d)=>{let p,m=d.config.address[s];if(m!=null){let y=Sa(d,m);if(this.dependencies.every(w=>w instanceof de?d.facet(w)===h.facet(w):w instanceof kt?d.field(w,!1)==h.field(w,!1):!0)||(a?rp(p=n(h),y,i):i(p=n(h),y)))return h.values[o]=y,0}else p=n(h);return h.values[o]=p,1}}}}function rp(r,e,t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!t(r[n],e[n]))return!1;return!0}function Pc(r,e){let t=!1;for(let n of e)Gs(r,n)&1&&(t=!0);return t}function ak(r,e,t){let n=t.map(l=>r[l.id]),i=t.map(l=>l.type),s=n.filter(l=>!(l&1)),o=r[e.id]>>1;function a(l){let c=[];for(let u=0;u<n.length;u++){let h=Sa(l,n[u]);if(i[u]==2)for(let d of h)c.push(d);else c.push(h)}return e.combine(c)}return{create(l){for(let c of n)Gs(l,c);return l.values[o]=a(l),1},update(l,c){if(!Pc(l,s))return 0;let u=a(l);return e.compare(u,l.values[o])?0:(l.values[o]=u,1)},reconfigure(l,c){let u=Pc(l,n),h=c.config.facets[e.id],d=c.facet(e);if(h&&!u&&Tc(t,h))return l.values[o]=d,0;let p=a(l);return e.compare(p,d)?(l.values[o]=d,0):(l.values[o]=p,1)}}}const np=de.define({static:!0});class kt{constructor(e,t,n,i,s){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let t=new kt(Ec++,e.create,e.update,e.compare||((n,i)=>n===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(np).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,i)=>{let s=n.values[t],o=this.updateF(s,i);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,i)=>i.config.address[this.id]!=null?(n.values[t]=i.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,np.of({field:this,create:e})]}get extension(){return this}}const bi={lowest:4,low:3,default:2,high:1,highest:0};function Us(r){return e=>new ip(e,r)}const xi={highest:Us(bi.highest),high:Us(bi.high),default:Us(bi.default),low:Us(bi.low),lowest:Us(bi.lowest)};class ip{constructor(e,t){this.inner=e,this.prec=t}}class xa{of(e){return new Mc(this,e)}reconfigure(e){return xa.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Mc{constructor(e,t){this.compartment=e,this.inner=t}}class wa{constructor(e,t,n,i,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let i=[],s=Object.create(null),o=new Map;for(let d of lk(e,t,o))d instanceof kt?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(p=>d.slot(p));let u=n?.config.facets;for(let d in s){let p=s[d],m=p[0].facet,y=u&&u[d]||[];if(p.every(w=>w.type==0))if(a[m.id]=l.length<<1|1,Tc(y,p))l.push(n.facet(m));else{let w=m.combine(p.map(A=>A.value));l.push(n&&m.compare(w,n.facet(m))?n.facet(m):w)}else{for(let w of p)w.type==0?(a[w.id]=l.length<<1|1,l.push(w.value)):(a[w.id]=c.length<<1,c.push(A=>w.dynamicSlot(A)));a[m.id]=c.length<<1,c.push(w=>ak(w,m,p))}}let h=c.map(d=>d(a));return new wa(e,o,h,a,l,s)}}function lk(r,e,t){let n=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let c=n[l].indexOf(o);c>-1&&n[l].splice(c,1),o instanceof Mc&&t.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let c of o)s(c,a);else if(o instanceof Mc){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),s(c,a)}else if(o instanceof ip)s(o.inner,o.prec);else if(o instanceof kt)n[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof ba)n[a].push(o),o.facet.extensions&&s(o.facet.extensions,bi.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,a)}}return s(r,bi.default),n.reduce((o,a)=>o.concat(a))}function Gs(r,e){if(e&1)return 2;let t=e>>1,n=r.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;r.status[t]=4;let i=r.computeSlot(r,r.config.dynamicSlots[t]);return r.status[t]=2|i}function Sa(r,e){return e&1?r.config.staticValues[e>>1]:r.values[e>>1]}const sp=de.define(),op=de.define({combine:r=>r.some(e=>e),static:!0}),ap=de.define({combine:r=>r.length?r[0]:void 0,static:!0}),lp=de.define(),cp=de.define(),up=de.define(),fp=de.define({combine:r=>r.length?r[0]:!1});class sn{constructor(e,t){this.type=e,this.value=t}static define(){return new ck}}class ck{of(e){return new sn(this,e)}}class uk{constructor(e){this.map=e}of(e){return new Ae(this,e)}}class Ae{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Ae(this.type,t)}is(e){return this.type==e}static define(e={}){return new uk(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let s=i.map(t);s&&n.push(s)}return n}}Ae.reconfigure=Ae.define(),Ae.appendConfig=Ae.define();class Tt{constructor(e,t,n,i,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&tp(n,t.newLength),s.some(a=>a.type==Tt.time)||(this.annotations=s.concat(Tt.time.of(Date.now())))}static create(e,t,n,i,s,o){return new Tt(e,t,n,i,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Tt.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Tt.time=sn.define(),Tt.userEvent=sn.define(),Tt.addToHistory=sn.define(),Tt.remote=sn.define();function fk(r,e){let t=[];for(let n=0,i=0;;){let s,o;if(n<r.length&&(i==e.length||e[i]>=r[n]))s=r[n++],o=r[n++];else if(i<e.length)s=e[i++],o=e[i++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function hp(r,e,t){var n;let i,s,o;return t?(i=e.changes,s=Et.empty(e.changes.length),o=r.changes.compose(e.changes)):(i=e.changes.map(r.changes),s=r.changes.mapDesc(e.changes,!0),o=r.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(n=r.selection)===null||n===void 0?void 0:n.map(i),effects:Ae.mapEffects(r.effects,i).concat(Ae.mapEffects(e.effects,s)),annotations:r.annotations.length?r.annotations.concat(e.annotations):e.annotations,scrollIntoView:r.scrollIntoView||e.scrollIntoView}}function Ic(r,e,t){let n=e.selection,i=Qi(e.annotations);return e.userEvent&&(i=i.concat(Tt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Et?e.changes:Et.of(e.changes||[],t,r.facet(ap)),selection:n&&(n instanceof ie?n:ie.single(n.anchor,n.head)),effects:Qi(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function dp(r,e,t){let n=Ic(r,e.length?e[0]:{},r.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;n=hp(n,Ic(r,e[s],o?n.changes.newLength:r.doc.length),o)}let i=Tt.create(r,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return dk(t?hk(i):i)}function hk(r){let e=r.startState,t=!0;for(let i of e.facet(lp)){let s=i(r);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:fk(t,s))}if(t!==!0){let i,s;if(t===!1)s=r.changes.invertedDesc,i=Et.empty(e.doc.length);else{let o=r.changes.filter(t);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}r=Tt.create(e,i,r.selection&&r.selection.map(s),Ae.mapEffects(r.effects,s),r.annotations,r.scrollIntoView)}let n=e.facet(cp);for(let i=n.length-1;i>=0;i--){let s=n[i](r);s instanceof Tt?r=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Tt?r=s[0]:r=dp(e,Qi(s),!1)}return r}function dk(r){let e=r.startState,t=e.facet(up),n=r;for(let i=t.length-1;i>=0;i--){let s=t[i](r);s&&Object.keys(s).length&&(n=hp(n,Ic(e,s,r.changes.newLength),!0))}return n==r?r:Tt.create(e,r.changes,r.selection,n.effects,n.annotations,n.scrollIntoView)}const pk=[];function Qi(r){return r==null?pk:Array.isArray(r)?r:[r]}var ot=function(r){return r[r.Word=0]="Word",r[r.Space=1]="Space",r[r.Other=2]="Other",r}(ot||(ot={}));const gk=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Dc;try{Dc=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function mk(r){if(Dc)return Dc.test(r);for(let e=0;e<r.length;e++){let t=r[e];if(/\w/.test(t)||t>"\x80"&&(t.toUpperCase()!=t.toLowerCase()||gk.test(t)))return!0}return!1}function vk(r){return e=>{if(!/\S/.test(e))return ot.Space;if(mk(e))return ot.Word;for(let t=0;t<r.length;t++)if(e.indexOf(r[t])>-1)return ot.Word;return ot.Other}}class We{constructor(e,t,n,i,s,o){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)Gs(this,a<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return Gs(this,n),Sa(this,n)}update(...e){return dp(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:i}=t;for(let o of e.effects)o.is(xa.reconfigure)?(t&&(i=new Map,t.compartments.forEach((a,l)=>i.set(l,a)),t=null),i.set(o.value.compartment,o.value.extension)):o.is(Ae.reconfigure)?(t=null,n=o.value):o.is(Ae.appendConfig)&&(t=null,n=Qi(n).concat(o.value));let s;t?s=e.startState.values.slice():(t=wa.resolve(n,i,this),s=new We(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,l)=>l.reconfigure(a,this),null).values),new We(t,e.newDoc,e.newSelection,s,(o,a)=>a.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:ie.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),s=[n.range],o=Qi(n.effects);for(let a=1;a<t.ranges.length;a++){let l=e(t.ranges[a]),c=this.changes(l.changes),u=c.map(i);for(let d=0;d<a;d++)s[d]=s[d].map(u);let h=i.mapDesc(c,!0);s.push(l.range.map(h)),i=i.compose(u),o=Ae.mapEffects(o,u).concat(Ae.mapEffects(Qi(l.effects),h))}return{changes:i,selection:ie.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Et?e:Et.of(e,this.doc.length,this.facet(We.lineSeparator))}toText(e){return Qe.of(e.split(this.facet(We.lineSeparator)||Ac))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Gs(this,t),Sa(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof kt&&this.config.address[i.id]!=null&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let o=n[s],a=e[s];i.push(o.init(l=>o.spec.fromJSON(a,l)))}}return We.create({doc:e.doc,selection:ie.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=wa.resolve(e.extensions||[],new Map),n=e.doc instanceof Qe?e.doc:Qe.of((e.doc||"").split(t.staticFacet(We.lineSeparator)||Ac)),i=e.selection?e.selection instanceof ie?e.selection:ie.single(e.selection.anchor,e.selection.head):ie.single(0);return tp(i,n.length),t.staticFacet(op)||(i=i.asSingle()),new We(t,n,i,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(We.tabSize)}get lineBreak(){return this.facet(We.lineSeparator)||`
144
+ `}get readOnly(){return this.facet(fp)}phrase(e,...t){for(let n of this.facet(We.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let s of this.facet(sp))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return vk(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let l=Ut(t,o,!1);if(s(t.slice(l,o))!=ot.Word)break;o=l}for(;a<i;){let l=Ut(t,a);if(s(t.slice(a,l))!=ot.Word)break;a=l}return o==a?null:ie.range(o+n,a+n)}}We.allowMultipleSelections=op,We.tabSize=de.define({combine:r=>r.length?r[0]:4}),We.lineSeparator=ap,We.readOnly=fp,We.phrases=de.define({compare(r,e){let t=Object.keys(r),n=Object.keys(e);return t.length==n.length&&t.every(i=>r[i]==e[i])}}),We.languageData=sp,We.changeFilter=lp,We.transactionFilter=cp,We.transactionExtender=up,xa.reconfigure=Ae.define();function zr(r,e,t={}){let n={};for(let i of r)for(let s of Object.keys(i)){let o=i[s],a=n[s];if(a===void 0)n[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class wi{eq(e){return this==e}range(e,t=e){return Ks.create(e,t,this)}}wi.prototype.startSide=wi.prototype.endSide=0,wi.prototype.point=!1,wi.prototype.mapMode=rr.TrackDel;class Ks{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new Ks(e,t,n)}}function Nc(r,e){return r.from-e.from||r.value.startSide-e.value.startSide}class Rc{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let s=n?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,t,n,i){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],i=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+e,h=this.to[l]+e,d,p;if(u==h){let m=t.mapPos(u,c.startSide,c.mapMode);if(m==null||(d=p=m,c.startSide!=c.endSide&&(p=t.mapPos(u,c.endSide),p<d)))continue}else if(d=t.mapPos(u,c.startSide),p=t.mapPos(h,c.endSide),d>p||d==p&&c.startSide>0&&c.endSide<=0)continue;(p-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(a=Math.max(a,p-d)),n.push(c),i.push(d-o),s.push(p-o))}return{mapped:n.length?new Rc(i,s,n,a):null,pos:o}}}class Ge{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new Ge(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(Nc)),this.isEmpty)return t.length?Ge.of(t):this;let a=new gp(this,null,-1).goto(0),l=0,c=[],u=new Un;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let h=t[l++];u.addInner(h.from,h.to,h.value)||c.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(u.addInner(a.from,a.to,a.value)||c.push(Ks.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?Ge.empty:this.nextLayer.update({add:c,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),t.push(l),n.push(e.mapPos(a));else if(c===!0){let{mapped:u,pos:h}=l.map(a,e);u&&(i=Math.max(i,u.maxPoint),t.push(u),n.push(h))}}let s=this.nextLayer.map(e);return t.length==0?s:new Ge(n,t,s||Ge.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Ys.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ys.from(e).goto(t)}static compare(e,t,n,i,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),l=pp(o,a,n),c=new Js(o,l,s),u=new Js(a,l,s);n.iterGaps((h,d,p)=>mp(c,h,u,d,p,i)),n.empty&&n.length==0&&mp(c,0,u,0,0,i)}static eq(e,t,n=0,i){i==null&&(i=1e9-1);let s=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),o=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=pp(s,o),l=new Js(s,a,0).goto(n),c=new Js(o,a,0).goto(n);for(;;){if(l.to!=c.to||!Bc(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,t,n,i,s=-1){let o=new Js(e,null,s).goto(t),a=t,l=o.openStart;for(;;){let c=Math.min(o.to,n);if(o.point){let u=o.activeForPoint(o.to),h=o.pointFrom<t?u.length+1:Math.min(u.length,l);i.point(a,c,o.point,u,h,o.pointRank),l=Math.min(o.openEnd(c),u.length)}else c>a&&(i.span(a,c,o.active,l),l=o.openEnd(c));if(o.to>n)return l+(o.point&&o.to>n?1:0);a=o.to,o.next()}}static of(e,t=!1){let n=new Un;for(let i of e instanceof Ks?[e]:t?yk(e):e)n.add(i.from,i.to,i.value);return n.finish()}}Ge.empty=new Ge([],[],null,-1);function yk(r){if(r.length>1)for(let e=r[0],t=1;t<r.length;t++){let n=r[t];if(Nc(e,n)>0)return r.slice().sort(Nc);e=n}return r}Ge.empty.nextLayer=Ge.empty;class Un{finishChunk(e){this.chunks.push(new Rc(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Un)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Ge.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Ge.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function pp(r,e,t){let n=new Map;for(let s of r)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&n.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=n.get(s.chunk[o]);a!=null&&(t?t.mapPos(a):a)==s.chunkPos[o]&&!t?.touchesRange(a,a+s.chunk[o].length)&&i.add(s.chunk[o])}return i}class gp{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Ys{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&i.push(new gp(o,t,n,s));return i.length==1?i[0]:new Ys(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)Lc(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)Lc(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Lc(this.heap,0)}}}function Lc(r,e){for(let t=r[e];;){let n=(e<<1)+1;if(n>=r.length)break;let i=r[n];if(n+1<r.length&&i.compare(r[n+1])>=0&&(i=r[n+1],n++),t.compare(i)<0)break;r[n]=t,r[e]=i,e=n}}class Js{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ys.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ka(this.active,e),ka(this.activeTo,e),ka(this.activeRank,e),this.minActive=vp(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:s}=this.cursor;for(;t<this.activeRank.length&&this.activeRank[t]<=s;)t++;Aa(this.active,t,n),Aa(this.activeTo,t,i),Aa(this.activeRank,t,s),e&&Aa(e,t,this.cursor.from),this.minActive=vp(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&ka(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let i=n.length-1;i>=0&&n[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function mp(r,e,t,n,i,s){r.goto(e),t.goto(n);let o=n+i,a=n,l=n-e;for(;;){let c=r.to+l-t.to||r.endSide-t.endSide,u=c<0?r.to+l:t.to,h=Math.min(u,o);if(r.point||t.point?r.point&&t.point&&(r.point==t.point||r.point.eq(t.point))&&Bc(r.activeForPoint(r.to),t.activeForPoint(t.to))||s.comparePoint(a,h,r.point,t.point):h>a&&!Bc(r.active,t.active)&&s.compareRange(a,h,r.active,t.active),u>o)break;a=u,c<=0&&r.next(),c>=0&&t.next()}}function Bc(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!=e[t]&&!r[t].eq(e[t]))return!1;return!0}function ka(r,e){for(let t=e,n=r.length-1;t<n;t++)r[t]=r[t+1];r.pop()}function Aa(r,e,t){for(let n=r.length-1;n>=e;n--)r[n+1]=r[n];r[e]=t}function vp(r,e){let t=-1,n=1e9;for(let i=0;i<e.length;i++)(e[i]-n||r[i].endSide-r[t].endSide)<0&&(t=i,n=e[i]);return t}function Xi(r,e,t=r.length){let n=0;for(let i=0;i<t;)r.charCodeAt(i)==9?(n+=e-n%e,i++):(n++,i=Ut(r,i));return n}function Fc(r,e,t,n){for(let i=0,s=0;;){if(s>=e)return i;if(i==r.length)break;s+=r.charCodeAt(i)==9?t-s%t:1,i=Ut(r,i)}return n===!0?-1:r.length}const jc="\u037C",yp=typeof Symbol>"u"?"__"+jc:Symbol.for(jc),Vc=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),bp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Gn{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,c){let u=[],h=/^@(\w+)\b/.exec(o[0]),d=h&&h[1]=="keyframes";if(h&&a==null)return l.push(o[0]+";");for(let p in a){let m=a[p];if(/&/.test(p))s(p.split(/,\s*/).map(y=>o.map(w=>y.replace(/&/,w))).reduce((y,w)=>y.concat(w)),m,l);else if(m&&typeof m=="object"){if(!h)throw new RangeError("The value of a property ("+p+") should be a primitive value.");s(i(p),m,u,d)}else m!=null&&u.push(p.replace(/_.*/,"").replace(/[A-Z]/g,y=>"-"+y.toLowerCase())+": "+m+";")}(u.length||d)&&l.push((n&&!h&&!c?o.map(n):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
145
+ `)}static newName(){let e=bp[yp]||1;return bp[yp]=e+1,jc+e.toString(36)}static mount(e,t,n){let i=e[Vc],s=n&&n.nonce;i?s&&i.setNonce(s):i=new bk(e,s),i.mount(Array.isArray(t)?t:[t])}}let xp=new Map;class bk{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=xp.get(n);if(s)return e.adoptedStyleSheets=[s.sheet,...e.adoptedStyleSheets],e[Vc]=s;this.sheet=new i.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],xp.set(n,this)}else{this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let s=e.head||e;s.insertBefore(this.styleTag,s.firstChild)}this.modules=[],e[Vc]=this}mount(e){let t=this.sheet,n=0,i=0;for(let s=0;s<e.length;s++){let o=e[s],a=this.modules.indexOf(o);if(a<i&&a>-1&&(this.modules.splice(a,1),i--,a=-1),a==-1){if(this.modules.splice(i++,0,o),t)for(let l=0;l<o.rules.length;l++)t.insertRule(o.rules[l],n++)}else{for(;i<a;)n+=this.modules[i++].rules.length;n+=o.rules.length,i++}}if(!t){let s="";for(let o=0;o<this.modules.length;o++)s+=this.modules[o].getRules()+`
146
+ `;this.styleTag.textContent=s}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var Kn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Qs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xk=typeof navigator<"u"&&/Mac/.test(navigator.platform),wk=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Bt=0;Bt<10;Bt++)Kn[48+Bt]=Kn[96+Bt]=String(Bt);for(var Bt=1;Bt<=24;Bt++)Kn[Bt+111]="F"+Bt;for(var Bt=65;Bt<=90;Bt++)Kn[Bt]=String.fromCharCode(Bt+32),Qs[Bt]=String.fromCharCode(Bt);for(var Wc in Kn)Qs.hasOwnProperty(Wc)||(Qs[Wc]=Kn[Wc]);function Sk(r){var e=xk&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||wk&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?Qs:Kn)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Ca(r){let e;return r.nodeType==11?e=r.getSelection?r:r.ownerDocument:e=r,e.getSelection()}function $c(r,e){return e?r==e||r.contains(e.nodeType!=1?e.parentNode:e):!1}function kk(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Oa(r,e){if(!e.anchorNode)return!1;try{return $c(r,e.anchorNode)}catch{return!1}}function Zi(r){return r.nodeType==3?Si(r,0,r.nodeValue.length).getClientRects():r.nodeType==1?r.getClientRects():[]}function Ea(r,e,t,n){return t?wp(r,e,t,n,-1)||wp(r,e,t,n,1):!1}function Xs(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e}function wp(r,e,t,n,i){for(;;){if(r==t&&e==n)return!0;if(e==(i<0?0:Cn(r))){if(r.nodeName=="DIV")return!1;let s=r.parentNode;if(!s||s.nodeType!=1)return!1;e=Xs(r)+(i<0?0:1),r=s}else if(r.nodeType==1){if(r=r.childNodes[e+(i<0?-1:0)],r.nodeType==1&&r.contentEditable=="false")return!1;e=i<0?Cn(r):0}else return!1}}function Cn(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Ta(r,e){let t=e?r.left:r.right;return{left:t,right:t,top:r.top,bottom:r.bottom}}function Ak(r){return{left:0,right:r.innerWidth,top:0,bottom:r.innerHeight}}function Ck(r,e,t,n,i,s,o,a){let l=r.ownerDocument,c=l.defaultView||window;for(let u=r,h=!1;u&&!h;)if(u.nodeType==1){let d,p=u==l.body,m=1,y=1;if(p)d=Ak(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let T=u.getBoundingClientRect();m=T.width/u.offsetWidth,y=T.height/u.offsetHeight,d={left:T.left,right:T.left+u.clientWidth*m,top:T.top,bottom:T.top+u.clientHeight*y}}let w=0,A=0;if(i=="nearest")e.top<d.top?(A=-(d.top-e.top+o),t>0&&e.bottom>d.bottom+A&&(A=e.bottom-d.bottom+A+o)):e.bottom>d.bottom&&(A=e.bottom-d.bottom+o,t<0&&e.top-A<d.top&&(A=-(d.top+A-e.top+o)));else{let T=e.bottom-e.top,P=d.bottom-d.top;A=(i=="center"&&T<=P?e.top+T/2-P/2:i=="start"||i=="center"&&t<0?e.top-o:e.bottom-P+o)-d.top}if(n=="nearest"?e.left<d.left?(w=-(d.left-e.left+s),t>0&&e.right>d.right+w&&(w=e.right-d.right+w+s)):e.right>d.right&&(w=e.right-d.right+s,t<0&&e.left<d.left+w&&(w=-(d.left+w-e.left+s))):w=(n=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:n=="start"==a?e.left-s:e.right-(d.right-d.left)+s)-d.left,w||A)if(p)c.scrollBy(w,A);else{let T=0,P=0;if(A){let L=u.scrollTop;u.scrollTop+=A/y,P=(u.scrollTop-L)*y}if(w){let L=u.scrollLeft;u.scrollLeft+=w/m,T=(u.scrollLeft-L)*m}e={left:e.left-T,top:e.top-P,right:e.right-T,bottom:e.bottom-P},T&&Math.abs(T-w)<1&&(n="nearest"),P&&Math.abs(P-A)<1&&(i="nearest")}if(p)break;u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function Ok(r){let e=r.ownerDocument;for(let t=r.parentNode;t&&t!=e.body;)if(t.nodeType==1){if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class Ek{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Cn(t):0),n,Math.min(e.focusOffset,n?Cn(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let _i=null;function Sp(r){if(r.setActive)return r.setActive();if(_i)return r.focus(_i);let e=[];for(let t=r;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(r.focus(_i==null?{get preventScroll(){return _i={preventScroll:!0},!0}}:void 0),!_i){_i=!1;for(let t=0;t<e.length;){let n=e[t++],i=e[t++],s=e[t++];n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=s&&(n.scrollLeft=s)}}}let kp;function Si(r,e,t=e){let n=kp||(kp=document.createRange());return n.setEnd(r,t),n.setStart(r,e),n}function qi(r,e,t){let n={key:e,code:e,keyCode:t,which:t,cancelable:!0},i=new KeyboardEvent("keydown",n);i.synthetic=!0,r.dispatchEvent(i);let s=new KeyboardEvent("keyup",n);return s.synthetic=!0,r.dispatchEvent(s),i.defaultPrevented||s.defaultPrevented}function Tk(r){for(;r;){if(r&&(r.nodeType==9||r.nodeType==11&&r.host))return r;r=r.assignedSlot||r.parentNode}return null}function Ap(r){for(;r.attributes.length;)r.removeAttributeNode(r.attributes[0])}function Pk(r,e){let t=e.focusNode,n=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=n)return!1;for(n=Math.min(n,Cn(t));;)if(n){if(t.nodeType!=1)return!1;let i=t.childNodes[n-1];i.contentEditable=="false"?n--:(t=i,n=Cn(t))}else{if(t==r)return!0;n=Xs(t),t=t.parentNode}}function Cp(r){return r.scrollTop>Math.max(1,r.scrollHeight-r.clientHeight-4)}class Kt{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new Kt(e.parentNode,Xs(e),t)}static after(e,t){return new Kt(e.parentNode,Xs(e)+1,t)}}const Hc=[];class nt{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let n=this.dom,i=null,s;for(let o of this.children){if(o.flags&7){if(!o.dom&&(s=i?i.nextSibling:n.firstChild)){let a=nt.get(s);(!a||!a.parent&&a.canReuseDOM(o))&&o.reuseDOM(s)}o.sync(e,t),o.flags&=-8}if(s=i?i.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&s!=o.dom&&(t.written=!0),o.dom.parentNode==n)for(;s&&s!=o.dom;)s=Op(s);else n.insertBefore(o.dom,s);i=o.dom}for(s=i?i.nextSibling:n.firstChild,s&&t&&t.node==n&&(t.written=!0);s;)s=Op(s)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let i=Cn(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;i==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?i=-1:i=1),e=s}i<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!nt.get(n);)n=n.nextSibling;if(!n)return this.length;for(let i=0,s=0;;i++){let o=this.children[i];if(o.dom==n)return s;s+=o.length+o.breakAfter}}domBoundsAround(e,t,n=0){let i=-1,s=-1,o=-1,a=-1;for(let l=0,c=n,u=n;l<this.children.length;l++){let h=this.children[l],d=c+h.length;if(c<e&&d>t)return h.domBoundsAround(e,t,c);if(d>=e&&i==-1&&(i=l,s=c),c>t&&h.dom.parentNode==this.dom){o=l,a=u;break}u=d,c=d+h.breakAfter}return{from:s,to:a<0?n+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Hc){this.markDirty();for(let i=e;i<t;i++){let s=this.children[i];s.parent==this&&s.destroy()}this.children.splice(e,t-e,...n);for(let i=0;i<n.length;i++)n[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Ep(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,i,s,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){this.parent=null}}nt.prototype.breakAfter=0;function Op(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class Ep{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function Tp(r,e,t,n,i,s,o,a,l){let{children:c}=r,u=c.length?c[e]:null,h=s.length?s[s.length-1]:null,d=h?h.breakAfter:o;if(!(e==n&&u&&!o&&!d&&s.length<2&&u.merge(t,i,s.length?h:null,t==0,a,l))){if(n<c.length){let p=c[n];p&&(i<p.length||p.breakAfter&&h?.breakAfter)?(e==n&&(p=p.split(i),i=0),!d&&h&&p.merge(0,i,h,!0,0,l)?s[s.length-1]=p:((i||p.children.length&&!p.children[0].length)&&p.merge(0,i,null,!1,0,l),s.push(p))):p?.breakAfter&&(h?h.breakAfter=1:o=1),n++}for(u&&(u.breakAfter=o,t>0&&(!o&&s.length&&u.merge(t,u.length,s[0],!1,a,0)?u.breakAfter=s.shift().breakAfter:(t<u.length||u.children.length&&u.children[u.children.length-1].length==0)&&u.merge(t,u.length,null,!1,a,0),e++));e<n&&s.length;)if(c[n-1].become(s[s.length-1]))n--,s.pop(),l=s.length?0:a;else if(c[e].become(s[0]))e++,s.shift(),a=s.length?0:l;else break;!s.length&&e&&n<c.length&&!c[e-1].breakAfter&&c[n].merge(0,0,c[e-1],!1,a,l)&&e--,(e<n||s.length)&&r.replaceChildren(e,n,s)}}function Pp(r,e,t,n,i,s){let o=r.childCursor(),{i:a,off:l}=o.findPos(t,1),{i:c,off:u}=o.findPos(e,-1),h=e-t;for(let d of n)h+=d.length;r.length+=h,Tp(r,c,u,a,l,n,0,i,s)}let vr=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},zc=typeof document<"u"?document:{documentElement:{style:{}}};const Uc=/Edge\/(\d+)/.exec(vr.userAgent),Mp=/MSIE \d/.test(vr.userAgent),Gc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vr.userAgent),Pa=!!(Mp||Gc||Uc),Ip=!Pa&&/gecko\/(\d+)/i.test(vr.userAgent),Kc=!Pa&&/Chrome\/(\d+)/.exec(vr.userAgent),Dp="webkitFontSmoothing"in zc.documentElement.style,Np=!Pa&&/Apple Computer/.test(vr.vendor),Rp=Np&&(/Mobile\/\w+/.test(vr.userAgent)||vr.maxTouchPoints>2);var ye={mac:Rp||/Mac/.test(vr.platform),windows:/Win/.test(vr.platform),linux:/Linux|X11/.test(vr.platform),ie:Pa,ie_version:Mp?zc.documentMode||6:Gc?+Gc[1]:Uc?+Uc[1]:0,gecko:Ip,gecko_version:Ip?+(/Firefox\/(\d+)/.exec(vr.userAgent)||[0,0])[1]:0,chrome:!!Kc,chrome_version:Kc?+Kc[1]:0,ios:Rp,android:/Android\b/.test(vr.userAgent),webkit:Dp,safari:Np,webkit_version:Dp?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:zc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Mk=256;class On extends nt{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof On)||this.length-(t-e)+n.length>Mk||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new On(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Kt(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Ik(this.dom,e,t)}}class En extends nt{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let i of t)i.setParent(this)}setAttrs(e){if(Ap(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,i,s,o){return n&&(!(n instanceof En&&n.mark.eq(this.mark))||e&&s<=0||t<this.length&&o<=0)?!1:(Pp(this,e,t,n?n.children:[],s-1,o-1),this.markDirty(),!0)}split(e){let t=[],n=0,i=-1,s=0;for(let a of this.children){let l=n+a.length;l>e&&t.push(n<e?a.split(e-n):a),i<0&&n>=e&&(i=s),n=l,s++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new En(this.mark,t,o)}domAtPos(e){return Lp(this,e)}coordsAt(e,t){return Fp(this,e,t)}}function Ik(r,e,t){let n=r.nodeValue.length;e>n&&(e=n);let i=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?ye.chrome||ye.gecko||(e?(i--,o=1):s<n&&(s++,o=-1)):t<0?i--:s<n&&s++;let a=Si(r,i,s).getClientRects();if(!a.length)return null;let l=a[(o?o<0:t>=0)?0:a.length-1];return ye.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),o?Ta(l,o<0):l||null}class Yn extends nt{static create(e,t,n){return new Yn(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=Yn.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,n,i,s,o){return n&&(!(n instanceof Yn)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}become(e){return e instanceof Yn&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Qe.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,i=this.posAtStart;return n?n.slice(i,i+this.length):Qe.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Kt.before(this.dom):Kt.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?i.length-1:0;s=i[a],!(e>0?a==0:a==i.length-1||s.top<s.bottom);a+=o?-1:1);return Ta(s,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class es extends nt{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof es&&e.side==this.side}split(){return new es(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Kt.before(this.dom):Kt.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Qe.empty}get isHidden(){return!0}}On.prototype.children=Yn.prototype.children=es.prototype.children=Hc;function Lp(r,e){let t=r.dom,{children:n}=r,i=0;for(let s=0;i<n.length;i++){let o=n[i],a=s+o.length;if(!(a==s&&o.getSide()<=0)){if(e>s&&e<a&&o.dom.parentNode==t)return o.domAtPos(e-s);if(e<=s)break;s=a}}for(let s=i;s>0;s--){let o=n[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=i;s<n.length;s++){let o=n[s];if(o.dom.parentNode==t)return o.domAtPos(0)}return new Kt(t,0)}function Bp(r,e,t){let n,{children:i}=r;t>0&&e instanceof En&&i.length&&(n=i[i.length-1])instanceof En&&n.mark.eq(e.mark)?Bp(n,e.children[0],t-1):(i.push(e),e.setParent(r)),r.length+=e.length}function Fp(r,e,t){let n=null,i=-1,s=null,o=-1;function a(c,u){for(let h=0,d=0;h<c.children.length&&d<=u;h++){let p=c.children[h],m=d+p.length;m>=u&&(p.children.length?a(p,u-d):(!s||s.isHidden&&t>0)&&(m>u||d==m&&p.getSide()>0)?(s=p,o=u-d):(d<u||d==m&&p.getSide()<0&&!p.isHidden)&&(n=p,i=u-d)),d=m}}a(r,e);let l=(t<0?n:s)||n||s;return l?l.coordsAt(Math.max(0,l==n?i:o),t):Dk(r)}function Dk(r){let e=r.dom.lastChild;if(!e)return r.dom.getBoundingClientRect();let t=Zi(e);return t[t.length-1]||null}function Yc(r,e){for(let t in r)t=="class"&&e.class?e.class+=" "+r.class:t=="style"&&e.style?e.style+=";"+r.style:e[t]=r[t];return e}const jp=Object.create(null);function Jc(r,e,t){if(r==e)return!0;r||(r=jp),e||(e=jp);let n=Object.keys(r),i=Object.keys(e);if(n.length-(t&&n.indexOf(t)>-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(i.indexOf(s)==-1||r[s]!==e[s]))return!1;return!0}function Qc(r,e,t){let n=!1;if(e)for(let i in e)t&&i in t||(n=!0,i=="style"?r.style.cssText="":r.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(n=!0,i=="style"?r.style.cssText=t[i]:r.setAttribute(i,t[i]));return n}function Nk(r){let e=Object.create(null);for(let t=0;t<r.attributes.length;t++){let n=r.attributes[t];e[n.name]=n.value}return e}class Pt extends nt{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,i,s,o){if(n){if(!(n instanceof Pt))return!1;this.dom||n.transferDOM(this)}return i&&this.setDeco(n?n.attrs:null),Pp(this,e,t,n?n.children:[],s,o),!0}split(e){let t=new Pt;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:i}=this.childPos(e);i&&(t.append(this.children[n].split(i),0),this.children[n].merge(i,this.children[n].length,null,!1,0,0),n++);for(let s=n;s<this.children.length;s++)t.append(this.children[s],0);for(;n>0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Jc(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Bp(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Yc(t,this.attrs||{})),n&&(this.attrs=Yc({class:n},this.attrs||{}))}domAtPos(e){return Lp(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(Ap(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Qc(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&nt.get(i)instanceof En;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((n=nt.get(i))===null||n===void 0?void 0:n.isEditable)==!1&&(!ye.ios||!this.children.some(s=>s instanceof On))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof On)||/[^ -~]/.test(n.text))return null;let i=Zi(n.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Fp(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:i}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-i.lineHeight)<2&&i.textHeight<s){let o=(s-i.textHeight)/2;return{top:n.top+o,bottom:n.bottom-o,left:n.left,right:n.left}}}return n}become(e){return!1}covers(){return!0}static find(e,t){for(let n=0,i=0;n<e.children.length;n++){let s=e.children[n],o=i+s.length;if(o>=t){if(s instanceof Pt)return s;if(o>t)break}i=o+s.breakAfter}return null}}class Jn extends nt{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,i,s,o){return n&&(!(n instanceof Jn)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Kt.before(this.dom):Kt.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new Jn(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return Hc}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Qe.empty}domBoundsAround(){return null}become(e){return e instanceof Jn&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){return this.widget.coordsAt(this.dom,e,t)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t==n?!1:e<0?t<0:n>0}}class on{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}destroy(e){}}var nr=function(r){return r[r.Text=0]="Text",r[r.WidgetBefore=1]="WidgetBefore",r[r.WidgetAfter=2]="WidgetAfter",r[r.WidgetRange=3]="WidgetRange",r}(nr||(nr={}));class we extends wi{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Zs(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Qn(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:s,end:o}=Vp(e,t);n=(s?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new Qn(e,n,i,t,e.widget||null,!0)}static line(e){return new _s(e)}static set(e,t=!1){return Ge.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}we.none=Ge.empty;class Zs extends we{constructor(e){let{start:t,end:n}=Vp(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof Zs&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Jc(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Zs.prototype.point=!1;class _s extends we{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof _s&&this.spec.class==e.spec.class&&Jc(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}_s.prototype.mapMode=rr.TrackBefore,_s.prototype.point=!0;class Qn extends we{constructor(e,t,n,i,s,o){super(t,n,s,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?rr.TrackBefore:rr.TrackAfter:rr.TrackDel}get type(){return this.startSide!=this.endSide?nr.WidgetRange:this.startSide<=0?nr.WidgetBefore:nr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Qn&&Rk(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Qn.prototype.point=!0;function Vp(r,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=r;return t==null&&(t=r.inclusive),n==null&&(n=r.inclusive),{start:t??e,end:n??e}}function Rk(r,e){return r==e||!!(r&&e&&r.compare(e))}function Xc(r,e,t,n=0){let i=t.length-1;i>=0&&t[i]+n>=r?t[i]=Math.max(t[i],e):t.push(r,e)}class qs{constructor(e,t,n,i){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Jn&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Pt),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ma(new es(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Jn)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(Ma(new On(this.text.slice(this.textOff,this.textOff+i)),t),n),this.atCursorPos=!0,this.textOff+=i,e-=i,n=0}}span(e,t,n,i){this.buildText(t-e,n,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,n,i,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Qn){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(n instanceof Qn)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Jn(n.widget||new Wp("div"),a,n));else{let l=Yn.create(n.widget||new Wp("span"),a,a?0:n.startSide),c=this.atCursorPos&&!l.isEditable&&s<=i.length&&(e<t||n.startSide>0),u=!l.isEditable&&(e<t||s>i.length||n.startSide<=0),h=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(h.append(Ma(new es(1),i),s),s=i.length+Math.max(0,s-i.length)),h.append(Ma(l,i),s),this.atCursorPos=u,this.pendingBuffer=u?e<t||s>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,n,i,s){let o=new qs(e,t,n,s);return o.openEnd=Ge.spans(i,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ma(r,e){for(let t of e)r=new En(t,[r],r.length);return r}class Wp extends on{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const $p=de.define(),Hp=de.define(),zp=de.define(),Up=de.define(),Zc=de.define(),Gp=de.define(),Kp=de.define(),Yp=de.define({combine:r=>r.some(e=>e)}),Jp=de.define({combine:r=>r.some(e=>e)});class Ia{constructor(e,t="nearest",n="nearest",i=5,s=5){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=s}map(e){return e.empty?this:new Ia(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Qp=Ae.define({map:(r,e)=>r.map(e)});function Nr(r,e,t){let n=r.facet(Up);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Da=de.define({combine:r=>r.length?r[0]:!0});let Lk=0;const eo=de.define();class ut{constructor(e,t,n,i,s){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:n,eventObservers:i,provide:s,decorations:o}=t||{};return new ut(Lk++,e,n,i,a=>{let l=[eo.of(a)];return o&&l.push(to.of(c=>{let u=c.plugin(a);return u?o(u):we.none})),s&&l.push(s(a)),l})}static fromClass(e,t){return ut.define(n=>new e(n),t)}}class _c{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Nr(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Nr(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){Nr(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Xp=de.define(),Na=de.define(),to=de.define(),qc=de.define(),Zp=de.define();function _p(r,e,t){let n=r.state.facet(Zp);if(!n.length)return n;let i=n.map(o=>o instanceof Function?o(r):o),s=[];return Ge.spans(i,e,t,{point(){},span(o,a,l,c){let u=s;for(let h=l.length-1;h>=0;h--,c--){let d=l[h].spec.bidiIsolate,p;if(d!=null)if(c>0&&u.length&&(p=u[u.length-1]).to==o&&p.direction==d)p.to=a,u=p.inner;else{let m={from:o,to:a,direction:d,inner:[]};u.push(m),u=m.inner}}}}),s}const qp=de.define();function eg(r){let e=0,t=0,n=0,i=0;for(let s of r.state.facet(qp)){let o=s(r);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:t,top:n,bottom:i}}const ro=de.define();class yr{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new yr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(t.length==0)return e;let n=[];for(let i=0,s=0,o=0,a=0;;i++){let l=i==e.length?null:e[i],c=o-a,u=l?l.fromB:1e9;for(;s<t.length&&t[s]<u;){let h=t[s],d=t[s+1],p=Math.max(a,h),m=Math.min(u,d);if(p<=m&&new yr(p+c,m+c,p,m).addToSet(n),d>u)break;s+=2}if(!l)return n;new yr(l.fromA,l.toA,l.fromB,l.toB).addToSet(n),o=l.toA,a=l.toB}}}class Ra{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Et.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.push(new yr(s,o,a,l))),this.changedRanges=i}static create(e,t,n){return new Ra(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var ft=function(r){return r[r.LTR=0]="LTR",r[r.RTL=1]="RTL",r}(ft||(ft={}));const no=ft.LTR,tg=ft.RTL;function rg(r){let e=[];for(let t=0;t<r.length;t++)e.push(1<<+r[t]);return e}const Bk=rg("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Fk=rg("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),eu=Object.create(null),an=[];for(let r of["()","[]","{}"]){let e=r.charCodeAt(0),t=r.charCodeAt(1);eu[e]=t,eu[t]=-e}function jk(r){return r<=247?Bk[r]:1424<=r&&r<=1524?2:1536<=r&&r<=1785?Fk[r-1536]:1774<=r&&r<=2220?4:8192<=r&&r<=8203?256:64336<=r&&r<=65023?4:r==8204?256:1}const Vk=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Xn{get dir(){return this.level%2?tg:no}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}static find(e,t,n,i){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==n)return o;(s<0||(i!=0?i<0?a.from<t:a.to>t:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function ng(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++){let n=r[t],i=e[t];if(n.from!=i.from||n.to!=i.to||n.direction!=i.direction||!ng(n.inner,i.inner))return!1}return!0}const qe=[];function Wk(r,e,t,n,i){for(let s=0;s<=n.length;s++){let o=s?n[s-1].to:e,a=s<n.length?n[s].from:t,l=s?256:i;for(let c=o,u=l,h=l;c<a;c++){let d=jk(r.charCodeAt(c));d==512?d=u:d==8&&h==4&&(d=16),qe[c]=d==4?2:d,d&7&&(h=d),u=d}for(let c=o,u=l,h=l;c<a;c++){let d=qe[c];if(d==128)c<a-1&&u==qe[c+1]&&u&24?d=qe[c]=u:qe[c]=256;else if(d==64){let p=c+1;for(;p<a&&qe[p]==64;)p++;let m=c&&u==8||p<t&&qe[p]==8?h==1?1:8:256;for(let y=c;y<p;y++)qe[y]=m;c=p-1}else d==8&&h==1&&(qe[c]=1);u=d,d&7&&(h=d)}}}function $k(r,e,t,n,i){let s=i==1?2:1;for(let o=0,a=0,l=0;o<=n.length;o++){let c=o?n[o-1].to:e,u=o<n.length?n[o].from:t;for(let h=c,d,p,m;h<u;h++)if(p=eu[d=r.charCodeAt(h)])if(p<0){for(let y=a-3;y>=0;y-=3)if(an[y+1]==-p){let w=an[y+2],A=w&2?i:w&4?w&1?s:i:0;A&&(qe[h]=qe[an[y]]=A),a=y;break}}else{if(an.length==189)break;an[a++]=h,an[a++]=d,an[a++]=l}else if((m=qe[h])==2||m==1){let y=m==i;l=y?0:1;for(let w=a-3;w>=0;w-=3){let A=an[w+2];if(A&2)break;if(y)an[w+2]|=2;else{if(A&4)break;an[w+2]|=4}}}}}function Hk(r,e,t,n){for(let i=0,s=n;i<=t.length;i++){let o=i?t[i-1].to:r,a=i<t.length?t[i].from:e;for(let l=o;l<a;){let c=qe[l];if(c==256){let u=l+1;for(;;)if(u==a){if(i==t.length)break;u=t[i++].to,a=i<t.length?t[i].from:e}else if(qe[u]==256)u++;else break;let h=s==1,d=(u<e?qe[u]:n)==1,p=h==d?h?1:2:n;for(let m=u,y=i,w=y?t[y-1].to:r;m>l;)m==w&&(m=t[--y].from,w=y?t[y-1].to:r),qe[--m]=p;l=u}else s=c,l++}}}function tu(r,e,t,n,i,s,o){let a=n%2?2:1;if(n%2==i%2)for(let l=e,c=0;l<t;){let u=!0,h=!1;if(c==s.length||l<s[c].from){let y=qe[l];y!=a&&(u=!1,h=y==16)}let d=!u&&a==1?[]:null,p=u?n:n+1,m=l;e:for(;;)if(c<s.length&&m==s[c].from){if(h)break e;let y=s[c];if(!u)for(let w=y.to,A=c+1;;){if(w==t)break e;if(A<s.length&&s[A].from==w)w=s[A++].to;else{if(qe[w]==a)break e;break}}if(c++,d)d.push(y);else{y.from>l&&o.push(new Xn(l,y.from,p));let w=y.direction==no!=!(p%2);ru(r,w?n+1:n,i,y.inner,y.from,y.to,o),l=y.to}m=y.to}else{if(m==t||(u?qe[m]!=a:qe[m]==a))break;m++}d?tu(r,l,m,n+1,i,d,o):l<m&&o.push(new Xn(l,m,p)),l=m}else for(let l=t,c=s.length;l>e;){let u=!0,h=!1;if(!c||l>s[c-1].to){let y=qe[l-1];y!=a&&(u=!1,h=y==16)}let d=!u&&a==1?[]:null,p=u?n:n+1,m=l;e:for(;;)if(c&&m==s[c-1].to){if(h)break e;let y=s[--c];if(!u)for(let w=y.from,A=c;;){if(w==e)break e;if(A&&s[A-1].to==w)w=s[--A].from;else{if(qe[w-1]==a)break e;break}}if(d)d.push(y);else{y.to<l&&o.push(new Xn(y.to,l,p));let w=y.direction==no!=!(p%2);ru(r,w?n+1:n,i,y.inner,y.from,y.to,o),l=y.from}m=y.from}else{if(m==e||(u?qe[m-1]!=a:qe[m-1]==a))break;m--}d?tu(r,m,l,n+1,i,d,o):m<l&&o.push(new Xn(m,l,p)),l=m}}function ru(r,e,t,n,i,s,o){let a=e%2?2:1;Wk(r,i,s,n,a),$k(r,i,s,n,a),Hk(i,s,n,a),tu(r,i,s,e,t,n,o)}function ig(r,e,t){if(!r)return[new Xn(0,0,e==tg?1:0)];if(e==no&&!t.length&&!Vk.test(r))return sg(r.length);if(t.length)for(;r.length>qe.length;)qe[qe.length]=256;let n=[],i=e==no?0:1;return ru(r,i,i,t,0,r.length,n),n}function sg(r){return[new Xn(0,r,0)]}let og="";function ag(r,e,t,n,i){var s;let o=n.head-r.from,a=-1;if(o==0){if(!i||!r.length)return null;e[0].level!=t&&(o=e[0].side(!1,t),a=0)}else if(o==r.length){if(i)return null;let d=e[e.length-1];d.level!=t&&(o=d.side(!0,t),a=e.length-1)}a<0&&(a=Xn.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc));let l=e[a];o==l.side(i,t)&&(l=e[a+=i?1:-1],o=l.side(!i,t));let c=i==(l.dir==t),u=Ut(r.text,o,c);if(og=r.text.slice(Math.min(o,u),Math.max(o,u)),u!=l.side(i,t))return ie.cursor(u+r.from,c?-1:1,l.level);let h=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return!h&&l.level!=t?ie.cursor(i?r.to:r.from,i?-1:1,t):h&&h.level<l.level?ie.cursor(h.side(!i,t)+r.from,i?1:-1,h.level):ie.cursor(u+r.from,i?-1:1,l.level)}class lg extends nt{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Pt],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new yr(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:u})=>u<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!Qk(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?Uk(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;n=new yr(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(ye.ie||ye.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),l=Yk(o,a,e.changes);return n=yr.extendWithRanges(n,l),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=ye.chrome||ye.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||i.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof Jn&&o.widget instanceof cg&&s.push(o.dom);i.updateGaps(s)}updateChildren(e,t,n){let i=n?n.range.addToSet(e.slice()):e,s=this.childCursor(t);for(let o=i.length-1;;o--){let a=o>=0?i[o]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:h}=a,d,p,m,y;if(n&&n.range.fromB<h&&n.range.toB>u){let L=qs.build(this.view.state.doc,u,n.range.fromB,this.decorations,this.dynamicDecorationMap),D=qs.build(this.view.state.doc,n.range.toB,h,this.decorations,this.dynamicDecorationMap);p=L.breakAtStart,m=L.openStart,y=D.openEnd;let j=this.compositionView(n);D.breakAtStart?j.breakAfter=1:D.content.length&&j.merge(j.length,j.length,D.content[0],!1,D.openStart,0)&&(j.breakAfter=D.content[0].breakAfter,D.content.shift()),L.content.length&&j.merge(0,0,L.content[L.content.length-1],!0,0,L.openEnd)&&L.content.pop(),d=L.content.concat(j).concat(D.content)}else({content:d,breakAtStart:p,openStart:m,openEnd:y}=qs.build(this.view.state.doc,u,h,this.decorations,this.dynamicDecorationMap));let{i:w,off:A}=s.findPos(c,1),{i:T,off:P}=s.findPos(l,-1);Tp(this,T,P,w,A,d,p,m,y)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new On(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new En(i,[t],t.length);let n=new Pt;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(o);let a=nt.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),i=this.children[n.i];t(e.line,i);for(let s=e.marks.length-1;s>=-1;s--)n=i.childPos(n.off,1),i=i.children[n.i],t(s>=0?e.marks[s].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,i=n==this.dom,s=!i&&Oa(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(i||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(ye.gecko&&a.empty&&!this.hasComposition&&zk(l)){let h=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(h,l.node.childNodes[l.offset]||null)),l=c=new Kt(h,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||!Ea(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Ea(c.node,c.offset,u.focusNode,u.focusOffset))&&(this.view.observer.ignore(()=>{ye.android&&ye.chrome&&this.dom.contains(u.focusNode)&&Jk(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let h=Ca(this.view.root);if(h)if(a.empty){if(ye.gecko){let d=Gk(l.node,l.offset);if(d&&d!=3){let p=fg(l.node,l.offset,d==1?1:-1);p&&(l=new Kt(p.node,p.offset))}}h.collapse(l.node,l.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(l.node,l.offset);try{h.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),h.removeAllRanges(),h.addRange(d)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Kt(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Kt(u.focusNode,u.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Ca(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=Pt.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let l=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(t.head+t.assoc);n.collapse(u.node,u.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&n.collapse(i,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let i=e.offset;!n&&i<t.childNodes.length;i++){let s=nt.get(t.childNodes[i]);s instanceof Pt&&(n=s.domAtPos(0))}for(let i=e.offset-1;!n&&i>=0;i--){let s=nt.get(t.childNodes[i]);s instanceof Pt&&(n=s.domAtPos(s.length))}return n?new Kt(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=nt.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let i=this.children[t];if(n<i.length||i instanceof Pt)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,i=0;for(let s=this.length,o=this.children.length-1;o>=0;o--){let a=this.children[o],l=s-a.breakAfter,c=l-a.length;if(l<e)break;c<=e&&(c<e||a.covers(-1))&&(l>e||a.covers(1))&&(!n||a instanceof Pt&&!(n instanceof Pt&&t>=0))&&(n=a,i=c),s=c}return n?n.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),i=this.children[t];if(!(i instanceof Pt))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(n,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}n=l}if(!(i instanceof On))return null;let s=Ut(i.text,n);if(s==n)return null;let o=Si(i.dom,n,s).getClientRects();for(let a=0;a<o.length;a++){let l=o[a];if(a==o.length-1||l.top<l.bottom&&l.left<l.right)return l}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==ft.LTR;for(let c=0,u=0;u<this.children.length;u++){let h=this.children[u],d=c+h.length;if(d>i)break;if(c>=n){let p=h.dom.getBoundingClientRect();if(t.push(p.height),o){let m=h.dom.lastChild,y=m?Zi(m):[];if(y.length){let w=y[y.length-1],A=l?w.right-p.left:p.right-w.left;A>a&&(a=A,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+h.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?ft.RTL:ft.LTR}measureTextSize(){for(let s of this.children)if(s instanceof Pt){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=Zi(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,i=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Ep(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let s=i==t.viewports.length?null:t.viewports[i],o=s?s.from-1:this.length;if(o>n){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(we.replace({widget:new cg(a),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return we.set(e)}updateDeco(){let e=this.view.state.facet(to).map((t,n)=>(this.dynamicDecorationMap[n]=typeof t=="function")?t(this.view):t);for(let t=e.length;t<e.length+3;t++)this.dynamicDecorationMap[t]=!1;return this.decorations=[...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]}scrollIntoView(e){let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),i;if(!n)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let s=eg(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom};Ck(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,e.xMargin,e.yMargin,this.view.textDirection==ft.LTR)}}function zk(r){return r.node.nodeType==1&&r.node.firstChild&&(r.offset==0||r.node.childNodes[r.offset-1].contentEditable=="false")&&(r.offset==r.node.childNodes.length||r.node.childNodes[r.offset].contentEditable=="false")}class cg extends on{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}}function ug(r,e){let t=r.observer.selectionRange,n=t.focusNode&&fg(t.focusNode,t.focusOffset,0);if(!n)return null;let i=e-n.offset;return{from:i,to:i+n.node.nodeValue.length,node:n.node}}function Uk(r,e,t){let n=ug(r,t);if(!n)return null;let{node:i,from:s,to:o}=n,a=i.nodeValue;if(/[\n\r]/.test(a)||r.state.doc.sliceString(n.from,n.to)!=a)return null;let l=e.invertedDesc,c=new yr(l.mapPos(s),l.mapPos(o),s,o),u=[];for(let h=i.parentNode;;h=h.parentNode){let d=nt.get(h);if(d instanceof En)u.push({node:h,deco:d.mark});else{if(d instanceof Pt||h.nodeName=="DIV"&&h.parentNode==r.contentDOM)return{range:c,text:i,marks:u,line:h};if(h!=r.contentDOM)u.push({node:h,deco:new Zs({inclusive:!0,attributes:Nk(h),tagName:h.tagName.toLowerCase()})});else return null}}}function fg(r,e,t){if(t<=0)for(let n=r,i=e;;){if(n.nodeType==3)return{node:n,offset:i};if(n.nodeType==1&&i>0)n=n.childNodes[i-1],i=Cn(n);else break}if(t>=0)for(let n=r,i=e;;){if(n.nodeType==3)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length&&t>=0)n=n.childNodes[i],i=0;else break}return null}function Gk(r,e){return r.nodeType!=1?0:(e&&r.childNodes[e-1].contentEditable=="false"?1:0)|(e<r.childNodes.length&&r.childNodes[e].contentEditable=="false"?2:0)}let Kk=class{constructor(){this.changes=[]}compareRange(e,t){Xc(e,t,this.changes)}comparePoint(e,t){Xc(e,t,this.changes)}};function Yk(r,e,t){let n=new Kk;return Ge.compare(r,e,t,n),n.changes}function Jk(r,e){for(let t=r;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Qk(r,e){let t=!1;return e&&r.iterChangedRanges((n,i)=>{n<e.to&&i>e.from&&(t=!0)}),t}function Xk(r,e,t=1){let n=r.charCategorizer(e),i=r.doc.lineAt(e),s=e-i.from;if(i.length==0)return ie.cursor(e);s==0?t=1:s==i.length&&(t=-1);let o=s,a=s;t<0?o=Ut(i.text,s,!1):a=Ut(i.text,s);let l=n(i.text.slice(o,a));for(;o>0;){let c=Ut(i.text,o,!1);if(n(i.text.slice(c,o))!=l)break;o=c}for(;a<i.length;){let c=Ut(i.text,a);if(n(i.text.slice(a,c))!=l)break;a=c}return ie.range(o+i.from,a+i.from)}function Zk(r,e){return e.left>r?e.left-r:Math.max(0,r-e.right)}function _k(r,e){return e.top>r?e.top-r:Math.max(0,r-e.bottom)}function nu(r,e){return r.top<e.bottom-1&&r.bottom>e.top+1}function hg(r,e){return e<r.top?{top:e,left:r.left,right:r.right,bottom:r.bottom}:r}function dg(r,e){return e>r.bottom?{top:r.top,left:r.left,right:r.right,bottom:e}:r}function iu(r,e,t){let n,i,s,o,a=!1,l,c,u,h;for(let m=r.firstChild;m;m=m.nextSibling){let y=Zi(m);for(let w=0;w<y.length;w++){let A=y[w];i&&nu(i,A)&&(A=hg(dg(A,i.bottom),i.top));let T=Zk(e,A),P=_k(t,A);if(T==0&&P==0)return m.nodeType==3?pg(m,e,t):iu(m,e,t);if(!n||o>P||o==P&&s>T){n=m,i=A,s=T,o=P;let L=P?t<A.top?-1:1:T?e<A.left?-1:1:0;a=!L||(L>0?w<y.length-1:w>0)}T==0?t>A.bottom&&(!u||u.bottom<A.bottom)?(l=m,u=A):t<A.top&&(!h||h.top>A.top)&&(c=m,h=A):u&&nu(u,A)?u=dg(u,A.bottom):h&&nu(h,A)&&(h=hg(h,A.top))}}if(u&&u.bottom>=t?(n=l,i=u):h&&h.top<=t&&(n=c,i=h),!n)return{node:r,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(n.nodeType==3)return pg(n,d,t);if(a&&n.contentEditable!="false")return iu(n,d,t);let p=Array.prototype.indexOf.call(r.childNodes,n)+(e>=(i.left+i.right)/2?1:0);return{node:r,offset:p}}function pg(r,e,t){let n=r.nodeValue.length,i=-1,s=1e9,o=0;for(let a=0;a<n;a++){let l=Si(r,a,a+1).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(u.top==u.bottom)continue;o||(o=e-u.left);let h=(u.top>t?u.top-t:t-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&h<s){let d=e>=(u.left+u.right)/2,p=d;if((ye.chrome||ye.gecko)&&Si(r,a).getBoundingClientRect().left==u.right&&(p=!d),h<=0)return{node:r,offset:a+(p?1:0)};i=a+(p?1:0),s=h}}}return{node:r,offset:i>-1?i:o>0?r.nodeValue.length:0}}function gg(r,e,t,n=-1){var i,s;let o=r.contentDOM.getBoundingClientRect(),a=o.top+r.viewState.paddingTop,l,{docHeight:c}=r.viewState,{x:u,y:h}=e,d=h-a;if(d<0)return 0;if(d>c)return r.state.doc.length;for(let L=r.viewState.heightOracle.textHeight/2,D=!1;l=r.elementAtHeight(d),l.type!=nr.Text;)for(;d=n>0?l.bottom+L:l.top-L,!(d>=0&&d<=c);){if(D)return t?null:0;D=!0,n=-n}h=a+d;let p=l.from;if(p<r.viewport.from)return r.viewport.from==0?0:t?null:mg(r,o,l,u,h);if(p>r.viewport.to)return r.viewport.to==r.state.doc.length?r.state.doc.length:t?null:mg(r,o,l,u,h);let m=r.dom.ownerDocument,y=r.root.elementFromPoint?r.root:m,w=y.elementFromPoint(u,h);w&&!r.contentDOM.contains(w)&&(w=null),w||(u=Math.max(o.left+1,Math.min(o.right-1,u)),w=y.elementFromPoint(u,h),w&&!r.contentDOM.contains(w)&&(w=null));let A,T=-1;if(w&&((i=r.docView.nearest(w))===null||i===void 0?void 0:i.isEditable)!=!1){if(m.caretPositionFromPoint){let L=m.caretPositionFromPoint(u,h);L&&({offsetNode:A,offset:T}=L)}else if(m.caretRangeFromPoint){let L=m.caretRangeFromPoint(u,h);L&&({startContainer:A,startOffset:T}=L,(!r.contentDOM.contains(A)||ye.safari&&qk(A,T,u)||ye.chrome&&eA(A,T,u))&&(A=void 0))}}if(!A||!r.docView.dom.contains(A)){let L=Pt.find(r.docView,p);if(!L)return d>l.top+l.height/2?l.to:l.from;({node:A,offset:T}=iu(L.dom,u,h))}let P=r.docView.nearest(A);if(!P)return null;if(P.isWidget&&((s=P.dom)===null||s===void 0?void 0:s.nodeType)==1){let L=P.dom.getBoundingClientRect();return e.y<L.top||e.y<=L.bottom&&e.x<=(L.left+L.right)/2?P.posAtStart:P.posAtEnd}else return P.localPosFromDOM(A,T)+P.posAtStart}function mg(r,e,t,n,i){let s=Math.round((n-e.left)*r.defaultCharacterWidth);if(r.lineWrapping&&t.height>r.defaultLineHeight*1.5){let a=r.viewState.heightOracle.textHeight,l=Math.floor((i-t.top-(r.defaultLineHeight-a)*.5)/a);s+=l*r.viewState.heightOracle.lineLength}let o=r.state.sliceDoc(t.from,t.to);return t.from+Fc(o,s,r.state.tabSize)}function qk(r,e,t){let n;if(r.nodeType!=3||e!=(n=r.nodeValue.length))return!1;for(let i=r.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return Si(r,n-1,n).getBoundingClientRect().left>t}function eA(r,e,t){if(e!=0)return!1;for(let i=r;;){let s=i.parentNode;if(!s||s.nodeType!=1||s.firstChild!=i)return!1;if(s.classList.contains("cm-line"))break;i=s}let n=r.nodeType==1?r.getBoundingClientRect():Si(r,0,Math.max(r.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function su(r,e){let t=r.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==nr.Text))return n}return t}function tA(r,e,t,n){let i=su(r,e.head),s=!n||i.type!=nr.Text||!(r.lineWrapping||i.widgetLineBreaks)?null:r.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=r.dom.getBoundingClientRect(),a=r.textDirectionAt(i.from),l=r.posAtCoords({x:t==(a==ft.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return ie.cursor(l,t?-1:1)}return ie.cursor(t?i.to:i.from,t?-1:1)}function vg(r,e,t,n){let i=r.state.doc.lineAt(e.head),s=r.bidiSpans(i),o=r.textDirectionAt(i.from);for(let a=e,l=null;;){let c=ag(i,s,o,a,t),u=og;if(!c){if(i.number==(t?r.state.doc.lines:1))return a;u=`
147
+ `,i=r.state.doc.line(i.number+(t?1:-1)),s=r.bidiSpans(i),c=ie.cursor(t?i.from:i.to)}if(l){if(!l(u))return a}else{if(!n)return c;l=n(u)}a=c}}function rA(r,e,t){let n=r.state.charCategorizer(e),i=n(t);return s=>{let o=n(s);return i==ot.Space&&(i=o),i==o}}function nA(r,e,t,n){let i=e.head,s=t?1:-1;if(i==(t?r.state.doc.length:0))return ie.cursor(i,e.assoc);let o=e.goalColumn,a,l=r.contentDOM.getBoundingClientRect(),c=r.coordsAtPos(i,e.assoc||-1),u=r.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let p=r.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,r.defaultCharacterWidth*(i-p.from))),a=(s<0?p.top:p.bottom)+u}let h=l.left+o,d=n??r.viewState.heightOracle.textHeight>>1;for(let p=0;;p+=10){let m=a+(d+p)*s,y=gg(r,{x:h,y:m},!1,s);if(m<l.top||m>l.bottom||(s<0?y<i:y>i)){let w=r.docView.coordsForChar(y),A=!w||m<w.top?-1:1;return ie.cursor(y,A,void 0,o)}}}function La(r,e,t){for(;;){let n=0;for(let i of r)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=n||t||(e-s<o-e?-1:1);e=l<0?s:o,n=l}});if(!n)return e}}function ou(r,e,t){let n=La(r.state.facet(qc).map(i=>i(r)),t.from,e.head>t.from?-1:1);return n==t.from?t:ie.cursor(n,n<t.from?1:-1)}class iA{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ye.safari&&e.contentDOM.addEventListener("input",()=>null),ye.gecko&&xA(e.contentDOM.ownerDocument)}handleEvent(e){!hA(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let i of n.observers)i(this.view,t);for(let i of n.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=sA(e),n=this.handlers,i=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=n[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(e.keyCode!=27&&xg.indexOf(e.keyCode)<0&&(this.view.inputState.lastEscPress=0),ye.android&&ye.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return ye.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=bg.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||oA.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,qi(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:ye.safari&&!ye.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function yg(r,e){return(t,n)=>{try{return e.call(r,n,t)}catch(i){Nr(t.state,i)}}}function sA(r){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of r){let i=n.spec;if(i&&i.domEventHandlers)for(let s in i.domEventHandlers){let o=i.domEventHandlers[s];o&&t(s).handlers.push(yg(n.value,o))}if(i&&i.domEventObservers)for(let s in i.domEventObservers){let o=i.domEventObservers[s];o&&t(s).observers.push(yg(n.value,o))}}for(let n in ln)t(n).handlers.push(ln[n]);for(let n in Ur)t(n).observers.push(Ur[n]);return e}const bg=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],oA="dthko",xg=[16,17,18,20,91,92,224,225],Ba=6;function Fa(r){return Math.max(0,r)*.7+8}function aA(r,e){return Math.max(Math.abs(r.clientX-e.clientX),Math.abs(r.clientY-e.clientY))}class lA{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Ok(e.contentDOM),this.atoms=e.state.facet(qc).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(We.allowMultipleSelections)&&cA(e,t),this.dragging=fA(e,t)&&Mg(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&aA(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,s=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=eg(this.view);e.clientX-o.left<=s.left+Ba?n=-Fa(s.left-e.clientX):e.clientX+o.right>=s.right-Ba&&(n=Fa(e.clientX-s.right)),e.clientY-o.top<=s.top+Ba?i=-Fa(s.top-e.clientY):e.clientY+o.bottom>=s.bottom-Ba&&(i=Fa(e.clientY-s.bottom)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let i=e.ranges[n],s=null;if(i.empty){let o=La(this.atoms,i.from,0);o!=i.from&&(s=ie.cursor(o,-1))}else{let o=La(this.atoms,i.from,-1),a=La(this.atoms,i.to,1);(o!=i.from||a!=i.to)&&(s=ie.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(t||(t=e.ranges.slice()),t[n]=s)}return t?ie.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection)||n.main.assoc!=t.state.selection.main.assoc&&this.dragging===!1)&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function cA(r,e){let t=r.state.facet($p);return t.length?t[0](e):ye.mac?e.metaKey:e.ctrlKey}function uA(r,e){let t=r.state.facet(Hp);return t.length?t[0](e):ye.mac?!e.altKey:!e.ctrlKey}function fA(r,e){let{main:t}=r.state.selection;if(t.empty)return!1;let n=Ca(r.root);if(!n||n.rangeCount==0)return!0;let i=n.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function hA(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=r.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=nt.get(t))&&n.ignoreEvent(e))return!1;return!0}const ln=Object.create(null),Ur=Object.create(null),wg=ye.ie&&ye.ie_version<15||ye.ios&&ye.webkit_version<604;function dA(r){let e=r.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{r.focus(),t.remove(),Sg(r,t.value)},50)}function Sg(r,e){let{state:t}=r,n,i=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(au!=null&&t.selection.ranges.every(l=>l.empty)&&au==s.toString()){let l=-1;n=t.changeByRange(c=>{let u=t.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let h=t.toText((o?s.line(i++).text:e)+t.lineBreak);return{changes:{from:u.from,insert:h},range:ie.cursor(c.from+h.length)}})}else o?n=t.changeByRange(l=>{let c=s.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:ie.cursor(l.from+c.length)}}):n=t.replaceSelection(s);r.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Ur.scroll=r=>{r.inputState.lastScrollTop=r.scrollDOM.scrollTop,r.inputState.lastScrollLeft=r.scrollDOM.scrollLeft},ln.keydown=(r,e)=>(r.inputState.setSelectionOrigin("select"),e.keyCode==27&&(r.inputState.lastEscPress=Date.now()),!1),Ur.touchstart=(r,e)=>{r.inputState.lastTouchTime=Date.now(),r.inputState.setSelectionOrigin("select.pointer")},Ur.touchmove=r=>{r.inputState.setSelectionOrigin("select.pointer")},ln.mousedown=(r,e)=>{if(r.observer.flush(),r.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of r.state.facet(zp))if(t=n(r,e),t)break;if(!t&&e.button==0&&(t=mA(r,e)),t){let n=!r.hasFocus;r.inputState.startMouseSelection(new lA(r,e,t,n)),n&&r.observer.ignore(()=>Sp(r.contentDOM));let i=r.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function kg(r,e,t,n){if(n==1)return ie.cursor(e,t);if(n==2)return Xk(r.state,e,t);{let i=Pt.find(r.docView,e),s=r.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return a<r.state.doc.length&&a==s.to&&a++,ie.range(o,a)}}let Ag=(r,e)=>r>=e.top&&r<=e.bottom,Cg=(r,e,t)=>Ag(e,t)&&r>=t.left&&r<=t.right;function pA(r,e,t,n){let i=Pt.find(r.docView,e);if(!i)return 1;let s=e-i.posAtStart;if(s==0)return 1;if(s==i.length)return-1;let o=i.coordsAt(s,-1);if(o&&Cg(t,n,o))return-1;let a=i.coordsAt(s,1);return a&&Cg(t,n,a)?1:o&&Ag(n,o)?-1:1}function Og(r,e){let t=r.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:pA(r,t,e.clientX,e.clientY)}}const gA=ye.ie&&ye.ie_version<=11;let Eg=null,Tg=0,Pg=0;function Mg(r){if(!gA)return r.detail;let e=Eg,t=Pg;return Eg=r,Pg=Date.now(),Tg=!e||t>Date.now()-400&&Math.abs(e.clientX-r.clientX)<2&&Math.abs(e.clientY-r.clientY)<2?(Tg+1)%3:1}function mA(r,e){let t=Og(r,e),n=Mg(e),i=r.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),i=i.map(s.changes))},get(s,o,a){let l=Og(r,s),c,u=kg(r,l.pos,l.bias,n);if(t.pos!=l.pos&&!o){let h=kg(r,t.pos,t.bias,n),d=Math.min(h.from,u.from),p=Math.max(h.to,u.to);u=d<u.from?ie.range(d,p):ie.range(p,d)}return o?i.replaceRange(i.main.extend(u.from,u.to)):a&&n==1&&i.ranges.length>1&&(c=vA(i,l.pos))?c:a?i.addRange(u):ie.create([u])}}}function vA(r,e){for(let t=0;t<r.ranges.length;t++){let{from:n,to:i}=r.ranges[t];if(n<=e&&i>=e)return ie.create(r.ranges.slice(0,t).concat(r.ranges.slice(t+1)),r.mainIndex==t?0:r.mainIndex-(r.mainIndex>t?1:0))}return null}ln.dragstart=(r,e)=>{let{selection:{main:t}}=r.state,{mouseSelection:n}=r.inputState;return n&&(n.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",r.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};function Ig(r,e,t,n){if(!t)return;let i=r.posAtCoords({x:e.clientX,y:e.clientY},!1),{mouseSelection:s}=r.inputState,o=n&&s&&s.dragging&&uA(r,e)?{from:s.dragging.from,to:s.dragging.to}:null,a={from:i,insert:t},l=r.state.changes(o?[o,a]:a);r.focus(),r.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"})}ln.drop=(r,e)=>{if(!e.dataTransfer)return!1;if(r.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),i=0,s=()=>{++i==t.length&&Ig(r,e,n.filter(o=>o!=null).join(r.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(n[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return Ig(r,e,n,!0),!0}return!1},ln.paste=(r,e)=>{if(r.state.readOnly)return!0;r.observer.flush();let t=wg?null:e.clipboardData;return t?(Sg(r,t.getData("text/plain")||t.getData("text/uri-text")),!0):(dA(r),!1)};function yA(r,e){let t=r.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),r.focus()},50)}function bA(r){let e=[],t=[],n=!1;for(let i of r.selection.ranges)i.empty||(e.push(r.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:s}of r.selection.ranges){let o=r.doc.lineAt(s);o.number>i&&(e.push(o.text),t.push({from:o.from,to:Math.min(r.doc.length,o.to+1)})),i=o.number}n=!0}return{text:e.join(r.lineBreak),ranges:t,linewise:n}}let au=null;ln.copy=ln.cut=(r,e)=>{let{text:t,ranges:n,linewise:i}=bA(r.state);if(!t&&!i)return!1;au=i?t:null,e.type=="cut"&&!r.state.readOnly&&r.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=wg?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(yA(r,t),!1)};const Dg=sn.define();function Ng(r,e){let t=[];for(let n of r.facet(Kp)){let i=n(r,e);i&&t.push(i)}return t?r.update({effects:t,annotations:Dg.of(!0)}):null}function Rg(r){setTimeout(()=>{let e=r.hasFocus;if(e!=r.inputState.notifiedFocused){let t=Ng(r.state,e);t?r.dispatch(t):r.update([])}},10)}Ur.focus=r=>{r.inputState.lastFocusTime=Date.now(),!r.scrollDOM.scrollTop&&(r.inputState.lastScrollTop||r.inputState.lastScrollLeft)&&(r.scrollDOM.scrollTop=r.inputState.lastScrollTop,r.scrollDOM.scrollLeft=r.inputState.lastScrollLeft),Rg(r)},Ur.blur=r=>{r.observer.clearSelectionRange(),Rg(r)},Ur.compositionstart=Ur.compositionupdate=r=>{r.inputState.compositionFirstChange==null&&(r.inputState.compositionFirstChange=!0),r.inputState.composing<0&&(r.inputState.composing=0)},Ur.compositionend=r=>{r.inputState.composing=-1,r.inputState.compositionEndedAt=Date.now(),r.inputState.compositionPendingKey=!0,r.inputState.compositionPendingChange=r.observer.pendingRecords().length>0,r.inputState.compositionFirstChange=null,ye.chrome&&ye.android?r.observer.flushSoon():r.inputState.compositionPendingChange?Promise.resolve().then(()=>r.observer.flush()):setTimeout(()=>{r.inputState.composing<0&&r.docView.hasComposition&&r.update([])},50)},Ur.contextmenu=r=>{r.inputState.lastContextMenu=Date.now()},ln.beforeinput=(r,e)=>{var t;let n;if(ye.chrome&&ye.android&&(n=bg.find(i=>i.inputType==e.inputType))&&(r.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let i=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>i+10&&r.hasFocus&&(r.contentDOM.blur(),r.focus())},100)}return!1};const Lg=new Set;function xA(r){Lg.has(r)||(Lg.add(r),r.addEventListener("copy",()=>{}),r.addEventListener("cut",()=>{}))}const Bg=["pre-wrap","normal","pre-line","break-spaces"];class Fg{constructor(e){this.lineWrapping=e,this.doc=Qe.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Bg.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(i*10)]||(t=!0,this.heightSamples[Math.floor(i*10)]=!0)}return t}refresh(e,t,n,i,s,o){let a=Bg.indexOf(e)>-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class jg{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class cn{constructor(e,t,n,i,s){this.from=e,this.length=t,this.top=n,this.height=i,this._content=s}get type(){return typeof this._content=="number"?nr.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Qn?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new cn(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var tt=function(r){return r[r.ByPos=0]="ByPos",r[r.ByHeight=1]="ByHeight",r[r.ByPosNoHeight=2]="ByPosNoHeight",r}(tt||(tt={}));const ja=.001;class Yt{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>ja&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return Yt.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let s=this,o=n.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:h}=i[a],d=s.lineAt(l,tt.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=c?d:s.lineAt(c,tt.ByPosNoHeight,n,0,0);for(h+=p.to-c,c=p.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,l<d.from&&(d=s.lineAt(l,tt.ByPosNoHeight,n,0,0));u+=d.from-l,l=d.from;let m=lu.build(n.setDoc(o),e,u,h);s=s.replace(l,c,m)}return s.updateHeight(n,0)}static empty(){return new br(0,0)}static of(e){if(e.length==1)return e[0];let t=0,n=e.length,i=0,s=0;for(;;)if(t==n)if(i>s*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),n+=1+a.break,i-=a.size}else if(s>i*2){let a=e[n];a.break?e.splice(n,1,a.left,null,a.right):e.splice(n,1,a.left,a.right),n+=2+a.break,s-=a.size}else break;else if(i<s){let a=e[t++];a&&(i+=a.size)}else{let a=e[--n];a&&(s+=a.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,n++),new wA(Yt.of(e.slice(0,t)),o,Yt.of(e.slice(n)))}}Yt.prototype.size=1;class Vg extends Yt{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,i){return new cn(i,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,i,s){return this.blockAt(0,n,i,s)}forEachLine(e,t,n,i,s,o){e<=s+this.length&&t>=s&&o(this.blockAt(0,n,i,s))}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class br extends Vg{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,i){return new cn(i,this.length,n,this.height,this.breaks)}replace(e,t,n){let i=n[0];return n.length==1&&(i instanceof br||i instanceof Ft&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Ft?i=new br(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Yt.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setHeight(e,i.heights[i.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ft extends Yt{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,s=i-n+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:i,perLine:o,perChar:a}}blockAt(e,t,n,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(t,i);if(t.lineWrapping){let c=i+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),u=t.doc.lineAt(c),h=a+u.length*l,d=Math.max(n,e-h/2);return new cn(u.from,u.length,d,h,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-n)/a))),{from:u,length:h}=t.doc.line(s+c);return new cn(u,h,n+a*c,a,0)}}lineAt(e,t,n,i,s){if(t==tt.ByHeight)return this.blockAt(e,n,i,s);if(t==tt.ByPosNoHeight){let{from:p,to:m}=n.doc.lineAt(e);return new cn(p,m-p,0,0,0)}let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(n,s),c=n.doc.lineAt(e),u=a+c.length*l,h=c.number-o,d=i+a*h+l*(c.from-s-h);return new cn(c.from,c.length,Math.max(i,Math.min(d,i+this.height-u)),u,0)}forEachLine(e,t,n,i,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(n,s);for(let u=e,h=i;u<=t;){let d=n.doc.lineAt(u);if(u==e){let m=d.number-a;h+=l*m+c*(e-s-m)}let p=l+c*d.length;o(new cn(d.from,d.length,h,p,0)),h+=p,u=d.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let s=n[n.length-1];s instanceof Ft?n[n.length-1]=new Ft(s.length+i):n.push(null,new Ft(i-1))}if(e>0){let s=n[0];s instanceof Ft?n[0]=new Ft(e+s.length):n.unshift(new Ft(e-1),null)}return Yt.of(n)}decomposeLeft(e,t){t.push(new Ft(e-1),null)}decomposeRight(e,t){t.push(null,new Ft(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let s=t+this.length;if(i&&i.from<=t+this.length&&i.more){let o=[],a=Math.max(t,i.from),l=-1;for(i.from>t&&o.push(new Ft(i.from-t-1).updateHeight(e,t));a<=s&&i.more;){let u=e.doc.lineAt(a).length;o.length&&o.push(null);let h=i.heights[i.index++];l==-1?l=h:Math.abs(h-l)>=ja&&(l=-2);let d=new br(u,h);d.outdated=!1,o.push(d),a+=u+1}a<=s&&o.push(null,new Ft(s-a).updateHeight(e,a));let c=Yt.of(o);return(l<0||Math.abs(c.height-this.height)>=ja||Math.abs(l-this.heightMetrics(e,t).perLine)>=ja)&&(e.heightChanged=!0),c}else(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class wA extends Yt{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,i){let s=n+this.left.height;return e<s?this.left.blockAt(e,t,n,i):this.right.blockAt(e,t,s,i+this.left.length+this.break)}lineAt(e,t,n,i,s){let o=i+this.left.height,a=s+this.left.length+this.break,l=t==tt.ByHeight?e<o:e<a,c=l?this.left.lineAt(e,t,n,i,s):this.right.lineAt(e,t,n,o,a);if(this.break||(l?c.to<a:c.from>a))return c;let u=t==tt.ByPosNoHeight?tt.ByPosNoHeight:tt.ByPos;return l?c.join(this.right.lineAt(a,u,n,o,a)):this.left.lineAt(a,u,n,i,s).join(c)}forEachLine(e,t,n,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,n,i,s,o),t>=l&&this.right.forEachLine(e,t,n,a,l,o);else{let c=this.lineAt(l,tt.ByPos,n,i,s);e<c.from&&this.left.forEachLine(e,c.from-1,n,i,s,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,a,l,o)}}replace(e,t,n){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of n)s.push(a);if(e>0&&Wg(s,o-1),t<this.length){let a=s.length;this.decomposeRight(t,s),Wg(s,a)}return Yt.of(s)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Yt.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,i){let{left:s,right:o}=this,a=t+s.length+this.break,l=null;return i&&i.from<=t+s.length&&i.more?l=s=s.updateHeight(e,t,n,i):s.updateHeight(e,t,n),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,n,i):o.updateHeight(e,a,n),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Wg(r,e){let t,n;r[e]==null&&(t=r[e-1])instanceof Ft&&(n=r[e+1])instanceof Ft&&r.splice(e-1,3,new Ft(t.length+1+n.length))}const SA=5;class lu{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof br?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new br(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let i=n.widget?n.widget.estimatedHeight:0,s=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new Vg(o,i,n)):(o||s||i>=SA)&&this.addLineDeco(i,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new br(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new Ft(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof br)return e;let t=new br(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof br)&&!this.isCovered?this.nodes.push(new br(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let i of this.nodes)i instanceof br&&i.updateHeight(this.oracle,n),n+=i?i.length:1;return this.nodes}static build(e,t,n,i){let s=new lu(n,e);return Ge.spans(t,n,i,s,0),s.finish(n)}}function kA(r,e,t){let n=new AA;return Ge.compare(r,e,t,n,0),n.changes}class AA{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&Xc(e,t,this.changes,5)}}function CA(r,e){let t=r.getBoundingClientRect(),n=r.ownerDocument,i=n.defaultView||window,s=Math.max(0,t.left),o=Math.min(i.innerWidth,t.right),a=Math.max(0,t.top),l=Math.min(i.innerHeight,t.bottom);for(let c=r.parentNode;c&&c!=n.body;)if(c.nodeType==1){let u=c,h=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&h.overflow!="visible"){let d=u.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),l=c==r.parentNode?d.bottom:Math.min(l,d.bottom)}c=h.position=="absolute"||h.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function OA(r,e){let t=r.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class cu{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],s=t[n];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,t){return we.replace({widget:new EA(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class EA extends on{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class $g{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!0,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Hg,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ft.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Na).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new Fg(t),this.stateDeco=e.facet(to).filter(n=>typeof n!="function"),this.heightMap=Yt.empty().applyChanges(this.stateDeco,Qe.empty,this.heightOracle.setDoc(e.doc),[new yr(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=we.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new Va(s,o))}}this.viewports=e.sort((n,i)=>n.from-i.from),this.scaler=this.heightMap.height<=7e6?Hg:new MA(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:io(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(to).filter(u=>typeof u!="function");let i=e.changedRanges,s=yr.extendWithRanges(i,kA(n,this.stateDeco,e?e.changes:Et.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=o&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let c=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),c&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Jp)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),i=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?ft.RTL:ft.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let L=a.width/t.offsetWidth,D=a.height/t.offsetHeight;(L>.995&&L<1.005||!isFinite(L)||Math.abs(a.width-t.offsetWidth)<1)&&(L=1),(D>.995&&D<1.005||!isFinite(D)||Math.abs(a.height-t.offsetHeight)<1)&&(D=1),(this.scaleX!=L||this.scaleY!=D)&&(this.scaleX=L,this.scaleY=D,c|=8,o=l=!0)}let h=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=d)&&(this.paddingTop=h,this.paddingBottom=d,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=Cp(e.scrollDOM);let m=(this.printing?OA:CA)(t,this.paddingTop),y=m.top-this.pixelViewport.top,w=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let A=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(A!=this.inView&&(this.inView=A,A&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let T=a.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let L=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(L)&&(o=!0),o||i.lineWrapping&&Math.abs(T-this.contentDOMWidth)>i.charWidth){let{lineHeight:D,charWidth:j,textHeight:W}=e.docView.measureTextSize();o=D>0&&i.refresh(s,D,j,W,T/j,L),o&&(e.docView.minWidth=0,c|=8)}y>0&&w>0?u=Math.max(y,w):y<0&&w<0&&(u=Math.min(y,w)),i.heightChanged=!1;for(let D of this.viewports){let j=D.from==this.viewport.from?L:e.docView.measureVisibleLineHeights(D);this.heightMap=(o?Yt.empty().applyChanges(this.stateDeco,Qe.empty,this.heightOracle,[new yr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new jg(D.from,j))}i.heightChanged&&(c|=2)}let P=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return P&&(this.viewport=this.getViewport(u,this.scrollTarget)),this.updateForViewport(),(c&2||P)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new Va(i.lineAt(o-n*1e3,tt.ByHeight,s,0,0).from,i.lineAt(a+(1-n)*1e3,tt.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(c,tt.ByPos,s,0,0),d;t.y=="center"?d=(h.top+h.bottom)/2-u/2:t.y=="start"||t.y=="nearest"&&c<l.from?d=h.top:d=h.bottom-u,l=new Va(i.lineAt(d-1e3/2,tt.ByHeight,s,0,0).from,i.lineAt(d+u+1e3/2,tt.ByHeight,s,0,0).to)}}return l}mapViewport(e,t){let n=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new Va(this.heightMap.lineAt(n,tt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,tt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,tt.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,tt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||i<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||s>=a+Math.max(10,Math.min(n,250)))&&i>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let i of e)t.touchesRange(i.from,i.to)||n.push(new cu(t.mapPos(i.from),t.mapPos(i.to),i.size));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,i=n?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=ft.LTR&&!n)return[];let a=[],l=(c,u,h,d)=>{if(u-c<s)return;let p=this.state.selection.main,m=[p.from];p.empty||m.push(p.to);for(let w of m)if(w>c&&w<u){l(c,w-10,h,d),l(w+10,u,h,d);return}let y=PA(e,w=>w.from>=h.from&&w.to<=h.to&&Math.abs(w.from-c)<s&&Math.abs(w.to-u)<s&&!m.some(A=>w.from<A&&w.to>A));if(!y){if(u<h.to&&t&&n&&t.visibleRanges.some(w=>w.from<=u&&w.to>=u)){let w=t.moveToLineBoundary(ie.cursor(u),!1,!0).head;w>c&&(u=w)}y=new cu(c,u,this.gapSize(h,c,u,d))}a.push(y)};for(let c of this.viewportLines){if(c.length<o)continue;let u=TA(c.from,c.to,this.stateDeco);if(u.total<o)continue;let h=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(n){let m=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,y,w;if(h!=null){let A=$a(u,h),T=((this.visibleBottom-this.visibleTop)/2+m)/c.height;y=A-T,w=A+T}else y=(this.visibleTop-c.top-m)/c.height,w=(this.visibleBottom-c.top+m)/c.height;d=Wa(u,y),p=Wa(u,w)}else{let m=u.total*this.heightOracle.charWidth,y=i*this.heightOracle.charWidth,w,A;if(h!=null){let T=$a(u,h),P=((this.pixelViewport.right-this.pixelViewport.left)/2+y)/m;w=T-P,A=T+P}else w=(this.pixelViewport.left-y)/m,A=(this.pixelViewport.right+y)/m;d=Wa(u,w),p=Wa(u,A)}d>c.from&&l(c.from,d,c,u),p<c.to&&l(p,c.to,c,u)}return a}gapSize(e,t,n,i){let s=$a(i,n)-$a(i,t);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){cu.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=we.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Ge.spans(e,this.viewport.from,this.viewport.to,{span(i,s){t.push({from:i,to:s})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((i,s)=>i.from!=t[s].from||i.to!=t[s].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||io(this.heightMap.lineAt(e,tt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return io(this.heightMap.lineAt(this.scaler.fromDOM(e),tt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return io(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Va{constructor(e,t){this.from=e,this.to=t}}function TA(r,e,t){let n=[],i=r,s=0;return Ge.spans(t,r,e,{span(){},point(o,a){o>i&&(n.push({from:i,to:o}),s+=o-i),i=a}},20),i<e&&(n.push({from:i,to:e}),s+=e-i),{total:s,ranges:n}}function Wa({total:r,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let n=Math.floor(r*t);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(n<=a)return s+n;n-=a}}function $a(r,e){let t=0;for(let{from:n,to:i}of r.ranges){if(e<=i){t+=e-n;break}t+=i-n}return t/r.total}function PA(r,e){for(let t of r)if(e(t))return t}const Hg={toDOM(r){return r},fromDOM(r){return r},scale:1};class MA{constructor(e,t,n){let i=0,s=0,o=0;this.viewports=n.map(({from:a,to:l})=>{let c=t.lineAt(a,tt.ByPos,e,0,0).top,u=t.lineAt(l,tt.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return i+(e-n)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);n=s.bottom,i=s.domBottom}}fromDOM(e){for(let t=0,n=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return n+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);n=s.bottom,i=s.domBottom}}}function io(r,e){if(e.scale==1)return r;let t=e.toDOM(r.top),n=e.toDOM(r.bottom);return new cn(r.from,r.length,t,n-t,Array.isArray(r._content)?r._content.map(i=>io(i,e)):r._content)}const Ha=de.define({combine:r=>r.join(" ")}),uu=de.define({combine:r=>r.indexOf(!0)>-1}),fu=Gn.newName(),zg=Gn.newName(),Ug=Gn.newName(),Gg={"&light":"."+zg,"&dark":"."+Ug};function hu(r,e,t){return new Gn(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,i=>{if(i=="&")return r;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):r+" "+n}})}const IA=hu("."+fu,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Gg),so="\uFFFF";class DA{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(We.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=so}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let s=this.text.length;this.readNode(i);let o=i.nextSibling;if(o==t)break;let a=nt.get(i),l=nt.get(o);(a&&l?a.breakAfter:(a?a.breakAfter:Kg(i))||Kg(o)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>s)&&this.lineBreak(),i=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(a=i.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let t=nt.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let i=n.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(NA(e,n.node,n.offset)?t:0))}}function NA(r,e,t){for(;;){if(!e||t<Cn(e))return!1;if(e==r)return!0;t=Xs(e)+1,e=e.parentNode}}function Kg(r){return r.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(r.nodeName)}class Yg{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class RA{constructor(e,t,n,i){this.typeOver=i,this.bounds=null,this.text="";let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let a=s||o?[]:FA(e),l=new DA(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=jA(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!$c(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!$c(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset);this.newSel=ie.single(c,l)}}}function Jg(r,e){let t,{newSel:n}=e,i=r.state.selection.main,s=r.inputState.lastKeyTime>Date.now()-100?r.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=i.from,c=null;(s===8||ye.android&&e.text.length<a-o)&&(l=i.to,c="end");let u=BA(r.state.doc.sliceString(o,a,so),e.text,l-o,c);u&&(ye.chrome&&s==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==so+so&&u.toB--,t={from:o+u.from,to:o+u.toA,insert:Qe.of(e.text.slice(u.from,u.toB).split(so))})}else n&&(!r.hasFocus&&r.state.facet(Da)||n.main.eq(i))&&(n=null);if(!t&&!n)return!1;if(!t&&e.typeOver&&!i.empty&&n&&n.main.empty?t={from:i.from,to:i.to,insert:r.state.doc.slice(i.from,i.to)}:t&&t.from>=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:r.state.doc.slice(i.from,t.from).append(t.insert).append(r.state.doc.slice(t.to,i.to))}:(ye.mac||ye.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&r.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=ie.single(n.main.anchor-1,n.main.head-1)),t={from:i.from,to:i.to,insert:Qe.of([" "])}):ye.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==`
148
+ `&&r.lineWrapping&&(n&&(n=ie.single(n.main.anchor-1,n.main.head-1)),t={from:i.from,to:i.to,insert:Qe.of([" "])}),t){if(ye.ios&&r.inputState.flushIOSKey()||ye.android&&(t.from==i.from&&t.to==i.to&&t.insert.length==1&&t.insert.lines==2&&qi(r.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||s==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&qi(r.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&qi(r.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();r.inputState.composing>=0&&r.inputState.composing++;let a,l=()=>a||(a=LA(r,t,n));return r.state.facet(Gp).some(c=>c(r,t.from,t.to,o,l))||r.dispatch(l()),!0}else if(n&&!n.main.eq(i)){let o=!1,a="select";return r.inputState.lastSelectionTime>Date.now()-50&&(r.inputState.lastSelectionOrigin=="select"&&(o=!0),a=r.inputState.lastSelectionOrigin),r.dispatch({selection:n,scrollIntoView:o,userEvent:a}),!0}else return!1}function LA(r,e,t){let n,i=r.state,s=i.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&r.inputState.composing<0){let a=s.from<e.from?i.sliceDoc(s.from,e.from):"",l=s.to>e.to?i.sliceDoc(e.to,s.to):"";n=i.replaceSelection(r.state.toText(a+e.insert.sliceString(0,void 0,r.state.lineBreak)+l))}else{let a=i.changes(e),l=t&&t.main.to<=a.newLength?t.main:void 0;if(i.selection.ranges.length>1&&r.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=r.state.sliceDoc(e.from,e.to),u,h=t&&ug(r,t.main.head);if(h){let m=e.insert.length-(e.to-e.from);u={from:h.from,to:h.to-m}}else u=r.state.doc.lineAt(s.head);let d=s.to-e.to,p=s.to-s.from;n=i.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:a,range:l||m.map(a)};let y=m.to-d,w=y-c.length;if(m.to-m.from!=p||r.state.sliceDoc(w,y)!=c||m.to>=u.from&&m.from<=u.to)return{range:m};let A=i.changes({from:w,to:y,insert:e.insert}),T=m.to-s.to;return{changes:A,range:l?ie.range(Math.max(0,l.anchor+T),Math.max(0,l.head+T)):m.map(A)}})}else n={changes:a,selection:l&&i.selection.replaceRange(l)}}let o="input.type";return(r.composing||r.inputState.compositionPendingChange&&r.inputState.compositionEndedAt>Date.now()-50)&&(r.inputState.compositionPendingChange=!1,o+=".compose",r.inputState.compositionFirstChange&&(o+=".start",r.inputState.compositionFirstChange=!1)),i.update(n,{userEvent:o,scrollIntoView:!0})}function BA(r,e,t,n){let i=Math.min(r.length,e.length),s=0;for(;s<i&&r.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&r.length==e.length)return null;let o=r.length,a=e.length;for(;o>0&&a>0&&r.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(n=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o<s&&r.length<e.length){let l=t<=s&&t>=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=t<=s&&t>=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function FA(r){let e=[];if(r.root.activeElement!=r.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:s}=r.observer.selectionRange;return t&&(e.push(new Yg(t,n)),(i!=t||s!=n)&&e.push(new Yg(i,s))),e}function jA(r,e){if(r.length==0)return null;let t=r[0].pos,n=r.length==2?r[1].pos:t;return t>-1&&n>-1?ie.single(t+e,n+e):null}const VA={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},du=ye.ie&&ye.ie_version<=11;class WA{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Ek,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(ye.ie&&ye.ie_version<=11||ye.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),du&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(Da)?n.root.activeElement!=this.dom:!Oa(n.dom,i))return;let s=i.anchorNode&&n.docView.nearest(i.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(ye.ie&&ye.ie_version<=11||ye.android&&ye.chrome)&&!n.state.selection.main.empty&&i.focusNode&&Ea(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ye.safari&&e.root.nodeType==11&&kk(this.dom.ownerDocument)==this.dom&&$A(this.view)||Ca(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=Oa(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Pk(this.dom,t)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(t),n&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=t)n.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,VA),du&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),du&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&qi(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&Oa(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new RA(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,i=Jg(this.view,t);return this.view.state==n&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=Qg(t,e.previousSibling||e.target.previousSibling,-1),i=Qg(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function Qg(r,e,t){for(;e;){let n=nt.get(e);if(n&&n.parent==r)return n;let i=e.parentNode;e=i!=r.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function $A(r){let e=null;function t(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}if(r.contentDOM.addEventListener("beforeinput",t,!0),r.dom.ownerDocument.execCommand("indent"),r.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let n=e.startContainer,i=e.startOffset,s=e.endContainer,o=e.endOffset,a=r.docView.domAtPos(r.state.selection.main.anchor);return Ea(a.node,a.offset,s,o)&&([n,i,s,o]=[s,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:s,focusOffset:o}}class he{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(n=>n.forEach(i=>t(i,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Tk(e.parent)||document,this.viewState=new $g(e.state||We.create(e)),this.plugins=this.state.facet(eo).map(n=>new _c(n));for(let n of this.plugins)n.update(this);this.observer=new WA(this),this.inputState=new iA(this),this.inputState.ensureHandlers(this.plugins),this.docView=new lg(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof Tt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(Dg))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=Ng(s,o),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(We.phrases)!=this.state.facet(We.phrases))return this.setState(s);i=Ra.create(this,s,e),i.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(h&&(h=h.map(d.changes)),d.scrollIntoView){let{main:p}=d.state.selection;h=new Ia(p.empty?p:ie.cursor(p.head,p.head>p.anchor?-1:1))}for(let p of d.effects)p.is(Qp)&&(h=p.value)}this.viewState.update(i,h),this.bidiCache=za.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(ro)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Ha)!=i.state.facet(Ha)&&(this.viewState.mustMeasureContent=!0),(t||n||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!i.empty)for(let d of this.state.facet(Zc))d(i);(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!Jg(this,u)&&c.force&&qi(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new $g(e),this.plugins=e.facet(eo).map(n=>new _c(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView=new lg(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(eo),n=e.state.facet(eo);if(t!=n){let i=[];for(let s of n){let o=t.indexOf(s);if(o<0)i.push(new _c(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,i=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(Cp(n))s=-1,o=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(i);s=p.from,o=p.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(p=>{try{return p.read(this)}catch(m){return Nr(this.state,m),Xg}}),h=Ra.create(this,this.state,[]),d=!1;h.flags|=l,t?t.flags|=l:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),d=this.docView.update(h));for(let p=0;p<c.length;p++)if(u[p]!=Xg)try{let m=c[p];m.write&&m.write(u[p],this)}catch(m){Nr(this.state,m)}if(d&&this.docView.updateSelection(!0),!h.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null;continue}else{let m=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(m>1||m<-1){i=i+m,n.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Zc))a(t)}get themeClasses(){return fu+" "+(this.state.facet(uu)?Ug:zg)+" "+this.state.facet(Ha)}updateAttrs(){let e=Zg(this,Xp,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Da)?"true":"false",class:"cm-content",style:`${ye.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Zg(this,Na,t);let n=this.observer.ignore(()=>{let i=Qc(this.contentDOM,this.contentAttrs,t),s=Qc(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let i of n.effects)if(i.is(he.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(ro);let e=this.state.facet(he.cspNonce);Gn.mount(this.root,this.styleModules.concat(IA).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(n=>n.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return ou(this,e,vg(this,e,t,n))}moveByGroup(e,t){return ou(this,e,vg(this,e,t,n=>rA(this,e.head,n)))}moveToLineBoundary(e,t,n=!0){return tA(this,e,t,n)}moveVertically(e,t,n){return ou(this,e,nA(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),gg(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Xn.find(s,e-i.from,-1,t)];return Ta(n,o.dir==ft.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Yp)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>HA)return sg(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||ng(s.isolates,n=_p(this,e.from,e.to))))return s.order;n||(n=_p(this,e.from,e.to));let i=ig(e.text,t,n);return this.bidiCache.push(new za(e.from,e.to,t,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ye.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Sp(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Qp.of(new Ia(typeof e=="number"?ie.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return ut.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ut.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Gn.newName(),i=[Ha.of(n),ro.of(hu(`.${n}`,e))];return t&&t.dark&&i.push(uu.of(!0)),i}static baseTheme(e){return xi.lowest(ro.of(hu("."+fu,e,Gg)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&nt.get(n)||nt.get(e);return((t=i?.rootView)===null||t===void 0?void 0:t.view)||null}}he.styleModule=ro,he.inputHandler=Gp,he.focusChangeEffect=Kp,he.perLineTextDirection=Yp,he.exceptionSink=Up,he.updateListener=Zc,he.editable=Da,he.mouseSelectionStyle=zp,he.dragMovesSelection=Hp,he.clickAddsSelectionRange=$p,he.decorations=to,he.atomicRanges=qc,he.bidiIsolatedRanges=Zp,he.scrollMargins=qp,he.darkTheme=uu,he.cspNonce=de.define({combine:r=>r.length?r[0]:""}),he.contentAttributes=Na,he.editorAttributes=Xp,he.lineWrapping=he.contentAttributes.of({class:"cm-lineWrapping"}),he.announce=Ae.define();const HA=4096,Xg={};class za{constructor(e,t,n,i,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:ft.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==i&&!t.touchesRange(o.from,o.to)&&n.push(new za(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function Zg(r,e,t){for(let n=r.state.facet(e),i=n.length-1;i>=0;i--){let s=n[i],o=typeof s=="function"?s(r):s;o&&Yc(o,t)}return t}const zA=ye.mac?"mac":ye.windows?"win":ye.linux?"linux":"key";function UA(r,e){const t=r.split(/-(?!$)/);let n=t[t.length-1];n=="Space"&&(n=" ");let i,s,o,a;for(let l=0;l<t.length-1;++l){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(n="Alt-"+n),s&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Ua(r,e,t){return e.altKey&&(r="Alt-"+r),e.ctrlKey&&(r="Ctrl-"+r),e.metaKey&&(r="Meta-"+r),t!==!1&&e.shiftKey&&(r="Shift-"+r),r}const GA=xi.default(he.domEventHandlers({keydown(r,e){return em(qg(e.state),r,e,"editor")}})),oo=de.define({enables:GA}),_g=new WeakMap;function qg(r){let e=r.facet(oo),t=_g.get(e);return t||_g.set(e,t=JA(e.reduce((n,i)=>n.concat(i),[]))),t}function KA(r,e,t){return em(qg(r.state),e,r,t)}let Zn=null;const YA=4e3;function JA(r,e=zA){let t=Object.create(null),n=Object.create(null),i=(o,a)=>{let l=n[o];if(l==null)n[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,c,u)=>{var h,d;let p=t[o]||(t[o]=Object.create(null)),m=a.split(/ (?!$)/).map(A=>UA(A,e));for(let A=1;A<m.length;A++){let T=m.slice(0,A).join(" ");i(T,!0),p[T]||(p[T]={preventDefault:!0,stopPropagation:!1,run:[P=>{let L=Zn={view:P,prefix:T,scope:o};return setTimeout(()=>{Zn==L&&(Zn=null)},YA),!0}]})}let y=m.join(" ");i(y,!1);let w=p[y]||(p[y]={preventDefault:!1,stopPropagation:!1,run:((d=(h=p._any)===null||h===void 0?void 0:h.run)===null||d===void 0?void 0:d.slice())||[]});l&&w.run.push(l),c&&(w.preventDefault=!0),u&&(w.stopPropagation=!0)};for(let o of r){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let h in u)u[h].run.push(o.any)}let l=o[e]||o.key;if(l)for(let c of a)s(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}function em(r,e,t,n){let i=Sk(e),s=Lt(i,0),o=Dr(s)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;Zn&&Zn.view==t&&Zn.scope==n&&(a=Zn.prefix+" ",xg.indexOf(e.keyCode)<0&&(c=!0,Zn=null));let h=new Set,d=w=>{if(w){for(let A of w.run)if(!h.has(A)&&(h.add(A),A(t,e)))return w.stopPropagation&&(u=!0),!0;w.preventDefault&&(w.stopPropagation&&(u=!0),c=!0)}return!1},p=r[n],m,y;return p&&(d(p[a+Ua(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ye.windows&&e.ctrlKey&&e.altKey)&&(m=Kn[e.keyCode])&&m!=i?(d(p[a+Ua(m,e,!0)])||e.shiftKey&&(y=Qs[e.keyCode])!=i&&y!=m&&d(p[a+Ua(y,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(p[a+Ua(i,e,!0)])&&(l=!0),!l&&d(p._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),l}class ao{constructor(e,t,n,i,s){this.className=e,this.left=t,this.top=n,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let s=tm(e);return[new ao(t,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return QA(e,t,n)}}function tm(r){let e=r.scrollDOM.getBoundingClientRect();return{left:(r.textDirection==ft.LTR?e.left:e.right-r.scrollDOM.clientWidth*r.scaleX)-r.scrollDOM.scrollLeft*r.scaleX,top:e.top-r.scrollDOM.scrollTop*r.scaleY}}function rm(r,e,t){let n=ie.cursor(e);return{from:Math.max(t.from,r.moveToLineBoundary(n,!1,!0).from),to:Math.min(t.to,r.moveToLineBoundary(n,!0,!0).from),type:nr.Text}}function QA(r,e,t){if(t.to<=r.viewport.from||t.from>=r.viewport.to)return[];let n=Math.max(t.from,r.viewport.from),i=Math.min(t.to,r.viewport.to),s=r.textDirection==ft.LTR,o=r.contentDOM,a=o.getBoundingClientRect(),l=tm(r),c=o.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),h=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),p=su(r,n),m=su(r,i),y=p.type==nr.Text?p:null,w=m.type==nr.Text?m:null;if(y&&(r.lineWrapping||p.widgetLineBreaks)&&(y=rm(r,n,y)),w&&(r.lineWrapping||m.widgetLineBreaks)&&(w=rm(r,i,w)),y&&w&&y.from==w.from)return T(P(t.from,t.to,y));{let D=y?P(t.from,null,y):L(p,!1),j=w?P(null,t.to,w):L(m,!0),W=[];return(y||p).to<(w||m).from-(y&&w?1:0)||p.widgetLineBreaks>1&&D.bottom+r.defaultLineHeight/2<j.top?W.push(A(h,D.bottom,d,j.top)):D.bottom<j.top&&r.elementAtHeight((D.bottom+j.top)/2).type==nr.Text&&(D.bottom=j.top=(D.bottom+j.top)/2),T(D).concat(W).concat(T(j))}function A(D,j,W,q){return new ao(e,D-l.left,j-l.top-.01,W-D,q-j+.01)}function T({top:D,bottom:j,horizontal:W}){let q=[];for(let F=0;F<W.length;F+=2)q.push(A(W[F],D,W[F+1],j));return q}function P(D,j,W){let q=1e9,F=-1e9,H=[];function Q(be,ke,Re,Se,Oe){let Te=r.coordsAtPos(be,be==W.to?-2:2),De=r.coordsAtPos(Re,Re==W.from?2:-2);!Te||!De||(q=Math.min(Te.top,De.top,q),F=Math.max(Te.bottom,De.bottom,F),Oe==ft.LTR?H.push(s&&ke?h:Te.left,s&&Se?d:De.right):H.push(!s&&Se?h:De.left,!s&&ke?d:Te.right))}let oe=D??W.from,fe=j??W.to;for(let be of r.visibleRanges)if(be.to>oe&&be.from<fe)for(let ke=Math.max(be.from,oe),Re=Math.min(be.to,fe);;){let Se=r.state.doc.lineAt(ke);for(let Oe of r.bidiSpans(Se)){let Te=Oe.from+Se.from,De=Oe.to+Se.from;if(Te>=Re)break;De>ke&&Q(Math.max(Te,ke),D==null&&Te<=oe,Math.min(De,Re),j==null&&De>=fe,Oe.dir)}if(ke=Se.to+1,ke>=Re)break}return H.length==0&&Q(oe,D==null,fe,j==null,r.textDirection),{top:q,bottom:F,horizontal:H}}function L(D,j){let W=a.top+(j?D.top:D.bottom);return{top:W,bottom:W,horizontal:[]}}}function XA(r,e){return r.constructor==e.constructor&&r.eq(e)}class ZA{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Ga)!=e.state.facet(Ga)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(Ga);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,n)=>!XA(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Ga=de.define();function nm(r){return[ut.define(e=>new ZA(e,r)),Ga.of(r)]}const im=!ye.ios,ts=de.define({combine(r){return zr(r,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function _A(r={}){return[ts.of(r),qA,eC,tC,Jp.of(!0)]}function qI(r){return r.facet(ts)}function sm(r){return r.startState.facet(ts)!=r.state.facet(ts)}const qA=nm({above:!0,markers(r){let{state:e}=r,t=e.facet(ts),n=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty?!s||im:t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:ie.cursor(i.head,i.head>i.anchor?-1:1);for(let l of ao.forRange(r,o,a))n.push(l)}}return n},update(r,e){r.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=sm(r);return t&&om(r.state,e),r.docChanged||r.selectionSet||t},mount(r,e){om(e.state,r)},class:"cm-cursorLayer"});function om(r,e){e.style.animationDuration=r.facet(ts).cursorBlinkRate+"ms"}const eC=nm({above:!1,markers(r){return r.state.selection.ranges.map(e=>e.empty?[]:ao.forRange(r,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(r,e){return r.docChanged||r.selectionSet||r.viewportChanged||sm(r)},class:"cm-selectionLayer"}),am={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};im&&(am[".cm-line"].caretColor="transparent !important");const tC=xi.highest(he.theme(am)),lm=Ae.define({map(r,e){return r==null?null:e.mapPos(r)}}),lo=kt.define({create(){return null},update(r,e){return r!=null&&(r=e.changes.mapPos(r)),e.effects.reduce((t,n)=>n.is(lm)?n.value:t,r)}}),rC=ut.fromClass(class{constructor(r){this.view=r,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(r){var e;let t=r.state.field(lo);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(r.startState.field(lo)!=t||r.docChanged||r.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:r}=this,e=r.state.field(lo),t=e!=null&&r.coordsAtPos(e);if(!t)return null;let n=r.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+r.scrollDOM.scrollLeft*r.scaleX,top:t.top-n.top+r.scrollDOM.scrollTop*r.scaleY,height:t.bottom-t.top}}drawCursor(r){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;r?(this.cursor.style.left=r.left/e+"px",this.cursor.style.top=r.top/t+"px",this.cursor.style.height=r.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(r){this.view.state.field(lo)!=r&&this.view.dispatch({effects:lm.of(r)})}},{eventObservers:{dragover(r){this.setDropPos(this.view.posAtCoords({x:r.clientX,y:r.clientY}))},dragleave(r){(r.target==this.view.contentDOM||!this.view.contentDOM.contains(r.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function nC(){return[lo,rC]}function cm(r,e,t,n,i){e.lastIndex=0;for(let s=r.iterRange(t,n),o=t,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function iC(r,e){let t=r.visibleRanges;if(t.length==1&&t[0].from==r.viewport.from&&t[0].to==r.viewport.to)return t;let n=[];for(let{from:i,to:s}of t)i=Math.max(r.state.doc.lineAt(i).from,i-e),s=Math.min(r.state.doc.lineAt(s).to,s+e),n.length&&n[n.length-1].to>=i?n[n.length-1].to=s:n.push({from:i,to:s});return n}class pu{constructor(e){const{regexp:t,decoration:n,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof n=="function")this.addMatch=(a,l,c,u)=>{let h=n(a,l,c);h&&u(c,c+a[0].length,h)};else if(n)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new Un,n=t.add.bind(t);for(let{from:i,to:s}of iC(e,this.maxLength))cm(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>e.view.viewport.from&&a<e.view.viewport.to&&(n=Math.min(a,n),i=Math.max(l,i))}),e.viewportChanged||i-n>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let s of e.visibleRanges){let o=Math.max(s.from,n),a=Math.min(s.to,i);if(a>o){let l=e.state.doc.lineAt(o),c=l.to<a?e.state.doc.lineAt(a):l,u=Math.max(s.from,l.from),h=Math.min(s.to,c.to);if(this.boundary){for(;o>l.from;o--)if(this.boundary.test(l.text[o-1-l.from])){u=o;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){h=a;break}}let d=[],p,m=(y,w,A)=>d.push(A.range(y,w));if(l==c)for(this.regexp.lastIndex=u-l.from;(p=this.regexp.exec(l.text))&&p.index<h-l.from;)this.addMatch(p,e,p.index+l.from,m);else cm(e.state.doc,this.regexp,u,h,(y,w)=>this.addMatch(w,e,y,m));t=t.update({filterFrom:u,filterTo:h,filter:(y,w)=>y<u||w>h,add:d})}}return t}}const gu=/x/.unicode!=null?"gu":"g",sC=new RegExp(`[\0-\b
149
+ -\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,gu),oC={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let mu=null;function aC(){var r;if(mu==null&&typeof document<"u"&&document.body){let e=document.body.style;mu=((r=e.tabSize)!==null&&r!==void 0?r:e.MozTabSize)!=null}return mu||!1}const Ka=de.define({combine(r){let e=zr(r,{render:null,specialChars:sC,addSpecialChars:null});return(e.replaceTabs=!aC())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,gu)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,gu)),e}});function lC(r={}){return[Ka.of(r),cC()]}let um=null;function cC(){return um||(um=ut.fromClass(class{constructor(r){this.view=r,this.decorations=we.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(r.state.facet(Ka)),this.decorations=this.decorator.createDeco(r)}makeDecorator(r){return new pu({regexp:r.specialChars,decoration:(e,t,n)=>{let{doc:i}=t.state,s=Lt(e[0],0);if(s==9){let o=i.lineAt(n),a=t.state.tabSize,l=Xi(o.text,a,n-o.from);return we.replace({widget:new dC((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=we.replace({widget:new hC(r,s)}))},boundary:r.replaceTabs?void 0:/[^]/})}update(r){let e=r.state.facet(Ka);r.startState.facet(Ka)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(r.view)):this.decorations=this.decorator.updateDeco(r,this.decorations)}},{decorations:r=>r.decorations}))}const uC="\u2022";function fC(r){return r>=32?uC:r==10?"\u2424":String.fromCharCode(9216+r)}class hC extends on{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=fC(this.code),n=e.state.phrase("Control character")+" "+(oC[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,t);if(i)return i;let s=document.createElement("span");return s.textContent=t,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class dC extends on{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const fm=null;function eD(){return[fm,Na.of(r=>{var e;return((e=r.plugin(fm))===null||e===void 0?void 0:e.attrs)||null})]}function pC(){return mC}const gC=we.line({class:"cm-activeLine"}),mC=ut.fromClass(class{constructor(r){this.decorations=this.getDeco(r)}update(r){(r.docChanged||r.selectionSet)&&(this.decorations=this.getDeco(r.view))}getDeco(r){let e=-1,t=[];for(let n of r.state.selection.ranges){let i=r.lineBlockAt(n.head);i.from>e&&(t.push(gC.range(i.from)),e=i.from)}return we.set(t)}},{decorations:r=>r.decorations});class vC extends on{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?Zi(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=Ta(t[0],n.direction!="rtl"),s=parseInt(n.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function yC(r){return ut.fromClass(class{constructor(e){this.view=e,this.placeholder=r?we.set([we.widget({widget:new vC(r),side:1}).range(0)]):we.none}get decorations(){return this.view.state.doc.length?we.none:this.placeholder}},{decorations:e=>e.decorations})}const vu=2e3;function bC(r,e,t){let n=Math.min(e.line,t.line),i=Math.max(e.line,t.line),s=[];if(e.off>vu||t.off>vu||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=n;l<=i;l++){let c=r.doc.line(l);c.length<=a&&s.push(ie.range(c.from+o,c.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=n;l<=i;l++){let c=r.doc.line(l),u=Fc(c.text,o,r.tabSize,!0);if(u<0)s.push(ie.cursor(c.to));else{let h=Fc(c.text,a,r.tabSize);s.push(ie.range(c.from+u,c.from+h))}}}return s}function xC(r,e){let t=r.coordsAtPos(r.viewport.from);return t?Math.round(Math.abs((t.left-e)/r.defaultCharacterWidth)):-1}function hm(r,e){let t=r.posAtCoords({x:e.clientX,y:e.clientY},!1),n=r.state.doc.lineAt(t),i=t-n.from,s=i>vu?-1:i==n.length?xC(r,e.clientX):Xi(n.text,r.state.tabSize,t-n.from);return{line:n.number,col:s,off:i}}function wC(r,e){let t=hm(r,e),n=r.state.selection;return t?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(t.line).from),o=i.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(i.changes)}},get(i,s,o){let a=hm(r,i);if(!a)return n;let l=bC(r.state,t,a);return l.length?o?ie.create(l.concat(n.ranges)):ie.create(l):n}}:null}function SC(r){let e=r?.eventFilter||(t=>t.altKey&&t.button==0);return he.mouseSelectionStyle.of((t,n)=>e(n)?wC(t,n):null)}const kC={Alt:[18,r=>!!r.altKey],Control:[17,r=>!!r.ctrlKey],Shift:[16,r=>!!r.shiftKey],Meta:[91,r=>!!r.metaKey]},AC={style:"cursor: crosshair"};function CC(r={}){let[e,t]=kC[r.key||"Alt"],n=ut.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[n,he.contentAttributes.of(i=>{var s;return!((s=i.plugin(n))===null||s===void 0)&&s.isDown?AC:null})]}const co="-10000px";class dm{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter(i=>i),this.tooltipViews=this.tooltips.map(n)}update(e,t){var n;let i=e.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=t?[]:null;for(let l=0;l<s.length;l++){let c=s[l],u=-1;if(c){for(let h=0;h<this.tooltips.length;h++){let d=this.tooltips[h];d&&d.create==c.create&&(u=h)}if(u<0)o[l]=this.createTooltipView(c),a&&(a[l]=!!c.above);else{let h=o[l]=this.tooltipViews[u];a&&(a[l]=t[u]),h.update&&h.update(e)}}}for(let l of this.tooltipViews)o.indexOf(l)<0&&(l.dom.remove(),(n=l.destroy)===null||n===void 0||n.call(l));return t&&(a.forEach((l,c)=>t[c]=l),t.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function tD(r={}){return Ya.of(r)}function OC(r){let{win:e}=r;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Ya=de.define({combine:r=>{var e,t,n;return{position:ye.ios?"absolute":((e=r.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=r.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=r.find(i=>i.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||OC}}}),pm=new WeakMap,yu=ut.fromClass(class{constructor(r){this.view=r,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=r.state.facet(Ya);this.position=e.position,this.parent=e.parent,this.classes=r.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new dm(r,Ja,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),r.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let r of this.manager.tooltipViews)this.intersectionObserver.observe(r.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(r){r.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(r,this.above);e&&this.observeIntersection();let t=e||r.geometryChanged,n=r.state.facet(Ya);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(r){let e=r.create(this.view);if(e.dom.classList.add("cm-tooltip"),r.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=co,e.dom.style.left="0px",this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var r,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(r=t.destroy)===null||r===void 0||r.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let r=this.view.dom.getBoundingClientRect(),e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(ye.gecko)n=i.offsetParent!=this.container.ownerDocument.body;else if(this.view.scaleX!=1||this.view.scaleY!=1)n=!0;else if(i.style.top==co&&i.style.left=="0px"){let s=i.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:r,parent:this.parent?this.container.getBoundingClientRect():r,pos:this.manager.tooltips.map((i,s)=>{let o=this.manager.tooltipViews[s];return o.getCoords?o.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(Ya).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(r){var e;if(r.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:t,space:n,scaleX:i,scaleY:s}=r,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,h=r.pos[a],d=r.size[a];if(!h||h.bottom<=Math.max(t.top,n.top)||h.top>=Math.min(t.bottom,n.bottom)||h.right<Math.max(t.left,n.left)-.1||h.left>Math.min(t.right,n.right)+.1){u.style.top=co;continue}let p=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=p?7:0,y=d.right-d.left,w=(e=pm.get(c))!==null&&e!==void 0?e:d.bottom-d.top,A=c.offset||TC,T=this.view.textDirection==ft.LTR,P=d.width>n.right-n.left?T?n.left:n.right-d.width:T?Math.min(h.left-(p?14:0)+A.x,n.right-y):Math.max(n.left,h.left-y+(p?14:0)-A.x),L=this.above[a];!l.strictSide&&(L?h.top-(d.bottom-d.top)-A.y<n.top:h.bottom+(d.bottom-d.top)+A.y>n.bottom)&&L==n.bottom-h.bottom>h.top-n.top&&(L=this.above[a]=!L);let D=(L?h.top-n.top:n.bottom-h.bottom)-m;if(D<w&&c.resize!==!1){if(D<this.view.defaultLineHeight){u.style.top=co;continue}pm.set(c,w),u.style.height=(w=D)/s+"px"}else u.style.height&&(u.style.height="");let j=L?h.top-w-m-A.y:h.bottom+m+A.y,W=P+y;if(c.overlap!==!0)for(let q of o)q.left<W&&q.right>P&&q.top<j+w&&q.bottom>j&&(j=L?q.top-w-2-m:q.bottom+m+2);if(this.position=="absolute"?(u.style.top=(j-r.parent.top)/s+"px",u.style.left=(P-r.parent.left)/i+"px"):(u.style.top=j/s+"px",u.style.left=P/i+"px"),p){let q=h.left+(T?A.x:-A.x)-(P+14-7);p.style.left=q/i+"px"}c.overlap!==!0&&o.push({left:P,top:j,right:W,bottom:j+w}),u.classList.toggle("cm-tooltip-above",L),u.classList.toggle("cm-tooltip-below",!L),c.positioned&&c.positioned(r.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let r of this.manager.tooltipViews)r.dom.style.top=co}},{eventObservers:{scroll(){this.maybeMeasure()}}}),EC=he.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),TC={x:0,y:0},Ja=de.define({enables:[yu,EC]}),uo=de.define();class bu{static create(e){return new bu(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new dm(e,uo,t=>this.createHostedView(t))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const PC=Ja.compute([uo],r=>{let e=r.facet(uo).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:bu.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class MC{constructor(e,t,n,i,s){this.view=e,this.source=t,this.field=n,this.setHover=i,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.nearest(t.target);if(!n)return;let i,s=1;if(n instanceof Yn)i=n.posAtStart;else{if(i=e.posAtCoords(t),i==null)return;let a=e.coordsAtPos(i);if(!a||t.y<a.top||t.y>a.bottom||t.x<a.left-e.defaultCharacterWidth||t.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==ft.RTL?-1:1;s=t.x<a.left?-c:c}let o=this.source(e,i,s);if(o?.then){let a=this.pending={pos:i};o.then(l=>{this.pending==a&&(this.pending=null,l&&e.dispatch({effects:this.setHover.of(l)}))},l=>Nr(e.state,l,"hover tooltip"))}else o&&e.dispatch({effects:this.setHover.of(o)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let n=this.active;if(n&&!gm(this.lastMove.target)||this.pending){let{pos:i}=n||this.pending,s=(t=n?.end)!==null&&t!==void 0?t:i;(i==s?this.view.posAtCoords(this.lastMove)!=i:!IC(this.view,i,s,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!gm(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function gm(r){for(let e=r;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function IC(r,e,t,n,i,s){let o=r.scrollDOM.getBoundingClientRect(),a=r.documentTop+r.documentPadding.top+r.contentHeight;if(o.left>n||o.right<n||o.top>i||Math.min(o.bottom,a)<i)return!1;let l=r.posAtCoords({x:n,y:i},!1);return l>=e&&l<=t}function DC(r,e={}){let t=Ae.define(),n=kt.define({create(){return null},update(i,s){if(i&&(e.hideOnChange&&(s.docChanged||s.selection)||e.hideOn&&e.hideOn(s,i)))return null;if(i&&s.docChanged){let o=s.changes.mapPos(i.pos,-1,rr.TrackDel);if(o==null)return null;let a=Object.assign(Object.create(null),i);a.pos=o,i.end!=null&&(a.end=s.changes.mapPos(i.end)),i=a}for(let o of s.effects)o.is(t)&&(i=o.value),o.is(NC)&&(i=null);return i},provide:i=>uo.from(i)});return[n,ut.define(i=>new MC(i,r,n,t,e.hoverTime||300)),PC]}function mm(r,e){let t=r.plugin(yu);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}function rD(r){return r.facet(uo).some(e=>e)}const NC=Ae.define(),nD=null;function iD(r){let e=r.plugin(yu);e&&e.maybeMeasure()}const xu=de.define({combine(r){let e,t;for(let n of r)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function sD(r){return r?[xu.of(r)]:[]}function fo(r,e){let t=r.plugin(vm),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const vm=ut.fromClass(class{constructor(r){this.input=r.state.facet(ho),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(r));let e=r.state.facet(xu);this.top=new Qa(r,!0,e.topContainer),this.bottom=new Qa(r,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(r){let e=r.state.facet(xu);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Qa(r.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Qa(r.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=r.state.facet(ho);if(t!=this.input){let n=t.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of n){let c=this.specs.indexOf(l),u;c<0?(u=l(r.view),a.push(u)):(u=this.panels[c],u.update&&u.update(r)),i.push(u),(u.top?s:o).push(u)}this.specs=n,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let n of this.panels)n.update&&n.update(r)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:r=>he.scrollMargins.of(e=>{let t=e.plugin(r);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Qa{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=ym(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=ym(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function ym(r){let e=r.nextSibling;return r.remove(),e}const ho=de.define({enables:vm});class un extends wi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}un.prototype.elementClass="",un.prototype.toDOM=void 0,un.prototype.mapMode=rr.TrackBefore,un.prototype.startSide=un.prototype.endSide=-1,un.prototype.point=!0;const Xa=de.define(),RC={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ge.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},po=de.define();function bm(r){return[xm(),po.of(Object.assign(Object.assign({},RC),r))]}const wu=de.define({combine:r=>r.some(e=>e)});function xm(r){let e=[LC];return r&&r.fixed===!1&&e.push(wu.of(!0)),e}const LC=ut.fromClass(class{constructor(r){this.view=r,this.prevViewport=r.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=r.state.facet(po).map(e=>new Sm(r,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!r.state.facet(wu),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),r.scrollDOM.insertBefore(this.dom,r.contentDOM)}update(r){if(this.updateGutters(r)){let e=this.prevViewport,t=r.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}r.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(wu)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=r.view.viewport}syncGutters(r){let e=this.dom.nextSibling;r&&this.dom.remove();let t=Ge.iter(this.view.state.facet(Xa),this.view.viewport.from),n=[],i=this.gutters.map(s=>new BC(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==nr.Text&&o){Su(t,n,a.from);for(let l of i)l.line(this.view,a,n);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==nr.Text){Su(t,n,s.from);for(let o of i)o.line(this.view,s,n)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();r&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(r){let e=r.startState.facet(po),t=r.state.facet(po),n=r.docChanged||r.heightChanged||r.viewportChanged||!Ge.eq(r.startState.facet(Xa),r.state.facet(Xa),r.view.viewport.from,r.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(r)&&(n=!0);else{n=!0;let i=[];for(let s of t){let o=e.indexOf(s);o<0?i.push(new Sm(this.view,s)):(this.gutters[o].update(r),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)this.dom.appendChild(s.dom);this.gutters=i}return n}destroy(){for(let r of this.gutters)r.destroy();this.dom.remove()}},{provide:r=>he.scrollMargins.of(e=>{let t=e.plugin(r);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==ft.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function wm(r){return Array.isArray(r)?r:[r]}function Su(r,e,t){for(;r.value&&r.from<=t;)r.from==t&&e.push(r.value),r.next()}class BC{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ge.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let a=new km(e,o,s,n);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];Su(this.cursor,i,t.from),n.length&&(i=i.concat(n));let s=this.gutter.config.lineMarker(e,t,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Sm{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,i)&&i.preventDefault()});this.markers=wm(t.markers(e)),t.initialSpacer&&(this.spacer=new km(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=wm(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let n=e.view.viewport;return!Ge.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class km{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),FC(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=s<t.length?t[s++]:null,c=!1;if(l){let u=l.elementClass;u&&(n+=" "+u);for(let h=o;h<this.markers.length;h++)if(this.markers[h].compare(l)){a=h,c=!0;break}}else a=this.markers.length;for(;o<a;){let u=this.markers[o++];if(u.toDOM){u.destroy(i);let h=i.nextSibling;i.remove(),i=h}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}function FC(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(!r[t].compare(e[t]))return!1;return!0}const jC=de.define(),rs=de.define({combine(r){return zr(r,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let i in t){let s=n[i],o=t[i];n[i]=s?(a,l,c)=>s(a,l,c)||o(a,l,c):o}return n}})}});class ku extends un{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Au(r,e){return r.state.facet(rs).formatNumber(e,r.state)}const VC=po.compute([rs],r=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(jC)},lineMarker(e,t,n){return n.some(i=>i.toDOM)?null:new ku(Au(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(rs)!=e.state.facet(rs),initialSpacer(e){return new ku(Au(e,Am(e.state.doc.lines)))},updateSpacer(e,t){let n=Au(t.view,Am(t.view.state.doc.lines));return n==e.number?e:new ku(n)},domEventHandlers:r.facet(rs).domEventHandlers}));function WC(r={}){return[rs.of(r),xm(),VC]}function Am(r){let e=9;for(;e<r;)e=e*10+9;return e}const $C=new class extends un{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},HC=Xa.compute(["selection"],r=>{let e=[],t=-1;for(let n of r.selection.ranges){let i=r.doc.lineAt(n.head).from;i>t&&(t=i,e.push($C.range(i)))}return Ge.of(e)});function zC(){return HC}const Cm=new Map;function UC(r){let e=Cm.get(r);return e||Cm.set(r,e=we.mark({attributes:r===" "?{class:"cm-highlightTab"}:{class:"cm-highlightSpace","data-display":r.replace(/ /g,"\xB7")}})),e}function Om(r){return ut.define(e=>({decorations:r.createDeco(e),update(t){this.decorations=r.updateDeco(t,this.decorations)}}),{decorations:e=>e.decorations})}const GC=Om(new pu({regexp:/\t| +/g,decoration:r=>UC(r[0]),boundary:/\S/}));function oD(){return GC}const KC=Om(new pu({regexp:/\s+$/g,decoration:we.mark({class:"cm-trailingSpace"}),boundary:/\S/}));function aD(){return KC}const lD={HeightMap:Yt,HeightOracle:Fg,MeasuredHeights:jg,QueryType:tt,ChangedRange:yr,computeOrder:ig,moveVisually:ag};var Cu;const ki=new Be;function Em(r){return de.define({combine:r?e=>e.concat(r):void 0})}const YC=new Be;class xr{constructor(e,t,n=[],i=""){this.data=e,this.name=i,We.prototype.hasOwnProperty("tree")||Object.defineProperty(We.prototype,"tree",{get(){return Nt(this)}}),this.parser=t,this.extension=[_n.of(this),We.languageData.of((s,o,a)=>{let l=Tm(s,o,a),c=l.type.prop(ki);if(!c)return[];let u=s.facet(c),h=l.type.prop(YC);if(h){let d=l.resolve(o-l.from,a);for(let p of h)if(p.test(d,s)){let m=s.facet(p.facet);return p.type=="replace"?m:m.concat(u)}}return u})].concat(n)}isActiveAt(e,t,n=-1){return Tm(e,t,n).type.prop(ki)==this.data}findRegions(e){let t=e.facet(_n);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(s,o)=>{if(s.prop(ki)==this.data){n.push({from:o,to:o+s.length});return}let a=s.prop(Be.mounted);if(a){if(a.tree.prop(ki)==this.data){if(a.overlay)for(let l of a.overlay)n.push({from:l.from+o,to:l.to+o});else n.push({from:o,to:o+s.length});return}else if(a.overlay){let l=n.length;if(i(a.tree,a.overlay[0].from+o),n.length>l)return}}for(let l=0;l<s.children.length;l++){let c=s.children[l];c instanceof ct&&i(c,s.positions[l]+o)}};return i(Nt(e),0),n}get allowsNesting(){return!0}}xr.setState=Ae.define();function Tm(r,e,t){let n=r.facet(_n),i=Nt(r).topNode;if(!n||n.allowsNesting)for(let s=i;s;s=s.enter(e,t,st.ExcludeBuffers))s.type.isTop&&(i=s);return i}class Za extends xr{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=Em(e.languageData);return new Za(t,e.parser.configure({props:[ki.add(n=>n.isTop?t:void 0)]}),e.name)}configure(e,t){return new Za(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Nt(r){let e=r.field(xr.state,!1);return e?e.tree:ct.empty}function JC(r,e,t=50){var n;let i=(n=r.field(xr.state,!1))===null||n===void 0?void 0:n.context;if(!i)return null;let s=i.viewport;i.updateViewport({from:0,to:e});let o=i.isDone(e)||i.work(t,e)?i.tree:null;return i.updateViewport(s),o}function cD(r,e=r.doc.length){var t;return((t=r.field(xr.state,!1))===null||t===void 0?void 0:t.context.isDone(e))||!1}function uD(r,e=r.viewport.to,t=100){let n=JC(r.state,e,t);return n!=Nt(r.state)&&r.dispatch({}),!!n}function fD(r){var e;return((e=r.plugin(Im))===null||e===void 0?void 0:e.isWorking())||!1}class QC{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let go=null;class ns{constructor(e,t,n=[],i,s,o,a,l){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new ns(e,t,[],ct.empty,0,n,[],null)}startParse(){return this.parser.startParse(new QC(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ct.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(kn.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(kn.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=go;go=this;try{return e()}finally{go=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Pm(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,h,d)=>l.push({fromA:c,toA:u,fromB:h,toB:d})),n=kn.applyChanges(n,l),i=ct.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);u<h&&a.push({from:u,to:h})}}}return new ns(this.parser,t,n,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let n=0;n<this.skipped.length;n++){let{from:i,to:s}=this.skipped[n];i<e.to&&s>e.from&&(this.fragments=Pm(this.fragments,i,s),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Td{createParse(t,n,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=go;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new ct(er.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return go}}function Pm(r,e,t){return kn.applyChanges(r,[{fromA:e,toA:t,fromB:e,toB:t}])}class is{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new is(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=ns.create(e.facet(_n).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new is(n)}}xr.state=kt.define({create:is.init,update(r,e){for(let t of e.effects)if(t.is(xr.setState))return t.value;return e.startState.facet(_n)!=e.state.facet(_n)?is.init(e.state):r.apply(e)}});let Mm=r=>{let e=setTimeout(()=>r(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Mm=r=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(r,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Ou=typeof navigator<"u"&&(!((Cu=navigator.scheduling)===null||Cu===void 0)&&Cu.isInputPending)?()=>navigator.scheduling.isInputPending():null,Im=ut.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(xr.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(xr.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Mm(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,s=n.field(xr.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Ou?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&n.doc.length>i+1e3,l=s.context.work(()=>Ou&&Ou()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:xr.setState.of(new is(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Nr(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),_n=de.define({combine(r){return r.length?r[0]:null},enables:r=>[xr.state,Im,he.contentAttributes.compute([r],e=>{let t=e.facet(r);return t&&t.name?{"data-language":t.name}:{}})]});class XC{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Dm{constructor(e,t,n,i,s,o=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new Dm(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let n=/\.([^.]+)$/.exec(t);if(n){for(let i of e)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(s=>s==t))return i;if(n)for(let i of e)for(let s of i.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return i}return null}}const Nm=de.define(),_a=de.define({combine:r=>{if(!r.length)return" ";let e=r[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(r[0]));return e}});function Ai(r){let e=r.facet(_a);return e.charCodeAt(0)==9?r.tabSize*e.length:e.length}function ss(r,e){let t="",n=r.tabSize,i=r.facet(_a)[0];if(i==" "){for(;e>=n;)t+=" ",e-=n;i=" "}for(let s=0;s<e;s++)t+=i;return t}function qa(r,e){r instanceof We&&(r=new mo(r));for(let n of r.state.facet(Nm)){let i=n(r,e);if(i!==void 0)return i}let t=Nt(r.state);return t.length>=e?ZC(r,t,e):null}function hD(r,e,t){let n=Object.create(null),i=new mo(r,{overrideIndentation:o=>{var a;return(a=n[o])!==null&&a!==void 0?a:-1}}),s=[];for(let o=e;o<=t;){let a=r.doc.lineAt(o);o=a.to+1;let l=qa(i,a.from);if(l==null)continue;/\S/.test(a.text)||(l=0);let c=/^\s*/.exec(a.text)[0],u=ss(r,l);c!=u&&(n[a.from]=l,s.push({from:a.from,to:a.from+c.length,insert:u}))}return r.changes(s)}class mo{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ai(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=n.from&&i<=n.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),s=this.countColumn(n,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,t=e.length){return Xi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Rm=new Be;function ZC(r,e,t){let n=e.resolveStack(t),i=n.node.enterUnfinishedNodesBefore(t);if(i!=n.node){let s=[];for(let o=i;o!=n.node;o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return Lm(n,r,t)}function Lm(r,e,t){for(let n=r;n;n=n.next){let i=qC(n.node);if(i)return i(Eu.create(e,t,n))}return 0}function _C(r){return r.pos==r.options.simulateBreak&&r.options.simulateDoubleBreak}function qC(r){let e=r.type.prop(Rm);if(e)return e;let t=r.firstChild,n;if(t&&(n=t.type.prop(Be.closedBy))){let i=r.lastChild,s=i&&n.indexOf(i.name)>-1;return o=>Bm(o,!0,1,void 0,s&&!_C(o)?i.from:void 0)}return r.parent==null?eO:null}function eO(){return 0}class Eu extends mo{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Eu(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(tO(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Lm(this.context.next,this.base,this.pos)}}function tO(r,e){for(let t=e;t;t=t.parent)if(r==t)return!0;return!1}function rO(r){let e=r.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let i=r.options.simulateBreak,s=r.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==n)return null;if(!l.type.isSkipped)return l.from<o?t:null;a=l.to}}function dD({closing:r,align:e=!0,units:t=1}){return n=>Bm(n,e,t,r)}function Bm(r,e,t,n,i){let s=r.textAfter,o=s.match(/^\s*/)[0].length,a=n&&s.slice(o,o+n.length)==n||i==r.pos+o,l=e?rO(r):null;return l?a?r.column(l.from):r.column(l.to):r.baseIndent+(a?0:r.unit*t)}const pD=r=>r.baseIndent;function Fm({except:r,units:e=1}={}){return t=>{let n=r&&r.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const nO=200;function iO(){return We.transactionFilter.of(r=>{if(!r.docChanged||!r.isUserEvent("input.type")&&!r.isUserEvent("input.complete"))return r;let e=r.startState.languageDataAt("indentOnInput",r.startState.selection.main.head);if(!e.length)return r;let t=r.newDoc,{head:n}=r.newSelection.main,i=t.lineAt(n);if(n>i.from+nO)return r;let s=t.sliceString(i.from,n);if(!e.some(c=>c.test(s)))return r;let{state:o}=r,a=-1,l=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==a)continue;a=u.from;let h=qa(o,u.from);if(h==null)continue;let d=/^\s*/.exec(u.text)[0],p=ss(o,h);d!=p&&l.push({from:u.from,to:u.from+d.length,insert:p})}return l.length?[r,{changes:l,sequential:!0}]:r})}const sO=de.define(),jm=new Be;function oO(r){let e=r.firstChild,t=r.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?r.to:t.from}:null}function aO(r,e,t){let n=Nt(r);if(n.length<t)return null;let i=n.resolveStack(t,1),s=null;for(let o=i;o;o=o.next){let a=o.node;if(a.to<=t||a.from>t)continue;if(s&&a.from<e)break;let l=a.type.prop(jm);if(l&&(a.to<n.length-50||n.length==r.doc.length||!lO(a))){let c=l(a,r);c&&c.from<=t&&c.from>=e&&c.to>t&&(s=c)}}return s}function lO(r){let e=r.lastChild;return e&&e.to==r.to&&e.type.isError}function vo(r,e,t){for(let n of r.facet(sO)){let i=n(r,e,t);if(i)return i}return aO(r,e,t)}function Vm(r,e){let t=e.mapPos(r.from,1),n=e.mapPos(r.to,-1);return t>=n?void 0:{from:t,to:n}}const yo=Ae.define({map:Vm}),os=Ae.define({map:Vm});function Tu(r){let e=[];for(let{head:t}of r.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(r.lineBlockAt(t));return e}const qn=kt.define({create(){return we.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(yo)&&!cO(r,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(Mu),i=n?we.replace({widget:new vO(n(e.state,t.value))}):Hm;r=r.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(os)&&(r=r.update({filter:(n,i)=>t.value.from!=n||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;r.between(n,n,(i,s)=>{i<n&&s>n&&(t=!0)}),t&&(r=r.update({filterFrom:n,filterTo:n,filter:(i,s)=>s<=n||i>=n}))}return r},provide:r=>he.decorations.from(r),toJSON(r,e){let t=[];return r.between(0,e.doc.length,(n,i)=>{t.push(n,i)}),t},fromJSON(r){if(!Array.isArray(r)||r.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<r.length;){let n=r[t++],i=r[t++];if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(Hm.range(n,i))}return we.set(e,!0)}});function gD(r){return r.field(qn,!1)||RangeSet.empty}function bo(r,e,t){var n;let i=null;return(n=r.field(qn,!1))===null||n===void 0||n.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function cO(r,e,t){let n=!1;return r.between(e,e,(i,s)=>{i==e&&s==t&&(n=!0)}),n}function Pu(r,e){return r.field(qn,!1)?e:e.concat(Ae.appendConfig.of(Wm()))}const uO=r=>{for(let e of Tu(r)){let t=vo(r.state,e.from,e.to);if(t)return r.dispatch({effects:Pu(r.state,[yo.of(t),el(r,t)])}),!0}return!1},fO=r=>{if(!r.state.field(qn,!1))return!1;let e=[];for(let t of Tu(r)){let n=bo(r.state,t.from,t.to);n&&e.push(os.of(n),el(r,n,!1))}return e.length&&r.dispatch({effects:e}),e.length>0};function el(r,e,t=!0){let n=r.state.doc.lineAt(e.from).number,i=r.state.doc.lineAt(e.to).number;return he.announce.of(`${r.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${r.state.phrase("to")} ${i}.`)}const hO=r=>{let{state:e}=r,t=[];for(let n=0;n<e.doc.length;){let i=r.lineBlockAt(n),s=vo(e,i.from,i.to);s&&t.push(yo.of(s)),n=(s?r.lineBlockAt(s.to):i).to+1}return t.length&&r.dispatch({effects:Pu(r.state,t)}),!!t.length},dO=r=>{let e=r.state.field(qn,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,r.state.doc.length,(n,i)=>{t.push(os.of({from:n,to:i}))}),r.dispatch({effects:t}),!0};function pO(r,e){for(let t=e;;){let n=vo(r.state,t.from,t.to);if(n&&n.to>e.from)return n;if(!t.from)return null;t=r.lineBlockAt(t.from-1)}}const mD=r=>{let e=[];for(let t of Tu(r)){let n=bo(r.state,t.from,t.to);if(n)e.push(os.of(n),el(r,n,!1));else{let i=pO(r,t);i&&e.push(yo.of(i),el(r,i))}}return e.length>0&&r.dispatch({effects:Pu(r.state,e)}),!!e.length},gO=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:uO},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:fO},{key:"Ctrl-Alt-[",run:hO},{key:"Ctrl-Alt-]",run:dO}],mO={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Mu=de.define({combine(r){return zr(r,mO)}});function Wm(r){let e=[qn,xO];return r&&e.push(Mu.of(r)),e}function $m(r,e){let{state:t}=r,n=t.facet(Mu),i=o=>{let a=r.lineBlockAt(r.posAtDOM(o.target)),l=bo(r.state,a.from,a.to);l&&r.dispatch({effects:os.of(l)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(r,i,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const Hm=we.replace({widget:new class extends on{toDOM(r){return $m(r,null)}}});class vO extends on{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return $m(e,this.value)}}const yO={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Iu extends un{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function bO(r={}){let e=Object.assign(Object.assign({},yO),r),t=new Iu(e,!0),n=new Iu(e,!1),i=ut.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(_n)!=o.state.facet(_n)||o.startState.field(qn,!1)!=o.state.field(qn,!1)||Nt(o.startState)!=Nt(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new Un;for(let l of o.viewportLineBlocks){let c=bo(o.state,l.from,l.to)?n:vo(o.state,l.from,l.to)?t:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:s}=e;return[i,bm({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||Ge.empty},initialSpacer(){return new Iu(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let c=bo(o.state,a.from,a.to);if(c)return o.dispatch({effects:os.of(c)}),!0;let u=vo(o.state,a.from,a.to);return u?(o.dispatch({effects:yo.of(u)}),!0):!1}})}),Wm()]}const xO=he.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class as{constructor(e,t){this.specs=e;let n;function i(a){let l=Gn.newName();return(n||(n=Object.create(null)))["."+l]=a,l}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof xr?a=>a.prop(ki)==o.data:o?a=>a==o:void 0,this.style=zd(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=n?new Gn(n):null,this.themeType=t.themeType}static define(e,t){return new as(e,t||{})}}const Du=de.define(),zm=de.define({combine(r){return r.length?[r[0]]:null}});function tl(r){let e=r.facet(Du);return e.length?e:r.facet(zm)}function Nu(r,e){let t=[SO],n;return r instanceof as&&(r.module&&t.push(he.styleModule.of(r.module)),n=r.themeType),e?.fallback?t.push(zm.of(r)):n?t.push(Du.computeN([he.darkTheme],i=>i.facet(he.darkTheme)==(n=="dark")?[r]:[])):t.push(Du.of(r)),t}function vD(r,e,t){let n=tl(r),i=null;if(n){for(let s of n)if(!s.scope||t&&s.scope(t)){let o=s.style(e);o&&(i=i?i+" "+o:o)}}return i}class wO{constructor(e){this.markCache=Object.create(null),this.tree=Nt(e.state),this.decorations=this.buildDeco(e,tl(e.state))}update(e){let t=Nt(e.state),n=tl(e.state),i=n!=tl(e.startState);t.length<e.view.viewport.to&&!i&&t.type==this.tree.type?this.decorations=this.decorations.map(e.changes):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n))}buildDeco(e,t){if(!t||!this.tree.length)return we.none;let n=new Un;for(let{from:i,to:s}of e.visibleRanges)_S(this.tree,t,(o,a,l)=>{n.add(o,a,this.markCache[l]||(this.markCache[l]=we.mark({class:l})))},i,s);return n.finish()}}const SO=xi.high(ut.fromClass(wO,{decorations:r=>r.decorations})),kO=as.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),AO=he.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Um=1e4,Gm="()[]{}",Km=de.define({combine(r){return zr(r,{afterCursor:!0,brackets:Gm,maxScanDistance:Um,renderMatch:EO})}}),CO=we.mark({class:"cm-matchingBracket"}),OO=we.mark({class:"cm-nonmatchingBracket"});function EO(r){let e=[],t=r.matched?CO:OO;return e.push(t.range(r.start.from,r.start.to)),r.end&&e.push(t.range(r.end.from,r.end.to)),e}const TO=[kt.define({create(){return we.none},update(r,e){if(!e.docChanged&&!e.selection)return r;let t=[],n=e.state.facet(Km);for(let i of e.state.selection.ranges){if(!i.empty)continue;let s=fn(e.state,i.head,-1,n)||i.head>0&&fn(e.state,i.head-1,1,n)||n.afterCursor&&(fn(e.state,i.head,1,n)||i.head<e.state.doc.length&&fn(e.state,i.head+1,-1,n));s&&(t=t.concat(n.renderMatch(s,e.state)))}return we.set(t,!0)},provide:r=>he.decorations.from(r)}),AO];function PO(r={}){return[Km.of(r),TO]}const MO=new Be;function Ru(r,e,t){let n=r.prop(e<0?Be.openedBy:Be.closedBy);if(n)return n;if(r.name.length==1){let i=t.indexOf(r.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function Lu(r){let e=r.type.prop(MO);return e?e(r.node):r}function fn(r,e,t,n={}){let i=n.maxScanDistance||Um,s=n.brackets||Gm,o=Nt(r),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let c=Ru(l.type,t,s);if(c&&l.from<l.to){let u=Lu(l);if(u&&(t>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return IO(r,e,t,l,u,c,s)}}return DO(r,e,t,o,a.type,i,s)}function IO(r,e,t,n,i,s,o){let a=n.parent,l={from:i.from,to:i.to},c=0,u=a?.cursor();if(u&&(t<0?u.childBefore(n.from):u.childAfter(n.to)))do if(t<0?u.to<=n.from:u.from>=n.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let h=Lu(u);return{start:l,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(Ru(u.type,t,o))c++;else if(Ru(u.type,-t,o)){if(c==0){let h=Lu(u);return{start:l,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(t<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function DO(r,e,t,n,i,s,o){let a=t<0?r.sliceDoc(e-1,e):r.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=r.doc.iterRange(e,t>0?r.doc.length:0),h=0;for(let d=0;!u.next().done&&d<=s;){let p=u.value;t<0&&(d+=p.length);let m=e+d*t;for(let y=t>0?0:p.length-1,w=t>0?p.length:-1;y!=w;y+=t){let A=o.indexOf(p[y]);if(!(A<0||n.resolveInner(m+y,1).type!=i))if(A%2==0==t>0)h++;else{if(h==1)return{start:c,end:{from:m+y,to:m+y+1},matched:A>>1==l>>1};h--}}t>0&&(d+=p.length)}return u.done?{start:c,matched:!1}:null}function Ym(r,e,t,n=0,i=0){e==null&&(e=r.search(/[^\s\u00a0]/),e==-1&&(e=r.length));let s=i;for(let o=n;o<e;o++)r.charCodeAt(o)==9?s+=t-s%t:s++;return s}class Jm{constructor(e,t,n,i){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Ym(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:Ym(this.string,null,this.tabSize)}match(e,t,n){if(typeof e=="string"){let i=o=>n?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return i(s)==i(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function NO(r){return{name:r.name||"",token:r.token,blankLine:r.blankLine||(()=>{}),startState:r.startState||(()=>!0),copyState:r.copyState||RO,indent:r.indent||(()=>null),languageData:r.languageData||{},tokenTable:r.tokenTable||Fu}}function RO(r){if(typeof r!="object")return r;let e={};for(let t in r){let n=r[t];e[t]=n instanceof Array?n.slice():n}return e}const Qm=new WeakMap;class Xm extends null{constructor(e){let t=Em(e.languageData),n=NO(e),i,s=new class extends Parser{createParse(o,a,l){return new BO(i,o,a,l)}};super(t,s,[Nm.of((o,a)=>this.getIndent(o,a))],e.name),this.topNode=VO(t),i=this,this.streamParser=n,this.stateAfter=new NodeProp({perNode:!0}),this.tokenTable=e.tokenTable?new t0(n.tokenTable):jO}static define(e){return new Xm(e)}getIndent(e,t){let n=Nt(e.state),i=n.resolve(t);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return null;let s,{overrideIndentation:o}=e.options;o&&(s=Qm.get(e.state),s!=null&&s<t-1e4&&(s=void 0));let a=Bu(this,n,0,i.from,s??t),l,c;if(a?(c=a.state,l=a.pos+1):(c=this.streamParser.startState(e.unit),l=0),t-l>1e4)return null;for(;l<t;){let h=e.state.doc.lineAt(l),d=Math.min(t,h.to);if(h.length){let p=o?o(h.from):-1,m=new Jm(h.text,e.state.tabSize,e.unit,p<0?void 0:p);for(;m.pos<d-h.from;)_m(this.streamParser.token,m,c)}else this.streamParser.blankLine(c,e.unit);if(d==t)break;l=h.to+1}let u=e.lineAt(t);return o&&s==null&&Qm.set(e.state,u.from),this.streamParser.indent(c,/^\s*(.*)/.exec(u.text)[1],e)}get allowsNesting(){return!1}}function Bu(r,e,t,n,i){let s=t>=n&&t+e.length<=i&&e.prop(r.stateAfter);if(s)return{state:r.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=t+e.positions[o],c=a instanceof Tree&&l<i&&Bu(r,a,l,n,i);if(c)return c}return null}function Zm(r,e,t,n,i){if(i&&t<=0&&n>=e.length)return e;!i&&e.type==r.topNode&&(i=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],l;if(o<n&&a instanceof Tree){if(!(l=Zm(r,a,t-o,n-o,i)))break;return i?new Tree(e.type,e.children.slice(0,s).concat(l),e.positions.slice(0,s+1),o+l.length):l}}return null}function LO(r,e,t,n){for(let i of e){let s=i.from+(i.openStart?25:0),o=i.to-(i.openEnd?25:0),a=s<=t&&o>t&&Bu(r,i.tree,0-i.offset,t,o),l;if(a&&(l=Zm(r,i.tree,t+i.offset,a.pos+i.offset,!1)))return{state:a.state,tree:l}}return{state:r.streamParser.startState(n?Ai(n):4),tree:Tree.empty}}class BO{constructor(e,t,n,i){this.lang=e,this.input=t,this.fragments=n,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let s=ns.get(),o=i[0].from,{state:a,tree:l}=LO(e,n,o,s?.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let c=0;c<l.children.length;c++)this.chunks.push(l.children[c]),this.chunkPos.push(l.positions[c]);s&&this.parsedPos<s.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(Ai(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=ns.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+2048);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
150
+ `&&(t="");else{let n=t.indexOf(`
151
+ `);n>-1&&(t=t.slice(0,n))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=n||(t=t.slice(0,s-(n-t.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,a=this.lineAfter(o);t+=a,n=o+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let i=this.ranges[this.rangeIndex].to,s=e+t;if(n>0?i>s:i>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-i}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,i,s){if(this.ranges.length>1){s=this.skipGapsTo(t,s,1),t+=s;let o=this.chunk.length;s=this.skipGapsTo(n,s,-1),n+=s,i+=this.chunk.length-o}return this.chunk.push(e,t,n,i),s}parseLine(e){let{line:t,end:n}=this.nextLine(),i=0,{streamParser:s}=this.lang,o=new Jm(t,e?e.state.tabSize:4,e?Ai(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=_m(s.token,o,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,4,i)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Tree.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:FO,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new Tree(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Tree(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function _m(r,e,t){e.start=e.pos;for(let n=0;n<10;n++){let i=r(e,t);if(e.pos>e.start)return i}throw new Error("Stream parser failed to advance stream.")}const Fu=Object.create(null),xo=[er.none],FO=new sa(xo),qm=[],e0=Object.create(null);for(let[r,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])e0[r]=r0(Fu,e);class t0{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),e0)}resolve(e){return e?this.table[e]||(this.table[e]=r0(this.extra,e)):0}}const jO=new t0(Fu);function ju(r,e){qm.indexOf(r)>-1||(qm.push(r),console.warn(e))}function r0(r,e){let t=[];for(let s of e.split(" ")){let o=[];for(let a of s.split(".")){let l=r[a]||M[a];l?typeof l=="function"?o.length?o=o.map(l):ju(a,`Modifier ${a} used at start of tag`):o.length?ju(a,`Tag ${a} used as modifier`):o=Array.isArray(l)?l:[l]:ju(a,`Unknown highlighting tag ${a}`)}for(let a of o)t.push(a)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),i=er.define({id:xo.length,name:n,props:[$d({[n]:t})]});return xo.push(i),i.id}function VO(r){let e=NodeType.define({id:xo.length,name:"Document",props:[ki.add(()=>r)],top:!0});return xo.push(e),e}const bD=()=>r=>{try{JSON.parse(r.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=WO(e,r.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function WO(r,e){let t;return(t=r.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=r.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const $O=Za.define({name:"json",parser:rk.configure({props:[Rm.add({Object:Fm({except:/^\s*\}/}),Array:Fm({except:/^\s*\]/})}),jm.add({"Object Array":oO})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function HO(){return new XC($O)}function Vu(){return Vu=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Vu.apply(this,arguments)}function zO(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}const UO=r=>{let{state:e}=r,t=e.doc.lineAt(e.selection.main.from),n=$u(r.state,t.from);return n.line?GO(r):n.block?YO(r):!1};function Wu(r,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=r(e,t);return i?(n(t.update(i)),!0):!1}}const GO=Wu(XO,0),xD=null,wD=null,KO=Wu(n0,0),SD=null,kD=null,YO=Wu((r,e)=>n0(r,e,QO(e)),0);function $u(r,e){let t=r.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const wo=50;function JO(r,{open:e,close:t},n,i){let s=r.sliceDoc(n-wo,n),o=r.sliceDoc(i,i+wo),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+t.length)==t)return{open:{pos:n-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,h;i-n<=2*wo?u=h=r.sliceDoc(n,i):(u=r.sliceDoc(n,n+wo),h=r.sliceDoc(i-wo,i));let d=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(h)[0].length,m=h.length-p-t.length;return u.slice(d,d+e.length)==e&&h.slice(m,m+t.length)==t?{open:{pos:n+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-p-t.length,margin:/\s/.test(h.charAt(m-1))?1:0}}:null}function QO(r){let e=[];for(let t of r.selection.ranges){let n=r.doc.lineAt(t.from),i=t.to<=n.to?n:r.doc.lineAt(t.to),s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=i.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:i.to})}return e}function n0(r,e,t=e.selection.ranges){let n=t.map(s=>$u(e,s.from).block);if(!n.every(s=>s))return null;let i=t.map((s,o)=>JO(e,n[o],s.from,s.to));if(r!=2&&!i.every(s=>s))return{changes:e.changes(t.map((s,o)=>i[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(r!=1&&i.some(s=>s)){let s=[];for(let o=0,a;o<i.length;o++)if(a=i[o]){let l=n[o],{open:c,close:u}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:s}}return null}function XO(r,e,t=e.selection.ranges){let n=[],i=-1;for(let{from:s,to:o}of t){let a=n.length,l=1e9,c=$u(e,s).line;if(c){for(let u=s;u<=o;){let h=e.doc.lineAt(u);if(h.from>i&&(s==o||o>h.from)){i=h.from;let d=/^\s*/.exec(h.text)[0].length,p=d==h.length,m=h.text.slice(d,d+c.length)==c?d:-1;d<h.text.length&&d<l&&(l=d),n.push({line:h,comment:m,token:c,indent:d,empty:p,single:!1})}u=h.to+1}if(l<1e9)for(let u=a;u<n.length;u++)n[u].indent<n[u].line.text.length&&(n[u].indent=l);n.length==a+1&&(n[a].single=!0)}}if(r!=2&&n.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:u,single:h}of n)(h||!u)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(r!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of n)if(a>=0){let c=o.from+a,u=c+l.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}const Hu=sn.define(),ZO=sn.define(),_O=de.define(),i0=de.define({combine(r){return zr(r,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}});function qO(r){let e=0;return r.iterChangedRanges((t,n)=>e=n),e}const zu=kt.define({create(){return hn.empty},update(r,e){let t=e.state.facet(i0),n=e.annotation(Hu);if(n){let l=e.docChanged?ie.single(qO(e.changes)):void 0,c=ar.fromTransaction(e,l),u=n.side,h=u==0?r.undone:r.done;return c?h=nl(h,h.length,t.minDepth,c):h=a0(h,e.startState.selection),new hn(u==0?n.rest:h,u==0?h:n.rest)}let i=e.annotation(ZO);if((i=="full"||i=="before")&&(r=r.isolate()),e.annotation(Tt.addToHistory)===!1)return e.changes.empty?r:r.addMapping(e.changes.desc);let s=ar.fromTransaction(e),o=e.annotation(Tt.time),a=e.annotation(Tt.userEvent);return s?r=r.addChanges(s,o,a,t,e):e.selection&&(r=r.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(i=="full"||i=="after")&&(r=r.isolate()),r},toJSON(r){return{done:r.done.map(e=>e.toJSON()),undone:r.undone.map(e=>e.toJSON())}},fromJSON(r){return new hn(r.done.map(ar.fromJSON),r.undone.map(ar.fromJSON))}});function e2(r={}){return[zu,i0.of(r),he.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?s0:e.inputType=="historyRedo"?Uu:null;return n?(e.preventDefault(),n(t)):!1}})]}const AD=null;function rl(r,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let i=t.field(zu,!1);if(!i)return!1;let s=i.pop(r,t,e);return s?(n(s),!0):!1}}const s0=rl(0,!1),Uu=rl(1,!1),t2=rl(0,!0),r2=rl(1,!0);function CD(r){return function(e){let t=e.field(zu,!1);if(!t)return 0;let n=r==0?t.done:t.undone;return n.length-(n.length&&!n[0].changes?1:0)}}const OD=null,ED=null;class ar{constructor(e,t,n,i,s){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new ar(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new ar(e.changes&&Et.fromJSON(e.changes),[],e.mapped&&nn.fromJSON(e.mapped),e.startSelection&&ie.fromJSON(e.startSelection),e.selectionsAfter.map(ie.fromJSON))}static fromTransaction(e,t){let n=Rr;for(let i of e.startState.facet(_O)){let s=i(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new ar(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Rr)}static selection(e){return new ar(void 0,Rr,void 0,void 0,e)}}function nl(r,e,t,n){let i=e+1>t+20?e-t-1:0,s=r.slice(i,e);return s.push(n),s}function n2(r,e){let t=[],n=!1;return r.iterChangedRanges((i,s)=>t.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let l=0;l<t.length;){let c=t[l++],u=t[l++];a>=c&&o<=u&&(n=!0)}}),n}function i2(r,e){return r.ranges.length==e.ranges.length&&r.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function o0(r,e){return r.length?e.length?r.concat(e):r:e}const Rr=[],s2=200;function a0(r,e){if(r.length){let t=r[r.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-s2));return n.length&&n[n.length-1].eq(e)?r:(n.push(e),nl(r,r.length-1,1e9,t.setSelAfter(n)))}else return[ar.selection([e])]}function o2(r){let e=r[r.length-1],t=r.slice();return t[r.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Gu(r,e){if(!r.length)return r;let t=r.length,n=Rr;for(;t;){let i=a2(r[t-1],e,n);if(i.changes&&!i.changes.empty||i.effects.length){let s=r.slice(0,t);return s[t-1]=i,s}else e=i.mapped,t--,n=i.selectionsAfter}return n.length?[ar.selection(n)]:Rr}function a2(r,e,t){let n=o0(r.selectionsAfter.length?r.selectionsAfter.map(a=>a.map(e)):Rr,t);if(!r.changes)return ar.selection(n);let i=r.changes.map(e),s=e.mapDesc(r.changes,!0),o=r.mapped?r.mapped.composeDesc(s):s;return new ar(i,Ae.mapEffects(r.effects,e),o,r.startSelection.map(s),n)}const l2=/^(input\.type|delete)($|\.)/;class hn{constructor(e,t,n=0,i=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new hn(this.done,this.undone):this}addChanges(e,t,n,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!n||l2.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,n2(a.changes,e.changes))||n=="input.type.compose")?o=nl(o,o.length-1,i.minDepth,new ar(e.changes.compose(a.changes),o0(e.effects,a.effects),a.mapped,a.startSelection,Rr)):o=nl(o,o.length,i.minDepth,e),new hn(o,Rr,t,n)}addSelection(e,t,n,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Rr;return s.length>0&&t-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&i2(s[s.length-1],e)?this:new hn(a0(this.done,e),this.undone,t,n)}addMapping(e){return new hn(Gu(this.done,e),Gu(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1];if(n&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Hu.of({side:e,rest:o2(i)}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=i.length==1?Rr:i.slice(0,i.length-1);return s.mapped&&(o=Gu(o,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Hu.of({side:e,rest:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}hn.empty=new hn(Rr,Rr);const c2=[{key:"Mod-z",run:s0,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Uu,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Uu,preventDefault:!0},{key:"Mod-u",run:t2,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:r2,preventDefault:!0}];function ls(r,e){return ie.create(r.ranges.map(e),r.mainIndex)}function dn(r,e){return r.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Lr({state:r,dispatch:e},t){let n=ls(r.selection,t);return n.eq(r.selection)?!1:(e(dn(r,n)),!0)}function So(r,e){return ie.cursor(e?r.to:r.from)}function il(r,e){return Lr(r,t=>t.empty?r.moveByChar(t,e):So(t,e))}function Jt(r){return r.textDirectionAt(r.state.selection.main.head)==ft.LTR}const l0=r=>il(r,!Jt(r)),c0=r=>il(r,Jt(r)),TD=r=>il(r,!0),PD=r=>il(r,!1);function sl(r,e){return Lr(r,t=>t.empty?r.moveByGroup(t,e):So(t,e))}const u2=r=>sl(r,!Jt(r)),f2=r=>sl(r,Jt(r)),MD=r=>sl(r,!0),ID=r=>sl(r,!1),u0=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function f0(r,e,t){let n=r.state.charCategorizer(e.from),i=CharCategory.Space,s=e.from,o=0,a=!1,l=!1,c=!1,u=d=>{if(a)return!1;s+=t?d.length:-d.length;let p=n(d),m;if(p==CharCategory.Word&&d.charCodeAt(0)<128&&/[\W_]/.test(d)&&(p=-1),i==CharCategory.Space&&(i=p),i!=p)return!1;if(i==CharCategory.Word)if(d.toLowerCase()==d){if(!t&&l)return!1;c=!0}else if(c){if(t)return!1;a=!0}else{if(l&&t&&n(m=r.state.sliceDoc(s,s+1))==CharCategory.Word&&m.toLowerCase()==m)return!1;l=!0}return o++,!0},h=r.moveByChar(e,t,d=>(u(d),u));if(u0&&i==CharCategory.Word&&h.from==e.from+o*(t?1:-1)){let d=Math.min(e.head,h.head),p=Math.max(e.head,h.head),m=r.state.sliceDoc(d,p);if(m.length>1&&/[\u4E00-\uffff]/.test(m)){let y=Array.from(u0.segment(m));if(y.length>1)return t?EditorSelection.cursor(e.head+y[1].index,-1):EditorSelection.cursor(h.head+y[y.length-1].index,1)}}return h}function h0(r,e){return Lr(r,t=>t.empty?f0(r,t,e):So(t,e))}const DD=r=>h0(r,!0),ND=r=>h0(r,!1);function h2(r,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(r.sliceDoc(e.from,e.to)))||e.firstChild}function ol(r,e,t){let n=Nt(r).resolveInner(e.head),i=t?Be.closedBy:Be.openedBy;for(let l=e.head;;){let c=t?n.childAfter(l):n.childBefore(l);if(!c)break;h2(r,c,i)?n=c:l=t?c.to:c.from}let s=n.type.prop(i),o,a;return s&&(o=t?fn(r,n.from,1):fn(r,n.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?n.to:n.from,ie.cursor(a,t?-1:1)}const d2=r=>Lr(r,e=>ol(r.state,e,!Jt(r))),p2=r=>Lr(r,e=>ol(r.state,e,Jt(r)));function d0(r,e){return Lr(r,t=>{if(!t.empty)return So(t,e);let n=r.moveVertically(t,e);return n.head!=t.head?n:r.moveToLineBoundary(t,e)})}const p0=r=>d0(r,!1),g0=r=>d0(r,!0);function m0(r){let e=r.scrollDOM.clientHeight<r.scrollDOM.scrollHeight-2,t=0,n=0,i;if(e){for(let s of r.state.facet(he.scrollMargins)){let o=s(r);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(n=Math.max(o?.bottom,n))}i=r.scrollDOM.clientHeight-t-n}else i=(r.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:n,selfScroll:e,height:Math.max(r.defaultLineHeight,i-5)}}function v0(r,e){let t=m0(r),{state:n}=r,i=ls(n.selection,o=>o.empty?r.moveVertically(o,e,t.height):So(o,e));if(i.eq(n.selection))return!1;let s;if(t.selfScroll){let o=r.coordsAtPos(n.selection.main.head),a=r.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,c=a.bottom-t.marginBottom;o&&o.top>l&&o.bottom<c&&(s=he.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-l}))}return r.dispatch(dn(n,i),{effects:s}),!0}const y0=r=>v0(r,!1),Ku=r=>v0(r,!0);function ei(r,e,t){let n=r.lineBlockAt(e.head),i=r.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?n.to:n.from)&&(i=r.moveToLineBoundary(e,t,!1)),!t&&i.head==n.from&&n.length){let s=/^\s*/.exec(r.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(i=ie.cursor(n.from+s))}return i}const g2=r=>Lr(r,e=>ei(r,e,!0)),m2=r=>Lr(r,e=>ei(r,e,!1)),v2=r=>Lr(r,e=>ei(r,e,!Jt(r))),y2=r=>Lr(r,e=>ei(r,e,Jt(r))),b2=r=>Lr(r,e=>ie.cursor(r.lineBlockAt(e.head).from,1)),x2=r=>Lr(r,e=>ie.cursor(r.lineBlockAt(e.head).to,-1));function b0(r,e,t){let n=!1,i=ls(r.selection,s=>{let o=fn(r,s.head,-1)||fn(r,s.head,1)||s.head>0&&fn(r,s.head-1,1)||s.head<r.doc.length&&fn(r,s.head+1,-1);if(!o||!o.end)return s;n=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return t?ie.range(s.anchor,a):ie.cursor(a)});return n?(e(dn(r,i)),!0):!1}const w2=({state:r,dispatch:e})=>b0(r,e,!1),RD=({state:r,dispatch:e})=>b0(r,e,!0);function wr(r,e){let t=ls(r.state.selection,n=>{let i=e(n);return ie.range(n.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(r.state.selection)?!1:(r.dispatch(dn(r.state,t)),!0)}function al(r,e){return wr(r,t=>r.moveByChar(t,e))}const x0=r=>al(r,!Jt(r)),w0=r=>al(r,Jt(r)),LD=r=>al(r,!0),BD=r=>al(r,!1);function ll(r,e){return wr(r,t=>r.moveByGroup(t,e))}const S2=r=>ll(r,!Jt(r)),k2=r=>ll(r,Jt(r)),FD=r=>ll(r,!0),jD=r=>ll(r,!1);function S0(r,e){return wr(r,t=>f0(r,t,e))}const VD=r=>S0(r,!0),WD=r=>S0(r,!1),A2=r=>wr(r,e=>ol(r.state,e,!Jt(r))),C2=r=>wr(r,e=>ol(r.state,e,Jt(r)));function k0(r,e){return wr(r,t=>r.moveVertically(t,e))}const A0=r=>k0(r,!1),C0=r=>k0(r,!0);function O0(r,e){return wr(r,t=>r.moveVertically(t,e,m0(r).height))}const E0=r=>O0(r,!1),T0=r=>O0(r,!0),O2=r=>wr(r,e=>ei(r,e,!0)),E2=r=>wr(r,e=>ei(r,e,!1)),T2=r=>wr(r,e=>ei(r,e,!Jt(r))),P2=r=>wr(r,e=>ei(r,e,Jt(r))),M2=r=>wr(r,e=>ie.cursor(r.lineBlockAt(e.head).from)),I2=r=>wr(r,e=>ie.cursor(r.lineBlockAt(e.head).to)),P0=({state:r,dispatch:e})=>(e(dn(r,{anchor:0})),!0),M0=({state:r,dispatch:e})=>(e(dn(r,{anchor:r.doc.length})),!0),I0=({state:r,dispatch:e})=>(e(dn(r,{anchor:r.selection.main.anchor,head:0})),!0),D0=({state:r,dispatch:e})=>(e(dn(r,{anchor:r.selection.main.anchor,head:r.doc.length})),!0),D2=({state:r,dispatch:e})=>(e(r.update({selection:{anchor:0,head:r.doc.length},userEvent:"select"})),!0),N2=({state:r,dispatch:e})=>{let t=ul(r).map(({from:n,to:i})=>ie.range(n,Math.min(i+1,r.doc.length)));return e(r.update({selection:ie.create(t),userEvent:"select"})),!0},R2=({state:r,dispatch:e})=>{let t=ls(r.selection,n=>{var i;let s=Nt(r).resolveStack(n.from,1);for(let o=s;o;o=o.next){let{node:a}=o;if((a.from<n.from&&a.to>=n.to||a.to>n.to&&a.from<=n.from)&&(!((i=a.parent)===null||i===void 0)&&i.parent))return ie.range(a.to,a.from)}return n});return e(dn(r,t)),!0},L2=({state:r,dispatch:e})=>{let t=r.selection,n=null;return t.ranges.length>1?n=ie.create([t.main]):t.main.empty||(n=ie.create([ie.cursor(t.main.head)])),n?(e(dn(r,n)),!0):!1};function cs(r,e){if(r.state.readOnly)return!1;let t="delete.selection",{state:n}=r,i=n.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);l<o?(t="delete.backward",l=cl(r,l,!1)):l>o&&(t="delete.forward",l=cl(r,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=cl(r,o,!1),a=cl(r,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:ie.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(r.dispatch(n.update(i,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?he.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function cl(r,e,t){if(r instanceof he)for(let n of r.state.facet(he.atomicRanges).map(i=>i(r)))n.between(e,e,(i,s)=>{i<e&&s>e&&(e=t?s:i)});return e}const N0=(r,e)=>cs(r,t=>{let n=t.from,{state:i}=r,s=i.doc.lineAt(n),o,a;if(!e&&n>s.from&&n<s.from+200&&!/[^ \t]/.test(o=s.text.slice(0,n-s.from))){if(o[o.length-1]==" ")return n-1;let l=Xi(o,i.tabSize),c=l%Ai(i)||Ai(i);for(let u=0;u<c&&o[o.length-1-u]==" ";u++)n--;a=n}else a=Ut(s.text,n-s.from,e,e)+s.from,a==n&&s.number!=(e?i.doc.lines:1)&&(a+=e?1:-1);return a}),Yu=r=>N0(r,!1),R0=r=>N0(r,!0),L0=(r,e)=>cs(r,t=>{let n=t.head,{state:i}=r,s=i.doc.lineAt(n),o=i.charCategorizer(n);for(let a=null;;){if(n==(e?s.to:s.from)){n==t.head&&s.number!=(e?i.doc.lines:1)&&(n+=e?1:-1);break}let l=Ut(s.text,n-s.from,e)+s.from,c=s.text.slice(Math.min(n,l)-s.from,Math.max(n,l)-s.from),u=o(c);if(a!=null&&u!=a)break;(c!=" "||n!=t.head)&&(a=u),n=l}return n}),B0=r=>L0(r,!1),B2=r=>L0(r,!0),F2=r=>cs(r,e=>{let t=r.lineBlockAt(e.head).to;return e.head<t?t:Math.min(r.state.doc.length,e.head+1)}),$D=r=>cs(r,e=>{let t=r.lineBlockAt(e.head).from;return e.head>t?t:Math.max(0,e.head-1)}),j2=r=>cs(r,e=>{let t=r.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),V2=r=>cs(r,e=>{let t=r.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(r.state.doc.length,e.head+1)}),HD=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=[];for(let n=0,i="",s=r.doc.iter();;){if(s.next(),s.lineBreak||s.done){let o=i.search(/\s+$/);if(o>-1&&t.push({from:n-(i.length-o),to:n}),s.done)break;i=""}else i=s.value;n+=s.value.length}return t.length?(e(r.update({changes:t,userEvent:"delete"})),!0):!1},W2=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=r.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Qe.of(["",""])},range:ie.cursor(n.from)}));return e(r.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},$2=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=r.changeByRange(n=>{if(!n.empty||n.from==0||n.from==r.doc.length)return{range:n};let i=n.from,s=r.doc.lineAt(i),o=i==s.from?i-1:Ut(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:Ut(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:r.doc.slice(i,a).append(r.doc.slice(o,i))},range:ie.cursor(a)}});return t.changes.empty?!1:(e(r.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ul(r){let e=[],t=-1;for(let n of r.selection.ranges){let i=r.doc.lineAt(n.from),s=r.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=r.doc.lineAt(n.to-1)),t>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:i.from,to:s.to,ranges:[n]});t=s.number+1}return e}function F0(r,e,t){if(r.readOnly)return!1;let n=[],i=[];for(let s of ul(r)){if(t?s.to==r.doc.length:s.from==0)continue;let o=r.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+r.lineBreak});for(let l of s.ranges)i.push(ie.range(Math.min(r.doc.length,l.anchor+a),Math.min(r.doc.length,l.head+a)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:r.lineBreak+o.text});for(let l of s.ranges)i.push(ie.range(l.anchor-a,l.head-a))}}return n.length?(e(r.update({changes:n,scrollIntoView:!0,selection:ie.create(i,r.selection.mainIndex),userEvent:"move.line"})),!0):!1}const H2=({state:r,dispatch:e})=>F0(r,e,!1),z2=({state:r,dispatch:e})=>F0(r,e,!0);function j0(r,e,t){if(r.readOnly)return!1;let n=[];for(let i of ul(r))t?n.push({from:i.from,insert:r.doc.slice(i.from,i.to)+r.lineBreak}):n.push({from:i.to,insert:r.lineBreak+r.doc.slice(i.from,i.to)});return e(r.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const U2=({state:r,dispatch:e})=>j0(r,e,!1),G2=({state:r,dispatch:e})=>j0(r,e,!0),K2=r=>{if(r.state.readOnly)return!1;let{state:e}=r,t=e.changes(ul(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),n=ls(e.selection,i=>r.moveVertically(i,!0)).map(t);return r.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0},zD=({state:r,dispatch:e})=>(e(r.update(r.replaceSelection(r.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0);function Y2(r,e){if(/\(\)|\[\]|\{\}/.test(r.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Nt(r).resolveInner(e),n=t.childBefore(e),i=t.childAfter(e),s;return n&&i&&n.to<=e&&i.from>=e&&(s=n.type.prop(Be.closedBy))&&s.indexOf(i.name)>-1&&r.doc.lineAt(n.to).from==r.doc.lineAt(i.from).from&&!/\S/.test(r.sliceDoc(n.to,i.from))?{from:n.to,to:i.from}:null}const J2=V0(!1),Q2=V0(!0);function V0(r){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),l=!r&&s==o&&Y2(e,s);r&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new mo(e,{simulateBreak:s,simulateDoubleBreak:!!l}),u=qa(c,s);for(u==null&&(u=Xi(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:s,to:o}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let h=["",ss(e,u)];return l&&h.push(ss(e,c.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:Qe.of(h)},range:ie.cursor(s+1+h[1].length)}});return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ju(r,e){let t=-1;return r.changeByRange(n=>{let i=[];for(let o=n.from;o<=n.to;){let a=r.doc.lineAt(o);a.number>t&&(n.empty||n.to>a.from)&&(e(a,i,n),t=a.number),o=a.to+1}let s=r.changes(i);return{changes:i,range:ie.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}const X2=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=Object.create(null),n=new mo(r,{overrideIndentation:s=>{let o=t[s];return o??-1}}),i=Ju(r,(s,o,a)=>{let l=qa(n,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let c=/^\s*/.exec(s.text)[0],u=ss(r,l);(c!=u||a.from<s.from+c.length)&&(t[s.from]=l,o.push({from:s.from,to:s.from+c.length,insert:u}))});return i.changes.empty||e(r.update(i,{userEvent:"indent"})),!0},Qu=({state:r,dispatch:e})=>r.readOnly?!1:(e(r.update(Ju(r,(t,n)=>{n.push({from:t.from,insert:r.facet(_a)})}),{userEvent:"input.indent"})),!0),W0=({state:r,dispatch:e})=>r.readOnly?!1:(e(r.update(Ju(r,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=Xi(i,r.tabSize),o=0,a=ss(r,Math.max(0,s-Ai(r)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),UD=({state:r,dispatch:e})=>r.selection.ranges.some(t=>!t.empty)?Qu({state:r,dispatch:e}):(e(r.update(r.replaceSelection(" "),{scrollIntoView:!0,userEvent:"input"})),!0),Z2=[{key:"Ctrl-b",run:l0,shift:x0,preventDefault:!0},{key:"Ctrl-f",run:c0,shift:w0},{key:"Ctrl-p",run:p0,shift:A0},{key:"Ctrl-n",run:g0,shift:C0},{key:"Ctrl-a",run:b2,shift:M2},{key:"Ctrl-e",run:x2,shift:I2},{key:"Ctrl-d",run:R0},{key:"Ctrl-h",run:Yu},{key:"Ctrl-k",run:F2},{key:"Ctrl-Alt-h",run:B0},{key:"Ctrl-o",run:W2},{key:"Ctrl-t",run:$2},{key:"Ctrl-v",run:Ku}],_2=[{key:"ArrowLeft",run:l0,shift:x0,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:u2,shift:S2,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:v2,shift:T2,preventDefault:!0},{key:"ArrowRight",run:c0,shift:w0,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:f2,shift:k2,preventDefault:!0},{mac:"Cmd-ArrowRight",run:y2,shift:P2,preventDefault:!0},{key:"ArrowUp",run:p0,shift:A0,preventDefault:!0},{mac:"Cmd-ArrowUp",run:P0,shift:I0},{mac:"Ctrl-ArrowUp",run:y0,shift:E0},{key:"ArrowDown",run:g0,shift:C0,preventDefault:!0},{mac:"Cmd-ArrowDown",run:M0,shift:D0},{mac:"Ctrl-ArrowDown",run:Ku,shift:T0},{key:"PageUp",run:y0,shift:E0},{key:"PageDown",run:Ku,shift:T0},{key:"Home",run:m2,shift:E2,preventDefault:!0},{key:"Mod-Home",run:P0,shift:I0},{key:"End",run:g2,shift:O2,preventDefault:!0},{key:"Mod-End",run:M0,shift:D0},{key:"Enter",run:J2},{key:"Mod-a",run:D2},{key:"Backspace",run:Yu,shift:Yu},{key:"Delete",run:R0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:B0},{key:"Mod-Delete",mac:"Alt-Delete",run:B2},{mac:"Mod-Backspace",run:j2},{mac:"Mod-Delete",run:V2}].concat(Z2.map(r=>({mac:r.key,run:r.run,shift:r.shift}))),q2=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:d2,shift:A2},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:p2,shift:C2},{key:"Alt-ArrowUp",run:H2},{key:"Shift-Alt-ArrowUp",run:U2},{key:"Alt-ArrowDown",run:z2},{key:"Shift-Alt-ArrowDown",run:G2},{key:"Escape",run:L2},{key:"Mod-Enter",run:Q2},{key:"Alt-l",mac:"Ctrl-l",run:N2},{key:"Mod-i",run:R2,preventDefault:!0},{key:"Mod-[",run:W0},{key:"Mod-]",run:Qu},{key:"Mod-Alt-\\",run:X2},{key:"Shift-Mod-k",run:K2},{key:"Shift-Mod-\\",run:w2},{key:"Mod-/",run:UO},{key:"Alt-A",run:KO}].concat(_2),eE={key:"Tab",run:Qu,shift:W0};function rt(){var r=arguments[0];typeof r=="string"&&(r=document.createElement(r));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var i=t[n];typeof i=="string"?r.setAttribute(n,i):i!=null&&(r[n]=i)}e++}for(;e<arguments.length;e++)$0(r,arguments[e]);return r}function $0(r,e){if(typeof e=="string")r.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)r.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)$0(r,e[t]);else throw new RangeError("Unsupported child node: "+e)}const H0=typeof String.prototype.normalize=="function"?r=>r.normalize("NFKD"):r=>r;class us{constructor(e,t,n=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=s?a=>s(H0(a)):H0,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Lt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=kc(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Dr(e);let i=this.normalize(t);for(let s=0,o=n;;s++){let a=i.charCodeAt(s),l=this.match(a,o);if(s==i.length-1){if(l)return this.value=l,this;break}o==n&&s<t.length&&t.charCodeAt(s)==a&&o++}}}match(e,t){let n=null;for(let i=0;i<this.matches.length;i+=2){let s=this.matches[i],o=!1;this.query.charCodeAt(s)==e&&(s==this.query.length-1?n={from:this.matches[i+1],to:t+1}:(this.matches[i]++,o=!0)),o||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?n={from:t,to:t+1}:this.matches.push(1,t)),n&&this.test&&!this.test(n.from,n.to,this.buffer,this.bufferStart)&&(n=null),n}}typeof Symbol<"u"&&(us.prototype[Symbol.iterator]=function(){return this});const z0={from:-1,to:-1,match:/.*/.exec("")},Xu="gm"+(/x/.unicode==null?"":"u");class U0{constructor(e,t,n,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=z0,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new G0(e,t,n,i,s);this.re=new RegExp(t,Xu+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=fl(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,i=n+t[0].length;if(this.matchPos=fl(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Zu=new WeakMap;class fs{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let i=Zu.get(e);if(!i||i.from>=n||i.to<=t){let a=new fs(t,e.sliceString(t,n));return Zu.set(e,a),a}if(i.from==t&&i.to==n)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to<n&&(s+=e.sliceString(i.to,n)),Zu.set(e,new fs(o,s)),new fs(t,s.slice(t-o,n-o))}}class G0{constructor(e,t,n,i,s){this.text=e,this.to=s,this.done=!1,this.value=z0,this.matchPos=fl(e,i),this.re=new RegExp(t,Xu+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=fs.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,i=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,match:t},this.matchPos=fl(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=fs.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(U0.prototype[Symbol.iterator]=G0.prototype[Symbol.iterator]=function(){return this});function tE(r){try{return new RegExp(r,Xu),!0}catch{return!1}}function fl(r,e){if(e>=r.length)return e;let t=r.lineAt(e),n;for(;e<t.to&&(n=t.text.charCodeAt(e-t.from))>=56320&&n<57344;)e++;return e}function _u(r){let e=String(r.state.doc.lineAt(r.state.selection.main.head).number),t=rt("input",{class:"cm-textfield",name:"line",value:e}),n=rt("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),r.dispatch({effects:hl.of(!1)}),r.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},rt("label",r.state.phrase("Go to line"),": ",t)," ",rt("button",{class:"cm-button",type:"submit"},r.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=r,a=o.doc.lineAt(o.selection.main.head),[,l,c,u,h]=s,d=u?+u.slice(1):0,p=c?+c:a.number;if(c&&h){let w=p/100;l&&(w=w*(l=="-"?-1:1)+a.number/o.doc.lines),p=Math.round(o.doc.lines*w)}else c&&l&&(p=p*(l=="-"?-1:1)+a.number);let m=o.doc.line(Math.max(1,Math.min(o.doc.lines,p))),y=ie.cursor(m.from+Math.max(0,Math.min(d,m.length)));r.dispatch({effects:[hl.of(!1),he.scrollIntoView(y.from,{y:"center"})],selection:y}),r.focus()}return{dom:n}}const hl=Ae.define(),K0=kt.define({create(){return!0},update(r,e){for(let t of e.effects)t.is(hl)&&(r=t.value);return r},provide:r=>ho.from(r,e=>e?_u:null)}),rE=r=>{let e=fo(r,_u);if(!e){let t=[hl.of(!0)];r.state.field(K0,!1)==null&&t.push(Ae.appendConfig.of([K0,nE])),r.dispatch({effects:t}),e=fo(r,_u)}return e&&e.dom.querySelector("input").select(),!0},nE=he.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),iE={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Y0=de.define({combine(r){return zr(r,iE,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function sE(r){let e=[uE,cE];return r&&e.push(Y0.of(r)),e}const oE=we.mark({class:"cm-selectionMatch"}),aE=we.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function J0(r,e,t,n){return(t==0||r(e.sliceDoc(t-1,t))!=ot.Word)&&(n==e.doc.length||r(e.sliceDoc(n,n+1))!=ot.Word)}function lE(r,e,t,n){return r(e.sliceDoc(t,t+1))==ot.Word&&r(e.sliceDoc(n-1,n))==ot.Word}const cE=ut.fromClass(class{constructor(r){this.decorations=this.getDeco(r)}update(r){(r.selectionSet||r.docChanged||r.viewportChanged)&&(this.decorations=this.getDeco(r.view))}getDeco(r){let e=r.state.facet(Y0),{state:t}=r,n=t.selection;if(n.ranges.length>1)return we.none;let i=n.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return we.none;let l=t.wordAt(i.head);if(!l)return we.none;o=t.charCategorizer(i.head),s=t.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return we.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(J0(o,t,i.from,i.to)&&lE(o,t,i.from,i.to)))return we.none}else if(s=t.sliceDoc(i.from,i.to).trim(),!s)return we.none}let a=[];for(let l of r.visibleRanges){let c=new us(t.doc,s,l.from,l.to);for(;!c.next().done;){let{from:u,to:h}=c.value;if((!o||J0(o,t,u,h))&&(i.empty&&u<=i.from&&h>=i.to?a.push(aE.range(u,h)):(u>=i.to||h<=i.from)&&a.push(oE.range(u,h)),a.length>e.maxMatches))return we.none}}return we.set(a)}},{decorations:r=>r.decorations}),uE=he.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),fE=({state:r,dispatch:e})=>{let{selection:t}=r,n=ie.create(t.ranges.map(i=>r.wordAt(i.head)||ie.cursor(i.head)),t.mainIndex);return n.eq(t)?!1:(e(r.update({selection:n})),!0)};function hE(r,e){let{main:t,ranges:n}=r.selection,i=r.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,a=new us(r.doc,e,n[n.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new us(r.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(l=>l.from==a.value.from))continue;if(s){let l=r.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const dE=({state:r,dispatch:e})=>{let{ranges:t}=r.selection;if(t.some(s=>s.from===s.to))return fE({state:r,dispatch:e});let n=r.sliceDoc(t[0].from,t[0].to);if(r.selection.ranges.some(s=>r.sliceDoc(s.from,s.to)!=n))return!1;let i=hE(r,n);return i?(e(r.update({selection:r.selection.addRange(ie.range(i.from,i.to),!1),effects:he.scrollIntoView(i.to)})),!0):!1},Ci=de.define({combine(r){return zr(r,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new CE(e),scrollToMatch:e=>he.scrollIntoView(e)})}});function GD(r){return r?[Ci.of(r),nf]:nf}class Q0{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||tE(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?`
152
+ `:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new vE(this):new gE(this)}getCursor(e,t=0,n){let i=e.doc?e:We.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?ds(this,i,t,n):hs(this,i,t,n)}}class X0{constructor(e){this.spec=e}}function hs(r,e,t,n){return new us(e.doc,r.unquoted,t,n,r.caseSensitive?void 0:i=>i.toLowerCase(),r.wholeWord?pE(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function pE(r,e){return(t,n,i,s)=>((s>t||s+i.length<n)&&(s=Math.max(0,t-2),i=r.sliceString(s,Math.min(r.length,n+2))),(e(dl(i,t-s))!=ot.Word||e(pl(i,t-s))!=ot.Word)&&(e(pl(i,n-s))!=ot.Word||e(dl(i,n-s))!=ot.Word))}class gE extends X0{constructor(e){super(e)}nextMatch(e,t,n){let i=hs(this.spec,e,n,e.doc.length).nextOverlapping();return i.done&&(i=hs(this.spec,e,0,t).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=n;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=hs(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;i-=1e4}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=hs(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let s=hs(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function ds(r,e,t,n){return new U0(e.doc,r.search,{ignoreCase:!r.caseSensitive,test:r.wholeWord?mE(e.charCategorizer(e.selection.main.head)):void 0},t,n)}function dl(r,e){return r.slice(Ut(r,e,!1),e)}function pl(r,e){return r.slice(e,Ut(r,e))}function mE(r){return(e,t,n)=>!n[0].length||(r(dl(n.input,n.index))!=ot.Word||r(pl(n.input,n.index))!=ot.Word)&&(r(pl(n.input,n.index+n[0].length))!=ot.Word||r(dl(n.input,n.index+n[0].length))!=ot.Word)}class vE extends X0{nextMatch(e,t,n){let i=ds(this.spec,e,n,e.doc.length).next();return i.done&&(i=ds(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let s=Math.max(t,n-i*1e4),o=ds(this.spec,e,s,n),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n<e.match.length?e.match[n]:t))}matchAll(e,t){let n=ds(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let s=ds(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const ko=Ae.define(),qu=Ae.define(),pn=kt.define({create(r){return new ef(vl(r).create(),null)},update(r,e){for(let t of e.effects)t.is(ko)?r=new ef(t.value.create(),r.panel):t.is(qu)&&(r=new ef(r.query,t.value?tf:null));return r},provide:r=>ho.from(r,e=>e.panel)});function KD(r){let e=r.field(pn,!1);return e?e.query.spec:vl(r)}function YD(r){var e;return((e=r.field(pn,!1))===null||e===void 0?void 0:e.panel)!=null}class ef{constructor(e,t){this.query=e,this.panel=t}}const yE=we.mark({class:"cm-searchMatch"}),bE=we.mark({class:"cm-searchMatch cm-searchMatch-selected"}),xE=ut.fromClass(class{constructor(r){this.view=r,this.decorations=this.highlight(r.state.field(pn))}update(r){let e=r.state.field(pn);(e!=r.startState.field(pn)||r.docChanged||r.selectionSet||r.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:r,panel:e}){if(!e||!r.spec.valid)return we.none;let{view:t}=this,n=new Un;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:a,to:l}=s[i];for(;i<o-1&&l>s[i+1].from-2*250;)l=s[++i].to;r.highlight(t.state,a,l,(c,u)=>{let h=t.state.selection.ranges.some(d=>d.from==c&&d.to==u);n.add(c,u,h?bE:yE)})}return n.finish()}},{decorations:r=>r.decorations});function Ao(r){return e=>{let t=e.state.field(pn,!1);return t&&t.query.spec.valid?r(e,t):ev(e)}}const gl=Ao((r,{query:e})=>{let{to:t}=r.state.selection.main,n=e.nextMatch(r.state,t,t);if(!n)return!1;let i=ie.single(n.from,n.to),s=r.state.facet(Ci);return r.dispatch({selection:i,effects:[rf(r,n),s.scrollToMatch(i.main,r)],userEvent:"select.search"}),q0(r),!0}),ml=Ao((r,{query:e})=>{let{state:t}=r,{from:n}=t.selection.main,i=e.prevMatch(t,n,n);if(!i)return!1;let s=ie.single(i.from,i.to),o=r.state.facet(Ci);return r.dispatch({selection:s,effects:[rf(r,i),o.scrollToMatch(s.main,r)],userEvent:"select.search"}),q0(r),!0}),wE=Ao((r,{query:e})=>{let t=e.matchAll(r.state,1e3);return!t||!t.length?!1:(r.dispatch({selection:ie.create(t.map(n=>ie.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),SE=({state:r,dispatch:e})=>{let t=r.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:i}=t.main,s=[],o=0;for(let a=new us(r.doc,r.sliceDoc(n,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==n&&(o=s.length),s.push(ie.range(a.value.from,a.value.to))}return e(r.update({selection:ie.create(s,o),userEvent:"select.search.matches"})),!0},Z0=Ao((r,{query:e})=>{let{state:t}=r,{from:n,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,n,n);if(!s)return!1;let o=[],a,l,c=[];if(s.from==n&&s.to==i&&(l=t.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:l}),s=e.nextMatch(t,s.from,s.to),c.push(he.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+"."))),s){let u=o.length==0||o[0].from>=s.to?0:s.to-s.from-l.length;a=ie.single(s.from-u,s.to-u),c.push(rf(r,s)),c.push(t.facet(Ci).scrollToMatch(a.main,r))}return r.dispatch({changes:o,selection:a,effects:c,userEvent:"input.replace"}),!0}),kE=Ao((r,{query:e})=>{if(r.state.readOnly)return!1;let t=e.matchAll(r.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let n=r.state.phrase("replaced $ matches",t.length)+".";return r.dispatch({changes:t,effects:he.announce.of(n),userEvent:"input.replace.all"}),!0});function tf(r){return r.state.facet(Ci).createPanel(r)}function vl(r,e){var t,n,i,s,o;let a=r.selection.main,l=a.empty||a.to>a.from+100?"":r.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=r.facet(Ci);return new Q0({search:((t=e?.literal)!==null&&t!==void 0?t:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:c.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function _0(r){let e=fo(r,tf);return e&&e.dom.querySelector("[main-field]")}function q0(r){let e=_0(r);e&&e==r.root.activeElement&&e.select()}const ev=r=>{let e=r.state.field(pn,!1);if(e&&e.panel){let t=_0(r);if(t&&t!=r.root.activeElement){let n=vl(r.state,e.query.spec);n.valid&&r.dispatch({effects:ko.of(n)}),t.focus(),t.select()}}else r.dispatch({effects:[qu.of(!0),e?ko.of(vl(r.state,e.query.spec)):Ae.appendConfig.of(nf)]});return!0},tv=r=>{let e=r.state.field(pn,!1);if(!e||!e.panel)return!1;let t=fo(r,tf);return t&&t.dom.contains(r.root.activeElement)&&r.focus(),r.dispatch({effects:qu.of(!1)}),!0},AE=[{key:"Mod-f",run:ev,scope:"editor search-panel"},{key:"F3",run:gl,shift:ml,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:gl,shift:ml,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:tv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:SE},{key:"Alt-g",run:rE},{key:"Mod-d",run:dE,preventDefault:!0}];class CE{constructor(e){this.view=e;let t=this.query=e.state.field(pn).query.spec;this.commit=this.commit.bind(this),this.searchField=rt("input",{value:t.search,placeholder:Sr(e,"Find"),"aria-label":Sr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=rt("input",{value:t.replace,placeholder:Sr(e,"Replace"),"aria-label":Sr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=rt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=rt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=rt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(i,s,o){return rt("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=rt("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,n("next",()=>gl(e),[Sr(e,"next")]),n("prev",()=>ml(e),[Sr(e,"previous")]),n("select",()=>wE(e),[Sr(e,"all")]),rt("label",null,[this.caseField,Sr(e,"match case")]),rt("label",null,[this.reField,Sr(e,"regexp")]),rt("label",null,[this.wordField,Sr(e,"by word")]),...e.state.readOnly?[]:[rt("br"),this.replaceField,n("replace",()=>Z0(e),[Sr(e,"replace")]),n("replaceAll",()=>kE(e),[Sr(e,"replace all")])],rt("button",{name:"close",onclick:()=>tv(e),"aria-label":Sr(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new Q0({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ko.of(e)}))}keydown(e){KA(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ml:gl)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Z0(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(ko)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ci).top}}function Sr(r,e){return r.state.phrase(e)}const yl=30,bl=/[\s\.,:;?!]/;function rf(r,{from:e,to:t}){let n=r.state.doc.lineAt(e),i=r.state.doc.lineAt(t).to,s=Math.max(n.from,e-yl),o=Math.min(i,t+yl),a=r.state.sliceDoc(s,o);if(s!=n.from){for(let l=0;l<yl;l++)if(!bl.test(a[l+1])&&bl.test(a[l])){a=a.slice(l);break}}if(o!=i){for(let l=a.length-1;l>a.length-yl;l--)if(!bl.test(a[l-1])&&bl.test(a[l])){a=a.slice(0,l);break}}return he.announce.of(`${r.state.phrase("current match")}. ${a} ${r.state.phrase("on line")} ${n.number}.`)}const OE=he.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),nf=[pn,xi.low(xE),OE];class rv{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=Nt(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),s=i.search(sv(e,!1));return s<0?null:{from:n+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function nv(r){let e=Object.keys(r).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function EE(r){let e=Object.create(null),t=Object.create(null);for(let{label:i}of r){e[i[0]]=!0;for(let s=1;s<i.length;s++)t[i[s]]=!0}let n=nv(e)+nv(t)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function TE(r){let e=r.map(i=>typeof i=="string"?{label:i}:i),[t,n]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:EE(e);return i=>{let s=i.matchBefore(n);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:t}:null}}function JD(r,e){return t=>{for(let n=syntaxTree(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(r.indexOf(n.name)>-1)return e(t);if(n.type.isTop)break}return null}}function QD(r,e){return t=>{for(let n=syntaxTree(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(r.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}class iv{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function ti(r){return r.selection.main.from}function sv(r,e){var t;let{source:n}=r,i=e&&n[0]!="^",s=n[n.length-1]!="$";return!i&&!s?r:new RegExp(`${i?"^":""}(?:${n})${s?"$":""}`,(t=r.flags)!==null&&t!==void 0?t:r.ignoreCase?"i":"")}const ov=sn.define();function PE(r,e,t,n){let{main:i}=r.selection,s=t-i.from,o=n-i.from;return Object.assign(Object.assign({},r.changeByRange(a=>a!=i&&t!=n&&r.sliceDoc(a.from+s,a.from+o)!=r.sliceDoc(t,n)?{range:a}:{changes:{from:a.from+s,to:n==i.from?a.to:a.from+o,insert:e},range:ie.cursor(a.from+s+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const av=new WeakMap;function ME(r){if(!Array.isArray(r))return r;let e=av.get(r);return e||av.set(r,e=TE(r)),e}const sf=Ae.define(),Co=Ae.define();class IE{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Lt(e,t),i=Dr(n);this.chars.push(n);let s=e.slice(t,t+i),o=s.toUpperCase();this.folded.push(Lt(o==s?s.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,!0}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return!1;let{chars:t,folded:n,any:i,precise:s,byWord:o}=this;if(t.length==1){let T=Lt(e,0),P=Dr(T),L=P==e.length?0:-100;if(T!=t[0])if(T==n[0])L+=-200;else return!1;return this.ret(L,[0,P])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,c=0;if(a<0){for(let T=0,P=Math.min(e.length,200);T<P&&c<l;){let L=Lt(e,T);(L==t[c]||L==n[c])&&(i[c++]=T),T+=Dr(L)}if(c<l)return!1}let u=0,h=0,d=!1,p=0,m=-1,y=-1,w=/[a-z]/.test(e),A=!0;for(let T=0,P=Math.min(e.length,200),L=0;T<P&&h<l;){let D=Lt(e,T);a<0&&(u<l&&D==t[u]&&(s[u++]=T),p<l&&(D==t[p]||D==n[p]?(p==0&&(m=T),y=T+1,p++):p=0));let j,W=D<255?D>=48&&D<=57||D>=97&&D<=122?2:D>=65&&D<=90?1:0:(j=kc(D))!=j.toLowerCase()?1:j!=j.toUpperCase()?2:0;(!T||W==1&&w||L==0&&W!=0)&&(t[h]==D||n[h]==D&&(d=!0)?o[h++]=T:o.length&&(A=!1)),L=W,T+=Dr(D)}return h==l&&o[0]==0&&A?this.result(-100+(d?-200:0),o,e):p==l&&m==0?this.ret(-200-e.length+(y==e.length?0:-100),[0,y]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):p==l?this.ret(-200+-700-e.length,[m,y]):h==l?this.result(-100+(d?-200:0)+-700+(A?0:-1100),o,e):t.length==2?!1:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,n){let i=[],s=0;for(let o of t){let a=o+(this.astral?Dr(Lt(n,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-n.length,i)}}const Qt=de.define({combine(r){return zr(r,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:DE,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>lv(e(n),t(n)),optionClass:(e,t)=>n=>lv(e(n),t(n)),addToOptions:(e,t)=>e.concat(t)})}});function lv(r,e){return r?e?r+" "+e:r:e}function DE(r,e,t,n,i,s){let o=r.textDirection==ft.RTL,a=o,l=!1,c="top",u,h,d=e.left-i.left,p=i.right-e.right,m=n.right-n.left,y=n.bottom-n.top;if(a&&d<Math.min(m,p)?a=!1:!a&&p<Math.min(m,d)&&(a=!0),m<=(a?d:p))u=Math.max(i.top,Math.min(t.top,i.bottom-y))-e.top,h=Math.min(400,a?d:p);else{l=!0,h=Math.min(400,(o?e.right:i.right-e.left)-30);let T=i.bottom-e.bottom;T>=y||T>e.top?u=t.bottom-e.top:(c="bottom",u=e.bottom-t.top)}let w=(e.bottom-e.top)/s.offsetHeight,A=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${u/w}px; max-width: ${h/A}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function NE(r){let e=r.addToOptions.slice();return r.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,i){let s=document.createElement("span");s.className="cm-completionLabel";let o=t.displayLabel||t.label,a=0;for(let l=0;l<i.length;){let c=i[l++],u=i[l++];c>a&&s.appendChild(document.createTextNode(o.slice(a,c)));let h=s.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(o.slice(c,u))),h.className="cm-completionMatchedText",a=u}return a<o.length&&s.appendChild(document.createTextNode(o.slice(a))),s},position:50},{render(t){if(!t.detail)return null;let n=document.createElement("span");return n.className="cm-completionDetail",n.textContent=t.detail,n},position:80}),e.sort((t,n)=>t.position-n.position).map(t=>t.render)}function of(r,e,t){if(r<=t)return{from:0,to:r};if(e<0&&(e=0),e<=r>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let n=Math.floor((r-e)/t);return{from:r-(n+1)*t,to:r-n*t}}class RE{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:o}=i.open,a=e.state.facet(Qt);this.optionContent=NE(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=of(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(t).open;for(let u=l.target,h;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(h=/-(\d+)$/.exec(u.id))&&+h[1]<c.length){this.applyCompletion(e,c[+h[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Qt).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:Co.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:s,selected:o,disabled:a}=n.open;(!i.open||i.open.options!=s)&&(this.range=of(s.length,o,e.state.facet(Qt).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),a!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=of(t.options.length,t.selected,this.view.state.facet(Qt).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:i}=n;if(!i)return;let s=typeof i=="string"?document.createTextNode(i):i(n);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,n)}).catch(o=>Nr(this.view.state,o,"completion info")):this.addInfoPane(s,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;n.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)n.nodeName!="LI"||!n.id?i--:i==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&BE(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return i.top>Math.min(s.bottom,t.bottom)-10||i.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(Qt).positionInfo(this.view,t,i,n,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let s=null;for(let o=n.from;o<n.to;o++){let{completion:a,match:l}=e[o],{section:c}=a;if(c){let d=typeof c=="string"?c:c.name;if(d!=s&&(o>n.from||n.from==0))if(s=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let p=i.appendChild(document.createElement("completion-section"));p.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let h=this.optionClass(a);h&&(u.className=h);for(let d of this.optionContent){let p=d(a,this.view.state,l);p&&u.appendChild(p)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function LE(r,e){return t=>new RE(t,r,e)}function BE(r,e){let t=r.getBoundingClientRect(),n=e.getBoundingClientRect(),i=t.height/r.offsetHeight;n.top<t.top?r.scrollTop-=(t.top-n.top)/i:n.bottom>t.bottom&&(r.scrollTop+=(n.bottom-t.bottom)/i)}function cv(r){return(r.boost||0)*100+(r.apply?10:0)+(r.info?5:0)+(r.type?1:0)}function FE(r,e){let t=[],n=null,i=l=>{t.push(l);let{section:c}=l.completion;if(c){n||(n=[]);let u=typeof c=="string"?c:c.name;n.some(h=>h.name==u)||n.push(typeof c=="string"?{name:u}:c)}};for(let l of r)if(l.hasResult()){let c=l.result.getMatch;if(l.result.filter===!1)for(let u of l.result.options)i(new iv(u,l.source,c?c(u):[],1e9-t.length));else{let u=new IE(e.sliceDoc(l.from,l.to));for(let h of l.result.options)if(u.match(h.label)){let d=h.displayLabel?c?c(h,u.matched):[]:u.matched;i(new iv(h,l.source,d,u.score+(h.boost||0)))}}}if(n){let l=Object.create(null),c=0,u=(h,d)=>{var p,m;return((p=h.rank)!==null&&p!==void 0?p:1e9)-((m=d.rank)!==null&&m!==void 0?m:1e9)||(h.name<d.name?-1:1)};for(let h of n.sort(u))c-=1e5,l[h.name]=c;for(let h of t){let{section:d}=h.completion;d&&(h.score+=l[typeof d=="string"?d:d.name])}}let s=[],o=null,a=e.facet(Qt).compareCompletions;for(let l of t.sort((c,u)=>u.score-c.score||a(c.completion,u.completion))){let c=l.completion;!o||o.label!=c.label||o.detail!=c.detail||o.type!=null&&c.type!=null&&o.type!=c.type||o.apply!=c.apply||o.boost!=c.boost?s.push(l):cv(l.completion)>cv(o)&&(s[s.length-1]=l),o=l.completion}return s}class ps{constructor(e,t,n,i,s,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new ps(this.options,uv(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,s){let o=FE(e,t);if(!o.length)return i&&e.some(l=>l.state==1)?new ps(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let a=t.facet(Qt).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;c<o.length;c++)if(o[c].completion==l){a=c;break}}return new ps(o,uv(n,a),{pos:e.reduce((l,c)=>c.hasResult()?Math.min(l,c.from):l,1e8),create:HE,above:s.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new ps(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class xl{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new xl(WE,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(Qt),s=(n.override||t.languageDataAt("autocomplete",ti(t)).map(ME)).map(a=>(this.active.find(c=>c.source==a)||new lr(a,this.active.some(c=>c.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((a,l)=>a==this.active[l])&&(s=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!jE(s,this.active)?o=ps.build(s,t,this.id,o,n):o&&o.disabled&&!s.some(a=>a.state==1)&&(o=null),!o&&s.every(a=>a.state!=1)&&s.some(a=>a.hasResult())&&(s=s.map(a=>a.hasResult()?new lr(a.source,0):a));for(let a of e.effects)a.is(lf)&&(o=o&&o.setSelected(a.value,this.id));return s==this.active&&o==this.open?this:new xl(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:VE}}function jE(r,e){if(r==e)return!0;for(let t=0,n=0;;){for(;t<r.length&&!r[t].hasResult;)t++;for(;n<e.length&&!e[n].hasResult;)n++;let i=t==r.length,s=n==e.length;if(i||s)return i==s;if(r[t++].result!=e[n++].result)return!1}}const VE={"aria-autocomplete":"list"};function uv(r,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":r};return e>-1&&(t["aria-activedescendant"]=r+"-"+e),t}const WE=[];function af(r){return r.isUserEvent("input.type")?"input":r.isUserEvent("delete.backward")?"delete":null}class lr{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=af(e),i=this;n?i=i.handleUserEvent(e,n,t):e.docChanged?i=i.handleChange(e):e.selection&&i.state!=0&&(i=new lr(i.source,0));for(let s of e.effects)if(s.is(sf))i=new lr(i.source,1,s.value?ti(e.state):-1);else if(s.is(Co))i=new lr(i.source,0);else if(s.is(fv))for(let o of s.value)o.source==i.source&&(i=o);return i}handleUserEvent(e,t,n){return t=="delete"||!n.activateOnTyping?this.map(e.changes):new lr(this.source,1)}handleChange(e){return e.changes.touchesRange(ti(e.startState))?new lr(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new lr(this.source,this.state,e.mapPos(this.explicitPos))}}class gs extends lr{constructor(e,t,n,i,s){super(e,2,t),this.result=n,this.from=i,this.to=s}hasResult(){return!0}handleUserEvent(e,t,n){var i;let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=ti(e.state);if((this.explicitPos<0?a<=s:a<this.from)||a>o||t=="delete"&&ti(e.startState)==this.from)return new lr(this.source,t=="input"&&n.activateOnTyping?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),c;return $E(this.result.validFor,e.state,s,o)?new gs(this.source,l,this.result,s,o):this.result.update&&(c=this.result.update(this.result,s,o,new rv(e.state,a,l>=0)))?new gs(this.source,l,c,c.from,(i=c.to)!==null&&i!==void 0?i:ti(e.state)):new lr(this.source,1,l)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new lr(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new gs(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function $E(r,e,t,n){if(!r)return!1;let i=e.sliceDoc(t,n);return typeof r=="function"?r(i,t,n,e):sv(r,!0).test(i)}const fv=Ae.define({map(r,e){return r.map(t=>t.map(e))}}),lf=Ae.define(),jt=kt.define({create(){return xl.start()},update(r,e){return r.update(e)},provide:r=>[Ja.from(r,e=>e.tooltip),he.contentAttributes.from(r,e=>e.attrs)]});function hv(r,e){const t=e.completion.apply||e.completion.label;let n=r.state.field(jt).active.find(i=>i.source==e.source);return n instanceof gs?(typeof t=="string"?r.dispatch(Object.assign(Object.assign({},PE(r.state,t,n.from,n.to)),{annotations:ov.of(e.completion)})):t(r,e.completion,n.from,n.to),!0):!1}const HE=LE(jt,hv);function wl(r,e="option"){return t=>{let n=t.state.field(jt,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<t.state.facet(Qt).interactionDelay)return!1;let i=1,s;e=="page"&&(s=mm(t,n.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=n.open.options,a=n.open.selected>-1?n.open.selected+i*(r?1:-1):r?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:lf.of(a)}),!0}}const zE=r=>{let e=r.state.field(jt,!1);return r.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<r.state.facet(Qt).interactionDelay?!1:hv(r,e.open.options[e.open.selected])},UE=r=>r.state.field(jt,!1)?(r.dispatch({effects:sf.of(!0)}),!0):!1,GE=r=>{let e=r.state.field(jt,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(r.dispatch({effects:Co.of(null)}),!0)};class KE{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const YE=50,JE=1e3,QE=ut.fromClass(class{constructor(r){this.view=r,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of r.state.field(jt).active)e.state==1&&this.startQuery(e)}update(r){let e=r.state.field(jt);if(!r.selectionSet&&!r.docChanged&&r.startState.field(jt)==e)return;let t=r.transactions.some(n=>(n.selection||n.docChanged)&&!af(n));for(let n=0;n<this.running.length;n++){let i=this.running[n];if(t||i.updates.length+r.transactions.length>YE&&Date.now()-i.time>JE){for(let s of i.context.abortListeners)try{s()}catch(o){Nr(this.view.state,o)}i.context.abortListeners=null,this.running.splice(n--,1)}else i.updates.push(...r.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(n=>n.state==1&&!this.running.some(i=>i.active.source==n.source))?setTimeout(()=>this.startUpdate(),50):-1,this.composing!=0)for(let n of r.transactions)af(n)=="input"?this.composing=2:this.composing==2&&n.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:r}=this.view,e=r.field(jt);for(let t of e.active)t.state==1&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t)}startQuery(r){let{state:e}=this.view,t=ti(e),n=new rv(e,t,r.explicitPos==t),i=new KE(r,n);this.running.push(i),Promise.resolve(r.source(n)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Co.of(null)}),Nr(this.view.state,s)})}scheduleAccept(){this.running.every(r=>r.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Qt).updateSyncTime))}accept(){var r;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Qt);for(let n=0;n<this.running.length;n++){let i=this.running[n];if(i.done===void 0)continue;if(this.running.splice(n--,1),i.done){let o=new gs(i.active.source,i.active.explicitPos,i.done,i.done.from,(r=i.done.to)!==null&&r!==void 0?r:ti(i.updates.length?i.updates[0].startState:this.view.state));for(let a of i.updates)o=o.update(a,t);if(o.hasResult()){e.push(o);continue}}let s=this.view.state.field(jt).active.find(o=>o.source==i.active.source);if(s&&s.state==1)if(i.done==null){let o=new lr(i.active.source,0);for(let a of i.updates)o=o.update(a,t);o.state!=1&&e.push(o)}else this.startQuery(s)}e.length&&this.view.dispatch({effects:fv.of(e)})}},{eventHandlers:{blur(r){let e=this.view.state.field(jt,!1);if(e&&e.tooltip&&this.view.state.facet(Qt).closeOnBlur){let t=e.open&&mm(this.view,e.open.tooltip);(!t||!t.dom.contains(r.relatedTarget))&&this.view.dispatch({effects:Co.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:sf.of(!1)}),20),this.composing=0}}}),dv=he.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class XE{constructor(e,t,n,i){this.field=e,this.line=t,this.from=n,this.to=i}}class cf{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,MapMode.TrackDel),n=e.mapPos(this.to,1,MapMode.TrackDel);return t==null||n==null?null:new cf(this.field,t,n)}}class uf{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],i=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(n.length){let c=o,u=/^\t*/.exec(l)[0].length;for(let h=0;h<u;h++)c+=e.facet(indentUnit);i.push(t+c.length-u),l=c+l.slice(u)}n.push(l),t+=l.length+1}let a=this.fieldPositions.map(l=>new cf(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:n,ranges:a}}static parse(e){let t=[],n=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",c=-1;for(let u=0;u<t.length;u++)(a!=null?t[u].seq==a:l&&t[u].name==l)&&(c=u);if(c<0){let u=0;for(;u<t.length&&(a==null||t[u].seq!=null&&t[u].seq<a);)u++;t.splice(u,0,{seq:a,name:l}),c=u;for(let h of i)h.field>=c&&h.field++}i.push(new XE(c,n.length,s.index,s.index+l.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}for(let a;a=/\\([{}])/.exec(o);){o=o.slice(0,a.index)+a[1]+o.slice(a.index+a[0].length);for(let l of i)l.line==n.length&&l.from>a.index&&(l.from--,l.to--)}n.push(o)}return new uf(n,i)}}let ZE=we.widget({widget:new class extends on{toDOM(){let r=document.createElement("span");return r.className="cm-snippetFieldPosition",r}ignoreEvent(){return!1}}}),_E=we.mark({class:"cm-snippetField"});class ms{constructor(e,t){this.ranges=e,this.active=t,this.deco=we.set(e.map(n=>(n.from==n.to?ZE:_E).range(n.from,n.to)))}map(e){let t=[];for(let n of this.ranges){let i=n.map(e);if(!i)return null;t.push(i)}return new ms(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}}const Oo=Ae.define({map(r,e){return r&&r.map(e)}}),qE=Ae.define(),Oi=kt.define({create(){return null},update(r,e){for(let t of e.effects){if(t.is(Oo))return t.value;if(t.is(qE)&&r)return new ms(r.ranges,t.value)}return r&&e.docChanged&&(r=r.map(e.changes)),r&&e.selection&&!r.selectionInsideField(e.selection)&&(r=null),r},provide:r=>he.decorations.from(r,e=>e?e.deco:we.none)});function ff(r,e){return ie.create(r.filter(t=>t.field==e).map(t=>ie.range(t.from,t.to)))}function eT(r){let e=uf.parse(r);return(t,n,i,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,i),l={changes:{from:i,to:s,insert:Text.of(o)},scrollIntoView:!0,annotations:n?ov.of(n):void 0};if(a.length&&(l.selection=ff(a,0)),a.length>1){let c=new ms(a,0),u=l.effects=[Oo.of(c)];t.state.field(Oi,!1)===void 0&&u.push(StateEffect.appendConfig.of([Oi,sT,oT,dv]))}t.dispatch(t.state.update(l))}}function pv(r){return({state:e,dispatch:t})=>{let n=e.field(Oi,!1);if(!n||r<0&&n.active==0)return!1;let i=n.active+r,s=r>0&&!n.ranges.some(o=>o.field==i+r);return t(e.update({selection:ff(n.ranges,i),effects:Oo.of(s?null:new ms(n.ranges,i)),scrollIntoView:!0})),!0}}const tT=({state:r,dispatch:e})=>r.field(Oi,!1)?(e(r.update({effects:Oo.of(null)})),!0):!1,rT=pv(1),nT=pv(-1);function XD(r){let e=r.field(Oi,!1);return!!(e&&e.ranges.some(t=>t.field==e.active+1))}function ZD(r){let e=r.field(Oi,!1);return!!(e&&e.active>0)}const iT=[{key:"Tab",run:rT,shift:nT},{key:"Escape",run:tT}],gv=de.define({combine(r){return r.length?r[0]:iT}}),sT=xi.highest(oo.compute([gv],r=>r.facet(gv)));function _D(r,e){return Object.assign(Object.assign({},e),{apply:eT(r)})}const oT=he.domEventHandlers({mousedown(r,e){let t=e.state.field(Oi,!1),n;if(!t||(n=e.posAtCoords({x:r.clientX,y:r.clientY}))==null)return!1;let i=t.ranges.find(s=>s.from<=n&&s.to>=n);return!i||i.field==t.active?!1:(e.dispatch({selection:ff(t.ranges,i.field),effects:Oo.of(t.ranges.some(s=>s.field>i.field)?new ms(t.ranges,i.field):null),scrollIntoView:!0}),!0)}});function aT(r){let e=r.replace(/[\]\-\\]/g,"\\$&");try{return new RegExp(`[\\p{Alphabetic}\\p{Number}_${e}]+`,"ug")}catch{return new RegExp(`[w${e}]`,"g")}}function mv(r,e){return new RegExp(e(r.source),r.unicode?"u":"")}const vv=null;function lT(r){return vv[r]||(vv[r]=new WeakMap)}function yv(r,e,t,n,i){for(let s=r.iterLines(),o=0;!s.next().done;){let{value:a}=s,l;for(e.lastIndex=0;l=e.exec(a);)if(!n[l[0]]&&o+l.index!=i&&(t.push({type:"text",label:l[0]}),n[l[0]]=!0,t.length>=2e3))return;o+=a.length+1}}function bv(r,e,t,n,i){let s=r.length>=1e3,o=s&&e.get(r);if(o)return o;let a=[],l=Object.create(null);if(r.children){let c=0;for(let u of r.children){if(u.length>=1e3)for(let h of bv(u,e,t,n-c,i-c))l[h.label]||(l[h.label]=!0,a.push(h));else yv(u,t,a,l,i-c);c+=u.length+1}}else yv(r,t,a,l,i);return s&&a.length<2e3&&e.set(r,a),a}const qD=r=>{let e=r.state.languageDataAt("wordChars",r.pos).join(""),t=aT(e),n=r.matchBefore(mv(t,o=>o+"$"));if(!n&&!r.explicit)return null;let i=n?n.from:r.pos,s=bv(r.state.doc,lT(e),t,5e4,i);return{from:i,options:s,validFor:mv(t,o=>"^"+o)}},Eo={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ei=Ae.define({map(r,e){let t=e.mapPos(r,-1,rr.TrackAfter);return t??void 0}}),hf=new class extends wi{};hf.startSide=1,hf.endSide=-1;const xv=kt.define({create(){return Ge.empty},update(r,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,n=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(n,-1)&&(r=Ge.empty)}r=r.map(e.changes);for(let t of e.effects)t.is(Ei)&&(r=r.update({add:[hf.range(t.value,t.value+1)]}));return r}});function cT(){return[fT,xv]}const df="()[]{}<>";function wv(r){for(let e=0;e<df.length;e+=2)if(df.charCodeAt(e)==r)return df.charAt(e+1);return kc(r<128?r:r+1)}function Sv(r,e){return r.languageDataAt("closeBrackets",e)[0]||Eo}const uT=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),fT=he.inputHandler.of((r,e,t,n)=>{if((uT?r.composing:r.compositionStarted)||r.state.readOnly)return!1;let i=r.state.selection.main;if(n.length>2||n.length==2&&Dr(Lt(n,0))==1||e!=i.from||t!=i.to)return!1;let s=dT(r.state,n);return s?(r.dispatch(s),!0):!1}),hT=[{key:"Backspace",run:({state:r,dispatch:e})=>{if(r.readOnly)return!1;let n=Sv(r,r.selection.main.head).brackets||Eo.brackets,i=null,s=r.changeByRange(o=>{if(o.empty){let a=pT(r.doc,o.head);for(let l of n)if(l==a&&Sl(r.doc,o.head)==wv(Lt(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:ie.cursor(o.head-l.length)}}return{range:i=o}});return i||e(r.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function dT(r,e){let t=Sv(r,r.selection.main.head),n=t.brackets||Eo.brackets;for(let i of n){let s=wv(Lt(i,0));if(e==i)return s==i?vT(r,i,n.indexOf(i+i+i)>-1,t):gT(r,i,s,t.before||Eo.before);if(e==s&&kv(r,r.selection.main.from))return mT(r,i,s)}return null}function kv(r,e){let t=!1;return r.field(xv).between(0,r.doc.length,n=>{n==e&&(t=!0)}),t}function Sl(r,e){let t=r.sliceString(e,e+2);return t.slice(0,Dr(Lt(t,0)))}function pT(r,e){let t=r.sliceString(e-2,e);return Dr(Lt(t,0))==t.length?t:t.slice(1)}function gT(r,e,t,n){let i=null,s=r.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Ei.of(o.to+e.length),range:ie.range(o.anchor+e.length,o.head+e.length)};let a=Sl(r.doc,o.head);return!a||/\s/.test(a)||n.indexOf(a)>-1?{changes:{insert:e+t,from:o.head},effects:Ei.of(o.head+e.length),range:ie.cursor(o.head+e.length)}:{range:i=o}});return i?null:r.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function mT(r,e,t){let n=null,i=r.changeByRange(s=>s.empty&&Sl(r.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:ie.cursor(s.head+t.length)}:n={range:s});return n?null:r.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function vT(r,e,t,n){let i=n.stringPrefixes||Eo.stringPrefixes,s=null,o=r.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Ei.of(a.to+e.length),range:ie.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=Sl(r.doc,l),u;if(c==e){if(Av(r,l))return{changes:{insert:e+e,from:l},effects:Ei.of(l+e.length),range:ie.cursor(l+e.length)};if(kv(r,l)){let d=t&&r.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:ie.cursor(l+d.length)}}}else{if(t&&r.sliceDoc(l-2*e.length,l)==e+e&&(u=Cv(r,l-2*e.length,i))>-1&&Av(r,u))return{changes:{insert:e+e+e+e,from:l},effects:Ei.of(l+e.length),range:ie.cursor(l+e.length)};if(r.charCategorizer(l)(c)!=ot.Word&&Cv(r,l,i)>-1&&!yT(r,l,e,i))return{changes:{insert:e+e,from:l},effects:Ei.of(l+e.length),range:ie.cursor(l+e.length)}}return{range:s=a}});return s?null:r.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Av(r,e){let t=Nt(r).resolveInner(e+1);return t.parent&&t.from==e}function yT(r,e,t,n){let i=Nt(r).resolveInner(e,-1),s=n.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=r.sliceDoc(i.from,Math.min(i.to,i.from+t.length+s)),l=a.indexOf(t);if(!l||l>-1&&n.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>t.length+l;){if(r.sliceDoc(u.to-t.length,u.to)==t)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function Cv(r,e,t){let n=r.charCategorizer(e);if(n(r.sliceDoc(e-1,e))!=ot.Word)return e;for(let i of t){let s=e-i.length;if(r.sliceDoc(s,e)==i&&n(r.sliceDoc(s-1,s))!=ot.Word)return s}return-1}function bT(r={}){return[jt,Qt.of(r),QE,xT,dv]}const Ov=[{key:"Ctrl-Space",run:UE},{key:"Escape",run:GE},{key:"ArrowDown",run:wl(!0)},{key:"ArrowUp",run:wl(!1)},{key:"PageDown",run:wl(!0,"page")},{key:"PageUp",run:wl(!1,"page")},{key:"Enter",run:zE}],xT=xi.highest(oo.computeN([Qt],r=>r.facet(Qt).defaultKeymap?[Ov]:[]));function t3(r){let e=r.field(jt,!1);return e&&e.active.some(t=>t.state==1)?"pending":e&&e.active.some(t=>t.state!=0)?"active":null}const Ev=new WeakMap;function r3(r){var e;let t=(e=r.field(jt,!1))===null||e===void 0?void 0:e.open;if(!t||t.disabled)return[];let n=Ev.get(t.options);return n||Ev.set(t.options,n=t.options.map(i=>i.completion)),n}function n3(r){var e;let t=(e=r.field(jt,!1))===null||e===void 0?void 0:e.open;return t&&!t.disabled&&t.selected>=0?t.options[t.selected].completion:null}function i3(r){var e;let t=(e=r.field(jt,!1))===null||e===void 0?void 0:e.open;return t&&!t.disabled&&t.selected>=0?t.selected:null}function s3(r){return lf.of(r)}class wT{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class Ti{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=e,s=n.facet(Pi).markerFilter;s&&(i=s(i));let o=we.set(i.map(a=>a.from==a.to||a.from==a.to-1&&n.doc.lineAt(a.from).to==a.from?we.widget({widget:new PT(a),diagnostic:a}).range(a.from):we.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a}).range(a.from,a.to)),!0);return new Ti(o,t,vs(o))}}function vs(r,e=null,t=0){let n=null;return r.between(t,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostic!=e))return n=new wT(i,s,o.diagnostic),!1}),n}function Tv(r,e){let t=r.startState.doc.lineAt(e.pos);return!!(r.effects.some(n=>n.is(kl))||r.changes.touchesRange(t.from,t.to))}function Pv(r,e){return r.field(Xt,!1)?e:e.concat(Ae.appendConfig.of(Wv))}function ST(r,e){return{effects:Pv(r,[kl.of(e)])}}const kl=Ae.define(),pf=Ae.define(),Mv=Ae.define(),Xt=kt.define({create(){return new Ti(we.none,null,null)},update(r,e){if(e.docChanged){let t=r.diagnostics.map(e.changes),n=null;if(r.selected){let i=e.changes.mapPos(r.selected.from,1);n=vs(t,r.selected.diagnostic,i)||vs(t,null,i)}r=new Ti(t,r.panel,n)}for(let t of e.effects)t.is(kl)?r=Ti.init(t.value,r.panel,e.state):t.is(pf)?r=new Ti(r.diagnostics,t.value?Al.open:null,r.selected):t.is(Mv)&&(r=new Ti(r.diagnostics,r.panel,t.value));return r},provide:r=>[ho.from(r,e=>e.panel),he.decorations.from(r,e=>e.diagnostics)]});function o3(r){let e=r.field(Xt,!1);return e?e.diagnostics.size:0}const kT=we.mark({class:"cm-lintRange cm-lintRange-active"});function AT(r,e,t){let{diagnostics:n}=r.state.field(Xt),i=[],s=2e8,o=0;n.between(e-(t<0?1:0),e+(t>0?1:0),(l,c,{spec:u})=>{e>=l&&e<=c&&(l==c||(e>l||t>0)&&(e<c||t<0))&&(i.push(u.diagnostic),s=Math.min(l,s),o=Math.max(c,o))});let a=r.state.facet(Pi).tooltipFilter;return a&&(i=a(i)),i.length?{pos:s,end:o,above:r.state.doc.lineAt(s).to<o,create(){return{dom:Iv(r,i)}}}:null}function Iv(r,e){return rt("ul",{class:"cm-tooltip-lint"},e.map(t=>Lv(r,t,!1)))}const CT=r=>{let e=r.state.field(Xt,!1);(!e||!e.panel)&&r.dispatch({effects:Pv(r.state,[pf.of(!0)])});let t=fo(r,Al.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},Dv=r=>{let e=r.state.field(Xt,!1);return!e||!e.panel?!1:(r.dispatch({effects:pf.of(!1)}),!0)},OT=r=>{let e=r.state.field(Xt,!1);if(!e)return!1;let t=r.state.selection.main,n=e.diagnostics.iter(t.to+1);return!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==t.from&&n.to==t.to)?!1:(r.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},a3=r=>{let{state:e}=r,t=e.field(Xt,!1);if(!t)return!1;let n=e.selection.main,i,s,o,a;return t.diagnostics.between(0,e.doc.length,(l,c)=>{c<n.to&&(i==null||i<l)&&(i=l,s=c),(o==null||l>o)&&(o=l,a=c)}),o==null||i==null&&o==n.from?!1:(r.dispatch({selection:{anchor:i??o,head:s??a},scrollIntoView:!0}),!0)},ET=[{key:"Mod-Shift-m",run:CT,preventDefault:!0},{key:"F8",run:OT}],Nv=ut.fromClass(class{constructor(r){this.view=r,this.timeout=-1,this.set=!0;let{delay:e}=r.state.facet(Pi);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let r=Date.now();if(r<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-r);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(Pi);Promise.all(t.map(n=>Promise.resolve(n(this.view)))).then(n=>{let i=n.reduce((s,o)=>s.concat(o));this.view.state.doc==e.doc&&this.view.dispatch(ST(this.view.state,i))},n=>{Nr(this.view.state,n)})}}update(r){let e=r.state.facet(Pi);(r.docChanged||e!=r.startState.facet(Pi)||e.needsRefresh&&e.needsRefresh(r))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Pi=de.define({combine(r){return Object.assign({sources:r.map(e=>e.source)},zr(r.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))}});function TT(r,e={}){return[Pi.of({source:r,config:e}),Nv,Wv]}function l3(r){let e=r.plugin(Nv);e&&e.force()}function Rv(r){let e=[];if(r)e:for(let{name:t}of r){for(let n=0;n<t.length;n++){let i=t[n];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function Lv(r,e,t){var n;let i=t?Rv(e.actions):[];return rt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},rt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(n=e.actions)===null||n===void 0?void 0:n.map((s,o)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let p=vs(r.state.field(Xt).diagnostics,e);p&&s.apply(r,p.from,p.to)},{name:c}=s,u=i[o]?c.indexOf(i[o]):-1,h=u<0?c:[c.slice(0,u),rt("u",c.slice(u,u+1)),c.slice(u+1)];return rt("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[o]})"`}.`},h)}),e.source&&rt("div",{class:"cm-diagnosticSource"},e.source))}class PT extends on{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return rt("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Bv{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Lv(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Al{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)Dv(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Rv(s.actions);for(let a=0;a<o.length;a++)if(o[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=vs(this.view.state.field(Xt).diagnostics,s);l&&s.actions[a].apply(e,l.from,l.to)}}else return;i.preventDefault()},n=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=rt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=rt("div",{class:"cm-panel-lint"},this.list,rt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Dv(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(Xt).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Xt),n=0,i=!1,s=null;for(e.between(0,this.view.state.doc.length,(o,a,{spec:l})=>{let c=-1,u;for(let h=n;h<this.items.length;h++)if(this.items[h].diagnostic==l.diagnostic){c=h;break}c<0?(u=new Bv(this.view,l.diagnostic),this.items.splice(n,0,u),i=!0):(u=this.items[c],c>n&&(this.items.splice(n,c-n),i=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),s=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),n++});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new Bv(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:a})=>{let l=a.height/this.list.offsetHeight;o.top<a.top?this.list.scrollTop-=(a.top-o.top)/l:o.bottom>a.bottom&&(this.list.scrollTop+=(o.bottom-a.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Xt),n=vs(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:Mv.of(n)})}static open(e){return new Al(e)}}function Cl(r,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(r)}</svg>')`}function Ol(r){return Cl(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${r}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const MT=he.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Ol("#d11")},".cm-lintRange-warning":{backgroundImage:Ol("orange")},".cm-lintRange-info":{backgroundImage:Ol("#999")},".cm-lintRange-hint":{backgroundImage:Ol("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Fv(r){return r=="error"?4:r=="warning"?3:r=="info"?2:1}class IT extends un{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce((t,n)=>Fv(t)<Fv(n.severity)?n.severity:t,"hint")}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,i=e.state.facet(El).tooltipFilter;return i&&(n=i(n)),n.length&&(t.onmouseover=()=>NT(e,t,n)),t}}function DT(r,e){let t=n=>{let i=e.getBoundingClientRect();if(!(n.clientX>i.left-10&&n.clientX<i.right+10&&n.clientY>i.top-10&&n.clientY<i.bottom+10)){for(let s=n.target;s;s=s.parentNode)if(s.nodeType==1&&s.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",t),r.state.field(Vv)&&r.dispatch({effects:gf.of(null)})}};window.addEventListener("mousemove",t)}function NT(r,e,t){function n(){let o=r.elementAtHeight(e.getBoundingClientRect().top+5-r.documentTop);r.coordsAtPos(o.from)&&r.dispatch({effects:gf.of({pos:o.from,above:!1,create(){return{dom:Iv(r,t),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,DT(r,e)}let{hoverTime:i}=r.state.facet(El),s=setTimeout(n,i);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(n,i)}}function RT(r,e){let t=Object.create(null);for(let i of e){let s=r.lineAt(i.from);(t[s.from]||(t[s.from]=[])).push(i)}let n=[];for(let i in t)n.push(new IT(t[i]).range(+i));return Ge.of(n,!0)}const LT=bm({class:"cm-gutter-lint",markers:r=>r.state.field(jv)}),jv=kt.define({create(){return Ge.empty},update(r,e){r=r.map(e.changes);let t=e.state.facet(El).markerFilter;for(let n of e.effects)if(n.is(kl)){let i=n.value;t&&(i=t(i||[])),r=RT(e.state.doc,i.slice(0))}return r}}),gf=Ae.define(),Vv=kt.define({create(){return null},update(r,e){return r&&e.docChanged&&(r=Tv(e,r)?null:Object.assign(Object.assign({},r),{pos:e.changes.mapPos(r.pos)})),e.effects.reduce((t,n)=>n.is(gf)?n.value:t,r)},provide:r=>Ja.from(r)}),BT=he.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Cl('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:Cl('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:Cl('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),Wv=[Xt,he.decorations.compute([Xt],r=>{let{selected:e,panel:t}=r.field(Xt);return!e||!t||e.from==e.to?we.none:we.set([kT.range(e.from,e.to)])}),DC(AT,{hideOn:Tv}),MT],El=de.define({combine(r){return zr(r,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function c3(r={}){return[El.of(r),jv,LT,BT,Vv]}function u3(r,e){let t=r.field(Xt,!1);if(t&&t.diagnostics.size)for(let n=RangeSet.iter([t.diagnostics]);n.value;n.next())e(n.value.spec.diagnostic,n.from,n.to)}var $v=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(hT)),e.defaultKeymap!==!1&&(n=n.concat(q2)),e.searchKeymap!==!1&&(n=n.concat(AE)),e.historyKeymap!==!1&&(n=n.concat(c2)),e.foldKeymap!==!1&&(n=n.concat(gO)),e.completionKeymap!==!1&&(n=n.concat(Ov)),e.lintKeymap!==!1&&(n=n.concat(ET));var i=[];return e.lineNumbers!==!1&&i.push(WC()),e.highlightActiveLineGutter!==!1&&i.push(zC()),e.highlightSpecialChars!==!1&&i.push(lC()),e.history!==!1&&i.push(e2()),e.foldGutter!==!1&&i.push(bO()),e.drawSelection!==!1&&i.push(_A()),e.dropCursor!==!1&&i.push(nC()),e.allowMultipleSelections!==!1&&i.push(We.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(iO()),e.syntaxHighlighting!==!1&&i.push(Nu(kO,{fallback:!0})),e.bracketMatching!==!1&&i.push(PO()),e.closeBrackets!==!1&&i.push(cT()),e.autocompletion!==!1&&i.push(bT()),e.rectangularSelection!==!1&&i.push(SC()),t!==!1&&i.push(CC()),e.highlightActiveLine!==!1&&i.push(pC()),e.highlightSelectionMatches!==!1&&i.push(sE()),e.tabSize&&typeof e.tabSize=="number"&&i.push(_a.of(" ".repeat(e.tabSize))),i.concat([oo.of(n.flat())]).filter(Boolean)},f3=function(e){e===void 0&&(e={});var t=[];e.defaultKeymap!==!1&&(t=t.concat(defaultKeymap)),e.historyKeymap!==!1&&(t=t.concat(historyKeymap));var n=[];return e.highlightSpecialChars!==!1&&n.push(highlightSpecialChars()),e.history!==!1&&n.push(history()),e.drawSelection!==!1&&n.push(drawSelection()),e.syntaxHighlighting!==!1&&n.push(syntaxHighlighting(defaultHighlightStyle,{fallback:!0})),n.concat([keymap.of(t.flat())]).filter(Boolean)};const Hv="#e5c07b",mf="#e06c75",zv="#56b6c2",Uv="#ffffff",To="#abb2bf",Tl="#7d8799",Gv="#61afef",Kv="#98c379",vf="#d19a66",Yv="#c678dd",Jv="#21252b",yf="#2c313a",bf="#282c34",Pl="#353a42",Qv="#3E4451",xf="#528bff",h3={chalky:Hv,coral:mf,cyan:zv,invalid:Uv,ivory:To,stone:Tl,malibu:Gv,sage:Kv,whiskey:vf,violet:Yv,darkBackground:Jv,highlightBackground:yf,background:bf,tooltipBackground:Pl,selection:Qv,cursor:xf},FT=he.theme({"&":{color:To,backgroundColor:bf},".cm-content":{caretColor:xf},".cm-cursor, .cm-dropCursor":{borderLeftColor:xf},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Qv},".cm-panels":{backgroundColor:Jv,color:To},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:bf,color:Tl,border:"none"},".cm-activeLineGutter":{backgroundColor:yf},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Pl},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Pl,borderBottomColor:Pl},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:yf,color:To}}},{dark:!0}),jT=as.define([{tag:M.keyword,color:Yv},{tag:[M.name,M.deleted,M.character,M.propertyName,M.macroName],color:mf},{tag:[M.function(M.variableName),M.labelName],color:Gv},{tag:[M.color,M.constant(M.name),M.standard(M.name)],color:vf},{tag:[M.definition(M.name),M.separator],color:To},{tag:[M.typeName,M.className,M.number,M.changed,M.annotation,M.modifier,M.self,M.namespace],color:Hv},{tag:[M.operator,M.operatorKeyword,M.url,M.escape,M.regexp,M.link,M.special(M.string)],color:zv},{tag:[M.meta,M.comment],color:Tl},{tag:M.strong,fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.link,color:Tl,textDecoration:"underline"},{tag:M.heading,fontWeight:"bold",color:mf},{tag:[M.atom,M.bool,M.special(M.variableName)],color:vf},{tag:[M.processingInstruction,M.string,M.inserted],color:Kv},{tag:M.invalid,color:Uv}]),VT=[FT,Nu(jT)];var WT=he.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),$T=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:i=!1,theme:s="light",placeholder:o="",basicSetup:a=!0}=e,l=[];switch(t&&l.unshift(oo.of([eE])),a&&(typeof a=="boolean"?l.unshift($v()):l.unshift($v(a))),o&&l.unshift(yC(o)),s){case"light":l.push(WT);break;case"dark":l.push(VT);break;case"none":break;default:l.push(s);break}return n===!1&&l.push(he.editable.of(!1)),i&&l.push(We.readOnly.of(!0)),[...l]},HT=r=>({line:r.state.doc.lineAt(r.state.selection.main.from),lineCount:r.state.doc.lines,lineBreak:r.state.lineBreak,length:r.state.doc.length,readOnly:r.state.readOnly,tabSize:r.state.tabSize,selection:r.state.selection,selectionAsSingle:r.state.selection.asSingle().main,ranges:r.state.selection.ranges,selectionCode:r.state.sliceDoc(r.state.selection.main.from,r.state.selection.main.to),selections:r.state.selection.ranges.map(e=>r.state.sliceDoc(e.from,e.to)),selectedText:r.state.selection.ranges.some(e=>!e.empty)}),Xv=sn.define(),zT=[];function UT(r){var{value:e,selection:t,onChange:n,onStatistics:i,onCreateEditor:s,onUpdate:o,extensions:a=zT,autoFocus:l,theme:c="light",height:u=null,minHeight:h=null,maxHeight:d=null,width:p=null,minWidth:m=null,maxWidth:y=null,placeholder:w="",editable:A=!0,readOnly:T=!1,indentWithTab:P=!0,basicSetup:L=!0,root:D,initialState:j}=r,[W,q]=(0,S.useState)(),[F,H]=(0,S.useState)(),[Q,oe]=(0,S.useState)(),fe=he.theme({"&":{height:u,minHeight:h,maxHeight:d,width:p,minWidth:m,maxWidth:y},"& .cm-scroller":{height:"100% !important"}}),be=he.updateListener.of(Se=>{if(Se.docChanged&&typeof n=="function"&&!Se.transactions.some(De=>De.annotation(Xv))){var Oe=Se.state.doc,Te=Oe.toString();n(Te,Se)}i&&i(HT(Se))}),ke=$T({theme:c,editable:A,readOnly:T,placeholder:w,indentWithTab:P,basicSetup:L}),Re=[be,fe,...ke];return o&&typeof o=="function"&&Re.push(he.updateListener.of(o)),Re=Re.concat(a),(0,S.useEffect)(()=>{if(W&&!Q){var Se={doc:e,selection:t,extensions:Re},Oe=j?We.fromJSON(j.json,Se,j.fields):We.create(Se);if(oe(Oe),!F){var Te=new he({state:Oe,parent:W,root:D});H(Te),s&&s(Te,Oe)}}return()=>{F&&(oe(void 0),H(void 0))}},[W,Q]),(0,S.useEffect)(()=>q(r.container),[r.container]),(0,S.useEffect)(()=>()=>{F&&(F.destroy(),H(void 0))},[F]),(0,S.useEffect)(()=>{l&&F&&F.focus()},[l,F]),(0,S.useEffect)(()=>{F&&F.dispatch({effects:Ae.reconfigure.of(Re)})},[c,a,u,h,d,p,m,y,w,A,T,P,L,n,o]),(0,S.useEffect)(()=>{if(e!==void 0){var Se=F?F.state.doc.toString():"";F&&e!==Se&&F.dispatch({changes:{from:0,to:Se.length,insert:e||""},annotations:[Xv.of(!0)]})}},[e,F]),{state:Q,setState:oe,view:F,setView:H,container:W,setContainer:q}}var GT=f(61250),KT=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Zv=(0,S.forwardRef)((r,e)=>{var{className:t,value:n="",selection:i,extensions:s=[],onChange:o,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:h="light",height:d,minHeight:p,maxHeight:m,width:y,minWidth:w,maxWidth:A,basicSetup:T,placeholder:P,indentWithTab:L,editable:D,readOnly:j,root:W,initialState:q}=r,F=zO(r,KT),H=(0,S.useRef)(null),{state:Q,view:oe,container:fe}=UT({container:H.current,root:W,value:n,autoFocus:u,theme:h,height:d,minHeight:p,maxHeight:m,width:y,minWidth:w,maxWidth:A,basicSetup:T,placeholder:P,indentWithTab:L,editable:D,readOnly:j,selection:i,onChange:o,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:s,initialState:q});if((0,S.useImperativeHandle)(e,()=>({editor:H.current,state:Q,view:oe}),[H,fe,Q,oe]),typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var be=typeof h=="string"?"cm-theme-"+h:"cm-theme";return(0,GT.jsx)("div",Vu({ref:H,className:""+be+(t?" "+t:"")},F))});Zv.displayName="CodeMirror";const YT=Zv,JT=(0,Je.ZP)(YT)`
153
+ display: flex;
154
+ flex-direction: column;
155
+ justify-content: flex-start;
156
+ overflow: hidden;
157
+ flex: 1;
199
158
 
200
- $3`);return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ah(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var sh=function(){var t=function(n,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var c in u)u.hasOwnProperty(c)&&(s[c]=u[c])},t(n,i)};return function(n,i){t(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)}}(),cr,Xs;if(typeof process=="object")Xs=!1;else if(typeof navigator=="object"){var lh=navigator.userAgent;Xs=lh.indexOf("Windows")>=0}function Sv(t){return 55296<=t&&t<=56319}function wv(t){return 56320<=t&&t<=57343}function Cv(t){return t>=97&&t<=102}function uh(t){return t>=97&&t<=122}function fh(t){return t>=65&&t<=90}function Av(t){return uh(t)||fh(t)}var ch=/^\w[\w\d+.-]*$/,dh=/^\//,hh=/^\/\//;function ph(t,n){if(!t.scheme&&n)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+t.authority+'", path: "'+t.path+'", query: "'+t.query+'", fragment: "'+t.fragment+'"}');if(t.scheme&&!ch.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!dh.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(hh.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 vh(t,n){return!t&&!n?"file":t}function gh(t,n){switch(t){case"https":case"http":case"file":n?n[0]!==qn&&(n=qn+n):n=qn;break}return n}var $t="",qn="/",mh=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,lc=function(){function t(n,i,s,u,c,h){h===void 0&&(h=!1),typeof n=="object"?(this.scheme=n.scheme||$t,this.authority=n.authority||$t,this.path=n.path||$t,this.query=n.query||$t,this.fragment=n.fragment||$t):(this.scheme=vh(n,h),this.authority=i||$t,this.path=gh(this.scheme,s||$t),this.query=u||$t,this.fragment=c||$t,ph(this,h))}return t.isUri=function(n){return n instanceof t?!0:n?typeof n.authority=="string"&&typeof n.fragment=="string"&&typeof n.path=="string"&&typeof n.query=="string"&&typeof n.scheme=="string"&&typeof n.fsPath=="function"&&typeof n.with=="function"&&typeof n.toString=="function":!1},Object.defineProperty(t.prototype,"fsPath",{get:function(){return ad(this,!1)},enumerable:!0,configurable:!0}),t.prototype.with=function(n){if(!n)return this;var i=n.scheme,s=n.authority,u=n.path,c=n.query,h=n.fragment;return i===void 0?i=this.scheme:i===null&&(i=$t),s===void 0?s=this.authority:s===null&&(s=$t),u===void 0?u=this.path:u===null&&(u=$t),c===void 0?c=this.query:c===null&&(c=$t),h===void 0?h=this.fragment:h===null&&(h=$t),i===this.scheme&&s===this.authority&&u===this.path&&c===this.query&&h===this.fragment?this:new za(i,s,u,c,h)},t.parse=function(n,i){i===void 0&&(i=!1);var s=mh.exec(n);return s?new za(s[2]||$t,Hu(s[4]||$t),Hu(s[5]||$t),Hu(s[7]||$t),Hu(s[9]||$t),i):new za($t,$t,$t,$t,$t)},t.file=function(n){var i=$t;if(Xs&&(n=n.replace(/\\/g,qn)),n[0]===qn&&n[1]===qn){var s=n.indexOf(qn,2);s===-1?(i=n.substring(2),n=qn):(i=n.substring(2,s),n=n.substring(s)||qn)}return new za("file",i,n,$t,$t)},t.from=function(n){return new za(n.scheme,n.authority,n.path,n.query,n.fragment)},t.prototype.toString=function(n){return n===void 0&&(n=!1),uc(this,n)},t.prototype.toJSON=function(){return this},t.revive=function(n){if(n){if(n instanceof t)return n;var i=new za(n);return i._formatted=n.external,i._fsPath=n._sep===nd?n.fsPath:null,i}else return n},t}(),nd=Xs?1:void 0,za=function(t){sh(n,t);function n(){var i=t!==null&&t.apply(this,arguments)||this;return i._formatted=null,i._fsPath=null,i}return Object.defineProperty(n.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=ad(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),n.prototype.toString=function(i){return i===void 0&&(i=!1),i?uc(this,!0):(this._formatted||(this._formatted=uc(this,!1)),this._formatted)},n.prototype.toJSON=function(){var i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=nd),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},n}(lc),id=(cr={},cr[58]="%3A",cr[47]="%2F",cr[63]="%3F",cr[35]="%23",cr[91]="%5B",cr[93]="%5D",cr[64]="%40",cr[33]="%21",cr[36]="%24",cr[38]="%26",cr[39]="%27",cr[40]="%28",cr[41]="%29",cr[42]="%2A",cr[43]="%2B",cr[44]="%2C",cr[59]="%3B",cr[61]="%3D",cr[32]="%20",cr);function od(t,n){for(var i=void 0,s=-1,u=0;u<t.length;u++){var c=t.charCodeAt(u);if(c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||n&&c===47)s!==-1&&(i+=encodeURIComponent(t.substring(s,u)),s=-1),i!==void 0&&(i+=t.charAt(u));else{i===void 0&&(i=t.substr(0,u));var h=id[c];h!==void 0?(s!==-1&&(i+=encodeURIComponent(t.substring(s,u)),s=-1),i+=h):s===-1&&(s=u)}}return s!==-1&&(i+=encodeURIComponent(t.substring(s))),i!==void 0?i:t}function yh(t){for(var n=void 0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s===35||s===63?(n===void 0&&(n=t.substr(0,i)),n+=id[s]):n!==void 0&&(n+=t[i])}return n!==void 0?n:t}function ad(t,n){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?n?i=t.path.substr(1):i=t.path[1].toLowerCase()+t.path.substr(2):i=t.path,Xs&&(i=i.replace(/\//g,"\\")),i}function uc(t,n){var i=n?yh:od,s="",u=t.scheme,c=t.authority,h=t.path,m=t.query,p=t.fragment;if(u&&(s+=u,s+=":"),(c||u==="file")&&(s+=qn,s+=qn),c){var y=c.indexOf("@");if(y!==-1){var T=c.substr(0,y);c=c.substr(y+1),y=T.indexOf(":"),y===-1?s+=i(T,!1):(s+=i(T.substr(0,y),!1),s+=":",s+=i(T.substr(y+1),!1)),s+="@"}c=c.toLowerCase(),y=c.indexOf(":"),y===-1?s+=i(c,!1):(s+=i(c.substr(0,y),!1),s+=c.substr(y))}if(h){if(h.length>=3&&h.charCodeAt(0)===47&&h.charCodeAt(2)===58){var L=h.charCodeAt(1);L>=65&&L<=90&&(h="/"+String.fromCharCode(L+32)+":"+h.substr(3))}else if(h.length>=2&&h.charCodeAt(1)===58){var L=h.charCodeAt(0);L>=65&&L<=90&&(h=String.fromCharCode(L+32)+":"+h.substr(2))}s+=i(h,!0)}return m&&(s+="?",s+=i(m,!1)),p&&(s+="#",s+=n?p:od(p,!1)),s}function sd(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+sd(t.substr(3)):t}}var ld=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Hu(t){return t.match(ld)?t.replace(ld,function(n){return sd(n)}):t}var bh=function(){function t(n){try{this.patternRegExp=new RegExp(th(n)+"$")}catch{this.patternRegExp=null}this.schemas=[]}return t.prototype.addSchema=function(n){this.schemas.push(n)},t.prototype.matchesPattern=function(n){return this.patternRegExp&&this.patternRegExp.test(n)},t.prototype.getSchemas=function(){return this.schemas},t}(),xh=function(){function t(n,i,s){this.service=n,this.url=i,this.dependencies={},s&&(this.unresolvedSchema=this.service.promise.resolve(new _a(s)))}return t.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},t.prototype.getResolvedSchema=function(){var n=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(i){return n.service.resolveSchemaContent(i,n.url,n.dependencies)})),this.resolvedSchema},t.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},t}(),_a=function(){function t(n,i){i===void 0&&(i=[]),this.schema=n,this.errors=i}return t}(),ud=function(){function t(n,i){i===void 0&&(i=[]),this.schema=n,this.errors=i}return t.prototype.getSection=function(n){return cn(this.getSectionRecursive(n,this.schema))},t.prototype.getSectionRecursive=function(n,i){if(!i||typeof i=="boolean"||n.length===0)return i;var s=n.shift();if(i.properties&&typeof i.properties[s])return this.getSectionRecursive(n,i.properties[s]);if(i.patternProperties)for(var u=0,c=Object.keys(i.patternProperties);u<c.length;u++){var h=c[u],m=new RegExp(h);if(m.test(s))return this.getSectionRecursive(n,i.patternProperties[h])}else{if(typeof i.additionalProperties=="object")return this.getSectionRecursive(n,i.additionalProperties);if(s.match("[0-9]+")){if(Array.isArray(i.items)){var p=parseInt(s,10);if(!isNaN(p)&&i.items[p])return this.getSectionRecursive(n,i.items[p])}else if(i.items)return this.getSectionRecursive(n,i.items)}}return null},t}(),Sh=function(){function t(n,i,s){this.contextService=i,this.requestService=n,this.promiseConstructor=s||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return t.prototype.getRegisteredSchemaIds=function(n){return Object.keys(this.registeredSchemasIds).filter(function(i){var s=lc.parse(i).scheme;return s!=="schemaservice"&&(!n||n(s))})},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(n){var i=this,s=!1;n=this.normalizeId(n);for(var u=[n],c=Object.keys(this.schemasById).map(function(y){return i.schemasById[y]});u.length;)for(var h=u.pop(),m=0;m<c.length;m++){var p=c[m];p&&(p.url===h||p.dependencies[h])&&(p.url!==h&&u.push(p.url),p.clearSchema(),c[m]=void 0,s=!0)}return s},t.prototype.normalizeId=function(n){try{return lc.parse(n).toString()}catch{return n}},t.prototype.setSchemaContributions=function(n){if(n.schemas){var i=n.schemas;for(var s in i){var u=this.normalizeId(s);this.contributionSchemas[u]=this.addSchemaHandle(u,i[s])}}if(n.schemaAssociations){var c=n.schemaAssociations;for(var h in c){var m=c[h];this.contributionAssociations[h]=m;for(var p=this.getOrAddFilePatternAssociation(h),y=0,T=m;y<T.length;y++){var L=T[y],s=this.normalizeId(L);p.addSchema(s)}}}},t.prototype.addSchemaHandle=function(n,i){var s=new xh(this,n,i);return this.schemasById[n]=s,s},t.prototype.getOrAddSchemaHandle=function(n,i){return this.schemasById[n]||this.addSchemaHandle(n,i)},t.prototype.getOrAddFilePatternAssociation=function(n){var i=this.filePatternAssociationById[n];return i||(i=new bh(n),this.filePatternAssociationById[n]=i,this.filePatternAssociations.push(i)),i},t.prototype.registerExternalSchema=function(n,i,s){i===void 0&&(i=null);var u=this.normalizeId(n);if(this.registeredSchemasIds[u]=!0,i)for(var c=0,h=i;c<h.length;c++){var m=h[c];this.getOrAddFilePatternAssociation(m).addSchema(u)}return s?this.addSchemaHandle(u,s):this.getOrAddSchemaHandle(u)},t.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var n in this.contributionSchemas)this.schemasById[n]=this.contributionSchemas[n],this.registeredSchemasIds[n]=!0;for(var i in this.contributionAssociations)for(var s=this.getOrAddFilePatternAssociation(i),u=0,c=this.contributionAssociations[i];u<c.length;u++){var h=c[u],n=this.normalizeId(h);s.addSchema(n)}},t.prototype.getResolvedSchema=function(n){var i=this.normalizeId(n),s=this.schemasById[i];return s?s.getResolvedSchema():this.promise.resolve(null)},t.prototype.loadSchema=function(n){if(!this.requestService){var i="Unable to load schema from '"+Uu(n)+"'. No schema request service available";return this.promise.resolve(new _a({},[i]))}return this.requestService(n).then(function(s){if(!s){var u="Unable to load schema from '"+Uu(n)+"': No content.";return new _a({},[u])}var c={},h=[];c=Zf(s,h);var m=h.length?["Unable to parse content from '"+Uu(n)+"': Parse error at offset "+h[0].offset]:[];return new _a(c,m)},function(s){var u="Unable to load schema from '"+Uu(n)+"': "+s.toString();return new _a({},[u])})},t.prototype.resolveSchemaContent=function(n,i,s){var u=this,c=n.errors.slice(0),h=n.schema;if(h.$schema){var m=this.normalizeId(h.$schema);if(m==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new ud({},["Draft-03 schemas are not supported."]));m==="https://json-schema.org/draft/2019-09/schema"&&n.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var p=this.contextService,y=function(W,_){if(!_)return W;var fe=W;return _[0]==="/"&&(_=_.substr(1)),_.split("/").some(function(ae){return fe=fe[ae],!fe}),fe},T=function(W,_,fe,ae){var oe=y(_,ae);if(oe)for(var ue in oe)oe.hasOwnProperty(ue)&&!W.hasOwnProperty(ue)&&(W[ue]=oe[ue]);else c.push("$ref '"+ae+"' in '"+fe+"' can not be resolved.")},L=function(W,_,fe,ae,oe){p&&!/^\w+:\/\/.*/.test(_)&&(_=p.resolveRelativePath(_,ae)),_=u.normalizeId(_);var ue=u.getOrAddSchemaHandle(_);return ue.getUnresolvedSchema().then(function(ye){if(oe[_]=!0,ye.errors.length){var Ae=fe?_+"#"+fe:_;c.push("Problems loading reference '"+Ae+"': "+ye.errors[0]+".")}return T(W,ye.schema,_,fe),q(W,ye.schema,_,ue.dependencies)})},q=function(W,_,fe,ae){if(!W||typeof W!="object")return Promise.resolve(null);for(var oe=[W],ue=[],ye=[],Ae=function(){for(var pe=[],Ie=0;Ie<arguments.length;Ie++)pe[Ie]=arguments[Ie];for(var Ee=0,Be=pe;Ee<Be.length;Ee++){var et=Be[Ee];typeof et=="object"&&oe.push(et)}},we=function(){for(var pe=[],Ie=0;Ie<arguments.length;Ie++)pe[Ie]=arguments[Ie];for(var Ee=0,Be=pe;Ee<Be.length;Ee++){var et=Be[Ee];if(typeof et=="object")for(var jt in et){var ut=et[jt];typeof ut=="object"&&oe.push(ut)}}},ke=function(){for(var pe=[],Ie=0;Ie<arguments.length;Ie++)pe[Ie]=arguments[Ie];for(var Ee=0,Be=pe;Ee<Be.length;Ee++){var et=Be[Ee];if(Array.isArray(et))for(var jt=0,ut=et;jt<ut.length;jt++){var jr=ut[jt];typeof jr=="object"&&oe.push(jr)}}},Te=function(pe){for(var Ie=[];pe.$ref;){var Ee=pe.$ref,Be=Ee.split("#",2);if(delete pe.$ref,Be[0].length>0){ye.push(L(pe,Be[0],Be[1],fe,ae));return}else Ie.indexOf(Ee)===-1&&(T(pe,_,fe,Be[1]),Ie.push(Ee))}Ae(pe.items,pe.additionalProperties,pe.not,pe.contains,pe.propertyNames,pe.if,pe.then,pe.else),we(pe.definitions,pe.properties,pe.patternProperties,pe.dependencies),ke(pe.anyOf,pe.allOf,pe.oneOf,pe.items)};oe.length;){var De=oe.pop();ue.indexOf(De)>=0||(ue.push(De),Te(De))}return u.promise.all(ye)};return q(h,h,i,s).then(function(W){return new ud(h,c)})},t.prototype.getSchemaForResource=function(n,i){if(i&&i.root&&i.root.type==="object"){var s=i.root.properties.filter(function(_){return _.keyNode.value==="$schema"&&_.valueNode&&_.valueNode.type==="string"});if(s.length>0){var u=So(s[0].valueNode);if(u&&eh(u,".")&&this.contextService&&(u=this.contextService.resolveRelativePath(u,n)),u){var c=this.normalizeId(u);return this.getOrAddSchemaHandle(c).getResolvedSchema()}}}for(var h=Object.create(null),m=[],p=0,y=this.filePatternAssociations;p<y.length;p++){var T=y[p];if(T.matchesPattern(n))for(var L=0,q=T.getSchemas();L<q.length;L++){var W=q[L];h[W]||(m.push(W),h[W]=!0)}}return m.length>0?this.createCombinedSchema(n,m).getResolvedSchema():this.promise.resolve(null)},t.prototype.createCombinedSchema=function(n,i){if(i.length===1)return this.getOrAddSchemaHandle(i[0]);var s="schemaservice://combinedSchema/"+encodeURIComponent(n),u={allOf:i.map(function(c){return{$ref:c}})};return this.addSchemaHandle(s,u)},t}();function Uu(t){try{}catch{}return t}var wh=function(){function t(n,i){this.jsonSchemaService=n,this.promise=i,this.validationEnabled=!0}return t.prototype.configure=function(n){n&&(this.validationEnabled=n.validate,this.commentSeverity=n.allowComments?void 0:Ze.Error)},t.prototype.doValidation=function(n,i,s,u){var c=this;if(!this.validationEnabled)return this.promise.resolve([]);var h=[],m={},p=function(L){var q=L.range.start.line+" "+L.range.start.character+" "+L.message;m[q]||(m[q]=!0,h.push(L))},y=function(L){var q=s?dd(s.trailingCommas):Ze.Error,W=s?dd(s.comments):c.commentSeverity;if(L){if(L.errors.length&&i.root){var _=i.root,fe=_.type==="object"?_.properties[0]:null;if(fe&&fe.keyNode.value==="$schema"){var ae=fe.valueNode||fe,oe=Oe.create(n.positionAt(ae.offset),n.positionAt(ae.offset+ae.length));p(Yt.create(oe,L.errors[0],Ze.Warning,Pt.SchemaResolveError))}else{var oe=Oe.create(n.positionAt(_.offset),n.positionAt(_.offset+1));p(Yt.create(oe,L.errors[0],Ze.Warning,Pt.SchemaResolveError))}}else{var ue=i.validate(n,L.schema);ue&&ue.forEach(p)}fd(L.schema)&&(W=void 0),cd(L.schema)&&(q=void 0)}for(var ye=0,Ae=i.syntaxErrors;ye<Ae.length;ye++){var we=Ae[ye];if(we.code===Pt.TrailingComma){if(typeof q!="number")continue;we.severity=q}p(we)}if(typeof W=="number"){var ke="Comments are not permitted in JSON.";i.comments.forEach(function(Te){p(Yt.create(Te,ke,W,Pt.CommentNotPermitted))})}return h};if(u){var T=u.id||"schemaservice://untitled/"+Ch++;return this.jsonSchemaService.resolveSchemaContent(new _a(u),T,{}).then(function(L){return y(L)})}return this.jsonSchemaService.getSchemaForResource(n.uri,i).then(function(L){return y(L)})},t}(),Ch=0;function fd(t){if(t&&typeof t=="object"){if(X(t.allowComments))return t.allowComments;if(t.allOf)for(var n=0,i=t.allOf;n<i.length;n++){var s=i[n],u=fd(s);if(X(u))return u}}}function cd(t){if(t&&typeof t=="object"){if(X(t.allowTrailingCommas))return t.allowTrailingCommas;if(X(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var n=0,i=t.allOf;n<i.length;n++){var s=i[n],u=cd(s);if(X(u))return u}}}function dd(t){switch(t){case"error":return Ze.Error;case"warning":return Ze.Warning;case"ignore":return}}var hd=48,Ah=57,Oh=65,zu=97,Eh=102;function dr(t){return t<hd?0:t<=Ah?t-hd:(t<zu&&(t+=zu-Oh),t>=zu&&t<=Eh?t-zu+10:0)}function Th(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:dr(t.charCodeAt(1))*17/255,green:dr(t.charCodeAt(2))*17/255,blue:dr(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:dr(t.charCodeAt(1))*17/255,green:dr(t.charCodeAt(2))*17/255,blue:dr(t.charCodeAt(3))*17/255,alpha:dr(t.charCodeAt(4))*17/255};case 7:return{red:(dr(t.charCodeAt(1))*16+dr(t.charCodeAt(2)))/255,green:(dr(t.charCodeAt(3))*16+dr(t.charCodeAt(4)))/255,blue:(dr(t.charCodeAt(5))*16+dr(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(dr(t.charCodeAt(1))*16+dr(t.charCodeAt(2)))/255,green:(dr(t.charCodeAt(3))*16+dr(t.charCodeAt(4)))/255,blue:(dr(t.charCodeAt(5))*16+dr(t.charCodeAt(6)))/255,alpha:(dr(t.charCodeAt(7))*16+dr(t.charCodeAt(8)))/255}}return null}function Ov(t,n,i,s){return s===void 0&&(s=1),{red:t/255,green:n/255,blue:i/255,alpha:s}}var kh=function(){function t(n){this.schemaService=n}return t.prototype.findDocumentSymbols=function(n,i,s){var u=this;s===void 0&&(s={resultLimit:Number.MAX_VALUE});var c=i.root;if(!c)return null;var h=s.resultLimit,m=n.uri;if((m==="vscode://defaultsettings/keybindings.json"||ac(m.toLowerCase(),"/user/keybindings.json"))&&c.type==="array"){for(var p=[],y=0,T=c.items;y<T.length;y++){var L=T[y];if(L.type==="object")for(var q=0,W=L.properties;q<W.length;q++){var _=W[q];if(_.keyNode.value==="key"&&_.valueNode){var fe=Ne.create(n.uri,wo(n,L));if(p.push({name:So(_.valueNode),kind:vi.Function,location:fe}),h--,h<=0)return s&&s.onResultLimitExceeded&&s.onResultLimitExceeded(m),p}}}return p}var ae=function(ue,ye,Ae){return h>=0&&(ye.type==="array"?ye.items.forEach(function(we){return ae(ue,we,Ae)}):ye.type==="object"&&ye.properties.forEach(function(we){if(h>=0){var ke=we.valueNode;if(ke){h--;var Te=Ne.create(n.uri,wo(n,we)),De=Ae?Ae+"."+we.keyNode.value:we.keyNode.value;ue.push({name:u.getKeyLabel(we),kind:u.getSymbolKind(ke.type),location:Te,containerName:Ae}),ae(ue,ke,De)}}})),ue},oe=ae([],c,void 0);return h<0&&(oe.pop(),s&&s.onResultLimitExceeded&&s.onResultLimitExceeded(m)),oe},t.prototype.findDocumentSymbols2=function(n,i,s){var u=this;s===void 0&&(s={resultLimit:Number.MAX_VALUE});var c=i.root;if(!c)return null;var h=s.resultLimit,m=n.uri;if((m==="vscode://defaultsettings/keybindings.json"||ac(m.toLowerCase(),"/user/keybindings.json"))&&c.type==="array"){for(var p=[],y=0,T=c.items;y<T.length;y++){var L=T[y];if(L.type==="object")for(var q=0,W=L.properties;q<W.length;q++){var _=W[q];if(_.keyNode.value==="key"&&_.valueNode){var fe=wo(n,L),ae=wo(n,_.keyNode);if(p.push({name:So(_.valueNode),kind:vi.Function,range:fe,selectionRange:ae}),h--,h<=0)return s&&s.onResultLimitExceeded&&s.onResultLimitExceeded(m),p}}}return p}var oe=function(ye,Ae){return h>=0&&(Ae.type==="array"?Ae.items.forEach(function(we,ke){if(we&&h>=0){h--;var Te=wo(n,we),De=Te,pe=String(ke),Ie=oe([],we);ye.push({name:pe,kind:u.getSymbolKind(we.type),range:Te,selectionRange:De,children:Ie})}}):Ae.type==="object"&&Ae.properties.forEach(function(we){var ke=we.valueNode;if(ke&&h>=0){h--;var Te=wo(n,we),De=wo(n,we.keyNode),pe=oe([],ke);ye.push({name:u.getKeyLabel(we),kind:u.getSymbolKind(ke.type),range:Te,selectionRange:De,children:pe})}})),ye},ue=oe([],c);return h<0&&(ue.pop(),s&&s.onResultLimitExceeded&&s.onResultLimitExceeded(m)),ue},t.prototype.getSymbolKind=function(n){switch(n){case"object":return vi.Module;case"string":return vi.String;case"number":return vi.Number;case"array":return vi.Array;case"boolean":return vi.Boolean;default:return vi.Variable}},t.prototype.getKeyLabel=function(n){var i=n.keyNode.value;return i&&(i=i.replace(/[\n]/g,"\u21B5")),i&&i.trim()?i:'"'+i+'"'},t.prototype.findDocumentColors=function(n,i,s){return this.schemaService.getSchemaForResource(n.uri,i).then(function(u){var c=[];if(u)for(var h=s&&typeof s.resultLimit=="number"?s.resultLimit:Number.MAX_VALUE,m=i.getMatchingSchemas(u.schema),p={},y=0,T=m;y<T.length;y++){var L=T[y];if(!L.inverted&&L.schema&&(L.schema.format==="color"||L.schema.format==="color-hex")&&L.node&&L.node.type==="string"){var q=String(L.node.offset);if(!p[q]){var W=Th(So(L.node));if(W){var _=wo(n,L.node);c.push({color:W,range:_})}if(p[q]=!0,h--,h<=0)return s&&s.onResultLimitExceeded&&s.onResultLimitExceeded(n.uri),c}}}return c})},t.prototype.getColorPresentations=function(n,i,s,u){var c=[],h=Math.round(s.red*255),m=Math.round(s.green*255),p=Math.round(s.blue*255);function y(L){var q=L.toString(16);return q.length!==2?"0"+q:q}var T;return s.alpha===1?T="#"+y(h)+y(m)+y(p):T="#"+y(h)+y(m)+y(p)+y(Math.round(s.alpha*255)),c.push({label:T,textEdit:Mt.replace(u,JSON.stringify(T))}),c},t}();function wo(t,n){return Oe.create(t.positionAt(n.offset),t.positionAt(n.offset+n.length))}var Ph={schemaAssociations:{},schemas:{}};function Lh(t,n){var i=[],s=[],u=[],c=-1,h=yo(t.getText(),!1),m=h.scan();function p(Ie){i.push(Ie),s.push(u.length)}for(;m!==17;){switch(m){case 1:case 3:{var y=t.positionAt(h.getTokenOffset()).line,T={startLine:y,endLine:y,kind:m===1?"object":"array"};u.push(T);break}case 2:case 4:{var L=m===2?"object":"array";if(u.length>0&&u[u.length-1].kind===L){var T=u.pop(),q=t.positionAt(h.getTokenOffset()).line;T&&q>T.startLine+1&&c!==T.startLine&&(T.endLine=q-1,p(T),c=T.startLine)}break}case 13:{var y=t.positionAt(h.getTokenOffset()).line,W=t.positionAt(h.getTokenOffset()+h.getTokenLength()).line;h.getTokenError()===1&&y+1<t.lineCount?h.setPosition(t.offsetAt(Me.create(y+1,0))):y<W&&(p({startLine:y,endLine:W,kind:kt.Comment}),c=y);break}case 12:{var _=t.getText().substr(h.getTokenOffset(),h.getTokenLength()),fe=_.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(fe){var q=t.positionAt(h.getTokenOffset()).line;if(fe[1]){var T={startLine:q,endLine:q,kind:kt.Region};u.push(T)}else{for(var ae=u.length-1;ae>=0&&u[ae].kind!==kt.Region;)ae--;if(ae>=0){var T=u[ae];u.length=ae,q>T.startLine&&c!==T.startLine&&(T.endLine=q,p(T),c=T.startLine)}}}break}}m=h.scan()}var oe=n&&n.rangeLimit;if(typeof oe!="number"||i.length<=oe)return i;n&&n.onRangeLimitExceeded&&n.onRangeLimitExceeded(t.uri);for(var ue=[],ye=0,Ae=s;ye<Ae.length;ye++){var we=Ae[ye];we<30&&(ue[we]=(ue[we]||0)+1)}for(var ke=0,Te=0,ae=0;ae<ue.length;ae++){var De=ue[ae];if(De){if(De+ke>oe){Te=ae;break}ke+=De}}for(var pe=[],ae=0;ae<i.length;ae++){var we=s[ae];typeof we=="number"&&(we<Te||we===Te&&ke++<oe)&&pe.push(i[ae])}return pe}function Ih(t,n,i){function s(m){for(var p=t.offsetAt(m),y=i.getNodeFromOffset(p,!0),T=[];y;){switch(y.type){case"string":case"object":case"array":var L=y.offset+1,q=y.offset+y.length-1;L<q&&p>=L&&p<=q&&T.push(u(L,q)),T.push(u(y.offset,y.offset+y.length));break;case"number":case"boolean":case"null":case"property":T.push(u(y.offset,y.offset+y.length));break}if(y.type==="property"||y.parent&&y.parent.type==="array"){var W=h(y.offset+y.length,5);W!==-1&&T.push(u(y.offset,W))}y=y.parent}for(var _=void 0,fe=T.length-1;fe>=0;fe--)_=ju.create(T[fe],_);return _||(_=ju.create(Oe.create(m,m))),_}function u(m,p){return Oe.create(t.positionAt(m),t.positionAt(p))}var c=yo(t.getText(),!0);function h(m,p){c.setPosition(m);var y=c.scan();return y===p?c.getTokenOffset()+c.getTokenLength():-1}return n.map(s)}function Mh(t){var n=t.promiseConstructor||Promise,i=new Sh(t.schemaRequestService,t.workspaceContext,n);i.setSchemaContributions(Ph);var s=new ih(i,t.contributions,n,t.clientCapabilities),u=new oh(i,t.contributions,n),c=new kh(i),h=new wh(i,n);return{configure:function(m){i.clearExternalSchemas(),m.schemas&&m.schemas.forEach(function(p){i.registerExternalSchema(p.uri,p.fileMatch,p.schema)}),h.configure(m)},resetSchema:function(m){return i.onResourceChange(m)},doValidation:h.doValidation.bind(h),parseJSONDocument:function(m){return qd(m,{collectComments:!0})},newJSONDocument:function(m,p){return Zd(m,p)},doComplete:s.doComplete.bind(s),findDocumentSymbols:c.findDocumentSymbols.bind(c),findDocumentSymbols2:c.findDocumentSymbols2.bind(c),findColorSymbols:function(m,p){return c.findDocumentColors(m,p).then(function(y){return y.map(function(T){return T.range})})},findDocumentColors:c.findDocumentColors.bind(c),getColorPresentations:c.getColorPresentations.bind(c),doHover:u.doHover.bind(u),getFoldingRanges:Lh,getSelectionRanges:Ih,format:function(m,p,y){var T=void 0;if(p){var L=m.offsetAt(p.start),q=m.offsetAt(p.end)-L;T={offset:L,length:q}}var W={tabSize:y?y.tabSize:4,insertSpaces:y?y.insertSpaces:!0,eol:`
201
- `};return d(m.getText(),T,W).map(function(_){return Mt.replace(Oe.create(m.positionAt(_.offset),m.positionAt(_.offset+_.length)),_.content)})}}}var pd=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});let Co=null;ot.Qg&&(Co=f(46944),f(13156),f(82518),f(33201),f(77436),f(29641),f(71628),f(6766),f(49812),f(17664),f(83539));const Va=Mh({});Co&&(Co.registerHelper("lint","json",function(t,n){return pd(this,null,function*(){const{schema:i,setError:s}=n;Va.configure({validate:!0,schemas:[{uri:"stub://"+n.id,fileMatch:["*"],schema:i}]});const u=Wu.create(n.id+".json","json",0,t),c=Va.parseJSONDocument(u),h=yield Va.doValidation(u,c);return h.length?s&&s(h[0].message):s&&s(void 0),h.map(m=>({from:Co.Pos(m.range.start.line,m.range.start.character),to:Co.Pos(m.range.end.line,m.range.end.character),message:m.message}))})}),Co.registerHelper("hint","json",(t,n)=>pd(void 0,null,function*(){const i=n.schema;if(!i)return;Va.configure({validate:!0,schemas:[{uri:"stub://"+n.id,fileMatch:["*"],schema:i}]});const s=t.getDoc().getCursor(),u=t.getTokenAt(s),c=Wu.create(n.id+".json","json",0,t.getValue()),h=Va.parseJSONDocument(c),m=yield Va.doComplete(c,{line:s.line,character:s.ch},h),p=T=>{let L="";for(;T--;)L+=" ";return L};let y=m?m.items.map(T=>({text:T.insertText,displayText:T.label,filter:T.filterText||T.label,from:{line:T.textEdit.range.start.line,ch:T.textEdit.range.start.character},to:{line:T.textEdit.range.end.line,ch:T.textEdit.range.end.character},hint:(L,q,W)=>{const _="_$__REDOC_CURSOR_HERE";let fe=W.text.replace(/(\$1|\${1:[^}]+})/,_)||"";if(fe=fe.replace(/(\$\d+|\${[^}]+})/g,"")||"",L.setSelection(W.from,W.to),fe.indexOf(`
202
- `)>-1){const oe=L.getLine(L.getCursor().line).search(/(\S|$)/);fe=fe.replace(/\n/g,`
203
- `+p(oe))}L.replaceSelection(fe);const ae=L.getSearchCursor(_,W.from);ae.findNext()&&(L.setCursor(ae.from()),ae.replace(""))}})):[];return/(property|string)/.test(u.type||"")&&(y=y.filter(T=>T.filter.replace(/(^"|"$)/g,"").startsWith(u.string.replace(/(^"|"$)/g,"")))),{from:Co.Pos(s.line,u.start),to:Co.Pos(s.line,s.ch),list:y}})));const Nh=(0,Tt.vJ)`
204
- .cm-s-material.CodeMirror {
205
- background-color: var(--bg-overlay) !important;
206
- color: var(--code-block-text-color) !important;
207
- font-family: var(--code-block-font-family);
159
+ .cm-editor {
160
+ flex: 1;
161
+ color: var(--code-block-text-color);
162
+ border-radius: var(--panel-border-radius);
208
163
  font-weight: var(--code-block-font-weight);
209
164
  font-size: var(--code-block-font-size);
210
165
  line-height: var(--code-block-line-height);
211
166
  padding: var(--code-block-padding);
212
167
  white-space: var(--code-wrap, pre);
213
- }
214
-
215
- .CodeMirror-lint-mark-error {
216
- background-size: 4px;
217
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAAVUlEQVR42mNgQAL/GRjigPg/EP8FYntkCX4gtoVKgvE/BoabcEVAhj6S5DUgfgFl/wFJ2gPxL6iuT1DF+kD2R5AYA5KRj6CS/FAMYvszIBltz4AFAAD9fz0YtLg13wAAAABJRU5ErkJggg==') !important;
218
- }
219
168
 
220
- .cm-s-material .CodeMirror-code .cm-string.cm-property {
221
- color: var(--code-block-tokens-property-string-color);
222
- }
169
+ .cm-matchingBracket {
170
+ outline: 1px solid grey;
171
+ text-decoration: none;
172
+ color: var(--color-gold-8);
173
+ }
223
174
 
224
- .cm-s-material .CodeMirror-code .cm-string {
225
- color: var(--code-block-tokens-string-color);
226
- }
175
+ .cm-nonmatchingBracket {
176
+ color: var(--color-red-8) !important;
177
+ }
227
178
 
228
- .cm-s-material .CodeMirror-code .cm-atom {
229
- color: var(--text-secondary);
230
- }
179
+ .cm-activeLine {
180
+ background: none;
181
+ }
231
182
 
232
- div .cm-s-material .CodeMirror-matchingbracket {
233
- outline: 1px solid grey;
234
- text-decoration: none;
235
- color: var(--color-gold-8) !important;
183
+ .cm-lintPoint:after {
184
+ border: none;
185
+ width: 10px;
186
+ height: 8px;
187
+ left: 0;
188
+ bottom: -2px;
189
+ background-position: left bottom;
190
+ background-repeat: repeat-x;
191
+ background-size: 4px;
192
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAAVUlEQVR42mNgQAL/GRjigPg/EP8FYntkCX4gtoVKgvE/BoabcEVAhj6S5DUgfgFl/wFJ2gPxL6iuT1DF+kD2R5AYA5KRj6CS/FAMYvszIBltz4AFAAD9fz0YtLg13wAAAABJRU5ErkJggg==') !important;
193
+ }
236
194
  }
195
+ .cm-editor.cm-focused {
196
+ outline: none;
237
197
 
238
- div .cm-s-material .CodeMirror-nonmatchingbracket {
239
- color: var(--color-red-8) !important;
198
+ .cm-matchingBracket,
199
+ .cm-nonmatchingBracket {
200
+ background: none;
201
+ }
240
202
  }
203
+ `;function Ml(){return Ml=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Ml.apply(this,arguments)}var _v=r=>{var{theme:e,settings:t={},styles:n=[]}=r,i={".cm-gutters":{}},s={};t.background&&(s.backgroundColor=t.background),t.backgroundImage&&(s.backgroundImage=t.backgroundImage),t.foreground&&(s.color=t.foreground),(t.background||t.foreground)&&(i["&"]=s),t.fontFamily&&(i["&.cm-editor .cm-scroller"]={fontFamily:t.fontFamily}),t.gutterBackground&&(i[".cm-gutters"].backgroundColor=t.gutterBackground),t.gutterForeground&&(i[".cm-gutters"].color=t.gutterForeground),t.gutterBorder&&(i[".cm-gutters"].borderRightColor=t.gutterBorder),t.caret&&(i[".cm-content"]={caretColor:t.caret},i[".cm-cursor, .cm-dropCursor"]={borderLeftColor:t.caret});var o={};t.gutterActiveForeground&&(o.color=t.gutterActiveForeground),t.lineHighlight&&(i[".cm-activeLine"]={backgroundColor:t.lineHighlight},o.backgroundColor=t.lineHighlight),i[".cm-activeLineGutter"]=o,t.selection&&(i["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:t.selection+" !important"}),t.selectionMatch&&(i["& .cm-selectionMatch"]={backgroundColor:t.selectionMatch});var a=he.theme(i,{dark:e==="dark"}),l=as.define(n),c=[a,Nu(l)];return c};const d3=null;var QT={background:"#2e3235",foreground:"#bdbdbd",caret:"#a0a4ae",selection:"#d7d4f0",selectionMatch:"#d7d4f0",gutterBackground:"#2e3235",gutterForeground:"#999",gutterActiveForeground:"#4f5b66",lineHighlight:"#545b61"},p3=null,wf=r=>{var{theme:e="dark",settings:t={},styles:n=[]}=r||{};return _v({theme:e,settings:Ml({},QT,t),styles:[{tag:M.keyword,color:"#cf6edf"},{tag:[M.name,M.deleted,M.character,M.macroName],color:"#56c8d8"},{tag:[M.propertyName],color:"#facf4e"},{tag:[M.variableName],color:"#bdbdbd"},{tag:[M.function(M.variableName)],color:"#56c8d8"},{tag:[M.labelName],color:"#cf6edf"},{tag:[M.color,M.constant(M.name),M.standard(M.name)],color:"#facf4e"},{tag:[M.definition(M.name),M.separator],color:"#fa5788"},{tag:[M.brace],color:"#cf6edf"},{tag:[M.annotation],color:"#ff5f52"},{tag:[M.number,M.changed,M.annotation,M.modifier,M.self,M.namespace],color:"#ffad42"},{tag:[M.typeName,M.className],color:"#ffad42"},{tag:[M.operator,M.operatorKeyword],color:"#7186f0"},{tag:[M.tagName],color:"#99d066"},{tag:[M.squareBracket],color:"#ff5f52"},{tag:[M.angleBracket],color:"#606f7a"},{tag:[M.attributeName],color:"#bdbdbd"},{tag:[M.regexp],color:"#ff5f52"},{tag:[M.quote],color:"#6abf69"},{tag:[M.string],color:"#99d066"},{tag:M.link,color:"#56c8d8",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[M.url,M.escape,M.special(M.string)],color:"#facf4e"},{tag:[M.meta],color:"#707d8b"},{tag:[M.comment],color:"#707d8b",fontStyle:"italic"},{tag:M.monospace,color:"#bdbdbd"},{tag:M.strong,fontWeight:"bold",color:"#ff5f52"},{tag:M.emphasis,fontStyle:"italic",color:"#99d066"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.heading,fontWeight:"bold",color:"#facf4e"},{tag:M.heading1,fontWeight:"bold",color:"#facf4e"},{tag:[M.heading2,M.heading3,M.heading4],fontWeight:"bold",color:"#facf4e"},{tag:[M.heading5,M.heading6],color:"#facf4e"},{tag:[M.atom,M.bool,M.special(M.variableName)],color:"#56c8d8"},{tag:[M.processingInstruction,M.inserted],color:"#ff5f52"},{tag:[M.contentSeparator],color:"#56c8d8"},{tag:M.invalid,color:"#606f7a",borderBottom:"1px dotted #ff5f52"},...n]})},XT=wf,g3=wf(),m3=wf(),ZT={background:"#FAFAFA",foreground:"#90A4AE",caret:"#272727",selection:"#80CBC440",selectionMatch:"#FAFAFA",gutterBackground:"#FAFAFA",gutterForeground:"#90A4AE",gutterBorder:"transparent",lineHighlight:"#CCD7DA50"},Sf=r=>{var{theme:e="light",settings:t={},styles:n=[]}=r||{};return _v({theme:e,settings:Ml({},ZT,t),styles:[{tag:M.keyword,color:"#39ADB5"},{tag:[M.name,M.deleted,M.character,M.macroName],color:"#90A4AE"},{tag:[M.propertyName],color:"#6182B8"},{tag:[M.processingInstruction,M.string,M.inserted,M.special(M.string)],color:"#91B859"},{tag:[M.function(M.variableName),M.labelName],color:"#6182B8"},{tag:[M.color,M.constant(M.name),M.standard(M.name)],color:"#39ADB5"},{tag:[M.definition(M.name),M.separator],color:"#90A4AE"},{tag:[M.className],color:"#E2931D"},{tag:[M.number,M.changed,M.annotation,M.modifier,M.self,M.namespace],color:"#F76D47"},{tag:[M.typeName],color:"#E2931D",fontStyle:"#E2931D"},{tag:[M.operator,M.operatorKeyword],color:"#39ADB5"},{tag:[M.url,M.escape,M.regexp,M.link],color:"#91B859"},{tag:[M.meta,M.comment],color:"#90A4AE"},{tag:M.strong,fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,fontWeight:"bold",color:"#39ADB5"},{tag:[M.atom,M.bool,M.special(M.variableName)],color:"#90A4AE"},{tag:M.invalid,color:"#E5393570"},{tag:M.strikethrough,textDecoration:"line-through"},...n]})},v3=Sf();function Il(r,e){e===void 0&&(e=!1);var t=r.length,n=0,i="",s=0,o=16,a=0,l=0,c=0,u=0,h=0;function d(P,L){for(var D=0,j=0;D<P||!L;){var W=r.charCodeAt(n);if(W>=48&&W<=57)j=j*16+W-48;else if(W>=65&&W<=70)j=j*16+W-65+10;else if(W>=97&&W<=102)j=j*16+W-97+10;else break;n++,D++}return D<P&&(j=-1),j}function p(P){n=P,i="",s=0,o=16,h=0}function m(){var P=n;if(r.charCodeAt(n)===48)n++;else for(n++;n<r.length&&ys(r.charCodeAt(n));)n++;if(n<r.length&&r.charCodeAt(n)===46)if(n++,n<r.length&&ys(r.charCodeAt(n)))for(n++;n<r.length&&ys(r.charCodeAt(n));)n++;else return h=3,r.substring(P,n);var L=n;if(n<r.length&&(r.charCodeAt(n)===69||r.charCodeAt(n)===101))if(n++,(n<r.length&&r.charCodeAt(n)===43||r.charCodeAt(n)===45)&&n++,n<r.length&&ys(r.charCodeAt(n))){for(n++;n<r.length&&ys(r.charCodeAt(n));)n++;L=n}else h=3;return r.substring(P,L)}function y(){for(var P="",L=n;;){if(n>=t){P+=r.substring(L,n),h=2;break}var D=r.charCodeAt(n);if(D===34){P+=r.substring(L,n),n++;break}if(D===92){if(P+=r.substring(L,n),n++,n>=t){h=2;break}var j=r.charCodeAt(n++);switch(j){case 34:P+='"';break;case 92:P+="\\";break;case 47:P+="/";break;case 98:P+="\b";break;case 102:P+="\f";break;case 110:P+=`
204
+ `;break;case 114:P+="\r";break;case 116:P+=" ";break;case 117:var W=d(4,!0);W>=0?P+=String.fromCharCode(W):h=4;break;default:h=5}L=n;continue}if(D>=0&&D<=31)if(Po(D)){P+=r.substring(L,n),h=2;break}else h=6;n++}return P}function w(){if(i="",h=0,s=n,l=a,u=c,n>=t)return s=t,o=17;var P=r.charCodeAt(n);if(kf(P)){do n++,i+=String.fromCharCode(P),P=r.charCodeAt(n);while(kf(P));return o=15}if(Po(P))return n++,i+=String.fromCharCode(P),P===13&&r.charCodeAt(n)===10&&(n++,i+=`
205
+ `),a++,c=n,o=14;switch(P){case 123:return n++,o=1;case 125:return n++,o=2;case 91:return n++,o=3;case 93:return n++,o=4;case 58:return n++,o=6;case 44:return n++,o=5;case 34:return n++,i=y(),o=10;case 47:var L=n-1;if(r.charCodeAt(n+1)===47){for(n+=2;n<t&&!Po(r.charCodeAt(n));)n++;return i=r.substring(L,n),o=12}if(r.charCodeAt(n+1)===42){n+=2;for(var D=t-1,j=!1;n<D;){var W=r.charCodeAt(n);if(W===42&&r.charCodeAt(n+1)===47){n+=2,j=!0;break}n++,Po(W)&&(W===13&&r.charCodeAt(n)===10&&n++,a++,c=n)}return j||(n++,h=1),i=r.substring(L,n),o=13}return i+=String.fromCharCode(P),n++,o=16;case 45:if(i+=String.fromCharCode(P),n++,n===t||!ys(r.charCodeAt(n)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;n<t&&A(P);)n++,P=r.charCodeAt(n);if(s!==n){switch(i=r.substring(s,n),i){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return i+=String.fromCharCode(P),n++,o=16}}function A(P){if(kf(P)||Po(P))return!1;switch(P){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function T(){var P;do P=w();while(P>=12&&P<=15);return P}return{setPosition:p,getPosition:function(){return n},scan:e?T:w,getToken:function(){return o},getTokenValue:function(){return i},getTokenOffset:function(){return s},getTokenLength:function(){return n-s},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return s-u},getTokenError:function(){return h}}}function kf(r){return r===32||r===9||r===11||r===12||r===160||r===5760||r>=8192&&r<=8203||r===8239||r===8287||r===12288||r===65279}function Po(r){return r===10||r===13||r===8232||r===8233}function ys(r){return r>=48&&r<=57}function _T(r,e,t){var n,i,s,o,a;if(e){for(o=e.offset,a=o+e.length,s=o;s>0&&!qv(r,s-1);)s--;for(var l=a;l<r.length&&!qv(r,l);)l++;i=r.substring(s,l),n=qT(i,t)}else i=r,n=0,s=0,o=0,a=r.length;var c=eP(t,r),u=!1,h=0,d;t.insertSpaces?d=Af(" ",t.tabSize||4):d=" ";var p=Il(i,!1),m=!1;function y(){return c+Af(d,n+h)}function w(){var Q=p.scan();for(u=!1;Q===15||Q===14;)u=u||Q===14,Q=p.scan();return m=Q===16||p.getTokenError()!==0,Q}var A=[];function T(Q,oe,fe){!m&&oe<a&&fe>o&&r.substring(oe,fe)!==Q&&A.push({offset:oe,length:fe-oe,content:Q})}var P=w();if(P!==17){var L=p.getTokenOffset()+s,D=Af(d,n);T(D,s,L)}for(;P!==17;){for(var j=p.getTokenOffset()+p.getTokenLength()+s,W=w(),q="";!u&&(W===12||W===13);){var F=p.getTokenOffset()+s;T(" ",j,F),j=p.getTokenOffset()+p.getTokenLength()+s,q=W===12?y():"",W=w()}if(W===2)P!==1&&(h--,q=y());else if(W===4)P!==3&&(h--,q=y());else{switch(P){case 3:case 1:h++,q=y();break;case 5:case 12:q=y();break;case 13:u?q=y():q=" ";break;case 6:q=" ";break;case 10:if(W===6){q="";break}case 7:case 8:case 9:case 11:case 2:case 4:W===12||W===13?q=" ":W!==5&&W!==17&&(m=!0);break;case 16:m=!0;break}u&&(W===12||W===13)&&(q=y())}var H=p.getTokenOffset()+s;T(q,j,H),P=W}return A}function Af(r,e){for(var t="",n=0;n<e;n++)t+=r;return t}function qT(r,e){for(var t=0,n=0,i=e.tabSize||4;t<r.length;){var s=r.charAt(t);if(s===" ")n++;else if(s===" ")n+=i;else break;t++}return Math.floor(n/i)}function eP(r,e){for(var t=0;t<e.length;t++){var n=e.charAt(t);if(n==="\r")return t+1<e.length&&e.charAt(t+1)===`
206
+ `?`\r
207
+ `:"\r";if(n===`
208
+ `)return`
209
+ `}return r&&r.eol||`
210
+ `}function qv(r,e){return`\r
211
+ `.indexOf(r.charAt(e))!==-1}var Mo;(function(r){r.DEFAULT={allowTrailingComma:!1}})(Mo||(Mo={}));function tP(r,e){var t=[],n=new Object,i=void 0,s={value:{},offset:0,length:0,type:"object",parent:void 0},o=!1;function a(l,c,u,h){s.value=l,s.offset=c,s.length=u,s.type=h,s.colonOffset=void 0,i=s}try{Dl(r,{onObjectBegin:function(l,c){if(e<=l)throw n;i=void 0,o=e>l,t.push("")},onObjectProperty:function(l,c,u){if(e<c||(a(l,c,u,"property"),t[t.length-1]=l,e<=c+u))throw n},onObjectEnd:function(l,c){if(e<=l)throw n;i=void 0,t.pop()},onArrayBegin:function(l,c){if(e<=l)throw n;i=void 0,t.push(0)},onArrayEnd:function(l,c){if(e<=l)throw n;i=void 0,t.pop()},onLiteralValue:function(l,c,u){if(e<c||(a(l,c,u,ry(l)),e<=c+u))throw n},onSeparator:function(l,c,u){if(e<=c)throw n;if(l===":"&&i&&i.type==="property")i.colonOffset=c,o=!1,i=void 0;else if(l===","){var h=t[t.length-1];typeof h=="number"?t[t.length-1]=h+1:(o=!0,t[t.length-1]=""),i=void 0}}})}catch(l){if(l!==n)throw l}return{path:t,previousNode:i,isAtPropertyKey:o,matches:function(l){for(var c=0,u=0;c<l.length&&u<t.length;u++)if(l[c]===t[u]||l[c]==="*")c++;else if(l[c]!=="**")return!1;return c===l.length}}}function rP(r,e,t){e===void 0&&(e=[]),t===void 0&&(t=Mo.DEFAULT);var n=null,i=[],s=[];function o(l){Array.isArray(i)?i.push(l):n!==null&&(i[n]=l)}var a={onObjectBegin:function(){var l={};o(l),s.push(i),i=l,n=null},onObjectProperty:function(l){n=l},onObjectEnd:function(){i=s.pop()},onArrayBegin:function(){var l=[];o(l),s.push(i),i=l,n=null},onArrayEnd:function(){i=s.pop()},onLiteralValue:o,onError:function(l,c,u){e.push({error:l,offset:c,length:u})}};return Dl(r,a,t),i[0]}function nP(r,e,t){e===void 0&&(e=[]),t===void 0&&(t=Mo.DEFAULT);var n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function i(l){n.type==="property"&&(n.length=l-n.offset,n=n.parent)}function s(l){return n.children.push(l),l}var o={onObjectBegin:function(l){n=s({type:"object",offset:l,length:-1,parent:n,children:[]})},onObjectProperty:function(l,c,u){n=s({type:"property",offset:c,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:l,offset:c,length:u,parent:n})},onObjectEnd:function(l,c){i(l+c),n.length=l+c-n.offset,n=n.parent,i(l+c)},onArrayBegin:function(l,c){n=s({type:"array",offset:l,length:-1,parent:n,children:[]})},onArrayEnd:function(l,c){n.length=l+c-n.offset,n=n.parent,i(l+c)},onLiteralValue:function(l,c,u){s({type:ry(l),offset:c,length:u,parent:n,value:l}),i(c+u)},onSeparator:function(l,c,u){n.type==="property"&&(l===":"?n.colonOffset=c:l===","&&i(c))},onError:function(l,c,u){e.push({error:l,offset:c,length:u})}};Dl(r,o,t);var a=n.children[0];return a&&delete a.parent,a}function iP(r,e){if(r){for(var t=r,n=0,i=e;n<i.length;n++){var s=i[n];if(typeof s=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;for(var o=!1,a=0,l=t.children;a<l.length;a++){var c=l[a];if(Array.isArray(c.children)&&c.children[0].value===s){t=c.children[1],o=!0;break}}if(!o)return}else{var u=s;if(t.type!=="array"||u<0||!Array.isArray(t.children)||u>=t.children.length)return;t=t.children[u]}}return t}}function ey(r){if(!r.parent||!r.parent.children)return[];var e=ey(r.parent);if(r.parent.type==="property"){var t=r.parent.children[0].value;e.push(t)}else if(r.parent.type==="array"){var n=r.parent.children.indexOf(r);n!==-1&&e.push(n)}return e}function Cf(r){switch(r.type){case"array":return r.children.map(Cf);case"object":for(var e=Object.create(null),t=0,n=r.children;t<n.length;t++){var i=n[t],s=i.children[1];s&&(e[i.children[0].value]=Cf(s))}return e;case"null":case"string":case"number":case"boolean":return r.value;default:return}}function sP(r,e,t){return t===void 0&&(t=!1),e>=r.offset&&e<r.offset+r.length||t&&e===r.offset+r.length}function ty(r,e,t){if(t===void 0&&(t=!1),sP(r,e,t)){var n=r.children;if(Array.isArray(n))for(var i=0;i<n.length&&n[i].offset<=e;i++){var s=ty(n[i],e,t);if(s)return s}return r}}function Dl(r,e,t){t===void 0&&(t=Mo.DEFAULT);var n=Il(r,!1);function i(F){return F?function(){return F(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}function s(F){return F?function(H){return F(H,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}var o=i(e.onObjectBegin),a=s(e.onObjectProperty),l=i(e.onObjectEnd),c=i(e.onArrayBegin),u=i(e.onArrayEnd),h=s(e.onLiteralValue),d=s(e.onSeparator),p=i(e.onComment),m=s(e.onError),y=t&&t.disallowComments,w=t&&t.allowTrailingComma;function A(){for(;;){var F=n.scan();switch(n.getTokenError()){case 4:T(14);break;case 5:T(15);break;case 3:T(13);break;case 1:y||T(11);break;case 2:T(12);break;case 6:T(16);break}switch(F){case 12:case 13:y?T(10):p();break;case 16:T(1);break;case 15:case 14:break;default:return F}}}function T(F,H,Q){if(H===void 0&&(H=[]),Q===void 0&&(Q=[]),m(F),H.length+Q.length>0)for(var oe=n.getToken();oe!==17;){if(H.indexOf(oe)!==-1){A();break}else if(Q.indexOf(oe)!==-1)break;oe=A()}}function P(F){var H=n.getTokenValue();return F?h(H):a(H),A(),!0}function L(){switch(n.getToken()){case 11:var F=n.getTokenValue(),H=Number(F);isNaN(H)&&(T(2),H=0),h(H);break;case 7:h(null);break;case 8:h(!0);break;case 9:h(!1);break;default:return!1}return A(),!0}function D(){return n.getToken()!==10?(T(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(d(":"),A(),q()||T(4,[],[2,5])):T(5,[],[2,5]),!0)}function j(){o(),A();for(var F=!1;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(F||T(4,[],[]),d(","),A(),n.getToken()===2&&w)break}else F&&T(6,[],[]);D()||T(4,[],[2,5]),F=!0}return l(),n.getToken()!==2?T(7,[2],[]):A(),!0}function W(){c(),A();for(var F=!1;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(F||T(4,[],[]),d(","),A(),n.getToken()===4&&w)break}else F&&T(6,[],[]);q()||T(4,[],[4,5]),F=!0}return u(),n.getToken()!==4?T(8,[4],[]):A(),!0}function q(){switch(n.getToken()){case 3:return W();case 1:return j();case 10:return P(!0);default:return L()}}return A(),n.getToken()===17?t.allowEmptyContent?!0:(T(4,[],[]),!1):q()?(n.getToken()!==17&&T(9,[],[]),!0):(T(4,[],[]),!1)}function oP(r,e){var t=Il(r),n=[],i,s=0,o;do switch(o=t.getPosition(),i=t.scan(),i){case 12:case 13:case 17:s!==o&&n.push(r.substring(s,o)),e!==void 0&&n.push(t.getTokenValue().replace(/[^\r\n]/g,e)),s=t.getPosition();break}while(i!==17);return n.join("")}function ry(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(r){if(Array.isArray(r))return"array"}else return"null";return"object"}default:return"null"}}function y3(r,e,t){return aP(r,e,void 0,t)}function aP(r,e,t,n){for(var i,s=e.slice(),o=[],a=parseTree(r,o),l=void 0,c=void 0;s.length>0&&(c=s.pop(),l=findNodeAtLocation(a,s),l===void 0&&t!==void 0);)typeof c=="string"?t=(i={},i[c]=t,i):t=[t];if(l)if(l.type==="object"&&typeof c=="string"&&Array.isArray(l.children)){var u=findNodeAtLocation(l,[c]);if(u!==void 0)if(t===void 0){if(!u.parent)throw new Error("Malformed AST");var h=l.children.indexOf(u.parent),d=void 0,p=u.parent.offset+u.parent.length;if(h>0){var m=l.children[h-1];d=m.offset+m.length}else if(d=l.offset+1,l.children.length>1){var y=l.children[1];p=y.offset}return Mi(r,{offset:d,length:p-d,content:""},n)}else return Mi(r,{offset:u.offset,length:u.length,content:JSON.stringify(t)},n);else{if(t===void 0)return[];var w=JSON.stringify(c)+": "+JSON.stringify(t),A=n.getInsertionIndex?n.getInsertionIndex(l.children.map(function(F){return F.children[0].value})):l.children.length,T=void 0;if(A>0){var m=l.children[A-1];T={offset:m.offset+m.length,length:0,content:","+w}}else l.children.length===0?T={offset:l.offset+1,length:0,content:w}:T={offset:l.offset+1,length:0,content:w+","};return Mi(r,T,n)}}else if(l.type==="array"&&typeof c=="number"&&Array.isArray(l.children)){var P=c;if(P===-1){var w=""+JSON.stringify(t),T=void 0;if(l.children.length===0)T={offset:l.offset+1,length:0,content:w};else{var m=l.children[l.children.length-1];T={offset:m.offset+m.length,length:0,content:","+w}}return Mi(r,T,n)}else if(t===void 0&&l.children.length>=0){var L=c,D=l.children[L],T=void 0;if(l.children.length===1)T={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===L){var m=l.children[L-1],j=m.offset+m.length,W=l.offset+l.length;T={offset:j,length:W-2-j,content:""}}else T={offset:D.offset,length:l.children[L+1].offset-D.offset,content:""};return Mi(r,T,n)}else if(t!==void 0){var T=void 0,w=""+JSON.stringify(t);if(!n.isArrayInsertion&&l.children.length>c){var q=l.children[c];T={offset:q.offset,length:q.length,content:w}}else if(l.children.length===0||c===0)T={offset:l.offset+1,length:0,content:l.children.length===0?w:w+","};else{var A=c>l.children.length?l.children.length:c,m=l.children[A-1];T={offset:m.offset+m.length,length:0,content:","+w}}return Mi(r,T,n)}else throw new Error("Can not "+(t===void 0?"remove":n.isArrayInsertion?"insert":"modify")+" Array index "+P+" as length is not sufficient")}else throw new Error("Can not add "+(typeof c!="number"?"index":"property")+" to parent of type "+l.type);else{if(t===void 0)throw new Error("Can not delete in empty document");return Mi(r,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(t)},n)}}function Mi(r,e,t){if(!t.formattingOptions)return[e];var n=ny(r,e),i=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;i>0&&!isEOL(n,i-1);)i--;for(;s<n.length&&!isEOL(n,s);)s++}for(var o=format(n,{offset:i,length:s-i},t.formattingOptions),a=o.length-1;a>=0;a--){var l=o[a];n=ny(n,l),i=Math.min(i,l.offset),s=Math.max(s,l.offset+l.length),s+=l.content.length-l.length}var c=r.length-(n.length-s)-i;return[{offset:i,length:c,content:n.substring(i,s)}]}function ny(r,e){return r.substring(0,e.offset)+e.content+r.substring(e.offset+e.length)}function b3(r,e){return`\r
212
+ `.indexOf(r.charAt(e))!==-1}var bs=Il,x3=tP,lP=rP,w3=nP,S3=iP,cP=ty,uP=ey,fP=Cf,k3=Dl,A3=oP;function C3(r){switch(r){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 hP(r,e,t){return _T(r,e,t)}function O3(r,e,t,n){return edit.setProperty(r,e,t,n)}function E3(r,e){for(var t=e.length-1;t>=0;t--)r=edit.applyEdit(r,e[t]);return r}function Io(r,e){if(r===e)return!0;if(r==null||e===null||e===void 0||typeof r!=typeof e||typeof r!="object"||Array.isArray(r)!==Array.isArray(e))return!1;var t,n;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(t=0;t<r.length;t++)if(!Io(r[t],e[t]))return!1}else{var i=[];for(n in r)i.push(n);i.sort();var s=[];for(n in e)s.push(n);if(s.sort(),!Io(i,s))return!1;for(t=0;t<i.length;t++)if(!Io(r[i[t]],e[i[t]]))return!1}return!0}function kr(r){return typeof r=="number"}function Tn(r){return typeof r<"u"}function gn(r){return typeof r=="boolean"}function dP(r){return typeof r=="string"}var iy;(function(r){function e(t){return typeof t=="string"}r.is=e})(iy||(iy={}));var Of;(function(r){function e(t){return typeof t=="string"}r.is=e})(Of||(Of={}));var sy;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&r.MIN_VALUE<=t&&t<=r.MAX_VALUE}r.is=e})(sy||(sy={}));var Nl;(function(r){r.MIN_VALUE=0,r.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&r.MIN_VALUE<=t&&t<=r.MAX_VALUE}r.is=e})(Nl||(Nl={}));var Br;(function(r){function e(n,i){return n===Number.MAX_VALUE&&(n=Nl.MAX_VALUE),i===Number.MAX_VALUE&&(i=Nl.MAX_VALUE),{line:n,character:i}}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&J.uinteger(i.line)&&J.uinteger(i.character)}r.is=t})(Br||(Br={}));var Ue;(function(r){function e(n,i,s,o){if(J.uinteger(n)&&J.uinteger(i)&&J.uinteger(s)&&J.uinteger(o))return{start:Br.create(n,i),end:Br.create(s,o)};if(Br.is(n)&&Br.is(i))return{start:n,end:i};throw new Error("Range#create called with invalid arguments[".concat(n,", ").concat(i,", ").concat(s,", ").concat(o,"]"))}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&Br.is(i.start)&&Br.is(i.end)}r.is=t})(Ue||(Ue={}));var xs;(function(r){function e(n,i){return{uri:n,range:i}}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&Ue.is(i.range)&&(J.string(i.uri)||J.undefined(i.uri))}r.is=t})(xs||(xs={}));var oy;(function(r){function e(n,i,s,o){return{targetUri:n,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&Ue.is(i.targetRange)&&J.string(i.targetUri)&&Ue.is(i.targetSelectionRange)&&(Ue.is(i.originSelectionRange)||J.undefined(i.originSelectionRange))}r.is=t})(oy||(oy={}));var Ef;(function(r){function e(n,i,s,o){return{red:n,green:i,blue:s,alpha:o}}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&J.numberRange(i.red,0,1)&&J.numberRange(i.green,0,1)&&J.numberRange(i.blue,0,1)&&J.numberRange(i.alpha,0,1)}r.is=t})(Ef||(Ef={}));var ay;(function(r){function e(n,i){return{range:n,color:i}}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&Ue.is(i.range)&&Ef.is(i.color)}r.is=t})(ay||(ay={}));var ly;(function(r){function e(n,i,s){return{label:n,textEdit:i,additionalTextEdits:s}}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&J.string(i.label)&&(J.undefined(i.textEdit)||Fr.is(i))&&(J.undefined(i.additionalTextEdits)||J.typedArray(i.additionalTextEdits,Fr.is))}r.is=t})(ly||(ly={}));var Do;(function(r){r.Comment="comment",r.Imports="imports",r.Region="region"})(Do||(Do={}));var cy;(function(r){function e(n,i,s,o,a,l){var c={startLine:n,endLine:i};return J.defined(s)&&(c.startCharacter=s),J.defined(o)&&(c.endCharacter=o),J.defined(a)&&(c.kind=a),J.defined(l)&&(c.collapsedText=l),c}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&J.uinteger(i.startLine)&&J.uinteger(i.startLine)&&(J.undefined(i.startCharacter)||J.uinteger(i.startCharacter))&&(J.undefined(i.endCharacter)||J.uinteger(i.endCharacter))&&(J.undefined(i.kind)||J.string(i.kind))}r.is=t})(cy||(cy={}));var Tf;(function(r){function e(n,i){return{location:n,message:i}}r.create=e;function t(n){var i=n;return J.defined(i)&&xs.is(i.location)&&J.string(i.message)}r.is=t})(Tf||(Tf={}));var Ie;(function(r){r.Error=1,r.Warning=2,r.Information=3,r.Hint=4})(Ie||(Ie={}));var uy;(function(r){r.Unnecessary=1,r.Deprecated=2})(uy||(uy={}));var fy;(function(r){function e(t){var n=t;return J.objectLiteral(n)&&J.string(n.href)}r.is=e})(fy||(fy={}));var Pn;(function(r){function e(n,i,s,o,a,l){var c={range:n,message:i};return J.defined(s)&&(c.severity=s),J.defined(o)&&(c.code=o),J.defined(a)&&(c.source=a),J.defined(l)&&(c.relatedInformation=l),c}r.create=e;function t(n){var i,s=n;return J.defined(s)&&Ue.is(s.range)&&J.string(s.message)&&(J.number(s.severity)||J.undefined(s.severity))&&(J.integer(s.code)||J.string(s.code)||J.undefined(s.code))&&(J.undefined(s.codeDescription)||J.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(J.string(s.source)||J.undefined(s.source))&&(J.undefined(s.relatedInformation)||J.typedArray(s.relatedInformation,Tf.is))}r.is=t})(Pn||(Pn={}));var ws;(function(r){function e(n,i){for(var s=[],o=2;o<arguments.length;o++)s[o-2]=arguments[o];var a={title:n,command:i};return J.defined(s)&&s.length>0&&(a.arguments=s),a}r.create=e;function t(n){var i=n;return J.defined(i)&&J.string(i.title)&&J.string(i.command)}r.is=t})(ws||(ws={}));var Fr;(function(r){function e(s,o){return{range:s,newText:o}}r.replace=e;function t(s,o){return{range:{start:s,end:s},newText:o}}r.insert=t;function n(s){return{range:s,newText:""}}r.del=n;function i(s){var o=s;return J.objectLiteral(o)&&J.string(o.newText)&&Ue.is(o.range)}r.is=i})(Fr||(Fr={}));var Ss;(function(r){function e(n,i,s){var o={label:n};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&J.string(i.label)&&(J.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(J.string(i.description)||i.description===void 0)}r.is=t})(Ss||(Ss={}));var Zt;(function(r){function e(t){var n=t;return J.string(n)}r.is=e})(Zt||(Zt={}));var ri;(function(r){function e(s,o,a){return{range:s,newText:o,annotationId:a}}r.replace=e;function t(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}r.insert=t;function n(s,o){return{range:s,newText:"",annotationId:o}}r.del=n;function i(s){var o=s;return Fr.is(o)&&(Ss.is(o.annotationId)||Zt.is(o.annotationId))}r.is=i})(ri||(ri={}));var Rl;(function(r){function e(n,i){return{textDocument:n,edits:i}}r.create=e;function t(n){var i=n;return J.defined(i)&&Bl.is(i.textDocument)&&Array.isArray(i.edits)}r.is=t})(Rl||(Rl={}));var No;(function(r){function e(n,i,s){var o={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}r.create=e;function t(n){var i=n;return i&&i.kind==="create"&&J.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||J.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||J.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Zt.is(i.annotationId))}r.is=t})(No||(No={}));var Ro;(function(r){function e(n,i,s,o){var a={kind:"rename",oldUri:n,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}r.create=e;function t(n){var i=n;return i&&i.kind==="rename"&&J.string(i.oldUri)&&J.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||J.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||J.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Zt.is(i.annotationId))}r.is=t})(Ro||(Ro={}));var Lo;(function(r){function e(n,i,s){var o={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}r.create=e;function t(n){var i=n;return i&&i.kind==="delete"&&J.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||J.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||J.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Zt.is(i.annotationId))}r.is=t})(Lo||(Lo={}));var Pf;(function(r){function e(t){var n=t;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(function(i){return J.string(i.kind)?No.is(i)||Ro.is(i)||Lo.is(i):Rl.is(i)}))}r.is=e})(Pf||(Pf={}));var Ll=function(){function r(e,t){this.edits=e,this.changeAnnotations=t}return r.prototype.insert=function(e,t,n){var i,s;if(n===void 0?i=Fr.insert(e,t):Zt.is(n)?(s=n,i=ri.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(n),i=ri.insert(e,t,s)),this.edits.push(i),s!==void 0)return s},r.prototype.replace=function(e,t,n){var i,s;if(n===void 0?i=Fr.replace(e,t):Zt.is(n)?(s=n,i=ri.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(n),i=ri.replace(e,t,s)),this.edits.push(i),s!==void 0)return s},r.prototype.delete=function(e,t){var n,i;if(t===void 0?n=Fr.del(e):Zt.is(t)?(i=t,n=ri.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(t),n=ri.del(e,i)),this.edits.push(n),i!==void 0)return i},r.prototype.add=function(e){this.edits.push(e)},r.prototype.all=function(){return this.edits},r.prototype.clear=function(){this.edits.splice(0,this.edits.length)},r.prototype.assertChangeAnnotations=function(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},r}(),hy=function(){function r(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}return r.prototype.all=function(){return this._annotations},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),r.prototype.manage=function(e,t){var n;if(Zt.is(e)?n=e:(n=this.nextId(),t=e),this._annotations[n]!==void 0)throw new Error("Id ".concat(n," is already in use."));if(t===void 0)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},r.prototype.nextId=function(){return this._counter++,this._counter.toString()},r}(),T3=function(){function r(e){var t=this;this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new hy(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(function(n){if(Rl.is(n)){var i=new Ll(n.edits,t._changeAnnotations);t._textEditChanges[n.textDocument.uri]=i}})):e.changes&&Object.keys(e.changes).forEach(function(n){var i=new Ll(e.changes[n]);t._textEditChanges[n]=i})):this._workspaceEdit={}}return Object.defineProperty(r.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}),r.prototype.getTextEditChange=function(e){if(Bl.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version},n=this._textEditChanges[t.uri];if(!n){var i=[],s={textDocument:t,edits:i};this._workspaceEdit.documentChanges.push(s),n=new Ll(i,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var n=this._textEditChanges[e];if(!n){var i=[];this._workspaceEdit.changes[e]=i,n=new Ll(i),this._textEditChanges[e]=n}return n}},r.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new hy,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},r.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},r.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i;Ss.is(t)||Zt.is(t)?i=t:n=t;var s,o;if(i===void 0?s=No.create(e,n):(o=Zt.is(i)?i:this._changeAnnotations.manage(i),s=No.create(e,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o},r.prototype.renameFile=function(e,t,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Ss.is(n)||Zt.is(n)?s=n:i=n;var o,a;if(s===void 0?o=Ro.create(e,t,i):(a=Zt.is(s)?s:this._changeAnnotations.manage(s),o=Ro.create(e,t,i,a)),this._workspaceEdit.documentChanges.push(o),a!==void 0)return a},r.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i;Ss.is(t)||Zt.is(t)?i=t:n=t;var s,o;if(i===void 0?s=Lo.create(e,n):(o=Zt.is(i)?i:this._changeAnnotations.manage(i),s=Lo.create(e,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o},r}(),dy;(function(r){function e(n){return{uri:n}}r.create=e;function t(n){var i=n;return J.defined(i)&&J.string(i.uri)}r.is=t})(dy||(dy={}));var py;(function(r){function e(n,i){return{uri:n,version:i}}r.create=e;function t(n){var i=n;return J.defined(i)&&J.string(i.uri)&&J.integer(i.version)}r.is=t})(py||(py={}));var Bl;(function(r){function e(n,i){return{uri:n,version:i}}r.create=e;function t(n){var i=n;return J.defined(i)&&J.string(i.uri)&&(i.version===null||J.integer(i.version))}r.is=t})(Bl||(Bl={}));var gy;(function(r){function e(n,i,s,o){return{uri:n,languageId:i,version:s,text:o}}r.create=e;function t(n){var i=n;return J.defined(i)&&J.string(i.uri)&&J.string(i.languageId)&&J.integer(i.version)&&J.string(i.text)}r.is=t})(gy||(gy={}));var Ii;(function(r){r.PlainText="plaintext",r.Markdown="markdown";function e(t){var n=t;return n===r.PlainText||n===r.Markdown}r.is=e})(Ii||(Ii={}));var Bo;(function(r){function e(t){var n=t;return J.objectLiteral(t)&&Ii.is(n.kind)&&J.string(n.value)}r.is=e})(Bo||(Bo={}));var Ar;(function(r){r.Text=1,r.Method=2,r.Function=3,r.Constructor=4,r.Field=5,r.Variable=6,r.Class=7,r.Interface=8,r.Module=9,r.Property=10,r.Unit=11,r.Value=12,r.Enum=13,r.Keyword=14,r.Snippet=15,r.Color=16,r.File=17,r.Reference=18,r.Folder=19,r.EnumMember=20,r.Constant=21,r.Struct=22,r.Event=23,r.Operator=24,r.TypeParameter=25})(Ar||(Ar={}));var Mt;(function(r){r.PlainText=1,r.Snippet=2})(Mt||(Mt={}));var my;(function(r){r.Deprecated=1})(my||(my={}));var vy;(function(r){function e(n,i,s){return{newText:n,insert:i,replace:s}}r.create=e;function t(n){var i=n;return i&&J.string(i.newText)&&Ue.is(i.insert)&&Ue.is(i.replace)}r.is=t})(vy||(vy={}));var yy;(function(r){r.asIs=1,r.adjustIndentation=2})(yy||(yy={}));var by;(function(r){function e(t){var n=t;return n&&(J.string(n.detail)||n.detail===void 0)&&(J.string(n.description)||n.description===void 0)}r.is=e})(by||(by={}));var Mf;(function(r){function e(t){return{label:t}}r.create=e})(Mf||(Mf={}));var xy;(function(r){function e(t,n){return{items:t||[],isIncomplete:!!n}}r.create=e})(xy||(xy={}));var Fl;(function(r){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}r.fromPlainText=e;function t(n){var i=n;return J.string(i)||J.objectLiteral(i)&&J.string(i.language)&&J.string(i.value)}r.is=t})(Fl||(Fl={}));var wy;(function(r){function e(t){var n=t;return!!n&&J.objectLiteral(n)&&(Bo.is(n.contents)||Fl.is(n.contents)||J.typedArray(n.contents,Fl.is))&&(t.range===void 0||Ue.is(t.range))}r.is=e})(wy||(wy={}));var Sy;(function(r){function e(t,n){return n?{label:t,documentation:n}:{label:t}}r.create=e})(Sy||(Sy={}));var ky;(function(r){function e(t,n){for(var i=[],s=2;s<arguments.length;s++)i[s-2]=arguments[s];var o={label:t};return J.defined(n)&&(o.documentation=n),J.defined(i)?o.parameters=i:o.parameters=[],o}r.create=e})(ky||(ky={}));var Ay;(function(r){r.Text=1,r.Read=2,r.Write=3})(Ay||(Ay={}));var Cy;(function(r){function e(t,n){var i={range:t};return J.number(n)&&(i.kind=n),i}r.create=e})(Cy||(Cy={}));var mn;(function(r){r.File=1,r.Module=2,r.Namespace=3,r.Package=4,r.Class=5,r.Method=6,r.Property=7,r.Field=8,r.Constructor=9,r.Enum=10,r.Interface=11,r.Function=12,r.Variable=13,r.Constant=14,r.String=15,r.Number=16,r.Boolean=17,r.Array=18,r.Object=19,r.Key=20,r.Null=21,r.EnumMember=22,r.Struct=23,r.Event=24,r.Operator=25,r.TypeParameter=26})(mn||(mn={}));var Oy;(function(r){r.Deprecated=1})(Oy||(Oy={}));var Ey;(function(r){function e(t,n,i,s,o){var a={name:t,kind:n,location:{uri:s,range:i}};return o&&(a.containerName=o),a}r.create=e})(Ey||(Ey={}));var Ty;(function(r){function e(t,n,i,s){return s!==void 0?{name:t,kind:n,location:{uri:i,range:s}}:{name:t,kind:n,location:{uri:i}}}r.create=e})(Ty||(Ty={}));var Py;(function(r){function e(n,i,s,o,a,l){var c={name:n,detail:i,kind:s,range:o,selectionRange:a};return l!==void 0&&(c.children=l),c}r.create=e;function t(n){var i=n;return i&&J.string(i.name)&&J.number(i.kind)&&Ue.is(i.range)&&Ue.is(i.selectionRange)&&(i.detail===void 0||J.string(i.detail))&&(i.deprecated===void 0||J.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}r.is=t})(Py||(Py={}));var My;(function(r){r.Empty="",r.QuickFix="quickfix",r.Refactor="refactor",r.RefactorExtract="refactor.extract",r.RefactorInline="refactor.inline",r.RefactorRewrite="refactor.rewrite",r.Source="source",r.SourceOrganizeImports="source.organizeImports",r.SourceFixAll="source.fixAll"})(My||(My={}));var jl;(function(r){r.Invoked=1,r.Automatic=2})(jl||(jl={}));var Iy;(function(r){function e(n,i,s){var o={diagnostics:n};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}r.create=e;function t(n){var i=n;return J.defined(i)&&J.typedArray(i.diagnostics,Pn.is)&&(i.only===void 0||J.typedArray(i.only,J.string))&&(i.triggerKind===void 0||i.triggerKind===jl.Invoked||i.triggerKind===jl.Automatic)}r.is=t})(Iy||(Iy={}));var Dy;(function(r){function e(n,i,s){var o={title:n},a=!0;return typeof i=="string"?(a=!1,o.kind=i):ws.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}r.create=e;function t(n){var i=n;return i&&J.string(i.title)&&(i.diagnostics===void 0||J.typedArray(i.diagnostics,Pn.is))&&(i.kind===void 0||J.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||ws.is(i.command))&&(i.isPreferred===void 0||J.boolean(i.isPreferred))&&(i.edit===void 0||Pf.is(i.edit))}r.is=t})(Dy||(Dy={}));var Ny;(function(r){function e(n,i){var s={range:n};return J.defined(i)&&(s.data=i),s}r.create=e;function t(n){var i=n;return J.defined(i)&&Ue.is(i.range)&&(J.undefined(i.command)||ws.is(i.command))}r.is=t})(Ny||(Ny={}));var Ry;(function(r){function e(n,i){return{tabSize:n,insertSpaces:i}}r.create=e;function t(n){var i=n;return J.defined(i)&&J.uinteger(i.tabSize)&&J.boolean(i.insertSpaces)}r.is=t})(Ry||(Ry={}));var Ly;(function(r){function e(n,i,s){return{range:n,target:i,data:s}}r.create=e;function t(n){var i=n;return J.defined(i)&&Ue.is(i.range)&&(J.undefined(i.target)||J.string(i.target))}r.is=t})(Ly||(Ly={}));var Vl;(function(r){function e(n,i){return{range:n,parent:i}}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&Ue.is(i.range)&&(i.parent===void 0||r.is(i.parent))}r.is=t})(Vl||(Vl={}));var By;(function(r){r.namespace="namespace",r.type="type",r.class="class",r.enum="enum",r.interface="interface",r.struct="struct",r.typeParameter="typeParameter",r.parameter="parameter",r.variable="variable",r.property="property",r.enumMember="enumMember",r.event="event",r.function="function",r.method="method",r.macro="macro",r.keyword="keyword",r.modifier="modifier",r.comment="comment",r.string="string",r.number="number",r.regexp="regexp",r.operator="operator",r.decorator="decorator"})(By||(By={}));var Fy;(function(r){r.declaration="declaration",r.definition="definition",r.readonly="readonly",r.static="static",r.deprecated="deprecated",r.abstract="abstract",r.async="async",r.modification="modification",r.documentation="documentation",r.defaultLibrary="defaultLibrary"})(Fy||(Fy={}));var jy;(function(r){function e(t){var n=t;return J.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}r.is=e})(jy||(jy={}));var Vy;(function(r){function e(n,i){return{range:n,text:i}}r.create=e;function t(n){var i=n;return i!=null&&Ue.is(i.range)&&J.string(i.text)}r.is=t})(Vy||(Vy={}));var Wy;(function(r){function e(n,i,s){return{range:n,variableName:i,caseSensitiveLookup:s}}r.create=e;function t(n){var i=n;return i!=null&&Ue.is(i.range)&&J.boolean(i.caseSensitiveLookup)&&(J.string(i.variableName)||i.variableName===void 0)}r.is=t})(Wy||(Wy={}));var $y;(function(r){function e(n,i){return{range:n,expression:i}}r.create=e;function t(n){var i=n;return i!=null&&Ue.is(i.range)&&(J.string(i.expression)||i.expression===void 0)}r.is=t})($y||($y={}));var Hy;(function(r){function e(n,i){return{frameId:n,stoppedLocation:i}}r.create=e;function t(n){var i=n;return J.defined(i)&&Ue.is(n.stoppedLocation)}r.is=t})(Hy||(Hy={}));var If;(function(r){r.Type=1,r.Parameter=2;function e(t){return t===1||t===2}r.is=e})(If||(If={}));var Df;(function(r){function e(n){return{value:n}}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&(i.tooltip===void 0||J.string(i.tooltip)||Bo.is(i.tooltip))&&(i.location===void 0||xs.is(i.location))&&(i.command===void 0||ws.is(i.command))}r.is=t})(Df||(Df={}));var zy;(function(r){function e(n,i,s){var o={position:n,label:i};return s!==void 0&&(o.kind=s),o}r.create=e;function t(n){var i=n;return J.objectLiteral(i)&&Br.is(i.position)&&(J.string(i.label)||J.typedArray(i.label,Df.is))&&(i.kind===void 0||If.is(i.kind))&&i.textEdits===void 0||J.typedArray(i.textEdits,Fr.is)&&(i.tooltip===void 0||J.string(i.tooltip)||Bo.is(i.tooltip))&&(i.paddingLeft===void 0||J.boolean(i.paddingLeft))&&(i.paddingRight===void 0||J.boolean(i.paddingRight))}r.is=t})(zy||(zy={}));var Uy;(function(r){function e(t){var n=t;return J.objectLiteral(n)&&Of.is(n.uri)&&J.string(n.name)}r.is=e})(Uy||(Uy={}));var P3=null,Gy;(function(r){function e(s,o,a,l){return new pP(s,o,a,l)}r.create=e;function t(s){var o=s;return!!(J.defined(o)&&J.string(o.uri)&&(J.undefined(o.languageId)||J.string(o.languageId))&&J.uinteger(o.lineCount)&&J.func(o.getText)&&J.func(o.positionAt)&&J.func(o.offsetAt))}r.is=t;function n(s,o){for(var a=s.getText(),l=i(o,function(m,y){var w=m.range.start.line-y.range.start.line;return w===0?m.range.start.character-y.range.start.character:w}),c=a.length,u=l.length-1;u>=0;u--){var h=l[u],d=s.offsetAt(h.range.start),p=s.offsetAt(h.range.end);if(p<=c)a=a.substring(0,d)+h.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");c=d}return a}r.applyEdits=n;function i(s,o){if(s.length<=1)return s;var a=s.length/2|0,l=s.slice(0,a),c=s.slice(a);i(l,o),i(c,o);for(var u=0,h=0,d=0;u<l.length&&h<c.length;){var p=o(l[u],c[h]);p<=0?s[d++]=l[u++]:s[d++]=c[h++]}for(;u<l.length;)s[d++]=l[u++];for(;h<c.length;)s[d++]=c[h++];return s}})(Gy||(Gy={}));var pP=function(){function r(e,t,n,i){this._uri=e,this._languageId=t,this._version=n,this._content=i,this._lineOffsets=void 0}return Object.defineProperty(r.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),r.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},r.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},r.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var e=[],t=this._content,n=!0,i=0;i<t.length;i++){n&&(e.push(i),n=!1);var s=t.charAt(i);n=s==="\r"||s===`
213
+ `,s==="\r"&&i+1<t.length&&t.charAt(i+1)===`
214
+ `&&i++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},r.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,i=t.length;if(i===0)return Br.create(0,e);for(;n<i;){var s=Math.floor((n+i)/2);t[s]>e?i=s:n=s+1}var o=n-1;return Br.create(o,e-t[o])},r.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)},Object.defineProperty(r.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),r}(),J;(function(r){var e=Object.prototype.toString;function t(p){return typeof p<"u"}r.defined=t;function n(p){return typeof p>"u"}r.undefined=n;function i(p){return p===!0||p===!1}r.boolean=i;function s(p){return e.call(p)==="[object String]"}r.string=s;function o(p){return e.call(p)==="[object Number]"}r.number=o;function a(p,m,y){return e.call(p)==="[object Number]"&&m<=p&&p<=y}r.numberRange=a;function l(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}r.integer=l;function c(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}r.uinteger=c;function u(p){return e.call(p)==="[object Function]"}r.func=u;function h(p){return p!==null&&typeof p=="object"}r.objectLiteral=h;function d(p,m){return Array.isArray(p)&&p.every(m)}r.typedArray=d})(J||(J={}));var gP=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))},Ky=function(){function r(e,t,n,i){this._uri=e,this._languageId=t,this._version=n,this._content=i,this._lineOffsets=void 0}return Object.defineProperty(r.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),r.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},r.prototype.update=function(e,t){for(var n=0,i=e;n<i.length;n++){var s=i[n];if(r.isIncremental(s)){var o=Jy(s.range),a=this.offsetAt(o.start),l=this.offsetAt(o.end);this._content=this._content.substring(0,a)+s.text+this._content.substring(l,this._content.length);var c=Math.max(o.start.line,0),u=Math.max(o.end.line,0),h=this._lineOffsets,d=Yy(s.text,!1,a);if(u-c===d.length)for(var p=0,m=d.length;p<m;p++)h[p+c+1]=d[p];else d.length<1e4?h.splice.apply(h,gP([c+1,u-c],d,!1)):this._lineOffsets=h=h.slice(0,c+1).concat(d,h.slice(u+1));var y=s.text.length-(l-a);if(y!==0)for(var p=c+1+d.length,m=h.length;p<m;p++)h[p]=h[p]+y}else if(r.isFull(s))this._content=s.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=t},r.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=Yy(this._content,!0)),this._lineOffsets},r.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,i=t.length;if(i===0)return{line:0,character:e};for(;n<i;){var s=Math.floor((n+i)/2);t[s]>e?i=s:n=s+1}var o=n-1;return{line:o,character:e-t[o]}},r.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)},Object.defineProperty(r.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),r.isIncremental=function(e){var t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")},r.isFull=function(e){var t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0},r}(),Nf;(function(r){function e(i,s,o,a){return new Ky(i,s,o,a)}r.create=e;function t(i,s,o){if(i instanceof Ky)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}r.update=t;function n(i,s){for(var o=i.getText(),a=Rf(s.map(mP),function(m,y){var w=m.range.start.line-y.range.start.line;return w===0?m.range.start.character-y.range.start.character:w}),l=0,c=[],u=0,h=a;u<h.length;u++){var d=h[u],p=i.offsetAt(d.range.start);if(p<l)throw new Error("Overlapping edit");p>l&&c.push(o.substring(l,p)),d.newText.length&&c.push(d.newText),l=i.offsetAt(d.range.end)}return c.push(o.substr(l)),c.join("")}r.applyEdits=n})(Nf||(Nf={}));function Rf(r,e){if(r.length<=1)return r;var t=r.length/2|0,n=r.slice(0,t),i=r.slice(t);Rf(n,e),Rf(i,e);for(var s=0,o=0,a=0;s<n.length&&o<i.length;){var l=e(n[s],i[o]);l<=0?r[a++]=n[s++]:r[a++]=i[o++]}for(;s<n.length;)r[a++]=n[s++];for(;o<i.length;)r[a++]=i[o++];return r}function Yy(r,e,t){t===void 0&&(t=0);for(var n=e?[t]:[],i=0;i<r.length;i++){var s=r.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<r.length&&r.charCodeAt(i+1)===10&&i++,n.push(t+i+1))}return n}function Jy(r){var e=r.start,t=r.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:r}function mP(r){var e=Jy(r.range);return e!==r.range?{newText:r.newText,range:e}:r}var He;(function(r){r[r.Undefined=0]="Undefined",r[r.EnumValueMismatch=1]="EnumValueMismatch",r[r.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",r[r.UnexpectedEndOfString=258]="UnexpectedEndOfString",r[r.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",r[r.InvalidUnicode=260]="InvalidUnicode",r[r.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",r[r.InvalidCharacter=262]="InvalidCharacter",r[r.PropertyExpected=513]="PropertyExpected",r[r.CommaExpected=514]="CommaExpected",r[r.ColonExpected=515]="ColonExpected",r[r.ValueExpected=516]="ValueExpected",r[r.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",r[r.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",r[r.TrailingComma=519]="TrailingComma",r[r.DuplicateKey=520]="DuplicateKey",r[r.CommentNotPermitted=521]="CommentNotPermitted",r[r.SchemaResolveError=768]="SchemaResolveError"})(He||(He={}));var Qy;(function(r){r.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[Ii.Markdown,Ii.PlainText],commitCharactersSupport:!0}}}}})(Qy||(Qy={}));var Di=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),vP={"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,}))$/}},Ni=function(){function r(e,t,n){this.offset=t,this.length=n,this.parent=e}return Object.defineProperty(r.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),r.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},r}(),yP=function(r){Di(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.type="null",i.value=null,i}return e}(Ni),Xy=function(r){Di(e,r);function e(t,n,i){var s=r.call(this,t,i)||this;return s.type="boolean",s.value=n,s}return e}(Ni),bP=function(r){Di(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.type="array",i.items=[],i}return Object.defineProperty(e.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),e}(Ni),xP=function(r){Di(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.type="number",i.isInteger=!0,i.value=Number.NaN,i}return e}(Ni),Zy=function(r){Di(e,r);function e(t,n,i){var s=r.call(this,t,n,i)||this;return s.type="string",s.value="",s}return e}(Ni),wP=function(r){Di(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.type="property",i.colonOffset=-1,i}return Object.defineProperty(e.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),e}(Ni),SP=function(r){Di(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.type="object",i.properties=[],i}return Object.defineProperty(e.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),e}(Ni);function cr(r){return gn(r)?r?{}:{not:{}}:r}var _y;(function(r){r[r.Key=0]="Key",r[r.Enum=1]="Enum"})(_y||(_y={}));var kP=function(){function r(e,t){e===void 0&&(e=-1),t===void 0&&(t=null),this.focusOffset=e,this.exclude=t,this.schemas=[]}return r.prototype.add=function(e){this.schemas.push(e)},r.prototype.merge=function(e){var t;(t=this.schemas).push.apply(t,e.schemas)},r.prototype.include=function(e){return(this.focusOffset===-1||qy(e,this.focusOffset))&&e!==this.exclude},r.prototype.newSub=function(){return new r(-1,this.exclude)},r}(),Lf=function(){function r(){}return Object.defineProperty(r.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),r.prototype.add=function(e){},r.prototype.merge=function(e){},r.prototype.include=function(e){return!0},r.prototype.newSub=function(){return this},r.instance=new r,r}(),ur=function(){function r(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return r.prototype.hasProblems=function(){return!!this.problems.length},r.prototype.mergeAll=function(e){for(var t=0,n=e;t<n.length;t++){var i=n[t];this.merge(i)}},r.prototype.merge=function(e){this.problems=this.problems.concat(e.problems)},r.prototype.mergeEnumValues=function(e){if(!this.enumValueMatch&&!e.enumValueMatch&&this.enumValues&&e.enumValues){this.enumValues=this.enumValues.concat(e.enumValues);for(var t=0,n=this.problems;t<n.length;t++){var i=n[t];i.code===He.EnumValueMismatch&&(i.message="Value is not accepted. Valid values: "+this.enumValues.map(function(s){return JSON.stringify(s)}).join(", ")+".")}}},r.prototype.mergePropertyMatch=function(e){this.merge(e),this.propertiesMatches++,(e.enumValueMatch||!e.hasProblems()&&e.propertiesMatches)&&this.propertiesValueMatches++,e.enumValueMatch&&e.enumValues&&e.enumValues.length===1&&this.primaryValueMatches++},r.prototype.compare=function(e){var t=this.hasProblems();return t!==e.hasProblems()?t?-1:1:this.enumValueMatch!==e.enumValueMatch?e.enumValueMatch?-1:1:this.primaryValueMatches!==e.primaryValueMatches?this.primaryValueMatches-e.primaryValueMatches:this.propertiesValueMatches!==e.propertiesValueMatches?this.propertiesValueMatches-e.propertiesValueMatches:this.propertiesMatches-e.propertiesMatches},r}();function AP(r,e){return e===void 0&&(e=[]),new eb(r,e,[])}function ni(r){return fP(r)}function Bf(r){return uP(r)}function qy(r,e,t){return t===void 0&&(t=!1),e>=r.offset&&e<r.offset+r.length||t&&e===r.offset+r.length}var eb=function(){function r(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.root=e,this.syntaxErrors=t,this.comments=n}return r.prototype.getNodeFromOffset=function(e,t){if(t===void 0&&(t=!1),this.root)return cP(this.root,e,t)},r.prototype.visit=function(e){if(this.root){var t=function(n){var i=e(n),s=n.children;if(Array.isArray(s))for(var o=0;o<s.length&&i;o++)i=t(s[o]);return i};t(this.root)}},r.prototype.validate=function(e,t){if(this.root&&t){var n=new ur;return Vt(this.root,t,n,Lf.instance),n.problems.map(function(i){var s=Ue.create(e.positionAt(i.location.offset),e.positionAt(i.location.offset+i.location.length));return Pn.create(s,i.message,i.severity,i.code)})}return null},r.prototype.getMatchingSchemas=function(e,t,n){t===void 0&&(t=-1),n===void 0&&(n=null);var i=new kP(t,n);return this.root&&e&&Vt(this.root,e,new ur,i),i.schemas},r}();function Vt(r,e,t,n){if(!r||!n.include(r))return;switch(r.type){case"object":l(r,e,t,n);break;case"array":a(r,e,t,n);break;case"string":o(r,e,t,n);break;case"number":s(r,e,t,n);break;case"property":return Vt(r.valueNode,e,t,n)}i(),n.add({node:r,schema:e});function i(){function c(oe){return r.type===oe||oe==="integer"&&r.type==="number"&&r.isInteger||e.nullable&&r.value===null}if(Array.isArray(e.type)?e.type.some(c)||t.problems.push({location:{offset:r.offset,length:r.length},severity:Ie.Warning,message:e.errorMessage||"Incorrect type. Expected one of "+e.type.join(", ")+"."}):e.type&&(c(e.type)||t.problems.push({location:{offset:r.offset,length:r.length},severity:Ie.Warning,message:e.errorMessage||'Incorrect type. Expected "'+e.type+'".'})),Array.isArray(e.allOf))for(var u=0,h=e.allOf;u<h.length;u++){var d=h[u];Vt(r,cr(d),t,n)}var p=cr(e.not);if(p){var m=new ur,y=n.newSub();Vt(r,p,m,y),m.hasProblems()||t.problems.push({location:{offset:r.offset,length:r.length},severity:Ie.Warning,message:"Matches a schema that is not allowed."});for(var w=0,A=y.schemas;w<A.length;w++){var T=A[w];T.inverted=!T.inverted,n.add(T)}}var P=function(oe,fe){for(var be=[],ke=null,Re=0,Se=oe;Re<Se.length;Re++){var Oe=Se[Re],Te=cr(Oe),De=new ur,bt=n.newSub();if(Vt(r,Te,De,bt),De.hasProblems()||be.push(Te),!ke)ke={schema:Te,validationResult:De,matchingSchemas:bt};else if(!fe&&!De.hasProblems()&&!ke.validationResult.hasProblems())ke.matchingSchemas.merge(bt),ke.validationResult.propertiesMatches+=De.propertiesMatches,ke.validationResult.propertiesValueMatches+=De.propertiesValueMatches;else{var Rt=De.compare(ke.validationResult);Rt>0?ke={schema:Te,validationResult:De,matchingSchemas:bt}:Rt===0&&(ke.matchingSchemas.merge(bt),ke.validationResult.mergeEnumValues(De))}}return be.length>1&&fe&&t.problems.push({location:{offset:r.offset,length:1},severity:Ie.Warning,message:"Matches multiple schemas when only one must validate."}),ke!==null&&(t.merge(ke.validationResult),t.propertiesMatches+=ke.validationResult.propertiesMatches,t.propertiesValueMatches+=ke.validationResult.propertiesValueMatches,n.merge(ke.matchingSchemas)),be.length};Array.isArray(e.anyOf)&&P(e.anyOf,!1),Array.isArray(e.oneOf)&&P(e.oneOf,!0);var L=function(oe){var fe=new ur,be=n.newSub();Vt(r,cr(oe),fe,be),t.merge(fe),t.propertiesMatches+=fe.propertiesMatches,t.propertiesValueMatches+=fe.propertiesValueMatches,n.merge(be)},D=function(oe,fe,be){var ke=cr(oe),Re=new ur,Se=n.newSub();Vt(r,ke,Re,Se),n.merge(Se),Re.hasProblems()?be&&L(be):fe&&L(fe)},j=cr(e.if);if(j&&D(j,cr(e.then),cr(e.else)),Array.isArray(e.enum)){for(var W=ni(r),q=!1,F=0,H=e.enum;F<H.length;F++){var Q=H[F];if(Io(W,Q)){q=!0;break}}t.enumValues=e.enum,t.enumValueMatch=q,q||t.problems.push({location:{offset:r.offset,length:r.length},severity:Ie.Warning,code:He.EnumValueMismatch,message:e.errorMessage||"Value is not accepted. Valid values: "+e.enum.map(function(oe){return JSON.stringify(oe)}).join(", ")+"."})}if(Tn(e.const)){var W=ni(r);Io(W,e.const)?t.enumValueMatch=!0:(t.problems.push({location:{offset:r.offset,length:r.length},severity:Ie.Warning,code:He.EnumValueMismatch,message:e.errorMessage||"Value must be "+JSON.stringify(e.const)+"."}),t.enumValueMatch=!1),t.enumValues=[e.const]}e.deprecationMessage&&r.parent&&t.problems.push({location:{offset:r.parent.offset,length:r.parent.length},severity:Ie.Warning,message:e.deprecationMessage})}function s(c,u,h,d){var p=c.value;kr(u.multipleOf)&&p%u.multipleOf!==0&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Value is not divisible by "+u.multipleOf+"."});function m(L,D){if(kr(D))return D;if(gn(D)&&D)return L}function y(L,D){if(!gn(D)||!D)return L}var w=m(u.minimum,u.exclusiveMinimum);kr(w)&&p<=w&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Value is below the exclusive minimum of "+w+"."});var A=m(u.maximum,u.exclusiveMaximum);kr(A)&&p>=A&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Value is above the exclusive maximum of "+A+"."});var T=y(u.minimum,u.exclusiveMinimum);kr(T)&&p<T&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Value is below the minimum of "+T+"."});var P=y(u.maximum,u.exclusiveMaximum);kr(P)&&p>P&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Value is above the maximum of "+P+"."})}function o(c,u,h,d){if(kr(u.minLength)&&c.value.length<u.minLength&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"String is shorter than the minimum length of "+u.minLength+"."}),kr(u.maxLength)&&c.value.length>u.maxLength&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"String is longer than the maximum length of "+u.maxLength+"."}),dP(u.pattern)){var p=new RegExp(u.pattern);p.test(c.value)||h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:u.patternErrorMessage||u.errorMessage||'String does not match the pattern of "'+u.pattern+'".'})}if(u.format)switch(u.format){case"uri":case"uri-reference":{var m=void 0;if(!c.value)m="URI expected.";else{var y=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(c.value);y?!y[2]&&u.format==="uri"&&(m="URI with a scheme is expected."):m="URI is expected."}m&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:u.patternErrorMessage||u.errorMessage||"String is not a URI: "+m})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var w=vP[u.format];(!c.value||!w.pattern.exec(c.value))&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:u.patternErrorMessage||u.errorMessage||w.errorMessage});break;default:}}function a(c,u,h,d){if(Array.isArray(u.items)){for(var p=u.items,m=0;m<p.length;m++){var y=p[m],w=cr(y),A=new ur,T=c.items[m];T?(Vt(T,w,A,d),h.mergePropertyMatch(A)):c.items.length>=p.length&&h.propertiesValueMatches++}if(c.items.length>p.length)if(typeof u.additionalItems=="object")for(var P=p.length;P<c.items.length;P++){var A=new ur;Vt(c.items[P],u.additionalItems,A,d),h.mergePropertyMatch(A)}else u.additionalItems===!1&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Array has too many items according to schema. Expected "+p.length+" or fewer."})}else{var L=cr(u.items);if(L)for(var D=0,j=c.items;D<j.length;D++){var T=j[D],A=new ur;Vt(T,L,A,d),h.mergePropertyMatch(A)}}var W=cr(u.contains);if(W){var q=c.items.some(function(Q){var oe=new ur;return Vt(Q,W,oe,Lf.instance),!oe.hasProblems()});q||h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:u.errorMessage||"Array does not contain required item."})}if(kr(u.minItems)&&c.items.length<u.minItems&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Array has too few items. Expected "+u.minItems+" or more."}),kr(u.maxItems)&&c.items.length>u.maxItems&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Array has too many items. Expected "+u.maxItems+" or fewer."}),u.uniqueItems===!0){var F=ni(c),H=F.some(function(Q,oe){return oe!==F.lastIndexOf(Q)});H&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Array has duplicate items."})}}function l(c,u,h,d){for(var p=Object.create(null),m=[],y=0,w=c.properties;y<w.length;y++){var A=w[y],T=A.keyNode.value;p[T]=A.valueNode,m.push(T)}if(Array.isArray(u.required))for(var P=0,L=u.required;P<L.length;P++){var D=L[P];if(!p[D]){var j=c.parent&&c.parent.type==="property"&&c.parent.keyNode,W=j?{offset:j.offset,length:j.length}:{offset:c.offset,length:1};h.problems.push({location:W,severity:Ie.Warning,message:'Missing property "'+D+'".'})}}var q=function(sr){for(var Es=m.indexOf(sr);Es>=0;)m.splice(Es,1),Es=m.indexOf(sr)};if(u.properties)for(var F=0,H=Object.keys(u.properties);F<H.length;F++){var D=H[F];q(D);var Q=u.properties[D],oe=p[D];if(oe)if(gn(Q))if(Q)h.propertiesMatches++,h.propertiesValueMatches++;else{var A=oe.parent;h.problems.push({location:{offset:A.keyNode.offset,length:A.keyNode.length},severity:Ie.Warning,message:u.errorMessage||"Property "+D+" is not allowed."})}else{var fe=new ur;Vt(oe,Q,fe,d),h.mergePropertyMatch(fe)}}if(u.patternProperties)for(var be=0,ke=Object.keys(u.patternProperties);be<ke.length;be++)for(var Re=ke[be],Se=new RegExp(Re),Oe=0,Te=m.slice(0);Oe<Te.length;Oe++){var D=Te[Oe];if(Se.test(D)){q(D);var oe=p[D];if(oe){var Q=u.patternProperties[Re];if(gn(Q))if(Q)h.propertiesMatches++,h.propertiesValueMatches++;else{var A=oe.parent;h.problems.push({location:{offset:A.keyNode.offset,length:A.keyNode.length},severity:Ie.Warning,message:u.errorMessage||"Property "+D+" is not allowed."})}else{var fe=new ur;Vt(oe,Q,fe,d),h.mergePropertyMatch(fe)}}}}if(typeof u.additionalProperties=="object")for(var De=0,bt=m;De<bt.length;De++){var D=bt[De],oe=p[D];if(oe){var fe=new ur;Vt(oe,u.additionalProperties,fe,d),h.mergePropertyMatch(fe)}}else if(u.additionalProperties===!1&&m.length>0)for(var Rt=0,ir=m;Rt<ir.length;Rt++){var D=ir[Rt],oe=p[D];if(oe){var A=oe.parent;h.problems.push({location:{offset:A.keyNode.offset,length:A.keyNode.length},severity:Ie.Warning,message:u.errorMessage||"Property "+D+" is not allowed."})}}if(kr(u.maxProperties)&&c.properties.length>u.maxProperties&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Object has more properties than limit of "+u.maxProperties+"."}),kr(u.minProperties)&&c.properties.length<u.minProperties&&h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Object has fewer properties than the required number of "+u.minProperties}),u.dependencies)for(var jr=0,si=Object.keys(u.dependencies);jr<si.length;jr++){var T=si[jr],Wt=p[T];if(Wt){var _t=u.dependencies[T];if(Array.isArray(_t))for(var Or=0,oi=_t;Or<oi.length;Or++){var ai=oi[Or];p[ai]?h.propertiesValueMatches++:h.problems.push({location:{offset:c.offset,length:c.length},severity:Ie.Warning,message:"Object is missing property "+ai+" required by property {$key}."})}else{var Q=cr(_t);if(Q){var fe=new ur;Vt(c,Q,fe,d),h.mergePropertyMatch(fe)}}}}var Er=cr(u.propertyNames);if(Er)for(var vn=0,Gl=c.properties;vn<Gl.length;vn++){var li=Gl[vn],T=li.keyNode;T&&Vt(T,Er,h,Lf.instance)}}}function CP(r,e){var t=[],n=-1,i=r.getText(),s=bs(i,!1),o=e&&e.collectComments?[]:void 0;function a(){for(;;){var j=s.scan();switch(h(),j){case 12:case 13:Array.isArray(o)&&o.push(Ue.create(r.positionAt(s.getTokenOffset()),r.positionAt(s.getTokenOffset()+s.getTokenLength())));break;case 15:case 14:break;default:return j}}}function l(j){return s.getToken()===j?(a(),!0):!1}function c(j,W,q,F,H){if(H===void 0&&(H=Ie.Error),t.length===0||q!==n){var Q=Ue.create(r.positionAt(q),r.positionAt(F));t.push(Pn.create(Q,j,H,W,r.languageId)),n=q}}function u(j,W,q,F,H){q===void 0&&(q=null),F===void 0&&(F=[]),H===void 0&&(H=[]);var Q=s.getTokenOffset(),oe=s.getTokenOffset()+s.getTokenLength();if(Q===oe&&Q>0){for(Q--;Q>0&&/\s/.test(i.charAt(Q));)Q--;oe=Q+1}if(c(j,W,Q,oe),q&&d(q,!1),F.length+H.length>0)for(var fe=s.getToken();fe!==17;){if(F.indexOf(fe)!==-1){a();break}else if(H.indexOf(fe)!==-1)break;fe=a()}return q}function h(){switch(s.getTokenError()){case 4:return u("Invalid unicode sequence in string.",He.InvalidUnicode),!0;case 5:return u("Invalid escape character in string.",He.InvalidEscapeCharacter),!0;case 3:return u("Unexpected end of number.",He.UnexpectedEndOfNumber),!0;case 1:return u("Unexpected end of comment.",He.UnexpectedEndOfComment),!0;case 2:return u("Unexpected end of string.",He.UnexpectedEndOfString),!0;case 6:return u("Invalid characters in string. Control characters must be escaped.",He.InvalidCharacter),!0}return!1}function d(j,W){return j.length=s.getTokenOffset()+s.getTokenLength()-j.offset,W&&a(),j}function p(j){if(s.getToken()!==3)return null;var W=new bP(j,s.getTokenOffset());a();for(var q=0,F=!1;s.getToken()!==4&&s.getToken()!==17;){if(s.getToken()===5){F||u("Value expected",He.ValueExpected);var H=s.getTokenOffset();if(a(),s.getToken()===4){F&&c("Trailing comma",He.TrailingComma,H,H+1);continue}}else F&&u("Expected comma",He.CommaExpected);var Q=P(W,q++);Q?W.items.push(Q):u("Value expected",He.ValueExpected,null,[],[4,5]),F=!0}return s.getToken()!==4?u("Expected comma or closing bracket",He.CommaOrCloseBacketExpected,W):d(W,!0)}function m(j,W){var q=new wP(j,s.getTokenOffset()),F=w(q);if(!F)if(s.getToken()===16){u("Property keys must be doublequoted",He.Undefined);var H=new Zy(q,s.getTokenOffset(),s.getTokenLength());H.value=s.getTokenValue(),F=H,a()}else return null;q.keyNode=F;var Q=W[F.value];if(Q?(c("Duplicate object key",He.DuplicateKey,q.keyNode.offset,q.keyNode.offset+q.keyNode.length,Ie.Warning),typeof Q=="object"&&c("DuplicateKeyWarning",He.DuplicateKey,Q.keyNode.offset,Q.keyNode.offset+Q.keyNode.length,Ie.Warning),W[F.value]=!0):W[F.value]=q,s.getToken()===6)q.colonOffset=s.getTokenOffset(),a();else if(u("Colon expected",He.ColonExpected),s.getToken()===10&&r.positionAt(F.offset+F.length).line<r.positionAt(s.getTokenOffset()).line)return q.length=F.length,q;var oe=P(q,F.value);return oe?(q.valueNode=oe,q.length=oe.offset+oe.length-q.offset,q):u("Value expected",He.ValueExpected,q,[],[2,5])}function y(j){if(s.getToken()!==1)return null;var W=new SP(j,s.getTokenOffset()),q=Object.create(null);a();for(var F=!1;s.getToken()!==2&&s.getToken()!==17;){if(s.getToken()===5){F||u("Property expected",He.PropertyExpected);var H=s.getTokenOffset();if(a(),s.getToken()===2){F&&c("Trailing comma",He.TrailingComma,H,H+1);continue}}else F&&u("Expected comma",He.CommaExpected);var Q=m(W,q);Q?W.properties.push(Q):u("Property expected",He.PropertyExpected,null,[],[2,5]),F=!0}return s.getToken()!==2?u("Expected comma or closing brace",He.CommaOrCloseBraceExpected,W):d(W,!0)}function w(j){if(s.getToken()!==10)return null;var W=new Zy(j,s.getTokenOffset());return W.value=s.getTokenValue(),d(W,!0)}function A(j){if(s.getToken()!==11)return null;var W=new xP(j,s.getTokenOffset());if(s.getTokenError()===0){var q=s.getTokenValue();try{var F=JSON.parse(q);if(!kr(F))return u("Invalid number format.",He.Undefined,W);W.value=F}catch{return u("Invalid number format.",He.Undefined,W)}W.isInteger=q.indexOf(".")===-1}return d(W,!0)}function T(j){var W;switch(s.getToken()){case 7:return d(new yP(j,s.getTokenOffset()),!0);case 8:return d(new Xy(j,!0,s.getTokenOffset()),!0);case 9:return d(new Xy(j,!1,s.getTokenOffset()),!0);default:return null}}function P(j,W){return p(j)||y(j)||w(j)||A(j)||T(j)}var L=null,D=a();return D!==17&&(L=P(null,null),L?s.getToken()!==17&&u("End of file expected.",He.Undefined):u("Expected a JSON object, array or literal.",He.Undefined)),new eb(L,t,o)}function Ff(r,e,t){if(r!==null&&typeof r=="object"){var n=e+" ";if(Array.isArray(r)){if(r.length===0)return"[]";for(var i=`[
215
+ `,s=0;s<r.length;s++)i+=n+Ff(r[s],n,t),s<r.length-1&&(i+=","),i+=`
216
+ `;return i+=e+"]",i}else{var o=Object.keys(r);if(o.length===0)return"{}";for(var i=`{
217
+ `,s=0;s<o.length;s++){var a=o[s];i+=n+JSON.stringify(a)+": "+Ff(r[a],n,t),s<o.length-1&&(i+=","),i+=`
218
+ `}return i+=e+"}",i}}return t(r)}function OP(r,e){if(r.length<e.length)return!1;for(var t=0;t<e.length;t++)if(r[t]!==e[t])return!1;return!0}function jf(r,e){var t=r.length-e.length;return t>0?r.lastIndexOf(e)===t:t===0?r===e:!1}function EP(r){return r.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function M3(r,e){for(var t="";e>0;)(e&1)===1&&(t+=r),r+=r,e=e>>>1;return t}var TP=[",","}","]"],PP=[":"],MP=function(){function r(e,t,n,i){t===void 0&&(t=[]),n===void 0&&(n=Promise),i===void 0&&(i={}),this.schemaService=e,this.contributions=t,this.promiseConstructor=n,this.clientCapabilities=i,this.templateVarIdCounter=0}return r.prototype.doResolve=function(e){for(var t=this.contributions.length-1;t>=0;t--)if(this.contributions[t].resolveCompletion){var n=this.contributions[t].resolveCompletion(e);if(n)return n}return this.promiseConstructor.resolve(e)},r.prototype.doComplete=function(e,t,n){var i=this,s={items:[],isIncomplete:!1},o=e.getText(),a=e.offsetAt(t),l=n.getNodeFromOffset(a,!0);if(this.isInComment(e,l?l.offset:0,a))return Promise.resolve(s);if(l&&a===l.offset+l.length&&a>0){var c=o[a-1];(l.type==="object"&&c==="}"||l.type==="array"&&c==="]")&&(l=l.parent)}var u=this.getCurrentWord(e,a),h=null;if(l&&(l.type==="string"||l.type==="number"||l.type==="boolean"||l.type==="null"))h=Ue.create(e.positionAt(l.offset),e.positionAt(l.offset+l.length));else{var d=a-u.length;d>0&&o[d-1]==='"'&&d--,h=Ue.create(e.positionAt(d),t)}var p=this.doesSupportsCommitCharacters(),m={},y={add:function(w){var A=m[w.label];A?A.documentation||(A.documentation=w.documentation):(m[w.label]=w,h&&(w.textEdit=Fr.replace(h,w.insertText)),p&&(w.commitCharacters=w.kind===Ar.Property?PP:TP),s.items.push(w))},setAsIncomplete:function(){s.isIncomplete=!0},error:function(w){console.error(w)},log:function(w){console.log(w)},getNumberOfProposals:function(){return s.items.length}};return this.schemaService.getSchemaForResource(e.uri,n).then(function(w){var A=[],T=!0,P="",L=null;if(l&&l.type==="string"){var D=l.parent;D&&D.type==="property"&&D.keyNode===l&&(T=!D.valueNode,L=D,P=o.substr(l.offset+1,l.length-2),D&&(l=D.parent))}if(l&&l.type==="object"){if(l.offset===a)return s;var j=l.properties;j.forEach(function(H){(!L||L!==H)&&(m[H.keyNode.value]=Mf.create("__"))});var W="";T&&(W=i.evaluateSeparatorAfter(e,e.offsetAt(h.end))),w?i.getPropertyCompletions(w,n,l,T,W,y):i.getSchemaLessPropertyCompletions(n,l,P,y);var q=Bf(l);i.contributions.forEach(function(H){var Q=H.collectPropertyCompletions(e.uri,q,u,T,W==="",y);Q&&A.push(Q)}),!w&&u.length>0&&o.charAt(a-u.length-1)!=='"'&&(y.add({kind:Ar.Property,label:i.getLabelForValue(u),insertText:i.getInsertTextForProperty(u,null,!1,W),insertTextFormat:Mt.Snippet,documentation:""}),y.setAsIncomplete())}var F={};return w?i.getValueCompletions(w,n,l,a,e,y,F):i.getSchemaLessValueCompletions(n,l,a,e,y),i.contributions.length>0&&i.getContributedValueCompletions(n,l,a,e,y,A),i.promiseConstructor.all(A).then(function(){if(y.getNumberOfProposals()===0){var H=a;l&&(l.type==="string"||l.type==="number"||l.type==="boolean"||l.type==="null")&&(H=l.offset+l.length);var Q=i.evaluateSeparatorAfter(e,H);i.addFillerValueCompletions(F,Q,y)}return s})})},r.prototype.getPropertyCompletions=function(e,t,n,i,s,o){var a=this,l=t.getMatchingSchemas(e.schema,n.offset);l.forEach(function(c){if(c.node===n&&!c.inverted){var u=c.schema.properties;u&&Object.keys(u).forEach(function(h){var d=u[h],p=!1;if(typeof d=="object"&&d.allOf)for(var m=0,y=d.allOf;m<y.length;m++){var w=y[m];if(w.readOnly){p=!0;break}}if(typeof d=="object"&&!d.deprecationMessage&&!d.doNotSuggest&&!p){var A={kind:Ar.Property,label:a.sanitizeLabel(h),insertText:a.getInsertTextForProperty(h,d,i,s),insertTextFormat:Mt.Snippet,filterText:a.getFilterTextForValue(h),documentation:a.fromMarkup(d.markdownDescription)||d.description||""};jf(A.insertText,"$1"+s)&&(A.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(A)}})}})},r.prototype.getSchemaLessPropertyCompletions=function(e,t,n,i){var s=this,o=function(l){l.properties.forEach(function(c){var u=c.keyNode.value;i.add({kind:Ar.Property,label:s.sanitizeLabel(u),insertText:s.getInsertTextForValue(u,""),insertTextFormat:Mt.Snippet,filterText:s.getFilterTextForValue(u),documentation:""})})};if(t.parent)if(t.parent.type==="property"){var a=t.parent.keyNode.value;e.visit(function(l){return l.type==="property"&&l!==t.parent&&l.keyNode.value===a&&l.valueNode&&l.valueNode.type==="object"&&o(l.valueNode),!0})}else t.parent.type==="array"&&t.parent.items.forEach(function(l){l.type==="object"&&l!==t&&o(l)});else t.type==="object"&&i.add({kind:Ar.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:Mt.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},r.prototype.getSchemaLessValueCompletions=function(e,t,n,i,s){var o=this,a=n;if(t&&(t.type==="string"||t.type==="number"||t.type==="boolean"||t.type==="null")&&(a=t.offset+t.length,t=t.parent),!t){s.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Mt.Snippet,documentation:""}),s.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Mt.Snippet,documentation:""});return}var l=this.evaluateSeparatorAfter(i,a),c=function(p){qy(p.parent,n,!0)||s.add({kind:o.getSuggestionKind(p.type),label:o.getLabelTextForMatchingNode(p,i),insertText:o.getInsertTextForMatchingNode(p,i,l),insertTextFormat:Mt.Snippet,documentation:""}),p.type==="boolean"&&o.addBooleanValueCompletion(!p.value,l,s)};if(t.type==="property"&&n>t.colonOffset){var u=t.valueNode;if(u&&(n>u.offset+u.length||u.type==="object"||u.type==="array"))return;var h=t.keyNode.value;e.visit(function(p){return p.type==="property"&&p.keyNode.value===h&&p.valueNode&&c(p.valueNode),!0}),h==="$schema"&&t.parent&&!t.parent.parent&&this.addDollarSchemaCompletions(l,s)}if(t.type==="array")if(t.parent&&t.parent.type==="property"){var d=t.parent.keyNode.value;e.visit(function(p){return p.type==="property"&&p.keyNode.value===d&&p.valueNode&&p.valueNode.type==="array"&&p.valueNode.items.forEach(c),!0})}else t.items.forEach(c)},r.prototype.getValueCompletions=function(e,t,n,i,s,o,a){var l=this,c=i,u=null,h=null;if(n&&(n.type==="string"||n.type==="number"||n.type==="boolean"||n.type==="null")&&(c=n.offset+n.length,h=n,n=n.parent),!n){this.addSchemaValueCompletions(e.schema,"",o,a);return}if(n.type==="property"&&i>n.colonOffset){var d=n.valueNode;if(d&&i>d.offset+d.length)return;u=n.keyNode.value,n=n.parent}if(n&&(u!==null||n.type==="array")){var p=this.evaluateSeparatorAfter(s,c),m=t.getMatchingSchemas(e.schema,n.offset,h);m.forEach(function(y){if(y.node===n&&!y.inverted&&y.schema){if(n.type==="array"&&y.schema.items)if(Array.isArray(y.schema.items)){var w=l.findItemAtOffset(n,s,i);w<y.schema.items.length&&l.addSchemaValueCompletions(y.schema.items[w],p,o,a)}else l.addSchemaValueCompletions(y.schema.items,p,o,a);if(y.schema.properties){var A=y.schema.properties[u];A&&l.addSchemaValueCompletions(A,p,o,a)}}}),u==="$schema"&&!n.parent&&this.addDollarSchemaCompletions(p,o),a.boolean&&(this.addBooleanValueCompletion(!0,p,o),this.addBooleanValueCompletion(!1,p,o)),a.null&&this.addNullValueCompletion(p,o)}},r.prototype.getContributedValueCompletions=function(e,t,n,i,s,o){if(!t)this.contributions.forEach(function(u){var h=u.collectDefaultCompletions(i.uri,s);h&&o.push(h)});else if((t.type==="string"||t.type==="number"||t.type==="boolean"||t.type==="null")&&(t=t.parent),t.type==="property"&&n>t.colonOffset){var a=t.keyNode.value,l=t.valueNode;if(!l||n<=l.offset+l.length){var c=Bf(t.parent);this.contributions.forEach(function(u){var h=u.collectValueCompletions(i.uri,c,a,s);h&&o.push(h)})}}},r.prototype.addSchemaValueCompletions=function(e,t,n,i){var s=this;typeof e=="object"&&(this.addEnumValueCompletions(e,t,n),this.addDefaultValueCompletions(e,t,n),this.collectTypes(e,i),Array.isArray(e.allOf)&&e.allOf.forEach(function(o){return s.addSchemaValueCompletions(o,t,n,i)}),Array.isArray(e.anyOf)&&e.anyOf.forEach(function(o){return s.addSchemaValueCompletions(o,t,n,i)}),Array.isArray(e.oneOf)&&e.oneOf.forEach(function(o){return s.addSchemaValueCompletions(o,t,n,i)}))},r.prototype.addDefaultValueCompletions=function(e,t,n,i){var s=this;i===void 0&&(i=0);var o=!1;if(Tn(e.default)){for(var a=e.type,l=e.default,c=i;c>0;c--)l=[l],a="array";n.add({kind:this.getSuggestionKind(a),label:this.getLabelForValue(l),insertText:this.getInsertTextForValue(l,t),insertTextFormat:Mt.Snippet}),o=!0}Array.isArray(e.examples)&&e.examples.forEach(function(u){for(var h=e.type,d=u,p=i;p>0;p--)d=[d],h="array";n.add({kind:s.getSuggestionKind(h),label:s.getLabelForValue(d),insertText:s.getInsertTextForValue(d,t),insertTextFormat:Mt.Snippet}),o=!0}),Array.isArray(e.defaultSnippets)&&e.defaultSnippets.forEach(function(u){var h=e.type,d=u.body,p=u.label,m,y;if(Tn(d)){for(var w=e.type,A=i;A>0;A--)d=[d],w="array";m=s.getInsertTextForSnippetValue(d,t),y=s.getFilterTextForSnippetValue(d),p=p||s.getLabelForSnippetValue(d)}else if(typeof u.bodyText=="string"){for(var T="",P="",L="",A=i;A>0;A--)T=T+L+`[
219
+ `,P=P+`
220
+ `+L+"]",L+=" ",h="array";m=T+L+u.bodyText.split(`
221
+ `).join(`
222
+ `+L)+P+t,p=p||s.sanitizeLabel(m),y=m.replace(/[\n]/g,"")}n.add({kind:s.getSuggestionKind(h),label:p,documentation:s.fromMarkup(u.markdownDescription)||u.description,insertText:m,insertTextFormat:Mt.Snippet,filterText:y}),o=!0}),!o&&typeof e.items=="object"&&!Array.isArray(e.items)&&this.addDefaultValueCompletions(e.items,t,n,i+1)},r.prototype.addEnumValueCompletions=function(e,t,n){if(Tn(e.const)&&n.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,t),insertTextFormat:Mt.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(var i=0,s=e.enum.length;i<s;i++){var o=e.enum[i],a=this.fromMarkup(e.markdownDescription)||e.description;e.markdownEnumDescriptions&&i<e.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?a=this.fromMarkup(e.markdownEnumDescriptions[i]):e.enumDescriptions&&i<e.enumDescriptions.length&&(a=e.enumDescriptions[i]),n.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(o),insertText:this.getInsertTextForValue(o,t),insertTextFormat:Mt.Snippet,documentation:a})}},r.prototype.collectTypes=function(e,t){if(!(Array.isArray(e.enum)||Tn(e.const))){var n=e.type;Array.isArray(n)?n.forEach(function(i){return t[i]=!0}):t[n]=!0}},r.prototype.addFillerValueCompletions=function(e,t,n){e.object&&n.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},t),insertTextFormat:Mt.Snippet,detail:"New object",documentation:""}),e.array&&n.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],t),insertTextFormat:Mt.Snippet,detail:"New array",documentation:""})},r.prototype.addBooleanValueCompletion=function(e,t,n){n.add({kind:this.getSuggestionKind("boolean"),label:e?"true":"false",insertText:this.getInsertTextForValue(e,t),insertTextFormat:Mt.Snippet,documentation:""})},r.prototype.addNullValueCompletion=function(e,t){t.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+e,insertTextFormat:Mt.Snippet,documentation:""})},r.prototype.addDollarSchemaCompletions=function(e,t){var n=this,i=this.schemaService.getRegisteredSchemaIds(function(s){return s==="http"||s==="https"});i.forEach(function(s){return t.add({kind:Ar.Module,label:n.getLabelForValue(s),filterText:n.getFilterTextForValue(s),insertText:n.getInsertTextForValue(s,e),insertTextFormat:Mt.Snippet,documentation:""})})},r.prototype.sanitizeLabel=function(e){return e=e.replace(/[\n]/g,"\u21B5"),e.length>57&&(e=e.substr(0,57).trim()+"..."),e},r.prototype.getLabelForValue=function(e){return this.sanitizeLabel(JSON.stringify(e))},r.prototype.getFilterTextForValue=function(e){return JSON.stringify(e)},r.prototype.getFilterTextForSnippetValue=function(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},r.prototype.getLabelForSnippetValue=function(e){var t=JSON.stringify(e);return t=t.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1"),this.sanitizeLabel(t)},r.prototype.getInsertTextForPlainText=function(e){return e.replace(/[\\\$\}]/g,"\\$&")},r.prototype.getInsertTextForValue=function(e,t){var n=JSON.stringify(e,null," ");return n==="{}"?"{$1}"+t:n==="[]"?"[$1]"+t:this.getInsertTextForPlainText(n+t)},r.prototype.getInsertTextForSnippetValue=function(e,t){var n=function(i){return typeof i=="string"&&i[0]==="^"?i.substr(1):JSON.stringify(i)};return Ff(e,"",n)+t},r.prototype.getInsertTextForGuessedValue=function(e,t){switch(typeof e){case"object":return e===null?"${1:null}"+t:this.getInsertTextForValue(e,t);case"string":var n=JSON.stringify(e);return n=n.substr(1,n.length-2),n=this.getInsertTextForPlainText(n),'"${1:'+n+'}"'+t;case"number":case"boolean":return"${1:"+JSON.stringify(e)+"}"+t}return this.getInsertTextForValue(e,t)},r.prototype.getSuggestionKind=function(e){if(Array.isArray(e)){var t=e;e=t.length>0?t[0]:null}if(!e)return Ar.Value;switch(e){case"string":return Ar.Value;case"object":return Ar.Module;case"property":return Ar.Property;default:return Ar.Value}},r.prototype.getLabelTextForMatchingNode=function(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:var n=t.getText().substr(e.offset,e.length);return n}},r.prototype.getInsertTextForMatchingNode=function(e,t,n){switch(e.type){case"array":return this.getInsertTextForValue([],n);case"object":return this.getInsertTextForValue({},n);default:var i=t.getText().substr(e.offset,e.length)+n;return this.getInsertTextForPlainText(i)}},r.prototype.getInsertTextForProperty=function(e,t,n,i){var s=this.getInsertTextForValue(e,"");if(!n)return s;var o=s+": ",a,l=0;if(t){if(Array.isArray(t.defaultSnippets)){if(t.defaultSnippets.length===1){var c=t.defaultSnippets[0].body;Tn(c)&&(a=this.getInsertTextForSnippetValue(c,""))}l+=t.defaultSnippets.length}if(t.enum&&(!a&&t.enum.length===1&&(a=this.getInsertTextForGuessedValue(t.enum[0],"")),l+=t.enum.length),Tn(t.default)&&(a||(a=this.getInsertTextForGuessedValue(t.default,"")),l++),l===0){var u=Array.isArray(t.type)?t.type[0]:t.type;switch(u||(t.properties?u="object":t.items&&(u="array")),u){case"boolean":a="$1";break;case"string":a='"$1"';break;case"object":a="{$1}";break;case"array":a="[$1]";break;case"number":case"integer":a="${1:0}";break;case"null":a="${1:null}";break;default:return s}}}return(!a||l>1)&&(a="$1"),o+a+i},r.prototype.getCurrentWord=function(e,t){for(var n=t-1,i=e.getText();n>=0&&`
223
+ \r\v":{[,]}`.indexOf(i.charAt(n))===-1;)n--;return i.substring(n+1,t)},r.prototype.evaluateSeparatorAfter=function(e,t){var n=bs(e.getText(),!0);n.setPosition(t);var i=n.scan();switch(i){case 5:case 2:case 4:case 17:return"";default:return","}},r.prototype.findItemAtOffset=function(e,t,n){for(var i=bs(t.getText(),!0),s=e.items,o=s.length-1;o>=0;o--){var a=s[o];if(n>a.offset+a.length){i.setPosition(a.offset+a.length);var l=i.scan();return l===5&&n>=i.getTokenOffset()+i.getTokenLength()?o+1:o}else if(n>=a.offset)return o}return 0},r.prototype.isInComment=function(e,t,n){var i=bs(e.getText(),!1);i.setPosition(t);for(var s=i.scan();s!==17&&i.getTokenOffset()+i.getTokenLength()<n;)s=i.scan();return(s===12||s===13)&&i.getTokenOffset()<=n},r.prototype.fromMarkup=function(e){if(e&&this.doesSupportMarkdown())return{kind:Ii.Markdown,value:e}},r.prototype.doesSupportMarkdown=function(){if(!Tn(this.supportsMarkdown)){var e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=e&&e.completionItem&&Array.isArray(e.completionItem.documentationFormat)&&e.completionItem.documentationFormat.indexOf(Ii.Markdown)!==-1}return this.supportsMarkdown},r.prototype.doesSupportsCommitCharacters=function(){if(!Tn(this.supportsCommitCharacters)){var e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsCommitCharacters=e&&e.completionItem&&!!e.completionItem.commitCharactersSupport}return this.supportsCommitCharacters},r}(),IP=function(){function r(e,t,n){t===void 0&&(t=[]),this.schemaService=e,this.contributions=t,this.promise=n||Promise}return r.prototype.doHover=function(e,t,n){var i=e.offsetAt(t),s=n.getNodeFromOffset(i);if(!s||(s.type==="object"||s.type==="array")&&i>s.offset+1&&i<s.offset+s.length-1)return this.promise.resolve(null);var o=s;if(s.type==="string"){var a=s.parent;if(a&&a.type==="property"&&a.keyNode===s&&(s=a.valueNode,!s))return this.promise.resolve(null)}for(var l=Ue.create(e.positionAt(o.offset),e.positionAt(o.offset+o.length)),c=function(m){var y={contents:m,range:l};return y},u=Bf(s),h=this.contributions.length-1;h>=0;h--){var d=this.contributions[h],p=d.getInfoContribution(e.uri,u);if(p)return p.then(function(m){return c(m)})}return this.schemaService.getSchemaForResource(e.uri,n).then(function(m){if(m){var y=n.getMatchingSchemas(m.schema,s.offset),w=null,A=null,T=null,P=null;y.every(function(D){if(D.node===s&&!D.inverted&&D.schema&&(w=w||D.schema.title,A=A||D.schema.markdownDescription||Vf(D.schema.description),D.schema.enum)){var j=D.schema.enum.indexOf(ni(s));D.schema.markdownEnumDescriptions?T=D.schema.markdownEnumDescriptions[j]:D.schema.enumDescriptions&&(T=Vf(D.schema.enumDescriptions[j])),T&&(P=D.schema.enum[j],typeof P!="string"&&(P=JSON.stringify(P)))}return!0});var L="";return w&&(L=Vf(w)),A&&(L.length>0&&(L+=`
241
224
 
242
- .react-codemirror2 {
243
- display: flex;
244
- flex-direction: column;
245
- justify-content: flex-start;
246
- overflow: hidden;
225
+ `),L+=A),T&&(L.length>0&&(L+=`
247
226
 
248
- flex: 1;
249
- }
227
+ `),L+="`"+DP(P)+"`: "+T),c([L])}return null})},r}();function Vf(r){if(r){var e=r.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
250
228
 
251
- .CodeMirror {
252
- flex: 1;
253
- border-radius: var(--panel-border-radius);
254
- }
255
- `,Dh=({fieldState:t,fieldApi:n,onChange:i,onBlur:s,forwardedRef:u,id:c,mode:h,schema:m})=>{let p;const y=(ae,oe)=>{/^[a-zA-Z0-9_":]$/.test(oe.key)&&p.execCommand("autocomplete")},T=ae=>{p=ae,p.on("keyup",y)},L=()=>{p.refresh()},q=()=>p.showHint({completeSingle:!0});(0,Vt.useMount)(()=>{setTimeout(()=>{p.refresh()},0),document.addEventListener("click",L)}),(0,Vt.useUnmount)(()=>{document.removeEventListener("click",L)});const{value:W}=t,{setValue:_,setTouched:fe}=n;return B.createElement(B.Fragment,null,B.createElement(Nh,null),B.createElement(ho.fk,{editorDidMount:T,value:W||"",ref:u,onBeforeChange:(ae,oe,ue)=>{_(ue),i&&i(ue)},onBlur:ae=>{fe(!1),s&&s(ae)},options:{mode:h||Ba.Tr.JSON,theme:"material",matchBrackets:!0,autoCloseBrackets:!0,tabSize:2,foldGutter:!0,extraKeys:{"Cmd-Space":q,"Ctrl-Space":q},hintOptions:{id:c,completeSingle:!1,schema:m}}}))},Fh=(0,Zr.UU)(Dh);var fc=f(91582);function Rh({mediaType:t,mediaContent:n,properties:i,id:s,resolvedBody:u,formApi:c,getActiveSample:h,validate:m}){const p=(0,fc.yN)(n),y=t.examples||{},T=Object.keys(y),L=t.schema,q=Ma(L||{},t.name)||t.name===Ba.Tr.MULTIPART||t.name===Ba.Tr.URL_ENCODED,{exampleKey:W}=(0,Yo.C6)(t.operation,y),_=(0,ot.YQ)((0,gt.P6)(s,t.name,W,y))||(0,gt.oY)(y[W],i),fe=(0,B.useCallback)((ue="",ye="",Ae=[])=>we=>{(0,ot.WW)((0,gt.P6)(s,ue,ye,Ae),we)},[s]),ae=(0,B.useCallback)(ue=>{p&&p(ue),c.setValue("body",h(ue))},[c,h,p]),oe=(0,B.useCallback)((ue,ye)=>{c.setValue(`body.${ue}`,ye)},[c]);return B.createElement(B.Fragment,null,T.length&&T.length!==1&&B.createElement(Yo.b_,{examples:y,onChange:ae,exampleKey:W,panel:"try-it"})||null,q?B.createElement(zs,{mediaType:t,formApi:c,onChange:oe}):B.createElement(Fh,{id:"body"+s,field:"body",initialValue:_,schema:(u?.content[t.name]||{}).schema,mode:t.name,validate:m,onChange:fe(t.name,W,y)}))}const Bh=(0,B.memo)(Rh);var jh=f(60821),Wh=Object.defineProperty,Hh=Object.defineProperties,Uh=Object.getOwnPropertyDescriptors,vd=Object.getOwnPropertySymbols,zh=Object.prototype.hasOwnProperty,_h=Object.prototype.propertyIsEnumerable,gd=(t,n,i)=>n in t?Wh(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,Vh=(t,n)=>{for(var i in n||(n={}))zh.call(n,i)&&gd(t,i,n[i]);if(vd)for(var i of vd(n))_h.call(n,i)&&gd(t,i,n[i]);return t},$h=(t,n)=>Hh(t,Uh(n));function Gh({body:{content:t},formApi:n,resolvedBody:i,properties:s,mergeExampleBody:u,id:c,validate:h,pointer:m}){const p=(0,wn.Dv)(jh.J8),{examples:y,name:T}=t&&(0,Cn.getActiveMediaType)(t,p)||{},L=(0,B.useCallback)(_=>{if(!t||!t.hasSample||!y?.[_])return"";const fe=T&&(0,ot.YQ)((0,gt.P6)(c,T,_,y)),ae=fe?JSON.parse(fe):y?.[_];return(0,gt.oY)(ae,s)},[T,y,c,t,s]),{activeExampleName:q}=(0,wn.Dv)((0,Us.N)(m));(0,B.useEffect)(()=>{if(s&&!u){n.setValue("body",JSON.stringify(s||{},null,2));return}const _=(0,gt.P6)(c,T,q,y);n.setValue("body",(0,ot.YQ)(_)||L(q||""))},[y,q,T,n,L,c,s,u]);const W=_=>B.createElement(bu.C,$h(Vh({},_),{variant:"dark",fullWidth:!0,Label:Su,Dropdown:xu.Lt}));return B.createElement(B.Fragment,null,B.createElement(Gf.d,{content:t,renderDropdown:W},_=>B.createElement(Bh,{mediaType:_,mediaContent:t,resolvedBody:i,id:c,properties:s,getActiveSample:L,formApi:n,validate:h})))}const Kh=(0,B.memo)(Gh),Yh=({initValue:t,paramEnum:n,fieldApi:i})=>{const[s,u]=(0,B.useState)(),c=n.map((p,y)=>({idx:y,value:p})),h=p=>{i.setValue(p.value),u(p.value)};(0,Vt.useMount)(()=>{if(t)if(Array.isArray(t)){const p=t.length?t[0]:"";u(p),i.setValue(p)}else u(t),i.setValue(t)});const m=()=>{i.setValue(""),u("")};return B.createElement(Qr.VD,{clearable:!0,fullWidth:!0,variant:"dark",value:s,options:c,handleClear:m,onChange:h})},Xh=(0,Zr.UU)(Yh),Jh=({name:t,param:n,place:i,renderParameter:s})=>{var u,c,h,m,p;const[y,T]=B.useState([]),L=()=>{T([...y,y.length?y[y.length-1]+1:0])},q=_=>{T(y.filter(fe=>fe!==_))},W=(u=n.schema.items)!=null&&u.fields?(c=n.schema.items)==null?void 0:c.fields:[{schema:((h=n.schema.items)==null?void 0:h.schema)||n.schema.items,name:"",required:n.required,description:(m=n.schema.items)==null?void 0:m.description,externalDocs:(p=n.schema.items)==null?void 0:p.externalDocs,deprecated:!1,toggle:()=>null,expanded:!1}];return B.createElement(B.Fragment,null,B.createElement(md,null,B.createElement(Ge.lX,{required:n.required},t,"(",y.length," items)"),B.createElement("span",{onClick:L},"Add item +")),y?.map((_,fe)=>B.createElement(md,{key:_},W.map(ae=>s(ae,i,`${t}.[${_}]`,`[${fe}]${ae.name&&"."+ae.name}`,B.createElement(Qh,{onClick:()=>q(_)},"Delete"))))))},md=Tt.ZP.div`
229
+ $3`);return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function DP(r){return r.indexOf("`")!==-1?"`` "+r+" ``":r}var NP=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),vt,Fo;if(typeof process=="object")Fo=!1;else if(typeof navigator=="object"){var RP=navigator.userAgent;Fo=RP.indexOf("Windows")>=0}function I3(r){return 55296<=r&&r<=56319}function D3(r){return 56320<=r&&r<=57343}function N3(r){return r>=97&&r<=102}function LP(r){return r>=97&&r<=122}function BP(r){return r>=65&&r<=90}function R3(r){return LP(r)||BP(r)}var FP=/^\w[\w\d+.-]*$/,jP=/^\//,VP=/^\/\//;function WP(r,e){if(!r.scheme&&e)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+r.authority+'", path: "'+r.path+'", query: "'+r.query+'", fragment: "'+r.fragment+'"}');if(r.scheme&&!FP.test(r.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(r.path){if(r.authority){if(!jP.test(r.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(VP.test(r.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function $P(r,e){return!r&&!e?"file":r}function HP(r,e){switch(r){case"https":case"http":case"file":e?e[0]!==Gr&&(e=Gr+e):e=Gr;break}return e}var et="",Gr="/",zP=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,Wf=function(){function r(e,t,n,i,s,o){o===void 0&&(o=!1),typeof e=="object"?(this.scheme=e.scheme||et,this.authority=e.authority||et,this.path=e.path||et,this.query=e.query||et,this.fragment=e.fragment||et):(this.scheme=$P(e,o),this.authority=t||et,this.path=HP(this.scheme,n||et),this.query=i||et,this.fragment=s||et,WP(this,o))}return r.isUri=function(e){return e instanceof r?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="function"&&typeof e.with=="function"&&typeof e.toString=="function":!1},Object.defineProperty(r.prototype,"fsPath",{get:function(){return ib(this,!1)},enumerable:!0,configurable:!0}),r.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,i=e.path,s=e.query,o=e.fragment;return t===void 0?t=this.scheme:t===null&&(t=et),n===void 0?n=this.authority:n===null&&(n=et),i===void 0?i=this.path:i===null&&(i=et),s===void 0?s=this.query:s===null&&(s=et),o===void 0?o=this.fragment:o===null&&(o=et),t===this.scheme&&n===this.authority&&i===this.path&&s===this.query&&o===this.fragment?this:new ks(t,n,i,s,o)},r.parse=function(e,t){t===void 0&&(t=!1);var n=zP.exec(e);return n?new ks(n[2]||et,Wl(n[4]||et),Wl(n[5]||et),Wl(n[7]||et),Wl(n[9]||et),t):new ks(et,et,et,et,et)},r.file=function(e){var t=et;if(Fo&&(e=e.replace(/\\/g,Gr)),e[0]===Gr&&e[1]===Gr){var n=e.indexOf(Gr,2);n===-1?(t=e.substring(2),e=Gr):(t=e.substring(2,n),e=e.substring(n)||Gr)}return new ks("file",t,e,et,et)},r.from=function(e){return new ks(e.scheme,e.authority,e.path,e.query,e.fragment)},r.prototype.toString=function(e){return e===void 0&&(e=!1),$f(this,e)},r.prototype.toJSON=function(){return this},r.revive=function(e){if(e){if(e instanceof r)return e;var t=new ks(e);return t._formatted=e.external,t._fsPath=e._sep===tb?e.fsPath:null,t}else return e},r}(),tb=Fo?1:void 0,ks=function(r){NP(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return Object.defineProperty(e.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=ib(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),e.prototype.toString=function(t){return t===void 0&&(t=!1),t?$f(this,!0):(this._formatted||(this._formatted=$f(this,!1)),this._formatted)},e.prototype.toJSON=function(){var t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=tb),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t},e}(Wf),rb=(vt={},vt[58]="%3A",vt[47]="%2F",vt[63]="%3F",vt[35]="%23",vt[91]="%5B",vt[93]="%5D",vt[64]="%40",vt[33]="%21",vt[36]="%24",vt[38]="%26",vt[39]="%27",vt[40]="%28",vt[41]="%29",vt[42]="%2A",vt[43]="%2B",vt[44]="%2C",vt[59]="%3B",vt[61]="%3D",vt[32]="%20",vt);function nb(r,e){for(var t=void 0,n=-1,i=0;i<r.length;i++){var s=r.charCodeAt(i);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47)n!==-1&&(t+=encodeURIComponent(r.substring(n,i)),n=-1),t!==void 0&&(t+=r.charAt(i));else{t===void 0&&(t=r.substr(0,i));var o=rb[s];o!==void 0?(n!==-1&&(t+=encodeURIComponent(r.substring(n,i)),n=-1),t+=o):n===-1&&(n=i)}}return n!==-1&&(t+=encodeURIComponent(r.substring(n))),t!==void 0?t:r}function UP(r){for(var e=void 0,t=0;t<r.length;t++){var n=r.charCodeAt(t);n===35||n===63?(e===void 0&&(e=r.substr(0,t)),e+=rb[n]):e!==void 0&&(e+=r[t])}return e!==void 0?e:r}function ib(r,e){var t;return r.authority&&r.path.length>1&&r.scheme==="file"?t="//"+r.authority+r.path:r.path.charCodeAt(0)===47&&(r.path.charCodeAt(1)>=65&&r.path.charCodeAt(1)<=90||r.path.charCodeAt(1)>=97&&r.path.charCodeAt(1)<=122)&&r.path.charCodeAt(2)===58?e?t=r.path.substr(1):t=r.path[1].toLowerCase()+r.path.substr(2):t=r.path,Fo&&(t=t.replace(/\//g,"\\")),t}function $f(r,e){var t=e?UP:nb,n="",i=r.scheme,s=r.authority,o=r.path,a=r.query,l=r.fragment;if(i&&(n+=i,n+=":"),(s||i==="file")&&(n+=Gr,n+=Gr),s){var c=s.indexOf("@");if(c!==-1){var u=s.substr(0,c);s=s.substr(c+1),c=u.indexOf(":"),c===-1?n+=t(u,!1):(n+=t(u.substr(0,c),!1),n+=":",n+=t(u.substr(c+1),!1)),n+="@"}s=s.toLowerCase(),c=s.indexOf(":"),c===-1?n+=t(s,!1):(n+=t(s.substr(0,c),!1),n+=s.substr(c))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){var h=o.charCodeAt(1);h>=65&&h<=90&&(o="/"+String.fromCharCode(h+32)+":"+o.substr(3))}else if(o.length>=2&&o.charCodeAt(1)===58){var h=o.charCodeAt(0);h>=65&&h<=90&&(o=String.fromCharCode(h+32)+":"+o.substr(2))}n+=t(o,!0)}return a&&(n+="?",n+=t(a,!1)),l&&(n+="#",n+=e?l:nb(l,!1)),n}function sb(r){try{return decodeURIComponent(r)}catch{return r.length>3?r.substr(0,3)+sb(r.substr(3)):r}}var ob=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Wl(r){return r.match(ob)?r.replace(ob,function(e){return sb(e)}):r}var GP=function(){function r(e){try{this.patternRegExp=new RegExp(EP(e)+"$")}catch{this.patternRegExp=null}this.schemas=[]}return r.prototype.addSchema=function(e){this.schemas.push(e)},r.prototype.matchesPattern=function(e){return this.patternRegExp&&this.patternRegExp.test(e)},r.prototype.getSchemas=function(){return this.schemas},r}(),KP=function(){function r(e,t,n){this.service=e,this.url=t,this.dependencies={},n&&(this.unresolvedSchema=this.service.promise.resolve(new As(n)))}return r.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},r.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(t){return e.service.resolveSchemaContent(t,e.url,e.dependencies)})),this.resolvedSchema},r.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},r}(),As=function(){function r(e,t){t===void 0&&(t=[]),this.schema=e,this.errors=t}return r}(),ab=function(){function r(e,t){t===void 0&&(t=[]),this.schema=e,this.errors=t}return r.prototype.getSection=function(e){return cr(this.getSectionRecursive(e,this.schema))},r.prototype.getSectionRecursive=function(e,t){if(!t||typeof t=="boolean"||e.length===0)return t;var n=e.shift();if(t.properties&&typeof t.properties[n])return this.getSectionRecursive(e,t.properties[n]);if(t.patternProperties)for(var i=0,s=Object.keys(t.patternProperties);i<s.length;i++){var o=s[i],a=new RegExp(o);if(a.test(n))return this.getSectionRecursive(e,t.patternProperties[o])}else{if(typeof t.additionalProperties=="object")return this.getSectionRecursive(e,t.additionalProperties);if(n.match("[0-9]+")){if(Array.isArray(t.items)){var l=parseInt(n,10);if(!isNaN(l)&&t.items[l])return this.getSectionRecursive(e,t.items[l])}else if(t.items)return this.getSectionRecursive(e,t.items)}}return null},r}(),YP=function(){function r(e,t,n){this.contextService=t,this.requestService=e,this.promiseConstructor=n||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return r.prototype.getRegisteredSchemaIds=function(e){return Object.keys(this.registeredSchemasIds).filter(function(t){var n=Wf.parse(t).scheme;return n!=="schemaservice"&&(!e||e(n))})},Object.defineProperty(r.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),r.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},r.prototype.onResourceChange=function(e){var t=this,n=!1;e=this.normalizeId(e);for(var i=[e],s=Object.keys(this.schemasById).map(function(c){return t.schemasById[c]});i.length;)for(var o=i.pop(),a=0;a<s.length;a++){var l=s[a];l&&(l.url===o||l.dependencies[o])&&(l.url!==o&&i.push(l.url),l.clearSchema(),s[a]=void 0,n=!0)}return n},r.prototype.normalizeId=function(e){try{return Wf.parse(e).toString()}catch{return e}},r.prototype.setSchemaContributions=function(e){if(e.schemas){var t=e.schemas;for(var n in t){var i=this.normalizeId(n);this.contributionSchemas[i]=this.addSchemaHandle(i,t[n])}}if(e.schemaAssociations){var s=e.schemaAssociations;for(var o in s){var a=s[o];this.contributionAssociations[o]=a;for(var l=this.getOrAddFilePatternAssociation(o),c=0,u=a;c<u.length;c++){var h=u[c],n=this.normalizeId(h);l.addSchema(n)}}}},r.prototype.addSchemaHandle=function(e,t){var n=new KP(this,e,t);return this.schemasById[e]=n,n},r.prototype.getOrAddSchemaHandle=function(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)},r.prototype.getOrAddFilePatternAssociation=function(e){var t=this.filePatternAssociationById[e];return t||(t=new GP(e),this.filePatternAssociationById[e]=t,this.filePatternAssociations.push(t)),t},r.prototype.registerExternalSchema=function(e,t,n){t===void 0&&(t=null);var i=this.normalizeId(e);if(this.registeredSchemasIds[i]=!0,t)for(var s=0,o=t;s<o.length;s++){var a=o[s];this.getOrAddFilePatternAssociation(a).addSchema(i)}return n?this.addSchemaHandle(i,n):this.getOrAddSchemaHandle(i)},r.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var e in this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(var t in this.contributionAssociations)for(var n=this.getOrAddFilePatternAssociation(t),i=0,s=this.contributionAssociations[t];i<s.length;i++){var o=s[i],e=this.normalizeId(o);n.addSchema(e)}},r.prototype.getResolvedSchema=function(e){var t=this.normalizeId(e),n=this.schemasById[t];return n?n.getResolvedSchema():this.promise.resolve(null)},r.prototype.loadSchema=function(e){if(!this.requestService){var t="Unable to load schema from '"+$l(e)+"'. No schema request service available";return this.promise.resolve(new As({},[t]))}return this.requestService(e).then(function(n){if(!n){var i="Unable to load schema from '"+$l(e)+"': No content.";return new As({},[i])}var s={},o=[];s=lP(n,o);var a=o.length?["Unable to parse content from '"+$l(e)+"': Parse error at offset "+o[0].offset]:[];return new As(s,a)},function(n){var i="Unable to load schema from '"+$l(e)+"': "+n.toString();return new As({},[i])})},r.prototype.resolveSchemaContent=function(e,t,n){var i=this,s=e.errors.slice(0),o=e.schema;if(o.$schema){var a=this.normalizeId(o.$schema);if(a==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new ab({},["Draft-03 schemas are not supported."]));a==="https://json-schema.org/draft/2019-09/schema"&&e.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var l=this.contextService,c=function(p,m){if(!m)return p;var y=p;return m[0]==="/"&&(m=m.substr(1)),m.split("/").some(function(w){return y=y[w],!y}),y},u=function(p,m,y,w){var A=c(m,w);if(A)for(var T in A)A.hasOwnProperty(T)&&!p.hasOwnProperty(T)&&(p[T]=A[T]);else s.push("$ref '"+w+"' in '"+y+"' can not be resolved.")},h=function(p,m,y,w,A){l&&!/^\w+:\/\/.*/.test(m)&&(m=l.resolveRelativePath(m,w)),m=i.normalizeId(m);var T=i.getOrAddSchemaHandle(m);return T.getUnresolvedSchema().then(function(P){if(A[m]=!0,P.errors.length){var L=y?m+"#"+y:m;s.push("Problems loading reference '"+L+"': "+P.errors[0]+".")}return u(p,P.schema,m,y),d(p,P.schema,m,T.dependencies)})},d=function(p,m,y,w){if(!p||typeof p!="object")return Promise.resolve(null);for(var A=[p],T=[],P=[],L=function(){for(var F=[],H=0;H<arguments.length;H++)F[H]=arguments[H];for(var Q=0,oe=F;Q<oe.length;Q++){var fe=oe[Q];typeof fe=="object"&&A.push(fe)}},D=function(){for(var F=[],H=0;H<arguments.length;H++)F[H]=arguments[H];for(var Q=0,oe=F;Q<oe.length;Q++){var fe=oe[Q];if(typeof fe=="object")for(var be in fe){var ke=fe[be];typeof ke=="object"&&A.push(ke)}}},j=function(){for(var F=[],H=0;H<arguments.length;H++)F[H]=arguments[H];for(var Q=0,oe=F;Q<oe.length;Q++){var fe=oe[Q];if(Array.isArray(fe))for(var be=0,ke=fe;be<ke.length;be++){var Re=ke[be];typeof Re=="object"&&A.push(Re)}}},W=function(F){for(var H=[];F.$ref;){var Q=F.$ref,oe=Q.split("#",2);if(delete F.$ref,oe[0].length>0){P.push(h(F,oe[0],oe[1],y,w));return}else H.indexOf(Q)===-1&&(u(F,m,y,oe[1]),H.push(Q))}L(F.items,F.additionalProperties,F.not,F.contains,F.propertyNames,F.if,F.then,F.else),D(F.definitions,F.properties,F.patternProperties,F.dependencies),j(F.anyOf,F.allOf,F.oneOf,F.items)};A.length;){var q=A.pop();T.indexOf(q)>=0||(T.push(q),W(q))}return i.promise.all(P)};return d(o,o,t,n).then(function(p){return new ab(o,s)})},r.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&t.root.type==="object"){var n=t.root.properties.filter(function(m){return m.keyNode.value==="$schema"&&m.valueNode&&m.valueNode.type==="string"});if(n.length>0){var i=ni(n[0].valueNode);if(i&&OP(i,".")&&this.contextService&&(i=this.contextService.resolveRelativePath(i,e)),i){var s=this.normalizeId(i);return this.getOrAddSchemaHandle(s).getResolvedSchema()}}}for(var o=Object.create(null),a=[],l=0,c=this.filePatternAssociations;l<c.length;l++){var u=c[l];if(u.matchesPattern(e))for(var h=0,d=u.getSchemas();h<d.length;h++){var p=d[h];o[p]||(a.push(p),o[p]=!0)}}return a.length>0?this.createCombinedSchema(e,a).getResolvedSchema():this.promise.resolve(null)},r.prototype.createCombinedSchema=function(e,t){if(t.length===1)return this.getOrAddSchemaHandle(t[0]);var n="schemaservice://combinedSchema/"+encodeURIComponent(e),i={allOf:t.map(function(s){return{$ref:s}})};return this.addSchemaHandle(n,i)},r}();function $l(r){try{}catch{}return r}var JP=function(){function r(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}return r.prototype.configure=function(e){e&&(this.validationEnabled=e.validate,this.commentSeverity=e.allowComments?void 0:Ie.Error)},r.prototype.doValidation=function(e,t,n,i){var s=this;if(!this.validationEnabled)return this.promise.resolve([]);var o=[],a={},l=function(h){var d=h.range.start.line+" "+h.range.start.character+" "+h.message;a[d]||(a[d]=!0,o.push(h))},c=function(h){var d=n?ub(n.trailingCommas):Ie.Error,p=n?ub(n.comments):s.commentSeverity;if(h){if(h.errors.length&&t.root){var m=t.root,y=m.type==="object"?m.properties[0]:null;if(y&&y.keyNode.value==="$schema"){var w=y.valueNode||y,A=Ue.create(e.positionAt(w.offset),e.positionAt(w.offset+w.length));l(Pn.create(A,h.errors[0],Ie.Warning,He.SchemaResolveError))}else{var A=Ue.create(e.positionAt(m.offset),e.positionAt(m.offset+1));l(Pn.create(A,h.errors[0],Ie.Warning,He.SchemaResolveError))}}else{var T=t.validate(e,h.schema);T&&T.forEach(l)}lb(h.schema)&&(p=void 0),cb(h.schema)&&(d=void 0)}for(var P=0,L=t.syntaxErrors;P<L.length;P++){var D=L[P];if(D.code===He.TrailingComma){if(typeof d!="number")continue;D.severity=d}l(D)}if(typeof p=="number"){var j="Comments are not permitted in JSON.";t.comments.forEach(function(W){l(Pn.create(W,j,p,He.CommentNotPermitted))})}return o};if(i){var u=i.id||"schemaservice://untitled/"+QP++;return this.jsonSchemaService.resolveSchemaContent(new As(i),u,{}).then(function(h){return c(h)})}return this.jsonSchemaService.getSchemaForResource(e.uri,t).then(function(h){return c(h)})},r}(),QP=0;function lb(r){if(r&&typeof r=="object"){if(gn(r.allowComments))return r.allowComments;if(r.allOf)for(var e=0,t=r.allOf;e<t.length;e++){var n=t[e],i=lb(n);if(gn(i))return i}}}function cb(r){if(r&&typeof r=="object"){if(gn(r.allowTrailingCommas))return r.allowTrailingCommas;if(gn(r.allowsTrailingCommas))return r.allowsTrailingCommas;if(r.allOf)for(var e=0,t=r.allOf;e<t.length;e++){var n=t[e],i=cb(n);if(gn(i))return i}}}function ub(r){switch(r){case"error":return Ie.Error;case"warning":return Ie.Warning;case"ignore":return}}var fb=48,XP=57,ZP=65,Hl=97,_P=102;function yt(r){return r<fb?0:r<=XP?r-fb:(r<Hl&&(r+=Hl-ZP),r>=Hl&&r<=_P?r-Hl+10:0)}function qP(r){if(r[0]!=="#")return null;switch(r.length){case 4:return{red:yt(r.charCodeAt(1))*17/255,green:yt(r.charCodeAt(2))*17/255,blue:yt(r.charCodeAt(3))*17/255,alpha:1};case 5:return{red:yt(r.charCodeAt(1))*17/255,green:yt(r.charCodeAt(2))*17/255,blue:yt(r.charCodeAt(3))*17/255,alpha:yt(r.charCodeAt(4))*17/255};case 7:return{red:(yt(r.charCodeAt(1))*16+yt(r.charCodeAt(2)))/255,green:(yt(r.charCodeAt(3))*16+yt(r.charCodeAt(4)))/255,blue:(yt(r.charCodeAt(5))*16+yt(r.charCodeAt(6)))/255,alpha:1};case 9:return{red:(yt(r.charCodeAt(1))*16+yt(r.charCodeAt(2)))/255,green:(yt(r.charCodeAt(3))*16+yt(r.charCodeAt(4)))/255,blue:(yt(r.charCodeAt(5))*16+yt(r.charCodeAt(6)))/255,alpha:(yt(r.charCodeAt(7))*16+yt(r.charCodeAt(8)))/255}}return null}function L3(r,e,t,n){return n===void 0&&(n=1),{red:r/255,green:e/255,blue:t/255,alpha:n}}var eM=function(){function r(e){this.schemaService=e}return r.prototype.findDocumentSymbols=function(e,t,n){var i=this;n===void 0&&(n={resultLimit:Number.MAX_VALUE});var s=t.root;if(!s)return null;var o=n.resultLimit,a=e.uri;if((a==="vscode://defaultsettings/keybindings.json"||jf(a.toLowerCase(),"/user/keybindings.json"))&&s.type==="array"){for(var l=[],c=0,u=s.items;c<u.length;c++){var h=u[c];if(h.type==="object")for(var d=0,p=h.properties;d<p.length;d++){var m=p[d];if(m.keyNode.value==="key"&&m.valueNode){var y=xs.create(e.uri,ii(e,h));if(l.push({name:ni(m.valueNode),kind:mn.Function,location:y}),o--,o<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),l}}}return l}var w=function(T,P,L){return o>=0&&(P.type==="array"?P.items.forEach(function(D){return w(T,D,L)}):P.type==="object"&&P.properties.forEach(function(D){if(o>=0){var j=D.valueNode;if(j){o--;var W=xs.create(e.uri,ii(e,D)),q=L?L+"."+D.keyNode.value:D.keyNode.value;T.push({name:i.getKeyLabel(D),kind:i.getSymbolKind(j.type),location:W,containerName:L}),w(T,j,q)}}})),T},A=w([],s,void 0);return o<0&&(A.pop(),n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a)),A},r.prototype.findDocumentSymbols2=function(e,t,n){var i=this;n===void 0&&(n={resultLimit:Number.MAX_VALUE});var s=t.root;if(!s)return null;var o=n.resultLimit,a=e.uri;if((a==="vscode://defaultsettings/keybindings.json"||jf(a.toLowerCase(),"/user/keybindings.json"))&&s.type==="array"){for(var l=[],c=0,u=s.items;c<u.length;c++){var h=u[c];if(h.type==="object")for(var d=0,p=h.properties;d<p.length;d++){var m=p[d];if(m.keyNode.value==="key"&&m.valueNode){var y=ii(e,h),w=ii(e,m.keyNode);if(l.push({name:ni(m.valueNode),kind:mn.Function,range:y,selectionRange:w}),o--,o<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),l}}}return l}var A=function(P,L){return o>=0&&(L.type==="array"?L.items.forEach(function(D,j){if(D&&o>=0){o--;var W=ii(e,D),q=W,F=String(j),H=A([],D);P.push({name:F,kind:i.getSymbolKind(D.type),range:W,selectionRange:q,children:H})}}):L.type==="object"&&L.properties.forEach(function(D){var j=D.valueNode;if(j&&o>=0){o--;var W=ii(e,D),q=ii(e,D.keyNode),F=A([],j);P.push({name:i.getKeyLabel(D),kind:i.getSymbolKind(j.type),range:W,selectionRange:q,children:F})}})),P},T=A([],s);return o<0&&(T.pop(),n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a)),T},r.prototype.getSymbolKind=function(e){switch(e){case"object":return mn.Module;case"string":return mn.String;case"number":return mn.Number;case"array":return mn.Array;case"boolean":return mn.Boolean;default:return mn.Variable}},r.prototype.getKeyLabel=function(e){var t=e.keyNode.value;return t&&(t=t.replace(/[\n]/g,"\u21B5")),t&&t.trim()?t:'"'+t+'"'},r.prototype.findDocumentColors=function(e,t,n){return this.schemaService.getSchemaForResource(e.uri,t).then(function(i){var s=[];if(i)for(var o=n&&typeof n.resultLimit=="number"?n.resultLimit:Number.MAX_VALUE,a=t.getMatchingSchemas(i.schema),l={},c=0,u=a;c<u.length;c++){var h=u[c];if(!h.inverted&&h.schema&&(h.schema.format==="color"||h.schema.format==="color-hex")&&h.node&&h.node.type==="string"){var d=String(h.node.offset);if(!l[d]){var p=qP(ni(h.node));if(p){var m=ii(e,h.node);s.push({color:p,range:m})}if(l[d]=!0,o--,o<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(e.uri),s}}}return s})},r.prototype.getColorPresentations=function(e,t,n,i){var s=[],o=Math.round(n.red*255),a=Math.round(n.green*255),l=Math.round(n.blue*255);function c(h){var d=h.toString(16);return d.length!==2?"0"+d:d}var u;return n.alpha===1?u="#"+c(o)+c(a)+c(l):u="#"+c(o)+c(a)+c(l)+c(Math.round(n.alpha*255)),s.push({label:u,textEdit:Fr.replace(i,JSON.stringify(u))}),s},r}();function ii(r,e){return Ue.create(r.positionAt(e.offset),r.positionAt(e.offset+e.length))}var tM={schemaAssociations:{},schemas:{}};function rM(r,e){var t=[],n=[],i=[],s=-1,o=bs(r.getText(),!1),a=o.scan();function l(H){t.push(H),n.push(i.length)}for(;a!==17;){switch(a){case 1:case 3:{var c=r.positionAt(o.getTokenOffset()).line,u={startLine:c,endLine:c,kind:a===1?"object":"array"};i.push(u);break}case 2:case 4:{var h=a===2?"object":"array";if(i.length>0&&i[i.length-1].kind===h){var u=i.pop(),d=r.positionAt(o.getTokenOffset()).line;u&&d>u.startLine+1&&s!==u.startLine&&(u.endLine=d-1,l(u),s=u.startLine)}break}case 13:{var c=r.positionAt(o.getTokenOffset()).line,p=r.positionAt(o.getTokenOffset()+o.getTokenLength()).line;o.getTokenError()===1&&c+1<r.lineCount?o.setPosition(r.offsetAt(Br.create(c+1,0))):c<p&&(l({startLine:c,endLine:p,kind:Do.Comment}),s=c);break}case 12:{var m=r.getText().substr(o.getTokenOffset(),o.getTokenLength()),y=m.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(y){var d=r.positionAt(o.getTokenOffset()).line;if(y[1]){var u={startLine:d,endLine:d,kind:Do.Region};i.push(u)}else{for(var w=i.length-1;w>=0&&i[w].kind!==Do.Region;)w--;if(w>=0){var u=i[w];i.length=w,d>u.startLine&&s!==u.startLine&&(u.endLine=d,l(u),s=u.startLine)}}}break}}a=o.scan()}var A=e&&e.rangeLimit;if(typeof A!="number"||t.length<=A)return t;e&&e.onRangeLimitExceeded&&e.onRangeLimitExceeded(r.uri);for(var T=[],P=0,L=n;P<L.length;P++){var D=L[P];D<30&&(T[D]=(T[D]||0)+1)}for(var j=0,W=0,w=0;w<T.length;w++){var q=T[w];if(q){if(q+j>A){W=w;break}j+=q}}for(var F=[],w=0;w<t.length;w++){var D=n[w];typeof D=="number"&&(D<W||D===W&&j++<A)&&F.push(t[w])}return F}function nM(r,e,t){function n(a){for(var l=r.offsetAt(a),c=t.getNodeFromOffset(l,!0),u=[];c;){switch(c.type){case"string":case"object":case"array":var h=c.offset+1,d=c.offset+c.length-1;h<d&&l>=h&&l<=d&&u.push(i(h,d)),u.push(i(c.offset,c.offset+c.length));break;case"number":case"boolean":case"null":case"property":u.push(i(c.offset,c.offset+c.length));break}if(c.type==="property"||c.parent&&c.parent.type==="array"){var p=o(c.offset+c.length,5);p!==-1&&u.push(i(c.offset,p))}c=c.parent}for(var m=void 0,y=u.length-1;y>=0;y--)m=Vl.create(u[y],m);return m||(m=Vl.create(Ue.create(a,a))),m}function i(a,l){return Ue.create(r.positionAt(a),r.positionAt(l))}var s=bs(r.getText(),!0);function o(a,l){s.setPosition(a);var c=s.scan();return c===l?s.getTokenOffset()+s.getTokenLength():-1}return e.map(n)}function iM(r){var e=r.promiseConstructor||Promise,t=new YP(r.schemaRequestService,r.workspaceContext,e);t.setSchemaContributions(tM);var n=new MP(t,r.contributions,e,r.clientCapabilities),i=new IP(t,r.contributions,e),s=new eM(t),o=new JP(t,e);return{configure:function(a){t.clearExternalSchemas(),a.schemas&&a.schemas.forEach(function(l){t.registerExternalSchema(l.uri,l.fileMatch,l.schema)}),o.configure(a)},resetSchema:function(a){return t.onResourceChange(a)},doValidation:o.doValidation.bind(o),parseJSONDocument:function(a){return CP(a,{collectComments:!0})},newJSONDocument:function(a,l){return AP(a,l)},doComplete:n.doComplete.bind(n),findDocumentSymbols:s.findDocumentSymbols.bind(s),findDocumentSymbols2:s.findDocumentSymbols2.bind(s),findColorSymbols:function(a,l){return s.findDocumentColors(a,l).then(function(c){return c.map(function(u){return u.range})})},findDocumentColors:s.findDocumentColors.bind(s),getColorPresentations:s.getColorPresentations.bind(s),doHover:i.doHover.bind(i),getFoldingRanges:rM,getSelectionRanges:nM,format:function(a,l,c){var u=void 0;if(l){var h=a.offsetAt(l.start),d=a.offsetAt(l.end)-h;u={offset:h,length:d}}var p={tabSize:c?c.tabSize:4,insertSpaces:c?c.insertSpaces:!0,eol:`
230
+ `};return hP(a.getText(),u,p).map(function(m){return Fr.replace(Ue.create(a.positionAt(m.offset),a.positionAt(m.offset+m.length)),m.content)})}}}var sM=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});function oM(r){const e={settings:{background:"var(--bg-overlay)",fontFamily:"var(--code-block-font-family)"},styles:[{tag:[M.propertyName],color:"var(--code-block-tokens-property-string-color)"},{tag:[M.processingInstruction,M.string,M.inserted,M.special(M.string)],color:"var(--code-block-tokens-string-color)"},{tag:[M.atom,M.bool,M.special(M.variableName)],color:"var(--text-secondary)"}]};switch(r){case"light":return Sf(e);case"dark":return XT(e);default:return Sf(e)}}const Hf=iM({});function aM({id:r,schema:e,handleErrors:t}){return Hf.configure({validate:!0,schemas:[{uri:"stub://"+r,fileMatch:["*"],schema:e}]}),TT(n=>sM(this,null,function*(){var i;const s=n.state.doc.toString(),o=Nf.create(r+".json","json",0,s),a=Hf.parseJSONDocument(o),l=yield Hf.doValidation(o,a);return t((i=l?.[0])==null?void 0:i.message),l?.map(c=>{const u=lM(s,c.range.start.line,c.range.start.character);return{from:u,to:u,message:c.message,severity:c.severity}})}))}function lM(r,e,t){const n=r.split(`
231
+ `);let i=0;for(let s=0;s<e-1;s++)i+=n[s].length+1;return i+=t,i}const cM=({onChange:r,onBlur:e,id:t,schema:n,fieldName:i,validate:s,defaultValue:o,mode:a})=>{const{setValue:l,control:c,setError:u,clearErrors:h,getFieldState:d}=(0,gt.Gc)(),p=(0,S.useCallback)(A=>{const{error:T}=d(i);A&&!T?u(i,{message:A}):T&&h(i)},[h,i,d,u]),m=(0,S.useCallback)(A=>{l(i,A),r?.(A)},[i,r,l]),y=(0,S.useCallback)(A=>{e?.(A)},[e]),w=(0,S.useMemo)(()=>[HO(),aM({id:t,schema:n,handleErrors:p})],[p,t,n]);return S.createElement(gt.Qr,{control:c,name:i,rules:{validate:s},defaultValue:o,render:({field:{value:A,ref:T}})=>S.createElement(JT,{ref:T,className:"codemirror-container",value:A||"",onChange:m,onBlur:y,lang:a||ia.Tr.JSON,theme:oM("light"),extensions:w,basicSetup:{bracketMatching:!0,closeBrackets:!0,tabSize:2,foldGutter:!1,lineNumbers:!1,lintKeymap:!0,drawSelection:!1}})})},uM=(0,S.memo)(cM);var zf=f(91582);function fM({mediaType:r,mediaContent:e,properties:t,id:n,resolvedBody:i,getActiveSample:s,validate:o}){const{setValue:a}=(0,gt.Gc)(),l=(0,zf.yN)(e),c=r.examples||{},u=Object.keys(c),h=r.schema,d=Qh(h||{},r.name)||r.name===ia.Tr.MULTIPART||r.name===ia.Tr.URL_ENCODED,{exampleKey:p}=(0,hc.C6)(r.operation,c),m=(0,Ee.YQ)((0,je.P6)(n,r.name,p,c))||(0,je.oY)(c[p],t),y=(0,S.useCallback)((P="",L="",D=[])=>j=>{(0,Ee.WW)((0,je.P6)(n,P,L,D),j)},[n]),w=(0,S.useCallback)(P=>{l?.(P),a("body",s(P))},[a,s,l]),A=(0,S.useCallback)((P,L)=>{a(`body.${P}`,L)},[a]),T=(0,S.useMemo)(()=>(i?.content[r.name]||{}).schema,[r.name,i?.content]);return S.createElement(S.Fragment,null,u.length&&u.length!==1&&S.createElement(hc.b_,{examples:c,onChange:w,exampleKey:p,panel:"try-it"})||null,d?S.createElement(kS,{mediaType:r,onChange:A}):S.createElement(uM,{id:"body"+n,fieldName:"body",defaultValue:m,schema:T,mode:r.name,validate:o,onChange:y(r.name,p,c)}))}const hM=(0,S.memo)(fM);var dM=f(60821),pM=Object.defineProperty,gM=Object.defineProperties,mM=Object.getOwnPropertyDescriptors,hb=Object.getOwnPropertySymbols,vM=Object.prototype.hasOwnProperty,yM=Object.prototype.propertyIsEnumerable,db=(r,e,t)=>e in r?pM(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,bM=(r,e)=>{for(var t in e||(e={}))vM.call(e,t)&&db(r,t,e[t]);if(hb)for(var t of hb(e))yM.call(e,t)&&db(r,t,e[t]);return r},xM=(r,e)=>gM(r,mM(e));function wM({body:{content:r},resolvedBody:e,properties:t,mergeExampleBody:n,id:i,validate:s,pointer:o}){const{setValue:a}=(0,gt.Gc)(),l=(0,$r.Dv)(dM.J8),{examples:c,name:u}=r&&(0,Xr.getActiveMediaType)(r,l)||{},h=(0,S.useCallback)(m=>{if(!r||!r.hasSample||!c?.[m])return"";const y=u&&(0,Ee.YQ)((0,je.P6)(i,u,m,c)),w=y?JSON.parse(y):c?.[m];return(0,je.oY)(w,t)},[u,c,i,r,t]),{activeExampleName:d}=(0,$r.Dv)((0,dc.N)(o));(0,S.useEffect)(()=>{if(t&&!n){a("body",JSON.stringify(t||{},null,2));return}const m=(0,je.P6)(i,u,d,c),y=(0,Ee.YQ)(m)||h(d||"");a("body",typeof y=="object"?JSON.stringify(y,null,2):y)},[c,d,u,a,h,i,t,n]);const p=m=>S.createElement(cS.C,xM(bM({},m),{variant:"dark",fullWidth:!0,Label:hS,Dropdown:fS.Lt}));return S.createElement(S.Fragment,null,S.createElement(uS.d,{content:r,renderDropdown:p},m=>S.createElement(hM,{mediaType:m,mediaContent:r,resolvedBody:e,id:i,properties:t,getActiveSample:h,validate:s})))}const SM=(0,S.memo)(wM),kM=({paramEnum:r,fieldName:e,defaultValue:t})=>{const{control:n,setValue:i}=(0,gt.Gc)(),s=r.map((l,c)=>({idx:c,value:l})),o=l=>{i(e,l.value)},a=()=>{i(e,"")};return S.createElement(gt.Qr,{control:n,name:e,defaultValue:Array.isArray(t)?t[0]:t,render:({field:{value:l}})=>S.createElement(Mr.VD,{clearable:!0,fullWidth:!0,variant:"dark",value:l,options:s,handleClear:a,onChange:o})})},AM=(0,S.memo)(kM),CM=({name:r,param:e,place:t,renderParameter:n})=>{var i,s,o,a,l;const[c,u]=S.useState([]),h=()=>{u([...c,c.length?c[c.length-1]+1:0])},d=m=>{u(c.filter(y=>y!==m))},p=(i=e.schema.items)!=null&&i.fields?(s=e.schema.items)==null?void 0:s.fields:[{schema:((o=e.schema.items)==null?void 0:o.schema)||e.schema.items,name:"",required:e.required,description:(a=e.schema.items)==null?void 0:a.description,externalDocs:(l=e.schema.items)==null?void 0:l.externalDocs,deprecated:!1,toggle:()=>null,expanded:!1}];return S.createElement(S.Fragment,null,S.createElement(pb,null,S.createElement(ve.lX,{required:e.required},r,"(",c.length," items)"),S.createElement("span",{onClick:h},"Add item +")),c?.map((m,y)=>S.createElement(pb,{key:m},p.map(w=>n(w,t,`${r}.[${m}]`,`[${y}]${w.name&&"."+w.name}`,S.createElement(OM,{onClick:()=>d(m)},"Delete"))))))},pb=Je.ZP.div`
256
232
  display: flex;
257
233
  width: 100%;
258
234
  align-items: center;
@@ -273,14 +249,14 @@ $3`);return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ah(t){return t.i
273
249
  color: #fff;
274
250
  }
275
251
  }
276
- `,Qh=Tt.ZP.span`
252
+ `,OM=Je.ZP.span`
277
253
  background: transparent;
278
254
  border: none;
279
255
  cursor: pointer;
280
256
  position: relative;
281
257
  margin-left: 5px;
282
258
  display: inline-block;
283
- `;var Js=(t=>(t.ARRAY="array",t.OBJECT="object",t))(Js||{});function Zh({schema:t,example:n}){return`(${t.type})`+(n?` ${n}`:"")}function qh(t){const n={};return t.forEach(i=>{i.in&&(n[i.in]||(n[i.in]=[]),n[i.in].push(i))}),n}function ep({schema:t,required:n}){return i=>{if(n&&!i)return"Field is required";if(n&&t.type===Js.ARRAY&&Array.isArray(i)){if(i.length>(t.rawSchema&&t.rawSchema.maxItems||1/0))return`Too many items selected, maximum ${t.rawSchema.maxItems}`;if(i.length<(t.rawSchema&&t.rawSchema.minItems||0)){const s=t.rawSchema.minItems;return`You should select at least ${s===1?`${s} item`:`${s} items`}`}}}}function tp(t){if(t.type===Js.ARRAY){const n=t.default||t.example;if(!n&&typeof t.rawSchema.items!="boolean"&&Array.isArray(t.rawSchema.items)){if(t.rawSchema.items[0].default)return[t.rawSchema.items[0].default];if(t.rawSchema.items[0].example)return[t.rawSchema.items[0].example]}if(!n&&typeof t.rawSchema.items!="boolean"&&!Array.isArray(t.rawSchema.items)&&(0,ot.Kn)(t.rawSchema.items)){if(t.rawSchema.items.default)return[t.rawSchema.items.default];if(t.rawSchema.items.example)return[t.rawSchema.items.example]}return n||[]}else return(Number.isInteger(t.default)?t.default.toString():t.default)||t.example}function rp({oneOfType:t}){return t}const np=["path","query","cookie","header"];function ip({id:t,param:n,values:i}){const s=(0,B.useMemo)(()=>ep(n),[n]),u=Array.isArray(n.schema.enum)&&n.schema.enum.length?n.schema.enum:void 0,c=tp(n.schema),h=t.split(".").map(m=>(0,ot.dw)(m));return u?B.createElement(Ge.NI,null,B.createElement(Xh,{initValue:c,paramEnum:u,field:t})):B.createElement(Bt.Xn,{fullWidth:!0,"data-cy":"parameter-input",id:t,field:t,placeholder:Zh(n),validate:s,initialValue:c||(0,ot.U2)(i,h),validateOnBlur:!0,validateOnChange:!0})}function op({values:t,operation:n}){const i=(0,B.useMemo)(()=>qh(n.parameters||[]),[n]),s=(c,h,m,p,y)=>{var T;const L=m?(0,ot.s1)(m,c.name):c.name,q=rp(c.schema),W=m?[h,m]:[c.in],_=(0,ot.s1)(...W,(0,ot.A8)(c.name));return q&&console.warn(`Unsupported parameter definition: "${q}"`),(Array.isArray(c.schema.type)?c.schema.type:[c.schema.type]).includes(Js.ARRAY)?B.createElement(Jh,{key:_,name:L,param:c,place:h,renderParameter:s}):c.schema.type===Js.OBJECT?(T=c.schema.fields)==null?void 0:T.map(ae=>s(ae,h,L)):B.createElement(Ge.NI,{key:_},B.createElement(Ge.lX,{required:c.required},p||L,": ",y),q?B.createElement(Ge.GE,null,"Unsupported field schema definition"):B.createElement(ip,{id:_,param:c,values:t}))},u=c=>{const h=i[c];return!h||!h.length?null:B.createElement(B.Fragment,{key:c},B.createElement(Ge.NI,null,B.createElement(Ge.iG,null," # ",c," parameters "),B.createElement("span",null,"\xA0")),h.map(m=>s(m,c)))};return B.createElement(Ge.iA,null,np.map(u))}var ap=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});function sp(t){return ap(this,null,function*(){return(yield fetch(t)).json()})}const lp=Tt.ZP.div`
259
+ `;var jo=(r=>(r.ARRAY="array",r.OBJECT="object",r))(jo||{});function EM({schema:r,example:e}){return`(${r.type})`+(e?` ${e}`:"")}function TM(r){const e={};return r.forEach(t=>{t.in&&(e[t.in]||(e[t.in]=[]),e[t.in].push(t))}),e}function PM({schema:r,required:e}){return t=>{if(e&&!t)return"Field is required";if(e&&r.type===jo.ARRAY&&Array.isArray(t)){if(t.length>(r.rawSchema&&r.rawSchema.maxItems||1/0))return`Too many items selected, maximum ${r.rawSchema.maxItems}`;if(t.length<(r.rawSchema&&r.rawSchema.minItems||0)){const n=r.rawSchema.minItems;return`You should select at least ${n===1?`${n} item`:`${n} items`}`}}}}function MM(r){if(r.type===jo.ARRAY){const e=r.default||r.example;if(!e&&typeof r.rawSchema.items!="boolean"&&Array.isArray(r.rawSchema.items)){if(r.rawSchema.items[0].default)return[r.rawSchema.items[0].default];if(r.rawSchema.items[0].example)return[r.rawSchema.items[0].example]}if(!e&&typeof r.rawSchema.items!="boolean"&&!Array.isArray(r.rawSchema.items)&&(0,Ee.Kn)(r.rawSchema.items)){if(r.rawSchema.items.default)return[r.rawSchema.items.default];if(r.rawSchema.items.example)return[r.rawSchema.items.example]}return e||[]}else return(Number.isInteger(r.default)?r.default.toString():r.default)||r.example}function IM({oneOfType:r}){return r}const DM=["path","query","cookie","header"];function NM({id:r,param:e,values:t}){const n=(0,S.useMemo)(()=>PM(e),[e]),i=Array.isArray(e.schema.enum)&&e.schema.enum.length?e.schema.enum:void 0,s=MM(e.schema),o=r.split(".").map(a=>(0,Ee.dw)(a));return i?S.createElement(ve.NI,null,S.createElement(AM,{defaultValue:s,paramEnum:i,fieldName:r})):S.createElement(it.Xn,{fullWidth:!0,"data-cy":"parameter-input",id:r,fieldName:r,placeholder:EM(e),rules:{validate:n},defaultValue:s||(0,Ee.U2)(t,o),validateOnBlur:!0,validateOnChange:!0})}function RM({values:r,operation:e}){const t=(0,S.useMemo)(()=>TM(e.parameters||[]),[e]),n=(s,o,a,l,c)=>{var u;const h=a?(0,Ee.s1)(a,s.name):s.name,d=IM(s.schema),p=a?[o,a]:[s.in],m=(0,Ee.s1)(...p,(0,Ee.A8)(s.name));return d&&console.warn(`Unsupported parameter definition: "${d}"`),(Array.isArray(s.schema.type)?s.schema.type:[s.schema.type]).includes(jo.ARRAY)?S.createElement(CM,{key:m,name:h,param:s,place:o,renderParameter:n}):s.schema.type===jo.OBJECT?(u=s.schema.fields)==null?void 0:u.map(w=>n(w,o,h)):S.createElement(ve.NI,{key:m},S.createElement(ve.lX,{required:s.required},l||h,": ",c),d?S.createElement(ve.GE,null,"Unsupported field schema definition"):S.createElement(NM,{id:m,param:s,values:r}))},i=s=>{const o=t[s];return!o||!o.length?null:S.createElement(S.Fragment,{key:s},S.createElement(ve.NI,null,S.createElement(ve.iG,null," # ",s," parameters "),S.createElement("span",null,"\xA0")),o.map(a=>n(a,s)))};return S.createElement(ve.iA,null,DM.map(i))}var LM=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});function BM(r){return LM(this,null,function*(){return(yield fetch(r)).json()})}const FM=Je.ZP.div`
284
260
  position: relative;
285
261
  height: 4px;
286
262
  display: block;
@@ -382,19 +358,19 @@ $3`);return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ah(t){return t.i
382
358
  right: -8%;
383
359
  }
384
360
  }
385
- `,yd=()=>B.createElement(lp,null,B.createElement("div",{className:"indeterminate"})),up=Tt.ZP.div`
361
+ `,gb=()=>S.createElement(FM,null,S.createElement("div",{className:"indeterminate"})),jM=Je.ZP.div`
386
362
  font-family: var(--font-family-monospaced);
387
363
  margin-top: 10px;
388
364
  line-height: 1;
389
365
  padding-left: 10px;
390
366
  border-left: 1px solid gray;
391
- `,fp=Tt.ZP.div`
367
+ `,VM=Je.ZP.div`
392
368
  margin-bottom: 15px;
393
- `,cp=Tt.ZP.div`
369
+ `,WM=Je.ZP.div`
394
370
  padding: 8px 0 20px;
395
- `,dp=Tt.ZP.div`
371
+ `,$M=Je.ZP.div`
396
372
  padding: 4px 0;
397
- `;var hp=Object.defineProperty,pp=Object.defineProperties,vp=Object.getOwnPropertyDescriptors,bd=Object.getOwnPropertySymbols,gp=Object.prototype.hasOwnProperty,mp=Object.prototype.propertyIsEnumerable,xd=(t,n,i)=>n in t?hp(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,yp=(t,n)=>{for(var i in n||(n={}))gp.call(n,i)&&xd(t,i,n[i]);if(bd)for(var i of bd(n))mp.call(n,i)&&xd(t,i,n[i]);return t},bp=(t,n)=>pp(t,vp(n));const xp=Tt.ZP.input`
373
+ `;var HM=Object.defineProperty,zM=Object.defineProperties,UM=Object.getOwnPropertyDescriptors,mb=Object.getOwnPropertySymbols,GM=Object.prototype.hasOwnProperty,KM=Object.prototype.propertyIsEnumerable,vb=(r,e,t)=>e in r?HM(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,YM=(r,e)=>{for(var t in e||(e={}))GM.call(e,t)&&vb(r,t,e[t]);if(mb)for(var t of mb(e))KM.call(e,t)&&vb(r,t,e[t]);return r},JM=(r,e)=>zM(r,UM(e));const QM=Je.ZP.input`
398
374
  cursor: pointer;
399
375
  margin-left: 0;
400
376
  margin-right: 5px;
@@ -403,7 +379,7 @@ $3`);return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ah(t){return t.i
403
379
  align-self: baseline;
404
380
  margin-top: 0;
405
381
  margin-bottom: 0;
406
- `,Sp=Tt.ZP.label`
382
+ `,XM=Je.ZP.label`
407
383
  display: inline-block;
408
384
  cursor: pointer;
409
385
  vertical-align: middle;
@@ -413,27 +389,34 @@ $3`);return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ah(t){return t.i
413
389
 
414
390
  overflow-wrap: break-word;
415
391
  line-height: 20px;
416
- `,wp=Tt.ZP.div`
417
- width: ${({fullWidth:t})=>t?"100%":"50%"};
392
+ `,ZM=Je.ZP.div`
393
+ width: ${({fullWidth:r})=>r?"100%":"50%"};
418
394
  display: inline-flex;
419
395
  align-items: center;
420
396
 
421
397
  & > label {
422
- white-space: ${({nowrap:t})=>t?"nowrap":"normal"};
398
+ white-space: ${({nowrap:r})=>r?"nowrap":"normal"};
423
399
  }
424
400
 
425
- ${({nowrap:t})=>t?"":`
401
+ ${({nowrap:r})=>r?"":`
426
402
  :not(:first-child) {
427
403
  margin-top: 5px;
428
404
  }
429
405
  `}
430
- `;function Cp(t,n){const{fullWidth:i,id:s,label:u,nowrap:c}=t;return B.createElement(wp,{fullWidth:i,nowrap:c},B.createElement(xp,bp(yp({},t),{type:"checkbox",ref:n})),B.createElement(Sp,{htmlFor:s},u))}const Sd=(0,B.forwardRef)(Cp),Ap=11,Op=({items:t,fieldApi:n,validateOnChange:i,maxDisplayedItems:s,showControls:u,trimItemsLength:c})=>{const[h,m]=(0,B.useState)(!0),p=ae=>{const oe=ae.target.value,ue=ae.target.checked;n.setTouched(!0);const ye=n.getValue()||[];let Ae;if(ue)Ae=[...ye,oe];else{const we=ye.indexOf(oe);Ae=[...ye.slice(0,we),...ye.slice(we+1)]}n.setValue(Ae)},y=ae=>n.getValue().includes(ae),T=()=>{m(ae=>!ae)},L=()=>{n.setValue(t)},q=()=>{n.setValue([])},W=n.getError(),_=s||Ap,fe=c&&h?t.slice(0,_):t;return B.createElement("div",null,u?B.createElement(Vt.CodeBlockControls,{controls:{select:{onClick:L,label:"Select all",tooltipText:"Select all checkboxes"},deselect:{onClick:q,label:"Deselect all",tooltipText:"Deselect all checkboxes"}}}):null,B.createElement(Tp,null,fe.map(ae=>B.createElement(Sd,{fullWidth:!0,id:ae,value:ae,checked:y(ae),label:ae,key:ae,onChange:oe=>{p(oe),i&&n.validate()}})),t.length>_&&c?B.createElement(kp,{onClick:()=>{T()}},h?"Show all":"Collapse"):null),W?B.createElement(Ge.Xq,null,W):"")},Ep=(0,Zr.UU)(Op),Tp=Tt.ZP.div`
406
+ `;function _M(r,e){const{fullWidth:t,id:n,label:i,nowrap:s}=r;return S.createElement(ZM,{fullWidth:t,nowrap:s},S.createElement(QM,JM(YM({},r),{type:"checkbox",ref:e})),S.createElement(XM,{htmlFor:n},i))}const yb=(0,S.forwardRef)(_M),qM=11,eI=({fieldName:r,defaultValue:e,items:t,validateOnChange:n,maxDisplayedItems:i,showControls:s,trimItemsLength:o})=>{var a;const{control:l,setValue:c,getValues:u,formState:h,trigger:d}=(0,gt.Gc)(),[p,m]=(0,S.useState)(!0),y=W=>{const q=W.target.value,F=W.target.checked,H=u(r)||[];let Q;if(F)Q=[...H,q];else{const oe=H.indexOf(q);Q=[...H.slice(0,oe),...H.slice(oe+1)]}c(r,Q)},w=W=>u(r).includes(W),A=()=>{m(W=>!W)},T=()=>{c(r,t)},P=()=>{c(r,[])},L=(a=h.errors[r])==null?void 0:a.message,D=i||qM,j=o&&p?t.slice(0,D):t;return S.createElement("div",null,s?S.createElement(pt.CodeBlockControls,{controls:{select:{onClick:T,label:"Select all",tooltipText:"Select all checkboxes"},deselect:{onClick:P,label:"Deselect all",tooltipText:"Deselect all checkboxes"}}}):null,S.createElement(rI,null,S.createElement(gt.Qr,{control:l,name:r,defaultValue:e,render:()=>S.createElement(S.Fragment,null,j.map(W=>S.createElement(yb,{fullWidth:!0,id:W,value:W,checked:w(W),label:W,key:W,onChange:q=>{y(q),n&&d(r)}})))}),t.length>D&&o?S.createElement(nI,{onClick:()=>{A()}},p?"Show all":"Collapse"):null),L?S.createElement(ve.Xq,null,L):"")},tI=(0,S.memo)(eI),rI=Je.ZP.div`
431
407
  padding: 10px;
432
408
  border: 1px solid var(--border-primary);
433
409
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
434
- `,kp=(0,Tt.ZP)(Vt.CodeBlockControlButton)`
410
+ `,nI=(0,Je.ZP)(pt.CodeBlockControlButton)`
435
411
  float: right;
436
- `;function wd(t){const{scopes:n,id:i}=t;let s=[];try{s=JSON.parse((0,ot.YQ)(`auth.${i}.scopes`))}catch{}return!n||!n.length?B.createElement(B.Fragment,null):B.createElement(Ge.NI,null,B.createElement(Ge.lX,null," Scopes: "),B.createElement(Ep,{field:`auth.${i}.scopes`,initialValue:s,items:n,showControls:!0,trimItemsLength:!0}))}const Pp=({token:t,loading:n,error:i})=>n?B.createElement(Ge.GE,null,"Please, finish your authorization flow or cancel authorization."):i?B.createElement(up,null,B.createElement(Ge.Xq,null,i)):t?.access_token?null:B.createElement(Ge.GE,null," No Access Token. Please, Authorize. ");var Lp=Object.defineProperty,Ip=Object.defineProperties,Mp=Object.getOwnPropertyDescriptors,Cd=Object.getOwnPropertySymbols,Np=Object.prototype.hasOwnProperty,Dp=Object.prototype.propertyIsEnumerable,Ad=(t,n,i)=>n in t?Lp(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,_u=(t,n)=>{for(var i in n||(n={}))Np.call(n,i)&&Ad(t,i,n[i]);if(Cd)for(var i of Cd(n))Dp.call(n,i)&&Ad(t,i,n[i]);return t},cc=(t,n)=>Ip(t,Mp(n)),Fp=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});function Rp(t){if(!t)return"Field is required"}const Vu=({usePkce:t,form:n,id:i,formApi:s,flow:u,tokenUrl:c,authCorsProxyUrl:h,tokenEndpointAuthMethod:m,server:p,scopes:y,authorizationUrl:T,defaultValues:L,clientId:q})=>{var W,_,fe,ae;const{oAuth2RedirectURI:oe,routingBasePath:ue}=(0,wn.Dv)(An.qd),[ye,Ae]=(0,B.useState)(null),[we,ke]=(0,B.useState)(!1),[Te,De]=(0,B.useState)(!1),[pe,Ie]=(0,B.useState)(void 0),[Ee,Be]=(0,B.useState)(void 0),[et,jt]=(0,B.useState)(void 0),ut=((_=(W=n.values)==null?void 0:W.auth)==null?void 0:_[i])||{},jr=((ae=(fe=n.errors)==null?void 0:fe.auth)==null?void 0:ae[i])||{},ei=pe!==void 0&&Ee!==et?{label:"sync",onClick:()=>{pe&&Be(et)}}:void 0;(0,B.useEffect)(()=>{if(t){const hr=(0,sn.CY)(43);fu(hr).then(Kr=>{Ie(hr),Be(Kr),jt(Kr)})}},[t]);const ji=hr=>{if(!hr||(s.validate(),!(0,sn.Qr)(jr)))return;ke(!0),Ae(null);const Kr=h?h+(0,gt.jg)(hr):hr,Bn=h&&c?h+(0,gt.jg)(c):c,na=s.getValue(`auth.${i}.scopes`),Ao={authorizationUrl:Kr.startsWith("http")?Kr:p+Kr,clientId:ut.client_id,scopes:na,redirectUri:oe,routingBasePath:ue,successCallback:ri=>{s.setValue(`auth.${i}.token`,ri),ke(!1),Ae(null)},errorCallback:ri=>{ke(!1),Ae(ri?.message||"Failed to retrieve the access token")}};if(u==="implicit"&&ln.authorizeImplicit(Ao),!(0,gt.xl)(m)){console.log(`Unsupported token endpoint auth method: ${m}`);return}u==="authorizationCode"&&ln.authorizeAuthorizationCode(_u(cc(_u({},Ao),{tokenUrl:Bn?.startsWith("http")?Bn:p+Bn,clientSecret:ut.client_secret,extraHeaders:(0,gt.Or)({authMethod:m,clientId:ut.client_id,clientSecret:ut.client_secret})}),t&&{codeVerifier:pe,codeChallenge:Ee}))},ti=()=>{En(),Ae(null)},Wr=()=>{ke(!1),Ae(null),ln.clearRedirectData(u)},En=()=>{s.setValue(`auth.${i}.token`,"")},qt=()=>{De(hr=>!hr)},Gr=hr=>Fp(void 0,[hr],function*({target:{value:Kr}}){const Bn=yield fu(Kr);Ie(Kr),jt(Bn)});if(!T)return B.createElement(Ge.Xq,null,"No flow info");let Ar=(0,ot.YQ)(`auth.${i}.token`)||JSON.stringify(L?.token);Ar=Ar?JSON.parse(Ar):"";const Tn=(0,ot.Al)(i,"client_id"),Rn={field:`auth.${i}.client_id`,fullWidth:!0,initialValue:(0,ot.YQ)(`auth.${i}.client_id`)||q||L?.client_id,initValue:(0,ot.YQ)(`auth.${i}.client_id`)||q||L?.client_id,placeholder:"Your OAuth2 app Client ID",validate:Rp,validateOnBlur:!0,validateOnChange:!0};return B.createElement("div",null,B.createElement(Ge.n5,null,B.createElement(Ge.NI,null,B.createElement(Ge.lX,null," Client ID: "),Tn?B.createElement(Bt.F0,cc(_u({},Rn),{options:Tn})):B.createElement(Bt.Xn,cc(_u({},Rn),{"data-cy":"client-id-input",panel:"try-it"}))),u==="authorizationCode"&&B.createElement(B.Fragment,null,(!t?.hideClientSecretInput||!t)&&B.createElement(Ge.NI,null,B.createElement(Ge.lX,null,"Client Secret:"),B.createElement(Bt.Xn,{type:"password",fullWidth:!0,field:`auth.${i}.client_secret`,initialValue:(0,ot.YQ)(`auth.${i}.client_secret`)||L?.client_secret,validateOnBlur:!0,validateOnChange:!0,panel:"try-it","data-cy":"client-secret-input"})),t&&!t.disableManualConfiguration&&B.createElement(cp,null,B.createElement(Sd,{id:"pkce-opitons-toggle",label:"Configure PKCE manually",checked:Te,onChange:qt,"data-cy":"pkce-options-toggle"}),Te&&B.createElement(dp,null,B.createElement(Ge.NI,null,B.createElement(Ge.lX,null,"Code Verifier"),B.createElement(Bt.nv,{fullWidth:!0,value:pe,onChange:Gr,panel:"try-it","data-cy":"code-verifier-input"})),B.createElement(Ge.NI,null,B.createElement(Ge.lX,null,"Code Challenge"),B.createElement(Bt.nv,{fullWidth:!0,value:Ee,onChange:({target:{value:hr}})=>{Be(hr)},inputActionButton:ei,panel:"try-it","data-cy":"code-challenge-input"}))))),B.createElement(Bt.Xn,{fullWidth:!0,field:`auth.${i}.token`,type:"hidden",initialValue:Ar,panel:"try-it"}),B.createElement(wd,{id:i,scopes:y}),ut.token&&ut.token.access_token?B.createElement(Ge.NI,null,B.createElement(Ge.lX,null," Access Token: "),B.createElement(Bt.nv,{disabled:!0,type:"password",fullWidth:!0,value:ut.token.access_token,panel:"try-it"})):null),B.createElement(fp,null,ut.token&&ut.token.access_token?B.createElement(Vt.Button,{fullWidth:!0,onClick:ti},"Log out"):we?B.createElement(B.Fragment,null,B.createElement(Vt.Button,{fullWidth:!0,onClick:Wr},"Cancel"),B.createElement(yd,null)):B.createElement(Vt.Button,{fullWidth:!0,disabled:!(0,sn.Qr)(jr),onClick:()=>{ji(T)}},"Authorize")),we||ye||!ut.token||!ut.token.access_token&&B.createElement(Pp,{loading:we,error:ye,token:ut.token}))};var Bp=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});function jp(t){var n,i;const{scheme:s,defaultValues:u}=t,[c,h]=(0,B.useState)({}),[m,p]=(0,B.useState)(),[y,T]=(0,B.useState)(!1);(0,B.useEffect)(()=>{L(s.openIdConnectUrl)},[s.openIdConnectUrl]);const L=q=>Bp(this,null,function*(){T(!0),p("");try{const W=yield sp(q);h(W)}catch(W){p(W.message)}T(!1)});return y?B.createElement(Wp,null):m?B.createElement(Od,{message:m}):B.createElement("div",null,B.createElement("div",null,(n=c?.response_types_supported)!=null&&n.includes("token")?B.createElement(B.Fragment,null,B.createElement(Qr.S6,null,"OAuth2 Implicit Flow"),B.createElement(Vu,{key:t.id,authorizationUrl:c.authorization_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:c.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,flow:"implicit",defaultValues:u})):(i=c?.response_types_supported)!=null&&i.includes("code")?B.createElement(B.Fragment,null,B.createElement(Qr.S6,null,"OAuth2 Authorization Flow"),B.createElement(Vu,{key:t.id,authorizationUrl:c.authorization_endpoint,tokenUrl:c.token_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:c.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,tokenEndpointAuthMethod:c?.token_endpoint_auth_methods_supported,flow:"authorizationCode",defaultValues:u})):B.createElement("div",null,"Unsupported flow")))}function Wp(){return B.createElement("div",null,B.createElement("div",null,B.createElement("div",null,"Fetching OpenID Connect metadata..."),B.createElement(yd,null)))}function Od({message:t}){return B.createElement("div",null,B.createElement("div",null,B.createElement(Ge.Xq,null,t)))}var Hp=Object.defineProperty,Up=Object.defineProperties,zp=Object.getOwnPropertyDescriptors,Ed=Object.getOwnPropertySymbols,_p=Object.prototype.hasOwnProperty,Vp=Object.prototype.propertyIsEnumerable,Td=(t,n,i)=>n in t?Hp(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,kd=(t,n)=>{for(var i in n||(n={}))_p.call(n,i)&&Td(t,i,n[i]);if(Ed)for(var i of Ed(n))Vp.call(n,i)&&Td(t,i,n[i]);return t},Pd=(t,n)=>Up(t,zp(n)),$p=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});function Gp(t){if(!t)return"Token is required"}const Kp=({form:t,id:n,formApi:i,server:s,flow:u,authCorsProxyUrl:c,defaultValues:h,clientId:m})=>{var p,y,T,L;const[q,W]=(0,B.useState)(""),[_,fe]=(0,B.useState)(!1),[ae,oe]=(0,B.useState)(!0),ue=((y=(p=t?.values)==null?void 0:p.auth)==null?void 0:y[n])||{},ye=((L=(T=t.errors)==null?void 0:T.auth)==null?void 0:L[n])||{},Ae=()=>{i.setValue(`auth.${n}.token`,""),(0,ot.WW)(`auth.${n}.token`,"")},we=()=>{oe(Ee=>!Ee)},ke=()=>$p(void 0,null,function*(){if(_)return;const Ee=c&&u.tokenUrl?c+(0,gt.jg)(u.tokenUrl):u.tokenUrl;if(ye.client_id||ye.client_secret){console.log("Provide client_id and client_secret");return}const Be=ue.client_id,et=ue.client_secret;if(!Be||!et){console.log("Provide client_id and client_secret");return}fe(!0);const jt=u["x-tokenEndpointAuthMethod"];if(!(0,gt.xl)(jt)){console.log(`Unsupported token endpoint auth method: ${jt}`);return}yield ln.authorizeClientCredentials({tokenUrl:Ee.startsWith("http")?Ee:s+Ee,clientId:Be,clientSecret:et,scopes:ue.scopes,extraHeaders:(0,gt.Or)({authMethod:jt,clientId:Be,clientSecret:et}),successCallback:ut=>{i.setValue(`auth.${n}.token`,ut),fe(!1)},errorCallback:ut=>{Ae(),W(ut.message),fe(!1)}})}),Te=Object.keys(u.scopes);let De=(0,ot.YQ)(`auth.${n}.token`)||JSON.stringify(h?.token);De=De?JSON.parse(De):"";const pe=(0,ot.Al)(n,"client_id"),Ie={field:`auth.${n}.client_id`,fullWidth:!0,initialValue:(0,ot.YQ)(`auth.${n}.client_id`)||m||h?.client_id,initValue:(0,ot.YQ)(`auth.${n}.client_id`)||m||h?.client_id,placeholder:"Your OAuth2 app Client ID"};return B.createElement(B.Fragment,null,B.createElement(Ge.n5,null,B.createElement(Ge.NI,null,B.createElement(Ge.lX,null,"Client ID:"),pe?B.createElement(Bt.F0,Pd(kd({},Ie),{options:pe})):B.createElement(Bt.Xn,Pd(kd({},Ie),{type:"password",panel:"try-it"}))),B.createElement(Ge.NI,null,B.createElement(Ge.lX,null,"Client Secret:"),B.createElement(Bt.Xn,{type:"password",fullWidth:!0,field:`auth.${n}.client_secret`,initialValue:(0,ot.YQ)(`auth.${n}.client_secret`)||h?.client_secret,panel:"try-it"})),B.createElement(Bt.Xn,{fullWidth:!0,field:`auth.${n}.token`,type:"hidden",initialValue:De,validate:Gp}),B.createElement(wd,{id:n,scopes:Te})),B.createElement(Vt.Button,{color:"primary",onClick:ke,blinking:_},_?"Loading...":"Request Token"),B.createElement(Ge.ph,null," Access Token "),q?B.createElement(Ge.Xq,{style:{marginBottom:"1em"}},"Failed to request token: ",B.createElement("pre",null,q)," "):ue.token&&ue.token.access_token?B.createElement(Ge.TR,null,B.createElement(Ge.WA,{length:ue.token.access_token.length,masked:ae},ue.token.access_token),B.createElement(Ge.lf,{onClick:we},ae?"Show":"Hide"," "),B.createElement(Ge.h,{onClick:Ae}," Clear ")):B.createElement(Ge.Xq,{style:{marginBottom:"1em"}},"No token"))};var Yp=Object.defineProperty,Xp=Object.defineProperties,Jp=Object.getOwnPropertyDescriptors,Ld=Object.getOwnPropertySymbols,Qp=Object.prototype.hasOwnProperty,Zp=Object.prototype.propertyIsEnumerable,Id=(t,n,i)=>n in t?Yp(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,$a=(t,n)=>{for(var i in n||(n={}))Qp.call(n,i)&&Id(t,i,n[i]);if(Ld)for(var i of Ld(n))Zp.call(n,i)&&Id(t,i,n[i]);return t},Ga=(t,n)=>Xp(t,Jp(n));const qp=({securityDefaults:t,operation:n,activeServer:i,authCorsProxyUrl:s,form:u,formApi:c})=>{var h,m;const[p,y]=(0,B.useState)(0),{parser:T}=(0,wn.Dv)(An.eG);(0,B.useEffect)(()=>{const oe=n.security.map(Ae=>Ae.schemes.map(we=>we.id).join(" and ")),ue=(0,ot.YQ)("securityRequirementName"),ye=oe.findIndex(Ae=>Ae===ue);y(ye<0?0:ye)},[n]);const L=oe=>{y(oe.idx),(0,ot.WW)("securityRequirementName",oe.value)},q=n.security,_=q.map(oe=>oe.schemes.map(ue=>ue.id).join(" and ")).filter(Boolean).map((oe,ue)=>({value:oe,idx:ue}));if(_.length===0)return B.createElement(Od,{message:"Cannot find security schema in the definition"});const fe=q[p],ae=(0,ot.A8)(fe.schemes[0].id);return B.createElement(B.Fragment,null,B.createElement(Ge.n5,null,_.length>1&&B.createElement(Ge.NI,null,B.createElement(Ge.lX,null," Security scheme: "),B.createElement(Qr.VD,{variant:"dark",fullWidth:!0,options:_,value:_[p].value,onChange:L}))||null,B.createElement(Vt.TryItSecurityApps,{apiId:(m=(h=T?.definition.info)==null?void 0:h["x-metadata"])==null?void 0:m.apiId,value:c.getValue(`auth.${ae}`),onChange:oe=>{c.setValue(`auth.${ae}`,oe)}}),q[p].schemes.map(oe=>{var ue,ye,Ae,we,ke,Te,De;const pe=(0,ot.A8)(oe.id);if(oe.type==="apiKey"){const Ie=(0,ot.Al)(pe,""),Ee={field:`auth.${pe}`,fullWidth:!0,initialValue:(0,gt.NG)(oe)||(0,ot.YQ)(`auth.${pe}`)||t?.[pe],initValue:(0,gt.NG)(oe)||(0,ot.YQ)(`auth.${pe}`)||t?.[pe],validate:gt.np,validateOnBlur:!0,validateOnChange:!0};return B.createElement(Ge.NI,{key:pe},B.createElement(Ge.lX,null," ",oe.name,": "),Ie?B.createElement(Bt.F0,Ga($a({},Ee),{options:Ie})):B.createElement(Bt.Xn,Ga($a({},Ee),{type:"password",panel:"try-it","data-cy":"apiKey-auth-password"})))}else if(oe.type==="http"){if(oe.scheme==="basic"){const Ie=(0,ot.Al)(pe,"username"),Ee={field:`auth.${pe}.username`,fullWidth:!0,initialValue:(0,ot.YQ)(`auth.${pe}.username`)||((ue=t?.[pe])==null?void 0:ue.username),initValue:(0,ot.YQ)(`auth.${pe}.username`)||((ye=t?.[pe])==null?void 0:ye.username),validate:gt.np,validateOnBlur:!0,validateOnChange:!0};return B.createElement(B.Fragment,{key:pe},B.createElement(Ge.NI,null,B.createElement(Ge.lX,null," ",(0,Uo.l)("tryItAuthBasicUsername"),": "),Ie?B.createElement(Bt.F0,Ga($a({},Ee),{options:Ie})):B.createElement(Bt.Xn,Ga($a({},Ee),{panel:"try-it"}))),B.createElement(Ge.NI,null,B.createElement(Ge.lX,null," ",(0,Uo.l)("tryItAuthBasicPassword"),": "),B.createElement(Bt.Xn,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:`auth.${pe}.password`,initialValue:(0,ot.YQ)(`auth.${pe}.password`)||((Ae=t?.[pe])==null?void 0:Ae.password)||"",validateOnBlur:!0,validateOnChange:!0,panel:"try-it"})))}else if(oe.scheme==="bearer"){const Ie=(0,ot.Al)(pe,""),Ee={field:`auth.${pe}`,fullWidth:!0,initialValue:(0,ot.YQ)(`auth.${pe}`)||t?.[pe],initValue:(0,ot.YQ)(`auth.${pe}`)||t?.[pe],validate:gt.np,validateOnBlur:!0,validateOnChange:!0};return B.createElement(B.Fragment,{key:pe},B.createElement(Ge.NI,null,B.createElement(Ge.lX,null," Bearer Token: "),Ie?B.createElement(Bt.F0,Ga($a({},Ee),{options:Ie})):B.createElement(Bt.Xn,Ga($a({},Ee),{type:"password",placeholder:"(without 'Bearer')",panel:"try-it"}))))}}else{if(oe.type==="oauth2"&&oe.flows&&oe.flows.clientCredentials)return B.createElement(Kp,{key:pe,flow:oe.flows.clientCredentials,server:i,authCorsProxyUrl:s,id:pe,form:u,formApi:c,clientId:oe.flows.clientCredentials["x-defaultClientId"]||oe["x-defaultClientId"],defaultValues:t?.[pe]});if(oe.type==="oauth2"&&oe.flows&&oe.flows.implicit)return B.createElement(Vu,{key:pe,authorizationUrl:oe.flows.implicit.authorizationUrl,authCorsProxyUrl:s,scopes:Object.keys(((ke=(we=oe?.flows)==null?void 0:we.implicit)==null?void 0:ke.scopes)||{}),server:i,id:pe,form:u,formApi:c,clientId:oe.flows.implicit["x-defaultClientId"]||oe["x-defaultClientId"],flow:"implicit",defaultValues:t?.[pe]});if(oe.type==="oauth2"&&oe.flows&&oe.flows.authorizationCode)return B.createElement(Vu,{key:pe,authorizationUrl:oe.flows.authorizationCode.authorizationUrl,tokenUrl:oe.flows.authorizationCode.tokenUrl,authCorsProxyUrl:s,scopes:Object.keys(((Te=oe.flows.authorizationCode)==null?void 0:Te.scopes)||{}),server:i,id:pe,form:u,formApi:c,clientId:oe.flows.authorizationCode["x-defaultClientId"]||oe["x-defaultClientId"],flow:"authorizationCode",tokenEndpointAuthMethod:oe.flows.authorizationCode["x-tokenEndpointAuthMethod"],usePkce:oe.flows.authorizationCode["x-usePkce"],defaultValues:t?.[pe]});if(oe.type==="oauth2"){let Ie=(0,ot.YQ)(`auth.${pe}.token`)||JSON.stringify((De=t?.[pe])==null?void 0:De.token);return Ie=Ie?JSON.parse(Ie):{},B.createElement(B.Fragment,{key:pe},B.createElement(Ge.NI,null,B.createElement(Ge.lX,null," Access Token Type: "),B.createElement(Bt.Xn,{fullWidth:!0,field:`auth.${pe}.token.token_type`,initialValue:Ie.token_type||"Bearer",panel:"try-it"})),B.createElement(Ge.NI,null,B.createElement(Ge.lX,null," Access Token: "),B.createElement(Bt.Xn,{type:"password",fullWidth:!0,field:`auth.${pe}.token.access_token`,validate:gt.np,initialValue:Ie.access_token,validateOnBlur:!0,validateOnChange:!0,panel:"try-it"})))}else if(oe.type==="openIdConnect")return B.createElement(jp,{key:pe,server:i,authCorsProxyUrl:s,id:pe,form:u,formApi:c,scheme:oe,clientId:oe["x-defaultClientId"],defaultValues:t?.[pe]})}})),B.createElement("small",null,B.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))};var ev=f(55919),tv=Object.defineProperty,Md=Object.getOwnPropertySymbols,rv=Object.prototype.hasOwnProperty,nv=Object.prototype.propertyIsEnumerable,Nd=(t,n,i)=>n in t?tv(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,iv=(t,n)=>{for(var i in n||(n={}))rv.call(n,i)&&Nd(t,i,n[i]);if(Md)for(var i of Md(n))nv.call(n,i)&&Nd(t,i,n[i]);return t};function ov({operation:t,properties:n,mergeExampleBody:i,securityDefaults:s,form:u,resolvedRawSpec:c,server:h,formApi:m,setFormApi:p,handleChange:y,handleServerChange:T}){const L=u.errors||{},q=L.path||L.cookie||L.header||L.query,{hooks:W,authCorsProxyUrl:_}=(0,wn.Dv)(An.qd),fe=c&&ot.IB.get(c,t.pointer);let ae=u.values&&u.values.auth&&Object.keys(u.values.auth)[0];(!ae||!u.values.auth[ae])&&(ae=void 0),ae&&(u.values.auth[ae].token!==void 0||u.values.auth[ae].client_id!==void 0||u.values.auth[ae].client_secret!==void 0)&&(!u.values.auth[ae].token||!u.values.auth[ae].token.access_token)&&(ae=void 0),ae&&u.values.auth[ae].username!=null&&(!u.values.auth[ae].username||!u.values.auth[ae].password)&&(ae=void 0);const oe=t.parameters||[];return!c&&B.createElement(B.Fragment,null,"Loading...")||B.createElement(Zr.l0,{onChange:y,getApi:p,style:{flex:1,display:"flex",flexDirection:"column",margin:0}},B.createElement(Rs,{operation:t,onChange:T}),B.createElement(Ii.UQ,{initialActiveIdx:t.security.length&&ae?1:0},t.security.length&&m&&B.createElement(js,{header:(0,Uo.l)("tryItAuth"),"data-cy":"security-trigger",error:!ae&&!!L.auth,success:!!ae,renderChildrenHidden:!0},Vt.OpenApiTryItSecurityPanel||W?.ReplaceTryItSecurityPanel?B.createElement(av,{field:"auth",validate:gt.np},ue=>B.createElement(ev.Q,{Hook:Vt.OpenApiTryItSecurityPanel||W?.ReplaceTryItSecurityPanel,props:{server:h,operation:t,onChange:ue,OAuth2:ln}})):B.createElement(qp,{formApi:m,form:u,operation:t,activeServer:h.url,authCorsProxyUrl:_,securityDefaults:s}))||null,t.requestBody&&m&&B.createElement(js,{header:(0,Uo.l)("tryItBody"),"data-cy":"body-trigger",error:!!L.body,renderChildrenHidden:!0},B.createElement(Kh,{validate:sv,formApi:m,body:t.requestBody,pointer:t.pointer,id:t.id,resolvedBody:fe?.requestBody,properties:n,mergeExampleBody:i}))||null,oe.length&&B.createElement(js,{header:(0,Uo.l)("tryItParameters"),"data-cy":"parameters-trigger",error:q,renderChildrenHidden:!0},B.createElement(op,{operation:t,values:u.values,errors:u.errors||{}}))||null))}function av(t){const{fieldApi:n,render:i,userProps:s}=(0,Zr.U$)(iv({},t)),{setValue:u}=n,{children:c}=s;return i(B.createElement(B.Fragment,null,c(u)))}function sv(){}const lv=(0,B.memo)(ov);function uv({shaking:t,className:n,children:i,rootElement:s}){const[u]=(0,fc.Bs)(s),c=(0,wn.Dv)(An.qd);return B.createElement(Qr.q2,{scrollYOffset:c.scrollYOffset,shaking:t,className:n,"data-cy":"console",fullWidth:u?.width},i)}const fv=(0,B.memo)(uv);var cv=Object.defineProperty,dv=Object.defineProperties,hv=Object.getOwnPropertyDescriptors,$u=Object.getOwnPropertySymbols,Dd=Object.prototype.hasOwnProperty,Fd=Object.prototype.propertyIsEnumerable,Rd=(t,n,i)=>n in t?cv(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,vr=(t,n)=>{for(var i in n||(n={}))Dd.call(n,i)&&Rd(t,i,n[i]);if($u)for(var i of $u(n))Fd.call(n,i)&&Rd(t,i,n[i]);return t},qr=(t,n)=>dv(t,hv(n)),Bd=(t,n)=>{var i={};for(var s in t)Dd.call(t,s)&&n.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&$u)for(var s of $u(t))n.indexOf(s)<0&&Fd.call(t,s)&&(i[s]=t[s]);return i},jd=(t,n,i)=>new Promise((s,u)=>{var c=p=>{try{m(i.next(p))}catch(y){u(y)}},h=p=>{try{m(i.throw(p))}catch(y){u(y)}},m=p=>p.done?s(p.value):Promise.resolve(p.value).then(c,h);m((i=i.apply(t,n)).next())});function Wd(t){return t.startsWith("//")?"https:"+t:t}function pv({operation:t,onResponse:n,className:i,rootElement:s,properties:u,mergeExampleBody:c,securityDefaults:h,onClose:m}){let p=(0,B.useRef)();const[y,T]=(0,wn.KO)((0,Us.N)(t.pointer)),[L,q]=(0,B.useState)(y.activeServer||t.activeServer),[W,_]=(0,B.useState)(0),[fe,ae]=(0,B.useState)(!1),[oe,ue]=(0,B.useState)(!1),[ye,Ae]=(0,B.useState)({values:{path:(0,gt.ZS)(t.parameters,"path"),cookie:(0,gt.ZS)(t.parameters,"cookie"),header:(0,gt.ZS)(t.parameters,"header"),query:(0,gt.ZS)(t.parameters,"query")}}),[we,ke]=(0,B.useState)(),[Te,De]=(0,B.useState)(),[pe,Ie]=(0,B.useState)(),[Ee,Be]=(0,B.useState)(),et=(0,fc.D9)(t),{parser:jt,options:ut}=(0,wn.Dv)(An.eG),jr=(0,B.useCallback)((qt,Gr=qt.getState())=>{var Ar=Gr,{values:Tn}=Ar,Rn=Bd(Ar,["values"]);p.current=qt,setTimeout(()=>{Ae(qr(vr({},Rn),{values:qr(vr({},Tn),{query:(0,gt.FU)(Tn.query||{})})}))},0)},[]),ei=(0,B.useCallback)(qt=>{var Gr=qt,{values:Ar}=Gr,Tn=Bd(Gr,["values"]);const Rn=qr(vr({},Tn),{values:qr(vr({},Ar),{query:(0,gt.FU)(Ar.query||{})})});T(hr=>qr(vr({},hr),{requestValues:JSON.parse(JSON.stringify(Ar))})),Ae(Rn),(0,gt.Hc)(Rn)},[T]),ji=(0,B.useCallback)(qt=>{_(qt)},[]),ti=(0,B.useCallback)(qt=>{q(qt),T(Gr=>qr(vr({},Gr),{activeServer:qt}))},[T]),Wr=(0,B.useCallback)(()=>jd(this,null,function*(){var qt,Gr,Ar,Tn,Rn,hr,Kr,Bn,na,Ao,ri,Qs,Gu,Zs,Ka,dc,Hd;const{values:Wi,invalid:gv}=((qt=p?.current)==null?void 0:qt.getState())||ye||{};if((Gr=p.current)==null||Gr.submitForm(),gv){ue(!0),setTimeout(()=>ue(!1),1e3),(Tn=(Ar=ut.events)==null?void 0:Ar.tryItSent)==null||Tn.call(Ar,{eventType:fr.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:t.operationId,operationPath:t.path,operationHttpVerb:t.httpVerb,operationSummary:t.description});return}const{servers:qs,requestBody:Ya}=t,mv=Ya&&Ya.content&&((Rn=(0,Cn.getActiveMediaType)(Ya.content))==null?void 0:Rn.name)||"";let Xa=Wi.body;if(/json/.test(mv))try{Xa=JSON.parse(Xa)}catch(Nt){console.error(Nt)}ae(!0);const jn=we,Ud=(t.httpVerb||"").toLowerCase();if(!qs)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 hc=qs.find(Nt=>L.url.endsWith(Nt.url.endsWith("/")?Nt.url.substring(0,Nt.url.length-1):Nt.url)),yv=Date.now();let Hi,Ja=Wi.auth;if(Wi.auth){const Nt=Object.keys(Wi.auth)[0],gi=(0,Rf.dw)(Nt);Hi=qr(vr({},jn),{components:qr(vr({},jn?.components),{securitySchemes:qr(vr({},(hr=jn?.components)==null?void 0:hr.securitySchemes),{[gi]:qr(vr({},(Bn=(Kr=jn?.components)==null?void 0:Kr.securitySchemes)==null?void 0:Bn[gi]),{type:((ri=(Ao=(na=jn?.components)==null?void 0:na.securitySchemes)==null?void 0:Ao[gi])==null?void 0:ri.type)==="openIdConnect"?"oauth2":((Gu=(Qs=jn?.components)==null?void 0:Qs.securitySchemes)==null?void 0:Gu[gi]).type})})})}),Ja=qr(vr({},Ja),{[gi]:Ja[Nt]})}else Hi=vr({},jn);Hi.servers=qs;const Ku=ut.corsProxyUrl;Ku&&qs.length&&(Hi.servers=qs.map(Nt=>qr(vr({},Nt),{url:Ku+Wd(Nt.url)})),Hi.paths=qr(vr({},Hi.paths),{[t.path]:qr(vr({},Hi.paths[t.path]),{[Ud]:qr(vr({},Hi.paths[t.path][Ud]),{servers:void 0}),servers:void 0})}));const pc=Ya?.content&&((Zs=(0,Cn.getActiveMediaType)(Ya.content))==null?void 0:Zs.name)||null;if(pc&&Xa&&Ni(pc)){const Nt=Object.values(Xa);Xa=Nt.length>1?Nt:Nt[0]}const vc={server:Ku?Ku+Wd(hc.url):hc.url,serverVariables:(0,gt.mj)(hc),spec:Hi,pathName:t.path,method:t.httpVerb,parameters:vr(vr(vr(vr({},Wi.path),Wi.query),Wi.header),Wi.cookie),securities:{authorized:Ja},requestBody:Xa,requestContentType:pc,responseContentType:((Ka=Wi.header)==null?void 0:Ka.Accept)||null,requestInterceptor:(0,gt.Tz)(ut,t,Ja?.Authorization)};try{const Nt=yield Mf(vc),gi=Nt?.data;gi instanceof Blob&&(Ni(gi.type)&&(Nt.fileInfo={rawData:gi,fileName:(0,gt.AM)(Nt.headers)}),Nt.data=yield gi.text()),n?.({request:vc,response:Nt}),Be(Nt),Ie(void 0)}catch(Nt){Nt&&Nt.response&&Nt.response.data instanceof Blob&&(Nt.response.data=yield Nt.response.data.text(),n?.({request:vc,response:Nt.response})),Be(void 0),Ie(Nt)}finally{ae(!1),_(1),De(Date.now()-yv),(Hd=(dc=ut.events)==null?void 0:dc.tryItSent)==null||Hd.call(dc,{eventType:fr.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:t.operationId,operationPath:t.path,operationHttpVerb:t.httpVerb,operationSummary:t.description})}}),[L.url,ye,n,t,ut,we]);(0,Vt.useMount)(()=>jd(this,null,function*(){var qt;const Gr=yield Ff(t,jt.definition);ke(Gr),(qt=p.current)==null||qt.setValues({})})),(0,B.useEffect)(()=>{et&&et!==t&&(Be(void 0),Ie(void 0),_(0))},[t,et]);const En=!!(Ee||pe);return B.createElement(fv,{shaking:oe,className:i,rootElement:s},B.createElement(Ii.Hc,null,B.createElement(jo,{active:W,hasResponse:En,onChange:ji}),m&&B.createElement(Qr.PZ,{onClick:m}," \u2715 ")),B.createElement(Qr.RE,{hidden:W!==0,"data-cy":"console-request-body"},B.createElement(lv,{operation:t,properties:u,mergeExampleBody:c,securityDefaults:h,form:ye,resolvedRawSpec:we,server:L,formApi:p.current,setFormApi:jr,handleChange:ei,handleServerChange:ti})),B.createElement(Qr.RE,{hidden:W!==1,"data-cy":"console-response-body"},B.createElement(nu,{response:Ee,error:pe,time:Te})),B.createElement(au,{hasResponse:En,params:ye.values,operation:t,loading:fe,execute:Wr}))}const vv=(0,B.memo)(pv)},85208:(x,N,f)=>{var v=f(34440),C=f(84108),E=f(61085),P=f(77706),D=f(8636);function R(V){var Q=-1,Z=V==null?0:V.length;for(this.clear();++Q<Z;){var de=V[Q];this.set(de[0],de[1])}}R.prototype.clear=v,R.prototype.delete=C,R.prototype.get=E,R.prototype.has=P,R.prototype.set=D,x.exports=R},81998:(x,N,f)=>{var v=f(90266),C=f(42875),E=f(45828),P=f(24115),D=f(67690);function R(V){var Q=-1,Z=V==null?0:V.length;for(this.clear();++Q<Z;){var de=V[Q];this.set(de[0],de[1])}}R.prototype.clear=v,R.prototype.delete=C,R.prototype.get=E,R.prototype.has=P,R.prototype.set=D,x.exports=R},72887:(x,N,f)=>{var v=f(65234),C=f(83250),E=v(C,"Map");x.exports=E},95678:(x,N,f)=>{var v=f(39016),C=f(62363),E=f(64348),P=f(53062),D=f(30262);function R(V){var Q=-1,Z=V==null?0:V.length;for(this.clear();++Q<Z;){var de=V[Q];this.set(de[0],de[1])}}R.prototype.clear=v,R.prototype.delete=C,R.prototype.get=E,R.prototype.has=P,R.prototype.set=D,x.exports=R},70861:(x,N,f)=>{var v=f(83250),C=v.Symbol;x.exports=C},29233:x=>{function N(f,v){for(var C=-1,E=f==null?0:f.length,P=Array(E);++C<E;)P[C]=v(f[C],C,f);return P}x.exports=N},18498:(x,N,f)=>{var v=f(58260);function C(E,P){for(var D=E.length;D--;)if(v(E[D][0],P))return D;return-1}x.exports=C},40548:(x,N,f)=>{var v=f(24007),C=f(86040);function E(P,D){D=v(D,P);for(var R=0,V=D.length;P!=null&&R<V;)P=P[C(D[R++])];return R&&R==V?P:void 0}x.exports=E},69823:(x,N,f)=>{var v=f(70861),C=f(91339),E=f(25151),P="[object Null]",D="[object Undefined]",R=v?v.toStringTag:void 0;function V(Q){return Q==null?Q===void 0?D:P:R&&R in Object(Q)?C(Q):E(Q)}x.exports=V},99817:(x,N,f)=>{var v=f(45563),C=f(28597),E=f(93702),P=f(55784),D=/[\\^$.*+?()[\]{}|]/g,R=/^\[object .+?Constructor\]$/,V=Function.prototype,Q=Object.prototype,Z=V.toString,de=Q.hasOwnProperty,re=RegExp("^"+Z.call(de).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function se($){if(!E($)||C($))return!1;var k=v($)?re:R;return k.test(P($))}x.exports=se},86245:(x,N,f)=>{var v=f(70861),C=f(29233),E=f(55589),P=f(52624),D=1/0,R=v?v.prototype:void 0,V=R?R.toString:void 0;function Q(Z){if(typeof Z=="string")return Z;if(E(Z))return C(Z,Q)+"";if(P(Z))return V?V.call(Z):"";var de=Z+"";return de=="0"&&1/Z==-D?"-0":de}x.exports=Q},24007:(x,N,f)=>{var v=f(55589),C=f(5130),E=f(44041),P=f(99835);function D(R,V){return v(R)?R:C(R,V)?[R]:E(P(R))}x.exports=D},1622:(x,N,f)=>{var v=f(83250),C=v["__core-js_shared__"];x.exports=C},20302:(x,N,f)=>{var v=typeof f.g=="object"&&f.g&&f.g.Object===Object&&f.g;x.exports=v},77570:(x,N,f)=>{var v=f(58949);function C(E,P){var D=E.__data__;return v(P)?D[typeof P=="string"?"string":"hash"]:D.map}x.exports=C},65234:(x,N,f)=>{var v=f(99817),C=f(67736);function E(P,D){var R=C(P,D);return v(R)?R:void 0}x.exports=E},91339:(x,N,f)=>{var v=f(70861),C=Object.prototype,E=C.hasOwnProperty,P=C.toString,D=v?v.toStringTag:void 0;function R(V){var Q=E.call(V,D),Z=V[D];try{V[D]=void 0;var de=!0}catch{}var re=P.call(V);return de&&(Q?V[D]=Z:delete V[D]),re}x.exports=R},67736:x=>{function N(f,v){return f?.[v]}x.exports=N},34440:(x,N,f)=>{var v=f(24545);function C(){this.__data__=v?v(null):{},this.size=0}x.exports=C},84108:x=>{function N(f){var v=this.has(f)&&delete this.__data__[f];return this.size-=v?1:0,v}x.exports=N},61085:(x,N,f)=>{var v=f(24545),C="__lodash_hash_undefined__",E=Object.prototype,P=E.hasOwnProperty;function D(R){var V=this.__data__;if(v){var Q=V[R];return Q===C?void 0:Q}return P.call(V,R)?V[R]:void 0}x.exports=D},77706:(x,N,f)=>{var v=f(24545),C=Object.prototype,E=C.hasOwnProperty;function P(D){var R=this.__data__;return v?R[D]!==void 0:E.call(R,D)}x.exports=P},8636:(x,N,f)=>{var v=f(24545),C="__lodash_hash_undefined__";function E(P,D){var R=this.__data__;return this.size+=this.has(P)?0:1,R[P]=v&&D===void 0?C:D,this}x.exports=E},5130:(x,N,f)=>{var v=f(55589),C=f(52624),E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,P=/^\w*$/;function D(R,V){if(v(R))return!1;var Q=typeof R;return Q=="number"||Q=="symbol"||Q=="boolean"||R==null||C(R)?!0:P.test(R)||!E.test(R)||V!=null&&R in Object(V)}x.exports=D},58949:x=>{function N(f){var v=typeof f;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?f!=="__proto__":f===null}x.exports=N},28597:(x,N,f)=>{var v=f(1622),C=function(){var P=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||"");return P?"Symbol(src)_1."+P:""}();function E(P){return!!C&&C in P}x.exports=E},90266:x=>{function N(){this.__data__=[],this.size=0}x.exports=N},42875:(x,N,f)=>{var v=f(18498),C=Array.prototype,E=C.splice;function P(D){var R=this.__data__,V=v(R,D);if(V<0)return!1;var Q=R.length-1;return V==Q?R.pop():E.call(R,V,1),--this.size,!0}x.exports=P},45828:(x,N,f)=>{var v=f(18498);function C(E){var P=this.__data__,D=v(P,E);return D<0?void 0:P[D][1]}x.exports=C},24115:(x,N,f)=>{var v=f(18498);function C(E){return v(this.__data__,E)>-1}x.exports=C},67690:(x,N,f)=>{var v=f(18498);function C(E,P){var D=this.__data__,R=v(D,E);return R<0?(++this.size,D.push([E,P])):D[R][1]=P,this}x.exports=C},39016:(x,N,f)=>{var v=f(85208),C=f(81998),E=f(72887);function P(){this.size=0,this.__data__={hash:new v,map:new(E||C),string:new v}}x.exports=P},62363:(x,N,f)=>{var v=f(77570);function C(E){var P=v(this,E).delete(E);return this.size-=P?1:0,P}x.exports=C},64348:(x,N,f)=>{var v=f(77570);function C(E){return v(this,E).get(E)}x.exports=C},53062:(x,N,f)=>{var v=f(77570);function C(E){return v(this,E).has(E)}x.exports=C},30262:(x,N,f)=>{var v=f(77570);function C(E,P){var D=v(this,E),R=D.size;return D.set(E,P),this.size+=D.size==R?0:1,this}x.exports=C},32924:(x,N,f)=>{var v=f(67997),C=500;function E(P){var D=v(P,function(V){return R.size===C&&R.clear(),V}),R=D.cache;return D}x.exports=E},24545:(x,N,f)=>{var v=f(65234),C=v(Object,"create");x.exports=C},25151:x=>{var N=Object.prototype,f=N.toString;function v(C){return f.call(C)}x.exports=v},83250:(x,N,f)=>{var v=f(20302),C=typeof self=="object"&&self&&self.Object===Object&&self,E=v||C||Function("return this")();x.exports=E},44041:(x,N,f)=>{var v=f(32924),C=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,E=/\\(\\)?/g,P=v(function(D){var R=[];return D.charCodeAt(0)===46&&R.push(""),D.replace(C,function(V,Q,Z,de){R.push(Z?de.replace(E,"$1"):Q||V)}),R});x.exports=P},86040:(x,N,f)=>{var v=f(52624),C=1/0;function E(P){if(typeof P=="string"||v(P))return P;var D=P+"";return D=="0"&&1/P==-C?"-0":D}x.exports=E},55784:x=>{var N=Function.prototype,f=N.toString;function v(C){if(C!=null){try{return f.call(C)}catch{}try{return C+""}catch{}}return""}x.exports=v},58260:x=>{function N(f,v){return f===v||f!==f&&v!==v}x.exports=N},13546:(x,N,f)=>{var v=f(40548);function C(E,P,D){var R=E==null?void 0:v(E,P);return R===void 0?D:R}x.exports=C},55589:x=>{var N=Array.isArray;x.exports=N},45563:(x,N,f)=>{var v=f(69823),C=f(93702),E="[object AsyncFunction]",P="[object Function]",D="[object GeneratorFunction]",R="[object Proxy]";function V(Q){if(!C(Q))return!1;var Z=v(Q);return Z==P||Z==D||Z==E||Z==R}x.exports=V},93702:x=>{function N(f){var v=typeof f;return f!=null&&(v=="object"||v=="function")}x.exports=N},50440:x=>{function N(f){return f!=null&&typeof f=="object"}x.exports=N},52624:(x,N,f)=>{var v=f(69823),C=f(50440),E="[object Symbol]";function P(D){return typeof D=="symbol"||C(D)&&v(D)==E}x.exports=P},67997:(x,N,f)=>{var v=f(95678),C="Expected a function";function E(P,D){if(typeof P!="function"||D!=null&&typeof D!="function")throw new TypeError(C);var R=function(){var V=arguments,Q=D?D.apply(this,V):V[0],Z=R.cache;if(Z.has(Q))return Z.get(Q);var de=P.apply(this,V);return R.cache=Z.set(Q,de)||Z,de};return R.cache=new(E.Cache||v),R}E.Cache=v,x.exports=E},99835:(x,N,f)=>{var v=f(86245);function C(E){return E==null?"":v(E)}x.exports=C},14927:(x,N,f)=>{var v=typeof Map=="function"&&Map.prototype,C=Object.getOwnPropertyDescriptor&&v?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,E=v&&C&&typeof C.get=="function"?C.get:null,P=v&&Map.prototype.forEach,D=typeof Set=="function"&&Set.prototype,R=Object.getOwnPropertyDescriptor&&D?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,V=D&&R&&typeof R.get=="function"?R.get:null,Q=D&&Set.prototype.forEach,Z=typeof WeakMap=="function"&&WeakMap.prototype,de=Z?WeakMap.prototype.has:null,re=typeof WeakSet=="function"&&WeakSet.prototype,se=re?WeakSet.prototype.has:null,$=typeof WeakRef=="function"&&WeakRef.prototype,k=$?WeakRef.prototype.deref:null,J=Boolean.prototype.valueOf,M=Object.prototype.toString,S=Function.prototype.toString,I=String.prototype.match,F=String.prototype.slice,K=String.prototype.replace,te=String.prototype.toUpperCase,j=String.prototype.toLowerCase,ie=RegExp.prototype.test,H=Array.prototype.concat,Y=Array.prototype.join,ce=Array.prototype.slice,ge=Math.floor,G=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ve=Object.getOwnPropertySymbols,ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,He=typeof Symbol=="function"&&typeof Symbol.iterator=="object",_e=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===He||"symbol")?Symbol.toStringTag:null,ze=Object.prototype.propertyIsEnumerable,dt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ne){return ne.__proto__}:null);function ft(ne,be){if(ne===1/0||ne===-1/0||ne!==ne||ne&&ne>-1e3&&ne<1e3||ie.call(/e/,be))return be;var je=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ne=="number"){var tt=ne<0?-ge(-ne):ge(ne);if(tt!==ne){var ct=String(tt),lt=F.call(be,ct.length+1);return K.call(ct,je,"$&_")+"."+K.call(K.call(lt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return K.call(be,je,"$&_")}var at=f(65710),Gt=at.custom,ht=Kt(Gt)?Gt:null;x.exports=function ne(be,je,tt,ct){var lt=je||{};if(Je(lt,"quoteStyle")&&lt.quoteStyle!=="single"&&lt.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Je(lt,"maxStringLength")&&(typeof lt.maxStringLength=="number"?lt.maxStringLength<0&&lt.maxStringLength!==1/0:lt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var _t=Je(lt,"customInspect")?lt.customInspect:!0;if(typeof _t!="boolean"&&_t!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Je(lt,"indent")&&lt.indent!==null&&lt.indent!==" "&&!(parseInt(lt.indent,10)===lt.indent&&lt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Je(lt,"numericSeparator")&&typeof lt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Tr=lt.numericSeparator;if(typeof be>"u")return"undefined";if(be===null)return"null";if(typeof be=="boolean")return be?"true":"false";if(typeof be=="string")return vn(be,lt);if(typeof be=="number"){if(be===0)return 1/0/be>0?"0":"-0";var wt=String(be);return Tr?ft(be,wt):wt}if(typeof be=="bigint"){var er=String(be)+"n";return Tr?ft(be,er):er}var Wn=typeof lt.depth>"u"?5:lt.depth;if(typeof tt>"u"&&(tt=0),tt>=Wn&&Wn>0&&typeof be=="object")return Ue(be)?"[Array]":"[Object]";var mr=st(lt,tt);if(typeof ct>"u")ct=[];else if(Or(ct,be)>=0)return"[Circular]";function yr(Mr,tr,In){if(tr&&(ct=ce.call(ct),ct.push(tr)),In){var tn={depth:lt.depth};return Je(lt,"quoteStyle")&&(tn.quoteStyle=lt.quoteStyle),ne(Mr,tn,tt+1,ct)}return ne(Mr,lt,tt+1,ct)}if(typeof be=="function"&&!Re(be)){var Hn=Lt(be),kr=pt(be,yr);return"[Function"+(Hn?": "+Hn:" (anonymous)")+"]"+(kr.length>0?" { "+Y.call(kr,", ")+" }":"")}if(Kt(be)){var Pn=He?K.call(String(be),/^(Symbol\(.*\))_[^)]*$/,"$1"):ee.call(be);return typeof be=="object"&&!He?gr(Pn):Pn}if(kn(be)){for(var Ln="<"+j.call(String(be.nodeName)),br=be.attributes||[],Un=0;Un<br.length;Un++)Ln+=" "+br[Un].name+"="+Ot(nt(br[Un].value),"double",lt);return Ln+=">",be.childNodes&&be.childNodes.length&&(Ln+="..."),Ln+="</"+j.call(String(be.nodeName))+">",Ln}if(Ue(be)){if(be.length===0)return"[]";var gn=pt(be,yr);return mr&&!mt(gn)?"["+Qe(gn,mr)+"]":"[ "+Y.call(gn,", ")+" ]"}if(it(be)){var ni=pt(be,yr);return!("cause"in Error.prototype)&&"cause"in be&&!ze.call(be,"cause")?"{ ["+String(be)+"] "+Y.call(H.call("[cause]: "+yr(be.cause),ni),", ")+" }":ni.length===0?"["+String(be)+"]":"{ ["+String(be)+"] "+Y.call(ni,", ")+" }"}if(typeof be=="object"&&_t){if(ht&&typeof be[ht]=="function"&&at)return at(be,{depth:Wn-tt});if(_t!=="symbol"&&typeof be.inspect=="function")return be.inspect()}if(Ft(be)){var Ui=[];return P&&P.call(be,function(Mr,tr){Ui.push(yr(tr,be,!0)+" => "+yr(Mr,be))}),Rt("Map",E.call(be),Ui,mr)}if(Hr(be)){var Yr=[];return Q&&Q.call(be,function(Mr){Yr.push(yr(Mr,be))}),Rt("Set",V.call(be),Yr,mr)}if(hn(be))return Er("WeakMap");if(en(be))return Er("WeakSet");if(pn(be))return Er("WeakRef");if(qe(be))return gr(yr(Number(be)));if(Jt(be))return gr(yr(G.call(be)));if(St(be))return gr(J.call(be));if(Dt(be))return gr(yr(String(be)));if(!Fe(be)&&!Re(be)){var Ir=pt(be,yr),Xr=dt?dt(be)===Object.prototype:be instanceof Object||be.constructor===Object,zr=be instanceof Object?"":"null prototype",_r=!Xr&&_e&&Object(be)===be&&_e in be?F.call(xt(be),8,-1):zr?"Object":"",Oo=Xr||typeof be.constructor!="function"?"":be.constructor.name?be.constructor.name+" ":"",mn=Oo+(_r||zr?"["+Y.call(H.call([],_r||[],zr||[]),": ")+"] ":"");return Ir.length===0?mn+"{}":mr?mn+"{"+Qe(Ir,mr)+"}":mn+"{ "+Y.call(Ir,", ")+" }"}return String(be)};function Ot(ne,be,je){var tt=(je.quoteStyle||be)==="double"?'"':"'";return tt+ne+tt}function nt(ne){return K.call(String(ne),/"/g,"&quot;")}function Ue(ne){return xt(ne)==="[object Array]"&&(!_e||!(typeof ne=="object"&&_e in ne))}function Fe(ne){return xt(ne)==="[object Date]"&&(!_e||!(typeof ne=="object"&&_e in ne))}function Re(ne){return xt(ne)==="[object RegExp]"&&(!_e||!(typeof ne=="object"&&_e in ne))}function it(ne){return xt(ne)==="[object Error]"&&(!_e||!(typeof ne=="object"&&_e in ne))}function Dt(ne){return xt(ne)==="[object String]"&&(!_e||!(typeof ne=="object"&&_e in ne))}function qe(ne){return xt(ne)==="[object Number]"&&(!_e||!(typeof ne=="object"&&_e in ne))}function St(ne){return xt(ne)==="[object Boolean]"&&(!_e||!(typeof ne=="object"&&_e in ne))}function Kt(ne){if(He)return ne&&typeof ne=="object"&&ne instanceof Symbol;if(typeof ne=="symbol")return!0;if(!ne||typeof ne!="object"||!ee)return!1;try{return ee.call(ne),!0}catch{}return!1}function Jt(ne){if(!ne||typeof ne!="object"||!G)return!1;try{return G.call(ne),!0}catch{}return!1}var pr=Object.prototype.hasOwnProperty||function(ne){return ne in this};function Je(ne,be){return pr.call(ne,be)}function xt(ne){return M.call(ne)}function Lt(ne){if(ne.name)return ne.name;var be=I.call(S.call(ne),/^function\s*([\w$]+)/);return be?be[1]:null}function Or(ne,be){if(ne.indexOf)return ne.indexOf(be);for(var je=0,tt=ne.length;je<tt;je++)if(ne[je]===be)return je;return-1}function Ft(ne){if(!E||!ne||typeof ne!="object")return!1;try{E.call(ne);try{V.call(ne)}catch{return!0}return ne instanceof Map}catch{}return!1}function hn(ne){if(!de||!ne||typeof ne!="object")return!1;try{de.call(ne,de);try{se.call(ne,se)}catch{return!0}return ne instanceof WeakMap}catch{}return!1}function pn(ne){if(!k||!ne||typeof ne!="object")return!1;try{return k.call(ne),!0}catch{}return!1}function Hr(ne){if(!V||!ne||typeof ne!="object")return!1;try{V.call(ne);try{E.call(ne)}catch{return!0}return ne instanceof Set}catch{}return!1}function en(ne){if(!se||!ne||typeof ne!="object")return!1;try{se.call(ne,se);try{de.call(ne,de)}catch{return!0}return ne instanceof WeakSet}catch{}return!1}function kn(ne){return!ne||typeof ne!="object"?!1:typeof HTMLElement<"u"&&ne instanceof HTMLElement?!0:typeof ne.nodeName=="string"&&typeof ne.getAttribute=="function"}function vn(ne,be){if(ne.length>be.maxStringLength){var je=ne.length-be.maxStringLength,tt="... "+je+" more character"+(je>1?"s":"");return vn(F.call(ne,0,be.maxStringLength),be)+tt}var ct=K.call(K.call(ne,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ur);return Ot(ct,"single",be)}function Ur(ne){var be=ne.charCodeAt(0),je={8:"b",9:"t",10:"n",12:"f",13:"r"}[be];return je?"\\"+je:"\\x"+(be<16?"0":"")+te.call(be.toString(16))}function gr(ne){return"Object("+ne+")"}function Er(ne){return ne+" { ? }"}function Rt(ne,be,je,tt){var ct=tt?Qe(je,tt):Y.call(je,", ");return ne+" ("+be+") {"+ct+"}"}function mt(ne){for(var be=0;be<ne.length;be++)if(Or(ne[be],`
437
- `)>=0)return!1;return!0}function st(ne,be){var je;if(ne.indent===" ")je=" ";else if(typeof ne.indent=="number"&&ne.indent>0)je=Y.call(Array(ne.indent+1)," ");else return null;return{base:je,prev:Y.call(Array(be+1),je)}}function Qe(ne,be){if(ne.length===0)return"";var je=`
438
- `+be.prev+be.base;return je+Y.call(ne,","+je)+`
439
- `+be.prev}function pt(ne,be){var je=Ue(ne),tt=[];if(je){tt.length=ne.length;for(var ct=0;ct<ne.length;ct++)tt[ct]=Je(ne,ct)?be(ne[ct],ne):""}var lt=typeof ve=="function"?ve(ne):[],_t;if(He){_t={};for(var Tr=0;Tr<lt.length;Tr++)_t["$"+lt[Tr]]=lt[Tr]}for(var wt in ne)Je(ne,wt)&&(je&&String(Number(wt))===wt&&wt<ne.length||He&&_t["$"+wt]instanceof Symbol||(ie.call(/[^\w$]/,wt)?tt.push(be(wt,ne)+": "+be(ne[wt],ne)):tt.push(wt+": "+be(ne[wt],ne))));if(typeof ve=="function")for(var er=0;er<lt.length;er++)ze.call(ne,lt[er])&&tt.push("["+be(lt[er])+"]: "+be(ne[lt[er]],ne));return tt}},83949:x=>{"use strict";var N=String.prototype.replace,f=/%20/g,v={RFC1738:"RFC1738",RFC3986:"RFC3986"};x.exports={default:v.RFC3986,formatters:{RFC1738:function(C){return N.call(C,f,"+")},RFC3986:function(C){return String(C)}},RFC1738:v.RFC1738,RFC3986:v.RFC3986}},67905:(x,N,f)=>{"use strict";var v=f(85095),C=f(95990),E=f(83949);x.exports={formats:E,parse:C,stringify:v}},95990:(x,N,f)=>{"use strict";var v=f(37748),C=Object.prototype.hasOwnProperty,E=Array.isArray,P={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:v.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},D=function($){return $.replace(/&#(\d+);/g,function(k,J){return String.fromCharCode(parseInt(J,10))})},R=function($,k){return $&&typeof $=="string"&&k.comma&&$.indexOf(",")>-1?$.split(","):$},V="utf8=%26%2310003%3B",Q="utf8=%E2%9C%93",Z=function(k,J){var M={__proto__:null},S=J.ignoreQueryPrefix?k.replace(/^\?/,""):k,I=J.parameterLimit===1/0?void 0:J.parameterLimit,F=S.split(J.delimiter,I),K=-1,te,j=J.charset;if(J.charsetSentinel)for(te=0;te<F.length;++te)F[te].indexOf("utf8=")===0&&(F[te]===Q?j="utf-8":F[te]===V&&(j="iso-8859-1"),K=te,te=F.length);for(te=0;te<F.length;++te)if(te!==K){var ie=F[te],H=ie.indexOf("]="),Y=H===-1?ie.indexOf("="):H+1,ce,ge;Y===-1?(ce=J.decoder(ie,P.decoder,j,"key"),ge=J.strictNullHandling?null:""):(ce=J.decoder(ie.slice(0,Y),P.decoder,j,"key"),ge=v.maybeMap(R(ie.slice(Y+1),J),function(G){return J.decoder(G,P.decoder,j,"value")})),ge&&J.interpretNumericEntities&&j==="iso-8859-1"&&(ge=D(ge)),ie.indexOf("[]=")>-1&&(ge=E(ge)?[ge]:ge),C.call(M,ce)?M[ce]=v.combine(M[ce],ge):M[ce]=ge}return M},de=function($,k,J,M){for(var S=M?k:R(k,J),I=$.length-1;I>=0;--I){var F,K=$[I];if(K==="[]"&&J.parseArrays)F=[].concat(S);else{F=J.plainObjects?Object.create(null):{};var te=K.charAt(0)==="["&&K.charAt(K.length-1)==="]"?K.slice(1,-1):K,j=parseInt(te,10);!J.parseArrays&&te===""?F={0:S}:!isNaN(j)&&K!==te&&String(j)===te&&j>=0&&J.parseArrays&&j<=J.arrayLimit?(F=[],F[j]=S):te!=="__proto__"&&(F[te]=S)}S=F}return S},re=function(k,J,M,S){if(k){var I=M.allowDots?k.replace(/\.([^.[]+)/g,"[$1]"):k,F=/(\[[^[\]]*])/,K=/(\[[^[\]]*])/g,te=M.depth>0&&F.exec(I),j=te?I.slice(0,te.index):I,ie=[];if(j){if(!M.plainObjects&&C.call(Object.prototype,j)&&!M.allowPrototypes)return;ie.push(j)}for(var H=0;M.depth>0&&(te=K.exec(I))!==null&&H<M.depth;){if(H+=1,!M.plainObjects&&C.call(Object.prototype,te[1].slice(1,-1))&&!M.allowPrototypes)return;ie.push(te[1])}return te&&ie.push("["+I.slice(te.index)+"]"),de(ie,J,M,S)}},se=function(k){if(!k)return P;if(k.decoder!==null&&k.decoder!==void 0&&typeof k.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof k.charset<"u"&&k.charset!=="utf-8"&&k.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var J=typeof k.charset>"u"?P.charset:k.charset;return{allowDots:typeof k.allowDots>"u"?P.allowDots:!!k.allowDots,allowPrototypes:typeof k.allowPrototypes=="boolean"?k.allowPrototypes:P.allowPrototypes,allowSparse:typeof k.allowSparse=="boolean"?k.allowSparse:P.allowSparse,arrayLimit:typeof k.arrayLimit=="number"?k.arrayLimit:P.arrayLimit,charset:J,charsetSentinel:typeof k.charsetSentinel=="boolean"?k.charsetSentinel:P.charsetSentinel,comma:typeof k.comma=="boolean"?k.comma:P.comma,decoder:typeof k.decoder=="function"?k.decoder:P.decoder,delimiter:typeof k.delimiter=="string"||v.isRegExp(k.delimiter)?k.delimiter:P.delimiter,depth:typeof k.depth=="number"||k.depth===!1?+k.depth:P.depth,ignoreQueryPrefix:k.ignoreQueryPrefix===!0,interpretNumericEntities:typeof k.interpretNumericEntities=="boolean"?k.interpretNumericEntities:P.interpretNumericEntities,parameterLimit:typeof k.parameterLimit=="number"?k.parameterLimit:P.parameterLimit,parseArrays:k.parseArrays!==!1,plainObjects:typeof k.plainObjects=="boolean"?k.plainObjects:P.plainObjects,strictNullHandling:typeof k.strictNullHandling=="boolean"?k.strictNullHandling:P.strictNullHandling}};x.exports=function($,k){var J=se(k);if($===""||$===null||typeof $>"u")return J.plainObjects?Object.create(null):{};for(var M=typeof $=="string"?Z($,J):$,S=J.plainObjects?Object.create(null):{},I=Object.keys(M),F=0;F<I.length;++F){var K=I[F],te=re(K,M[K],J,typeof $=="string");S=v.merge(S,te,J)}return J.allowSparse===!0?S:v.compact(S)}},85095:(x,N,f)=>{"use strict";var v=f(44852),C=f(37748),E=f(83949),P=Object.prototype.hasOwnProperty,D={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,I){return S+"["+I+"]"},repeat:function(S){return S}},R=Array.isArray,V=Array.prototype.push,Q=function(M,S){V.apply(M,R(S)?S:[S])},Z=Date.prototype.toISOString,de=E.default,re={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:C.encode,encodeValuesOnly:!1,format:de,formatter:E.formatters[de],indices:!1,serializeDate:function(S){return Z.call(S)},skipNulls:!1,strictNullHandling:!1},se=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},$={},k=function M(S,I,F,K,te,j,ie,H,Y,ce,ge,G,ve,ee,He,_e){for(var ze=S,dt=_e,ft=0,at=!1;(dt=dt.get($))!==void 0&&!at;){var Gt=dt.get(S);if(ft+=1,typeof Gt<"u"){if(Gt===ft)throw new RangeError("Cyclic object value");at=!0}typeof dt.get($)>"u"&&(ft=0)}if(typeof H=="function"?ze=H(I,ze):ze instanceof Date?ze=ge(ze):F==="comma"&&R(ze)&&(ze=C.maybeMap(ze,function(Kt){return Kt instanceof Date?ge(Kt):Kt})),ze===null){if(te)return ie&&!ee?ie(I,re.encoder,He,"key",G):I;ze=""}if(se(ze)||C.isBuffer(ze)){if(ie){var ht=ee?I:ie(I,re.encoder,He,"key",G);return[ve(ht)+"="+ve(ie(ze,re.encoder,He,"value",G))]}return[ve(I)+"="+ve(String(ze))]}var Ot=[];if(typeof ze>"u")return Ot;var nt;if(F==="comma"&&R(ze))ee&&ie&&(ze=C.maybeMap(ze,ie)),nt=[{value:ze.length>0?ze.join(",")||null:void 0}];else if(R(H))nt=H;else{var Ue=Object.keys(ze);nt=Y?Ue.sort(Y):Ue}for(var Fe=K&&R(ze)&&ze.length===1?I+"[]":I,Re=0;Re<nt.length;++Re){var it=nt[Re],Dt=typeof it=="object"&&typeof it.value<"u"?it.value:ze[it];if(!(j&&Dt===null)){var qe=R(ze)?typeof F=="function"?F(Fe,it):Fe:Fe+(ce?"."+it:"["+it+"]");_e.set(S,ft);var St=v();St.set($,_e),Q(Ot,M(Dt,qe,F,K,te,j,F==="comma"&&ee&&R(ze)?null:ie,H,Y,ce,ge,G,ve,ee,He,St))}}return Ot},J=function(S){if(!S)return re;if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var I=S.charset||re.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var F=E.default;if(typeof S.format<"u"){if(!P.call(E.formatters,S.format))throw new TypeError("Unknown format option provided.");F=S.format}var K=E.formatters[F],te=re.filter;return(typeof S.filter=="function"||R(S.filter))&&(te=S.filter),{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:re.addQueryPrefix,allowDots:typeof S.allowDots>"u"?re.allowDots:!!S.allowDots,charset:I,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:re.charsetSentinel,delimiter:typeof S.delimiter>"u"?re.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:re.encode,encoder:typeof S.encoder=="function"?S.encoder:re.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:re.encodeValuesOnly,filter:te,format:F,formatter:K,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:re.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:re.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:re.strictNullHandling}};x.exports=function(M,S){var I=M,F=J(S),K,te;typeof F.filter=="function"?(te=F.filter,I=te("",I)):R(F.filter)&&(te=F.filter,K=te);var j=[];if(typeof I!="object"||I===null)return"";var ie;S&&S.arrayFormat in D?ie=S.arrayFormat:S&&"indices"in S?ie=S.indices?"indices":"repeat":ie="indices";var H=D[ie];if(S&&"commaRoundTrip"in S&&typeof S.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var Y=H==="comma"&&S&&S.commaRoundTrip;K||(K=Object.keys(I)),F.sort&&K.sort(F.sort);for(var ce=v(),ge=0;ge<K.length;++ge){var G=K[ge];F.skipNulls&&I[G]===null||Q(j,k(I[G],G,H,Y,F.strictNullHandling,F.skipNulls,F.encode?F.encoder:null,F.filter,F.sort,F.allowDots,F.serializeDate,F.format,F.formatter,F.encodeValuesOnly,F.charset,ce))}var ve=j.join(F.delimiter),ee=F.addQueryPrefix===!0?"?":"";return F.charsetSentinel&&(F.charset==="iso-8859-1"?ee+="utf8=%26%2310003%3B&":ee+="utf8=%E2%9C%93&"),ve.length>0?ee+ve:""}},37748:(x,N,f)=>{"use strict";var v=f(83949),C=Object.prototype.hasOwnProperty,E=Array.isArray,P=function(){for(var M=[],S=0;S<256;++S)M.push("%"+((S<16?"0":"")+S.toString(16)).toUpperCase());return M}(),D=function(S){for(;S.length>1;){var I=S.pop(),F=I.obj[I.prop];if(E(F)){for(var K=[],te=0;te<F.length;++te)typeof F[te]<"u"&&K.push(F[te]);I.obj[I.prop]=K}}},R=function(S,I){for(var F=I&&I.plainObjects?Object.create(null):{},K=0;K<S.length;++K)typeof S[K]<"u"&&(F[K]=S[K]);return F},V=function M(S,I,F){if(!I)return S;if(typeof I!="object"){if(E(S))S.push(I);else if(S&&typeof S=="object")(F&&(F.plainObjects||F.allowPrototypes)||!C.call(Object.prototype,I))&&(S[I]=!0);else return[S,I];return S}if(!S||typeof S!="object")return[S].concat(I);var K=S;return E(S)&&!E(I)&&(K=R(S,F)),E(S)&&E(I)?(I.forEach(function(te,j){if(C.call(S,j)){var ie=S[j];ie&&typeof ie=="object"&&te&&typeof te=="object"?S[j]=M(ie,te,F):S.push(te)}else S[j]=te}),S):Object.keys(I).reduce(function(te,j){var ie=I[j];return C.call(te,j)?te[j]=M(te[j],ie,F):te[j]=ie,te},K)},Q=function(S,I){return Object.keys(I).reduce(function(F,K){return F[K]=I[K],F},S)},Z=function(M,S,I){var F=M.replace(/\+/g," ");if(I==="iso-8859-1")return F.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(F)}catch{return F}},de=function(S,I,F,K,te){if(S.length===0)return S;var j=S;if(typeof S=="symbol"?j=Symbol.prototype.toString.call(S):typeof S!="string"&&(j=String(S)),F==="iso-8859-1")return escape(j).replace(/%u[0-9a-f]{4}/gi,function(ce){return"%26%23"+parseInt(ce.slice(2),16)+"%3B"});for(var ie="",H=0;H<j.length;++H){var Y=j.charCodeAt(H);if(Y===45||Y===46||Y===95||Y===126||Y>=48&&Y<=57||Y>=65&&Y<=90||Y>=97&&Y<=122||te===v.RFC1738&&(Y===40||Y===41)){ie+=j.charAt(H);continue}if(Y<128){ie=ie+P[Y];continue}if(Y<2048){ie=ie+(P[192|Y>>6]+P[128|Y&63]);continue}if(Y<55296||Y>=57344){ie=ie+(P[224|Y>>12]+P[128|Y>>6&63]+P[128|Y&63]);continue}H+=1,Y=65536+((Y&1023)<<10|j.charCodeAt(H)&1023),ie+=P[240|Y>>18]+P[128|Y>>12&63]+P[128|Y>>6&63]+P[128|Y&63]}return ie},re=function(S){for(var I=[{obj:{o:S},prop:"o"}],F=[],K=0;K<I.length;++K)for(var te=I[K],j=te.obj[te.prop],ie=Object.keys(j),H=0;H<ie.length;++H){var Y=ie[H],ce=j[Y];typeof ce=="object"&&ce!==null&&F.indexOf(ce)===-1&&(I.push({obj:j,prop:Y}),F.push(ce))}return D(I),S},se=function(S){return Object.prototype.toString.call(S)==="[object RegExp]"},$=function(S){return!S||typeof S!="object"?!1:!!(S.constructor&&S.constructor.isBuffer&&S.constructor.isBuffer(S))},k=function(S,I){return[].concat(S,I)},J=function(S,I){if(E(S)){for(var F=[],K=0;K<S.length;K+=1)F.push(I(S[K]));return F}return I(S)};x.exports={arrayToObject:R,assign:Q,combine:k,compact:re,decode:Z,encode:de,isBuffer:$,isRegExp:se,maybeMap:J,merge:V}},99913:(x,N,f)=>{"use strict";var v;function C(){return C=Object.assign||function(se){for(var $=1;$<arguments.length;$++){var k=arguments[$];for(var J in k)Object.prototype.hasOwnProperty.call(k,J)&&(se[J]=k[J])}return se},C.apply(this,arguments)}function E(se){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(k){return typeof k}:E=function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},E(se)}var P=function(){var se=function(k,J){return se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,S){M.__proto__=S}||function(M,S){for(var I in S)S.hasOwnProperty(I)&&(M[I]=S[I])},se(k,J)};return function($,k){se($,k);function J(){this.constructor=$}$.prototype=k===null?Object.create(k):(J.prototype=k.prototype,new J)}}();v={value:!0},v=N.fk=void 0;var D=f(29901),R=typeof navigator>"u"||f.g.PREVENT_CODEMIRROR_RENDER===!0,V;R||(V=f(46944));var Q=function(){function se(){}return se.equals=function($,k){var J=this,M=Object.keys,S=E($),I=E(k);return $&&k&&S==="object"&&S===I?M($).length===M(k).length&&M($).every(function(F){return J.equals($[F],k[F])}):$===k},se}(),Z=function(){function se($,k){this.editor=$,this.props=k}return se.prototype.delegateCursor=function($,k,J){var M=this.editor.getDoc();J&&this.editor.focus(),k?M.setCursor($):M.setCursor($,null,{scroll:!1})},se.prototype.delegateScroll=function($){this.editor.scrollTo($.x,$.y)},se.prototype.delegateSelection=function($,k){var J=this.editor.getDoc();J.setSelections($),k&&this.editor.focus()},se.prototype.apply=function($){$&&$.selection&&$.selection.ranges&&this.delegateSelection($.selection.ranges,$.selection.focus||!1),$&&$.cursor&&this.delegateCursor($.cursor,$.autoScroll||!1,this.editor.getOption("autofocus")||!1),$&&$.scroll&&this.delegateScroll($.scroll)},se.prototype.applyNext=function($,k,J){$&&$.selection&&$.selection.ranges&&k&&k.selection&&k.selection.ranges&&!Q.equals($.selection.ranges,k.selection.ranges)&&this.delegateSelection(k.selection.ranges,k.selection.focus||!1),$&&$.cursor&&k&&k.cursor&&!Q.equals($.cursor,k.cursor)&&this.delegateCursor(J.cursor||k.cursor,k.autoScroll||!1,k.autoCursor||!1),$&&$.scroll&&k&&k.scroll&&!Q.equals($.scroll,k.scroll)&&this.delegateScroll(k.scroll)},se.prototype.applyUserDefined=function($,k){k&&k.cursor&&this.delegateCursor(k.cursor,$.autoScroll||!1,this.editor.getOption("autofocus")||!1)},se.prototype.wire=function($){var k=this;Object.keys($||{}).filter(function(J){return/^on/.test(J)}).forEach(function(J){switch(J){case"onBlur":k.editor.on("blur",function(M,S){k.props.onBlur(k.editor,S)});break;case"onContextMenu":{k.editor.on("contextmenu",function(M,S){k.props.onContextMenu(k.editor,S)});break}case"onCopy":{k.editor.on("copy",function(M,S){k.props.onCopy(k.editor,S)});break}case"onCursor":k.editor.on("cursorActivity",function(M){k.props.onCursor(k.editor,k.editor.getDoc().getCursor())});break;case"onCursorActivity":k.editor.on("cursorActivity",function(M){k.props.onCursorActivity(k.editor)});break;case"onCut":{k.editor.on("cut",function(M,S){k.props.onCut(k.editor,S)});break}case"onDblClick":{k.editor.on("dblclick",function(M,S){k.props.onDblClick(k.editor,S)});break}case"onDragEnter":k.editor.on("dragenter",function(M,S){k.props.onDragEnter(k.editor,S)});break;case"onDragLeave":{k.editor.on("dragleave",function(M,S){k.props.onDragLeave(k.editor,S)});break}case"onDragOver":k.editor.on("dragover",function(M,S){k.props.onDragOver(k.editor,S)});break;case"onDragStart":{k.editor.on("dragstart",function(M,S){k.props.onDragStart(k.editor,S)});break}case"onDrop":k.editor.on("drop",function(M,S){k.props.onDrop(k.editor,S)});break;case"onFocus":k.editor.on("focus",function(M,S){k.props.onFocus(k.editor,S)});break;case"onGutterClick":k.editor.on("gutterClick",function(M,S,I,F){k.props.onGutterClick(k.editor,S,I,F)});break;case"onInputRead":k.editor.on("inputRead",function(M,S){k.props.onInputRead(k.editor,S)});break;case"onKeyDown":k.editor.on("keydown",function(M,S){k.props.onKeyDown(k.editor,S)});break;case"onKeyHandled":k.editor.on("keyHandled",function(M,S,I){k.props.onKeyHandled(k.editor,S,I)});break;case"onKeyPress":k.editor.on("keypress",function(M,S){k.props.onKeyPress(k.editor,S)});break;case"onKeyUp":k.editor.on("keyup",function(M,S){k.props.onKeyUp(k.editor,S)});break;case"onMouseDown":{k.editor.on("mousedown",function(M,S){k.props.onMouseDown(k.editor,S)});break}case"onPaste":{k.editor.on("paste",function(M,S){k.props.onPaste(k.editor,S)});break}case"onRenderLine":{k.editor.on("renderLine",function(M,S,I){k.props.onRenderLine(k.editor,S,I)});break}case"onScroll":k.editor.on("scroll",function(M){k.props.onScroll(k.editor,k.editor.getScrollInfo())});break;case"onSelection":k.editor.on("beforeSelectionChange",function(M,S){k.props.onSelection(k.editor,S)});break;case"onTouchStart":{k.editor.on("touchstart",function(M,S){k.props.onTouchStart(k.editor,S)});break}case"onUpdate":k.editor.on("update",function(M){k.props.onUpdate(k.editor)});break;case"onViewportChange":k.editor.on("viewportChange",function(M,S,I){k.props.onViewportChange(k.editor,S,I)});break}})},se}(),de=function(se){P($,se);function $(k){var J=se.call(this,k)||this;return R||(J.applied=!1,J.appliedNext=!1,J.appliedUserDefined=!1,J.deferred=null,J.emulating=!1,J.hydrated=!1,J.initCb=function(){J.props.editorDidConfigure&&J.props.editorDidConfigure(J.editor)},J.mounted=!1),J}return $.prototype.hydrate=function(k){var J=this,M=k&&k.options?k.options:{},S=C({},V.defaults,this.editor.options,M),I=Object.keys(S).some(function(F){return J.editor.getOption(F)!==S[F]});I&&Object.keys(S).forEach(function(F){M.hasOwnProperty(F)&&J.editor.getOption(F)!==S[F]&&(J.editor.setOption(F,S[F]),J.mirror.setOption(F,S[F]))}),this.hydrated||(this.deferred?this.resolveChange(k.value):this.initChange(k.value||"")),this.hydrated=!0},$.prototype.initChange=function(k){this.emulating=!0;var J=this.editor.getDoc(),M=J.lastLine(),S=J.getLine(J.lastLine()).length;J.replaceRange(k||"",{line:0,ch:0},{line:M,ch:S}),this.mirror.setValue(k),J.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},$.prototype.resolveChange=function(k){this.emulating=!0;var J=this.editor.getDoc();if(this.deferred.origin==="undo"?J.undo():this.deferred.origin==="redo"?J.redo():J.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),k&&k!==J.getValue()){var M=J.getCursor();J.setValue(k),J.setCursor(M)}this.emulating=!1,this.deferred=null},$.prototype.mirrorChange=function(k){var J=this.editor.getDoc();return k.origin==="undo"?(J.setHistory(this.mirror.getHistory()),this.mirror.undo()):k.origin==="redo"?(J.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(k.text,k.from,k.to,k.origin),this.mirror.getValue()},$.prototype.componentDidMount=function(){var k=this;R||(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&V.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=V(this.ref,this.props.options),this.shared=new Z(this.editor,this.props),this.mirror=V(function(){},this.props.options),this.editor.on("electricInput",function(){k.mirror.setHistory(k.editor.getDoc().getHistory())}),this.editor.on("cursorActivity",function(){k.mirror.setCursor(k.editor.getDoc().getCursor())}),this.editor.on("beforeChange",function(J,M){if(!k.emulating){M.cancel(),k.deferred=M;var S=k.mirrorChange(k.deferred);k.props.onBeforeChange&&k.props.onBeforeChange(k.editor,k.deferred,S)}}),this.editor.on("change",function(J,M){k.mounted&&k.props.onChange&&k.props.onChange(k.editor,M,k.editor.getValue())}),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},$.prototype.componentDidUpdate=function(k){if(!R){var J={cursor:null};this.props.value!==k.value&&(this.hydrated=!1),!this.props.autoCursor&&this.props.autoCursor!==void 0&&(J.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(k,this.props,J),this.appliedNext=!0),this.shared.applyUserDefined(k,J),this.appliedUserDefined=!0}},$.prototype.componentWillUnmount=function(){R||this.props.editorWillUnmount&&this.props.editorWillUnmount(V)},$.prototype.shouldComponentUpdate=function(k,J){return!R},$.prototype.render=function(){var k=this;if(R)return null;var J=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return D.createElement("div",{className:J,ref:function(S){return k.ref=S}})},$}(D.Component);N.fk=de;var re=function(se){P($,se);function $(k){var J=se.call(this,k)||this;return R||(J.applied=!1,J.appliedUserDefined=!1,J.continueChange=!1,J.detached=!1,J.hydrated=!1,J.initCb=function(){J.props.editorDidConfigure&&J.props.editorDidConfigure(J.editor)},J.mounted=!1,J.onBeforeChangeCb=function(){J.continueChange=!0}),J}return $.prototype.hydrate=function(k){var J=this,M=k&&k.options?k.options:{},S=C({},V.defaults,this.editor.options,M),I=Object.keys(S).some(function(j){return J.editor.getOption(j)!==S[j]});if(I&&Object.keys(S).forEach(function(j){M.hasOwnProperty(j)&&J.editor.getOption(j)!==S[j]&&J.editor.setOption(j,S[j])}),!this.hydrated){var F=this.editor.getDoc(),K=F.lastLine(),te=F.getLine(F.lastLine()).length;F.replaceRange(k.value||"",{line:0,ch:0},{line:K,ch:te})}this.hydrated=!0},$.prototype.componentDidMount=function(){var k=this;R||(this.detached=this.props.detach===!0,this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&V.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=V(this.ref,this.props.options),this.shared=new Z(this.editor,this.props),this.editor.on("beforeChange",function(J,M){k.props.onBeforeChange&&k.props.onBeforeChange(k.editor,M,k.editor.getValue(),k.onBeforeChangeCb)}),this.editor.on("change",function(J,M){!k.mounted||!k.props.onChange||(k.props.onBeforeChange?k.continueChange&&k.props.onChange(k.editor,M,k.editor.getValue()):k.props.onChange(k.editor,M,k.editor.getValue()))}),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getDoc().clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},$.prototype.componentDidUpdate=function(k){if(this.detached&&this.props.detach===!1&&(this.detached=!1,k.editorDidAttach&&k.editorDidAttach(this.editor)),!this.detached&&this.props.detach===!0&&(this.detached=!0,k.editorDidDetach&&k.editorDidDetach(this.editor)),!(R||this.detached)){var J={cursor:null};this.props.value!==k.value&&(this.hydrated=!1,this.applied=!1,this.appliedUserDefined=!1),!k.autoCursor&&k.autoCursor!==void 0&&(J.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.applied||(this.shared.apply(k),this.applied=!0),this.appliedUserDefined||(this.shared.applyUserDefined(k,J),this.appliedUserDefined=!0)}},$.prototype.componentWillUnmount=function(){R||this.props.editorWillUnmount&&this.props.editorWillUnmount(V)},$.prototype.shouldComponentUpdate=function(k,J){var M=!0;return R&&(M=!1),this.detached&&k.detach&&(M=!1),M},$.prototype.render=function(){var k=this;if(R)return null;var J=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return D.createElement("div",{className:J,ref:function(S){return k.ref=S}})},$}(D.Component);v=re},44852:(x,N,f)=>{"use strict";var v=f(71013),C=f(2864),E=f(14927),P=v("%TypeError%"),D=v("%WeakMap%",!0),R=v("%Map%",!0),V=C("WeakMap.prototype.get",!0),Q=C("WeakMap.prototype.set",!0),Z=C("WeakMap.prototype.has",!0),de=C("Map.prototype.get",!0),re=C("Map.prototype.set",!0),se=C("Map.prototype.has",!0),$=function(S,I){for(var F=S,K;(K=F.next)!==null;F=K)if(K.key===I)return F.next=K.next,K.next=S.next,S.next=K,K},k=function(S,I){var F=$(S,I);return F&&F.value},J=function(S,I,F){var K=$(S,I);K?K.value=F:S.next={key:I,next:S.next,value:F}},M=function(S,I){return!!$(S,I)};x.exports=function(){var I,F,K,te={assert:function(j){if(!te.has(j))throw new P("Side channel does not contain "+E(j))},get:function(j){if(D&&j&&(typeof j=="object"||typeof j=="function")){if(I)return V(I,j)}else if(R){if(F)return de(F,j)}else if(K)return k(K,j)},has:function(j){if(D&&j&&(typeof j=="object"||typeof j=="function")){if(I)return Z(I,j)}else if(R){if(F)return se(F,j)}else if(K)return M(K,j);return!1},set:function(j,ie){D&&j&&(typeof j=="object"||typeof j=="function")?(I||(I=new D),Q(I,j,ie)):R?(F||(F=new R),re(F,j,ie)):(K||(K={key:{},next:null}),J(K,j,ie))}};return te}},83539:(x,N,f)=>{var v=f(26673),C=f(20788);C=C.__esModule?C.default:C,typeof C=="string"&&(C=[[x.id,C,""]]);var E={};E.insert="head",E.singleton=!1;var P=v(C,E);x.exports=C.locals||{}},17664:(x,N,f)=>{var v=f(26673),C=f(15218);C=C.__esModule?C.default:C,typeof C=="string"&&(C=[[x.id,C,""]]);var E={};E.insert="head",E.singleton=!1;var P=v(C,E);x.exports=C.locals||{}},6766:(x,N,f)=>{var v=f(26673),C=f(80766);C=C.__esModule?C.default:C,typeof C=="string"&&(C=[[x.id,C,""]]);var E={};E.insert="head",E.singleton=!1;var P=v(C,E);x.exports=C.locals||{}},49812:(x,N,f)=>{var v=f(26673),C=f(62459);C=C.__esModule?C.default:C,typeof C=="string"&&(C=[[x.id,C,""]]);var E={};E.insert="head",E.singleton=!1;var P=v(C,E);x.exports=C.locals||{}},56089:x=>{"use strict";x.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg=="},17735:x=>{"use strict";x.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="},96192:x=>{"use strict";x.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC"},71090:x=>{"use strict";x.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII="},46050:x=>{"use strict";x.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII="},65710:()=>{},93652:(x,N,f)=>{x.exports=f(24018)},10017:(x,N,f)=>{x.exports=f(27411)},34961:(x,N,f)=>{x.exports=f(79155)},86751:(x,N,f)=>{x.exports=f(13375)},12953:(x,N,f)=>{x.exports=f(95442)},11099:(x,N,f)=>{x.exports=f(55334)},86351:(x,N,f)=>{x.exports=f(48261)},70762:(x,N,f)=>{x.exports=f(92864)},10954:(x,N,f)=>{x.exports=f(27923)},55839:(x,N,f)=>{x.exports=f(89225)},23422:(x,N,f)=>{x.exports=f(95281)},47319:(x,N,f)=>{x.exports=f(55468)}}]);
412
+ `;function bb(r){const{scopes:e,id:t}=r;let n=[];try{n=JSON.parse((0,Ee.YQ)(`auth.${t}.scopes`))}catch{}return!e||!e.length?S.createElement(S.Fragment,null):S.createElement(ve.NI,null,S.createElement(ve.lX,null," Scopes: "),S.createElement(tI,{fieldName:`auth.${t}.scopes`,defaultValue:n,items:e,showControls:!0,trimItemsLength:!0}))}const iI=({token:r,loading:e,error:t})=>e?S.createElement(ve.GE,null,"Please, finish your authorization flow or cancel authorization."):t?S.createElement(jM,null,S.createElement(ve.Xq,null,t)):r?.access_token?null:S.createElement(ve.GE,null," No Access Token. Please, Authorize. ");var sI=Object.defineProperty,oI=Object.defineProperties,aI=Object.getOwnPropertyDescriptors,xb=Object.getOwnPropertySymbols,lI=Object.prototype.hasOwnProperty,cI=Object.prototype.propertyIsEnumerable,wb=(r,e,t)=>e in r?sI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,zl=(r,e)=>{for(var t in e||(e={}))lI.call(e,t)&&wb(r,t,e[t]);if(xb)for(var t of xb(e))cI.call(e,t)&&wb(r,t,e[t]);return r},Uf=(r,e)=>oI(r,aI(e)),Sb=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});const Ul=({usePkce:r,id:e,flow:t,tokenUrl:n,authCorsProxyUrl:i,tokenEndpointAuthMethod:s,server:o,scopes:a,authorizationUrl:l,defaultValues:c,clientId:u})=>{var h;const{oAuth2RedirectURI:d,routingBasePath:p}=(0,$r.Dv)(Wn.qd),{setValue:m,getValues:y,trigger:w,formState:A}=(0,gt.Gc)(),[T,P]=(0,S.useState)(null),[L,D]=(0,S.useState)(!1),[j,W]=(0,S.useState)(!1),[q,F]=(0,S.useState)(void 0),[H,Q]=(0,S.useState)(void 0),[oe,fe]=(0,S.useState)(void 0),be=((h=y("auth"))==null?void 0:h[e])||{},ke=A.errors||{},Re=q!==void 0&&H!==oe?{label:"sync",onClick:()=>{q&&Q(oe)}}:void 0;(0,S.useEffect)(()=>{if(r){const Wt=(0,gi.CY)(43);ad(Wt).then(_t=>{F(Wt),Q(_t),fe(_t)})}},[r]);const Se=Wt=>Sb(void 0,null,function*(){if(!Wt||(yield w(),!(0,gi.Qr)(ke)))return;D(!0),P(null);const _t=i?i+(0,je.jg)(Wt):Wt,Or=i&&n?i+(0,je.jg)(n):n,oi=y(`auth.${e}.scopes`),ai={authorizationUrl:_t.startsWith("http")?_t:o+_t,clientId:be.client_id,scopes:oi,redirectUri:d,routingBasePath:p,successCallback:Er=>{m(`auth.${e}.token`,Er),D(!1),P(null)},errorCallback:Er=>{D(!1),P(Er?.message||"Failed to retrieve the access token")}};if(t==="implicit"&&Hr.authorizeImplicit(ai),!(0,je.xl)(s)){console.log(`Unsupported token endpoint auth method: ${s}`);return}t==="authorizationCode"&&Hr.authorizeAuthorizationCode(zl(Uf(zl({},ai),{tokenUrl:Or?.startsWith("http")?Or:o+Or,clientSecret:be.client_secret,extraHeaders:(0,je.Or)({authMethod:s,clientId:be.client_id,clientSecret:be.client_secret})}),r&&{codeVerifier:q,codeChallenge:H}))}),Oe=()=>{De(),P(null)},Te=()=>{D(!1),P(null),Hr.clearRedirectData(t)},De=()=>{m(`auth.${e}.token`,"")},bt=()=>{W(Wt=>!Wt)},Rt=Wt=>Sb(void 0,[Wt],function*({target:{value:_t}}){const Or=yield ad(_t);F(_t),fe(Or)});if(!l)return S.createElement(ve.Xq,null,"No flow info");let ir=(0,Ee.YQ)(`auth.${e}.token`)||JSON.stringify(c?.token);ir=ir?JSON.parse(ir):"";const jr=(0,Ee.Al)(e,"client_id"),si={fieldName:`auth.${e}.client_id`,fullWidth:!0,defaultValue:(0,Ee.YQ)(`auth.${e}.client_id`)||u||c?.client_id,placeholder:"Your OAuth2 app Client ID",rules:{validate:je.np},validateOnBlur:!0,validateOnChange:!0};return S.createElement("div",null,S.createElement(ve.n5,null,S.createElement(ve.NI,null,S.createElement(ve.lX,null," Client ID: "),jr?S.createElement(it.F0,Uf(zl({},si),{options:jr})):S.createElement(it.Xn,Uf(zl({},si),{"data-cy":"client-id-input",panel:"try-it"}))),t==="authorizationCode"&&S.createElement(S.Fragment,null,(!r?.hideClientSecretInput||!r)&&S.createElement(ve.NI,null,S.createElement(ve.lX,null,"Client Secret:"),S.createElement(it.Xn,{type:"password",fullWidth:!0,fieldName:`auth.${e}.client_secret`,defaultValue:(0,Ee.YQ)(`auth.${e}.client_secret`)||c?.client_secret,validateOnBlur:!0,validateOnChange:!0,panel:"try-it","data-cy":"client-secret-input"})),r&&!r.disableManualConfiguration&&S.createElement(WM,null,S.createElement(yb,{id:"pkce-opitons-toggle",label:"Configure PKCE manually",checked:j,onChange:bt,"data-cy":"pkce-options-toggle"}),j&&S.createElement($M,null,S.createElement(ve.NI,null,S.createElement(ve.lX,null,"Code Verifier"),S.createElement(it.nv,{fullWidth:!0,value:q,onChange:Rt,panel:"try-it","data-cy":"code-verifier-input"})),S.createElement(ve.NI,null,S.createElement(ve.lX,null,"Code Challenge"),S.createElement(it.nv,{fullWidth:!0,value:H,onChange:({target:{value:Wt}})=>{Q(Wt)},inputActionButton:Re,panel:"try-it","data-cy":"code-challenge-input"}))))),S.createElement(it.Xn,{fullWidth:!0,fieldName:`auth.${e}.token`,type:"hidden",defaultValue:ir,panel:"try-it"}),S.createElement(bb,{id:e,scopes:a}),be.token&&be.token.access_token?S.createElement(ve.NI,null,S.createElement(ve.lX,null," Access Token: "),S.createElement(it.nv,{disabled:!0,type:"password",fullWidth:!0,value:be.token.access_token,panel:"try-it"})):null),S.createElement(VM,null,be.token&&be.token.access_token?S.createElement(pt.Button,{fullWidth:!0,onClick:Oe},"Log out"):L?S.createElement(S.Fragment,null,S.createElement(pt.Button,{fullWidth:!0,onClick:Te},"Cancel"),S.createElement(gb,null)):S.createElement(pt.Button,{fullWidth:!0,disabled:!(0,gi.Qr)(ke),onClick:()=>{Se(l)}},"Authorize")),L||T||!be.token||!be.token.access_token&&S.createElement(iI,{loading:L,error:T,token:be.token}))};var uI=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});function fI(r){var e,t;const{scheme:n,defaultValues:i}=r,[s,o]=(0,S.useState)({}),[a,l]=(0,S.useState)(),[c,u]=(0,S.useState)(!1);(0,S.useEffect)(()=>{h(n.openIdConnectUrl)},[n.openIdConnectUrl]);const h=d=>uI(this,null,function*(){u(!0),l("");try{const p=yield BM(d);o(p)}catch(p){l(p.message)}u(!1)});return c?S.createElement(hI,null):a?S.createElement(kb,{message:a}):S.createElement("div",null,S.createElement("div",null,(e=s?.response_types_supported)!=null&&e.includes("token")?S.createElement(S.Fragment,null,S.createElement(Mr.S6,null,"OAuth2 Implicit Flow"),S.createElement(Ul,{key:r.id,authorizationUrl:s.authorization_endpoint,authCorsProxyUrl:r.authCorsProxyUrl,scopes:s.scopes_supported,server:r.server,id:r.id,clientId:r.clientId,flow:"implicit",defaultValues:i})):(t=s?.response_types_supported)!=null&&t.includes("code")?S.createElement(S.Fragment,null,S.createElement(Mr.S6,null,"OAuth2 Authorization Flow"),S.createElement(Ul,{key:r.id,authorizationUrl:s.authorization_endpoint,tokenUrl:s.token_endpoint,authCorsProxyUrl:r.authCorsProxyUrl,scopes:s.scopes_supported,server:r.server,id:r.id,clientId:r.clientId,tokenEndpointAuthMethod:s?.token_endpoint_auth_methods_supported,flow:"authorizationCode",defaultValues:i})):S.createElement("div",null,"Unsupported flow")))}function hI(){return S.createElement("div",null,S.createElement("div",null,S.createElement("div",null,"Fetching OpenID Connect metadata..."),S.createElement(gb,null)))}function kb({message:r}){return S.createElement("div",null,S.createElement("div",null,S.createElement(ve.Xq,null,r)))}var dI=Object.defineProperty,pI=Object.defineProperties,gI=Object.getOwnPropertyDescriptors,Ab=Object.getOwnPropertySymbols,mI=Object.prototype.hasOwnProperty,vI=Object.prototype.propertyIsEnumerable,Cb=(r,e,t)=>e in r?dI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ob=(r,e)=>{for(var t in e||(e={}))mI.call(e,t)&&Cb(r,t,e[t]);if(Ab)for(var t of Ab(e))vI.call(e,t)&&Cb(r,t,e[t]);return r},Eb=(r,e)=>pI(r,gI(e)),yI=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});function bI(r){if(!r)return"Token is required"}const xI=({id:r,server:e,flow:t,authCorsProxyUrl:n,defaultValues:i,clientId:s})=>{var o,a;const{setValue:l,watch:c,formState:u}=(0,gt.Gc)(),[h,d]=(0,S.useState)(""),[p,m]=(0,S.useState)(!1),[y,w]=(0,S.useState)(!0),A=((o=c("auth"))==null?void 0:o[r])||{},T=((a=u.errors)==null?void 0:a.auth)||{},P=()=>{l(`auth.${r}.token`,""),(0,Ee.WW)(`auth.${r}.token`,"")},L=()=>{w(H=>!H)},D=()=>yI(void 0,null,function*(){if(p)return;const H=n&&t.tokenUrl?n+(0,je.jg)(t.tokenUrl):t.tokenUrl;if(T.client_id||T.client_secret){console.log("Provide client_id and client_secret");return}const Q=A.client_id,oe=A.client_secret;if(!Q||!oe){console.log("Provide client_id and client_secret");return}m(!0);const fe=t["x-tokenEndpointAuthMethod"];if(!(0,je.xl)(fe)){console.log(`Unsupported token endpoint auth method: ${fe}`);return}yield Hr.authorizeClientCredentials({tokenUrl:H.startsWith("http")?H:e+H,clientId:Q,clientSecret:oe,scopes:A.scopes,extraHeaders:(0,je.Or)({authMethod:fe,clientId:Q,clientSecret:oe}),successCallback:be=>{l(`auth.${r}.token`,be),m(!1)},errorCallback:be=>{P(),d(be.message),m(!1)}})}),j=Object.keys(t.scopes);let W=(0,Ee.YQ)(`auth.${r}.token`)||JSON.stringify(i?.token);W=W?JSON.parse(W):"";const q=(0,Ee.Al)(r,"client_id"),F={fieldName:`auth.${r}.client_id`,fullWidth:!0,defaultValue:(0,Ee.YQ)(`auth.${r}.client_id`)||s||i?.client_id,placeholder:"Your OAuth2 app Client ID"};return S.createElement(S.Fragment,null,S.createElement(ve.n5,null,S.createElement(ve.NI,null,S.createElement(ve.lX,null,"Client ID:"),q?S.createElement(it.F0,Eb(Ob({},F),{options:q})):S.createElement(it.Xn,Eb(Ob({},F),{type:"password",panel:"try-it"}))),S.createElement(ve.NI,null,S.createElement(ve.lX,null,"Client Secret:"),S.createElement(it.Xn,{type:"password",fullWidth:!0,fieldName:`auth.${r}.client_secret`,defaultValue:(0,Ee.YQ)(`auth.${r}.client_secret`)||i?.client_secret,panel:"try-it"})),S.createElement(it.Xn,{fullWidth:!0,fieldName:`auth.${r}.token`,type:"hidden",defaultValue:W,rules:{validate:bI}}),S.createElement(bb,{id:r,scopes:j})),S.createElement(pt.Button,{color:"primary",onClick:D,blinking:p},p?"Loading...":"Request Token"),S.createElement(ve.ph,null," Access Token "),h?S.createElement(ve.Xq,{style:{marginBottom:"1em"}},"Failed to request token: ",S.createElement("pre",null,h)," "):A.token&&A.token.access_token?S.createElement(ve.TR,null,S.createElement(ve.WA,{length:A.token.access_token.length,masked:y},A.token.access_token),S.createElement(ve.lf,{onClick:L},y?"Show":"Hide"," "),S.createElement(ve.h,{onClick:P}," Clear ")):S.createElement(ve.Xq,{style:{marginBottom:"1em"}},"No token"))};var wI=Object.defineProperty,SI=Object.defineProperties,kI=Object.getOwnPropertyDescriptors,Tb=Object.getOwnPropertySymbols,AI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,Pb=(r,e,t)=>e in r?wI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Cs=(r,e)=>{for(var t in e||(e={}))AI.call(e,t)&&Pb(r,t,e[t]);if(Tb)for(var t of Tb(e))CI.call(e,t)&&Pb(r,t,e[t]);return r},Os=(r,e)=>SI(r,kI(e));const OI=({securityDefaults:r,operation:e,activeServer:t,authCorsProxyUrl:n})=>{var i,s;const{control:o,setValue:a,watch:l}=(0,gt.Gc)(),{parser:c}=(0,$r.Dv)(Wn.eG),u=e.security,h=(0,S.useMemo)(()=>u.map(P=>P.schemes.map(L=>L.id).join(" and ")).filter(Boolean),[u]),d=l("securityScheme"),p=(0,S.useMemo)(()=>{const P=h.findIndex(L=>L===d);return P<0?0:P},[h,d]);(0,S.useEffect)(()=>{const P=(0,Ee.YQ)("securityRequirementName"),L=h.findIndex(D=>D===P);a("securityScheme",h[L<0?0:L])},[h,e,a]);const m=(0,S.useCallback)(P=>{a("securityScheme",P.value),(0,Ee.WW)("securityRequirementName",P.value)},[a]),y=(0,S.useMemo)(()=>h.map((P,L)=>({value:P,idx:L})),[h]);if(y.length===0)return S.createElement(kb,{message:"Cannot find security schema in the definition"});const w=u[p],A=(0,Ee.A8)(w.schemes[0].id),T=l(`auth.${A}`);return S.createElement(S.Fragment,null,S.createElement(ve.n5,null,y.length>1&&S.createElement(ve.NI,null,S.createElement(ve.lX,null," Security scheme: "),S.createElement(gt.Qr,{control:o,name:"securityScheme",render:({field:{value:P}})=>S.createElement(Mr.VD,{variant:"dark",fullWidth:!0,options:y,value:P,onChange:m})}))||null,S.createElement(pt.TryItSecurityApps,{apiId:(s=(i=c?.definition.info)==null?void 0:i["x-metadata"])==null?void 0:s.apiId,value:T,onChange:P=>{a(`auth.${A}`,P)}}),w.schemes.map(P=>{var L,D,j,W,q,F;const H=(0,Ee.A8)(P.id);if(P.type==="apiKey"){const Q=(0,Ee.Al)(H,""),oe={fieldName:`auth.${H}`,fullWidth:!0,defaultValue:(0,je.NG)(P)||(0,Ee.YQ)(`auth.${H}`)||r?.[H],rules:{validate:je.np},validateOnBlur:!0,validateOnChange:!0};return S.createElement(ve.NI,{key:H},S.createElement(ve.lX,null," ",P.name,": "),Q?S.createElement(it.F0,Os(Cs({},oe),{options:Q})):S.createElement(it.Xn,Os(Cs({},oe),{type:"password",panel:"try-it","data-cy":"apiKey-auth-password"})))}else if(P.type==="http"){if(P.scheme==="basic"){const Q=(0,Ee.Al)(H,"username"),oe={fieldName:`auth.${H}.username`,fullWidth:!0,defaultValue:(0,Ee.YQ)(`auth.${H}.username`)||((L=r?.[H])==null?void 0:L.username),validate:je.np,rules:{required:!0}};return S.createElement(S.Fragment,{key:H},S.createElement(ve.NI,null,S.createElement(ve.lX,null," ",(0,Fs.l)("tryItAuthBasicUsername"),": "),Q?S.createElement(it.F0,Os(Cs({},oe),{options:Q})):S.createElement(it.Xn,Os(Cs({},oe),{panel:"try-it"}))),S.createElement(ve.NI,null,S.createElement(ve.lX,null," ",(0,Fs.l)("tryItAuthBasicPassword"),": "),S.createElement(it.Xn,{type:"password","data-cy":"http-auth-password",fullWidth:!0,fieldName:`auth.${H}.password`,defaultValue:(0,Ee.YQ)(`auth.${H}.password`)||((D=r?.[H])==null?void 0:D.password)||"",validateOnBlur:!0,validateOnChange:!0,panel:"try-it"})))}else if(P.scheme==="bearer"){const Q=(0,Ee.Al)(H,""),oe={fieldName:`auth.${H}`,fullWidth:!0,defaultValue:(0,Ee.YQ)(`auth.${H}`)||r?.[H],rules:{validate:je.np},validateOnBlur:!0,validateOnChange:!0};return S.createElement(S.Fragment,{key:H},S.createElement(ve.NI,null,S.createElement(ve.lX,null," Bearer Token: "),Q?S.createElement(it.F0,Os(Cs({},oe),{options:Q})):S.createElement(it.Xn,Os(Cs({},oe),{type:"password",placeholder:"(without 'Bearer')",panel:"try-it"}))))}}else{if(P.type==="oauth2"&&P.flows&&P.flows.clientCredentials)return S.createElement(xI,{key:H,flow:P.flows.clientCredentials,server:t,authCorsProxyUrl:n,id:H,clientId:P.flows.clientCredentials["x-defaultClientId"]||P["x-defaultClientId"],defaultValues:r?.[H]});if(P.type==="oauth2"&&P.flows&&P.flows.implicit)return S.createElement(Ul,{key:H,authorizationUrl:P.flows.implicit.authorizationUrl,authCorsProxyUrl:n,scopes:Object.keys(((W=(j=P?.flows)==null?void 0:j.implicit)==null?void 0:W.scopes)||{}),server:t,id:H,clientId:P.flows.implicit["x-defaultClientId"]||P["x-defaultClientId"],flow:"implicit",defaultValues:r?.[H]});if(P.type==="oauth2"&&P.flows&&P.flows.authorizationCode)return S.createElement(Ul,{key:H,authorizationUrl:P.flows.authorizationCode.authorizationUrl,tokenUrl:P.flows.authorizationCode.tokenUrl,authCorsProxyUrl:n,scopes:Object.keys(((q=P.flows.authorizationCode)==null?void 0:q.scopes)||{}),server:t,id:H,clientId:P.flows.authorizationCode["x-defaultClientId"]||P["x-defaultClientId"],flow:"authorizationCode",tokenEndpointAuthMethod:P.flows.authorizationCode["x-tokenEndpointAuthMethod"],usePkce:P.flows.authorizationCode["x-usePkce"],defaultValues:r?.[H]});if(P.type==="oauth2"){let Q=(0,Ee.YQ)(`auth.${H}.token`)||JSON.stringify((F=r?.[H])==null?void 0:F.token);return Q=Q?JSON.parse(Q):{},S.createElement(S.Fragment,{key:H},S.createElement(ve.NI,null,S.createElement(ve.lX,null," Access Token Type: "),S.createElement(it.Xn,{fullWidth:!0,fieldName:`auth.${H}.token.token_type`,defaultValue:Q.token_type||"Bearer",panel:"try-it"})),S.createElement(ve.NI,null,S.createElement(ve.lX,null," Access Token: "),S.createElement(it.Xn,{type:"password",fullWidth:!0,fieldName:`auth.${H}.token.access_token`,rules:{validate:je.np},defaultValue:Q.access_token,validateOnBlur:!0,validateOnChange:!0,panel:"try-it"})))}else if(P.type==="openIdConnect")return S.createElement(fI,{key:H,server:t,authCorsProxyUrl:n,id:H,scheme:P,clientId:P["x-defaultClientId"],defaultValues:r?.[H]})}})),S.createElement("small",null,S.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))};var EI=f(55919);function TI({operation:r,properties:e,mergeExampleBody:t,securityDefaults:n,resolvedRawSpec:i,server:s,onServerChange:o}){const{watch:a,formState:l}=(0,gt.Gc)(),c=l.errors||{},u=!!(c.path||c.cookie||c.header||c.query),{hooks:h,authCorsProxyUrl:d}=(0,$r.Dv)(Wn.qd),p=i&&Ee.IB.get(i,r.pointer),m=a();let y=m&&m.auth&&Object.keys(m.auth)[0];(!y||!m.auth[y])&&(y=void 0),y&&(m.auth[y].token!==void 0||m.auth[y].client_id!==void 0||m.auth[y].client_secret!==void 0)&&(!m.auth[y].token||!m.auth[y].token.access_token)&&(y=void 0),y&&m.auth[y].username!=null&&(!m.auth[y].username||!m.auth[y].password)&&(y=void 0);const w=r.parameters||[];return!i&&S.createElement(S.Fragment,null,"Loading...")||S.createElement("form",{style:{flex:1,display:"flex",flexDirection:"column",margin:0}},S.createElement(eS,{operation:r,onChange:o}),S.createElement(ea.UQ,{initialActiveIdx:r.security.length&&y?1:0},r.security.length&&S.createElement(fc,{header:(0,Fs.l)("tryItAuth"),"data-cy":"security-trigger",error:!y&&!!c.auth,success:!!y,renderChildrenHidden:!0},pt.OpenApiTryItSecurityPanel||h?.ReplaceTryItSecurityPanel?S.createElement(PI,{fieldName:"auth",validate:je.np},A=>S.createElement(EI.Q,{Hook:pt.OpenApiTryItSecurityPanel||h?.ReplaceTryItSecurityPanel,props:{server:s,operation:r,onChange:A,OAuth2:Hr}})):S.createElement(OI,{operation:r,activeServer:s.url,authCorsProxyUrl:d,securityDefaults:n}))||null,r.requestBody&&S.createElement(fc,{header:(0,Fs.l)("tryItBody"),"data-cy":"body-trigger",error:!!c.body,renderChildrenHidden:!0},S.createElement(SM,{validate:MI,body:r.requestBody,pointer:r.pointer,id:r.id,resolvedBody:p?.requestBody,properties:e,mergeExampleBody:t}))||null,w.length&&S.createElement(fc,{header:(0,Fs.l)("tryItParameters"),"data-cy":"parameters-trigger",error:u,renderChildrenHidden:!0},S.createElement(RM,{operation:r,values:m}))||null))}function PI({fieldName:r,validate:e,children:t}){const{control:n,setValue:i}=(0,gt.Gc)();return S.createElement(gt.Qr,{control:n,name:r,rules:{validate:e},render:()=>t(i)})}function MI(){}const II=(0,S.memo)(TI);function DI({shaking:r,className:e,children:t,rootElement:n}){const[i]=(0,zf.Bs)(n),s=(0,$r.Dv)(Wn.qd);return S.createElement(Mr.q2,{scrollYOffset:s.scrollYOffset,shaking:r,className:e,"data-cy":"console",fullWidth:i?.width},t)}const NI=(0,S.memo)(DI);var RI=Object.defineProperty,LI=Object.defineProperties,BI=Object.getOwnPropertyDescriptors,Mb=Object.getOwnPropertySymbols,FI=Object.prototype.hasOwnProperty,jI=Object.prototype.propertyIsEnumerable,Ib=(r,e,t)=>e in r?RI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,It=(r,e)=>{for(var t in e||(e={}))FI.call(e,t)&&Ib(r,t,e[t]);if(Mb)for(var t of Mb(e))jI.call(e,t)&&Ib(r,t,e[t]);return r},Cr=(r,e)=>LI(r,BI(e)),Db=(r,e,t)=>new Promise((n,i)=>{var s=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});function Nb(r){return r.startsWith("//")?"https:"+r:r}function VI({operation:r,onResponse:e,className:t,rootElement:n,properties:i,mergeExampleBody:s,securityDefaults:o,onClose:a}){const l=(0,gt.cI)({defaultValues:{path:(0,je.ZS)(r.parameters,"path"),cookie:(0,je.ZS)(r.parameters,"cookie"),header:(0,je.ZS)(r.parameters,"header"),query:(0,je.ZS)(r.parameters,"query")}}),[{activeServer:c},u]=(0,$r.KO)((0,dc.N)(r.pointer)),[h,d]=(0,S.useState)(0),[p,m]=(0,S.useState)(!1),[y,w]=(0,S.useState)(!1),[A,T]=(0,S.useState)(),[P,L]=(0,S.useState)(),[D,j]=(0,S.useState)(),[W,q]=(0,S.useState)(),F=(0,zf.D9)(r),{parser:H,options:Q}=(0,$r.Dv)(Wn.eG);(0,S.useEffect)(()=>{const{unsubscribe:Se}=l.watch((Oe={})=>{u(Te=>Cr(It({},Te),{requestValues:JSON.parse(JSON.stringify(Oe))})),(0,je.Hc)(Cr(It({},Oe),{query:(0,je.FU)(Oe.query||{})}))});return()=>Se()},[l,u]);const oe=(0,S.useCallback)(Se=>{d(Se)},[]),fe=(0,S.useCallback)(Se=>{u(Oe=>Cr(It({},Oe),{activeServer:Se})),l.setValue("server",Se)},[u,l]),be=l.handleSubmit(Se=>Db(this,null,function*(){var Oe,Te,De,bt,Rt,ir,jr,si,Wt,_t,Or,oi,ai;const{servers:Er,requestBody:vn}=r,Gl=vn&&vn.content&&((Oe=(0,Xr.getActiveMediaType)(vn.content))==null?void 0:Oe.name)||"";let li=Se.body;if(/json/.test(Gl))try{li=JSON.parse(li)}catch(Ke){console.error(Ke)}m(!0);const sr=A,Es=(r.httpVerb||"").toLowerCase();if(!Er)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 Gf=Er.find(Ke=>c?.url.endsWith(Ke.url.endsWith("/")?Ke.url.substring(0,Ke.url.length-1):Ke.url)),$I=Date.now();let Mn,ci=Se.auth;if(ci){const Ke=Object.keys(ci)[0],yn=(0,ww.dw)(Ke);Mn=Cr(It({},sr),{components:Cr(It({},sr?.components),{securitySchemes:Cr(It({},(Te=sr?.components)==null?void 0:Te.securitySchemes),{[yn]:Cr(It({},(bt=(De=sr?.components)==null?void 0:De.securitySchemes)==null?void 0:bt[yn]),{type:((jr=(ir=(Rt=sr?.components)==null?void 0:Rt.securitySchemes)==null?void 0:ir[yn])==null?void 0:jr.type)==="openIdConnect"?"oauth2":((Wt=(si=sr?.components)==null?void 0:si.securitySchemes)==null?void 0:Wt[yn]).type})})})}),ci=Cr(It({},ci),{[yn]:ci[Ke]})}else Mn=It({},sr);Mn.servers=Er;const Kl=Q.corsProxyUrl;Kl&&Er.length&&(Mn.servers=Er.map(Ke=>Cr(It({},Ke),{url:Kl+Nb(Ke.url)})),Mn.paths=Cr(It({},Mn.paths),{[r.path]:Cr(It({},Mn.paths[r.path]),{[Es]:Cr(It({},Mn.paths[r.path][Es]),{servers:void 0}),servers:void 0})}));const Kf=vn?.content&&((_t=(0,Xr.getActiveMediaType)(vn.content))==null?void 0:_t.name)||null;if(Kf&&li&&ta(Kf)){const Ke=Object.values(li);li=Ke.length>1?Ke:Ke[0]}const HI=(0,je.FU)(Se.query||{}),Yf={server:Kl?Kl+Nb(Gf.url):Gf.url,serverVariables:(0,je.mj)(Gf),spec:Mn,pathName:r.path,method:r.httpVerb,parameters:It(It(It(It({},Se.path),HI),Se.header),Se.cookie),securities:{authorized:ci},requestBody:li,requestContentType:Kf,responseContentType:((Or=Se.header)==null?void 0:Or.Accept)||null,requestInterceptor:(0,je.Tz)(Q,r,ci?.Authorization)};try{const Ke=yield rw(Yf),yn=Ke?.data;yn instanceof Blob&&(ta(yn.type)&&(Ke.fileInfo={rawData:yn,fileName:(0,je.AM)(Ke.headers)}),Ke.data=yield yn.text()),e?.({request:Yf,response:Ke}),q(Ke),j(void 0)}catch(Ke){Ke&&Ke.response&&Ke.response.data instanceof Blob&&(Ke.response.data=yield Ke.response.data.text(),e?.({request:Yf,response:Ke.response})),q(void 0),j(Ke)}finally{m(!1),d(1),L(Date.now()-$I),(ai=(oi=Q.events)==null?void 0:oi.tryItSent)==null||ai.call(oi,{eventType:lc.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:r.operationId,operationPath:r.path,operationHttpVerb:r.httpVerb,operationSummary:r.description})}}),()=>{var Se,Oe;w(!0),setTimeout(()=>w(!1),1e3),(Oe=(Se=Q.events)==null?void 0:Se.tryItSent)==null||Oe.call(Se,{eventType:lc.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:r.operationId,operationPath:r.path,operationHttpVerb:r.httpVerb,operationSummary:r.description})});(0,pt.useMount)(()=>Db(this,null,function*(){const Se=yield xw(r,H.definition);T(Se),r.activeServer&&!c&&u(Oe=>Cr(It({},Oe),{activeServer:r.activeServer}))})),(0,S.useEffect)(()=>{F&&F!==r&&(q(void 0),j(void 0),d(0))},[r,F]);const ke=!!(W||D),Re=l.getValues();return S.createElement(gt.RV,It({},l),S.createElement(NI,{shaking:y,className:t,rootElement:n},S.createElement(ea.Hc,null,S.createElement(Rw,{active:h,hasResponse:ke,onChange:oe}),a&&S.createElement(Mr.PZ,{onClick:a}," \u2715 ")),S.createElement(Mr.RE,{hidden:h!==0,"data-cy":"console-request-body"},S.createElement(II,{operation:r,properties:i,mergeExampleBody:s,securityDefaults:o,resolvedRawSpec:A,server:c||r.activeServer,onServerChange:fe})),S.createElement(Mr.RE,{hidden:h!==1,"data-cy":"console-response-body"},S.createElement(Dw,{response:W,error:D,time:P})),S.createElement(jw,{hasResponse:ke,params:Re,operation:r,loading:p,onSubmit:be})))}const WI=(0,S.memo)(VI)},85208:(v,C,f)=>{var g=f(34440),b=f(84108),x=f(61085),k=f(77706),O=f(8636);function E(N){var I=-1,B=N==null?0:N.length;for(this.clear();++I<B;){var z=N[I];this.set(z[0],z[1])}}E.prototype.clear=g,E.prototype.delete=b,E.prototype.get=x,E.prototype.has=k,E.prototype.set=O,v.exports=E},81998:(v,C,f)=>{var g=f(90266),b=f(42875),x=f(45828),k=f(24115),O=f(67690);function E(N){var I=-1,B=N==null?0:N.length;for(this.clear();++I<B;){var z=N[I];this.set(z[0],z[1])}}E.prototype.clear=g,E.prototype.delete=b,E.prototype.get=x,E.prototype.has=k,E.prototype.set=O,v.exports=E},72887:(v,C,f)=>{var g=f(65234),b=f(83250),x=g(b,"Map");v.exports=x},95678:(v,C,f)=>{var g=f(39016),b=f(62363),x=f(64348),k=f(53062),O=f(30262);function E(N){var I=-1,B=N==null?0:N.length;for(this.clear();++I<B;){var z=N[I];this.set(z[0],z[1])}}E.prototype.clear=g,E.prototype.delete=b,E.prototype.get=x,E.prototype.has=k,E.prototype.set=O,v.exports=E},70861:(v,C,f)=>{var g=f(83250),b=g.Symbol;v.exports=b},29233:v=>{function C(f,g){for(var b=-1,x=f==null?0:f.length,k=Array(x);++b<x;)k[b]=g(f[b],b,f);return k}v.exports=C},18498:(v,C,f)=>{var g=f(58260);function b(x,k){for(var O=x.length;O--;)if(g(x[O][0],k))return O;return-1}v.exports=b},40548:(v,C,f)=>{var g=f(24007),b=f(86040);function x(k,O){O=g(O,k);for(var E=0,N=O.length;k!=null&&E<N;)k=k[b(O[E++])];return E&&E==N?k:void 0}v.exports=x},69823:(v,C,f)=>{var g=f(70861),b=f(91339),x=f(25151),k="[object Null]",O="[object Undefined]",E=g?g.toStringTag:void 0;function N(I){return I==null?I===void 0?O:k:E&&E in Object(I)?b(I):x(I)}v.exports=N},99817:(v,C,f)=>{var g=f(45563),b=f(28597),x=f(93702),k=f(55784),O=/[\\^$.*+?()[\]{}|]/g,E=/^\[object .+?Constructor\]$/,N=Function.prototype,I=Object.prototype,B=N.toString,z=I.hasOwnProperty,Y=RegExp("^"+B.call(z).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _(X){if(!x(X)||b(X))return!1;var G=g(X)?Y:E;return G.test(k(X))}v.exports=_},86245:(v,C,f)=>{var g=f(70861),b=f(29233),x=f(55589),k=f(52624),O=1/0,E=g?g.prototype:void 0,N=E?E.toString:void 0;function I(B){if(typeof B=="string")return B;if(x(B))return b(B,I)+"";if(k(B))return N?N.call(B):"";var z=B+"";return z=="0"&&1/B==-O?"-0":z}v.exports=I},24007:(v,C,f)=>{var g=f(55589),b=f(5130),x=f(44041),k=f(99835);function O(E,N){return g(E)?E:b(E,N)?[E]:x(k(E))}v.exports=O},1622:(v,C,f)=>{var g=f(83250),b=g["__core-js_shared__"];v.exports=b},20302:(v,C,f)=>{var g=typeof f.g=="object"&&f.g&&f.g.Object===Object&&f.g;v.exports=g},77570:(v,C,f)=>{var g=f(58949);function b(x,k){var O=x.__data__;return g(k)?O[typeof k=="string"?"string":"hash"]:O.map}v.exports=b},65234:(v,C,f)=>{var g=f(99817),b=f(67736);function x(k,O){var E=b(k,O);return g(E)?E:void 0}v.exports=x},91339:(v,C,f)=>{var g=f(70861),b=Object.prototype,x=b.hasOwnProperty,k=b.toString,O=g?g.toStringTag:void 0;function E(N){var I=x.call(N,O),B=N[O];try{N[O]=void 0;var z=!0}catch{}var Y=k.call(N);return z&&(I?N[O]=B:delete N[O]),Y}v.exports=E},67736:v=>{function C(f,g){return f?.[g]}v.exports=C},34440:(v,C,f)=>{var g=f(24545);function b(){this.__data__=g?g(null):{},this.size=0}v.exports=b},84108:v=>{function C(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}v.exports=C},61085:(v,C,f)=>{var g=f(24545),b="__lodash_hash_undefined__",x=Object.prototype,k=x.hasOwnProperty;function O(E){var N=this.__data__;if(g){var I=N[E];return I===b?void 0:I}return k.call(N,E)?N[E]:void 0}v.exports=O},77706:(v,C,f)=>{var g=f(24545),b=Object.prototype,x=b.hasOwnProperty;function k(O){var E=this.__data__;return g?E[O]!==void 0:x.call(E,O)}v.exports=k},8636:(v,C,f)=>{var g=f(24545),b="__lodash_hash_undefined__";function x(k,O){var E=this.__data__;return this.size+=this.has(k)?0:1,E[k]=g&&O===void 0?b:O,this}v.exports=x},5130:(v,C,f)=>{var g=f(55589),b=f(52624),x=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/;function O(E,N){if(g(E))return!1;var I=typeof E;return I=="number"||I=="symbol"||I=="boolean"||E==null||b(E)?!0:k.test(E)||!x.test(E)||N!=null&&E in Object(N)}v.exports=O},58949:v=>{function C(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}v.exports=C},28597:(v,C,f)=>{var g=f(1622),b=function(){var k=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||"");return k?"Symbol(src)_1."+k:""}();function x(k){return!!b&&b in k}v.exports=x},90266:v=>{function C(){this.__data__=[],this.size=0}v.exports=C},42875:(v,C,f)=>{var g=f(18498),b=Array.prototype,x=b.splice;function k(O){var E=this.__data__,N=g(E,O);if(N<0)return!1;var I=E.length-1;return N==I?E.pop():x.call(E,N,1),--this.size,!0}v.exports=k},45828:(v,C,f)=>{var g=f(18498);function b(x){var k=this.__data__,O=g(k,x);return O<0?void 0:k[O][1]}v.exports=b},24115:(v,C,f)=>{var g=f(18498);function b(x){return g(this.__data__,x)>-1}v.exports=b},67690:(v,C,f)=>{var g=f(18498);function b(x,k){var O=this.__data__,E=g(O,x);return E<0?(++this.size,O.push([x,k])):O[E][1]=k,this}v.exports=b},39016:(v,C,f)=>{var g=f(85208),b=f(81998),x=f(72887);function k(){this.size=0,this.__data__={hash:new g,map:new(x||b),string:new g}}v.exports=k},62363:(v,C,f)=>{var g=f(77570);function b(x){var k=g(this,x).delete(x);return this.size-=k?1:0,k}v.exports=b},64348:(v,C,f)=>{var g=f(77570);function b(x){return g(this,x).get(x)}v.exports=b},53062:(v,C,f)=>{var g=f(77570);function b(x){return g(this,x).has(x)}v.exports=b},30262:(v,C,f)=>{var g=f(77570);function b(x,k){var O=g(this,x),E=O.size;return O.set(x,k),this.size+=O.size==E?0:1,this}v.exports=b},32924:(v,C,f)=>{var g=f(67997),b=500;function x(k){var O=g(k,function(N){return E.size===b&&E.clear(),N}),E=O.cache;return O}v.exports=x},24545:(v,C,f)=>{var g=f(65234),b=g(Object,"create");v.exports=b},25151:v=>{var C=Object.prototype,f=C.toString;function g(b){return f.call(b)}v.exports=g},83250:(v,C,f)=>{var g=f(20302),b=typeof self=="object"&&self&&self.Object===Object&&self,x=g||b||Function("return this")();v.exports=x},44041:(v,C,f)=>{var g=f(32924),b=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,x=/\\(\\)?/g,k=g(function(O){var E=[];return O.charCodeAt(0)===46&&E.push(""),O.replace(b,function(N,I,B,z){E.push(B?z.replace(x,"$1"):I||N)}),E});v.exports=k},86040:(v,C,f)=>{var g=f(52624),b=1/0;function x(k){if(typeof k=="string"||g(k))return k;var O=k+"";return O=="0"&&1/k==-b?"-0":O}v.exports=x},55784:v=>{var C=Function.prototype,f=C.toString;function g(b){if(b!=null){try{return f.call(b)}catch{}try{return b+""}catch{}}return""}v.exports=g},58260:v=>{function C(f,g){return f===g||f!==f&&g!==g}v.exports=C},13546:(v,C,f)=>{var g=f(40548);function b(x,k,O){var E=x==null?void 0:g(x,k);return E===void 0?O:E}v.exports=b},55589:v=>{var C=Array.isArray;v.exports=C},45563:(v,C,f)=>{var g=f(69823),b=f(93702),x="[object AsyncFunction]",k="[object Function]",O="[object GeneratorFunction]",E="[object Proxy]";function N(I){if(!b(I))return!1;var B=g(I);return B==k||B==O||B==x||B==E}v.exports=N},93702:v=>{function C(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}v.exports=C},50440:v=>{function C(f){return f!=null&&typeof f=="object"}v.exports=C},52624:(v,C,f)=>{var g=f(69823),b=f(50440),x="[object Symbol]";function k(O){return typeof O=="symbol"||b(O)&&g(O)==x}v.exports=k},67997:(v,C,f)=>{var g=f(95678),b="Expected a function";function x(k,O){if(typeof k!="function"||O!=null&&typeof O!="function")throw new TypeError(b);var E=function(){var N=arguments,I=O?O.apply(this,N):N[0],B=E.cache;if(B.has(I))return B.get(I);var z=k.apply(this,N);return E.cache=B.set(I,z)||B,z};return E.cache=new(x.Cache||g),E}x.Cache=g,v.exports=x},99835:(v,C,f)=>{var g=f(86245);function b(x){return x==null?"":g(x)}v.exports=b},14927:(v,C,f)=>{var g=typeof Map=="function"&&Map.prototype,b=Object.getOwnPropertyDescriptor&&g?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,x=g&&b&&typeof b.get=="function"?b.get:null,k=g&&Map.prototype.forEach,O=typeof Set=="function"&&Set.prototype,E=Object.getOwnPropertyDescriptor&&O?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,N=O&&E&&typeof E.get=="function"?E.get:null,I=O&&Set.prototype.forEach,B=typeof WeakMap=="function"&&WeakMap.prototype,z=B?WeakMap.prototype.has:null,Y=typeof WeakSet=="function"&&WeakSet.prototype,_=Y?WeakSet.prototype.has:null,X=typeof WeakRef=="function"&&WeakRef.prototype,G=X?WeakRef.prototype.deref:null,te=Boolean.prototype.valueOf,se=Object.prototype.toString,R=Function.prototype.toString,ee=String.prototype.match,U=String.prototype.slice,re=String.prototype.replace,ne=String.prototype.toUpperCase,ae=String.prototype.toLowerCase,ce=RegExp.prototype.test,V=Array.prototype.concat,K=Array.prototype.join,le=Array.prototype.slice,pe=Math.floor,ge=typeof BigInt=="function"?BigInt.prototype.valueOf:null,me=Object.getOwnPropertySymbols,$e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ye=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ve||"symbol")?Symbol.toStringTag:null,Fe=Object.prototype.propertyIsEnumerable,at=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function Dt($,Z){if($===1/0||$===-1/0||$!==$||$&&$>-1e3&&$<1e3||ce.call(/e/,Z))return Z;var ze=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $=="number"){var _e=$<0?-pe(-$):pe($);if(_e!==$){var lt=String(_e),Me=U.call(Z,lt.length+1);return re.call(lt,ze,"$&_")+"."+re.call(re.call(Me,/([0-9]{3})/g,"$&_"),/_$/,"")}}return re.call(Z,ze,"$&_")}var At=f(65710),qt=At.custom,Xe=hr(qt)?qt:null;v.exports=function $(Z,ze,_e,lt){var Me=ze||{};if(Pr(Me,"quoteStyle")&&Me.quoteStyle!=="single"&&Me.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Pr(Me,"maxStringLength")&&(typeof Me.maxStringLength=="number"?Me.maxStringLength<0&&Me.maxStringLength!==1/0:Me.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Yr=Pr(Me,"customInspect")?Me.customInspect:!0;if(typeof Yr!="boolean"&&Yr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Pr(Me,"indent")&&Me.indent!==null&&Me.indent!==" "&&!(parseInt(Me.indent,10)===Me.indent&&Me.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Pr(Me,"numericSeparator")&&typeof Me.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var wn=Me.numericSeparator;if(typeof Z>"u")return"undefined";if(Z===null)return"null";if(typeof Z=="boolean")return Z?"true":"false";if(typeof Z=="string")return fi(Z,Me);if(typeof Z=="number"){if(Z===0)return 1/0/Z>0?"0":"-0";var Ht=String(Z);return wn?Dt(Z,Ht):Ht}if(typeof Z=="bigint"){var Jr=String(Z)+"n";return wn?Dt(Z,Jr):Jr}var Ts=typeof Me.depth>"u"?5:Me.depth;if(typeof _e>"u"&&(_e=0),_e>=Ts&&Ts>0&&typeof Z=="object")return Ot(Z)?"[Array]":"[Object]";var Ln=Ce(Me,_e);if(typeof lt>"u")lt=[];else if(Kr(lt,Z)>=0)return"[Circular]";function gr(Fn,Wi,Uo){if(Wi&&(lt=le.call(lt),lt.push(Wi)),Uo){var Go={depth:Me.depth};return Pr(Me,"quoteStyle")&&(Go.quoteStyle=Me.quoteStyle),$(Fn,Go,_e+1,lt)}return $(Fn,Me,_e+1,lt)}if(typeof Z=="function"&&!Ne(Z)){var Vo=pr(Z),Wo=Pe(Z,gr);return"[Function"+(Vo?": "+Vo:" (anonymous)")+"]"+(Wo.length>0?" { "+K.call(Wo,", ")+" }":"")}if(hr(Z)){var Ps=Ve?re.call(String(Z),/^(Symbol\(.*\))_[^)]*$/,"$1"):$e.call(Z);return typeof Z=="object"&&!Ve?Wr(Ps):Ps}if(Dn(Z)){for(var Bn="<"+ae.call(String(Z.nodeName)),Li=Z.attributes||[],di=0;di<Li.length;di++)Bn+=" "+Li[di].name+"="+Ct(xt(Li[di].value),"double",Me);return Bn+=">",Z.childNodes&&Z.childNodes.length&&(Bn+="..."),Bn+="</"+ae.call(String(Z.nodeName))+">",Bn}if(Ot(Z)){if(Z.length===0)return"[]";var Bi=Pe(Z,gr);return Ln&&!Ze(Bi)?"["+Le(Bi,Ln)+"]":"[ "+K.call(Bi,", ")+" ]"}if(wt(Z)){var Ms=Pe(Z,gr);return!("cause"in Error.prototype)&&"cause"in Z&&!Fe.call(Z,"cause")?"{ ["+String(Z)+"] "+K.call(V.call("[cause]: "+gr(Z.cause),Ms),", ")+" }":Ms.length===0?"["+String(Z)+"]":"{ ["+String(Z)+"] "+K.call(Ms,", ")+" }"}if(typeof Z=="object"&&Yr){if(Xe&&typeof Z[Xe]=="function"&&At)return At(Z,{depth:Ts-_e});if(Yr!=="symbol"&&typeof Z.inspect=="function")return Z.inspect()}if(dt(Z)){var $o=[];return k&&k.call(Z,function(Fn,Wi){$o.push(gr(Wi,Z,!0)+" => "+gr(Fn,Z))}),hi("Map",x.call(Z),$o,Ln)}if(bn(Z)){var Ho=[];return I&&I.call(Z,function(Fn){Ho.push(gr(Fn,Z))}),hi("Set",N.call(Z),Ho,Ln)}if(In(Z))return Rn("WeakMap");if(xn(Z))return Rn("WeakSet");if(ui(Z))return Rn("WeakRef");if(ht(Z))return Wr(gr(Number(Z)));if(Vr(Z))return Wr(gr(ge.call(Z)));if(Tr(Z))return Wr(te.call(Z));if($t(Z))return Wr(gr(String(Z)));if(!fr(Z)&&!Ne(Z)){var Fi=Pe(Z,gr),zo=at?at(Z)===Object.prototype:Z instanceof Object||Z.constructor===Object,ji=Z instanceof Object?"":"null prototype",Vi=!zo&&Ye&&Object(Z)===Z&&Ye in Z?U.call(dr(Z),8,-1):ji?"Object":"",Yl=zo||typeof Z.constructor!="function"?"":Z.constructor.name?Z.constructor.name+" ":"",Is=Yl+(Vi||ji?"["+K.call(V.call([],Vi||[],ji||[]),": ")+"] ":"");return Fi.length===0?Is+"{}":Ln?Is+"{"+Le(Fi,Ln)+"}":Is+"{ "+K.call(Fi,", ")+" }"}return String(Z)};function Ct($,Z,ze){var _e=(ze.quoteStyle||Z)==="double"?'"':"'";return _e+$+_e}function xt($){return re.call(String($),/"/g,"&quot;")}function Ot($){return dr($)==="[object Array]"&&(!Ye||!(typeof $=="object"&&Ye in $))}function fr($){return dr($)==="[object Date]"&&(!Ye||!(typeof $=="object"&&Ye in $))}function Ne($){return dr($)==="[object RegExp]"&&(!Ye||!(typeof $=="object"&&Ye in $))}function wt($){return dr($)==="[object Error]"&&(!Ye||!(typeof $=="object"&&Ye in $))}function $t($){return dr($)==="[object String]"&&(!Ye||!(typeof $=="object"&&Ye in $))}function ht($){return dr($)==="[object Number]"&&(!Ye||!(typeof $=="object"&&Ye in $))}function Tr($){return dr($)==="[object Boolean]"&&(!Ye||!(typeof $=="object"&&Ye in $))}function hr($){if(Ve)return $&&typeof $=="object"&&$ instanceof Symbol;if(typeof $=="symbol")return!0;if(!$||typeof $!="object"||!$e)return!1;try{return $e.call($),!0}catch{}return!1}function Vr($){if(!$||typeof $!="object"||!ge)return!1;try{return ge.call($),!0}catch{}return!1}var Ri=Object.prototype.hasOwnProperty||function($){return $ in this};function Pr($,Z){return Ri.call($,Z)}function dr($){return se.call($)}function pr($){if($.name)return $.name;var Z=ee.call(R.call($),/^function\s*([\w$]+)/);return Z?Z[1]:null}function Kr($,Z){if($.indexOf)return $.indexOf(Z);for(var ze=0,_e=$.length;ze<_e;ze++)if($[ze]===Z)return ze;return-1}function dt($){if(!x||!$||typeof $!="object")return!1;try{x.call($);try{N.call($)}catch{return!0}return $ instanceof Map}catch{}return!1}function In($){if(!z||!$||typeof $!="object")return!1;try{z.call($,z);try{_.call($,_)}catch{return!0}return $ instanceof WeakMap}catch{}return!1}function ui($){if(!G||!$||typeof $!="object")return!1;try{return G.call($),!0}catch{}return!1}function bn($){if(!N||!$||typeof $!="object")return!1;try{N.call($);try{x.call($)}catch{return!0}return $ instanceof Set}catch{}return!1}function xn($){if(!_||!$||typeof $!="object")return!1;try{_.call($,_);try{z.call($,z)}catch{return!0}return $ instanceof WeakSet}catch{}return!1}function Dn($){return!$||typeof $!="object"?!1:typeof HTMLElement<"u"&&$ instanceof HTMLElement?!0:typeof $.nodeName=="string"&&typeof $.getAttribute=="function"}function fi($,Z){if($.length>Z.maxStringLength){var ze=$.length-Z.maxStringLength,_e="... "+ze+" more character"+(ze>1?"s":"");return fi(U.call($,0,Z.maxStringLength),Z)+_e}var lt=re.call(re.call($,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Nn);return Ct(lt,"single",Z)}function Nn($){var Z=$.charCodeAt(0),ze={8:"b",9:"t",10:"n",12:"f",13:"r"}[Z];return ze?"\\"+ze:"\\x"+(Z<16?"0":"")+ne.call(Z.toString(16))}function Wr($){return"Object("+$+")"}function Rn($){return $+" { ? }"}function hi($,Z,ze,_e){var lt=_e?Le(ze,_e):K.call(ze,", ");return $+" ("+Z+") {"+lt+"}"}function Ze($){for(var Z=0;Z<$.length;Z++)if(Kr($[Z],`
413
+ `)>=0)return!1;return!0}function Ce($,Z){var ze;if($.indent===" ")ze=" ";else if(typeof $.indent=="number"&&$.indent>0)ze=K.call(Array($.indent+1)," ");else return null;return{base:ze,prev:K.call(Array(Z+1),ze)}}function Le($,Z){if($.length===0)return"";var ze=`
414
+ `+Z.prev+Z.base;return ze+K.call($,","+ze)+`
415
+ `+Z.prev}function Pe($,Z){var ze=Ot($),_e=[];if(ze){_e.length=$.length;for(var lt=0;lt<$.length;lt++)_e[lt]=Pr($,lt)?Z($[lt],$):""}var Me=typeof me=="function"?me($):[],Yr;if(Ve){Yr={};for(var wn=0;wn<Me.length;wn++)Yr["$"+Me[wn]]=Me[wn]}for(var Ht in $)Pr($,Ht)&&(ze&&String(Number(Ht))===Ht&&Ht<$.length||Ve&&Yr["$"+Ht]instanceof Symbol||(ce.call(/[^\w$]/,Ht)?_e.push(Z(Ht,$)+": "+Z($[Ht],$)):_e.push(Ht+": "+Z($[Ht],$))));if(typeof me=="function")for(var Jr=0;Jr<Me.length;Jr++)Fe.call($,Me[Jr])&&_e.push("["+Z(Me[Jr])+"]: "+Z($[Me[Jr]],$));return _e}},83949:v=>{"use strict";var C=String.prototype.replace,f=/%20/g,g={RFC1738:"RFC1738",RFC3986:"RFC3986"};v.exports={default:g.RFC3986,formatters:{RFC1738:function(b){return C.call(b,f,"+")},RFC3986:function(b){return String(b)}},RFC1738:g.RFC1738,RFC3986:g.RFC3986}},67905:(v,C,f)=>{"use strict";var g=f(85095),b=f(95990),x=f(83949);v.exports={formats:x,parse:b,stringify:g}},95990:(v,C,f)=>{"use strict";var g=f(37748),b=Object.prototype.hasOwnProperty,x=Array.isArray,k={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:g.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},O=function(X){return X.replace(/&#(\d+);/g,function(G,te){return String.fromCharCode(parseInt(te,10))})},E=function(X,G){return X&&typeof X=="string"&&G.comma&&X.indexOf(",")>-1?X.split(","):X},N="utf8=%26%2310003%3B",I="utf8=%E2%9C%93",B=function(G,te){var se={__proto__:null},R=te.ignoreQueryPrefix?G.replace(/^\?/,""):G,ee=te.parameterLimit===1/0?void 0:te.parameterLimit,U=R.split(te.delimiter,ee),re=-1,ne,ae=te.charset;if(te.charsetSentinel)for(ne=0;ne<U.length;++ne)U[ne].indexOf("utf8=")===0&&(U[ne]===I?ae="utf-8":U[ne]===N&&(ae="iso-8859-1"),re=ne,ne=U.length);for(ne=0;ne<U.length;++ne)if(ne!==re){var ce=U[ne],V=ce.indexOf("]="),K=V===-1?ce.indexOf("="):V+1,le,pe;K===-1?(le=te.decoder(ce,k.decoder,ae,"key"),pe=te.strictNullHandling?null:""):(le=te.decoder(ce.slice(0,K),k.decoder,ae,"key"),pe=g.maybeMap(E(ce.slice(K+1),te),function(ge){return te.decoder(ge,k.decoder,ae,"value")})),pe&&te.interpretNumericEntities&&ae==="iso-8859-1"&&(pe=O(pe)),ce.indexOf("[]=")>-1&&(pe=x(pe)?[pe]:pe),b.call(se,le)?se[le]=g.combine(se[le],pe):se[le]=pe}return se},z=function(X,G,te,se){for(var R=se?G:E(G,te),ee=X.length-1;ee>=0;--ee){var U,re=X[ee];if(re==="[]"&&te.parseArrays)U=[].concat(R);else{U=te.plainObjects?Object.create(null):{};var ne=re.charAt(0)==="["&&re.charAt(re.length-1)==="]"?re.slice(1,-1):re,ae=parseInt(ne,10);!te.parseArrays&&ne===""?U={0:R}:!isNaN(ae)&&re!==ne&&String(ae)===ne&&ae>=0&&te.parseArrays&&ae<=te.arrayLimit?(U=[],U[ae]=R):ne!=="__proto__"&&(U[ne]=R)}R=U}return R},Y=function(G,te,se,R){if(G){var ee=se.allowDots?G.replace(/\.([^.[]+)/g,"[$1]"):G,U=/(\[[^[\]]*])/,re=/(\[[^[\]]*])/g,ne=se.depth>0&&U.exec(ee),ae=ne?ee.slice(0,ne.index):ee,ce=[];if(ae){if(!se.plainObjects&&b.call(Object.prototype,ae)&&!se.allowPrototypes)return;ce.push(ae)}for(var V=0;se.depth>0&&(ne=re.exec(ee))!==null&&V<se.depth;){if(V+=1,!se.plainObjects&&b.call(Object.prototype,ne[1].slice(1,-1))&&!se.allowPrototypes)return;ce.push(ne[1])}return ne&&ce.push("["+ee.slice(ne.index)+"]"),z(ce,te,se,R)}},_=function(G){if(!G)return k;if(G.decoder!==null&&G.decoder!==void 0&&typeof G.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof G.charset<"u"&&G.charset!=="utf-8"&&G.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var te=typeof G.charset>"u"?k.charset:G.charset;return{allowDots:typeof G.allowDots>"u"?k.allowDots:!!G.allowDots,allowPrototypes:typeof G.allowPrototypes=="boolean"?G.allowPrototypes:k.allowPrototypes,allowSparse:typeof G.allowSparse=="boolean"?G.allowSparse:k.allowSparse,arrayLimit:typeof G.arrayLimit=="number"?G.arrayLimit:k.arrayLimit,charset:te,charsetSentinel:typeof G.charsetSentinel=="boolean"?G.charsetSentinel:k.charsetSentinel,comma:typeof G.comma=="boolean"?G.comma:k.comma,decoder:typeof G.decoder=="function"?G.decoder:k.decoder,delimiter:typeof G.delimiter=="string"||g.isRegExp(G.delimiter)?G.delimiter:k.delimiter,depth:typeof G.depth=="number"||G.depth===!1?+G.depth:k.depth,ignoreQueryPrefix:G.ignoreQueryPrefix===!0,interpretNumericEntities:typeof G.interpretNumericEntities=="boolean"?G.interpretNumericEntities:k.interpretNumericEntities,parameterLimit:typeof G.parameterLimit=="number"?G.parameterLimit:k.parameterLimit,parseArrays:G.parseArrays!==!1,plainObjects:typeof G.plainObjects=="boolean"?G.plainObjects:k.plainObjects,strictNullHandling:typeof G.strictNullHandling=="boolean"?G.strictNullHandling:k.strictNullHandling}};v.exports=function(X,G){var te=_(G);if(X===""||X===null||typeof X>"u")return te.plainObjects?Object.create(null):{};for(var se=typeof X=="string"?B(X,te):X,R=te.plainObjects?Object.create(null):{},ee=Object.keys(se),U=0;U<ee.length;++U){var re=ee[U],ne=Y(re,se[re],te,typeof X=="string");R=g.merge(R,ne,te)}return te.allowSparse===!0?R:g.compact(R)}},85095:(v,C,f)=>{"use strict";var g=f(44852),b=f(37748),x=f(83949),k=Object.prototype.hasOwnProperty,O={brackets:function(R){return R+"[]"},comma:"comma",indices:function(R,ee){return R+"["+ee+"]"},repeat:function(R){return R}},E=Array.isArray,N=Array.prototype.push,I=function(se,R){N.apply(se,E(R)?R:[R])},B=Date.prototype.toISOString,z=x.default,Y={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:b.encode,encodeValuesOnly:!1,format:z,formatter:x.formatters[z],indices:!1,serializeDate:function(R){return B.call(R)},skipNulls:!1,strictNullHandling:!1},_=function(R){return typeof R=="string"||typeof R=="number"||typeof R=="boolean"||typeof R=="symbol"||typeof R=="bigint"},X={},G=function se(R,ee,U,re,ne,ae,ce,V,K,le,pe,ge,me,$e,Ve,Ye){for(var Fe=R,at=Ye,Dt=0,At=!1;(at=at.get(X))!==void 0&&!At;){var qt=at.get(R);if(Dt+=1,typeof qt<"u"){if(qt===Dt)throw new RangeError("Cyclic object value");At=!0}typeof at.get(X)>"u"&&(Dt=0)}if(typeof V=="function"?Fe=V(ee,Fe):Fe instanceof Date?Fe=pe(Fe):U==="comma"&&E(Fe)&&(Fe=b.maybeMap(Fe,function(hr){return hr instanceof Date?pe(hr):hr})),Fe===null){if(ne)return ce&&!$e?ce(ee,Y.encoder,Ve,"key",ge):ee;Fe=""}if(_(Fe)||b.isBuffer(Fe)){if(ce){var Xe=$e?ee:ce(ee,Y.encoder,Ve,"key",ge);return[me(Xe)+"="+me(ce(Fe,Y.encoder,Ve,"value",ge))]}return[me(ee)+"="+me(String(Fe))]}var Ct=[];if(typeof Fe>"u")return Ct;var xt;if(U==="comma"&&E(Fe))$e&&ce&&(Fe=b.maybeMap(Fe,ce)),xt=[{value:Fe.length>0?Fe.join(",")||null:void 0}];else if(E(V))xt=V;else{var Ot=Object.keys(Fe);xt=K?Ot.sort(K):Ot}for(var fr=re&&E(Fe)&&Fe.length===1?ee+"[]":ee,Ne=0;Ne<xt.length;++Ne){var wt=xt[Ne],$t=typeof wt=="object"&&typeof wt.value<"u"?wt.value:Fe[wt];if(!(ae&&$t===null)){var ht=E(Fe)?typeof U=="function"?U(fr,wt):fr:fr+(le?"."+wt:"["+wt+"]");Ye.set(R,Dt);var Tr=g();Tr.set(X,Ye),I(Ct,se($t,ht,U,re,ne,ae,U==="comma"&&$e&&E(Fe)?null:ce,V,K,le,pe,ge,me,$e,Ve,Tr))}}return Ct},te=function(R){if(!R)return Y;if(R.encoder!==null&&typeof R.encoder<"u"&&typeof R.encoder!="function")throw new TypeError("Encoder has to be a function.");var ee=R.charset||Y.charset;if(typeof R.charset<"u"&&R.charset!=="utf-8"&&R.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var U=x.default;if(typeof R.format<"u"){if(!k.call(x.formatters,R.format))throw new TypeError("Unknown format option provided.");U=R.format}var re=x.formatters[U],ne=Y.filter;return(typeof R.filter=="function"||E(R.filter))&&(ne=R.filter),{addQueryPrefix:typeof R.addQueryPrefix=="boolean"?R.addQueryPrefix:Y.addQueryPrefix,allowDots:typeof R.allowDots>"u"?Y.allowDots:!!R.allowDots,charset:ee,charsetSentinel:typeof R.charsetSentinel=="boolean"?R.charsetSentinel:Y.charsetSentinel,delimiter:typeof R.delimiter>"u"?Y.delimiter:R.delimiter,encode:typeof R.encode=="boolean"?R.encode:Y.encode,encoder:typeof R.encoder=="function"?R.encoder:Y.encoder,encodeValuesOnly:typeof R.encodeValuesOnly=="boolean"?R.encodeValuesOnly:Y.encodeValuesOnly,filter:ne,format:U,formatter:re,serializeDate:typeof R.serializeDate=="function"?R.serializeDate:Y.serializeDate,skipNulls:typeof R.skipNulls=="boolean"?R.skipNulls:Y.skipNulls,sort:typeof R.sort=="function"?R.sort:null,strictNullHandling:typeof R.strictNullHandling=="boolean"?R.strictNullHandling:Y.strictNullHandling}};v.exports=function(se,R){var ee=se,U=te(R),re,ne;typeof U.filter=="function"?(ne=U.filter,ee=ne("",ee)):E(U.filter)&&(ne=U.filter,re=ne);var ae=[];if(typeof ee!="object"||ee===null)return"";var ce;R&&R.arrayFormat in O?ce=R.arrayFormat:R&&"indices"in R?ce=R.indices?"indices":"repeat":ce="indices";var V=O[ce];if(R&&"commaRoundTrip"in R&&typeof R.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var K=V==="comma"&&R&&R.commaRoundTrip;re||(re=Object.keys(ee)),U.sort&&re.sort(U.sort);for(var le=g(),pe=0;pe<re.length;++pe){var ge=re[pe];U.skipNulls&&ee[ge]===null||I(ae,G(ee[ge],ge,V,K,U.strictNullHandling,U.skipNulls,U.encode?U.encoder:null,U.filter,U.sort,U.allowDots,U.serializeDate,U.format,U.formatter,U.encodeValuesOnly,U.charset,le))}var me=ae.join(U.delimiter),$e=U.addQueryPrefix===!0?"?":"";return U.charsetSentinel&&(U.charset==="iso-8859-1"?$e+="utf8=%26%2310003%3B&":$e+="utf8=%E2%9C%93&"),me.length>0?$e+me:""}},37748:(v,C,f)=>{"use strict";var g=f(83949),b=Object.prototype.hasOwnProperty,x=Array.isArray,k=function(){for(var se=[],R=0;R<256;++R)se.push("%"+((R<16?"0":"")+R.toString(16)).toUpperCase());return se}(),O=function(R){for(;R.length>1;){var ee=R.pop(),U=ee.obj[ee.prop];if(x(U)){for(var re=[],ne=0;ne<U.length;++ne)typeof U[ne]<"u"&&re.push(U[ne]);ee.obj[ee.prop]=re}}},E=function(R,ee){for(var U=ee&&ee.plainObjects?Object.create(null):{},re=0;re<R.length;++re)typeof R[re]<"u"&&(U[re]=R[re]);return U},N=function se(R,ee,U){if(!ee)return R;if(typeof ee!="object"){if(x(R))R.push(ee);else if(R&&typeof R=="object")(U&&(U.plainObjects||U.allowPrototypes)||!b.call(Object.prototype,ee))&&(R[ee]=!0);else return[R,ee];return R}if(!R||typeof R!="object")return[R].concat(ee);var re=R;return x(R)&&!x(ee)&&(re=E(R,U)),x(R)&&x(ee)?(ee.forEach(function(ne,ae){if(b.call(R,ae)){var ce=R[ae];ce&&typeof ce=="object"&&ne&&typeof ne=="object"?R[ae]=se(ce,ne,U):R.push(ne)}else R[ae]=ne}),R):Object.keys(ee).reduce(function(ne,ae){var ce=ee[ae];return b.call(ne,ae)?ne[ae]=se(ne[ae],ce,U):ne[ae]=ce,ne},re)},I=function(R,ee){return Object.keys(ee).reduce(function(U,re){return U[re]=ee[re],U},R)},B=function(se,R,ee){var U=se.replace(/\+/g," ");if(ee==="iso-8859-1")return U.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(U)}catch{return U}},z=function(R,ee,U,re,ne){if(R.length===0)return R;var ae=R;if(typeof R=="symbol"?ae=Symbol.prototype.toString.call(R):typeof R!="string"&&(ae=String(R)),U==="iso-8859-1")return escape(ae).replace(/%u[0-9a-f]{4}/gi,function(le){return"%26%23"+parseInt(le.slice(2),16)+"%3B"});for(var ce="",V=0;V<ae.length;++V){var K=ae.charCodeAt(V);if(K===45||K===46||K===95||K===126||K>=48&&K<=57||K>=65&&K<=90||K>=97&&K<=122||ne===g.RFC1738&&(K===40||K===41)){ce+=ae.charAt(V);continue}if(K<128){ce=ce+k[K];continue}if(K<2048){ce=ce+(k[192|K>>6]+k[128|K&63]);continue}if(K<55296||K>=57344){ce=ce+(k[224|K>>12]+k[128|K>>6&63]+k[128|K&63]);continue}V+=1,K=65536+((K&1023)<<10|ae.charCodeAt(V)&1023),ce+=k[240|K>>18]+k[128|K>>12&63]+k[128|K>>6&63]+k[128|K&63]}return ce},Y=function(R){for(var ee=[{obj:{o:R},prop:"o"}],U=[],re=0;re<ee.length;++re)for(var ne=ee[re],ae=ne.obj[ne.prop],ce=Object.keys(ae),V=0;V<ce.length;++V){var K=ce[V],le=ae[K];typeof le=="object"&&le!==null&&U.indexOf(le)===-1&&(ee.push({obj:ae,prop:K}),U.push(le))}return O(ee),R},_=function(R){return Object.prototype.toString.call(R)==="[object RegExp]"},X=function(R){return!R||typeof R!="object"?!1:!!(R.constructor&&R.constructor.isBuffer&&R.constructor.isBuffer(R))},G=function(R,ee){return[].concat(R,ee)},te=function(R,ee){if(x(R)){for(var U=[],re=0;re<R.length;re+=1)U.push(ee(R[re]));return U}return ee(R)};v.exports={arrayToObject:E,assign:I,combine:G,compact:Y,decode:B,encode:z,isBuffer:X,isRegExp:_,maybeMap:te,merge:N}},95472:(v,C,f)=>{"use strict";var g;/** @license React v17.0.2
416
+ * react-jsx-runtime.production.min.js
417
+ *
418
+ * Copyright (c) Facebook, Inc. and its affiliates.
419
+ *
420
+ * This source code is licensed under the MIT license found in the
421
+ * LICENSE file in the root directory of this source tree.
422
+ */f(52458);var b=f(29901),x=60103;if(g=60107,typeof Symbol=="function"&&Symbol.for){var k=Symbol.for;x=k("react.element"),g=k("react.fragment")}var O=b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,E=Object.prototype.hasOwnProperty,N={key:!0,ref:!0,__self:!0,__source:!0};function I(B,z,Y){var _,X={},G=null,te=null;Y!==void 0&&(G=""+Y),z.key!==void 0&&(G=""+z.key),z.ref!==void 0&&(te=z.ref);for(_ in z)E.call(z,_)&&!N.hasOwnProperty(_)&&(X[_]=z[_]);if(B&&B.defaultProps)for(_ in z=B.defaultProps,z)X[_]===void 0&&(X[_]=z[_]);return{$$typeof:x,type:B,key:G,ref:te,props:X,_owner:O.current}}C.jsx=I,g=I},61250:(v,C,f)=>{"use strict";v.exports=f(95472)},44852:(v,C,f)=>{"use strict";var g=f(71013),b=f(2864),x=f(14927),k=g("%TypeError%"),O=g("%WeakMap%",!0),E=g("%Map%",!0),N=b("WeakMap.prototype.get",!0),I=b("WeakMap.prototype.set",!0),B=b("WeakMap.prototype.has",!0),z=b("Map.prototype.get",!0),Y=b("Map.prototype.set",!0),_=b("Map.prototype.has",!0),X=function(R,ee){for(var U=R,re;(re=U.next)!==null;U=re)if(re.key===ee)return U.next=re.next,re.next=R.next,R.next=re,re},G=function(R,ee){var U=X(R,ee);return U&&U.value},te=function(R,ee,U){var re=X(R,ee);re?re.value=U:R.next={key:ee,next:R.next,value:U}},se=function(R,ee){return!!X(R,ee)};v.exports=function(){var ee,U,re,ne={assert:function(ae){if(!ne.has(ae))throw new k("Side channel does not contain "+x(ae))},get:function(ae){if(O&&ae&&(typeof ae=="object"||typeof ae=="function")){if(ee)return N(ee,ae)}else if(E){if(U)return z(U,ae)}else if(re)return G(re,ae)},has:function(ae){if(O&&ae&&(typeof ae=="object"||typeof ae=="function")){if(ee)return B(ee,ae)}else if(E){if(U)return _(U,ae)}else if(re)return se(re,ae);return!1},set:function(ae,ce){O&&ae&&(typeof ae=="object"||typeof ae=="function")?(ee||(ee=new O),I(ee,ae,ce)):E?(U||(U=new E),Y(U,ae,ce)):(re||(re={key:{},next:null}),te(re,ae,ce))}};return ne}},65710:()=>{},93652:(v,C,f)=>{v.exports=f(24018)},10017:(v,C,f)=>{v.exports=f(27411)},34961:(v,C,f)=>{v.exports=f(79155)},86751:(v,C,f)=>{v.exports=f(13375)},12953:(v,C,f)=>{v.exports=f(95442)},11099:(v,C,f)=>{v.exports=f(55334)},86351:(v,C,f)=>{v.exports=f(48261)},70762:(v,C,f)=>{v.exports=f(92864)},10954:(v,C,f)=>{v.exports=f(27923)},55839:(v,C,f)=>{v.exports=f(89225)},23422:(v,C,f)=>{v.exports=f(95281)},47319:(v,C,f)=>{v.exports=f(55468)}}]);