iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 61.6 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["8771"],{17743:function(t,e,i){var n=i(13053);t.exports=function(t,e,i){for(var o=0,s=arguments.length>2?i:n(e),r=new t(s);s>o;)r[o]=e[o++];return r}},57145:function(t,e,i){var n=i(31269),o=i(72878),s=i(25091),r=i(12360),a=i(70273),l=i(13053),c=i(72309),h=i(17743),u=Array,f=o([].push);t.exports=function(t,e,i,o){for(var p,d,m,g=r(t),v=s(g),b=n(e,i),y=c(null),x=l(v),w=0;x>w;w++)m=v[w],(d=a(b(m,w,g)))in y?f(y[d],m):y[d]=[m];if(o&&(p=o(g))!==u)for(d in y)y[d]=h(p,y[d]);return y}},37588:function(t,e,i){var n=i(68533).PROPER,o=i(29660),s=i(91430);t.exports=function(t){return o((function(){return!!s[t]()||"
"!=="
"[t]()||n&&s[t].name!==t}))}},82328:function(t,e,i){var n=i(40810),o=i(1569),s=i(11003),r=i(6567),a="ArrayBuffer",l=s[a];n({global:!0,constructor:!0,forced:o[a]!==l},{ArrayBuffer:l}),r(a)},63434:function(t,e,i){var n=i(40810),o=i(12360),s=i(13053),r=i(88045),a=i(35709);n({target:"Array",proto:!0},{at:function(t){var e=o(this),i=s(e),n=r(t),a=n>=0?n:i+n;return a<0||a>=i?void 0:e[a]}}),a("at")},68107:function(t,e,i){var n=i(40810),o=i(73994),s=i(63983),r=i(71998),a=i(4576);n({target:"Iterator",proto:!0,real:!0},{every:function(t){r(this),s(t);var e=a(this),i=0;return!o(e,(function(e,n){if(!t(e,i++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},32517:function(t,e,i){var n=i(1569),o=i(85779),s=i(27803),r=i(31126),a=i(29660),l=n.RegExp,c=l.prototype;o&&a((function(){var t=!0;try{l(".","d")}catch(a){t=!1}var e={},i="",n=t?"dgimsy":"gimsy",o=function(t,n){Object.defineProperty(e,t,{get:function(){return i+=n,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var r in t&&(s.hasIndices="d"),s)o(r,s[r]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(e)!==n||i!==n}))&&s(c,"flags",{configurable:!0,get:r})},96829:function(t,e,i){var n=i(40810),o=i(72878),s=i(95011),r=i(88045),a=i(72616),l=i(29660),c=o("".charAt);n({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(t){var e=a(s(this)),i=e.length,n=r(t),o=n>=0?n:i+n;return o<0||o>=i?void 0:c(e,o)}})},64706:function(t,e,i){var n=i(40810),o=i(97934),s=i(87915),r=i(33723),a=i(78996),l=i(95011),c=i(82065),h=i(72616),u=i(71998),f=i(56737),p=i(36313),d=i(12523),m=i(40262),g=i(22861),v=i(99473),b=i(29660),y=i(27847),x=i(16593),w=i(41848),k=i(3182),C=i(84238),S=i(92288),M=y("matchAll"),L="RegExp String",T=L+" Iterator",A=C.set,D=C.getterFor(T),I=RegExp.prototype,O=TypeError,E=s("".indexOf),R=s("".matchAll),P=!!R&&!b((function(){R("a",/./)})),W=r((function(t,e,i,n){A(this,{type:T,regexp:t,string:e,global:i,unicode:n,done:!1})}),L,(function(){var t=D(this);if(t.done)return a(void 0,!0);var e=t.regexp,i=t.string,n=k(e,i);return null===n?(t.done=!0,a(void 0,!0)):t.global?(""===h(n[0])&&(e.lastIndex=w(i,c(e.lastIndex),t.unicode)),a(n,!1)):(t.done=!0,a(n,!1))})),q=function(t){var e,i,n,o=u(this),s=h(t),r=x(o,RegExp),a=h(m(o));return e=new r(r===RegExp?o.source:o,a),i=!!~E(a,"g"),n=!!~E(a,"u"),e.lastIndex=c(o.lastIndex),new W(e,s,i,n)};n({target:"String",proto:!0,forced:P},{matchAll:function(t){var e,i,n,s,r=l(this);if(f(t)){if(P)return R(r,t)}else{if(d(t)&&(e=h(l(m(t))),!~E(e,"g")))throw new O("`.matchAll` does not allow non-global regexes");if(P)return R(r,t);if(void 0===(n=g(t,M))&&S&&"RegExp"===p(t)&&(n=q),n)return o(n,t,r)}return i=h(r),s=new RegExp(t,"g"),S?o(q,s,i):s[M](i)}}),S||M in I||v(I,M,q)},81804:function(t,e,i){var n=i(40810),o=i(36888).trim;n({target:"String",proto:!0,forced:i(37588)("trim")},{trim:function(){return o(this)}})},22139:function(t,e,i){var n=i(40810),o=i(57145),s=i(35709);n({target:"Array",proto:!0},{group:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),s("group")},14688:function(t,e,i){i.a(t,(async function(t,n){try{i.d(e,{ys:()=>lt});i(71695),i(92745),i(52805),i(61893),i(9359),i(68107),i(56475),i(1331),i(70104),i(48136),i(52924),i(19423),i(40251),i(69235),i(12385),i(19134),i(32517),i(5740),i(11740),i(44495),i(97003),i(47706),i(32114),i(46692),i(47021);var o=i(89276),s=i(10857),r=i(51801),a=t([r,s]);[r,s]=a.then?(await a)():a;class c{constructor(t,e,i,n){this.state=t,this.pos=e,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=(0,r.qz)(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),o=n.search(m(t,!1));return o<0?null:{from:i+o,to:this.pos,text:n.slice(o)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,i){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function h(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function u(t){let e=Object.create(null),i=Object.create(null);for(let{label:o}of t){e[o[0]]=!0;for(let t=1;t<o.length;t++)i[o[t]]=!0}let n=h(e)+h(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function f(t){let e=t.map((t=>"string"==typeof t?{label:t}:t)),[i,n]=e.every((t=>/^\w+$/.test(t.label)))?[/\w*$/,/\w+$/]:u(e);return t=>{let o=t.matchBefore(n);return o||t.explicit?{from:o?o.from:t.pos,options:e,validFor:i}:null}}class p{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function d(t){return t.selection.main.from}function m(t,e){var i;let{source:n}=t,o=e&&"^"!=n[0],s="$"!=n[n.length-1];return o||s?new RegExp(`${o?"^":""}(?:${n})${s?"$":""}`,null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t}const g=o.q6.define();function v(t,e,i,n){let{main:s}=t.selection,r=i-s.from,a=n-s.from;return Object.assign(Object.assign({},t.changeByRange((l=>{if(l!=s&&i!=n&&t.sliceDoc(l.from+r,l.from+a)!=t.sliceDoc(i,n))return{range:l};let c=t.toText(e);return{changes:{from:l.from+r,to:n==s.from?l.to:l.from+a,insert:c},range:o.jT.cursor(l.from+r+c.length)}}))),{scrollIntoView:!0,userEvent:"input.complete"})}const b=new WeakMap;function y(t){if(!Array.isArray(t))return t;let e=b.get(t);return e||b.set(t,e=f(t)),e}const x=o.Py.define(),w=o.Py.define();class k{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e<t.length;){let i=(0,o.gm)(t,e),n=(0,o.nZ)(i);this.chars.push(i);let s=t.slice(e,e+n),r=s.toUpperCase();this.folded.push((0,o.gm)(r==s?s.toLowerCase():r,0)),e+=n}this.astral=t.length!=this.chars.length}ret(t,e){return this.score=t,this.matched=e,this}match(t){if(0==this.pattern.length)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:e,folded:i,any:n,precise:s,byWord:r}=this;if(1==e.length){let n=(0,o.gm)(t,0),s=(0,o.nZ)(n),r=s==t.length?0:-100;if(n==e[0]);else{if(n!=i[0])return null;r+=-200}return this.ret(r,[0,s])}let a=t.indexOf(this.pattern);if(0==a)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=e.length,c=0;if(a<0){for(let s=0,r=Math.min(t.length,200);s<r&&c<l;){let r=(0,o.gm)(t,s);r!=e[c]&&r!=i[c]||(n[c++]=s),s+=(0,o.nZ)(r)}if(c<l)return null}let h=0,u=0,f=!1,p=0,d=-1,m=-1,g=/[a-z]/.test(t),v=!0;for(let b=0,y=Math.min(t.length,200),x=0;b<y&&u<l;){let n=(0,o.gm)(t,b);a<0&&(h<l&&n==e[h]&&(s[h++]=b),p<l&&(n==e[p]||n==i[p]?(0==p&&(d=b),m=b+1,p++):p=0));let c,y=n<255?n>=48&&n<=57||n>=97&&n<=122?2:n>=65&&n<=90?1:0:(c=(0,o.bg)(n))!=c.toLowerCase()?1:c!=c.toUpperCase()?2:0;(!b||1==y&&g||0==x&&0!=y)&&(e[u]==n||i[u]==n&&(f=!0)?r[u++]=b:r.length&&(v=!1)),x=y,b+=(0,o.nZ)(n)}return u==l&&0==r[0]&&v?this.result((f?-200:0)-100,r,t):p==l&&0==d?this.ret(-200-t.length+(m==t.length?0:-100),[0,m]):a>-1?this.ret(-700-t.length,[a,a+this.pattern.length]):p==l?this.ret(-900-t.length,[d,m]):u==l?this.result((f?-200:0)-100-700+(v?0:-1100),r,t):2==e.length?null:this.result((n[0]?-700:0)-200-1100,n,t)}result(t,e,i){let n=[],s=0;for(let r of e){let t=r+(this.astral?(0,o.nZ)((0,o.gm)(i,r)):1);s&&n[s-1]==r?n[s-1]=t:(n[s++]=r,n[s++]=t)}return this.ret(t-i.length,n)}}class C{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let e=t.slice(0,this.pattern.length),i=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return null==i?null:(this.matched=[0,e.length],this.score=i+(t.length==this.pattern.length?0:-100),this)}}const S=o.r$.define({combine(t){return(0,o.BO)(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:L,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>M(t(i),e(i)),optionClass:(t,e)=>i=>M(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})}});function M(t,e){return t?e?t+" "+e:t:e}function L(t,e,i,n,o,r){let a,l,c=t.textDirection==s.Nm.RTL,h=c,u=!1,f="top",p=e.left-o.left,d=o.right-e.right,m=n.right-n.left,g=n.bottom-n.top;if(h&&p<Math.min(m,d)?h=!1:!h&&d<Math.min(m,p)&&(h=!0),m<=(h?p:d))a=Math.max(o.top,Math.min(i.top,o.bottom-g))-e.top,l=Math.min(400,h?p:d);else{u=!0,l=Math.min(400,(c?e.right:o.right-e.left)-30);let t=o.bottom-e.bottom;t>=g||t>e.top?a=i.bottom-e.top:(f="bottom",a=e.bottom-i.top)}return{style:`${f}: ${a/((e.bottom-e.top)/r.offsetHeight)}px; max-width: ${l/((e.right-e.left)/r.offsetWidth)}px`,class:"cm-completionInfo-"+(u?c?"left-narrow":"right-narrow":h?"left":"right")}}function T(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map((t=>"cm-completionIcon-"+t))),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,i,n){let o=document.createElement("span");o.className="cm-completionLabel";let s=t.displayLabel||t.label,r=0;for(let a=0;a<n.length;){let t=n[a++],e=n[a++];t>r&&o.appendChild(document.createTextNode(s.slice(r,t)));let i=o.appendChild(document.createElement("span"));i.appendChild(document.createTextNode(s.slice(t,e))),i.className="cm-completionMatchedText",r=e}return r<s.length&&o.appendChild(document.createTextNode(s.slice(r))),o},position:50},{render(t){if(!t.detail)return null;let e=document.createElement("span");return e.className="cm-completionDetail",e.textContent=t.detail,e},position:80}),e.sort(((t,e)=>t.position-e.position)).map((t=>t.render))}function A(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/i);return{from:t*i,to:(t+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class D{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:o,selected:s}=n.open,r=t.state.facet(S);this.optionContent=T(r),this.optionClass=r.optionClass,this.tooltipClass=r.tooltipClass,this.range=A(o.length,s,r.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",(i=>{let{options:n}=t.state.field(e).open;for(let e,o=i.target;o&&o!=this.dom;o=o.parentNode)if("LI"==o.nodeName&&(e=/-(\d+)$/.exec(o.id))&&+e[1]<n.length)return this.applyCompletion(t,n[+e[1]]),void i.preventDefault()})),this.dom.addEventListener("focusout",(e=>{let i=t.state.field(this.stateField,!1);i&&i.tooltip&&t.state.facet(S).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:w.of(null)})})),this.showOptions(o,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:o,selected:s,disabled:r}=i.open;n.open&&n.open.options==o||(this.range=A(o.length,s,t.state.facet(S).maxRenderedOptions),this.showOptions(o,i.id)),this.updateSel(),r!=(null===(e=n.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!r)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=A(e.options.length,e.selected,this.view.state.facet(S).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:n}=i;if(!n)return;let o="string"==typeof n?document.createTextNode(n):n(i);if(!o)return;"then"in o?o.then((e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,i)})).catch((t=>(0,s.OO)(this.view.state,t,"completion info"))):this.addInfoPane(o,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:n}=t;i.appendChild(e),this.infoDestroy=n||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)"LI"==i.nodeName&&i.id?n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected"):n--;return e&&O(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),o=this.space;if(!o){let t=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:t.clientWidth,bottom:t.clientHeight}}return n.top>Math.min(o.bottom,e.bottom)-10||n.bottom<Math.max(o.top,e.top)+10?null:this.view.state.facet(S).positionInfo(this.view,e,n,i,o,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,e,i){const n=document.createElement("ul");n.id=e,n.setAttribute("role","listbox"),n.setAttribute("aria-expanded","true"),n.setAttribute("aria-label",this.view.state.phrase("Completions")),n.addEventListener("mousedown",(t=>{t.target==n&&t.preventDefault()}));let o=null;for(let s=i.from;s<i.to;s++){let{completion:r,match:a}=t[s],{section:l}=r;if(l){let t="string"==typeof l?l:l.name;if(t!=o&&(s>i.from||0==i.from))if(o=t,"string"!=typeof l&&l.header)n.appendChild(l.header(l));else{n.appendChild(document.createElement("completion-section")).textContent=t}}const c=n.appendChild(document.createElement("li"));c.id=e+"-"+s,c.setAttribute("role","option");let h=this.optionClass(r);h&&(c.className=h);for(let t of this.optionContent){let e=t(r,this.view.state,this.view,a);e&&c.appendChild(e)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.to<t.length&&n.classList.add("cm-completionListIncompleteBottom"),n}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function I(t,e){return i=>new D(i,t,e)}function O(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),o=i.height/t.offsetHeight;n.top<i.top?t.scrollTop-=(i.top-n.top)/o:n.bottom>i.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/o)}function E(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function R(t,e){let i=[],n=null,o=t=>{i.push(t);let{section:e}=t.completion;if(e){n||(n=[]);let t="string"==typeof e?e:e.name;n.some((e=>e.name==t))||n.push("string"==typeof e?{name:t}:e)}},s=e.facet(S);for(let c of t)if(c.hasResult()){let t=c.result.getMatch;if(!1===c.result.filter)for(let e of c.result.options)o(new p(e,c.source,t?t(e):[],1e9-i.length));else{let i,n=e.sliceDoc(c.from,c.to),r=s.filterStrict?new C(n):new k(n);for(let e of c.result.options)if(i=r.match(e.label)){let n=e.displayLabel?t?t(e,i.matched):[]:i.matched;o(new p(e,c.source,n,i.score+(e.boost||0)))}}}if(n){let t=Object.create(null),e=0,o=(t,e)=>{var i,n;return(null!==(i=t.rank)&&void 0!==i?i:1e9)-(null!==(n=e.rank)&&void 0!==n?n:1e9)||(t.name<e.name?-1:1)};for(let i of n.sort(o))e-=1e5,t[i.name]=e;for(let n of i){let{section:e}=n.completion;e&&(n.score+=t["string"==typeof e?e:e.name])}}let r=[],a=null,l=s.compareCompletions;for(let c of i.sort(((t,e)=>e.score-t.score||l(t.completion,e.completion)))){let t=c.completion;!a||a.label!=t.label||a.detail!=t.detail||null!=a.type&&null!=t.type&&a.type!=t.type||a.apply!=t.apply||a.boost!=t.boost?r.push(c):E(c.completion)>E(a)&&(r[r.length-1]=c),a=c.completion}return r}class P{constructor(t,e,i,n,o,s){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=o,this.disabled=s}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new P(this.options,j(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,o,s){if(n&&!s&&t.some((t=>t.isPending)))return n.setDisabled();let r=R(t,e);if(!r.length)return n&&t.some((t=>t.isPending))?n.setDisabled():null;let a=e.facet(S).selectOnOpen?0:-1;if(n&&n.selected!=a&&-1!=n.selected){let t=n.options[n.selected].completion;for(let e=0;e<r.length;e++)if(r[e].completion==t){a=e;break}}return new P(r,j(i,a),{pos:t.reduce(((t,e)=>e.hasResult()?Math.min(t,e.from):t),1e8),create:V,above:o.aboveCursor},n?n.timestamp:Date.now(),a,!1)}map(t){return new P(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new P(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class W{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new W(B,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,i=e.facet(S),n=(i.override||e.languageDataAt("autocomplete",d(e)).map(y)).map((e=>(this.active.find((t=>t.source==e))||new z(e,this.active.some((t=>0!=t.state))?1:0)).update(t,i)));n.length==this.active.length&&n.every(((t,e)=>t==this.active[e]))&&(n=this.active);let o=this.open,s=t.effects.some((t=>t.is(_)));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||n.some((e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to)))||!q(n,this.active)||s?o=P.build(n,e,this.id,o,i,s):o&&o.disabled&&!n.some((t=>t.isPending))&&(o=null),!o&&n.every((t=>!t.isPending))&&n.some((t=>t.hasResult()))&&(n=n.map((t=>t.hasResult()?new z(t.source,0):t)));for(let r of t.effects)r.is(Q)&&(o=o&&o.setSelected(r.value,this.id));return n==this.active&&o==this.open?this:new W(n,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?F:$}}function q(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i<t.length&&!t[i].hasResult();)i++;for(;n<e.length&&!e[n].hasResult();)n++;let o=i==t.length,s=n==e.length;if(o||s)return o==s;if(t[i++].result!=e[n++].result)return!1}}const F={"aria-autocomplete":"list"},$={};function j(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const B=[];function N(t,e){if(t.isUserEvent("input.complete")){let i=t.annotation(g);if(i&&e.activateOnCompletion(i))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class z{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return 1==this.state}update(t,e){let i=N(t,e),n=this;(8&i||16&i&&this.touches(t))&&(n=new z(n.source,0)),4&i&&0==n.state&&(n=new z(this.source,1)),n=n.updateFor(t,i);for(let o of t.effects)if(o.is(x))n=new z(n.source,1,o.value);else if(o.is(w))n=new z(n.source,0);else if(o.is(_))for(let t of o.value)t.source==n.source&&(n=t);return n}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(d(t.state))}}class Z extends z{constructor(t,e,i,n,o,s){super(t,3,e),this.limit=i,this.result=n,this.from=o,this.to=s}hasResult(){return!0}updateFor(t,e){var i;if(!(3&e))return this.map(t.changes);let n=this.result;n.map&&!t.changes.empty&&(n=n.map(n,t.changes));let o=t.changes.mapPos(this.from),s=t.changes.mapPos(this.to,1),r=d(t.state);if(r>s||!n||2&e&&(d(t.startState)==this.from||r<this.limit))return new z(this.source,4&e?1:0);let a=t.changes.mapPos(this.limit);return U(n.validFor,t.state,o,s)?new Z(this.source,this.explicit,a,n,o,s):n.update&&(n=n.update(n,o,s,new c(t.state,r,!1)))?new Z(this.source,this.explicit,a,n,n.from,null!==(i=n.to)&&void 0!==i?i:d(t.state)):new z(this.source,1,this.explicit)}map(t){if(t.empty)return this;return(this.result.map?this.result.map(this.result,t):this.result)?new Z(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new z(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function U(t,e,i,n){if(!t)return!1;let o=e.sliceDoc(i,n);return"function"==typeof t?t(o,i,n,e):m(t,!0).test(o)}const _=o.Py.define({map(t,e){return t.map((t=>t.map(e)))}}),Q=o.Py.define(),H=o.QQ.define({create(){return W.start()},update(t,e){return t.update(e)},provide:t=>[s.hJ.from(t,(t=>t.tooltip)),s.tk.contentAttributes.from(t,(t=>t.attrs))]});function K(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(H).active.find((t=>t.source==e.source));return n instanceof Z&&("string"==typeof i?t.dispatch(Object.assign(Object.assign({},v(t.state,i,n.from,n.to)),{annotations:g.of(e.completion)})):i(t,e.completion,n.from,n.to),!0)}const V=I(H,K);function G(t,e="option"){return i=>{let n=i.state.field(H,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<i.state.facet(S).interactionDelay)return!1;let o,r=1;"page"==e&&(o=(0,s.gB)(i,n.open.tooltip))&&(r=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=n.open.options,l=n.open.selected>-1?n.open.selected+r*(t?1:-1):t?0:a-1;return l<0?l="page"==e?0:a-1:l>=a&&(l="page"==e?a-1:0),i.dispatch({effects:Q.of(l)}),!0}}const J=t=>{let e=t.state.field(H,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(S).interactionDelay)&&K(t,e.open.options[e.open.selected])},X=t=>!!t.state.field(H,!1)&&(t.dispatch({effects:x.of(!0)}),!0),Y=t=>{let e=t.state.field(H,!1);return!(!e||!e.active.some((t=>0!=t.state)))&&(t.dispatch({effects:w.of(null)}),!0)};class tt{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const et=50,it=1e3,nt=s.lg.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(H).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(H),i=t.state.facet(S);if(!t.selectionSet&&!t.docChanged&&t.startState.field(H)==e)return;let n=t.transactions.some((t=>{let e=N(t,i);return 8&e||(t.selection||t.docChanged)&&!(3&e)}));for(let a=0;a<this.running.length;a++){let e=this.running[a];if(n||e.context.abortOnDocChange&&t.docChanged||e.updates.length+t.transactions.length>et&&Date.now()-e.time>it){for(let t of e.context.abortListeners)try{t()}catch(r){(0,s.OO)(this.view.state,r)}e.context.abortListeners=null,this.running.splice(a--,1)}else e.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some((t=>t.effects.some((t=>t.is(x)))))&&(this.pendingStart=!0);let o=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some((t=>t.isPending&&!this.running.some((e=>e.active.source==t.source))))?setTimeout((()=>this.startUpdate()),o):-1,0!=this.composing)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:2==this.composing&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(H);for(let i of e.active)i.isPending&&!this.running.some((t=>t.active.source==i.source))&&this.startQuery(i);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(S).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=d(e),n=new c(e,i,t.explicit,this.view),o=new tt(t,n);this.running.push(o),Promise.resolve(t.source(n)).then((t=>{o.context.aborted||(o.done=t||null,this.scheduleAccept())}),(t=>{this.view.dispatch({effects:w.of(null)}),(0,s.OO)(this.view.state,t)}))}scheduleAccept(){this.running.every((t=>void 0!==t.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(S).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(S),n=this.view.state.field(H);for(let o=0;o<this.running.length;o++){let s=this.running[o];if(void 0===s.done)continue;if(this.running.splice(o--,1),s.done){let n=d(s.updates.length?s.updates[0].startState:this.view.state),o=Math.min(n,s.done.from+(s.active.explicit?0:1)),r=new Z(s.active.source,s.active.explicit,o,s.done,s.done.from,null!==(t=s.done.to)&&void 0!==t?t:n);for(let t of s.updates)r=r.update(t,i);if(r.hasResult()){e.push(r);continue}}let r=n.active.find((t=>t.source==s.active.source));if(r&&r.isPending)if(null==s.done){let t=new z(s.active.source,0);for(let e of s.updates)t=t.update(e,i);t.isPending||e.push(t)}else this.startQuery(r)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:_.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(H,!1);if(e&&e.tooltip&&this.view.state.facet(S).closeOnBlur){let i=e.open&&(0,s.gB)(this.view,e.open.tooltip);i&&i.dom.contains(t.relatedTarget)||setTimeout((()=>this.view.dispatch({effects:w.of(null)})),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:x.of(!1)})),20),this.composing=0}}}),ot="object"==typeof navigator&&/Win/.test(navigator.platform),st=o.Wl.highest(s.tk.domEventHandlers({keydown(t,e){let i=e.state.field(H,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&(!ot||!t.altKey)||t.metaKey)return!1;let n=i.open.options[i.open.selected],o=i.active.find((t=>t.source==n.source)),s=n.completion.commitCharacters||o.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&K(e,n),!1}})),rt=s.tk.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:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".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:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});const at=new class extends o.uU{};at.startSide=1,at.endSide=-1;"object"==typeof navigator&&navigator.userAgent;function lt(t={}){return[st,H,S.of(t),nt,ht,rt]}const ct=[{key:"Ctrl-Space",run:X},{mac:"Alt-`",run:X},{key:"Escape",run:Y},{key:"ArrowDown",run:G(!0)},{key:"ArrowUp",run:G(!1)},{key:"PageDown",run:G(!0,"page")},{key:"PageUp",run:G(!1,"page")},{key:"Enter",run:J}],ht=o.Wl.highest(s.$f.computeN([S],(t=>t.facet(S).defaultKeymap?[ct]:[])));n()}catch(l){n(l)}}))},3191:function(t,e,i){i.d(e,{b:()=>c});i(69235),i(12385),i(19134),i(11740),i(44495);var n=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","do","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","set","raw","endraw","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","call","endcall","macro","endmacro","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","without","context","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","pluralize","autoescape","endautoescape"],o=/^[+\-*&%=<>!?|~^]/,s=/^[:\[\(\{]/,r=["true","false"],a=/^(\d[+\-\*\/])?\d+(\.\d+)?/;function l(t,e){var i=t.peek();if(e.incomment)return t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(e.intag){if(e.operator){if(e.operator=!1,t.match(r))return"atom";if(t.match(a))return"number"}if(e.sign){if(e.sign=!1,t.match(r))return"atom";if(t.match(a))return"number"}if(e.instring)return i==e.instring&&(e.instring=!1),t.next(),"string";if("'"==i||'"'==i)return e.instring=i,t.next(),"string";if(e.inbraces>0&&")"==i)t.next(),e.inbraces--;else if("("==i)t.next(),e.inbraces++;else if(e.inbrackets>0&&"]"==i)t.next(),e.inbrackets--;else if("["==i)t.next(),e.inbrackets++;else{if(!e.lineTag&&(t.match(e.intag+"}")||t.eat("-")&&t.match(e.intag+"}")))return e.intag=!1,"tag";if(t.match(o))return e.operator=!0,"operator";if(t.match(s))e.sign=!0;else{if(1==t.column()&&e.lineTag&&t.match(n))return"keyword";if(t.eat(" ")||t.sol()){if(t.match(n))return"keyword";if(t.match(r))return"atom";if(t.match(a))return"number";t.sol()&&t.next()}else t.next()}}return"variable"}if(t.eat("{")){if(t.eat("#"))return e.incomment=!0,t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(i=t.eat(/\{|%/))return e.intag=i,e.inbraces=0,e.inbrackets=0,"{"==i&&(e.intag="}"),t.eat("-"),"tag"}else if(t.eat("#")){if("#"==t.peek())return t.skipToEnd(),"comment";if(!t.eol())return e.intag=!0,e.lineTag=!0,e.inbraces=0,e.inbrackets=0,"tag"}t.next()}n=new RegExp("(("+n.join(")|(")+"))\\b"),r=new RegExp("(("+r.join(")|(")+"))\\b");const c={name:"jinja2",startState:function(){return{tokenize:l,inbrackets:0,inbraces:0}},token:function(t,e){var i=e.tokenize(t,e);return t.eol()&&e.lineTag&&!e.instring&&0==e.inbraces&&0==e.inbrackets&&(e.intag=!1,e.lineTag=!1),i},languageData:{commentTokens:{block:{open:"{#",close:"#}",line:"##"}}}}},91847:function(t,e,i){i.d(e,{r:()=>o});i(69235),i(12385),i(19134),i(5740),i(11740),i(44495);var n=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i");const o={name:"yaml",token:function(t,e){var i=t.peek(),o=e.escaped;if(e.escaped=!1,"#"==i&&(0==t.pos||/\s/.test(t.string.charAt(t.pos-1))))return t.skipToEnd(),"comment";if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(e.literal&&t.indentation()>e.keyCol)return t.skipToEnd(),"string";if(e.literal&&(e.literal=!1),t.sol()){if(e.keyCol=0,e.pair=!1,e.pairStart=!1,t.match("---"))return"def";if(t.match("..."))return"def";if(t.match(/^\s*-\s+/))return"meta"}if(t.match(/^(\{|\}|\[|\])/))return"{"==i?e.inlinePairs++:"}"==i?e.inlinePairs--:"["==i?e.inlineList++:e.inlineList--,"meta";if(e.inlineList>0&&!o&&","==i)return t.next(),"meta";if(e.inlinePairs>0&&!o&&","==i)return e.keyCol=0,e.pair=!1,e.pairStart=!1,t.next(),"meta";if(e.pairStart){if(t.match(/^\s*(\||\>)\s*/))return e.literal=!0,"meta";if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(0==e.inlinePairs&&t.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(e.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(t.match(n))return"keyword"}return!e.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(e.pair=!0,e.keyCol=t.indentation(),"atom"):e.pair&&t.match(/^:\s*/)?(e.pairStart=!0,"meta"):(e.pairStart=!1,e.escaped="\\"==i,t.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}}},73755:function(t,e,i){i.a(t,(async function(t,n){try{i.d(e,{Lp:()=>ut,sW:()=>L});i(63721),i(28457),i(71695),i(92745),i(5509),i(9359),i(70104),i(52924),i(69235),i(12385),i(19134),i(5740),i(11740),i(44495),i(64706),i(97003),i(47706),i(46692),i(47021);var o=i(10857),s=i(89276),r=i(65902),a=t([o]);o=(a.then?(await a)():a)[0];const c="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class h{constructor(t,e,i=0,n=t.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=o?t=>o(c(t)):c,this.query=this.normalize(e)}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(0,s.gm)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=(0,s.bg)(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=(0,s.nZ)(t);let n=this.normalize(e);if(n.length)for(let o=0,s=i;;o++){let t=n.charCodeAt(o),r=this.match(t,s,this.bufferPos+this.bufferStart);if(o==n.length-1){if(r)return this.value=r,this;break}s==i&&o<e.length&&e.charCodeAt(o)==t&&s++}}}match(t,e,i){let n=null;for(let o=0;o<this.matches.length;o+=2){let e=this.matches[o],s=!1;this.query.charCodeAt(e)==t&&(e==this.query.length-1?n={from:this.matches[o+1],to:i}:(this.matches[o]++,s=!0)),s||(this.matches.splice(o,2),o-=2)}return this.query.charCodeAt(0)==t&&(1==this.query.length?n={from:e,to:i}:this.matches.push(1,e)),n&&this.test&&!this.test(n.from,n.to,this.buffer,this.bufferStart)&&(n=null),n}}"undefined"!=typeof Symbol&&(h.prototype[Symbol.iterator]=function(){return this});const u={from:-1,to:-1,match:/.*/.exec("")},f="gm"+(null==/x/.unicode?"":"u");class p{constructor(t,e,i,n=0,o=t.length){if(this.text=t,this.to=o,this.curLine="",this.done=!1,this.value=u,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new g(t,e,i,n,o);this.re=new RegExp(e,f+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.iter=t.iter();let s=t.lineAt(n);this.curLineStart=s.from,this.matchPos=b(t,n),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),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 t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,n=i+e[0].length;if(this.matchPos=b(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<n||i>this.value.to)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),t=0}}}}const d=new WeakMap;class m{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,i){let n=d.get(t);if(!n||n.from>=i||n.to<=e){let n=new m(e,t.sliceString(e,i));return d.set(t,n),n}if(n.from==e&&n.to==i)return n;let{text:o,from:s}=n;return s>e&&(o=t.sliceString(e,s)+o,s=e),n.to<i&&(o+=t.sliceString(n.to,i)),d.set(t,new m(s,o)),new m(e,o.slice(e-s,i-s))}}class g{constructor(t,e,i,n,o){this.text=t,this.to=o,this.done=!1,this.value=u,this.matchPos=b(t,n),this.re=new RegExp(e,f+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.flat=m.get(t,n,this.chunkEnd(n+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,i=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,i,e)))return this.value={from:t,to:i,match:e},this.matchPos=b(this.text,i+(t==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=m.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function v(t){try{return new RegExp(t,f),!0}catch(e){return!1}}function b(t,e){if(e>=t.length)return e;let i,n=t.lineAt(e);for(;e<n.to&&(i=n.text.charCodeAt(e-n.from))>=56320&&i<57344;)e++;return e}function y(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),i=(0,r.Z)("input",{class:"cm-textfield",name:"line",value:e});function n(){let e=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(i.value);if(!e)return;let{state:n}=t,r=n.doc.lineAt(n.selection.main.head),[,a,l,c,h]=e,u=c?+c.slice(1):0,f=l?+l:r.number;if(l&&h){let t=f/100;a&&(t=t*("-"==a?-1:1)+r.number/n.doc.lines),f=Math.round(n.doc.lines*t)}else l&&a&&(f=f*("-"==a?-1:1)+r.number);let p=n.doc.line(Math.max(1,Math.min(n.doc.lines,f))),d=s.jT.cursor(p.from+Math.max(0,Math.min(u,p.length)));t.dispatch({effects:[x.of(!1),o.tk.scrollIntoView(d.from,{y:"center"})],selection:d}),t.focus()}return{dom:(0,r.Z)("form",{class:"cm-gotoLine",onkeydown:e=>{27==e.keyCode?(e.preventDefault(),t.dispatch({effects:x.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),n())},onsubmit:t=>{t.preventDefault(),n()}},(0,r.Z)("label",t.state.phrase("Go to line"),": ",i)," ",(0,r.Z)("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),(0,r.Z)("button",{name:"close",onclick:()=>{t.dispatch({effects:x.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]))}}"undefined"!=typeof Symbol&&(p.prototype[Symbol.iterator]=g.prototype[Symbol.iterator]=function(){return this});const x=s.Py.define(),w=s.QQ.define({create(){return!0},update(t,e){for(let i of e.effects)i.is(x)&&(t=i.value);return t},provide:t=>o.mH.from(t,(t=>t?y:null))}),k=t=>{let e=(0,o.Sd)(t,y);if(!e){let i=[x.of(!0)];null==t.state.field(w,!1)&&i.push(s.Py.appendConfig.of([w,C])),t.dispatch({effects:i}),e=(0,o.Sd)(t,y)}return e&&e.dom.querySelector("input").select(),!0},C=o.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),S={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},M=s.r$.define({combine(t){return(0,s.BO)(t,S,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}});function L(t){let e=[E,O];return t&&e.push(M.of(t)),e}const T=o.p.mark({class:"cm-selectionMatch"}),A=o.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function D(t,e,i,n){return!(0!=i&&t(e.sliceDoc(i-1,i))==s.D0.Word||n!=e.doc.length&&t(e.sliceDoc(n,n+1))==s.D0.Word)}function I(t,e,i,n){return t(e.sliceDoc(i,i+1))==s.D0.Word&&t(e.sliceDoc(n-1,n))==s.D0.Word}const O=o.lg.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(M),{state:i}=t,n=i.selection;if(n.ranges.length>1)return o.p.none;let s,r=n.main,a=null;if(r.empty){if(!e.highlightWordAroundCursor)return o.p.none;let t=i.wordAt(r.head);if(!t)return o.p.none;a=i.charCategorizer(r.head),s=i.sliceDoc(t.from,t.to)}else{let t=r.to-r.from;if(t<e.minSelectionLength||t>200)return o.p.none;if(e.wholeWords){if(s=i.sliceDoc(r.from,r.to),a=i.charCategorizer(r.head),!D(a,i,r.from,r.to)||!I(a,i,r.from,r.to))return o.p.none}else if(s=i.sliceDoc(r.from,r.to),!s)return o.p.none}let l=[];for(let c of t.visibleRanges){let t=new h(i.doc,s,c.from,c.to);for(;!t.next().done;){let{from:n,to:s}=t.value;if((!a||D(a,i,n,s))&&(r.empty&&n<=r.from&&s>=r.to?l.push(A.range(n,s)):(n>=r.to||s<=r.from)&&l.push(T.range(n,s)),l.length>e.maxMatches))return o.p.none}}return o.p.set(l)}},{decorations:t=>t.decorations}),E=o.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),R=({state:t,dispatch:e})=>{let{selection:i}=t,n=s.jT.create(i.ranges.map((e=>t.wordAt(e.head)||s.jT.cursor(e.head))),i.mainIndex);return!n.eq(i)&&(e(t.update({selection:n})),!0)};function P(t,e){let{main:i,ranges:n}=t.selection,o=t.wordAt(i.head),s=o&&o.from==i.from&&o.to==i.to;for(let r=!1,a=new h(t.doc,e,n[n.length-1].to);;){if(a.next(),!a.done){if(r&&n.some((t=>t.from==a.value.from)))continue;if(s){let e=t.wordAt(a.value.from);if(!e||e.from!=a.value.from||e.to!=a.value.to)continue}return a.value}if(r)return null;a=new h(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),r=!0}}const W=({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some((t=>t.from===t.to)))return R({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some((e=>t.sliceDoc(e.from,e.to)!=n)))return!1;let r=P(t,n);return!!r&&(e(t.update({selection:t.selection.addRange(s.jT.range(r.from,r.to),!1),effects:o.tk.scrollIntoView(r.to)})),!0)},q=s.r$.define({combine(t){return(0,s.BO)(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new ft(t),scrollToMatch:t=>o.tk.scrollIntoView(t)})}});class F{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||v(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,((t,e)=>"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"))}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new U(this):new B(this)}getCursor(t,e=0,i){let n=t.doc?t:s.yy.create({doc:t});return null==i&&(i=n.doc.length),this.regexp?N(this,n,e,i):j(this,n,e,i)}}class ${constructor(t){this.spec=t}}function j(t,e,i,n){return new h(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:t=>t.toLowerCase(),t.wholeWord?(o=e.doc,r=e.charCategorizer(e.selection.main.head),(t,e,i,n)=>((n>t||n+i.length<e)&&(n=Math.max(0,t-2),i=o.sliceString(n,Math.min(o.length,e+2))),!(r(z(i,t-n))==s.D0.Word&&r(Z(i,t-n))==s.D0.Word||r(Z(i,e-n))==s.D0.Word&&r(z(i,e-n))==s.D0.Word))):void 0);var o,r}class B extends ${constructor(t){super(t)}nextMatch(t,e,i){let n=j(this.spec,t,i,t.doc.length).nextOverlapping();if(n.done){let i=Math.min(t.doc.length,e+this.spec.unquoted.length);n=j(this.spec,t,0,i).nextOverlapping()}return n.done||n.value.from==e&&n.value.to==i?null:n.value}prevMatchInRange(t,e,i){for(let n=i;;){let i=Math.max(e,n-1e4-this.spec.unquoted.length),o=j(this.spec,t,i,n),s=null;for(;!o.nextOverlapping().done;)s=o.value;if(s)return s;if(i==e)return null;n-=1e4}}prevMatch(t,e,i){let n=this.prevMatchInRange(t,0,e);return n||(n=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),!n||n.from==e&&n.to==i?null:n}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let i=j(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let o=j(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!o.next().done;)n(o.value.from,o.value.to)}}function N(t,e,i,n){return new p(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(o=e.charCategorizer(e.selection.main.head),(t,e,i)=>!i[0].length||(o(z(i.input,i.index))!=s.D0.Word||o(Z(i.input,i.index))!=s.D0.Word)&&(o(Z(i.input,i.index+i[0].length))!=s.D0.Word||o(z(i.input,i.index+i[0].length))!=s.D0.Word)):void 0},i,n);var o}function z(t,e){return t.slice((0,s.cp)(t,e,!1),e)}function Z(t,e){return t.slice(e,(0,s.cp)(t,e))}class U extends ${nextMatch(t,e,i){let n=N(this.spec,t,i,t.doc.length).next();return n.done&&(n=N(this.spec,t,0,e).next()),n.done?null:n.value}prevMatchInRange(t,e,i){for(let n=1;;n++){let o=Math.max(e,i-1e4*n),s=N(this.spec,t,o,i),r=null;for(;!s.next().done;)r=s.value;if(r&&(o==e||r.from>o+10))return r;if(o==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,((e,i)=>{if("&"==i)return t.match[0];if("$"==i)return"$";for(let n=i.length;n>0;n--){let e=+i.slice(0,n);if(e>0&&e<t.match.length)return t.match[e]+i.slice(n)}return e}))}matchAll(t,e){let i=N(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let o=N(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!o.next().done;)n(o.value.from,o.value.to)}}const _=s.Py.define(),Q=s.Py.define(),H=s.QQ.define({create(t){return new K(rt(t).create(),null)},update(t,e){for(let i of e.effects)i.is(_)?t=new K(i.value.create(),t.panel):i.is(Q)&&(t=new K(t.query,i.value?st:null));return t},provide:t=>o.mH.from(t,(t=>t.panel))});class K{constructor(t,e){this.query=t,this.panel=e}}const V=o.p.mark({class:"cm-searchMatch"}),G=o.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),J=o.lg.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(H))}update(t){let e=t.state.field(H);(e!=t.startState.field(H)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return o.p.none;let{view:i}=this,n=new s.f_;for(let o=0,s=i.visibleRanges,r=s.length;o<r;o++){let{from:e,to:a}=s[o];for(;o<r-1&&a>s[o+1].from-500;)a=s[++o].to;t.highlight(i.state,e,a,((t,e)=>{let o=i.state.selection.ranges.some((i=>i.from==t&&i.to==e));n.add(t,e,o?G:V)}))}return n.finish()}},{decorations:t=>t.decorations});function X(t){return e=>{let i=e.state.field(H,!1);return i&&i.query.spec.valid?t(e,i):ct(e)}}const Y=X(((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let o=s.jT.single(n.from,n.to),r=t.state.facet(q);return t.dispatch({selection:o,effects:[gt(t,n),r.scrollToMatch(o.main,t)],userEvent:"select.search"}),lt(t),!0})),tt=X(((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,o=e.prevMatch(i,n,n);if(!o)return!1;let r=s.jT.single(o.from,o.to),a=t.state.facet(q);return t.dispatch({selection:r,effects:[gt(t,o),a.scrollToMatch(r.main,t)],userEvent:"select.search"}),lt(t),!0})),et=X(((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!(!i||!i.length)&&(t.dispatch({selection:s.jT.create(i.map((t=>s.jT.range(t.from,t.to)))),userEvent:"select.search.matches"}),!0)})),it=({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:o}=i.main,r=[],a=0;for(let l=new h(t.doc,t.sliceDoc(n,o));!l.next().done;){if(r.length>1e3)return!1;l.value.from==n&&(a=r.length),r.push(s.jT.range(l.value.from,l.value.to))}return e(t.update({selection:s.jT.create(r,a),userEvent:"select.search.matches"})),!0},nt=X(((t,{query:e})=>{let{state:i}=t,{from:n,to:r}=i.selection.main;if(i.readOnly)return!1;let a=e.nextMatch(i,n,n);if(!a)return!1;let l,c,h=a,u=[],f=[];if(h.from==n&&h.to==r&&(c=i.toText(e.getReplacement(h)),u.push({from:h.from,to:h.to,insert:c}),h=e.nextMatch(i,h.from,h.to),f.push(o.tk.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(n).number)+"."))),h){let e=0==u.length||u[0].from>=a.to?0:a.to-a.from-c.length;l=s.jT.single(h.from-e,h.to-e),f.push(gt(t,h)),f.push(i.facet(q).scrollToMatch(l.main,t))}return t.dispatch({changes:u,selection:l,effects:f,userEvent:"input.replace"}),!0})),ot=X(((t,{query:e})=>{if(t.state.readOnly)return!1;let i=e.matchAll(t.state,1e9).map((t=>{let{from:i,to:n}=t;return{from:i,to:n,insert:e.getReplacement(t)}}));if(!i.length)return!1;let n=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:o.tk.announce.of(n),userEvent:"input.replace.all"}),!0}));function st(t){return t.state.facet(q).createPanel(t)}function rt(t,e){var i,n,o,s,r;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(q);return new F({search:(null!==(i=null==e?void 0:e.literal)&&void 0!==i?i:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(n=null==e?void 0:e.caseSensitive)&&void 0!==n?n:c.caseSensitive,literal:null!==(o=null==e?void 0:e.literal)&&void 0!==o?o:c.literal,regexp:null!==(s=null==e?void 0:e.regexp)&&void 0!==s?s:c.regexp,wholeWord:null!==(r=null==e?void 0:e.wholeWord)&&void 0!==r?r:c.wholeWord})}function at(t){let e=(0,o.Sd)(t,st);return e&&e.dom.querySelector("[main-field]")}function lt(t){let e=at(t);e&&e==t.root.activeElement&&e.select()}const ct=t=>{let e=t.state.field(H,!1);if(e&&e.panel){let i=at(t);if(i&&i!=t.root.activeElement){let n=rt(t.state,e.query.spec);n.valid&&t.dispatch({effects:_.of(n)}),i.focus(),i.select()}}else t.dispatch({effects:[Q.of(!0),e?_.of(rt(t.state,e.query.spec)):s.Py.appendConfig.of(bt)]});return!0},ht=t=>{let e=t.state.field(H,!1);if(!e||!e.panel)return!1;let i=(0,o.Sd)(t,st);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Q.of(!1)}),!0},ut=[{key:"Mod-f",run:ct,scope:"editor search-panel"},{key:"F3",run:Y,shift:tt,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Y,shift:tt,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ht,scope:"editor search-panel"},{key:"Mod-Shift-l",run:it},{key:"Mod-Alt-g",run:k},{key:"Mod-d",run:W,preventDefault:!0}];class ft{constructor(t){this.view=t;let e=this.query=t.state.field(H).query.spec;function i(t,e,i){return(0,r.Z)("button",{class:"cm-button",name:t,onclick:e,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=(0,r.Z)("input",{value:e.search,placeholder:pt(t,"Find"),"aria-label":pt(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=(0,r.Z)("input",{value:e.replace,placeholder:pt(t,"Replace"),"aria-label":pt(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=(0,r.Z)("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=(0,r.Z)("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=(0,r.Z)("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=(0,r.Z)("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,i("next",(()=>Y(t)),[pt(t,"next")]),i("prev",(()=>tt(t)),[pt(t,"previous")]),i("select",(()=>et(t)),[pt(t,"all")]),(0,r.Z)("label",null,[this.caseField,pt(t,"match case")]),(0,r.Z)("label",null,[this.reField,pt(t,"regexp")]),(0,r.Z)("label",null,[this.wordField,pt(t,"by word")]),...t.state.readOnly?[]:[(0,r.Z)("br"),this.replaceField,i("replace",(()=>nt(t)),[pt(t,"replace")]),i("replaceAll",(()=>ot(t)),[pt(t,"replace all")])],(0,r.Z)("button",{name:"close",onclick:()=>ht(t),"aria-label":pt(t,"close"),type:"button"},["×"])])}commit(){let t=new F({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:_.of(t)}))}keydown(t){(0,o.$1)(this.view,t,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?tt:Y)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),nt(this.view))}update(t){for(let e of t.transactions)for(let t of e.effects)t.is(_)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(q).top}}function pt(t,e){return t.state.phrase(e)}const dt=30,mt=/[\s\.,:;?!]/;function gt(t,{from:e,to:i}){let n=t.state.doc.lineAt(e),s=t.state.doc.lineAt(i).to,r=Math.max(n.from,e-dt),a=Math.min(s,i+dt),l=t.state.sliceDoc(r,a);if(r!=n.from)for(let o=0;o<dt;o++)if(!mt.test(l[o+1])&&mt.test(l[o])){l=l.slice(o);break}if(a!=s)for(let o=l.length-1;o>l.length-dt;o--)if(!mt.test(l[o-1])&&mt.test(l[o])){l=l.slice(0,o);break}return o.tk.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${n.number}.`)}const vt=o.tk.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"}}),bt=[H,s.Wl.low(J),vt];n()}catch(l){n(l)}}))},74092:function(t,e,i){i.a(t,(async function(t,n){try{i.d(e,{C:()=>b});i(52247),i(71695),i(92745),i(9359),i(70104),i(19423),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(81804),i(47021);var o=i(51801),s=i(89276),r=i(10857),a=t([o,r]);function c(t,e=t.state){const i=new Set;for(const{from:n,to:o}of t.visibleRanges){let t=n;for(;t<=o;){const n=e.doc.lineAt(t);i.has(n)||i.add(n),t=n.to+1}}return i}function h(t){const e=t.selection.main.head;return t.doc.lineAt(e)}function u(t,e){let i=0;t:for(let n=0;n<t.length;n++)switch(t[n]){case" ":case" ":i+=1;continue t;case"\t":i+=e-i%e;continue t;case"\r":continue t;default:break t}return i}[o,r]=a.then?(await a)():a;const f=s.r$.define({combine(t){return(0,s.BO)(t,{highlightActiveBlock:!0,hideFirstIndent:!1,markerType:"fullScope",thickness:1})}});class p{constructor(t,e,i,n){this.lines=t,this.state=e,this.map=new Map,this.unitWidth=i,this.markerType=n;for(const o of this.lines)this.add(o);this.state.facet(f).highlightActiveBlock&&this.findAndSetActiveLines()}has(t){return this.map.has("number"==typeof t?t:t.number)}get(t){const e=this.map.get("number"==typeof t?t:t.number);if(!e)throw new Error("Line not found in indentation map");return e}set(t,e,i){const n=!t.text.trim().length,o={line:t,col:e,level:i,empty:n};return this.map.set(o.line.number,o),o}add(t){if(this.has(t))return this.get(t);if(!t.length||!t.text.trim().length){if(1===t.number)return this.set(t,0,0);if(t.number===this.state.doc.lines){const e=this.closestNonEmpty(t,-1);return this.set(t,0,e.level)}const e=this.closestNonEmpty(t,-1),i=this.closestNonEmpty(t,1);return e.level>=i.level&&"codeOnly"!==this.markerType?this.set(t,0,e.level):e.empty&&0===e.level&&0!==i.level?this.set(t,0,0):i.level>e.level?this.set(t,0,e.level+1):this.set(t,0,i.level)}const e=u(t.text,this.state.tabSize),i=Math.floor(e/this.unitWidth);return this.set(t,e,i)}closestNonEmpty(t,e){let i=t.number+e;for(;-1===e?i>=1:i<=this.state.doc.lines;){if(this.has(i)){const t=this.get(i);if(!t.empty)return t}const t=this.state.doc.line(i);if(t.text.trim().length){const e=u(t.text,this.state.tabSize),i=Math.floor(e/this.unitWidth);return this.set(t,e,i)}i+=e}const n=this.state.doc.line(-1===e?1:this.state.doc.lines);return this.set(n,0,0)}findAndSetActiveLines(){const t=h(this.state);if(!this.has(t))return;let e,i,n=this.get(t);if(this.has(n.line.number+1)){const t=this.get(n.line.number+1);t.level>n.level&&(n=t)}if(this.has(n.line.number-1)){const t=this.get(n.line.number-1);t.level>n.level&&(n=t)}if(0!==n.level){for(n.active=n.level,e=n.line.number;e>1;e--){if(!this.has(e-1))continue;const t=this.get(e-1);if(t.level<n.level)break;t.active=n.level}for(i=n.line.number;i<this.state.doc.lines;i++){if(!this.has(i+1))continue;const t=this.get(i+1);if(t.level<n.level)break;t.active=n.level}}}}function d(t){const e={light:"#F0F1F2",dark:"#2B3245",activeLight:"#E4E5E6",activeDark:"#3C445C"};let i=e;return t&&(i=Object.assign(Object.assign({},e),t)),r.tk.baseTheme({"&light":{"--indent-marker-bg-color":i.light,"--indent-marker-active-bg-color":i.activeLight},"&dark":{"--indent-marker-bg-color":i.dark,"--indent-marker-active-bg-color":i.activeDark},".cm-line":{position:"relative"},".cm-indent-markers::before":{content:'""',position:"absolute",top:0,left:"2px",right:0,bottom:0,background:"var(--indent-markers)",pointerEvents:"none",zIndex:"-1"}})}function m(t,e,i,n,o){return`${`repeating-linear-gradient(to right, var(${t}) 0 ${e}px, transparent ${e}px ${i}ch)`} ${n*i}.5ch/calc(${i*o}ch - 1px) no-repeat`}function g(t,e,i,n,o){const{level:s,active:r}=t;if(o=null!=o?o:n,i&&0===s)return[];const a=i?1:0,l=[];if(void 0!==r){const t=r-a-1;t>0&&l.push(m("--indent-marker-bg-color",n,e,a,t)),l.push(m("--indent-marker-active-bg-color",o,e,r-1,1)),r!==s&&l.push(m("--indent-marker-bg-color",n,e,r,s-r))}else l.push(m("--indent-marker-bg-color",n,e,a,s-a));return l.join(",")}class v{constructor(t){this.view=t,this.unitWidth=(0,o.y1)(t.state),this.currentLineNumber=h(t.state).number,this.generate(t.state)}update(t){const e=(0,o.y1)(t.state),i=e!==this.unitWidth;i&&(this.unitWidth=e);const n=h(t.state).number,s=n!==this.currentLineNumber;this.currentLineNumber=n;const r=t.state.facet(f).highlightActiveBlock&&s;(t.docChanged||t.viewportChanged||i||r)&&this.generate(t.state)}generate(t){const e=new s.f_,i=c(this.view,t),{hideFirstIndent:n,markerType:o,thickness:a,activeThickness:l}=t.facet(f),h=new p(i,t,this.unitWidth,o);for(const s of i){const t=h.get(s.number);if(!(null==t?void 0:t.level))continue;const i=g(t,this.unitWidth,n,a,l);e.add(s.from,s.from,r.p.line({class:"cm-indent-markers",attributes:{style:`--indent-markers: ${i}`}}))}this.decorations=e.finish()}}function b(t={}){return[f.of(t),d(t.colors),r.lg.fromClass(v,{decorations:t=>t.decorations})]}n()}catch(l){n(l)}}))},65902:function(t,e,i){i.d(e,{Z:()=>n});i(52247);function n(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var s=i[n];"string"==typeof s?t.setAttribute(n,s):null!=s&&(t[n]=s)}e++}for(;e<arguments.length;e++)o(t,arguments[e]);return t}function o(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var i=0;i<e.length;i++)o(t,e[i])}}}}]);
//# sourceMappingURL=8771.8289273a58b662a3.js.map