diff --git a/dev/checksums/vendor b/dev/checksums/vendor index 8a51f0ed5..151d99486 100644 --- a/dev/checksums/vendor +++ b/dev/checksums/vendor @@ -1 +1 @@ -aa0c206344886b541784cd17e41f327ba8f0abe53b48e7b1477d72d570c3bc21 \ No newline at end of file +549c89b1a426fec378adbcf495a3227307dfaa60affb8ac00cf206afd904bbe9 \ No newline at end of file diff --git a/public/dist/app.js b/public/dist/app.js index eea497ebd..c6af6820d 100644 --- a/public/dist/app.js +++ b/public/dist/app.js @@ -1,12 +1,12 @@ // See the "/licenses" URI for full package license details -var Gi=Object.defineProperty;var Yi=i=>{throw TypeError(i)};var Ls=(i,t,e)=>t in i?Gi(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var xs=(i,t)=>{for(var e in t)Gi(i,e,{get:t[e],enumerable:!0})};var d=(i,t,e)=>Ls(i,typeof t!="symbol"?t+"":t,e),Ts=(i,t,e)=>t.has(i)||Yi("Cannot "+e);var Ji=(i,t,e)=>t.has(i)?Yi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e);var Jt=(i,t,e)=>(Ts(i,t,"access private method"),e);var ge=class{constructor(){d(this,"listeners",{});d(this,"stack",[])}emit(t,e={}){this.stack.push({name:t,data:e});let n=this.listeners[t]||[];for(let o of n)o(e)}listen(t,e){typeof this.listeners[t]>"u"&&(this.listeners[t]=[]),this.listeners[t].push(e)}remove(t,e){let n=this.listeners[t]||[],o=n.indexOf(e);o!==-1&&n.splice(o,1)}emitPublic(t,e,n){let o=new CustomEvent(e,{detail:n,bubbles:!0});t.dispatchEvent(o)}success(t){this.emit("success",t)}error(t){this.emit("error",t)}showValidationErrors(t){if(t.status===422&&t.data){let e=Object.values(t.data).flat().join(` -`);this.error(e)}}showResponseError(t){t.status&&t.status>=400&&typeof t.data=="object"&&t.data.message&&this.error(t.data.message)}};var Lt=class extends Error{constructor(e,n){super(e.statusText);d(this,"data");d(this,"headers");d(this,"original");d(this,"redirected");d(this,"status");d(this,"statusText");d(this,"url");this.data=n,this.headers=e.headers,this.redirected=e.redirected,this.status=e.status,this.statusText=e.statusText,this.url=e.url,this.original=e}},ve=class{async getResponseContent(t){if(t.status===204)return null;let n=(t.headers.get("Content-Type")||"").split(";")[0].split("/").pop();return n==="javascript"||n==="json"?t.json():t.text()}createXMLHttpRequest(t,e,n={}){let o=document.querySelector("meta[name=token]")?.getAttribute("content"),s=new XMLHttpRequest;for(let[r,a]of Object.entries(n))s.addEventListener(r,a.bind(s));return s.open(t,e),s.withCredentials=!0,s.setRequestHeader("X-CSRF-TOKEN",o||""),s}async request(t,e={}){let n=t;if(n.startsWith("http")||(n=window.baseUrl(n)),e.params){let c=new URL(n);for(let u of Object.keys(e.params)){let p=e.params[u];typeof p<"u"&&p!==null&&c.searchParams.set(u,p)}n=c.toString()}let o=document.querySelector("meta[name=token]")?.getAttribute("content")||"",s={...e,credentials:"same-origin"};s.headers={...s.headers||{},baseURL:window.baseUrl(""),"X-CSRF-TOKEN":o};let r=await fetch(n,s),a=await this.getResponseContent(r)||"",l={data:a,headers:r.headers,redirected:r.redirected,status:r.status,statusText:r.statusText,url:r.url,original:r};if(!r.ok)throw new Lt(r,a);return l}async dataRequest(t,e,n){let o={method:t,body:n};return typeof n=="object"&&!(n instanceof FormData)&&(o.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},o.body=JSON.stringify(n)),n instanceof FormData&&t!=="post"&&(n.append("_method",t),o.method="post"),this.request(e,o)}async get(t,e={}){return this.request(t,{method:"GET",params:e})}async post(t,e=null){return this.dataRequest("POST",t,e)}async put(t,e=null){return this.dataRequest("PUT",t,e)}async patch(t,e=null){return this.dataRequest("PATCH",t,e)}async delete(t,e=null){return this.dataRequest("DELETE",t,e)}formatErrorResponseText(t){let e=t.startsWith("{")?JSON.parse(t):{message:t};if(!e)return t;if(e.message||e.error)return e.message||e.error;let n=Object.values(e);return n.every(s=>Array.isArray(s)&&s.every(r=>typeof r=="string"))?n.flat().join(" "):t}};var we=class{choice(t,e,n={}){n=Object.assign({},{count:String(e)},n);let o=t.split("|"),s=/^{([0-9]+)}/,r=/^\[([0-9]+),([0-9*]+)]/,a=null;for(let l of o){let c=l.match(s);if(c!==null&&Number(c[1])===e){a=l.replace(s,"").trim();break}let u=l.match(r);if(u!==null&&Number(u[1])<=e&&(u[2]==="*"||Number(u[2])>=e)){a=l.replace(r,"").trim();break}}return a===null&&o.length>1&&(a=e===1?o[0]:o[1]),a===null&&(a=o[0]),this.performReplacements(a,n)}performReplacements(t,e){let n=t.match(/:(\S+)/g);if(n===null)return t;let o=t;for(let s of n){let r=s.substring(1);typeof e[r]>"u"||(o=o.replace(s,e[r]))}return o}};var zi={};xs(zi,{AddRemoveRows:()=>Ce,AjaxDeleteRow:()=>Le,AjaxForm:()=>xe,Attachments:()=>Te,AttachmentsList:()=>Se,AutoSubmit:()=>$e,AutoSuggest:()=>ke,BackToTop:()=>Me,BookSort:()=>Ke,ChapterContents:()=>Ge,CodeEditor:()=>Ye,CodeHighlighter:()=>Je,CodeTextarea:()=>Ze,Collapsible:()=>Qe,ConfirmDialog:()=>tn,CustomCheckbox:()=>en,DetailsHighlighter:()=>nn,Dropdown:()=>on,DropdownSearch:()=>sn,Dropzone:()=>rn,EditorToolbox:()=>an,EntityPermissions:()=>ln,EntitySearch:()=>cn,EntitySelector:()=>dn,EntitySelectorPopup:()=>hn,EventEmitSelect:()=>un,ExpandToggle:()=>pn,GlobalSearch:()=>mn,HeaderMobileToggle:()=>fn,ImageManager:()=>gn,ImagePicker:()=>vn,ListSortControl:()=>wn,LoadingButton:()=>bn,MarkdownEditor:()=>yn,NewUserPassword:()=>En,Notification:()=>Cn,OptionalInput:()=>Ln,PageComment:()=>xn,PageCommentReference:()=>Tn,PageComments:()=>Sn,PageDisplay:()=>kn,PageEditor:()=>$n,PagePicker:()=>Dn,PermissionsTable:()=>An,Pointer:()=>In,Popup:()=>Hn,SettingAppColorScheme:()=>Bn,SettingColorPicker:()=>Pn,SettingHomepageControl:()=>Rn,ShelfSort:()=>Fn,ShortcutInput:()=>qn,Shortcuts:()=>_n,SortRuleManager:()=>Wn,SortableList:()=>Vn,SubmitOnChange:()=>Un,Tabs:()=>jt,TagManager:()=>jn,TemplateManager:()=>zn,ToggleSwitch:()=>Kn,TriLayout:()=>Xn,UserSelect:()=>Gn,WebhookEvents:()=>Yn,WysiwygEditor:()=>Jn,WysiwygEditorTinymce:()=>ii,WysiwygInput:()=>oi});function mt(i,t,e){let n=null;return function(...s){let r=this,a=function(){n=null,e||i.apply(r,s)},l=e&&!n;n&&clearTimeout(n),n=window.setTimeout(a,t),l&&i.apply(r,s)}}function Ss(i){return i.nodeName==="DETAILS"}function xt(i){if(!i)return;let t=i;for(;t.parentElement;)t=t.parentElement,Ss(t)&&!t.open&&(t.open=!0);i.scrollIntoView({behavior:"smooth"});let e=getComputedStyle(document.body).getPropertyValue("--color-link");i.style.outline=`2px dashed ${e}`,i.style.outlineOffset="5px",i.style.removeProperty("transition"),setTimeout(()=>{i.style.transition="outline linear 3s",i.style.outline="2px dashed rgba(0, 0, 0, 0)";let n=()=>{i.removeEventListener("transitionend",n),i.style.removeProperty("transition"),i.style.removeProperty("outline"),i.style.removeProperty("outlineOffset")};i.addEventListener("transitionend",n)},1e3)}function Zi(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Qi(){let i=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${i()+i()}-${i()}-${i()}-${i()}-${i()}${i()}${i()}`}function to(i){return new Promise(t=>{setTimeout(t,i)})}function eo(i){let t=i,e=document.querySelector('meta[name="base-url"]');if(!e)throw new Error("Could not find expected base-url meta tag in document");let n=e.getAttribute("content")||"";return n[n.length-1]==="/"&&(n=n.slice(0,n.length-1)),t[0]==="/"&&(t=t.slice(1)),`${n}/${t}`}function ks(){let i=document.querySelector('link[href*="/dist/styles.css?version="]');if(!i)throw new Error("Could not find expected style link in document for version use");return(i.getAttribute("href")||"").split("?version=").pop()||""}function no(i){return import(window.baseUrl(`dist/${i}.js?version=${ks()}`))}function io(i,t=0){let e=3735928559^t,n=1103547991^t;for(let o=0,s;o>>16,2246822507),e^=Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(e^e>>>13,3266489909),String(4294967296*(2097151&n)+(e>>>0))}function ft(i){return i instanceof HTMLElement}function ot(i,t={},e=[]){let n=document.createElement(i);for(let[o,s]of Object.entries(t))s===null?n.removeAttribute(o):n.setAttribute(o,s);for(let o of e)typeof o=="string"?n.append(document.createTextNode(o)):n.append(o);return n}function ri(i,t){let e=document.querySelectorAll(i);for(let n of e)t(n)}function be(i,t,e){if(i)for(let n of t)i.addEventListener(n,e)}function T(i,t){Array.isArray(i)||(i=[i]);for(let e of i)e.addEventListener("click",t),e.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t(n))})}function oo(i,t,e){Array.isArray(t)||(t=[t]);let n=o=>{o.key===i&&e(o)};t.forEach(o=>o.addEventListener("keydown",n))}function Ht(i,t){oo("Enter",i,t)}function so(i,t){oo("Escape",i,t)}function I(i,t,e,n){i.addEventListener(e,o=>{let s=o.target?.closest(t);s&&n.call(s,o,s)})}function ro(i,t){let e=document.querySelectorAll(i);t=t.toLowerCase();for(let n of e)if((n.textContent||"").toLowerCase().includes(t)&&ft(n))return n;return null}function Tt(i){i.innerHTML='
'}function Bt(){let i=document.createElement("div");return i.classList.add("loading-container"),i.innerHTML="
",i}function Zt(i){let t=i.querySelectorAll(".loading-container");for(let e of t)e.remove()}function Q(i){let t=document.createElement("div");t.innerHTML=i,window.$components.init(t);let e=t.children[0];if(!ft(e))throw new Error("Could not find child HTMLElement when creating DOM element from HTML");return e}function ai(i,t,e){if(!e.contains(i))throw new Error("ParentElement must be a prent of element");let n=t,o=i.nodeType===Node.TEXT_NODE?i:i.childNodes[t];for(;o!==e&&o;)o.previousSibling?(o=o.previousSibling,n+=o.textContent?.length||0):o=o.parentNode;return n}function ye(i,t){if(t===0)return{node:i,offset:0};let e=0,n=null;for(let o=0;o=t)return{node:n,offset:t-e};e+=s}else if(n.nodeType===Node.ELEMENT_NODE){let s=(n.textContent||"").length;if(e+s>=t)return ye(n,t-e);e+=s}return null}function Ee(i){let t=(i.textContent||"").replace(/\s{2,}/g,"");return io(t)}function ao(i){let t=i;do{if(window.getComputedStyle(t).overflowY==="scroll")return t;t=t.parentElement}while(t);return document.body}var h=class{constructor(){d(this,"$name","");d(this,"$el",null);d(this,"$refs",{});d(this,"$manyRefs",{});d(this,"$opts",{})}setup(){}$emit(t,e={}){e.from=this;let n=this.$name,o=new CustomEvent(`${n}-${t}`,{bubbles:!0,detail:e});this.$el.dispatchEvent(o)}};var Ce=class extends h{setup(){this.modelRow=this.$refs.model,this.addButton=this.$refs.add,this.removeSelector=this.$opts.removeSelector,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.addButton.addEventListener("click",this.add.bind(this)),I(this.$el,this.removeSelector,"click",t=>{t.target.closest(this.rowSelector).remove()})}add(){let t=this.modelRow.cloneNode(!0);t.classList.remove("hidden"),this.setClonedInputNames(t),this.modelRow.parentNode.insertBefore(t,this.modelRow),window.$components.init(t)}setClonedInputNames(t){let e=Qi(),n=t.querySelectorAll('[name*="randrowid"]');for(let o of n)o.name=o.name.split("randrowid").join(e)}};var Le=class extends h{constructor(){super(...arguments);d(this,"row");d(this,"url");d(this,"deleteButtons",[])}setup(){this.row=this.$el,this.url=this.$opts.url,this.deleteButtons=this.$manyRefs.delete||[],T(this.deleteButtons,this.runDelete.bind(this))}runDelete(){this.row.style.opacity="0.7",this.row.style.pointerEvents="none",window.$http.delete(this.url).then(e=>{typeof e.data=="object"&&e.data.message&&window.$events.emit("success",e.data.message),this.row.remove()}).catch(()=>{this.row.style.removeProperty("opacity"),this.row.style.removeProperty("pointer-events")})}};var xe=class extends h{setup(){this.container=this.$el,this.responseContainer=this.container,this.url=this.$opts.url,this.method=this.$opts.method||"post",this.successMessage=this.$opts.successMessage,this.submitButtons=this.$manyRefs.submit||[],this.$opts.responseContainer&&(this.responseContainer=this.container.closest(this.$opts.responseContainer)),this.setupListeners()}setupListeners(){if(this.container.tagName==="FORM"){this.container.addEventListener("submit",this.submitRealForm.bind(this));return}Ht(this.container,t=>{this.submitFakeForm(),t.preventDefault()}),this.submitButtons.forEach(t=>T(t,this.submitFakeForm.bind(this)))}submitFakeForm(){let t=new FormData,e=this.container.querySelectorAll("[name]");for(let n of e)t.append(n.getAttribute("name"),n.value);this.submit(t)}submitRealForm(t){t.preventDefault();let e=new FormData(this.container);this.submit(e)}async submit(t){this.responseContainer.style.opacity="0.7",this.responseContainer.style.pointerEvents="none";try{let e=await window.$http[this.method.toLowerCase()](this.url,t);this.$emit("success",{formData:t}),this.responseContainer.innerHTML=e.data,this.successMessage&&window.$events.emit("success",this.successMessage)}catch(e){this.responseContainer.innerHTML=e.data}window.$components.init(this.responseContainer),this.responseContainer.style.opacity=null,this.responseContainer.style.pointerEvents=null}};var Te=class extends h{setup(){this.container=this.$el,this.pageId=this.$opts.pageId,this.editContainer=this.$refs.editContainer,this.listContainer=this.$refs.listContainer,this.linksContainer=this.$refs.linksContainer,this.listPanel=this.$refs.listPanel,this.attachLinkButton=this.$refs.attachLinkButton,this.setupListeners()}setupListeners(){let t=this.reloadList.bind(this);this.container.addEventListener("dropzone-upload-success",t),this.container.addEventListener("ajax-form-success",t),this.container.addEventListener("sortable-list-sort",e=>{this.updateOrder(e.detail.ids)}),this.container.addEventListener("event-emit-select-edit",e=>{this.startEdit(e.detail.id)}),this.container.addEventListener("event-emit-select-edit-back",()=>{this.stopEdit()}),this.container.addEventListener("event-emit-select-insert",e=>{let n=e.target.closest("[data-drag-content]").getAttribute("data-drag-content"),o=JSON.parse(n);window.$events.emit("editor::insert",{html:o["text/html"],markdown:o["text/plain"]})}),this.attachLinkButton.addEventListener("click",()=>{this.showSection("links")})}showSection(t){let e={links:this.linksContainer,edit:this.editContainer,list:this.listContainer};for(let[n,o]of Object.entries(e))o.toggleAttribute("hidden",n!==t)}reloadList(){this.stopEdit(),window.$http.get(`/attachments/get/page/${this.pageId}`).then(t=>{this.listPanel.innerHTML=t.data,window.$components.init(this.listPanel)})}updateOrder(t){window.$http.put(`/attachments/sort/page/${this.pageId}`,{order:t}).then(e=>{window.$events.emit("success",e.data.message)})}async startEdit(t){this.showSection("edit"),Tt(this.editContainer);let e=await window.$http.get(`/attachments/edit/${t}`);this.editContainer.innerHTML=e.data,window.$components.init(this.editContainer)}stopEdit(){this.showSection("list")}};var Se=class extends h{setup(){this.container=this.$el,this.fileLinks=this.$manyRefs.linkTypeFile,this.setupListeners()}setupListeners(){let t=e=>e.key==="Control"||e.key==="Meta";window.addEventListener("keydown",e=>{t(e)&&this.addOpenQueryToLinks()},{passive:!0}),window.addEventListener("keyup",e=>{t(e)&&this.removeOpenQueryFromLinks()},{passive:!0})}addOpenQueryToLinks(){for(let t of this.fileLinks)t.href.split("?")[1]!=="open=true"&&(t.href+="?open=true",t.setAttribute("target","_blank"))}removeOpenQueryFromLinks(){for(let t of this.fileLinks)t.href=t.href.split("?")[0],t.removeAttribute("target")}};var vt,ci,di,gt=class{constructor(t,e=null,n=null){Ji(this,vt);d(this,"containers");d(this,"onEscape");d(this,"onEnter");this.containers=[t],this.onEscape=e,this.onEnter=n,t.addEventListener("keydown",Jt(this,vt,ci).bind(this))}shareHandlingToEl(t){this.containers.push(t),t.addEventListener("keydown",Jt(this,vt,ci).bind(this))}focusNext(){let t=Jt(this,vt,di).call(this),e=document.activeElement,o=(ft(e)?t.indexOf(e):-1)+1;o>=t.length&&(o=0),t[o].focus()}focusPrevious(){let t=Jt(this,vt,di).call(this),e=document.activeElement,o=(ft(e)?t.indexOf(e):-1)-1;o<0&&(o=t.length-1),t[o].focus()}};vt=new WeakSet,ci=function(t){ft(t.target)&&t.target.matches("input")&&(t.key==="ArrowRight"||t.key==="ArrowLeft")||(t.key==="ArrowDown"||t.key==="ArrowRight"?(this.focusNext(),t.preventDefault()):t.key==="ArrowUp"||t.key==="ArrowLeft"?(this.focusPrevious(),t.preventDefault()):t.key==="Escape"?this.onEscape?this.onEscape(t):ft(document.activeElement)&&document.activeElement.blur():t.key==="Enter"&&this.onEnter&&this.onEnter(t))},di=function(){let t=[],e='[tabindex]:not([tabindex="-1"]),[href],button:not([tabindex="-1"],[disabled]),input:not([type=hidden])';for(let n of this.containers){let o=[...n.querySelectorAll(e)].filter(s=>ft(s));t.push(...o)}return t};var hi={},ke=class extends h{setup(){this.parent=this.$el.parentElement,this.container=this.$el,this.type=this.$opts.type,this.url=this.$opts.url,this.input=this.$refs.input,this.list=this.$refs.list,this.lastPopulated=0,this.setupListeners()}setupListeners(){new gt(this.list,()=>{this.input.focus(),setTimeout(()=>this.hideSuggestions(),1)},e=>{e.preventDefault();let n=e.target.textContent;n&&this.selectSuggestion(n)}).shareHandlingToEl(this.input),I(this.list,".text-item","click",(e,n)=>{this.selectSuggestion(n.textContent)}),this.input.addEventListener("input",this.requestSuggestions.bind(this)),this.input.addEventListener("focus",this.requestSuggestions.bind(this)),this.input.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this)),this.input.addEventListener("keydown",e=>{e.key==="Tab"&&this.hideSuggestions()})}selectSuggestion(t){this.input.value=t,this.lastPopulated=Date.now(),this.input.focus(),this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hideSuggestions()}async requestSuggestions(){if(Date.now()-this.lastPopulated<50)return;let t=this.getNameFilterIfNeeded(),e=this.input.value.toLowerCase(),o=(await this.loadSuggestions(e,t)).filter(s=>e===""||s.toLowerCase().startsWith(e)).slice(0,10);this.displaySuggestions(o)}getNameFilterIfNeeded(){return this.type!=="value"?null:this.parent.querySelector("input").value}async loadSuggestions(t,e=null){t=t.slice(0,4);let n={search:t,name:e},o=`${this.url}:${JSON.stringify(n)}`;if(hi[o])return hi[o];let s=await window.$http.get(this.url,n);return hi[o]=s.data,s.data}displaySuggestions(t){if(t.length===0){this.hideSuggestions();return}this.list.innerHTML=t.map(e=>`
  • ${Zi(e)}
  • `).join(""),this.list.style.display="block";for(let e of this.list.querySelectorAll(".text-item"))e.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this))}hideSuggestions(){this.list.style.display="none"}hideSuggestionsIfFocusedLost(t){this.container.contains(t.relatedTarget)||this.hideSuggestions()}};var $e=class extends h{setup(){this.form=this.$el,this.form.submit()}};var Me=class extends h{setup(){if(this.button=this.$el,this.targetElem=document.getElementById("header"),this.showing=!1,this.breakPoint=1200,document.body.classList.contains("flexbox")){this.button.style.display="none";return}this.button.addEventListener("click",this.scrollToTop.bind(this)),window.addEventListener("scroll",this.onPageScroll.bind(this))}onPageScroll(){let t=document.documentElement.scrollTop||document.body.scrollTop||0;!this.showing&&t>this.breakPoint?(this.button.style.display="block",this.showing=!0,setTimeout(()=>{this.button.style.opacity=.4},1)):this.showing&&t{this.button.style.display="none"},500))}scrollToTop(){let t=this.targetElem.getBoundingClientRect().top,e=document.documentElement.scrollTop?document.documentElement:document.body,n=300,o=Date.now(),s=this.targetElem.getBoundingClientRect().top;function r(){let a=1-(Date.now()-o)/n,l=Math.abs(a*s);a>0?(e.scrollTop=l,requestAnimationFrame(r.bind(this))):e.scrollTop=t}requestAnimationFrame(r.bind(this))}};function lo(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function rt(i){for(var t=1;t=0)&&(e[o]=i[o]);return e}function Ds(i,t){if(i==null)return{};var e=Ms(i,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(e[n]=i[n])}return e}function As(i){return Is(i)||Hs(i)||Bs(i)||Ps()}function Is(i){if(Array.isArray(i))return Ci(i)}function Hs(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Bs(i,t){if(i){if(typeof i=="string")return Ci(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ci(i,t)}}function Ci(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e"&&(t=t.substring(1)),i)try{if(i.matches)return i.matches(t);if(i.msMatchesSelector)return i.msMatchesSelector(t);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(t)}catch{return!1}return!1}}function Co(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function z(i,t,e,n){if(i){e=e||document;do{if(t!=null&&(t[0]===">"?i.parentNode===e&&qe(i,t):qe(i,t))||n&&i===e)return i;if(i===e)break}while(i=Co(i))}return null}var ho=/\s+/g;function P(i,t,e){if(i&&t)if(i.classList)i.classList[e?"add":"remove"](t);else{var n=(" "+i.className+" ").replace(ho," ").replace(" "+t+" "," ");i.className=(n+(e?" "+t:"")).replace(ho," ")}}function g(i,t,e){var n=i&&i.style;if(n){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(e=i.currentStyle),t===void 0?e:e[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=e+(typeof e=="string"?"":"px")}}function Mt(i,t){var e="";if(typeof i=="string")e=i;else do{var n=g(i,"transform");n&&n!=="none"&&(e=n+" "+e)}while(!t&&(i=i.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(e)}function Lo(i,t,e){if(i){var n=i.getElementsByTagName(t),o=0,s=n.length;if(e)for(;o=s:r=o<=s,!r)return n;if(n===st())break;n=yt(n,!1)}return!1}function _t(i,t,e,n){for(var o=0,s=0,r=i.children;s2&&arguments[2]!==void 0?arguments[2]:{},o=n.evt,s=Ds(n,Ws);ue.pluginEvent.bind(w)(t,e,rt({dragEl:m,parentEl:H,ghostEl:y,rootEl:D,nextEl:$t,lastDownEl:Oe,cloneEl:A,cloneHidden:bt,dragStarted:ie,putSortable:N,activeSortable:w.active,originalEvent:o,oldIndex:Ft,oldDraggableIndex:le,newIndex:Y,newDraggableIndex:wt,hideGhostForTarget:Do,unhideGhostForTarget:Ao,cloneNowHidden:function(){bt=!0},cloneNowShown:function(){bt=!1},dispatchSortableEvent:function(a){W({sortable:e,name:a,originalEvent:o})}},s))};function W(i){ne(rt({putSortable:N,cloneEl:A,targetEl:m,rootEl:D,oldIndex:Ft,oldDraggableIndex:le,newIndex:Y,newDraggableIndex:wt},i))}var m,H,y,D,$t,Oe,A,bt,Ft,Y,le,wt,De,N,Nt=!1,Ve=!1,We=[],St,tt,fi,gi,fo,go,ie,Rt,ce,de=!1,Ae=!1,Ne,_,vi=[],Li=!1,Ue=[],ze=typeof document<"u",Ie=ki,vo=he||dt?"cssFloat":"float",Us=ze&&!yo&&!ki&&"draggable"in document.createElement("div"),ko=function(){if(ze){if(dt)return!1;var i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}}(),$o=function(t,e){var n=g(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),s=_t(t,0,e),r=_t(t,1,e),a=s&&g(s),l=r&&g(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+M(s).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+M(r).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&a.float&&a.float!=="none"){var p=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===p)?"vertical":"horizontal"}return s&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=o&&n[vo]==="none"||r&&n[vo]==="none"&&c+u>o)?"vertical":"horizontal"},js=function(t,e,n){var o=n?t.left:t.top,s=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,c=n?e.width:e.height;return o===a||s===l||o+r/2===a+c/2},zs=function(t,e){var n;return We.some(function(o){var s=o[F].options.emptyInsertThreshold;if(!(!s||$i(o))){var r=M(o),a=t>=r.left-s&&t<=r.right+s,l=e>=r.top-s&&e<=r.bottom+s;if(a&&l)return n=o}}),n},Mo=function(t){function e(s,r){return function(a,l,c,u){var p=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(s==null&&(r||p))return!0;if(s==null||s===!1)return!1;if(r&&s==="clone")return s;if(typeof s=="function")return e(s(a,l,c,u),r)(a,l,c,u);var f=(r?a:l).options.group.name;return s===!0||typeof s=="string"&&s===f||s.join&&s.indexOf(f)>-1}}var n={},o=t.group;(!o||Re(o)!="object")&&(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Do=function(){!ko&&y&&g(y,"display","none")},Ao=function(){!ko&&y&&g(y,"display","")};ze&&!yo&&document.addEventListener("click",function(i){if(Ve)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),Ve=!1,!1},!0);var kt=function(t){if(m){t=t.touches?t.touches[0]:t;var e=zs(t.clientX,t.clientY);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[F]._onDragOver(n)}}},Ks=function(t){m&&m.parentNode[F]._isOutsideThisEl(t.target)};function w(i,t){if(!(i&&i.nodeType&&i.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(i));this.el=i,this.options=t=nt({},t),i[F]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(i.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return $o(i,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:w.supportPointer!==!1&&"PointerEvent"in window&&(!re||ki),emptyInsertThreshold:5};ue.initializePlugins(this,i,e);for(var n in e)!(n in t)&&(t[n]=e[n]);Mo(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:Us,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?C(i,"pointerdown",this._onTapStart):(C(i,"mousedown",this._onTapStart),C(i,"touchstart",this._onTapStart)),this.nativeDraggable&&(C(i,"dragover",this),C(i,"dragenter",this)),We.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),nt(this,_s())}w.prototype={constructor:w,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Rt=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,m):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,s=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=o.filter;if(er(n),!m&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&re&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=z(l,o.draggable,n,!1),!(l&&l.animated)&&Oe!==l)){if(Ft=R(l),le=R(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){W({sortable:e,rootEl:c,name:"filter",targetEl:l,toEl:n,fromEl:n}),U("filter",e,{evt:t}),s&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(p){if(p=z(c,p.trim(),n,!1),p)return W({sortable:e,rootEl:p,name:"filter",targetEl:l,fromEl:n,toEl:n}),U("filter",e,{evt:t}),!0}),u)){s&&t.preventDefault();return}o.handle&&!z(c,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o=this,s=o.el,r=o.options,a=s.ownerDocument,l;if(n&&!m&&n.parentNode===s){var c=M(n);if(D=s,m=n,H=m.parentNode,$t=m.nextSibling,Oe=n,De=r.group,w.dragged=m,St={target:m,clientX:(e||t).clientX,clientY:(e||t).clientY},fo=St.clientX-c.left,go=St.clientY-c.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,m.style["will-change"]="all",l=function(){if(U("delayEnded",o,{evt:t}),w.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!co&&o.nativeDraggable&&(m.draggable=!0),o._triggerDragStart(t,e),W({sortable:o,name:"choose",originalEvent:t}),P(m,r.chosenClass,!0)},r.ignore.split(",").forEach(function(u){Lo(m,u.trim(),wi)}),C(a,"dragover",kt),C(a,"mousemove",kt),C(a,"touchmove",kt),r.supportPointer?(C(a,"pointerup",o._onDrop),!this.nativeDraggable&&C(a,"pointercancel",o._onDrop)):(C(a,"mouseup",o._onDrop),C(a,"touchend",o._onDrop),C(a,"touchcancel",o._onDrop)),co&&this.nativeDraggable&&(this.options.touchStartThreshold=4,m.draggable=!0),U("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(he||dt))){if(w.eventCanceled){this._onDrop();return}r.supportPointer?(C(a,"pointerup",o._disableDelayedDrag),C(a,"pointercancel",o._disableDelayedDrag)):(C(a,"mouseup",o._disableDelayedDrag),C(a,"touchend",o._disableDelayedDrag),C(a,"touchcancel",o._disableDelayedDrag)),C(a,"mousemove",o._delayedDragTouchMoveHandler),C(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&C(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){m&&wi(m),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;E(t,"mouseup",this._disableDelayedDrag),E(t,"touchend",this._disableDelayedDrag),E(t,"touchcancel",this._disableDelayedDrag),E(t,"pointerup",this._disableDelayedDrag),E(t,"pointercancel",this._disableDelayedDrag),E(t,"mousemove",this._delayedDragTouchMoveHandler),E(t,"touchmove",this._delayedDragTouchMoveHandler),E(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?C(document,"pointermove",this._onTouchMove):e?C(document,"touchmove",this._onTouchMove):C(document,"mousemove",this._onTouchMove):(C(m,"dragend",this),C(D,"dragstart",this._onDragStart));try{document.selection?Fe(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Nt=!1,D&&m){U("dragStarted",this,{evt:e}),this.nativeDraggable&&C(document,"dragover",Ks);var n=this.options;!t&&P(m,n.dragClass,!1),P(m,n.ghostClass,!0),w.active=this,t&&this._appendGhost(),W({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(tt){this._lastX=tt.clientX,this._lastY=tt.clientY,Do();for(var t=document.elementFromPoint(tt.clientX,tt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(tt.clientX,tt.clientY),t!==e);)e=t;if(m.parentNode[F]._isOutsideThisEl(t),e)do{if(e[F]){var n=void 0;if(n=e[F]._onDragOver({clientX:tt.clientX,clientY:tt.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=Co(e));Ao()}},_onTouchMove:function(t){if(St){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,s=t.touches?t.touches[0]:t,r=y&&Mt(y,!0),a=y&&r&&r.a,l=y&&r&&r.d,c=Ie&&_&&po(_),u=(s.clientX-St.clientX+o.x)/(a||1)+(c?c[0]-vi[0]:0)/(a||1),p=(s.clientY-St.clientY+o.y)/(l||1)+(c?c[1]-vi[1]:0)/(l||1);if(!w.active&&!Nt){if(n&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))=0&&(W({rootEl:H,name:"add",toEl:H,fromEl:D,originalEvent:t}),W({sortable:this,name:"remove",toEl:H,originalEvent:t}),W({rootEl:H,name:"sort",toEl:H,fromEl:D,originalEvent:t}),W({sortable:this,name:"sort",toEl:H,originalEvent:t})),N&&N.save()):Y!==Ft&&Y>=0&&(W({sortable:this,name:"update",toEl:H,originalEvent:t}),W({sortable:this,name:"sort",toEl:H,originalEvent:t})),w.active&&((Y==null||Y===-1)&&(Y=Ft,wt=le),W({sortable:this,name:"end",toEl:H,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){U("nulling",this),D=m=H=y=$t=A=Oe=bt=St=tt=ie=Y=wt=Ft=le=Rt=ce=N=De=w.dragged=w.ghost=w.clone=w.active=null,Ue.forEach(function(t){t.checked=!0}),Ue.length=fi=gi=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":m&&(this._onDragOver(t),Xs(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,o=0,s=n.length,r=this.options;oo.right+s||i.clientY>n.bottom&&i.clientX>n.left:i.clientY>o.bottom+s||i.clientX>n.right&&i.clientY>n.top}function Zs(i,t,e,n,o,s,r,a){var l=n?i.clientY:i.clientX,c=n?e.height:e.width,u=n?e.top:e.left,p=n?e.bottom:e.right,f=!1;if(!r){if(a&&Neu+c*s/2:lp-Ne)return-ce}else if(l>u+c*(1-o)/2&&lp-c*s/2)?l>u+c/2?1:-1:0}function Qs(i){return R(m)1&&(b.forEach(function(a){s.addAnimationState({target:a,rect:j?M(a):r}),pi(a),a.fromRect=r,n.removeAnimationState(a)}),j=!1,ir(!this.options.removeCloneOnHide,o))},dragOverCompleted:function(e){var n=e.sortable,o=e.isOwner,s=e.insertion,r=e.activeSortable,a=e.parentEl,l=e.putSortable,c=this.options;if(s){if(o&&r._hideClone(),te=!1,c.animation&&b.length>1&&(j||!o&&!r.options.sort&&!l)){var u=M($,!1,!0,!0);b.forEach(function(f){f!==$&&(mo(f,u),a.appendChild(f))}),j=!0}if(!o)if(j||Pe(),b.length>1){var p=Be;r._showClone(n),r.options.animation&&!Be&&p&&G.forEach(function(f){r.addAnimationState({target:f,rect:ee}),f.fromRect=ee,f.thisAnimationDuration=null})}else r._showClone(n)}},dragOverAnimationCapture:function(e){var n=e.dragRect,o=e.isOwner,s=e.activeSortable;if(b.forEach(function(a){a.thisAnimationDuration=null}),s.options.animation&&!o&&s.multiDrag.isMultiDrag){ee=nt({},n);var r=Mt($,!0);ee.top-=r.f,ee.left-=r.e}},dragOverAnimationComplete:function(){j&&(j=!1,Pe())},drop:function(e){var n=e.originalEvent,o=e.rootEl,s=e.parentEl,r=e.sortable,a=e.dispatchSortableEvent,l=e.oldIndex,c=e.putSortable,u=c||this.sortable;if(n){var p=this.options,f=s.children;if(!Ot)if(p.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),P($,p.selectedClass,!~b.indexOf($)),~b.indexOf($))b.splice(b.indexOf($),1),Qt=null,ne({sortable:r,rootEl:o,name:"deselect",targetEl:$,originalEvent:n});else{if(b.push($),ne({sortable:r,rootEl:o,name:"select",targetEl:$,originalEvent:n}),n.shiftKey&&Qt&&r.el.contains(Qt)){var v=R(Qt),L=R($);~v&&~L&&v!==L&&function(){var x,k;L>v?(k=v,x=L):(k=L,x=v+1);for(var O=p.filter;k1){var S=M($),V=R($,":not(."+this.options.selectedClass+")");if(!te&&p.animation&&($.thisAnimationDuration=null),u.captureAnimationState(),!te&&(p.animation&&($.fromRect=S,b.forEach(function(x){if(x.thisAnimationDuration=null,x!==$){var k=j?M(x):S;x.fromRect=k,u.addAnimationState({target:x,rect:k})}})),Pe(),b.forEach(function(x){f[V]?s.insertBefore(x,f[V]):s.appendChild(x),V++}),l===R($))){var J=!1;b.forEach(function(x){if(x.sortableIndex!==R(x)){J=!0;return}}),J&&(a("update"),a("sort"))}b.forEach(function(x){pi(x)}),u.animateAll()}et=u}(o===s||c&&c.lastPutMode!=="clone")&&G.forEach(function(x){x.parentNode&&x.parentNode.removeChild(x)})}},nullingGlobal:function(){this.isMultiDrag=Ot=!1,G.length=0},destroyGlobal:function(){this._deselectMultiDrag(),E(document,"pointerup",this._deselectMultiDrag),E(document,"mouseup",this._deselectMultiDrag),E(document,"touchend",this._deselectMultiDrag),E(document,"keydown",this._checkKeyDown),E(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof Ot<"u"&&Ot)&&et===this.sortable&&!(e&&z(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;b.length;){var n=b[0];P(n,this.options.selectedClass,!1),b.shift(),ne({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:n,originalEvent:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},nt(i,{pluginName:"multiDrag",utils:{select:function(e){var n=e.parentNode[F];!n||!n.options.multiDrag||~b.indexOf(e)||(et&&et!==n&&(et.multiDrag._deselectMultiDrag(),et=n),P(e,n.options.selectedClass,!0),b.push(e))},deselect:function(e){var n=e.parentNode[F],o=b.indexOf(e);!n||!n.options.multiDrag||!~o||(P(e,n.options.selectedClass,!1),b.splice(o,1))}},eventProperties:function(){var e=this,n=[],o=[];return b.forEach(function(s){n.push({multiDragElement:s,index:s.sortableIndex});var r;j&&s!==$?r=-1:j?r=R(s,":not(."+e.options.selectedClass+")"):r=R(s),o.push({multiDragElement:s,index:r})}),{items:As(b),clones:[].concat(G),oldIndicies:n,newIndicies:o}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e==="ctrl"?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function ir(i,t){b.forEach(function(e,n){var o=t.children[e.sortableIndex+(i?Number(n):0)];o?t.insertBefore(e,o):t.appendChild(e)})}function bo(i,t){G.forEach(function(e,n){var o=t.children[e.sortableIndex+(i?Number(n):0)];o?t.insertBefore(e,o):t.appendChild(e)})}function Pe(){b.forEach(function(i){i!==$&&i.parentNode&&i.parentNode.removeChild(i)})}w.mount(new nr);w.mount(Ai,Di);var ht=w;var Bo={name(i,t){let e=i.getAttribute("data-name").trim().toLowerCase(),n=t.getAttribute("data-name").trim().toLowerCase();return e.localeCompare(n)},created(i,t){let e=Number(i.getAttribute("data-created"));return Number(t.getAttribute("data-created"))-e},updated(i,t){let e=Number(i.getAttribute("data-updated"));return Number(t.getAttribute("data-updated"))-e},chaptersFirst(i,t){let e=i.getAttribute("data-type"),n=t.getAttribute("data-type");return e===n?0:e==="chapter"?-1:1},chaptersLast(i,t){let e=i.getAttribute("data-type"),n=t.getAttribute("data-type");return e===n?0:e==="chapter"?1:-1}},Po={up:{active(i,t){return!(i.previousElementSibling===null&&!t)},run(i,t){(i.previousElementSibling||t).insertAdjacentElement("beforebegin",i)}},down:{active(i,t){return!(i.nextElementSibling===null&&!t)},run(i,t){(i.nextElementSibling||t).insertAdjacentElement("afterend",i)}},next_book:{active(i,t,e){return e.nextElementSibling!==null},run(i,t,e){e.nextElementSibling.querySelector("ul").prepend(i)}},prev_book:{active(i,t,e){return e.previousElementSibling!==null},run(i,t,e){e.previousElementSibling.querySelector("ul").appendChild(i)}},next_chapter:{active(i,t){return i.dataset.type==="page"&&this.getNextChapter(i,t)},run(i,t){this.getNextChapter(i,t).querySelector("ul").prepend(i)},getNextChapter(i,t){let e=t||i,n=Array.from(e.parentElement.children),o=n.indexOf(e);return n.slice(o+1).find(s=>s.dataset.type==="chapter")}},prev_chapter:{active(i,t){return i.dataset.type==="page"&&this.getPrevChapter(i,t)},run(i,t){this.getPrevChapter(i,t).querySelector("ul").append(i)},getPrevChapter(i,t){let e=t||i,n=Array.from(e.parentElement.children),o=n.indexOf(e);return n.slice(0,o).reverse().find(s=>s.dataset.type==="chapter")}},book_end:{active(i,t){return t||t===null&&i.nextElementSibling},run(i,t,e){e.querySelector("ul").append(i)}},book_start:{active(i,t){return t||t===null&&i.previousElementSibling},run(i,t,e){e.querySelector("ul").prepend(i)}},before_chapter:{active(i,t){return t},run(i,t){t.insertAdjacentElement("beforebegin",i)}},after_chapter:{active(i,t){return t},run(i,t){t.insertAdjacentElement("afterend",i)}}},Ke=class extends h{setup(){this.container=this.$el,this.sortContainer=this.$refs.sortContainer,this.input=this.$refs.input,ht.mount(new Ho);let t=this.container.querySelector(".sort-box");this.setupBookSortable(t),this.setupSortPresets(),this.setupMoveActions(),window.$events.listen("entity-select-change",this.bookSelect.bind(this))}setupMoveActions(){this.container.addEventListener("click",t=>{if(t.target.matches("[data-move]")){let e=t.target.getAttribute("data-move"),n=t.target.closest("[data-id]");this.runSortAction(n,e)}}),this.updateMoveActionStateForAll()}setupSortPresets(){let t="",e=!1,n=["name","created","updated"];this.sortContainer.addEventListener("click",o=>{let s=o.target.closest(".sort-box-options [data-sort]");if(!s)return;o.preventDefault();let r=s.closest(".sort-box").querySelectorAll("ul"),a=s.getAttribute("data-sort");e=t===a?!e:!1;let l=Bo[a];e&&n.includes(a)&&(l=function(u,p){return 0-Bo[a](u,p)});for(let c of r)Array.from(c.children).filter(p=>p.matches("li")).sort(l).forEach(p=>{c.appendChild(p)});t=a,this.updateMapInput()})}bookSelect(t){if(this.container.querySelector(`[data-type="book"][data-id="${t.id}"]`)!==null)return;let n=`${t.link}/sort-item`;window.$http.get(n).then(o=>{let s=Q(o.data);this.sortContainer.append(s),this.setupBookSortable(s),this.updateMoveActionStateForAll(),s.querySelector("summary").focus()})}setupBookSortable(t){let e=Array.from(t.querySelectorAll(".sort-list, .sortable-page-sublist")),n={name:"book",pull:["book","chapter"],put:["book","chapter"]},o={name:"chapter",pull:["book","chapter"],put(s,r,a){return a.getAttribute("data-type")==="page"}};for(let s of e)ht.create(s,{group:s.classList.contains("sort-list")?n:o,animation:150,fallbackOnBody:!0,swapThreshold:.65,onSort:()=>{this.ensureNoNestedChapters(),this.updateMapInput(),this.updateMoveActionStateForAll()},dragClass:"bg-white",ghostClass:"primary-background-light",multiDrag:!0,multiDragKey:"Control",selectedClass:"sortable-selected"})}ensureNoNestedChapters(){let t=this.container.querySelectorAll('[data-type="chapter"] [data-type="chapter"]');for(let e of t)e.parentElement.closest('[data-type="chapter"]').insertAdjacentElement("afterend",e)}updateMapInput(){let t=this.buildEntityMap();this.input.value=JSON.stringify(t)}buildEntityMap(){let t=[],e=this.container.querySelectorAll(".sort-list");for(let n of e){let o=n.closest('[data-type="book"]').getAttribute("data-id"),s=Array.from(n.children).filter(r=>r.matches('[data-type="page"], [data-type="chapter"]'));for(let r=0;r{for(let r of o)i.style.removeProperty(r);i.style.removeProperty("transition"),i.removeEventListener("transitionend",s),Xe.delete(i),n&&n()};setTimeout(()=>{i.style.transition=`all ease-in-out ${e}ms`;for(let r of o)i.style.setProperty(r,t[r][1]);i.addEventListener("transitionend",s),Xe.set(i,s)},15)}function me(i){Xe.has(i)&&Xe.get(i)()}function Ro(i,t=400,e=null){me(i),i.style.display="block",pe(i,{opacity:["0","1"]},t,()=>{e&&e()})}function Oo(i,t=400,e=null){me(i),pe(i,{opacity:["1","0"]},t,()=>{i.style.display="none",e&&e()})}function qt(i,t=400){me(i);let e=i.getBoundingClientRect().height,n=getComputedStyle(i),o=n.getPropertyValue("padding-top"),s=n.getPropertyValue("padding-bottom"),r={"max-height":[`${e}px`,"0px"],overflow:["hidden","hidden"],"padding-top":[o,"0px"],"padding-bottom":[s,"0px"]};pe(i,r,t,()=>{i.style.display="none"})}function Vt(i,t=400){me(i),i.style.display="block";let e=i.getBoundingClientRect().height,n=getComputedStyle(i),o=n.getPropertyValue("padding-top"),s=n.getPropertyValue("padding-bottom"),r={"max-height":["0px",`${e}px`],overflow:["hidden","hidden"],"padding-top":["0px",o],"padding-bottom":["0px",s]};pe(i,r,t)}function No(i,t=400){let e=i.getBoundingClientRect().height,n=getComputedStyle(i),o=n.getPropertyValue("padding-top"),s=n.getPropertyValue("padding-bottom");return()=>{me(i);let r=i.getBoundingClientRect().height,a=getComputedStyle(i),l=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-bottom"),u={height:[`${e}px`,`${r}px`],overflow:["hidden","hidden"],"padding-top":[o,l],"padding-bottom":[s,c]};pe(i,u,t)}}var Ge=class extends h{setup(){this.list=this.$refs.list,this.toggle=this.$refs.toggle,this.isOpen=this.toggle.classList.contains("open"),this.toggle.addEventListener("click",this.click.bind(this))}open(){this.toggle.classList.add("open"),this.toggle.setAttribute("aria-expanded","true"),Vt(this.list,180),this.isOpen=!0}close(){this.toggle.classList.remove("open"),this.toggle.setAttribute("aria-expanded","false"),qt(this.list,180),this.isOpen=!1}click(t){t.preventDefault(),this.isOpen?this.close():this.open()}};var Ye=class extends h{constructor(){super(...arguments);d(this,"editor",null);d(this,"saveCallback",null);d(this,"cancelCallback",null);d(this,"history",{});d(this,"historyKey","code_history")}setup(){this.container=this.$refs.container,this.popup=this.$el,this.editorInput=this.$refs.editor,this.languageButtons=this.$manyRefs.languageButton,this.languageOptionsContainer=this.$refs.languageOptionsContainer,this.saveButton=this.$refs.saveButton,this.languageInput=this.$refs.languageInput,this.historyDropDown=this.$refs.historyDropDown,this.historyList=this.$refs.historyList,this.favourites=new Set(this.$opts.favourites.split(",")),this.setupListeners(),this.setupFavourites()}setupListeners(){this.container.addEventListener("keydown",e=>{e.ctrlKey&&e.key==="Enter"&&this.save()}),T(this.languageButtons,e=>{let n=e.target.dataset.lang;this.languageInput.value=n,this.languageInputChange(n)}),Ht(this.languageInput,()=>this.save()),this.languageInput.addEventListener("input",()=>this.languageInputChange(this.languageInput.value)),T(this.saveButton,()=>this.save()),I(this.historyList,"button","click",(e,n)=>{e.preventDefault();let o=n.dataset.time;this.editor&&this.editor.setContent(this.history[o])})}setupFavourites(){for(let e of this.languageButtons)this.setupFavouritesForButton(e);this.sortLanguageList()}setupFavouritesForButton(e){let n=e.dataset.lang,o=this.favourites.has(n);e.setAttribute("data-favourite",o?"true":"false"),I(e.parentElement,".lang-option-favorite-toggle","click",()=>{o=!o,o?this.favourites.add(n):this.favourites.delete(n),e.setAttribute("data-favourite",o?"true":"false"),window.$http.patch("/preferences/update-code-language-favourite",{language:n,active:o}),this.sortLanguageList(),o&&e.scrollIntoView({block:"center",behavior:"smooth"})})}sortLanguageList(){let e=this.languageButtons.sort((n,o)=>{let s=n.dataset.favourite==="true",r=o.dataset.favourite==="true";return s&&!r?-1:r&&!s||n.dataset.lang>o.dataset.lang?1:-1}).map(n=>n.parentElement);for(let n of e)this.languageOptionsContainer.append(n)}save(){this.saveCallback&&this.saveCallback(this.editor.getContent(),this.languageInput.value),this.hide()}async open(e,n,o,s,r){this.languageInput.value=n,this.saveCallback=s,this.cancelCallback=r,await this.show(),this.languageInputChange(n),this.editor.setContent(e),this.setDirection(o)}async show(){let e=await window.importVersioned("code");this.editor||(this.editor=e.popupEditor(this.editorInput,this.languageInput.value)),this.loadHistory(),this.getPopup().show(()=>{this.editor.focus()},()=>{this.addHistory(),this.cancelCallback&&this.cancelCallback()})}setDirection(e){let n=this.editorInput.parentElement;e?n.setAttribute("dir",e):n.removeAttribute("dir")}hide(){this.getPopup().hide(),this.addHistory()}getPopup(){return window.$components.firstOnElement(this.popup,"popup")}async updateEditorMode(e){this.editor.setMode(e,this.editor.getContent())}languageInputChange(e){this.updateEditorMode(e);let n=e.toLowerCase();for(let o of this.languageButtons){let s=o.dataset.lang.toLowerCase().trim(),r=n===s;o.classList.toggle("active",r),r&&o.scrollIntoView({block:"center",behavior:"smooth"})}}loadHistory(){this.history=JSON.parse(window.sessionStorage.getItem(this.historyKey)||"{}");let e=Object.keys(this.history).reverse();this.historyDropDown.classList.toggle("hidden",e.length===0),this.historyList.innerHTML=e.map(n=>{let o=new Date(parseInt(n,10)).toLocaleTimeString();return`
  • `}).join("")}addHistory(){if(!this.editor)return;let e=this.editor.getContent();if(!e)return;let n=Object.keys(this.history).pop();if(this.history[n]===e)return;this.history[String(Date.now())]=e;let o=JSON.stringify(this.history);window.sessionStorage.setItem(this.historyKey,o)}};var Je=class extends h{setup(){let t=this.$el;t.querySelectorAll("pre").length>0&&window.importVersioned("code").then(n=>{n.highlightWithin(t)})}};var Ze=class extends h{async setup(){let{mode:t}=this.$opts;(await window.importVersioned("code")).inlineEditor(this.$el,t)}};var Qe=class extends h{setup(){this.container=this.$el,this.trigger=this.$refs.trigger,this.content=this.$refs.content,this.trigger&&(this.trigger.addEventListener("click",this.toggle.bind(this)),this.openIfContainsError())}open(){this.container.classList.add("open"),this.trigger.setAttribute("aria-expanded","true"),Vt(this.content,300)}close(){this.container.classList.remove("open"),this.trigger.setAttribute("aria-expanded","false"),qt(this.content,300)}toggle(){this.container.classList.contains("open")?this.close():this.open()}openIfContainsError(){this.content.querySelector(".text-neg.text-small")&&this.open()}};var tn=class extends h{setup(){this.container=this.$el,this.confirmButton=this.$refs.confirm,this.res=null,T(this.confirmButton,()=>{this.sendResult(!0),this.getPopup().hide()})}show(){return this.getPopup().show(null,()=>{this.sendResult(!1)}),new Promise(t=>{this.res=t})}getPopup(){return window.$components.firstOnElement(this.container,"popup")}sendResult(t){this.res&&(this.res(t),this.res=null)}};var en=class extends h{setup(){this.container=this.$el,this.checkbox=this.container.querySelector("input[type=checkbox]"),this.display=this.container.querySelector('[role="checkbox"]'),this.checkbox.addEventListener("change",this.stateChange.bind(this)),this.container.addEventListener("keydown",this.onKeyDown.bind(this))}onKeyDown(t){(t.key===" "||t.key==="Enter")&&(t.preventDefault(),this.toggle())}toggle(){this.checkbox.checked=!this.checkbox.checked,this.checkbox.dispatchEvent(new Event("change")),this.stateChange()}stateChange(){let t=this.checkbox.checked?"true":"false";this.display.setAttribute("aria-checked",t)}};var nn=class extends h{setup(){this.container=this.$el,this.dealtWith=!1,this.container.addEventListener("toggle",this.onToggle.bind(this))}onToggle(){this.dealtWith||(this.container.querySelector("pre")&&window.importVersioned("code").then(t=>{t.highlightWithin(this.container)}),this.dealtWith=!0)}};var on=class extends h{setup(){this.container=this.$el,this.menu=this.$refs.menu,this.toggle=this.$refs.toggle,this.moveMenu=this.$opts.moveMenu,this.bubbleEscapes=this.$opts.bubbleEscapes==="true",this.direction=document.dir==="rtl"?"right":"left",this.body=document.body,this.showing=!1,this.hide=this.hide.bind(this),this.setupListeners()}show(t=null){this.hideAll(),this.menu.style.display="block",this.menu.classList.add("anim","menuIn"),this.toggle.setAttribute("aria-expanded","true");let e=this.menu.getBoundingClientRect(),n=0,o=this.toggle.getBoundingClientRect().height,s=ao(this.menu).getBoundingClientRect(),r=e.bottom>s.bottom,a=this.container.getBoundingClientRect();if(this.moveMenu&&(this.body.appendChild(this.menu),this.menu.style.position="fixed",this.menu.style.width=`${e.width}px`,this.menu.style.left=`${e.left}px`,r?n=window.innerHeight-e.top-o/2:n=e.top),r){this.menu.style.top="initial",this.menu.style.bottom=`${n}px`;let u=window.innerHeight-40-(window.innerHeight-a.bottom);this.menu.style.maxHeight=`${Math.floor(u)}px`}else{this.menu.style.top=`${n}px`,this.menu.style.bottom="initial";let u=window.innerHeight-40-a.top;this.menu.style.maxHeight=`${Math.floor(u)}px`}this.menu.addEventListener("mouseleave",this.hide),window.addEventListener("click",u=>{this.menu.contains(u.target)||this.hide()});let l=this.menu.querySelector("input");l!==null&&l.focus(),this.showing=!0;let c=new Event("show");this.container.dispatchEvent(c),t&&t.stopPropagation()}hideAll(){for(let t of window.$components.get("dropdown"))t.hide()}hide(){this.menu.style.display="none",this.menu.classList.remove("anim","menuIn"),this.toggle.setAttribute("aria-expanded","false"),this.menu.style.top="",this.menu.style.bottom="",this.menu.style.maxHeight="",this.moveMenu&&(this.menu.style.position="",this.menu.style[this.direction]="",this.menu.style.width="",this.menu.style.left="",this.container.appendChild(this.menu)),this.showing=!1}setupListeners(){let t=new gt(this.container,e=>{this.hide(),this.toggle.focus(),this.bubbleEscapes||e.stopPropagation()},e=>{e.target.nodeName==="INPUT"&&(e.preventDefault(),e.stopPropagation()),this.hide()});this.moveMenu&&t.shareHandlingToEl(this.menu),this.container.addEventListener("click",e=>{Array.from(this.menu.querySelectorAll("a")).includes(e.target)&&this.hide()}),T(this.toggle,e=>{e.stopPropagation(),e.preventDefault(),this.show(e),e instanceof KeyboardEvent&&t.focusNext()})}};var sn=class extends h{setup(){this.elem=this.$el,this.searchInput=this.$refs.searchInput,this.loadingElem=this.$refs.loading,this.listContainerElem=this.$refs.listContainer,this.localSearchSelector=this.$opts.localSearchSelector,this.url=this.$opts.url,this.elem.addEventListener("show",this.onShow.bind(this)),this.searchInput.addEventListener("input",this.onSearch.bind(this)),this.runAjaxSearch=mt(this.runAjaxSearch,300,!1)}onShow(){this.loadList()}onSearch(){let t=this.searchInput.value.toLowerCase().trim();this.localSearchSelector?this.runLocalSearch(t):(this.toggleLoading(!0),this.listContainerElem.innerHTML="",this.runAjaxSearch(t))}runAjaxSearch(t){this.loadList(t)}runLocalSearch(t){let e=this.listContainerElem.querySelectorAll(this.localSearchSelector);for(let n of e){let o=!t||n.textContent.toLowerCase().includes(t);n.style.display=o?"flex":"none",n.classList.toggle("hidden",!o)}}async loadList(t=""){this.listContainerElem.innerHTML="",this.toggleLoading(!0);try{let e=await window.$http.get(this.getAjaxUrl(t)),n=No(this.listContainerElem,80);this.listContainerElem.innerHTML=e.data,n()}catch(e){console.error(e)}this.toggleLoading(!1),this.localSearchSelector&&this.onSearch()}getAjaxUrl(t=null){if(!t)return this.url;let e=this.url.includes("?")?"&":"?";return`${this.url}${e}search=${encodeURIComponent(t)}`}toggleLoading(t=!1){this.loadingElem.style.display=t?"block":"none"}};var Wt=class{constructor(t){d(this,"data");this.data=t}hasItems(){return!!this.data&&!!this.data.types&&this.data.types.length>0}containsTabularData(){let t=this.data.getData("text/rtf");return!!t&&t.includes("\\trowd")}getImages(){return this.getFiles().filter(t=>t.type.includes("image"))}getFiles(){let{files:t}=this.data;return[...t]}};async function Ii(i){if(window.isSecureContext&&navigator.clipboard){await navigator.clipboard.writeText(i);return}let t=document.createElement("textarea");t.setAttribute("style","position: absolute; left: -1000px; top: -1000px;"),t.value=i,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}var rn=class extends h{setup(){this.container=this.$el,this.statusArea=this.$refs.statusArea,this.dropTarget=this.$refs.dropTarget,this.selectButtons=this.$manyRefs.selectButton||[],this.isActive=!0,this.url=this.$opts.url,this.method=(this.$opts.method||"post").toUpperCase(),this.successMessage=this.$opts.successMessage,this.errorMessage=this.$opts.errorMessage,this.uploadLimitMb=Number(this.$opts.uploadLimit),this.uploadLimitMessage=this.$opts.uploadLimitMessage,this.zoneText=this.$opts.zoneText,this.fileAcceptTypes=this.$opts.fileAccept,this.allowMultiple=this.$opts.allowMultiple==="true",this.setupListeners()}toggleActive(t){this.isActive=t}setupListeners(){T(this.selectButtons,this.manualSelectHandler.bind(this)),this.setupDropTargetHandlers()}setupDropTargetHandlers(){let t=0,e=()=>{this.hideOverlay(),t=0};this.dropTarget.addEventListener("dragenter",n=>{n.preventDefault(),t+=1,t===1&&this.isActive&&this.showOverlay()}),this.dropTarget.addEventListener("dragover",n=>{n.preventDefault()}),this.dropTarget.addEventListener("dragend",e),this.dropTarget.addEventListener("dragleave",()=>{t-=1,t===0&&e()}),this.dropTarget.addEventListener("drop",n=>{if(n.preventDefault(),e(),!this.isActive)return;let s=new Wt(n.dataTransfer).getFiles();for(let r of s)this.createUploadFromFile(r)})}manualSelectHandler(){let t=ot("input",{type:"file",style:"left: -400px; visibility: hidden; position: fixed;",accept:this.fileAcceptTypes,multiple:this.allowMultiple?"":null});this.container.append(t),t.click(),t.addEventListener("change",()=>{for(let e of t.files)this.createUploadFromFile(e);t.remove()})}showOverlay(){if(!this.dropTarget.querySelector(".dropzone-overlay")){let e=ot("div",{class:"dropzone-overlay"},[this.zoneText]);this.dropTarget.append(e)}}hideOverlay(){let t=this.dropTarget.querySelector(".dropzone-overlay");t&&t.remove()}createUploadFromFile(t){let{dom:e,status:n,progress:o,dismiss:s}=this.createDomForFile(t);this.statusArea.append(e);let r=this,a={file:t,dom:e,updateProgress(l){o.textContent=`${l}%`,o.style.width=`${l}%`},markError(l){n.setAttribute("data-status","error"),n.textContent=l,Zt(e),this.updateProgress(100)},markSuccess(l){n.setAttribute("data-status","success"),n.textContent=l,Zt(e),setTimeout(s,2400),r.$emit("upload-success",{name:t.name})}};return t.size>this.uploadLimitMb*1e6?(a.markError(this.uploadLimitMessage),a):(this.startXhrForUpload(a),a)}startXhrForUpload(t){let e=new FormData;e.append("file",t.file,t.file.name),this.method!=="POST"&&e.append("_method",this.method);let n=this,o=window.$http.createXMLHttpRequest("POST",this.url,{error(){t.markError(n.errorMessage)},readystatechange(){this.readyState===XMLHttpRequest.DONE&&this.status===200?t.markSuccess(n.successMessage):this.readyState===XMLHttpRequest.DONE&&this.status>=400&&t.markError(window.$http.formatErrorResponseText(this.responseText))}});o.upload.addEventListener("progress",s=>{let r=Math.min(Math.ceil(s.loaded/s.total*100),100);t.updateProgress(r)}),o.setRequestHeader("Accept","application/json"),o.send(e)}createDomForFile(t){let e=ot("img",{src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.224 7.373a.924.924 0 0 0-.92.925l-.006 7.404c0 .509.412.925.921.925h5.557a.928.928 0 0 0 .926-.925v-5.553l-2.777-2.776Zm3.239 3.239V8.067l2.545 2.545z' style='fill:%23000;fill-opacity:.75'/%3E%3C/svg%3E"}),n=ot("div",{class:"dropzone-file-item-status"},[]),o=ot("div",{class:"dropzone-file-item-progress"}),s=ot("div",{class:"dropzone-file-item-image-wrap"},[e]),r=ot("div",{class:"dropzone-file-item"},[s,ot("div",{class:"dropzone-file-item-text-wrap"},[ot("div",{class:"dropzone-file-item-label"},[t.name]),Bt(),n]),o]);t.type.startsWith("image/")&&(e.src=URL.createObjectURL(t));let a=()=>{r.classList.add("dismiss"),r.addEventListener("animationend",()=>{r.remove()})};return r.addEventListener("click",a),{dom:r,progress:o,status:n,dismiss:a}}};var an=class extends h{constructor(){super(...arguments);d(this,"container");d(this,"buttons");d(this,"contentElements");d(this,"toggleButton");d(this,"editorWrapEl");d(this,"open",!1);d(this,"tab","")}setup(){this.container=this.$el,this.buttons=this.$manyRefs.tabButton,this.contentElements=this.$manyRefs.tabContent,this.toggleButton=this.$refs.toggle,this.editorWrapEl=this.container.closest(".page-editor"),this.setupListeners(),this.setActiveTab(this.contentElements[0].dataset.tabContent||"")}setupListeners(){this.toggleButton.addEventListener("click",()=>this.toggle()),this.container.addEventListener("click",e=>{let n=e.target.closest("button");if(n instanceof HTMLButtonElement&&this.buttons.includes(n)){let o=n.dataset.tab||"";this.setActiveTab(o,!0)}})}toggle(){this.container.classList.toggle("open");let e=this.container.classList.contains("open");this.toggleButton.setAttribute("aria-expanded",e?"true":"false"),this.editorWrapEl.classList.toggle("toolbox-open",e),this.open=e,this.emitState()}setActiveTab(e,n=!1){for(let o of this.buttons)o.classList.remove("active"),o.dataset.tab===e&&o.classList.add("active");for(let o of this.contentElements)o.style.display="none",o.dataset.tabContent===e&&(o.style.display="block");n&&!this.container.classList.contains("open")&&this.toggle(),this.tab=e,this.emitState()}emitState(){let e={tab:this.tab,open:this.open};this.$emit("change",e)}};var ln=class extends h{setup(){this.container=this.$el,this.entityType=this.$opts.entityType,this.everyoneInheritToggle=this.$refs.everyoneInherit,this.roleSelect=this.$refs.roleSelect,this.roleContainer=this.$refs.roleContainer,this.setupListeners()}setupListeners(){this.everyoneInheritToggle.addEventListener("change",t=>{let e=t.target.checked,n=document.querySelectorAll('input[name^="permissions[0]["]');for(let o of n)o.disabled=e,o.checked=!1}),this.container.addEventListener("click",t=>{let e=t.target.closest("button");e&&e.dataset.roleId&&this.removeRowOnButtonClick(e)}),this.roleSelect.addEventListener("change",()=>{let t=this.roleSelect.value;t&&this.addRoleRow(t)})}async addRoleRow(t){this.roleSelect.disabled=!0;let e=this.roleSelect.querySelector(`option[value="${t}"]`);e&&e.remove();let n=await window.$http.get(`/permissions/form-row/${this.entityType}/${t}`),o=Q(n.data);this.roleContainer.append(o),this.roleSelect.disabled=!1}removeRowOnButtonClick(t){let e=t.closest(".item-list-row"),{roleId:n}=t.dataset,{roleName:o}=t.dataset,s=document.createElement("option");s.value=n,s.textContent=o,this.roleSelect.append(s),e.remove()}};var cn=class extends h{setup(){this.entityId=this.$opts.entityId,this.entityType=this.$opts.entityType,this.contentView=this.$refs.contentView,this.searchView=this.$refs.searchView,this.searchResults=this.$refs.searchResults,this.searchInput=this.$refs.searchInput,this.searchForm=this.$refs.searchForm,this.clearButton=this.$refs.clearButton,this.loadingBlock=this.$refs.loadingBlock,this.setupListeners()}setupListeners(){this.searchInput.addEventListener("change",this.runSearch.bind(this)),this.searchForm.addEventListener("submit",t=>{t.preventDefault(),this.runSearch()}),T(this.clearButton,this.clearSearch.bind(this))}runSearch(){let t=this.searchInput.value.trim();if(t.length===0){this.clearSearch();return}this.searchView.classList.remove("hidden"),this.contentView.classList.add("hidden"),this.loadingBlock.classList.remove("hidden");let e=window.baseUrl(`/search/${this.entityType}/${this.entityId}`);window.$http.get(e,{term:t}).then(n=>{this.searchResults.innerHTML=n.data}).catch(console.error).then(()=>{this.loadingBlock.classList.add("hidden")})}clearSearch(){this.searchView.classList.add("hidden"),this.contentView.classList.remove("hidden"),this.loadingBlock.classList.add("hidden"),this.searchInput.value=""}};var dn=class extends h{constructor(){super(...arguments);d(this,"elem");d(this,"input");d(this,"searchInput");d(this,"loading");d(this,"resultsContainer");d(this,"searchOptions");d(this,"search","");d(this,"lastClick",0)}setup(){this.elem=this.$el,this.input=this.$refs.input,this.searchInput=this.$refs.search,this.loading=this.$refs.loading,this.resultsContainer=this.$refs.results,this.searchOptions={entityTypes:this.$opts.entityTypes||"page,book,chapter",entityPermission:this.$opts.entityPermission||"view",searchEndpoint:this.$opts.searchEndpoint||"",initialValue:this.searchInput.value||""},this.setupListeners(),this.showLoading(),this.searchOptions.searchEndpoint&&this.initialLoad()}configureSearchOptions(e){Object.assign(this.searchOptions,e),this.reset(),this.searchInput.value=this.searchOptions.initialValue}setupListeners(){this.elem.addEventListener("click",this.onClick.bind(this));let e=0;this.searchInput.addEventListener("input",()=>{e=Date.now(),this.showLoading(),setTimeout(()=>{Date.now()-e<199||this.searchEntities(this.searchInput.value)},200)}),this.searchInput.addEventListener("keydown",n=>{n.keyCode===13&&n.preventDefault()}),I(this.$el,"[data-entity-type]","keydown",n=>{if(n.ctrlKey&&n.code==="Enter"){let o=this.$el.closest("form");if(o){o.submit(),n.preventDefault();return}}n.code==="ArrowDown"&&this.focusAdjacent(!0),n.code==="ArrowUp"&&this.focusAdjacent(!1)}),this.searchInput.addEventListener("keydown",n=>{n.code==="ArrowDown"&&this.focusAdjacent(!0)})}focusAdjacent(e=!0){let n=Array.from(this.resultsContainer.querySelectorAll("[data-entity-type]")),o=n.indexOf(document.activeElement),s=n[o+(e?1:-1)]||n[0];s instanceof HTMLElement&&s.focus()}reset(){this.searchInput.value="",this.showLoading(),this.initialLoad()}focusSearch(){this.searchInput.focus()}showLoading(){this.loading.style.display="block",this.resultsContainer.style.display="none"}hideLoading(){this.loading.style.display="none",this.resultsContainer.style.display="block"}initialLoad(){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");if(this.searchOptions.initialValue){this.searchEntities(this.searchOptions.initialValue);return}window.$http.get(this.searchUrl()).then(e=>{this.resultsContainer.innerHTML=e.data,this.hideLoading()})}searchUrl(){let e=`types=${encodeURIComponent(this.searchOptions.entityTypes)}&permission=${encodeURIComponent(this.searchOptions.entityPermission)}`;return`${this.searchOptions.searchEndpoint}?${e}`}searchEntities(e){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");this.input.value="";let n=`${this.searchUrl()}&term=${encodeURIComponent(e)}`;window.$http.get(n).then(o=>{this.resultsContainer.innerHTML=o.data,this.hideLoading()})}isDoubleClick(){let e=Date.now(),n=e-this.lastClick<300;return this.lastClick=e,n}onClick(e){let n=e.target.closest("[data-entity-type]");n instanceof HTMLElement&&(e.preventDefault(),e.stopPropagation(),this.selectItem(n))}selectItem(e){let n=this.isDoubleClick(),o=e.getAttribute("data-entity-type"),s=e.getAttribute("data-entity-id"),r=!e.classList.contains("selected")||n;this.unselectAll(),this.input.value=r?`${o}:${s}`:"";let a=e.getAttribute("href")||"",l=e.querySelector(".entity-list-item-name")?.textContent||"",c={id:Number(s),name:l,link:a};r?e.classList.add("selected"):window.$events.emit("entity-select-change"),!(!n&&!r)&&(n&&this.confirmSelection(c),r&&window.$events.emit("entity-select-change",c))}confirmSelection(e){window.$events.emit("entity-select-confirm",e)}unselectAll(){let e=this.elem.querySelectorAll(".selected");for(let n of e)n.classList.remove("selected","primary-background")}};var hn=class extends h{constructor(){super(...arguments);d(this,"container");d(this,"selectButton");d(this,"selectorEl");d(this,"callback",null);d(this,"selection",null)}setup(){this.container=this.$el,this.selectButton=this.$refs.select,this.selectorEl=this.$refs.selector,this.selectButton.addEventListener("click",this.onSelectButtonClick.bind(this)),window.$events.listen("entity-select-change",this.onSelectionChange.bind(this)),window.$events.listen("entity-select-confirm",this.handleConfirmedSelection.bind(this))}show(e,n={}){this.callback=e,this.getSelector().configureSearchOptions(n),this.getPopup().show(),this.getSelector().focusSearch()}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.container,"popup")}getSelector(){return window.$components.firstOnElement(this.selectorEl,"entity-selector")}onSelectButtonClick(){this.handleConfirmedSelection(this.selection)}onSelectionChange(e){this.selection=e.hasOwnProperty("id")?e:null,this.selection?this.selectButton.removeAttribute("disabled"):this.selectButton.setAttribute("disabled","true")}handleConfirmedSelection(e){this.hide(),this.getSelector().reset(),this.callback&&e&&this.callback(e)}};var un=class extends h{setup(){this.container=this.$el,this.name=this.$opts.name,T(this.$el,()=>{this.$emit(this.name,this.$opts)})}};var pn=class extends h{setup(){this.targetSelector=this.$opts.targetSelector,this.isOpen=this.$opts.isOpen==="true",this.updateEndpoint=this.$opts.updateEndpoint,this.$el.addEventListener("click",this.click.bind(this))}open(t){Vt(t,200)}close(t){qt(t,200)}click(t){t.preventDefault();let e=document.querySelectorAll(this.targetSelector);for(let n of e)(this.isOpen?this.close:this.open)(n);this.isOpen=!this.isOpen,this.updateSystemAjax(this.isOpen)}updateSystemAjax(t){window.$http.patch(this.updateEndpoint,{expand:t?"true":"false"})}};var mn=class extends h{setup(){this.container=this.$el,this.input=this.$refs.input,this.suggestions=this.$refs.suggestions,this.suggestionResultsWrap=this.$refs.suggestionResults,this.loadingWrap=this.$refs.loading,this.button=this.$refs.button,this.setupListeners()}setupListeners(){let t=mt(this.updateSuggestions.bind(this),200,!1);this.input.addEventListener("input",()=>{let{value:e}=this.input;e.length>0?(this.loadingWrap.style.display="block",this.suggestionResultsWrap.style.opacity="0.5",t(e)):this.hideSuggestions()}),this.input.addEventListener("dblclick",()=>{this.input.setAttribute("autocomplete","on"),this.button.focus(),this.input.focus()}),new gt(this.container,()=>{this.hideSuggestions()})}async updateSuggestions(t){let{data:e}=await window.$http.get("/search/suggest",{term:t});if(!this.input.value)return;let n=Q(e);this.suggestionResultsWrap.innerHTML="",this.suggestionResultsWrap.style.opacity="1",this.loadingWrap.style.display="none",this.suggestionResultsWrap.append(n),this.container.classList.contains("search-active")||this.showSuggestions()}showSuggestions(){this.container.classList.add("search-active"),window.requestAnimationFrame(()=>{this.suggestions.classList.add("search-suggestions-animation")})}hideSuggestions(){this.container.classList.remove("search-active"),this.suggestions.classList.remove("search-suggestions-animation"),this.suggestionResultsWrap.innerHTML=""}};var fn=class extends h{setup(){this.elem=this.$el,this.toggleButton=this.$refs.toggle,this.menu=this.$refs.menu,this.open=!1,this.toggleButton.addEventListener("click",this.onToggle.bind(this)),this.onWindowClick=this.onWindowClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}onToggle(t){this.open=!this.open,this.menu.classList.toggle("show",this.open),this.toggleButton.setAttribute("aria-expanded",this.open?"true":"false"),this.open?(this.elem.addEventListener("keydown",this.onKeyDown),window.addEventListener("click",this.onWindowClick)):(this.elem.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("click",this.onWindowClick)),t.stopPropagation()}onKeyDown(t){t.code==="Escape"&&this.onToggle(t)}onWindowClick(t){this.onToggle(t)}};var gn=class extends h{setup(){this.uploadedTo=this.$opts.uploadedTo,this.container=this.$el,this.popupEl=this.$refs.popup,this.searchForm=this.$refs.searchForm,this.searchInput=this.$refs.searchInput,this.cancelSearch=this.$refs.cancelSearch,this.listContainer=this.$refs.listContainer,this.filterTabs=this.$manyRefs.filterTabs,this.selectButton=this.$refs.selectButton,this.uploadButton=this.$refs.uploadButton,this.uploadHint=this.$refs.uploadHint,this.formContainer=this.$refs.formContainer,this.formContainerPlaceholder=this.$refs.formContainerPlaceholder,this.dropzoneContainer=this.$refs.dropzoneContainer,this.loadMore=this.$refs.loadMore,this.type="gallery",this.lastSelected={},this.lastSelectedTime=0,this.callback=null,this.resetState=()=>{this.hasData=!1,this.page=1,this.filter="all"},this.resetState(),this.setupListeners()}setupListeners(){T(this.filterTabs,n=>{this.resetAll(),this.filter=n.target.dataset.filter,this.setActiveFilterTab(this.filter),this.loadGallery()}),this.searchForm.addEventListener("submit",n=>{this.resetListView(),this.loadGallery(),this.cancelSearch.toggleAttribute("hidden",!this.searchInput.value),n.preventDefault()}),T(this.cancelSearch,()=>{this.resetListView(),this.resetSearchView(),this.loadGallery()}),I(this.container,".load-more button","click",this.runLoadMore.bind(this)),this.listContainer.addEventListener("event-emit-select-image",this.onImageSelectEvent.bind(this)),this.listContainer.addEventListener("error",n=>{n.target.src=window.baseUrl("loading_error.png")},!0),T(this.selectButton,()=>{this.callback&&this.callback(this.lastSelected),this.hide()}),I(this.formContainer,"#image-manager-delete","click",()=>{this.lastSelected&&this.loadImageEditForm(this.lastSelected.id,!0)}),I(this.formContainer,"#image-manager-rebuild-thumbs","click",async(n,o)=>{o.disabled=!0,this.lastSelected&&await this.rebuildThumbnails(this.lastSelected.id),o.disabled=!1}),this.formContainer.addEventListener("ajax-form-success",()=>{this.refreshGallery(),this.resetEditForm()}),this.container.addEventListener("dropzone-upload-success",this.refreshGallery.bind(this));let t=this.listContainer.parentElement,e=[];t.addEventListener("wheel",n=>{if(!(Math.ceil(t.scrollHeight-t.scrollTop)===t.clientHeight)||n.deltaY<1)return;let r=Date.now()-1e3;e.push(Date.now()),e=e.filter(a=>a>=r),e.length>5&&this.canLoadMore()&&this.runLoadMore()})}show(t,e="gallery"){this.resetAll(),this.callback=t,this.type=e,this.getPopup().show();let n=e!=="gallery";this.dropzoneContainer.classList.toggle("hidden",n),this.uploadButton.classList.toggle("hidden",n),this.uploadHint.classList.toggle("hidden",n),window.$components.firstOnElement(this.container,"dropzone").toggleActive(!n),this.hasData||(this.loadGallery(),this.hasData=!0)}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.popupEl,"popup")}async loadGallery(){let t={page:this.page,search:this.searchInput.value||null,uploaded_to:this.uploadedTo,filter_type:this.filter==="all"?null:this.filter},{data:e}=await window.$http.get(`images/${this.type}`,t);t.page===1&&(this.listContainer.innerHTML=""),this.addReturnedHtmlElementsToList(e),Zt(this.listContainer)}addReturnedHtmlElementsToList(t){let e=document.createElement("div");e.innerHTML=t;let n=e.querySelector(".load-more");n&&(n.remove(),this.loadMore.innerHTML=n.innerHTML),this.loadMore.toggleAttribute("hidden",!n),window.$components.init(e);for(let o of[...e.children])this.listContainer.appendChild(o)}setActiveFilterTab(t){for(let e of this.filterTabs){let n=e.dataset.filter===t;e.setAttribute("aria-selected",n?"true":"false")}}resetAll(){this.resetState(),this.resetListView(),this.resetSearchView(),this.resetEditForm(),this.setActiveFilterTab("all"),this.selectButton.classList.add("hidden")}resetSearchView(){this.searchInput.value="",this.cancelSearch.toggleAttribute("hidden",!0)}resetEditForm(){this.formContainer.innerHTML="",this.formContainerPlaceholder.removeAttribute("hidden")}resetListView(){Tt(this.listContainer),this.page=1}refreshGallery(){this.resetListView(),this.loadGallery()}async onImageSelectEvent(t){let e=JSON.parse(t.detail.data),n=e&&e.id===this.lastSelected.id&&Date.now()-this.lastSelectedTime<400,o=t.target.classList.contains("selected");[...this.listContainer.querySelectorAll(".selected")].forEach(s=>{s.classList.remove("selected")}),!o&&!n?(t.target.classList.add("selected"),e=await this.loadImageEditForm(e.id)):n?n&&(e=this.lastSelected):this.resetEditForm(),this.selectButton.classList.toggle("hidden",o),n&&this.callback&&(this.callback(e),this.hide()),this.lastSelected=e,this.lastSelectedTime=Date.now()}async loadImageEditForm(t,e=!1){e||(this.formContainer.innerHTML="");let n=e?{delete:!0}:{},{data:o}=await window.$http.get(`/images/edit/${t}`,n);this.formContainer.innerHTML=o,this.formContainerPlaceholder.setAttribute("hidden",""),window.$components.init(this.formContainer);let s=this.formContainer.querySelector("#image-manager-form-image-data");return JSON.parse(s.text)}runLoadMore(){Tt(this.loadMore),this.page+=1,this.loadGallery()}canLoadMore(){return this.loadMore.querySelector("button")&&!this.loadMore.hasAttribute("hidden")}async rebuildThumbnails(t){try{let e=await window.$http.put(`/images/${t}/rebuild-thumbnails`);window.$events.success(e.data),this.refreshGallery()}catch(e){window.$events.showResponseError(e)}}};var vn=class extends h{setup(){this.imageElem=this.$refs.image,this.imageInput=this.$refs.imageInput,this.resetInput=this.$refs.resetInput,this.removeInput=this.$refs.removeInput,this.resetButton=this.$refs.resetButton,this.removeButton=this.$refs.removeButton||null,this.defaultImage=this.$opts.defaultImage,this.setupListeners()}setupListeners(){this.resetButton.addEventListener("click",this.reset.bind(this)),this.removeButton&&this.removeButton.addEventListener("click",this.removeImage.bind(this)),this.imageInput.addEventListener("change",this.fileInputChange.bind(this))}fileInputChange(){this.resetInput.setAttribute("disabled","disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled");for(let t of this.imageInput.files)this.imageElem.src=window.URL.createObjectURL(t);this.imageElem.classList.remove("none")}reset(){this.imageInput.value="",this.imageElem.src=this.defaultImage,this.resetInput.removeAttribute("disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled"),this.imageElem.classList.remove("none")}removeImage(){this.imageInput.value="",this.imageElem.classList.add("none"),this.removeInput.removeAttribute("disabled"),this.resetInput.setAttribute("disabled","disabled")}};var wn=class extends h{setup(){this.elem=this.$el,this.menu=this.$refs.menu,this.sortInput=this.$refs.sort,this.orderInput=this.$refs.order,this.form=this.$refs.form,this.setupListeners()}setupListeners(){this.menu.addEventListener("click",t=>{t.target.closest("[data-sort-value]")!==null&&this.sortOptionClick(t)}),this.elem.addEventListener("click",t=>{t.target.closest("[data-sort-dir]")!==null&&this.sortDirectionClick(t)})}sortOptionClick(t){let e=t.target.closest("[data-sort-value]");this.sortInput.value=e.getAttribute("data-sort-value"),t.preventDefault(),this.form.submit()}sortDirectionClick(t){let e=this.orderInput.value;this.orderInput.value=e==="asc"?"desc":"asc",t.preventDefault(),this.form.submit()}};function q(i,t={},e=[]){let n=document.createElement(i),o=Object.keys(t);for(let s of o)t[s]!==null&&n.setAttribute(s,t[s]);for(let s of e)typeof s=="string"?n.append(document.createTextNode(s)):n.append(s);return n}var bn=class extends h{constructor(){super(...arguments);d(this,"button");d(this,"loadingEl",null)}setup(){this.button=this.$el;let e=this.button.form,n=()=>{setTimeout(()=>this.showLoadingState(),10)};this.button.addEventListener("click",n),e&&e.addEventListener("submit",n)}showLoadingState(){this.button.disabled=!0,this.loadingEl||(this.loadingEl=q("div",{class:"inline block"}),Tt(this.loadingEl),this.button.after(this.loadingEl))}};var yn=class extends h{setup(){this.elem=this.$el,this.pageId=this.$opts.pageId,this.textDirection=this.$opts.textDirection,this.imageUploadErrorText=this.$opts.imageUploadErrorText,this.serverUploadLimitText=this.$opts.serverUploadLimitText,this.display=this.$refs.display,this.input=this.$refs.input,this.divider=this.$refs.divider,this.displayWrap=this.$refs.displayWrap;let{settingContainer:t}=this.$refs,e=t.querySelectorAll('input[type="checkbox"]');this.editor=null,window.importVersioned("markdown").then(n=>n.init({pageId:this.pageId,container:this.elem,displayEl:this.display,inputEl:this.input,drawioUrl:this.getDrawioUrl(),settingInputs:Array.from(e),text:{serverUploadLimit:this.serverUploadLimitText,imageUploadError:this.imageUploadErrorText}})).then(n=>{this.editor=n,this.setupListeners(),this.emitEditorEvents(),this.scrollToTextIfNeeded(),this.editor.actions.updateAndRender()})}emitEditorEvents(){window.$events.emitPublic(this.elem,"editor-markdown::setup",{markdownIt:this.editor.markdown.getRenderer(),displayEl:this.display,cmEditorView:this.editor.cm})}setupListeners(){this.elem.addEventListener("click",t=>{let e=t.target.closest("button[data-action]");if(e===null)return;let n=e.getAttribute("data-action");if(n==="insertImage"&&this.editor.actions.showImageInsert(),n==="insertLink"&&this.editor.actions.showLinkSelector(),n==="insertDrawing"&&(t.ctrlKey||t.metaKey)){this.editor.actions.showImageManager();return}n==="insertDrawing"&&this.editor.actions.startDrawing(),n==="fullscreen"&&this.editor.actions.fullScreen()}),this.elem.addEventListener("click",t=>{let e=t.target.closest(".editor-toolbar-label");if(!e)return;let n=this.elem.querySelectorAll(".markdown-editor-wrap");for(let o of n)o.classList.remove("active");e.closest(".markdown-editor-wrap").classList.add("active")}),this.handleDividerDrag()}handleDividerDrag(){this.divider.addEventListener("pointerdown",()=>{let e=this.elem.getBoundingClientRect(),n=s=>{let r=s.pageX-e.left,a=Math.min(Math.max(20,Math.floor(r/e.width*100)),80);this.displayWrap.style.flexBasis=`${100-a}%`,this.editor.settings.set("editorWidth",a)},o=()=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",o),this.display.style.pointerEvents=null,document.body.style.userSelect=null};this.display.style.pointerEvents="none",document.body.style.userSelect="none",window.addEventListener("pointermove",n),window.addEventListener("pointerup",o)});let t=this.editor.settings.get("editorWidth");t&&(this.displayWrap.style.flexBasis=`${100-t}%`)}scrollToTextIfNeeded(){let e=new URL(window.location).searchParams.get("content-text");e&&this.editor.actions.scrollToText(e)}getDrawioUrl(){let t=document.querySelector("[drawio-url]");return t&&t.getAttribute("drawio-url")||""}async getContent(){return this.editor.actions.getContent()}};var En=class extends h{setup(){this.container=this.$el,this.inputContainer=this.$refs.inputContainer,this.inviteOption=this.container.querySelector("input[name=send_invite]"),this.inviteOption&&(this.inviteOption.addEventListener("change",this.inviteOptionChange.bind(this)),this.inviteOptionChange())}inviteOptionChange(){let t=this.inviteOption.value==="true",e=this.container.querySelectorAll("input[type=password]");for(let n of e)n.disabled=t;this.inputContainer.style.display=t?"none":"block"}};var Cn=class extends h{setup(){this.container=this.$el,this.type=this.$opts.type,this.textElem=this.container.querySelector("span"),this.autoHide=this.$opts.autoHide==="true",this.initialShow=this.$opts.show==="true",this.container.style.display="grid",window.$events.listen(this.type,t=>{this.show(t)}),this.container.addEventListener("click",this.hide.bind(this)),this.initialShow&&setTimeout(()=>this.show(this.textElem.textContent),100),this.hideCleanup=this.hideCleanup.bind(this)}show(t=""){if(this.container.removeEventListener("transitionend",this.hideCleanup),this.textElem.textContent=t,this.container.style.display="grid",setTimeout(()=>{this.container.classList.add("showing")},1),this.autoHide){let e=t.split(" ").length,n=Math.max(2e3,1e3+250*e);setTimeout(this.hide.bind(this),n)}}hide(){this.container.classList.remove("showing"),this.container.addEventListener("transitionend",this.hideCleanup)}hideCleanup(){this.container.style.display="none",this.container.removeEventListener("transitionend",this.hideCleanup)}};var Ln=class extends h{setup(){this.removeButton=this.$refs.remove,this.showButton=this.$refs.show,this.input=this.$refs.input,this.setupListeners()}setupListeners(){T(this.removeButton,()=>{this.input.value="",this.input.classList.add("hidden"),this.removeButton.classList.add("hidden"),this.showButton.classList.remove("hidden")}),T(this.showButton,()=>{this.input.classList.remove("hidden"),this.removeButton.classList.remove("hidden"),this.showButton.classList.add("hidden")})}};var xn=class extends h{constructor(){super(...arguments);d(this,"commentId");d(this,"commentLocalId");d(this,"deletedText");d(this,"updatedText");d(this,"archiveText");d(this,"wysiwygEditor",null);d(this,"wysiwygTextDirection");d(this,"container");d(this,"contentContainer");d(this,"form");d(this,"formCancel");d(this,"editButton");d(this,"deleteButton");d(this,"replyButton");d(this,"archiveButton");d(this,"input")}setup(){this.commentId=this.$opts.commentId,this.commentLocalId=this.$opts.commentLocalId,this.deletedText=this.$opts.deletedText,this.updatedText=this.$opts.updatedText,this.archiveText=this.$opts.archiveText,this.wysiwygTextDirection=this.$opts.wysiwygTextDirection,this.container=this.$el,this.contentContainer=this.$refs.contentContainer,this.form=this.$refs.form,this.formCancel=this.$refs.formCancel,this.editButton=this.$refs.editButton,this.deleteButton=this.$refs.deleteButton,this.replyButton=this.$refs.replyButton,this.archiveButton=this.$refs.archiveButton,this.input=this.$refs.input,this.setupListeners()}setupListeners(){if(this.replyButton){let e={id:this.commentLocalId,element:this.container};this.replyButton.addEventListener("click",()=>this.$emit("reply",e))}this.editButton&&(this.editButton.addEventListener("click",this.startEdit.bind(this)),this.form.addEventListener("submit",this.update.bind(this)),this.formCancel.addEventListener("click",()=>this.toggleEditMode(!1))),this.deleteButton&&this.deleteButton.addEventListener("click",this.delete.bind(this)),this.archiveButton&&this.archiveButton.addEventListener("click",this.archive.bind(this))}toggleEditMode(e){this.contentContainer.toggleAttribute("hidden",e),this.form.toggleAttribute("hidden",!e)}async startEdit(){if(this.toggleEditMode(!0),this.wysiwygEditor){this.wysiwygEditor.focus();return}let e=await window.importVersioned("wysiwyg"),n=this.input.value,o=q("div",{class:"comment-editor-container"});this.input.parentElement?.appendChild(o),this.input.hidden=!0,this.wysiwygEditor=e.createBasicEditorInstance(o,n,{darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.$opts.textDirection,translations:window.editor_translations}),this.wysiwygEditor.focus()}async update(e){e.preventDefault();let n=this.showLoading();this.form.toggleAttribute("hidden",!0);let o={html:await this.wysiwygEditor?.getContentAsHtml()||""};try{let s=await window.$http.put(`/comment/${this.commentId}`,o),r=Q(s.data);this.container.replaceWith(r),window.$events.success(this.updatedText)}catch(s){console.error(s),s instanceof Lt&&window.$events.showValidationErrors(s),this.form.toggleAttribute("hidden",!1),n.remove()}}async delete(){this.showLoading(),await window.$http.delete(`/comment/${this.commentId}`),this.$emit("delete");let e=this.container.closest(".comment-branch");if(e instanceof HTMLElement){let n=window.$components.allWithinElement(e,"page-comment-reference");for(let o of n)o.hideMarker();e.remove()}window.$events.success(this.deletedText)}async archive(){this.showLoading();let n=this.archiveButton.dataset.isArchived==="true"?"unarchive":"archive",o=await window.$http.put(`/comment/${this.commentId}/${n}`);window.$events.success(this.archiveText);let s={new_thread_dom:Q(o.data)};this.$emit(n,s);let r=this.container.closest(".comment-branch"),a=window.$components.allWithinElement(r,"page-comment-reference");for(let l of a)l.hideMarker();r.remove()}showLoading(){let e=Bt();return e.classList.add("px-l"),this.container.append(e),e}};var Fo='';var _o='';var Ut=null,Tn=class extends h{constructor(){super(...arguments);d(this,"link");d(this,"reference");d(this,"markerWrap",null);d(this,"viewCommentText");d(this,"jumpToThreadText");d(this,"closeText")}setup(){this.link=this.$el,this.reference=this.$opts.reference,this.viewCommentText=this.$opts.viewCommentText,this.jumpToThreadText=this.$opts.jumpToThreadText,this.closeText=this.$opts.closeText,this.showForDisplay(),window.addEventListener("editor-toolbox-change",e=>{let n=e.detail.tab,o=e.detail.open;n==="comments"&&o&&this.link.checkVisibility()?this.showForEditor():this.hideMarker()}),window.addEventListener("toggle",e=>{e.target instanceof HTMLElement&&e.target.contains(this.link)&&window.requestAnimationFrame(()=>{this.link.checkVisibility()?this.showForEditor():this.hideMarker()})},{capture:!0}),window.addEventListener("tabs-change",e=>{let n=e.detail.showing;if(!n.startsWith("comment-tab-panel"))return;document.getElementById(n)?.contains(this.link)?this.showForDisplay():this.hideMarker()})}showForDisplay(){let e=document.querySelector(".page-content");e instanceof HTMLElement&&this.link.checkVisibility()&&this.updateMarker(e)}showForEditor(){let e=document.querySelector(".editor-content-wrap");e instanceof HTMLElement&&this.updateMarker(e);let n=()=>{this.hideMarker(),setTimeout(()=>{window.$events.remove("editor-html-change",n)},1)};window.$events.listen("editor-html-change",n)}updateMarker(e){this.link.classList.remove("outdated","missing"),this.markerWrap&&this.markerWrap.remove();let[n,o,s]=this.reference.split(":"),r=document.getElementById(n);if(!r){this.link.classList.add("outdated","missing");return}Ee(r)!==o&&this.link.classList.add("outdated");let l=q("button",{type:"button",class:"content-comment-marker",title:this.viewCommentText});l.innerHTML=Fo,l.addEventListener("click",u=>{this.showCommentAtMarker(l)}),this.markerWrap=q("div",{class:"content-comment-highlight"},[l]),e.append(this.markerWrap),this.positionMarker(r,s),this.link.href=`#${r.id}`,this.link.addEventListener("click",u=>{u.preventDefault(),xt(r)});let c=mt(()=>{this.positionMarker(r,s)},50,!1).bind(this);window.addEventListener("resize",c)}positionMarker(e,n){if(!this.markerWrap)return;let o=this.markerWrap.parentElement,s=o.getBoundingClientRect(),r=e.getBoundingClientRect(),[a,l]=n.split("-");if(a&&l){let p=new Range,f=ye(e,Number(a)),v=ye(e,Number(l));f&&v&&(p.setStart(f.node,f.offset),p.setEnd(v.node,v.offset),r=p.getBoundingClientRect())}let c=r.left-s.left,u=r.top-s.top+o.scrollTop;this.markerWrap.style.left=`${c}px`,this.markerWrap.style.top=`${u}px`,this.markerWrap.style.width=`${r.width}px`,this.markerWrap.style.height=`${r.height}px`}hideMarker(){Ut&&Ut(),this.markerWrap?.remove(),this.markerWrap=null}showCommentAtMarker(e){Ut&&Ut(),e.hidden=!0;let n=this.link.closest(".comment-box"),o=n.closest(".comment-branch").cloneNode(!0),s=o.querySelectorAll(".actions, form");for(let v of s)v.remove();let r=q("button",{type:"button",title:this.closeText});r.innerHTML=_o;let a=q("button",{type:"button","data-action":"jump"},[this.jumpToThreadText]),l=q("div",{class:"content-comment-window"},[q("div",{class:"content-comment-window-actions"},[a,r]),q("div",{class:"content-comment-window-content comment-container-compact comment-container-super-compact"},[o])]);e.parentElement?.append(l);let c=()=>{l.remove(),e.hidden=!1,window.removeEventListener("click",u),Ut=null},u=v=>{e.parentElement.contains(v.target)||c()};window.addEventListener("click",u),Ut=c,r.addEventListener("click",c.bind(this)),a.addEventListener("click",()=>{c(),n.scrollIntoView({behavior:"smooth"});let v=n.querySelector(".header");v.classList.add("anim-highlight"),v.addEventListener("animationend",()=>v.classList.remove("anim-highlight"))});let p=l.getBoundingClientRect(),f=document.querySelector(".page-content")?.getBoundingClientRect();if(f&&p.right>f.right){let v=p.right-f.right;l.style.left=`-${v}px`}}};var jt=class extends h{constructor(){super(...arguments);d(this,"container");d(this,"tabList");d(this,"tabs");d(this,"panels");d(this,"activeUnder");d(this,"active",null)}setup(){this.container=this.$el,this.tabList=this.container.querySelector('[role="tablist"]'),this.tabs=Array.from(this.tabList.querySelectorAll('[role="tab"]')),this.panels=Array.from(this.container.querySelectorAll(':scope > [role="tabpanel"], :scope > * > [role="tabpanel"]')),this.activeUnder=this.$opts.activeUnder?Number(this.$opts.activeUnder):1e4,this.container.addEventListener("click",e=>{let n=e.target.closest('[role="tab"]');n instanceof HTMLElement&&this.tabs.includes(n)&&this.show(n.getAttribute("aria-controls")||"")}),window.addEventListener("resize",this.updateActiveState.bind(this),{passive:!0}),this.updateActiveState()}show(e){for(let o of this.panels)o.toggleAttribute("hidden",o.id!==e);for(let o of this.tabs){let r=o.getAttribute("aria-controls")===e;o.setAttribute("aria-selected",r?"true":"false")}let n={showing:e};this.$emit("change",n)}updateActiveState(){let e=window.innerWidth!n.hasAttribute("hidden"))||this.panels[0];this.show(e.id),this.tabList.toggleAttribute("hidden",!1)}deactivate(){for(let e of this.panels)e.removeAttribute("hidden");for(let e of this.tabs)e.setAttribute("aria-selected","false");this.tabList.toggleAttribute("hidden",!0)}};var Sn=class extends h{constructor(){super(...arguments);d(this,"elem");d(this,"pageId");d(this,"container");d(this,"commentCountBar");d(this,"activeTab");d(this,"archivedTab");d(this,"addButtonContainer");d(this,"archiveContainer");d(this,"activeContainer");d(this,"replyToRow");d(this,"referenceRow");d(this,"formContainer");d(this,"form");d(this,"formInput");d(this,"formReplyLink");d(this,"formReferenceLink");d(this,"addCommentButton");d(this,"hideFormButton");d(this,"removeReplyToButton");d(this,"removeReferenceButton");d(this,"wysiwygTextDirection");d(this,"wysiwygEditor",null);d(this,"createdText");d(this,"countText");d(this,"archivedCountText");d(this,"parentId",null);d(this,"contentReference","");d(this,"formReplyText","")}setup(){this.elem=this.$el,this.pageId=Number(this.$opts.pageId),this.container=this.$refs.commentContainer,this.commentCountBar=this.$refs.commentCountBar,this.activeTab=this.$refs.activeTab,this.archivedTab=this.$refs.archivedTab,this.addButtonContainer=this.$refs.addButtonContainer,this.archiveContainer=this.$refs.archiveContainer,this.activeContainer=this.$refs.activeContainer,this.replyToRow=this.$refs.replyToRow,this.referenceRow=this.$refs.referenceRow,this.formContainer=this.$refs.formContainer,this.form=this.$refs.form,this.formInput=this.$refs.formInput,this.formReplyLink=this.$refs.formReplyLink,this.formReferenceLink=this.$refs.formReferenceLink,this.addCommentButton=this.$refs.addCommentButton,this.hideFormButton=this.$refs.hideFormButton,this.removeReplyToButton=this.$refs.removeReplyToButton,this.removeReferenceButton=this.$refs.removeReferenceButton,this.wysiwygTextDirection=this.$opts.wysiwygTextDirection,this.createdText=this.$opts.createdText,this.countText=this.$opts.countText,this.archivedCountText=this.$opts.archivedCountText,this.formReplyText=this.formReplyLink?.textContent||"",this.setupListeners()}setupListeners(){this.elem.addEventListener("page-comment-delete",()=>{setTimeout(()=>{this.updateCount(),this.hideForm()},1)}),this.elem.addEventListener("page-comment-reply",e=>{this.setReply(e.detail.id,e.detail.element)}),this.elem.addEventListener("page-comment-archive",e=>{this.archiveContainer.append(e.detail.new_thread_dom),setTimeout(()=>this.updateCount(),1)}),this.elem.addEventListener("page-comment-unarchive",e=>{this.container.append(e.detail.new_thread_dom),setTimeout(()=>this.updateCount(),1)}),this.form&&(this.removeReplyToButton.addEventListener("click",this.removeReplyTo.bind(this)),this.removeReferenceButton.addEventListener("click",()=>this.setContentReference("")),this.hideFormButton.addEventListener("click",this.hideForm.bind(this)),this.addCommentButton.addEventListener("click",this.showForm.bind(this)),this.form.addEventListener("submit",this.saveComment.bind(this)))}async saveComment(e){e.preventDefault(),e.stopPropagation();let n=Bt();n.classList.add("px-l"),this.form.after(n),this.form.toggleAttribute("hidden",!0);let o={html:await this.wysiwygEditor?.getContentAsHtml()||"",parent_id:this.parentId||null,content_ref:this.contentReference};window.$http.post(`/comment/${this.pageId}`,o).then(s=>{let r=Q(s.data);o.parent_id?this.formContainer.after(r):this.container.append(r);let a=window.$components.allWithinElement(r,"page-comment-reference");for(let l of a)l.showForDisplay();window.$events.success(this.createdText),this.hideForm(),this.updateCount()}).catch(s=>{this.form.toggleAttribute("hidden",!1),window.$events.showValidationErrors(s)}),this.form.toggleAttribute("hidden",!1),n.remove()}updateCount(){let e=this.getActiveThreadCount();this.activeTab.textContent=window.$trans.choice(this.countText,e);let n=this.getArchivedThreadCount();this.archivedTab.textContent=window.$trans.choice(this.archivedCountText,n)}resetForm(){this.removeEditor(),this.formInput.value="",this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.setContentReference("")}showForm(){this.removeEditor(),this.formContainer.toggleAttribute("hidden",!1),this.addButtonContainer.toggleAttribute("hidden",!0),this.formContainer.scrollIntoView({behavior:"smooth",block:"nearest"}),this.loadEditor();let e=window.$components.firstOnElement(this.elem,"tabs");e instanceof jt&&this.formContainer.closest("#comment-tab-panel-active")&&e.show("comment-tab-panel-active")}hideForm(){this.resetForm(),this.formContainer.toggleAttribute("hidden",!0),this.getActiveThreadCount()>0?this.activeContainer.append(this.addButtonContainer):this.commentCountBar.append(this.addButtonContainer),this.addButtonContainer.toggleAttribute("hidden",!1)}async loadEditor(){if(this.wysiwygEditor){this.wysiwygEditor.focus();return}let e=await window.importVersioned("wysiwyg"),n=q("div",{class:"comment-editor-container"});this.formInput.parentElement?.appendChild(n),this.formInput.hidden=!0,this.wysiwygEditor=e.createBasicEditorInstance(n,"

    ",{darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.wysiwygTextDirection,translations:window.editor_translations}),this.wysiwygEditor.focus()}removeEditor(){this.wysiwygEditor&&(this.wysiwygEditor.remove(),this.wysiwygEditor=null)}getActiveThreadCount(){return this.container.querySelectorAll(":scope > .comment-branch:not([hidden])").length}getArchivedThreadCount(){return this.archiveContainer.querySelectorAll(":scope > .comment-branch").length}setReply(e,n){n.closest(".comment-branch").querySelector(".comment-branch-children").append(this.formContainer),this.showForm(),this.parentId=Number(e),this.replyToRow.toggleAttribute("hidden",!1),this.formReplyLink.textContent=this.formReplyText.replace("1234",String(this.parentId)),this.formReplyLink.href=`#comment${this.parentId}`}removeReplyTo(){this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.showForm()}startNewComment(e){this.resetForm(),this.showForm(),this.setContentReference(e)}setContentReference(e){this.contentReference=e,this.referenceRow.toggleAttribute("hidden",!e);let[n]=e.split(":");this.formReferenceLink.href=`#${n}`,this.formReferenceLink.onclick=function(o){o.preventDefault();let s=document.getElementById(n);s&&xt(s)}}};function rr(i,t){ri(`#page-navigation a[href="#${i}"]`,e=>{e.closest("li").classList.toggle("current-heading",t)})}function ar(i){for(let t of i){let e=t.intersectionRatio===1;rr(t.target.id,e)}}function lr(i){let t={rootMargin:"0px 0px 0px 0px",threshold:1},e=new IntersectionObserver(ar,t);for(let n of i)e.observe(n)}var kn=class extends h{setup(){if(this.container=this.$el,this.pageId=this.$opts.pageId,window.importVersioned("code").then(e=>e.highlight()),this.setupNavHighlighting(),window.location.hash){let e=window.location.hash.replace(/%20/g," ").substring(1);this.goToText(e)}let t=document.querySelector(".sidebar-page-nav");t&&I(t,"a","click",(e,n)=>{e.preventDefault(),window.$components.first("tri-layout").showContent();let o=n.getAttribute("href").substr(1);this.goToText(o),window.history.pushState(null,null,`#${o}`)})}goToText(t){let e=document.getElementById(t);if(ri(".page-content [data-highlighted]",n=>{n.removeAttribute("data-highlighted"),n.style.backgroundColor=null}),e!==null)xt(e);else{let n=ro(".page-content > div > *",t);n&&xt(n)}}setupNavHighlighting(){let t=document.querySelector(".sidebar-page-nav"),e=document.querySelector(".page-content").querySelectorAll("h1, h2, h3, h4, h5, h6");e.length>0&&t!==null&&lr(e)}};function qo(i){let t=new Date(i*1e3),e=t.getHours(),n=t.getMinutes();return`${(e>9?"":"0")+e}:${(n>9?"":"0")+n}`}var $n=class extends h{setup(){this.draftsEnabled=this.$opts.draftsEnabled==="true",this.editorType=this.$opts.editorType,this.pageId=Number(this.$opts.pageId),this.isNewDraft=this.$opts.pageNewDraft==="true",this.hasDefaultTitle=this.$opts.hasDefaultTitle||!1,this.container=this.$el,this.titleElem=this.$refs.titleContainer.querySelector("input"),this.saveDraftButton=this.$refs.saveDraft,this.discardDraftButton=this.$refs.discardDraft,this.discardDraftWrap=this.$refs.discardDraftWrap,this.deleteDraftButton=this.$refs.deleteDraft,this.deleteDraftWrap=this.$refs.deleteDraftWrap,this.draftDisplay=this.$refs.draftDisplay,this.draftDisplayIcon=this.$refs.draftDisplayIcon,this.changelogInput=this.$refs.changelogInput,this.changelogDisplay=this.$refs.changelogDisplay,this.changelogCounter=this.$refs.changelogCounter,this.changeEditorButtons=this.$manyRefs.changeEditor||[],this.switchDialogContainer=this.$refs.switchDialog,this.deleteDraftDialogContainer=this.$refs.deleteDraftDialog,this.draftText=this.$opts.draftText,this.autosaveFailText=this.$opts.autosaveFailText,this.editingPageText=this.$opts.editingPageText,this.draftDiscardedText=this.$opts.draftDiscardedText,this.draftDeleteText=this.$opts.draftDeleteText,this.draftDeleteFailText=this.$opts.draftDeleteFailText,this.setChangelogText=this.$opts.setChangelogText,this.autoSave={interval:null,frequency:3e4,last:0,pendingChange:!1},this.shownWarningsCache=new Set,this.pageId!==0&&this.draftsEnabled&&window.setTimeout(()=>{this.startAutoSave()},1e3),this.draftDisplay.innerHTML=this.draftText,this.setupListeners(),this.setInitialFocus()}setupListeners(){window.$events.listen("editor-save-draft",this.saveDraft.bind(this)),window.$events.listen("editor-save-page",this.savePage.bind(this));let t=()=>{this.autoSave.pendingChange=!0};window.$events.listen("editor-html-change",t),window.$events.listen("editor-markdown-change",t),this.titleElem.addEventListener("input",t);let e=mt(this.updateChangelogDisplay.bind(this),300,!1);this.changelogInput.addEventListener("input",()=>{let n=this.changelogInput.value.length;this.changelogCounter.innerText=`${n} / 180`,e()}),T(this.saveDraftButton,this.saveDraft.bind(this)),T(this.discardDraftButton,this.discardDraft.bind(this)),T(this.deleteDraftButton,this.deleteDraft.bind(this)),T(this.changeEditorButtons,this.changeEditor.bind(this))}setInitialFocus(){if(this.hasDefaultTitle){this.titleElem.select();return}window.setTimeout(()=>{window.$events.emit("editor::focus","")},500)}startAutoSave(){this.autoSave.interval=window.setInterval(this.runAutoSave.bind(this),this.autoSave.frequency)}runAutoSave(){Date.now()-this.autoSave.last{this.draftDisplayIcon.classList.remove("visible")},2e3)}async discardDraft(t=!0){let e;try{e=await window.$http.get(`/ajax/page/${this.pageId}`)}catch(n){console.error(n);return}this.autoSave.interval&&window.clearInterval(this.autoSave.interval),this.draftDisplay.innerText=this.editingPageText,this.discardDraftWrap.toggleAttribute("hidden",!0),window.$events.emit("editor::replace",{html:e.data.html,markdown:e.data.markdown}),this.titleElem.value=e.data.name,window.setTimeout(()=>{this.startAutoSave()},1e3),t&&window.$events.success(this.draftDiscardedText)}async deleteDraft(){if(await window.$components.firstOnElement(this.deleteDraftDialogContainer,"confirm-dialog").show())try{let n=this.discardDraft(!1),o=window.$http.delete(`/page-revisions/user-drafts/${this.pageId}`);await Promise.all([n,o]),window.$events.success(this.draftDeleteText),this.deleteDraftWrap.toggleAttribute("hidden",!0)}catch(n){console.error(n),window.$events.error(this.draftDeleteFailText)}}updateChangelogDisplay(){let t=this.changelogInput.value.trim();t.length===0?t=this.setChangelogText:t.length>16&&(t=`${t.slice(0,16)}...`),this.changelogDisplay.innerText=t}async changeEditor(t){t.preventDefault();let e=t.target.closest("a").href,n=window.$components.firstOnElement(this.switchDialogContainer,"confirm-dialog"),[o,s]=await Promise.all([this.saveDraft(),n.show()]);o&&s&&(window.location=e)}getEditorComponent(){return window.$components.first("markdown-editor")||window.$components.first("wysiwyg-editor")||window.$components.first("wysiwyg-editor-tinymce")}};function Mn(i,t){i.toggleAttribute("hidden",!t)}var Dn=class extends h{setup(){this.input=this.$refs.input,this.resetButton=this.$refs.resetButton,this.selectButton=this.$refs.selectButton,this.display=this.$refs.display,this.defaultDisplay=this.$refs.defaultDisplay,this.buttonSep=this.$refs.buttonSeperator,this.selectorEndpoint=this.$opts.selectorEndpoint,this.value=this.input.value,this.setupListeners()}setupListeners(){this.selectButton.addEventListener("click",this.showPopup.bind(this)),this.display.parentElement.addEventListener("click",this.showPopup.bind(this)),this.display.addEventListener("click",t=>t.stopPropagation()),this.resetButton.addEventListener("click",()=>{this.setValue("","")})}showPopup(){window.$components.first("entity-selector-popup").show(e=>{this.setValue(e.id,e.name)},{initialValue:"",searchEndpoint:this.selectorEndpoint,entityTypes:"page",entityPermission:"view"})}setValue(t,e){this.value=t,this.input.value=t,this.controlView(e)}controlView(t){let e=this.value&&this.value!==0;if(Mn(this.resetButton,e),Mn(this.buttonSep,e),Mn(this.defaultDisplay,!e),Mn(this.display,e),e){let n=this.getAssetIdFromVal();this.display.textContent=`#${n}, ${t}`,this.display.href=window.baseUrl(`/link/${n}`)}}getAssetIdFromVal(){return Number(this.value)}};var An=class extends h{setup(){this.container=this.$el,this.cellSelector=this.$opts.cellSelector||"td,th",this.rowSelector=this.$opts.rowSelector||"tr";for(let t of this.$manyRefs.toggleAll||[])t.addEventListener("click",this.toggleAllClick.bind(this));for(let t of this.$manyRefs.toggleRow||[])t.addEventListener("click",this.toggleRowClick.bind(this));for(let t of this.$manyRefs.toggleColumn||[])t.addEventListener("click",this.toggleColumnClick.bind(this))}toggleAllClick(t){t.preventDefault(),this.toggleAllInElement(this.container)}toggleRowClick(t){t.preventDefault(),this.toggleAllInElement(t.target.closest(this.rowSelector))}toggleColumnClick(t){t.preventDefault();let e=t.target.closest(this.cellSelector),n=Array.from(e.parentElement.children).indexOf(e),o=this.container.querySelectorAll(this.rowSelector),s=[];for(let r of o){let a=r.children[n];a&&s.push(...a.querySelectorAll("input[type=checkbox]"))}this.toggleAllInputs(s)}toggleAllInElement(t){let e=t.querySelectorAll("input[type=checkbox]");this.toggleAllInputs(e)}toggleAllInputs(t){let e=t.length>0?t[0].checked:!1;for(let n of t)n.checked=!e,n.dispatchEvent(new Event("change"))}};var In=class extends h{constructor(){super(...arguments);d(this,"showing",!1);d(this,"isMakingSelection",!1);d(this,"targetElement",null);d(this,"targetSelectionRange",null);d(this,"pointer");d(this,"linkInput");d(this,"linkButton");d(this,"includeInput");d(this,"includeButton");d(this,"sectionModeButton");d(this,"commentButton");d(this,"modeToggles");d(this,"modeSections");d(this,"pageId")}setup(){this.pointer=this.$refs.pointer,this.linkInput=this.$refs.linkInput,this.linkButton=this.$refs.linkButton,this.includeInput=this.$refs.includeInput,this.includeButton=this.$refs.includeButton,this.sectionModeButton=this.$refs.sectionModeButton,this.commentButton=this.$refs.commentButton,this.modeToggles=this.$manyRefs.modeToggle,this.modeSections=this.$manyRefs.modeSection,this.pageId=this.$opts.pageId,this.setupListeners()}setupListeners(){this.includeButton.addEventListener("click",()=>Ii(this.includeInput.value)),this.linkButton.addEventListener("click",()=>Ii(this.linkInput.value)),T([this.includeInput,this.linkInput],n=>{n.target.select(),n.stopPropagation()}),be(this.pointer,["click","focus"],n=>{n.stopPropagation()}),be(document.body,["click","focus"],()=>{!this.showing||this.isMakingSelection||this.hidePointer()}),so(this.pointer,this.hidePointer.bind(this));let e=document.querySelector(".page-content");be(e,["mouseup","keyup"],n=>{n.stopPropagation();let o=n.target.closest('[id^="bkmrk"]');if(o instanceof HTMLElement&&(window.getSelection()||"").toString().length>0){let s=n instanceof MouseEvent?n.pageX:0;this.showPointerAtTarget(o,s,!1)}}),T(this.sectionModeButton,this.enterSectionSelectMode.bind(this)),T(this.modeToggles,n=>{let o=n.target;for(let r of this.modeSections){let a=!r.contains(o);r.toggleAttribute("hidden",!a)}let s=this.modeToggles.find(r=>r!==o);s&&s.focus()}),this.commentButton&&T(this.commentButton,this.createCommentAtPointer.bind(this))}hidePointer(){this.pointer.style.removeProperty("display"),this.showing=!1,this.targetElement=null,this.targetSelectionRange=null}showPointerAtTarget(e,n,o){this.targetElement=e,this.targetSelectionRange=window.getSelection()?.getRangeAt(0)||null,this.updateDomForTarget(e),this.pointer.style.display="block";let s=e.getBoundingClientRect(),r=this.pointer.getBoundingClientRect(),l=Math.min(Math.max(n,s.left),s.right)-r.width/2,c=s.top-r.height-16;this.pointer.style.left=`${l}px`,this.pointer.style.top=`${c}px`,this.showing=!0,this.isMakingSelection=!0,setTimeout(()=>{this.isMakingSelection=!1},100);let u=()=>{this.hidePointer(),window.removeEventListener("scroll",u)};e.parentElement?.insertBefore(this.pointer,e),o||window.addEventListener("scroll",u,{passive:!0})}updateDomForTarget(e){let n=window.baseUrl(`/link/${this.pageId}#${e.id}`),o=`{{@${this.pageId}#${e.id}}}`;this.linkInput.value=n,this.includeInput.value=o;let s=this.pointer.querySelector("#pointer-edit");if(s instanceof HTMLAnchorElement&&e){let{editHref:r}=s.dataset,a=e.id,l=(e.textContent||"").substring(0,50);s.href=`${r}?content-id=${a}&content-text=${encodeURIComponent(l)}`}}enterSectionSelectMode(){let e=Array.from(document.querySelectorAll('.page-content [id^="bkmrk"]'));for(let n of e)n.setAttribute("tabindex","0");e[0].focus(),Ht(e,n=>{this.showPointerAtTarget(n.target,0,!0),this.pointer.focus()})}createCommentAtPointer(){if(!this.targetElement)return;let e=this.targetElement.id,n=Ee(this.targetElement),o="";if(this.targetSelectionRange){let a=this.targetSelectionRange.commonAncestorContainer;if(this.targetElement.contains(a)){let l=ai(this.targetSelectionRange.startContainer,this.targetSelectionRange.startOffset,this.targetElement),c=ai(this.targetSelectionRange.endContainer,this.targetSelectionRange.endOffset,this.targetElement);o=`${l}-${c}`}}let s=`${e}:${n}:${o}`;window.$components.first("page-comments").startNewComment(s)}};var Hn=class extends h{setup(){this.container=this.$el,this.hideButtons=this.$manyRefs.hide||[],this.onkeyup=null,this.onHide=null,this.setupListeners()}setupListeners(){let t=null;this.container.addEventListener("mousedown",e=>{t=e.target}),this.container.addEventListener("click",e=>{e.target===this.container&&t===this.container&&this.hide()}),T(this.hideButtons,()=>this.hide())}hide(t=null){Oo(this.container,120,t),this.onkeyup&&(window.removeEventListener("keyup",this.onkeyup),this.onkeyup=null),this.onHide&&this.onHide()}show(t=null,e=null){Ro(this.container,120,t),this.onkeyup=n=>{n.key==="Escape"&&this.hide()},window.addEventListener("keyup",this.onkeyup),this.onHide=e}};var Bn=class extends h{setup(){this.container=this.$el,this.mode=this.$opts.mode,this.lightContainer=this.$refs.lightContainer,this.darkContainer=this.$refs.darkContainer,this.container.addEventListener("tabs-change",e=>{let o=e.detail.showing==="color-scheme-panel-light"?"light":"dark";this.handleModeChange(o)});let t=e=>{this.updateAppColorsFromInputs(),e.target.name.startsWith("setting-app-color")&&this.updateLightForInput(e.target)};this.container.addEventListener("change",t),this.container.addEventListener("input",t)}handleModeChange(t){this.mode=t;let e=t==="dark";document.documentElement.classList.toggle("dark-mode",e),this.updateAppColorsFromInputs()}updateAppColorsFromInputs(){let e=(this.mode==="dark"?this.darkContainer:this.lightContainer).querySelectorAll('input[type="color"]');for(let n of e){let o=n.name.split("-"),s=o.indexOf("color"),r=o.slice(1,s).join("-");r==="app"&&(r="primary");let a=`--color-${r}`;document.body.style.setProperty(a,n.value)}}updateLightForInput(t){let e=t.name.replace("-color","-color-light"),n=t.value,o=this.hexToRgb(n),s=`rgba(${[o.r,o.g,o.b,"0.15"].join(",")})`,r=this.container.querySelector(`input[name="${e}"][type="hidden"]`);r.value=s}hexToRgb(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return{r:e?parseInt(e[1],16):0,g:e?parseInt(e[2],16):0,b:e?parseInt(e[3],16):0}}};var Pn=class extends h{setup(){this.colorInput=this.$refs.input,this.resetButton=this.$refs.resetButton,this.defaultButton=this.$refs.defaultButton,this.currentColor=this.$opts.current,this.defaultColor=this.$opts.default,this.resetButton.addEventListener("click",()=>this.setValue(this.currentColor)),this.defaultButton.addEventListener("click",()=>this.setValue(this.defaultColor))}setValue(t){this.colorInput.value=t,this.colorInput.dispatchEvent(new Event("change",{bubbles:!0}))}};var Rn=class extends h{setup(){this.typeControl=this.$refs.typeControl,this.pagePickerContainer=this.$refs.pagePickerContainer,this.typeControl.addEventListener("change",this.controlPagePickerVisibility.bind(this)),this.controlPagePickerVisibility()}controlPagePickerVisibility(){let t=this.typeControl.value==="page";this.pagePickerContainer.style.display=t?"block":"none"}};function On(i,t){return{move_up(e){let n=e.parentNode,o=Array.from(n.children).indexOf(e),s=Math.max(o-1,0);n.insertBefore(e,n.children[s]||null)},move_down(e){let n=e.parentNode,o=Array.from(n.children).indexOf(e),s=Math.min(o+2,n.children.length);n.insertBefore(e,n.children[s]||null)},remove(e){i.appendChild(e)},add(e){t.appendChild(e)}}}function Nn(i,t){return e=>{let n=e.target.closest(".scroll-box-item button[data-action]");if(n){let o=n.closest(".scroll-box-item"),s=n.dataset.action;if(!s)throw new Error("No action defined for clicked button");let r=i[s];r(o),t()}}}var Fn=class extends h{setup(){this.elem=this.$el,this.input=this.$refs.input,this.shelfBookList=this.$refs.shelfBookList,this.allBookList=this.$refs.allBookList,this.bookSearchInput=this.$refs.bookSearch,this.sortButtonContainer=this.$refs.sortButtonContainer,this.lastSort=null,this.initSortable(),this.setupListeners()}initSortable(){let t=this.elem.querySelectorAll(".scroll-box");for(let e of t)new ht(e,{group:"shelf-books",ghostClass:"primary-background-light",handle:".handle",animation:150,onSort:this.onChange.bind(this)})}setupListeners(){let t=On(this.allBookList,this.shelfBookList),e=Nn(t,this.onChange.bind(this));this.elem.addEventListener("click",e),this.bookSearchInput.addEventListener("input",()=>{this.filterBooksByName(this.bookSearchInput.value)}),this.sortButtonContainer.addEventListener("click",n=>{let o=n.target.closest("button[data-sort]");o&&this.sortShelfBooks(o.dataset.sort)})}filterBooksByName(t){this.allBookList.style.height||(this.allBookList.style.height=`${this.allBookList.getBoundingClientRect().height}px`);let e=this.allBookList.children,n=t.trim().toLowerCase();for(let o of e){let s=!t||o.textContent.toLowerCase().includes(n);o.style.display=s?null:"none"}}onChange(){let t=Array.from(this.shelfBookList.querySelectorAll("[data-id]"));this.input.value=t.map(e=>e.getAttribute("data-id")).join(",")}sortShelfBooks(t){let e=Array.from(this.shelfBookList.children),n=t===this.lastSort;e.sort((o,s)=>{let r=o.dataset[t].toLowerCase(),a=s.dataset[t].toLowerCase();return n?a.localeCompare(r):r.localeCompare(a)});for(let o of e)this.shelfBookList.append(o);this.lastSort=this.lastSort===t?null:t,this.onChange()}};function cr(i){let t={};for(let[e,n]of Object.entries(i))t[n]=e;return t}var _n=class extends h{setup(){this.container=this.$el,this.mapById=JSON.parse(this.$opts.keyMap),this.mapByShortcut=cr(this.mapById),this.hintsShowing=!1,this.hideHints=this.hideHints.bind(this),this.hintAbortController=null,this.setupListeners()}setupListeners(){window.addEventListener("keydown",t=>{if(!t.target.closest("input, select, textarea, .cm-editor, .editor-container")){if(t.key==="?"){this.hintsShowing?this.hideHints():this.showHints();return}this.handleShortcutPress(t)}})}handleShortcutPress(t){let n=[t.ctrlKey?"Ctrl":"",t.metaKey?"Cmd":"",t.key].filter(s=>!!s).join(" + "),o=this.mapByShortcut[n];o&&this.runShortcut(o)&&t.preventDefault()}runShortcut(t){let e=this.container.querySelector(`[data-shortcut="${t}"]`);return e?e.matches("input, textarea, select")?(e.focus(),!0):e.matches("a, button")?(e.click(),!0):e.matches("div[tabindex]")?(e.click(),e.focus(),!0):(console.error("Shortcut attempted to be ran for element type that does not have handling setup",e),!1):!1}showHints(){let t=document.createElement("div");t.classList.add("shortcut-container"),this.container.append(t);let e=this.container.querySelectorAll("[data-shortcut]"),n=new Set;for(let s of e){let r=s.getAttribute("data-shortcut");if(n.has(r))continue;let a=this.mapById[r];this.showHintLabel(s,a,t),n.add(r)}this.hintAbortController=new AbortController;let o=this.hintAbortController.signal;window.addEventListener("scroll",this.hideHints,{signal:o}),window.addEventListener("focus",this.hideHints,{signal:o}),window.addEventListener("blur",this.hideHints,{signal:o}),window.addEventListener("click",this.hideHints,{signal:o}),this.hintsShowing=!0}showHintLabel(t,e,n){let o=t.getBoundingClientRect(),s=document.createElement("div");s.classList.add("shortcut-hint"),s.textContent=e;let r=document.createElement("div");r.classList.add("shortcut-linkage"),r.style.left=`${o.x}px`,r.style.top=`${o.y}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,n.append(s,r);let a=s.getBoundingClientRect();s.style.insetInlineStart=`${o.x+o.width-(a.width+6)}px`,s.style.insetBlockStart=`${o.y+(o.height-a.height)/2}px`}hideHints(){this.container.querySelector(".shortcut-container").remove(),this.hintAbortController?.abort(),this.hintsShowing=!1}};var dr=["Control","Alt","Shift","Meta","Super"," ","+","Tab","Escape"],qn=class extends h{setup(){this.input=this.$el,this.setupListeners()}setupListeners(){this.listenerRecordKey=this.listenerRecordKey.bind(this),this.input.addEventListener("focus",()=>{this.startListeningForInput()}),this.input.addEventListener("blur",()=>{this.stopListeningForInput()})}startListeningForInput(){this.input.addEventListener("keydown",this.listenerRecordKey)}listenerRecordKey(t){if(dr.includes(t.key))return;let e=[t.ctrlKey?"Ctrl":"",t.metaKey?"Cmd":"",t.key];this.input.value=e.filter(n=>!!n).join(" + ")}stopListeningForInput(){this.input.removeEventListener("keydown",this.listenerRecordKey)}};var Vn=class extends h{setup(){this.container=this.$el,this.handleSelector=this.$opts.handleSelector;let t=new ht(this.container,{handle:this.handleSelector,animation:150,onSort:()=>{this.$emit("sort",{ids:t.toArray()})},setData(e,n){let o=n.getAttribute("data-drag-content");if(o){let s=JSON.parse(o);for(let[r,a]of Object.entries(s))e.setData(r,a)}},revertOnSpill:!0,dropBubble:!0,dragoverBubble:!1})}};var Wn=class extends h{constructor(){super(...arguments);d(this,"input");d(this,"configuredList");d(this,"availableList")}setup(){this.input=this.$refs.input,this.configuredList=this.$refs.configuredOperationsList,this.availableList=this.$refs.availableOperationsList,this.initSortable();let e=On(this.availableList,this.configuredList),n=Nn(e,this.onChange.bind(this));this.$el.addEventListener("click",n)}initSortable(){let e=[this.configuredList,this.availableList];for(let n of e)new ht(n,{group:"sort-rule-operations",ghostClass:"primary-background-light",handle:".handle",animation:150,onSort:this.onChange.bind(this)})}onChange(){let e=Array.from(this.configuredList.querySelectorAll("[data-id]"));this.input.value=e.map(n=>n.getAttribute("data-id")).join(",")}};var Un=class extends h{setup(){this.filter=this.$opts.filter,this.$el.addEventListener("change",t=>{if(this.filter&&!t.target.matches(this.filter))return;let e=this.$el.closest("form");e&&e.submit()})}};var jn=class extends h{setup(){this.addRemoveComponentEl=this.$refs.addRemove,this.container=this.$el,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.container.addEventListener("input",t=>{let e=window.$components.firstOnElement(this.addRemoveComponentEl,"add-remove-rows");!this.hasEmptyRows()&&t.target.value&&e.add()})}hasEmptyRows(){return[...this.container.querySelectorAll(this.rowSelector)].find(n=>[...n.querySelectorAll("input")].filter(o=>o.value).length===0)!==void 0}};var zn=class extends h{setup(){this.container=this.$el,this.list=this.$refs.list,this.searchInput=this.$refs.searchInput,this.searchButton=this.$refs.searchButton,this.searchCancel=this.$refs.searchCancel,this.setupListeners()}setupListeners(){I(this.container,"[template-action]","click",this.handleTemplateActionClick.bind(this)),I(this.container,".pagination a","click",this.handlePaginationClick.bind(this)),I(this.container,".template-item-content","click",this.handleTemplateItemClick.bind(this)),I(this.container,".template-item","dragstart",this.handleTemplateItemDragStart.bind(this)),this.searchInput.addEventListener("keypress",t=>{t.key==="Enter"&&(t.preventDefault(),this.performSearch())}),this.searchButton.addEventListener("click",()=>this.performSearch()),this.searchCancel.addEventListener("click",()=>{this.searchInput.value="",this.performSearch()})}handleTemplateItemClick(t,e){let n=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(n,"replace")}handleTemplateItemDragStart(t,e){let n=e.closest("[template-id]").getAttribute("template-id");t.dataTransfer.setData("bookstack/template",n),t.dataTransfer.setData("text/plain",n)}handleTemplateActionClick(t,e){t.stopPropagation();let n=e.getAttribute("template-action"),o=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(o,n)}async insertTemplate(t,e="replace"){let n=await window.$http.get(`/templates/${t}`),o=`editor::${e}`;window.$events.emit(o,n.data)}async handlePaginationClick(t,e){t.preventDefault();let n=e.getAttribute("href"),o=await window.$http.get(n);this.list.innerHTML=o.data}async performSearch(){let t=this.searchInput.value,e=await window.$http.get("/templates",{search:t});this.searchCancel.style.display=t?"block":"none",this.list.innerHTML=e.data}};var Kn=class extends h{setup(){this.input=this.$el.querySelector("input[type=hidden]"),this.checkbox=this.$el.querySelector("input[type=checkbox]"),this.checkbox.addEventListener("change",this.stateChange.bind(this))}stateChange(){this.input.value=this.checkbox.checked?"true":"false";let t=new Event("change");this.input.dispatchEvent(t)}};var Xn=class extends h{constructor(){super(...arguments);d(this,"container");d(this,"tabs");d(this,"sidebarScrollContainers");d(this,"lastLayoutType","none");d(this,"onDestroy",null);d(this,"scrollCache",{content:0,info:0});d(this,"lastTabShown","content")}setup(){this.container=this.$refs.container,this.tabs=this.$manyRefs.tab,this.sidebarScrollContainers=this.$manyRefs.sidebarScrollContainer,this.mobileTabClick=this.mobileTabClick.bind(this),this.updateLayout(),window.addEventListener("resize",()=>{this.updateLayout()},{passive:!0}),this.setupSidebarScrollHandlers()}updateLayout(){let e="tablet";window.innerWidth<=1e3&&(e="mobile"),window.innerWidth>1400&&(e="desktop"),e!==this.lastLayoutType&&(this.onDestroy&&(this.onDestroy(),this.onDestroy=null),e==="desktop"?this.setupDesktop():e==="mobile"&&this.setupMobile(),this.lastLayoutType=e)}setupMobile(){for(let e of this.tabs)e.addEventListener("click",this.mobileTabClick);this.onDestroy=()=>{for(let e of this.tabs)e.removeEventListener("click",this.mobileTabClick)}}setupDesktop(){}mobileTabClick(e){let n=e.target.dataset.tab||"";this.showTab(n)}showContent(){this.showTab("content",!1)}showTab(e,n=!0){this.scrollCache[this.lastTabShown]=document.documentElement.scrollTop;for(let s of this.tabs){let r=s.dataset.tab===e;s.setAttribute("aria-selected",r?"true":"false")}let o=e==="info";if(this.container.classList.toggle("show-info",o),n){let r=document.querySelector("header").getBoundingClientRect().bottom;document.documentElement.scrollTop=this.scrollCache[e]||r,setTimeout(()=>{document.documentElement.scrollTop=this.scrollCache[e]||r},50)}this.lastTabShown=e}setupSidebarScrollHandlers(){for(let e of this.sidebarScrollContainers)e.addEventListener("scroll",()=>this.handleSidebarScroll(e),{passive:!0}),this.handleSidebarScroll(e);window.addEventListener("resize",()=>{for(let e of this.sidebarScrollContainers)this.handleSidebarScroll(e)})}handleSidebarScroll(e){let n=e.clientHeight!==e.scrollHeight,o=e.scrollTop===0,s=e.scrollTop+e.clientHeight===e.scrollHeight;e.parentElement&&(e.parentElement.classList.toggle("scroll-away-from-top",!o&&n),e.parentElement.classList.toggle("scroll-away-from-bottom",!s&&n))}};var Gn=class extends h{setup(){this.container=this.$el,this.input=this.$refs.input,this.userInfoContainer=this.$refs.userInfo,I(this.container,"a.dropdown-search-item","click",this.selectUser.bind(this))}selectUser(t,e){t.preventDefault(),this.input.value=e.getAttribute("data-id"),this.userInfoContainer.innerHTML=e.innerHTML,this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hide()}hide(){window.$components.firstOnElement(this.container,"dropdown").hide()}};var Yn=class extends h{setup(){this.checkboxes=this.$el.querySelectorAll('input[type="checkbox"]'),this.allCheckbox=this.$el.querySelector('input[type="checkbox"][value="all"]'),this.$el.addEventListener("change",t=>{t.target.checked&&t.target===this.allCheckbox?this.deselectIndividualEvents():t.target.checked&&(this.allCheckbox.checked=!1)})}deselectIndividualEvents(){for(let t of this.checkboxes)t!==this.allCheckbox&&(t.checked=!1)}};var Jn=class extends h{setup(){this.elem=this.$el,this.editContainer=this.$refs.editContainer,this.input=this.$refs.input,this.editor=null;let t={...window.editor_translations,imageUploadErrorText:this.$opts.imageUploadErrorText,serverUploadLimitText:this.$opts.serverUploadLimitText};window.importVersioned("wysiwyg").then(n=>{let o=this.input.value;this.editor=n.createPageEditorInstance(this.editContainer,o,{drawioUrl:this.getDrawIoUrl(),pageId:Number(this.$opts.pageId),darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.$opts.textDirection,translations:t}),window.wysiwyg=this.editor});let e=!1;this.input.form.addEventListener("submit",n=>{this.editor&&(e?e=!1:(n.preventDefault(),e=!0,this.editor.getContentAsHtml().then(o=>{this.input.value=o,setTimeout(()=>{this.input.form.requestSubmit()},5)})))})}getDrawIoUrl(){let t=document.querySelector("[drawio-url]");return t?t.getAttribute("drawio-url"):""}async getContent(){return{html:await this.editor.getContentAsHtml()}}};function Vo(i){for(let t=1;t<5;t++)i.shortcuts.add(`meta+${t}`,"",["FormatBlock",!1,`h${t+1}`]);i.shortcuts.add("meta+5","",["FormatBlock",!1,"p"]),i.shortcuts.add("meta+d","",["FormatBlock",!1,"p"]),i.shortcuts.add("meta+6","",["FormatBlock",!1,"blockquote"]),i.shortcuts.add("meta+q","",["FormatBlock",!1,"blockquote"]),i.shortcuts.add("meta+7","",["codeeditor",!1,"pre"]),i.shortcuts.add("meta+e","",["codeeditor",!1,"pre"]),i.shortcuts.add("meta+8","",["FormatBlock",!1,"code"]),i.shortcuts.add("meta+shift+E","",["FormatBlock",!1,"code"]),i.shortcuts.add("meta+o","","InsertOrderedList"),i.shortcuts.add("meta+p","","InsertUnorderedList"),i.shortcuts.add("meta+S","",()=>{window.$events.emit("editor-save-draft")}),i.shortcuts.add("meta+13","",()=>{window.$events.emit("editor-save-page")}),i.shortcuts.add("meta+9","",()=>{let t=i.selection.getNode(),e=t?t.closest(".callout"):null,n=["info","success","warning","danger"],s=(n.findIndex(a=>e&&e.classList.contains(a))+1)%n.length,r=n[s];i.formatter.apply(`callout${r}`)}),i.shortcuts.add("meta+shift+K","",()=>{let t=window.$components.first("entity-selector-popup"),e=i.selection.getContent({format:"text"}).trim();t.show(n=>{i.selection.isCollapsed()?i.insertContent(i.dom.createHTML("a",{href:n.link},i.dom.encode(n.name))):i.formatter.apply("link",{href:n.link}),i.selection.collapse(!1),i.focus()},{initialValue:e,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})})}function Wo(i){window.$events.listen("editor::replace",({html:t})=>{i.setContent(t)}),window.$events.listen("editor::append",({html:t})=>{let e=i.getContent()+t;i.setContent(e)}),window.$events.listen("editor::prepend",({html:t})=>{let e=t+i.getContent();i.setContent(e)}),window.$events.listen("editor::insert",({html:t})=>{i.insertContent(t)}),window.$events.listen("editor::focus",()=>{i.initialized&&i.focus()})}function hr(i,t){let e=i.dom.get(encodeURIComponent(t).replace(/!/g,"%21"));e&&(e.scrollIntoView(),i.selection.select(e,!0),i.selection.collapse(!1),i.focus())}function Uo(i){let e=new URL(window.location).searchParams.get("content-id");e&&hr(i,e)}var Dt,Zn;function ur(i){return i&&!!(i.textContent||i.innerText)}async function pr(i,t){if(i===null||i.type.indexOf("image")!==0)throw new Error("Not an image file");let e=i.name||`image-${Date.now()}.png`,n=new FormData;return n.append("file",i,e),n.append("uploaded_to",t),(await window.$http.post(window.baseUrl("/images/gallery"),n)).data}function jo(i,t,e){let n=new Wt(e.clipboardData||e.dataTransfer);if(!n.hasItems()||n.containsTabularData())return;let o=n.getImages();for(let s of o){let r=`image-${Math.random().toString(16).slice(2)}`,a=window.baseUrl("/loading.gif");e.preventDefault(),setTimeout(()=>{i.insertContent(`

    `),pr(s,t.pageId).then(l=>{let c=l.name.replace(/"/g,""),u=`${c}`,p=i.dom.create("a",{target:"_blank",href:l.url},u);i.dom.replace(p,r)}).catch(l=>{i.dom.remove(r),window.$events.error(l?.data?.message||t.translations.imageUploadErrorText),console.error(l)})},10)}}function mr(i){let t=i.selection.getNode();t.nodeName==="IMG"&&(Dt=i.dom.getParent(t,".mceTemp"),!Dt&&t.parentNode.nodeName==="A"&&!ur(t.parentNode)&&(Dt=t.parentNode)),t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="false"&&(Zn=t)}function fr(i,t,e){let{dom:n}=i,o=window.tinymce.dom.RangeUtils.getCaretRangeFromPoint(e.clientX,e.clientY,i.getDoc()),s=e.dataTransfer&&e.dataTransfer.getData("bookstack/template");s&&(e.preventDefault(),window.$http.get(`/templates/${s}`).then(r=>{i.selection.setRng(o),i.undoManager.transact(()=>{i.execCommand("mceInsertContent",!1,r.data.html)})})),n.getParent(o.startContainer,".mceTemp")?e.preventDefault():Dt&&(e.preventDefault(),i.undoManager.transact(()=>{i.selection.setRng(o),i.selection.setNode(Dt),n.remove(Dt)})),!e.isDefaultPrevented()&&Zn&&(e.preventDefault(),i.undoManager.transact(()=>{let r=i.selection.getNode(),a=i.selection.getRng(),l=r.closest("body > *");a.startOffset>a.startContainer.length/2?l.after(Zn):l.before(Zn)})),e.isDefaultPrevented()||jo(i,t,e),Dt=null}function gr(i,t){t.preventDefault(),i.focus();let n=window.tinymce.dom.RangeUtils.getCaretRangeFromPoint(t.clientX??0,t.clientY??0,i.getDoc());i.selection.setRng(n)}function zo(i,t){i.on("dragover",e=>gr(i,e)),i.on("dragstart",()=>mr(i)),i.on("drop",e=>fr(i,t,e)),i.on("paste",e=>jo(i,t,e))}function Ko(i){return["undo redo","styles","bold italic underline forecolor backcolor formatoverflow","alignleft aligncenter alignright alignjustify","bullist numlist listoverflow",i.textDirection==="rtl"?"ltr rtl":"","link customtable imagemanager-insert insertoverflow","code about fullscreen"].filter(n=>!!n).join(" | ")}function vr(i){i.ui.registry.addGroupToolbarButton("formatoverflow",{icon:"more-drawer",tooltip:"More",items:"strikethrough superscript subscript inlinecode removeformat"}),i.ui.registry.addGroupToolbarButton("listoverflow",{icon:"more-drawer",tooltip:"More",items:"tasklist outdent indent"}),i.ui.registry.addGroupToolbarButton("insertoverflow",{icon:"more-drawer",tooltip:"More",items:"customhr codeeditor drawio media details"})}function wr(i){i.ui.registry.addContextToolbar("linkcontexttoolbar",{predicate(t){return t.closest("a")!==null},position:"node",scope:"node",items:"link unlink openlink"})}function br(i){i.ui.registry.addContextToolbar("imagecontexttoolbar",{predicate(t){return t.closest("img")!==null&&!t.hasAttribute("data-mce-object")},position:"node",scope:"node",items:"image"})}function yr(i){i.ui.registry.addContextToolbar("objectcontexttoolbar",{predicate(t){return t.closest("img")!==null&&t.hasAttribute("data-mce-object")},position:"node",scope:"node",items:"media"})}function Xo(i){vr(i),wr(i),br(i),yr(i)}var Er={"table-delete-column":'',"table-delete-row":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',table:'',"table-delete-table":''};function Go(i){for(let[t,e]of Object.entries(Er))i.ui.registry.addIcon(t,e)}function Cr(i){i.serializer.addNodeFilter("br",t=>{for(let e of t)if(e.parent&&e.parent.name==="code"){let n=window.tinymce.html.Node.create("#text");n.value=` -`,e.replace(n)}})}function Lr(i){i.parser.addNodeFilter("div",t=>{for(let e of t){let n=e.attr("id")||"",o=e.attr("class")||"";(n==="pointer"||o.includes("pointer"))&&e.remove()}})}function Yo(i){Cr(i),Lr(i)}function Jo(i){return i.tagName.toLowerCase()==="code-block"}function Qo(i,t,e,n,o){let s=window.$components.first("code-editor"),r=i.selection.getBookmark();s.open(t,e,n,(a,l)=>{o(a,l),i.focus(),i.selection.moveToBookmark(r)},()=>{i.focus(),i.selection.moveToBookmark(r)})}function Zo(i,t){let e=t.getAttribute("dir")||"";Qo(i,t.getContent(),t.getLanguage(),e,(n,o)=>{t.setContent(n,o)})}function xr(i){let t=i.getDoc(),e=t.defaultView;class n extends e.HTMLElement{constructor(){super();d(this,"editor",null);this.attachShadow({mode:"open"});let r=document.head.querySelectorAll('link[rel="stylesheet"]:not([media="print"]),style'),a=Array.from(r).map(c=>c.cloneNode(!0)),l=document.createElement("div");l.style.pointerEvents="none",l.contentEditable="false",l.classList.add("CodeMirrorContainer"),l.classList.toggle("dark-mode",document.documentElement.classList.contains("dark-mode")),this.shadowRoot.append(...a,l)}getLanguage(){let r=c=>(c.split(" ").filter(p=>p.startsWith("language-"))[0]||"").replace("language-",""),a=this.querySelector("code"),l=this.querySelector("pre");return r(l.className)||a&&r(a.className)||""}setContent(r,a){this.editor&&(this.editor.setContent(r),this.editor.setMode(a,r));let l=this.querySelector("pre");l||(l=t.createElement("pre"),this.append(l)),l.innerHTML="";let c=t.createElement("code");l.append(c),c.innerText=r,c.className=`language-${a}`}getContent(){let r=this.querySelector("code")||this.querySelector("pre"),a=document.createElement("pre");a.innerHTML=r.innerHTML.replace(/\ufeff/g,"");let l=a.querySelectorAll("br");for(let c of l)c.replaceWith(` -`);return a.textContent}connectedCallback(){let r=Date.now();if(this.editor)return;this.cleanChildContent();let a=this.getContent(),c=a.split(` -`).length*19.2+18+24;this.style.height=`${c}px`;let u=this.shadowRoot.querySelector(".CodeMirrorContainer"),p=f=>{this.editor=f.wysiwygView(u,this.shadowRoot,a,this.getLanguage()),setTimeout(()=>{this.style.height=null},12)};window.importVersioned("code").then(f=>{let v=Date.now()-r<20?20:0;setTimeout(()=>p(f),v)})}cleanChildContent(){let r=this.querySelector("pre");if(r)for(let a of r.childNodes)a.nodeName==="#text"&&a.textContent==="\uFEFF"&&a.remove()}}e.customElements.define("code-block",n)}function Tr(i){i.ui.registry.addIcon("codeblock",''),i.ui.registry.addButton("codeeditor",{tooltip:"Insert code block",icon:"codeblock",onAction(){i.execCommand("codeeditor")}}),i.ui.registry.addButton("editcodeeditor",{tooltip:"Edit code block",icon:"edit-block",onAction(){i.execCommand("codeeditor")}}),i.addCommand("codeeditor",()=>{let t=i.selection.getNode(),e=t.ownerDocument;if(Jo(t))Zo(i,t);else{let n=i.selection.getContent({format:"text"}),o=document.dir==="rtl"?"ltr":"";Qo(i,n,"",o,(s,r)=>{let a=e.createElement("pre"),l=e.createElement("code");l.classList.add(`language-${r}`),l.innerText=s,o&&a.setAttribute("dir",o),a.append(l),i.insertContent(a.outerHTML)})}}),i.on("dblclick",()=>{let t=i.selection.getNode();Jo(t)&&Zo(i,t)}),i.on("PreInit",()=>{i.parser.addNodeFilter("pre",t=>{for(let e of t){let n=window.tinymce.html.Node.create("code-block",{contenteditable:"false"}),o=e.children().filter(a=>a.name==="code")[0]||null,s=e.attr("dir")||o&&o.attr("dir")||"";s&&n.attr("dir",s);let r=e.getAll("span");for(let a of r)a.unwrap();e.attr("style",null),e.wrap(n)}}),i.parser.addNodeFilter("code-block",t=>{for(let e of t)e.attr("contenteditable","false")}),i.serializer.addNodeFilter("code-block",t=>{for(let e of t){let n=e.attr("dir");n&&e.firstChild?e.firstChild.attr("dir",n):e.firstChild&&e.firstChild.attr("dir",null),e.unwrap()}})}),i.ui.registry.addContextToolbar("codeeditor",{predicate(t){return t.nodeName.toLowerCase()==="code-block"},items:"editcodeeditor",position:"node",scope:"node"}),i.on("PreInit",()=>{xr(i)})}function ts(){return Tr}function Qn(i){return new Promise((t,e)=>{i.oncomplete=i.onsuccess=()=>t(i.result),i.onabort=i.onerror=()=>e(i.error)})}function Sr(i,t){let e,n=()=>{if(e)return e;let o=indexedDB.open(i);return o.onupgradeneeded=()=>o.result.createObjectStore(t),e=Qn(o),e.then(s=>{s.onclose=()=>e=void 0},()=>{}),e};return(o,s)=>n().then(r=>s(r.transaction(t,o).objectStore(t)))}var Hi;function Bi(){return Hi||(Hi=Sr("keyval-store","keyval")),Hi}function Pi(i,t=Bi()){return t("readonly",e=>Qn(e.get(i)))}function Ri(i,t,e=Bi()){return e("readwrite",n=>(n.put(t,i),Qn(n.transaction)))}function Oi(i,t=Bi()){return t("readwrite",e=>(e.delete(i),Qn(e.transaction)))}var it=null,_i,ti,Ni,Fi="last-drawing-save";function qi(i){it?.contentWindow?.postMessage(JSON.stringify(i),_i)}function $r(i){Ri(Fi,i.data),Ni&&Ni(i.data).then(()=>{Oi(Fi)})}function Mr(i){qi({action:"export",format:"xmlpng",xml:i.xml,spin:"Updating drawing"})}function Dr(){ti&&ti().then(i=>{qi({action:"load",autosave:1,xml:i})})}function Ar(){let i={};it&&(window.$events.emitPublic(it,"editor-drawio::configure",{config:i}),qi({action:"configure",config:i}))}function es(){window.removeEventListener("message",ns),it&&document.body.removeChild(it)}function ns(i){if(!i.data||i.data.length<1||i.origin!==_i)return;let t=JSON.parse(i.data);t.event==="init"?Dr():t.event==="exit"?es():t.event==="save"?Mr(t):t.event==="export"?$r(t):t.event==="configure"&&Ar()}async function Ir(){let i=await Pi(Fi),t=document.getElementById("unsaved-drawing-dialog");t||console.error("Missing expected unsaved-drawing dialog"),i&&t&&await window.$components.firstOnElement(t,"confirm-dialog").show()&&(ti=async()=>i)}async function is(i,t,e){ti=t,Ni=e,await Ir(),it=document.createElement("iframe"),it.setAttribute("frameborder","0"),window.addEventListener("message",ns),it.setAttribute("src",i),it.setAttribute("class","fullscreen"),it.style.backgroundColor="#FFFFFF",document.body.appendChild(it),_i=new URL(i).origin}async function Vi(i,t){let e={image:i,uploaded_to:t};return(await window.$http.post(window.baseUrl("/images/drawio"),e)).data}function ei(){es()}async function os(i){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${i}`))).data.content}`}catch(t){throw t instanceof Lt&&window.$events.showResponseError(t),ei(),t}}var K=null,It=null,At={};function Wi(i){return i.hasAttribute("drawio-diagram")}function Br(i,t=null){K=i,It=t,window.$components.first("image-manager").show(n=>{if(t){let o=t.querySelector("img");K.undoManager.transact(()=>{K.dom.setAttrib(o,"src",n.url),K.dom.setAttrib(t,"drawio-diagram",n.id)})}else{let o=`
    `;K.insertContent(o)}},"drawio")}async function Pr(i){let t=window.baseUrl("/loading.gif"),e=s=>{s.status===413?window.$events.emit("error",At.translations.serverUploadLimitText):window.$events.emit("error",At.translations.imageUploadErrorText),console.error(s)};if(It){ei();let s=It.querySelector("img");try{let r=await Vi(i,At.pageId);K.undoManager.transact(()=>{K.dom.setAttrib(s,"src",r.url),K.dom.setAttrib(It,"drawio-diagram",r.id)})}catch(r){throw e(r),new Error(`Failed to save image with error: ${r}`)}return}await to(5);let n=`drawing-${Math.random().toString(16).slice(2)}`,o=`drawing-wrap-${Math.random().toString(16).slice(2)}`;K.insertContent(`
    `),ei();try{let s=await Vi(i,At.pageId);K.undoManager.transact(()=>{K.dom.setAttrib(n,"src",s.url),K.dom.setAttrib(o,"drawio-diagram",s.id)})}catch(s){throw K.dom.remove(o),e(s),new Error(`Failed to save image with error: ${s}`)}}function Rr(){if(!It)return Promise.resolve("");let i=It.getAttribute("drawio-diagram");return os(i)}function ss(i,t=null){K=i,It=t,is(At.drawioUrl,Rr,Pr)}function Or(i){i.addCommand("drawio",()=>{let t=i.selection.getNode();ss(i,Wi(t)?t:null)}),i.ui.registry.addIcon("diagram",``),i.ui.registry.addSplitButton("drawio",{tooltip:"Insert/edit drawing",icon:"diagram",onAction(){i.execCommand("drawio"),window.document.body.dispatchEvent(new Event("mousedown",{bubbles:!0}))},fetch(t){t([{type:"choiceitem",text:"Drawing manager",value:"drawing-manager"}])},onItemAction(t,e){if(e==="drawing-manager"){let n=i.selection.getNode();Br(i,Wi(n)?n:null)}}}),i.on("dblclick",()=>{let t=i.selection.getNode();Wi(t)&&ss(i,t)}),i.on("SetContent",()=>{let t=i.dom.select("body > div[drawio-diagram]");t.length&&i.undoManager.transact(()=>{for(let e of t)e.setAttribute("contenteditable","false")})})}function rs(i){return At=i,Or}function Nr(i){i.addCommand("InsertHorizontalRule",()=>{let t=document.createElement("hr"),e=i.selection.getNode(),{parentNode:n}=e;n.insertBefore(t,e)}),i.ui.registry.addButton("customhr",{icon:"horizontal-rule",tooltip:"Insert horizontal line",onAction(){i.execCommand("InsertHorizontalRule")}})}function as(){return Nr}function Fr(i){i.ui.registry.addButton("imagemanager-insert",{title:"Insert image",icon:"image",tooltip:"Insert image",onAction(){window.$components.first("image-manager").show(e=>{let n=e.thumbs?.display||e.url,o=``;o+=`${e.name}`,o+="",i.execCommand("mceInsertContent",!1,o)},"gallery")}})}function ls(){return Fr}function _r(i){let t={title:"About the WYSIWYG Editor",url:window.baseUrl("/help/tinymce")};i.ui.registry.addButton("about",{icon:"help",tooltip:"About the editor",onAction(){window.tinymce.activeEditor.windowManager.openUrl(t)}})}function cs(){return _r}var ds=["p","h1","h2","h3","h4","h5","h6","div","blockquote","pre","code-block","details","ul","ol","table","hr"];function ni(i){return i.selection.getNode().closest("details")}function qr(i,t){let e=ni(i);e&&i.undoManager.transact(()=>{let n=e.querySelector("summary");n||(n=document.createElement("summary"),e.prepend(n)),n.textContent=t})}function Vr(i){return{title:"Edit collapsible block",body:{type:"panel",items:[{type:"input",name:"summary",label:"Toggle label"}]},buttons:[{type:"cancel",text:"Cancel"},{type:"submit",text:"Save",primary:!0}],onSubmit(t){let{summary:e}=t.getData();qr(i,e),t.close()}}}function Wr(i){let t=i.querySelector("summary");return t?t.textContent:""}function hs(i){let t=ni(i);i.windowManager.open(Vr(i)).setData({summary:Wr(t)})}function Ur(i){let t=i.selection.getNode().closest("details"),e=i.selection.getBookmark();if(t){let n=t.querySelectorAll("details > *:not(summary, doc-root), doc-root > *");i.undoManager.transact(()=>{for(let o of n)t.parentNode.insertBefore(o,t);t.remove()})}i.focus(),i.selection.moveToBookmark(e)}function Ui(i){i.attr("contenteditable",null);let t=!1;for(let e of i.children())e.name==="doc-root"&&(e.unwrap(),t=!0);t&&Ui(i)}function jr(i){Ui(i),i.attr("contenteditable","false");let t=window.tinymce.html.Node.create("doc-root",{contenteditable:"true"}),e=null;for(let n of i.children()){if(n.name==="summary")continue;ds.includes(n.name)?(t.append(n),e=null):(e||(e=window.tinymce.html.Node.create("p"),t.append(e)),e.append(n))}i.append(t)}function zr(i){i.parser.addNodeFilter("details",t=>{for(let e of t)jr(e)}),i.serializer.addNodeFilter("details",t=>{for(let e of t)Ui(e),e.attr("open",null)}),i.serializer.addNodeFilter("doc-root",t=>{for(let e of t)e.unwrap()})}function Kr(i){i.ui.registry.addIcon("details",''),i.ui.registry.addIcon("togglefold",''),i.ui.registry.addIcon("togglelabel",''),i.ui.registry.addButton("details",{icon:"details",tooltip:"Insert collapsible block",onAction(){i.execCommand("InsertDetailsBlock")}}),i.ui.registry.addButton("removedetails",{icon:"table-delete-table",tooltip:"Unwrap",onAction(){Ur(i)}}),i.ui.registry.addButton("editdetials",{icon:"togglelabel",tooltip:"Edit label",onAction(){hs(i)}}),i.on("dblclick",t=>{!ni(i)||t.target.closest("doc-root")||hs(i)}),i.ui.registry.addButton("toggledetails",{icon:"togglefold",tooltip:"Toggle open/closed",onAction(){ni(i).toggleAttribute("open"),i.focus()}}),i.addCommand("InsertDetailsBlock",()=>{let t=i.selection.getContent({format:"html"}),e=document.createElement("details"),n=document.createElement("summary"),o=`details-${Date.now()}`;e.setAttribute("data-id",o),e.appendChild(n),t||(t="


    "),e.innerHTML+=t,i.insertContent(e.outerHTML),i.focus();let s=i.dom.select(`[data-id="${o}"]`)[0]||null;if(s){let r=s.querySelector("doc-root > *");r&&r.focus(),s.removeAttribute("data-id")}}),i.ui.registry.addContextToolbar("details",{predicate(t){return t.nodeName.toLowerCase()==="details"},items:"editdetials toggledetails removedetails",position:"node",scope:"node"}),i.on("PreInit",()=>{zr(i)})}function us(){return Kr}function Xr(i){i.ui.registry.addIcon("tableclearformatting",'');let t={items:" | tablerowheader",predicate(n){let o=n.nodeName.toLowerCase()==="table",s=i.selection.getNode(),r=s.closest("table");return!o||!r?!1:r.querySelector("tr").contains(s)},position:"node",scope:"node"};i.ui.registry.addContextToolbar("customtabletoolbarfirstrow",t),i.addCommand("tableclearformatting",()=>{let n=i.dom.getParent(i.selection.getStart(),"table");if(!n)return;let o=["class","style","width","height"],s=[n,...n.querySelectorAll(o.map(r=>`[${r}]`).join(","))];for(let r of s)for(let a of o)r.removeAttribute(a)}),i.addCommand("tableclearsizes",()=>{let n=i.dom.getParent(i.selection.getStart(),"table");if(!n)return;let o=[n,...n.querySelectorAll("tr,td,th,tbody,thead,tfoot,th>*,td>*")];for(let s of o)s.removeAttribute("width"),s.removeAttribute("height"),s.style.height=null,s.style.width=null});let e=()=>{let n=i.ui.registry.getAll().buttons;i.ui.registry.addMenuButton("customtable",{...n.table,fetch:o=>o("inserttable | cell row column | advtablesort | tableprops tableclearformatting tableclearsizes deletetable")}),i.ui.registry.addMenuItem("tableclearformatting",{icon:"tableclearformatting",text:"Clear table formatting",onSetup:n.tableprops.onSetup,onAction(){i.execCommand("tableclearformatting")}}),i.ui.registry.addMenuItem("tableclearsizes",{icon:"resize",text:"Resize to contents",onSetup:n.tableprops.onSetup,onAction(){i.execCommand("tableclearsizes")}}),i.off("PreInit",e)};i.on("PreInit",e)}function ps(){return Xr}function Gr(i){let t=i.closest("li");return t&&t.parentNode.nodeName==="UL"&&t.classList.contains("task-list-item")}function Yr(i,t,e){let n=t.getBoundingClientRect();i.clientX<=n.right&&i.clientX>=n.left&&i.clientY>=n.top&&i.clientY<=n.bottom||e.undoManager.transact(()=>{t.hasAttribute("checked")?t.removeAttribute("checked"):t.setAttribute("checked","checked")})}function Jr(i){i.attr("class","task-list-item");for(let t of i.children())t.name==="input"&&(t.attr("checked")==="checked"&&i.attr("checked","checked"),t.remove())}function Zr(i){let t=i.attr("checked")==="checked";i.attr("checked",null);let e={type:"checkbox",disabled:"disabled"};t&&(e.checked="checked");let n=window.tinymce.html.Node.create("input",e);n.shortEnded=!0,i.firstChild?i.insert(n,i.firstChild,!0):i.append(n)}function Qr(i){i.ui.registry.addIcon("tasklist",''),i.ui.registry.addToggleButton("tasklist",{tooltip:"Task list",icon:"tasklist",active:!1,onAction(n){n.isActive()?i.execCommand("RemoveList"):i.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:"task-list-item"},"list-style-type":"tasklist"})},onSetup(n){i.on("NodeChange",o=>{let s=o.parents.find(a=>a.nodeName==="LI"),r=s&&s.classList.contains("task-list-item");n.setActive(!!r)})}});let t=i.ui.registry.getAll().buttons.bullist;t.onSetup=function(o){i.on("NodeChange",s=>{let r=s.parents.find(c=>c.nodeName==="LI"),a=r&&r.classList.contains("task-list-item"),l=r&&r.parentNode.nodeName==="UL";o.setActive(!!(l&&!a))})},t.onAction=function(){Gr(i.selection.getNode())&&i.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}}),i.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:null}})};let e=i.ui.registry.getAll().buttons.numlist;e.onAction=function(){i.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}})},i.on("PreInit",()=>{i.parser.addNodeFilter("li",n=>{for(let o of n)o.attributes.map.class==="task-list-item"&&Jr(o)}),i.serializer.addNodeFilter("li",n=>{for(let o of n)o.attributes.map.class==="task-list-item"&&Zr(o)})}),i.on("click",n=>{let o=n.target;o.nodeName==="LI"&&o.classList.contains("task-list-item")&&(Yr(n,o,i),n.preventDefault())})}function ms(){return Qr}function fs(i){function t(e){let n=e.querySelector("iframe, video");if(!n)return;let o=[...n.classList.values()].filter(r=>r.startsWith("align-")),s=[...e.classList.values()].filter(r=>r.startsWith("align-"));e.classList.remove(...s),e.classList.add(...o)}i.on("SetContent",()=>{let e=i.dom.select("span.mce-preview-object");for(let n of e)t(n)}),i.on("FormatApply",e=>{let n=e.format.startsWith("align");if(!(e.node instanceof i.dom.doc.defaultView.HTMLElement)||!n||!e.node.matches(".mce-preview-object"))return;let s=e.node.querySelector("iframe, video");if(s){let r=(i.formatter.get(e.format)[0]?.classes||[])[0],a=!s.classList.contains(r),c=(e.node.getAttribute("data-mce-p-class")||"").split(" ").filter(p=>!p.startsWith("align-"));a&&c.push(r);let u=c.join(" ");e.node.setAttribute("data-mce-p-class",u),s.setAttribute("class",u),i.formatter.apply(e.format,{},s),t(e.node)}})}function gs(i){let t=i.querySelectorAll('[align],[style*="text-align"],.align-center,.align-left,.align-right');for(let e of t)e.removeAttribute("align"),e.style.textAlign=null,e.classList.remove("align-center","align-right","align-left")}function ji(i){let t=i.querySelectorAll('[dir],[style*="direction"]');for(let e of t)e.removeAttribute("dir"),e.style.direction=null;gs(i),i.style.direction=null,i.style.textAlign=null,i.removeAttribute("align")}function vs(i){let t=[];i.on("TableSelectionChange",n=>{t=(n.cells||[]).map(o=>o.dom)}),i.on("TableSelectionClear",()=>{t=[]});let e={RemoveFormat:n=>{let o=["class","style","width","height","align"];for(let s of o)n.removeAttribute(s)},mceDirectionLTR:n=>{n.setAttribute("dir","ltr"),ji(n)},mceDirectionRTL:n=>{n.setAttribute("dir","rtl"),ji(n)},JustifyLeft:n=>{n.removeAttribute("align"),gs(n)}};e.JustifyRight=e.JustifyLeft,e.JustifyCenter=e.JustifyLeft,e.JustifyFull=e.JustifyLeft,i.on("ExecCommand",n=>{let o=e[n.command];if(o)for(let s of t)o(s)})}function ws(i){i.on("ExecCommand",t=>{let e=t.command;if(e!=="mceDirectionLTR"&&e!=="mceDirectionRTL")return;let n=i.selection.getSelectedBlocks();for(let o of n)ji(o)})}var ta=[{title:"Large Header",format:"h2",preview:"color: blue;"},{title:"Medium Header",format:"h3"},{title:"Small Header",format:"h4"},{title:"Tiny Header",format:"h5"},{title:"Paragraph",format:"p",exact:!0,classes:""},{title:"Blockquote",format:"blockquote"},{title:"Callouts",items:[{title:"Information",format:"calloutinfo"},{title:"Success",format:"calloutsuccess"},{title:"Warning",format:"calloutwarning"},{title:"Danger",format:"calloutdanger"}]}],ea={alignleft:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video",classes:"align-left"},aligncenter:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video",classes:"align-center"},alignright:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video",classes:"align-right"},calloutsuccess:{block:"p",exact:!0,attributes:{class:"callout success"}},calloutinfo:{block:"p",exact:!0,attributes:{class:"callout info"}},calloutwarning:{block:"p",exact:!0,attributes:{class:"callout warning"}},calloutdanger:{block:"p",exact:!0,attributes:{class:"callout danger"}}},na=["#BFEDD2","","#FBEEB8","","#F8CAC6","","#ECCAFA","","#C2E0F4","","#2DC26B","","#F1C40F","","#E03E2D","","#B96AD9","","#3598DB","","#169179","","#E67E23","","#BA372A","","#843FA1","","#236FA1","","#ECF0F1","","#CED4D9","","#95A5A6","","#7E8C8D","","#34495E","","#000000","","#ffffff",""];function ia(i,t,e){if(e.filetype==="file"){let n=window.$components.first("entity-selector-popup"),o=this.selection.getContent({format:"text"}).trim();n.show(s=>{i(s.link,{text:s.name,title:s.name})},{initialValue:o,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}e.filetype==="image"&&window.$components.first("image-manager").show(o=>{i(o.url,{alt:o.name})},"gallery")}function oa(i){let t=["image","table","link","autolink","fullscreen","code","customhr","autosave","lists","codeeditor","media","imagemanager","about","details","tasklist","tableadditions",i.textDirection==="rtl"?"directionality":""];return window.tinymce.PluginManager.add("codeeditor",ts()),window.tinymce.PluginManager.add("customhr",as()),window.tinymce.PluginManager.add("imagemanager",ls()),window.tinymce.PluginManager.add("about",cs()),window.tinymce.PluginManager.add("details",us()),window.tinymce.PluginManager.add("tasklist",ms()),window.tinymce.PluginManager.add("tableadditions",ps()),i.drawioUrl&&(window.tinymce.PluginManager.add("drawio",rs(i)),t.push("drawio")),t.filter(e=>!!e)}function sa(i){let t=document.head.innerHTML.split(` +var Yi=Object.defineProperty;var Ji=i=>{throw TypeError(i)};var xs=(i,t,e)=>t in i?Yi(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Ts=(i,t)=>{for(var e in t)Yi(i,e,{get:t[e],enumerable:!0})};var c=(i,t,e)=>xs(i,typeof t!="symbol"?t+"":t,e),Ss=(i,t,e)=>t.has(i)||Ji("Cannot "+e);var Zi=(i,t,e)=>t.has(i)?Ji("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e);var Jt=(i,t,e)=>(Ss(i,t,"access private method"),e);var ge=class{constructor(){c(this,"listeners",{});c(this,"stack",[])}emit(t,e={}){this.stack.push({name:t,data:e});let n=this.listeners[t]||[];for(let o of n)o(e)}listen(t,e){typeof this.listeners[t]>"u"&&(this.listeners[t]=[]),this.listeners[t].push(e)}remove(t,e){let n=this.listeners[t]||[],o=n.indexOf(e);o!==-1&&n.splice(o,1)}emitPublic(t,e,n){let o=new CustomEvent(e,{detail:n,bubbles:!0});t.dispatchEvent(o)}success(t){this.emit("success",t)}error(t){this.emit("error",t)}showValidationErrors(t){if(t.status===422&&t.data){let e=Object.values(t.data).flat().join(` +`);this.error(e)}}showResponseError(t){t.status&&t.status>=400&&typeof t.data=="object"&&t.data.message&&this.error(t.data.message)}};var Lt=class extends Error{constructor(e,n){super(e.statusText);c(this,"data");c(this,"headers");c(this,"original");c(this,"redirected");c(this,"status");c(this,"statusText");c(this,"url");this.data=n,this.headers=e.headers,this.redirected=e.redirected,this.status=e.status,this.statusText=e.statusText,this.url=e.url,this.original=e}},ve=class{async getResponseContent(t){if(t.status===204)return null;let n=(t.headers.get("Content-Type")||"").split(";")[0].split("/").pop();return n==="javascript"||n==="json"?t.json():t.text()}createXMLHttpRequest(t,e,n={}){let o=document.querySelector("meta[name=token]")?.getAttribute("content"),s=new XMLHttpRequest;for(let[r,a]of Object.entries(n))s.addEventListener(r,a.bind(s));return s.open(t,e),s.withCredentials=!0,s.setRequestHeader("X-CSRF-TOKEN",o||""),s}async request(t,e={}){let n=t;if(n.startsWith("http")||(n=window.baseUrl(n)),e.params){let d=new URL(n);for(let u of Object.keys(e.params)){let p=e.params[u];typeof p<"u"&&p!==null&&d.searchParams.set(u,p)}n=d.toString()}let o=document.querySelector("meta[name=token]")?.getAttribute("content")||"",s={...e,credentials:"same-origin"};s.headers={...s.headers||{},baseURL:window.baseUrl(""),"X-CSRF-TOKEN":o};let r=await fetch(n,s),a=await this.getResponseContent(r)||"",l={data:a,headers:r.headers,redirected:r.redirected,status:r.status,statusText:r.statusText,url:r.url,original:r};if(!r.ok)throw new Lt(r,a);return l}async dataRequest(t,e,n){let o={method:t,body:n};return typeof n=="object"&&!(n instanceof FormData)&&(o.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},o.body=JSON.stringify(n)),n instanceof FormData&&t!=="post"&&(n.append("_method",t),o.method="post"),this.request(e,o)}async get(t,e={}){return this.request(t,{method:"GET",params:e})}async post(t,e=null){return this.dataRequest("POST",t,e)}async put(t,e=null){return this.dataRequest("PUT",t,e)}async patch(t,e=null){return this.dataRequest("PATCH",t,e)}async delete(t,e=null){return this.dataRequest("DELETE",t,e)}formatErrorResponseText(t){let e=t.startsWith("{")?JSON.parse(t):{message:t};if(!e)return t;if(e.message||e.error)return e.message||e.error;let n=Object.values(e);return n.every(s=>Array.isArray(s)&&s.every(r=>typeof r=="string"))?n.flat().join(" "):t}};var we=class{choice(t,e,n={}){n=Object.assign({},{count:String(e)},n);let o=t.split("|"),s=/^{([0-9]+)}/,r=/^\[([0-9]+),([0-9*]+)]/,a=null;for(let l of o){let d=l.match(s);if(d!==null&&Number(d[1])===e){a=l.replace(s,"").trim();break}let u=l.match(r);if(u!==null&&Number(u[1])<=e&&(u[2]==="*"||Number(u[2])>=e)){a=l.replace(r,"").trim();break}}return a===null&&o.length>1&&(a=e===1?o[0]:o[1]),a===null&&(a=o[0]),this.performReplacements(a,n)}performReplacements(t,e){let n=t.match(/:(\S+)/g);if(n===null)return t;let o=t;for(let s of n){let r=s.substring(1);typeof e[r]>"u"||(o=o.replace(s,e[r]))}return o}};var Ki={};Ts(Ki,{AddRemoveRows:()=>Ce,AjaxDeleteRow:()=>Le,AjaxForm:()=>xe,ApiNav:()=>Te,Attachments:()=>Se,AttachmentsList:()=>ke,AutoSubmit:()=>Me,AutoSuggest:()=>$e,BackToTop:()=>De,BookSort:()=>Xe,ChapterContents:()=>Ye,CodeEditor:()=>Je,CodeHighlighter:()=>Ze,CodeTextarea:()=>Qe,Collapsible:()=>tn,ConfirmDialog:()=>en,CustomCheckbox:()=>nn,DetailsHighlighter:()=>on,Dropdown:()=>sn,DropdownSearch:()=>rn,Dropzone:()=>an,EditorToolbox:()=>ln,EntityPermissions:()=>cn,EntitySearch:()=>dn,EntitySelector:()=>hn,EntitySelectorPopup:()=>un,EventEmitSelect:()=>pn,ExpandToggle:()=>mn,GlobalSearch:()=>fn,HeaderMobileToggle:()=>gn,ImageManager:()=>vn,ImagePicker:()=>wn,ListSortControl:()=>bn,LoadingButton:()=>yn,MarkdownEditor:()=>En,NewUserPassword:()=>Cn,Notification:()=>Ln,OptionalInput:()=>xn,PageComment:()=>Tn,PageCommentReference:()=>Sn,PageComments:()=>kn,PageDisplay:()=>$n,PageEditor:()=>Mn,PagePicker:()=>An,PermissionsTable:()=>In,Pointer:()=>Hn,Popup:()=>Bn,SettingAppColorScheme:()=>Pn,SettingColorPicker:()=>Rn,SettingHomepageControl:()=>On,ShelfSort:()=>_n,ShortcutInput:()=>Vn,Shortcuts:()=>qn,SortRuleManager:()=>Un,SortableList:()=>Wn,SubmitOnChange:()=>jn,Tabs:()=>jt,TagManager:()=>zn,TemplateManager:()=>Kn,ToggleSwitch:()=>Xn,TriLayout:()=>Gn,UserSelect:()=>Yn,WebhookEvents:()=>Jn,WysiwygEditor:()=>Zn,WysiwygEditorTinymce:()=>oi,WysiwygInput:()=>si});function mt(i,t,e){let n=null;return function(...s){let r=this,a=function(){n=null,e||i.apply(r,s)},l=e&&!n;n&&clearTimeout(n),n=window.setTimeout(a,t),l&&i.apply(r,s)}}function ks(i){return i.nodeName==="DETAILS"}function xt(i){if(!i)return;let t=i;for(;t.parentElement;)t=t.parentElement,ks(t)&&!t.open&&(t.open=!0);i.scrollIntoView({behavior:"smooth"});let e=getComputedStyle(document.body).getPropertyValue("--color-link");i.style.outline=`2px dashed ${e}`,i.style.outlineOffset="5px",i.style.removeProperty("transition"),setTimeout(()=>{i.style.transition="outline linear 3s",i.style.outline="2px dashed rgba(0, 0, 0, 0)";let n=()=>{i.removeEventListener("transitionend",n),i.style.removeProperty("transition"),i.style.removeProperty("outline"),i.style.removeProperty("outlineOffset")};i.addEventListener("transitionend",n)},1e3)}function Qi(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function to(){let i=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${i()+i()}-${i()}-${i()}-${i()}-${i()}${i()}${i()}`}function eo(i){return new Promise(t=>{setTimeout(t,i)})}function no(i){let t=i,e=document.querySelector('meta[name="base-url"]');if(!e)throw new Error("Could not find expected base-url meta tag in document");let n=e.getAttribute("content")||"";return n[n.length-1]==="/"&&(n=n.slice(0,n.length-1)),t[0]==="/"&&(t=t.slice(1)),`${n}/${t}`}function $s(){let i=document.querySelector('link[href*="/dist/styles.css?version="]');if(!i)throw new Error("Could not find expected style link in document for version use");return(i.getAttribute("href")||"").split("?version=").pop()||""}function io(i){return import(window.baseUrl(`dist/${i}.js?version=${$s()}`))}function oo(i,t=0){let e=3735928559^t,n=1103547991^t;for(let o=0,s;o>>16,2246822507),e^=Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(e^e>>>13,3266489909),String(4294967296*(2097151&n)+(e>>>0))}function ft(i){return i instanceof HTMLElement}function ot(i,t={},e=[]){let n=document.createElement(i);for(let[o,s]of Object.entries(t))s===null?n.removeAttribute(o):n.setAttribute(o,s);for(let o of e)typeof o=="string"?n.append(document.createTextNode(o)):n.append(o);return n}function ai(i,t){let e=document.querySelectorAll(i);for(let n of e)t(n)}function be(i,t,e){if(i)for(let n of t)i.addEventListener(n,e)}function T(i,t){Array.isArray(i)||(i=[i]);for(let e of i)e.addEventListener("click",t),e.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t(n))})}function so(i,t,e){Array.isArray(t)||(t=[t]);let n=o=>{o.key===i&&e(o)};t.forEach(o=>o.addEventListener("keydown",n))}function Ht(i,t){so("Enter",i,t)}function ro(i,t){so("Escape",i,t)}function I(i,t,e,n){i.addEventListener(e,o=>{let s=o.target?.closest(t);s&&n.call(s,o,s)})}function ao(i,t){let e=document.querySelectorAll(i);t=t.toLowerCase();for(let n of e)if((n.textContent||"").toLowerCase().includes(t)&&ft(n))return n;return null}function Tt(i){i.innerHTML='
    '}function Bt(){let i=document.createElement("div");return i.classList.add("loading-container"),i.innerHTML="
    ",i}function Zt(i){let t=i.querySelectorAll(".loading-container");for(let e of t)e.remove()}function Q(i){let t=document.createElement("div");t.innerHTML=i,window.$components.init(t);let e=t.children[0];if(!ft(e))throw new Error("Could not find child HTMLElement when creating DOM element from HTML");return e}function li(i,t,e){if(!e.contains(i))throw new Error("ParentElement must be a prent of element");let n=t,o=i.nodeType===Node.TEXT_NODE?i:i.childNodes[t];for(;o!==e&&o;)o.previousSibling?(o=o.previousSibling,n+=o.textContent?.length||0):o=o.parentNode;return n}function ye(i,t){if(t===0)return{node:i,offset:0};let e=0,n=null;for(let o=0;o=t)return{node:n,offset:t-e};e+=s}else if(n.nodeType===Node.ELEMENT_NODE){let s=(n.textContent||"").length;if(e+s>=t)return ye(n,t-e);e+=s}return null}function Ee(i){let t=(i.textContent||"").replace(/\s{2,}/g,"");return oo(t)}function lo(i){let t=i;do{if(window.getComputedStyle(t).overflowY==="scroll")return t;t=t.parentElement}while(t);return document.body}var h=class{constructor(){c(this,"$name","");c(this,"$el",null);c(this,"$refs",{});c(this,"$manyRefs",{});c(this,"$opts",{})}setup(){}$emit(t,e={}){e.from=this;let n=this.$name,o=new CustomEvent(`${n}-${t}`,{bubbles:!0,detail:e});this.$el.dispatchEvent(o)}};var Ce=class extends h{setup(){this.modelRow=this.$refs.model,this.addButton=this.$refs.add,this.removeSelector=this.$opts.removeSelector,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.addButton.addEventListener("click",this.add.bind(this)),I(this.$el,this.removeSelector,"click",t=>{t.target.closest(this.rowSelector).remove()})}add(){let t=this.modelRow.cloneNode(!0);t.classList.remove("hidden"),this.setClonedInputNames(t),this.modelRow.parentNode.insertBefore(t,this.modelRow),window.$components.init(t)}setClonedInputNames(t){let e=to(),n=t.querySelectorAll('[name*="randrowid"]');for(let o of n)o.name=o.name.split("randrowid").join(e)}};var Le=class extends h{constructor(){super(...arguments);c(this,"row");c(this,"url");c(this,"deleteButtons",[])}setup(){this.row=this.$el,this.url=this.$opts.url,this.deleteButtons=this.$manyRefs.delete||[],T(this.deleteButtons,this.runDelete.bind(this))}runDelete(){this.row.style.opacity="0.7",this.row.style.pointerEvents="none",window.$http.delete(this.url).then(e=>{typeof e.data=="object"&&e.data.message&&window.$events.emit("success",e.data.message),this.row.remove()}).catch(()=>{this.row.style.removeProperty("opacity"),this.row.style.removeProperty("pointer-events")})}};var xe=class extends h{setup(){this.container=this.$el,this.responseContainer=this.container,this.url=this.$opts.url,this.method=this.$opts.method||"post",this.successMessage=this.$opts.successMessage,this.submitButtons=this.$manyRefs.submit||[],this.$opts.responseContainer&&(this.responseContainer=this.container.closest(this.$opts.responseContainer)),this.setupListeners()}setupListeners(){if(this.container.tagName==="FORM"){this.container.addEventListener("submit",this.submitRealForm.bind(this));return}Ht(this.container,t=>{this.submitFakeForm(),t.preventDefault()}),this.submitButtons.forEach(t=>T(t,this.submitFakeForm.bind(this)))}submitFakeForm(){let t=new FormData,e=this.container.querySelectorAll("[name]");for(let n of e)t.append(n.getAttribute("name"),n.value);this.submit(t)}submitRealForm(t){t.preventDefault();let e=new FormData(this.container);this.submit(e)}async submit(t){this.responseContainer.style.opacity="0.7",this.responseContainer.style.pointerEvents="none";try{let e=await window.$http[this.method.toLowerCase()](this.url,t);this.$emit("success",{formData:t}),this.responseContainer.innerHTML=e.data,this.successMessage&&window.$events.emit("success",this.successMessage)}catch(e){this.responseContainer.innerHTML=e.data}window.$components.init(this.responseContainer),this.responseContainer.style.opacity=null,this.responseContainer.style.pointerEvents=null}};var Te=class extends h{constructor(){super(...arguments);c(this,"select");c(this,"sidebar");c(this,"body")}setup(){this.select=this.$refs.select,this.sidebar=this.$refs.sidebar,this.body=this.$el.ownerDocument.documentElement,this.select.addEventListener("change",()=>{let e=this.select.value,n=document.getElementById(`sidebar-header-${e}`),o=document.getElementById(`section-${e}`);if(n&&o){let s=n.getBoundingClientRect().top-this.sidebar.getBoundingClientRect().top+this.sidebar.scrollTop;this.sidebar.scrollTo({top:s-120,behavior:"smooth"});let r=o.getBoundingClientRect().top+this.body.scrollTop;this.body.scrollTo({top:r-20,behavior:"smooth"})}})}};var Se=class extends h{setup(){this.container=this.$el,this.pageId=this.$opts.pageId,this.editContainer=this.$refs.editContainer,this.listContainer=this.$refs.listContainer,this.linksContainer=this.$refs.linksContainer,this.listPanel=this.$refs.listPanel,this.attachLinkButton=this.$refs.attachLinkButton,this.setupListeners()}setupListeners(){let t=this.reloadList.bind(this);this.container.addEventListener("dropzone-upload-success",t),this.container.addEventListener("ajax-form-success",t),this.container.addEventListener("sortable-list-sort",e=>{this.updateOrder(e.detail.ids)}),this.container.addEventListener("event-emit-select-edit",e=>{this.startEdit(e.detail.id)}),this.container.addEventListener("event-emit-select-edit-back",()=>{this.stopEdit()}),this.container.addEventListener("event-emit-select-insert",e=>{let n=e.target.closest("[data-drag-content]").getAttribute("data-drag-content"),o=JSON.parse(n);window.$events.emit("editor::insert",{html:o["text/html"],markdown:o["text/plain"]})}),this.attachLinkButton.addEventListener("click",()=>{this.showSection("links")})}showSection(t){let e={links:this.linksContainer,edit:this.editContainer,list:this.listContainer};for(let[n,o]of Object.entries(e))o.toggleAttribute("hidden",n!==t)}reloadList(){this.stopEdit(),window.$http.get(`/attachments/get/page/${this.pageId}`).then(t=>{this.listPanel.innerHTML=t.data,window.$components.init(this.listPanel)})}updateOrder(t){window.$http.put(`/attachments/sort/page/${this.pageId}`,{order:t}).then(e=>{window.$events.emit("success",e.data.message)})}async startEdit(t){this.showSection("edit"),Tt(this.editContainer);let e=await window.$http.get(`/attachments/edit/${t}`);this.editContainer.innerHTML=e.data,window.$components.init(this.editContainer)}stopEdit(){this.showSection("list")}};var ke=class extends h{setup(){this.container=this.$el,this.fileLinks=this.$manyRefs.linkTypeFile,this.setupListeners()}setupListeners(){let t=e=>e.key==="Control"||e.key==="Meta";window.addEventListener("keydown",e=>{t(e)&&this.addOpenQueryToLinks()},{passive:!0}),window.addEventListener("keyup",e=>{t(e)&&this.removeOpenQueryFromLinks()},{passive:!0})}addOpenQueryToLinks(){for(let t of this.fileLinks)t.href.split("?")[1]!=="open=true"&&(t.href+="?open=true",t.setAttribute("target","_blank"))}removeOpenQueryFromLinks(){for(let t of this.fileLinks)t.href=t.href.split("?")[0],t.removeAttribute("target")}};var vt,di,hi,gt=class{constructor(t,e=null,n=null){Zi(this,vt);c(this,"containers");c(this,"onEscape");c(this,"onEnter");this.containers=[t],this.onEscape=e,this.onEnter=n,t.addEventListener("keydown",Jt(this,vt,di).bind(this))}shareHandlingToEl(t){this.containers.push(t),t.addEventListener("keydown",Jt(this,vt,di).bind(this))}focusNext(){let t=Jt(this,vt,hi).call(this),e=document.activeElement,o=(ft(e)?t.indexOf(e):-1)+1;o>=t.length&&(o=0),t[o].focus()}focusPrevious(){let t=Jt(this,vt,hi).call(this),e=document.activeElement,o=(ft(e)?t.indexOf(e):-1)-1;o<0&&(o=t.length-1),t[o].focus()}};vt=new WeakSet,di=function(t){ft(t.target)&&t.target.matches("input")&&(t.key==="ArrowRight"||t.key==="ArrowLeft")||(t.key==="ArrowDown"||t.key==="ArrowRight"?(this.focusNext(),t.preventDefault()):t.key==="ArrowUp"||t.key==="ArrowLeft"?(this.focusPrevious(),t.preventDefault()):t.key==="Escape"?this.onEscape?this.onEscape(t):ft(document.activeElement)&&document.activeElement.blur():t.key==="Enter"&&this.onEnter&&this.onEnter(t))},hi=function(){let t=[],e='[tabindex]:not([tabindex="-1"]),[href],button:not([tabindex="-1"],[disabled]),input:not([type=hidden])';for(let n of this.containers){let o=[...n.querySelectorAll(e)].filter(s=>ft(s));t.push(...o)}return t};var ui={},$e=class extends h{setup(){this.parent=this.$el.parentElement,this.container=this.$el,this.type=this.$opts.type,this.url=this.$opts.url,this.input=this.$refs.input,this.list=this.$refs.list,this.lastPopulated=0,this.setupListeners()}setupListeners(){new gt(this.list,()=>{this.input.focus(),setTimeout(()=>this.hideSuggestions(),1)},e=>{e.preventDefault();let n=e.target.textContent;n&&this.selectSuggestion(n)}).shareHandlingToEl(this.input),I(this.list,".text-item","click",(e,n)=>{this.selectSuggestion(n.textContent)}),this.input.addEventListener("input",this.requestSuggestions.bind(this)),this.input.addEventListener("focus",this.requestSuggestions.bind(this)),this.input.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this)),this.input.addEventListener("keydown",e=>{e.key==="Tab"&&this.hideSuggestions()})}selectSuggestion(t){this.input.value=t,this.lastPopulated=Date.now(),this.input.focus(),this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hideSuggestions()}async requestSuggestions(){if(Date.now()-this.lastPopulated<50)return;let t=this.getNameFilterIfNeeded(),e=this.input.value.toLowerCase(),o=(await this.loadSuggestions(e,t)).filter(s=>e===""||s.toLowerCase().startsWith(e)).slice(0,10);this.displaySuggestions(o)}getNameFilterIfNeeded(){return this.type!=="value"?null:this.parent.querySelector("input").value}async loadSuggestions(t,e=null){t=t.slice(0,4);let n={search:t,name:e},o=`${this.url}:${JSON.stringify(n)}`;if(ui[o])return ui[o];let s=await window.$http.get(this.url,n);return ui[o]=s.data,s.data}displaySuggestions(t){if(t.length===0){this.hideSuggestions();return}this.list.innerHTML=t.map(e=>`
  • ${Qi(e)}
  • `).join(""),this.list.style.display="block";for(let e of this.list.querySelectorAll(".text-item"))e.addEventListener("blur",this.hideSuggestionsIfFocusedLost.bind(this))}hideSuggestions(){this.list.style.display="none"}hideSuggestionsIfFocusedLost(t){this.container.contains(t.relatedTarget)||this.hideSuggestions()}};var Me=class extends h{setup(){this.form=this.$el,this.form.submit()}};var De=class extends h{setup(){if(this.button=this.$el,this.targetElem=document.getElementById("header"),this.showing=!1,this.breakPoint=1200,document.body.classList.contains("flexbox")){this.button.style.display="none";return}this.button.addEventListener("click",this.scrollToTop.bind(this)),window.addEventListener("scroll",this.onPageScroll.bind(this))}onPageScroll(){let t=document.documentElement.scrollTop||document.body.scrollTop||0;!this.showing&&t>this.breakPoint?(this.button.style.display="block",this.showing=!0,setTimeout(()=>{this.button.style.opacity=.4},1)):this.showing&&t{this.button.style.display="none"},500))}scrollToTop(){let t=this.targetElem.getBoundingClientRect().top,e=document.documentElement.scrollTop?document.documentElement:document.body,n=300,o=Date.now(),s=this.targetElem.getBoundingClientRect().top;function r(){let a=1-(Date.now()-o)/n,l=Math.abs(a*s);a>0?(e.scrollTop=l,requestAnimationFrame(r.bind(this))):e.scrollTop=t}requestAnimationFrame(r.bind(this))}};function co(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function rt(i){for(var t=1;t=0)&&(e[o]=i[o]);return e}function As(i,t){if(i==null)return{};var e=Ds(i,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(e[n]=i[n])}return e}function Is(i){return Hs(i)||Bs(i)||Ps(i)||Rs()}function Hs(i){if(Array.isArray(i))return Li(i)}function Bs(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Ps(i,t){if(i){if(typeof i=="string")return Li(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Li(i,t)}}function Li(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e"&&(t=t.substring(1)),i)try{if(i.matches)return i.matches(t);if(i.msMatchesSelector)return i.msMatchesSelector(t);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(t)}catch{return!1}return!1}}function Lo(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function z(i,t,e,n){if(i){e=e||document;do{if(t!=null&&(t[0]===">"?i.parentNode===e&&Ve(i,t):Ve(i,t))||n&&i===e)return i;if(i===e)break}while(i=Lo(i))}return null}var uo=/\s+/g;function P(i,t,e){if(i&&t)if(i.classList)i.classList[e?"add":"remove"](t);else{var n=(" "+i.className+" ").replace(uo," ").replace(" "+t+" "," ");i.className=(n+(e?" "+t:"")).replace(uo," ")}}function g(i,t,e){var n=i&&i.style;if(n){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(e=i.currentStyle),t===void 0?e:e[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=e+(typeof e=="string"?"":"px")}}function Mt(i,t){var e="";if(typeof i=="string")e=i;else do{var n=g(i,"transform");n&&n!=="none"&&(e=n+" "+e)}while(!t&&(i=i.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(e)}function xo(i,t,e){if(i){var n=i.getElementsByTagName(t),o=0,s=n.length;if(e)for(;o=s:r=o<=s,!r)return n;if(n===st())break;n=yt(n,!1)}return!1}function _t(i,t,e,n){for(var o=0,s=0,r=i.children;s2&&arguments[2]!==void 0?arguments[2]:{},o=n.evt,s=As(n,Us);ue.pluginEvent.bind(w)(t,e,rt({dragEl:m,parentEl:H,ghostEl:y,rootEl:D,nextEl:$t,lastDownEl:Ne,cloneEl:A,cloneHidden:bt,dragStarted:ie,putSortable:N,activeSortable:w.active,originalEvent:o,oldIndex:Ft,oldDraggableIndex:le,newIndex:Y,newDraggableIndex:wt,hideGhostForTarget:Ao,unhideGhostForTarget:Io,cloneNowHidden:function(){bt=!0},cloneNowShown:function(){bt=!1},dispatchSortableEvent:function(a){W({sortable:e,name:a,originalEvent:o})}},s))};function W(i){ne(rt({putSortable:N,cloneEl:A,targetEl:m,rootEl:D,oldIndex:Ft,oldDraggableIndex:le,newIndex:Y,newDraggableIndex:wt},i))}var m,H,y,D,$t,Ne,A,bt,Ft,Y,le,wt,Ae,N,Nt=!1,We=!1,Ue=[],St,tt,gi,vi,go,vo,ie,Rt,ce,de=!1,Ie=!1,Fe,_,wi=[],xi=!1,je=[],Ke=typeof document<"u",He=$i,wo=he||dt?"cssFloat":"float",js=Ke&&!Eo&&!$i&&"draggable"in document.createElement("div"),$o=function(){if(Ke){if(dt)return!1;var i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}}(),Mo=function(t,e){var n=g(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),s=_t(t,0,e),r=_t(t,1,e),a=s&&g(s),l=r&&g(r),d=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+M(s).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+M(r).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&a.float&&a.float!=="none"){var p=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===p)?"vertical":"horizontal"}return s&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||d>=o&&n[wo]==="none"||r&&n[wo]==="none"&&d+u>o)?"vertical":"horizontal"},zs=function(t,e,n){var o=n?t.left:t.top,s=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,d=n?e.width:e.height;return o===a||s===l||o+r/2===a+d/2},Ks=function(t,e){var n;return Ue.some(function(o){var s=o[F].options.emptyInsertThreshold;if(!(!s||Mi(o))){var r=M(o),a=t>=r.left-s&&t<=r.right+s,l=e>=r.top-s&&e<=r.bottom+s;if(a&&l)return n=o}}),n},Do=function(t){function e(s,r){return function(a,l,d,u){var p=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(s==null&&(r||p))return!0;if(s==null||s===!1)return!1;if(r&&s==="clone")return s;if(typeof s=="function")return e(s(a,l,d,u),r)(a,l,d,u);var f=(r?a:l).options.group.name;return s===!0||typeof s=="string"&&s===f||s.join&&s.indexOf(f)>-1}}var n={},o=t.group;(!o||Oe(o)!="object")&&(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Ao=function(){!$o&&y&&g(y,"display","none")},Io=function(){!$o&&y&&g(y,"display","")};Ke&&!Eo&&document.addEventListener("click",function(i){if(We)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),We=!1,!1},!0);var kt=function(t){if(m){t=t.touches?t.touches[0]:t;var e=Ks(t.clientX,t.clientY);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[F]._onDragOver(n)}}},Xs=function(t){m&&m.parentNode[F]._isOutsideThisEl(t.target)};function w(i,t){if(!(i&&i.nodeType&&i.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(i));this.el=i,this.options=t=nt({},t),i[F]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(i.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Mo(i,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:w.supportPointer!==!1&&"PointerEvent"in window&&(!re||$i),emptyInsertThreshold:5};ue.initializePlugins(this,i,e);for(var n in e)!(n in t)&&(t[n]=e[n]);Do(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:js,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?C(i,"pointerdown",this._onTapStart):(C(i,"mousedown",this._onTapStart),C(i,"touchstart",this._onTapStart)),this.nativeDraggable&&(C(i,"dragover",this),C(i,"dragenter",this)),Ue.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),nt(this,qs())}w.prototype={constructor:w,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Rt=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,m):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,s=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,d=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=o.filter;if(nr(n),!m&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&re&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=z(l,o.draggable,n,!1),!(l&&l.animated)&&Ne!==l)){if(Ft=R(l),le=R(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){W({sortable:e,rootEl:d,name:"filter",targetEl:l,toEl:n,fromEl:n}),U("filter",e,{evt:t}),s&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(p){if(p=z(d,p.trim(),n,!1),p)return W({sortable:e,rootEl:p,name:"filter",targetEl:l,fromEl:n,toEl:n}),U("filter",e,{evt:t}),!0}),u)){s&&t.preventDefault();return}o.handle&&!z(d,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o=this,s=o.el,r=o.options,a=s.ownerDocument,l;if(n&&!m&&n.parentNode===s){var d=M(n);if(D=s,m=n,H=m.parentNode,$t=m.nextSibling,Ne=n,Ae=r.group,w.dragged=m,St={target:m,clientX:(e||t).clientX,clientY:(e||t).clientY},go=St.clientX-d.left,vo=St.clientY-d.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,m.style["will-change"]="all",l=function(){if(U("delayEnded",o,{evt:t}),w.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!ho&&o.nativeDraggable&&(m.draggable=!0),o._triggerDragStart(t,e),W({sortable:o,name:"choose",originalEvent:t}),P(m,r.chosenClass,!0)},r.ignore.split(",").forEach(function(u){xo(m,u.trim(),bi)}),C(a,"dragover",kt),C(a,"mousemove",kt),C(a,"touchmove",kt),r.supportPointer?(C(a,"pointerup",o._onDrop),!this.nativeDraggable&&C(a,"pointercancel",o._onDrop)):(C(a,"mouseup",o._onDrop),C(a,"touchend",o._onDrop),C(a,"touchcancel",o._onDrop)),ho&&this.nativeDraggable&&(this.options.touchStartThreshold=4,m.draggable=!0),U("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(he||dt))){if(w.eventCanceled){this._onDrop();return}r.supportPointer?(C(a,"pointerup",o._disableDelayedDrag),C(a,"pointercancel",o._disableDelayedDrag)):(C(a,"mouseup",o._disableDelayedDrag),C(a,"touchend",o._disableDelayedDrag),C(a,"touchcancel",o._disableDelayedDrag)),C(a,"mousemove",o._delayedDragTouchMoveHandler),C(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&C(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){m&&bi(m),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;E(t,"mouseup",this._disableDelayedDrag),E(t,"touchend",this._disableDelayedDrag),E(t,"touchcancel",this._disableDelayedDrag),E(t,"pointerup",this._disableDelayedDrag),E(t,"pointercancel",this._disableDelayedDrag),E(t,"mousemove",this._delayedDragTouchMoveHandler),E(t,"touchmove",this._delayedDragTouchMoveHandler),E(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?C(document,"pointermove",this._onTouchMove):e?C(document,"touchmove",this._onTouchMove):C(document,"mousemove",this._onTouchMove):(C(m,"dragend",this),C(D,"dragstart",this._onDragStart));try{document.selection?_e(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Nt=!1,D&&m){U("dragStarted",this,{evt:e}),this.nativeDraggable&&C(document,"dragover",Xs);var n=this.options;!t&&P(m,n.dragClass,!1),P(m,n.ghostClass,!0),w.active=this,t&&this._appendGhost(),W({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(tt){this._lastX=tt.clientX,this._lastY=tt.clientY,Ao();for(var t=document.elementFromPoint(tt.clientX,tt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(tt.clientX,tt.clientY),t!==e);)e=t;if(m.parentNode[F]._isOutsideThisEl(t),e)do{if(e[F]){var n=void 0;if(n=e[F]._onDragOver({clientX:tt.clientX,clientY:tt.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=Lo(e));Io()}},_onTouchMove:function(t){if(St){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,s=t.touches?t.touches[0]:t,r=y&&Mt(y,!0),a=y&&r&&r.a,l=y&&r&&r.d,d=He&&_&&mo(_),u=(s.clientX-St.clientX+o.x)/(a||1)+(d?d[0]-wi[0]:0)/(a||1),p=(s.clientY-St.clientY+o.y)/(l||1)+(d?d[1]-wi[1]:0)/(l||1);if(!w.active&&!Nt){if(n&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))=0&&(W({rootEl:H,name:"add",toEl:H,fromEl:D,originalEvent:t}),W({sortable:this,name:"remove",toEl:H,originalEvent:t}),W({rootEl:H,name:"sort",toEl:H,fromEl:D,originalEvent:t}),W({sortable:this,name:"sort",toEl:H,originalEvent:t})),N&&N.save()):Y!==Ft&&Y>=0&&(W({sortable:this,name:"update",toEl:H,originalEvent:t}),W({sortable:this,name:"sort",toEl:H,originalEvent:t})),w.active&&((Y==null||Y===-1)&&(Y=Ft,wt=le),W({sortable:this,name:"end",toEl:H,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){U("nulling",this),D=m=H=y=$t=A=Ne=bt=St=tt=ie=Y=wt=Ft=le=Rt=ce=N=Ae=w.dragged=w.ghost=w.clone=w.active=null,je.forEach(function(t){t.checked=!0}),je.length=gi=vi=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":m&&(this._onDragOver(t),Gs(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,o=0,s=n.length,r=this.options;oo.right+s||i.clientY>n.bottom&&i.clientX>n.left:i.clientY>o.bottom+s||i.clientX>n.right&&i.clientY>n.top}function Qs(i,t,e,n,o,s,r,a){var l=n?i.clientY:i.clientX,d=n?e.height:e.width,u=n?e.top:e.left,p=n?e.bottom:e.right,f=!1;if(!r){if(a&&Feu+d*s/2:lp-Fe)return-ce}else if(l>u+d*(1-o)/2&&lp-d*s/2)?l>u+d/2?1:-1:0}function tr(i){return R(m)1&&(b.forEach(function(a){s.addAnimationState({target:a,rect:j?M(a):r}),mi(a),a.fromRect=r,n.removeAnimationState(a)}),j=!1,or(!this.options.removeCloneOnHide,o))},dragOverCompleted:function(e){var n=e.sortable,o=e.isOwner,s=e.insertion,r=e.activeSortable,a=e.parentEl,l=e.putSortable,d=this.options;if(s){if(o&&r._hideClone(),te=!1,d.animation&&b.length>1&&(j||!o&&!r.options.sort&&!l)){var u=M($,!1,!0,!0);b.forEach(function(f){f!==$&&(fo(f,u),a.appendChild(f))}),j=!0}if(!o)if(j||Re(),b.length>1){var p=Pe;r._showClone(n),r.options.animation&&!Pe&&p&&G.forEach(function(f){r.addAnimationState({target:f,rect:ee}),f.fromRect=ee,f.thisAnimationDuration=null})}else r._showClone(n)}},dragOverAnimationCapture:function(e){var n=e.dragRect,o=e.isOwner,s=e.activeSortable;if(b.forEach(function(a){a.thisAnimationDuration=null}),s.options.animation&&!o&&s.multiDrag.isMultiDrag){ee=nt({},n);var r=Mt($,!0);ee.top-=r.f,ee.left-=r.e}},dragOverAnimationComplete:function(){j&&(j=!1,Re())},drop:function(e){var n=e.originalEvent,o=e.rootEl,s=e.parentEl,r=e.sortable,a=e.dispatchSortableEvent,l=e.oldIndex,d=e.putSortable,u=d||this.sortable;if(n){var p=this.options,f=s.children;if(!Ot)if(p.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),P($,p.selectedClass,!~b.indexOf($)),~b.indexOf($))b.splice(b.indexOf($),1),Qt=null,ne({sortable:r,rootEl:o,name:"deselect",targetEl:$,originalEvent:n});else{if(b.push($),ne({sortable:r,rootEl:o,name:"select",targetEl:$,originalEvent:n}),n.shiftKey&&Qt&&r.el.contains(Qt)){var v=R(Qt),L=R($);~v&&~L&&v!==L&&function(){var x,k;L>v?(k=v,x=L):(k=L,x=v+1);for(var O=p.filter;k1){var S=M($),V=R($,":not(."+this.options.selectedClass+")");if(!te&&p.animation&&($.thisAnimationDuration=null),u.captureAnimationState(),!te&&(p.animation&&($.fromRect=S,b.forEach(function(x){if(x.thisAnimationDuration=null,x!==$){var k=j?M(x):S;x.fromRect=k,u.addAnimationState({target:x,rect:k})}})),Re(),b.forEach(function(x){f[V]?s.insertBefore(x,f[V]):s.appendChild(x),V++}),l===R($))){var J=!1;b.forEach(function(x){if(x.sortableIndex!==R(x)){J=!0;return}}),J&&(a("update"),a("sort"))}b.forEach(function(x){mi(x)}),u.animateAll()}et=u}(o===s||d&&d.lastPutMode!=="clone")&&G.forEach(function(x){x.parentNode&&x.parentNode.removeChild(x)})}},nullingGlobal:function(){this.isMultiDrag=Ot=!1,G.length=0},destroyGlobal:function(){this._deselectMultiDrag(),E(document,"pointerup",this._deselectMultiDrag),E(document,"mouseup",this._deselectMultiDrag),E(document,"touchend",this._deselectMultiDrag),E(document,"keydown",this._checkKeyDown),E(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof Ot<"u"&&Ot)&&et===this.sortable&&!(e&&z(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;b.length;){var n=b[0];P(n,this.options.selectedClass,!1),b.shift(),ne({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:n,originalEvent:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},nt(i,{pluginName:"multiDrag",utils:{select:function(e){var n=e.parentNode[F];!n||!n.options.multiDrag||~b.indexOf(e)||(et&&et!==n&&(et.multiDrag._deselectMultiDrag(),et=n),P(e,n.options.selectedClass,!0),b.push(e))},deselect:function(e){var n=e.parentNode[F],o=b.indexOf(e);!n||!n.options.multiDrag||!~o||(P(e,n.options.selectedClass,!1),b.splice(o,1))}},eventProperties:function(){var e=this,n=[],o=[];return b.forEach(function(s){n.push({multiDragElement:s,index:s.sortableIndex});var r;j&&s!==$?r=-1:j?r=R(s,":not(."+e.options.selectedClass+")"):r=R(s),o.push({multiDragElement:s,index:r})}),{items:Is(b),clones:[].concat(G),oldIndicies:n,newIndicies:o}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e==="ctrl"?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function or(i,t){b.forEach(function(e,n){var o=t.children[e.sortableIndex+(i?Number(n):0)];o?t.insertBefore(e,o):t.appendChild(e)})}function yo(i,t){G.forEach(function(e,n){var o=t.children[e.sortableIndex+(i?Number(n):0)];o?t.insertBefore(e,o):t.appendChild(e)})}function Re(){b.forEach(function(i){i!==$&&i.parentNode&&i.parentNode.removeChild(i)})}w.mount(new ir);w.mount(Ii,Ai);var ht=w;var Po={name(i,t){let e=i.getAttribute("data-name").trim().toLowerCase(),n=t.getAttribute("data-name").trim().toLowerCase();return e.localeCompare(n)},created(i,t){let e=Number(i.getAttribute("data-created"));return Number(t.getAttribute("data-created"))-e},updated(i,t){let e=Number(i.getAttribute("data-updated"));return Number(t.getAttribute("data-updated"))-e},chaptersFirst(i,t){let e=i.getAttribute("data-type"),n=t.getAttribute("data-type");return e===n?0:e==="chapter"?-1:1},chaptersLast(i,t){let e=i.getAttribute("data-type"),n=t.getAttribute("data-type");return e===n?0:e==="chapter"?1:-1}},Ro={up:{active(i,t){return!(i.previousElementSibling===null&&!t)},run(i,t){(i.previousElementSibling||t).insertAdjacentElement("beforebegin",i)}},down:{active(i,t){return!(i.nextElementSibling===null&&!t)},run(i,t){(i.nextElementSibling||t).insertAdjacentElement("afterend",i)}},next_book:{active(i,t,e){return e.nextElementSibling!==null},run(i,t,e){e.nextElementSibling.querySelector("ul").prepend(i)}},prev_book:{active(i,t,e){return e.previousElementSibling!==null},run(i,t,e){e.previousElementSibling.querySelector("ul").appendChild(i)}},next_chapter:{active(i,t){return i.dataset.type==="page"&&this.getNextChapter(i,t)},run(i,t){this.getNextChapter(i,t).querySelector("ul").prepend(i)},getNextChapter(i,t){let e=t||i,n=Array.from(e.parentElement.children),o=n.indexOf(e);return n.slice(o+1).find(s=>s.dataset.type==="chapter")}},prev_chapter:{active(i,t){return i.dataset.type==="page"&&this.getPrevChapter(i,t)},run(i,t){this.getPrevChapter(i,t).querySelector("ul").append(i)},getPrevChapter(i,t){let e=t||i,n=Array.from(e.parentElement.children),o=n.indexOf(e);return n.slice(0,o).reverse().find(s=>s.dataset.type==="chapter")}},book_end:{active(i,t){return t||t===null&&i.nextElementSibling},run(i,t,e){e.querySelector("ul").append(i)}},book_start:{active(i,t){return t||t===null&&i.previousElementSibling},run(i,t,e){e.querySelector("ul").prepend(i)}},before_chapter:{active(i,t){return t},run(i,t){t.insertAdjacentElement("beforebegin",i)}},after_chapter:{active(i,t){return t},run(i,t){t.insertAdjacentElement("afterend",i)}}},Xe=class extends h{setup(){this.container=this.$el,this.sortContainer=this.$refs.sortContainer,this.input=this.$refs.input,ht.mount(new Bo);let t=this.container.querySelector(".sort-box");this.setupBookSortable(t),this.setupSortPresets(),this.setupMoveActions(),window.$events.listen("entity-select-change",this.bookSelect.bind(this))}setupMoveActions(){this.container.addEventListener("click",t=>{if(t.target.matches("[data-move]")){let e=t.target.getAttribute("data-move"),n=t.target.closest("[data-id]");this.runSortAction(n,e)}}),this.updateMoveActionStateForAll()}setupSortPresets(){let t="",e=!1,n=["name","created","updated"];this.sortContainer.addEventListener("click",o=>{let s=o.target.closest(".sort-box-options [data-sort]");if(!s)return;o.preventDefault();let r=s.closest(".sort-box").querySelectorAll("ul"),a=s.getAttribute("data-sort");e=t===a?!e:!1;let l=Po[a];e&&n.includes(a)&&(l=function(u,p){return 0-Po[a](u,p)});for(let d of r)Array.from(d.children).filter(p=>p.matches("li")).sort(l).forEach(p=>{d.appendChild(p)});t=a,this.updateMapInput()})}bookSelect(t){if(this.container.querySelector(`[data-type="book"][data-id="${t.id}"]`)!==null)return;let n=`${t.link}/sort-item`;window.$http.get(n).then(o=>{let s=Q(o.data);this.sortContainer.append(s),this.setupBookSortable(s),this.updateMoveActionStateForAll(),s.querySelector("summary").focus()})}setupBookSortable(t){let e=Array.from(t.querySelectorAll(".sort-list, .sortable-page-sublist")),n={name:"book",pull:["book","chapter"],put:["book","chapter"]},o={name:"chapter",pull:["book","chapter"],put(s,r,a){return a.getAttribute("data-type")==="page"}};for(let s of e)ht.create(s,{group:s.classList.contains("sort-list")?n:o,animation:150,fallbackOnBody:!0,swapThreshold:.65,onSort:()=>{this.ensureNoNestedChapters(),this.updateMapInput(),this.updateMoveActionStateForAll()},dragClass:"bg-white",ghostClass:"primary-background-light",multiDrag:!0,multiDragKey:"Control",selectedClass:"sortable-selected"})}ensureNoNestedChapters(){let t=this.container.querySelectorAll('[data-type="chapter"] [data-type="chapter"]');for(let e of t)e.parentElement.closest('[data-type="chapter"]').insertAdjacentElement("afterend",e)}updateMapInput(){let t=this.buildEntityMap();this.input.value=JSON.stringify(t)}buildEntityMap(){let t=[],e=this.container.querySelectorAll(".sort-list");for(let n of e){let o=n.closest('[data-type="book"]').getAttribute("data-id"),s=Array.from(n.children).filter(r=>r.matches('[data-type="page"], [data-type="chapter"]'));for(let r=0;r{for(let r of o)i.style.removeProperty(r);i.style.removeProperty("transition"),i.removeEventListener("transitionend",s),Ge.delete(i),n&&n()};setTimeout(()=>{i.style.transition=`all ease-in-out ${e}ms`;for(let r of o)i.style.setProperty(r,t[r][1]);i.addEventListener("transitionend",s),Ge.set(i,s)},15)}function me(i){Ge.has(i)&&Ge.get(i)()}function Oo(i,t=400,e=null){me(i),i.style.display="block",pe(i,{opacity:["0","1"]},t,()=>{e&&e()})}function No(i,t=400,e=null){me(i),pe(i,{opacity:["1","0"]},t,()=>{i.style.display="none",e&&e()})}function qt(i,t=400){me(i);let e=i.getBoundingClientRect().height,n=getComputedStyle(i),o=n.getPropertyValue("padding-top"),s=n.getPropertyValue("padding-bottom"),r={"max-height":[`${e}px`,"0px"],overflow:["hidden","hidden"],"padding-top":[o,"0px"],"padding-bottom":[s,"0px"]};pe(i,r,t,()=>{i.style.display="none"})}function Vt(i,t=400){me(i),i.style.display="block";let e=i.getBoundingClientRect().height,n=getComputedStyle(i),o=n.getPropertyValue("padding-top"),s=n.getPropertyValue("padding-bottom"),r={"max-height":["0px",`${e}px`],overflow:["hidden","hidden"],"padding-top":["0px",o],"padding-bottom":["0px",s]};pe(i,r,t)}function Fo(i,t=400){let e=i.getBoundingClientRect().height,n=getComputedStyle(i),o=n.getPropertyValue("padding-top"),s=n.getPropertyValue("padding-bottom");return()=>{me(i);let r=i.getBoundingClientRect().height,a=getComputedStyle(i),l=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-bottom"),u={height:[`${e}px`,`${r}px`],overflow:["hidden","hidden"],"padding-top":[o,l],"padding-bottom":[s,d]};pe(i,u,t)}}var Ye=class extends h{setup(){this.list=this.$refs.list,this.toggle=this.$refs.toggle,this.isOpen=this.toggle.classList.contains("open"),this.toggle.addEventListener("click",this.click.bind(this))}open(){this.toggle.classList.add("open"),this.toggle.setAttribute("aria-expanded","true"),Vt(this.list,180),this.isOpen=!0}close(){this.toggle.classList.remove("open"),this.toggle.setAttribute("aria-expanded","false"),qt(this.list,180),this.isOpen=!1}click(t){t.preventDefault(),this.isOpen?this.close():this.open()}};var Je=class extends h{constructor(){super(...arguments);c(this,"editor",null);c(this,"saveCallback",null);c(this,"cancelCallback",null);c(this,"history",{});c(this,"historyKey","code_history")}setup(){this.container=this.$refs.container,this.popup=this.$el,this.editorInput=this.$refs.editor,this.languageButtons=this.$manyRefs.languageButton,this.languageOptionsContainer=this.$refs.languageOptionsContainer,this.saveButton=this.$refs.saveButton,this.languageInput=this.$refs.languageInput,this.historyDropDown=this.$refs.historyDropDown,this.historyList=this.$refs.historyList,this.favourites=new Set(this.$opts.favourites.split(",")),this.setupListeners(),this.setupFavourites()}setupListeners(){this.container.addEventListener("keydown",e=>{e.ctrlKey&&e.key==="Enter"&&this.save()}),T(this.languageButtons,e=>{let n=e.target.dataset.lang;this.languageInput.value=n,this.languageInputChange(n)}),Ht(this.languageInput,()=>this.save()),this.languageInput.addEventListener("input",()=>this.languageInputChange(this.languageInput.value)),T(this.saveButton,()=>this.save()),I(this.historyList,"button","click",(e,n)=>{e.preventDefault();let o=n.dataset.time;this.editor&&this.editor.setContent(this.history[o])})}setupFavourites(){for(let e of this.languageButtons)this.setupFavouritesForButton(e);this.sortLanguageList()}setupFavouritesForButton(e){let n=e.dataset.lang,o=this.favourites.has(n);e.setAttribute("data-favourite",o?"true":"false"),I(e.parentElement,".lang-option-favorite-toggle","click",()=>{o=!o,o?this.favourites.add(n):this.favourites.delete(n),e.setAttribute("data-favourite",o?"true":"false"),window.$http.patch("/preferences/update-code-language-favourite",{language:n,active:o}),this.sortLanguageList(),o&&e.scrollIntoView({block:"center",behavior:"smooth"})})}sortLanguageList(){let e=this.languageButtons.sort((n,o)=>{let s=n.dataset.favourite==="true",r=o.dataset.favourite==="true";return s&&!r?-1:r&&!s||n.dataset.lang>o.dataset.lang?1:-1}).map(n=>n.parentElement);for(let n of e)this.languageOptionsContainer.append(n)}save(){this.saveCallback&&this.saveCallback(this.editor.getContent(),this.languageInput.value),this.hide()}async open(e,n,o,s,r){this.languageInput.value=n,this.saveCallback=s,this.cancelCallback=r,await this.show(),this.languageInputChange(n),this.editor.setContent(e),this.setDirection(o)}async show(){let e=await window.importVersioned("code");this.editor||(this.editor=e.popupEditor(this.editorInput,this.languageInput.value)),this.loadHistory(),this.getPopup().show(()=>{this.editor.focus()},()=>{this.addHistory(),this.cancelCallback&&this.cancelCallback()})}setDirection(e){let n=this.editorInput.parentElement;e?n.setAttribute("dir",e):n.removeAttribute("dir")}hide(){this.getPopup().hide(),this.addHistory()}getPopup(){return window.$components.firstOnElement(this.popup,"popup")}async updateEditorMode(e){this.editor.setMode(e,this.editor.getContent())}languageInputChange(e){this.updateEditorMode(e);let n=e.toLowerCase();for(let o of this.languageButtons){let s=o.dataset.lang.toLowerCase().trim(),r=n===s;o.classList.toggle("active",r),r&&o.scrollIntoView({block:"center",behavior:"smooth"})}}loadHistory(){this.history=JSON.parse(window.sessionStorage.getItem(this.historyKey)||"{}");let e=Object.keys(this.history).reverse();this.historyDropDown.classList.toggle("hidden",e.length===0),this.historyList.innerHTML=e.map(n=>{let o=new Date(parseInt(n,10)).toLocaleTimeString();return`
  • `}).join("")}addHistory(){if(!this.editor)return;let e=this.editor.getContent();if(!e)return;let n=Object.keys(this.history).pop();if(this.history[n]===e)return;this.history[String(Date.now())]=e;let o=JSON.stringify(this.history);window.sessionStorage.setItem(this.historyKey,o)}};var Ze=class extends h{setup(){let t=this.$el;t.querySelectorAll("pre").length>0&&window.importVersioned("code").then(n=>{n.highlightWithin(t)})}};var Qe=class extends h{async setup(){let{mode:t}=this.$opts;(await window.importVersioned("code")).inlineEditor(this.$el,t)}};var tn=class extends h{setup(){this.container=this.$el,this.trigger=this.$refs.trigger,this.content=this.$refs.content,this.trigger&&(this.trigger.addEventListener("click",this.toggle.bind(this)),this.openIfContainsError())}open(){this.container.classList.add("open"),this.trigger.setAttribute("aria-expanded","true"),Vt(this.content,300)}close(){this.container.classList.remove("open"),this.trigger.setAttribute("aria-expanded","false"),qt(this.content,300)}toggle(){this.container.classList.contains("open")?this.close():this.open()}openIfContainsError(){this.content.querySelector(".text-neg.text-small")&&this.open()}};var en=class extends h{setup(){this.container=this.$el,this.confirmButton=this.$refs.confirm,this.res=null,T(this.confirmButton,()=>{this.sendResult(!0),this.getPopup().hide()})}show(){return this.getPopup().show(null,()=>{this.sendResult(!1)}),new Promise(t=>{this.res=t})}getPopup(){return window.$components.firstOnElement(this.container,"popup")}sendResult(t){this.res&&(this.res(t),this.res=null)}};var nn=class extends h{setup(){this.container=this.$el,this.checkbox=this.container.querySelector("input[type=checkbox]"),this.display=this.container.querySelector('[role="checkbox"]'),this.checkbox.addEventListener("change",this.stateChange.bind(this)),this.container.addEventListener("keydown",this.onKeyDown.bind(this))}onKeyDown(t){(t.key===" "||t.key==="Enter")&&(t.preventDefault(),this.toggle())}toggle(){this.checkbox.checked=!this.checkbox.checked,this.checkbox.dispatchEvent(new Event("change")),this.stateChange()}stateChange(){let t=this.checkbox.checked?"true":"false";this.display.setAttribute("aria-checked",t)}};var on=class extends h{setup(){this.container=this.$el,this.dealtWith=!1,this.container.addEventListener("toggle",this.onToggle.bind(this))}onToggle(){this.dealtWith||(this.container.querySelector("pre")&&window.importVersioned("code").then(t=>{t.highlightWithin(this.container)}),this.dealtWith=!0)}};var sn=class extends h{setup(){this.container=this.$el,this.menu=this.$refs.menu,this.toggle=this.$refs.toggle,this.moveMenu=this.$opts.moveMenu,this.bubbleEscapes=this.$opts.bubbleEscapes==="true",this.direction=document.dir==="rtl"?"right":"left",this.body=document.body,this.showing=!1,this.hide=this.hide.bind(this),this.setupListeners()}show(t=null){this.hideAll(),this.menu.style.display="block",this.menu.classList.add("anim","menuIn"),this.toggle.setAttribute("aria-expanded","true");let e=this.menu.getBoundingClientRect(),n=0,o=this.toggle.getBoundingClientRect().height,s=lo(this.menu).getBoundingClientRect(),r=e.bottom>s.bottom,a=this.container.getBoundingClientRect();if(this.moveMenu&&(this.body.appendChild(this.menu),this.menu.style.position="fixed",this.menu.style.width=`${e.width}px`,this.menu.style.left=`${e.left}px`,r?n=window.innerHeight-e.top-o/2:n=e.top),r){this.menu.style.top="initial",this.menu.style.bottom=`${n}px`;let u=window.innerHeight-40-(window.innerHeight-a.bottom);this.menu.style.maxHeight=`${Math.floor(u)}px`}else{this.menu.style.top=`${n}px`,this.menu.style.bottom="initial";let u=window.innerHeight-40-a.top;this.menu.style.maxHeight=`${Math.floor(u)}px`}this.menu.addEventListener("mouseleave",this.hide),window.addEventListener("click",u=>{this.menu.contains(u.target)||this.hide()});let l=this.menu.querySelector("input");l!==null&&l.focus(),this.showing=!0;let d=new Event("show");this.container.dispatchEvent(d),t&&t.stopPropagation()}hideAll(){for(let t of window.$components.get("dropdown"))t.hide()}hide(){this.menu.style.display="none",this.menu.classList.remove("anim","menuIn"),this.toggle.setAttribute("aria-expanded","false"),this.menu.style.top="",this.menu.style.bottom="",this.menu.style.maxHeight="",this.moveMenu&&(this.menu.style.position="",this.menu.style[this.direction]="",this.menu.style.width="",this.menu.style.left="",this.container.appendChild(this.menu)),this.showing=!1}setupListeners(){let t=new gt(this.container,e=>{this.hide(),this.toggle.focus(),this.bubbleEscapes||e.stopPropagation()},e=>{e.target.nodeName==="INPUT"&&(e.preventDefault(),e.stopPropagation()),this.hide()});this.moveMenu&&t.shareHandlingToEl(this.menu),this.container.addEventListener("click",e=>{Array.from(this.menu.querySelectorAll("a")).includes(e.target)&&this.hide()}),T(this.toggle,e=>{e.stopPropagation(),e.preventDefault(),this.show(e),e instanceof KeyboardEvent&&t.focusNext()})}};var rn=class extends h{setup(){this.elem=this.$el,this.searchInput=this.$refs.searchInput,this.loadingElem=this.$refs.loading,this.listContainerElem=this.$refs.listContainer,this.localSearchSelector=this.$opts.localSearchSelector,this.url=this.$opts.url,this.elem.addEventListener("show",this.onShow.bind(this)),this.searchInput.addEventListener("input",this.onSearch.bind(this)),this.runAjaxSearch=mt(this.runAjaxSearch,300,!1)}onShow(){this.loadList()}onSearch(){let t=this.searchInput.value.toLowerCase().trim();this.localSearchSelector?this.runLocalSearch(t):(this.toggleLoading(!0),this.listContainerElem.innerHTML="",this.runAjaxSearch(t))}runAjaxSearch(t){this.loadList(t)}runLocalSearch(t){let e=this.listContainerElem.querySelectorAll(this.localSearchSelector);for(let n of e){let o=!t||n.textContent.toLowerCase().includes(t);n.style.display=o?"flex":"none",n.classList.toggle("hidden",!o)}}async loadList(t=""){this.listContainerElem.innerHTML="",this.toggleLoading(!0);try{let e=await window.$http.get(this.getAjaxUrl(t)),n=Fo(this.listContainerElem,80);this.listContainerElem.innerHTML=e.data,n()}catch(e){console.error(e)}this.toggleLoading(!1),this.localSearchSelector&&this.onSearch()}getAjaxUrl(t=null){if(!t)return this.url;let e=this.url.includes("?")?"&":"?";return`${this.url}${e}search=${encodeURIComponent(t)}`}toggleLoading(t=!1){this.loadingElem.style.display=t?"block":"none"}};var Wt=class{constructor(t){c(this,"data");this.data=t}hasItems(){return!!this.data&&!!this.data.types&&this.data.types.length>0}containsTabularData(){let t=this.data.getData("text/rtf");return!!t&&t.includes("\\trowd")}getImages(){return this.getFiles().filter(t=>t.type.includes("image"))}getFiles(){let{files:t}=this.data;return[...t]}};async function Hi(i){if(window.isSecureContext&&navigator.clipboard){await navigator.clipboard.writeText(i);return}let t=document.createElement("textarea");t.setAttribute("style","position: absolute; left: -1000px; top: -1000px;"),t.value=i,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}var an=class extends h{setup(){this.container=this.$el,this.statusArea=this.$refs.statusArea,this.dropTarget=this.$refs.dropTarget,this.selectButtons=this.$manyRefs.selectButton||[],this.isActive=!0,this.url=this.$opts.url,this.method=(this.$opts.method||"post").toUpperCase(),this.successMessage=this.$opts.successMessage,this.errorMessage=this.$opts.errorMessage,this.uploadLimitMb=Number(this.$opts.uploadLimit),this.uploadLimitMessage=this.$opts.uploadLimitMessage,this.zoneText=this.$opts.zoneText,this.fileAcceptTypes=this.$opts.fileAccept,this.allowMultiple=this.$opts.allowMultiple==="true",this.setupListeners()}toggleActive(t){this.isActive=t}setupListeners(){T(this.selectButtons,this.manualSelectHandler.bind(this)),this.setupDropTargetHandlers()}setupDropTargetHandlers(){let t=0,e=()=>{this.hideOverlay(),t=0};this.dropTarget.addEventListener("dragenter",n=>{n.preventDefault(),t+=1,t===1&&this.isActive&&this.showOverlay()}),this.dropTarget.addEventListener("dragover",n=>{n.preventDefault()}),this.dropTarget.addEventListener("dragend",e),this.dropTarget.addEventListener("dragleave",()=>{t-=1,t===0&&e()}),this.dropTarget.addEventListener("drop",n=>{if(n.preventDefault(),e(),!this.isActive)return;let s=new Wt(n.dataTransfer).getFiles();for(let r of s)this.createUploadFromFile(r)})}manualSelectHandler(){let t=ot("input",{type:"file",style:"left: -400px; visibility: hidden; position: fixed;",accept:this.fileAcceptTypes,multiple:this.allowMultiple?"":null});this.container.append(t),t.click(),t.addEventListener("change",()=>{for(let e of t.files)this.createUploadFromFile(e);t.remove()})}showOverlay(){if(!this.dropTarget.querySelector(".dropzone-overlay")){let e=ot("div",{class:"dropzone-overlay"},[this.zoneText]);this.dropTarget.append(e)}}hideOverlay(){let t=this.dropTarget.querySelector(".dropzone-overlay");t&&t.remove()}createUploadFromFile(t){let{dom:e,status:n,progress:o,dismiss:s}=this.createDomForFile(t);this.statusArea.append(e);let r=this,a={file:t,dom:e,updateProgress(l){o.textContent=`${l}%`,o.style.width=`${l}%`},markError(l){n.setAttribute("data-status","error"),n.textContent=l,Zt(e),this.updateProgress(100)},markSuccess(l){n.setAttribute("data-status","success"),n.textContent=l,Zt(e),setTimeout(s,2400),r.$emit("upload-success",{name:t.name})}};return t.size>this.uploadLimitMb*1e6?(a.markError(this.uploadLimitMessage),a):(this.startXhrForUpload(a),a)}startXhrForUpload(t){let e=new FormData;e.append("file",t.file,t.file.name),this.method!=="POST"&&e.append("_method",this.method);let n=this,o=window.$http.createXMLHttpRequest("POST",this.url,{error(){t.markError(n.errorMessage)},readystatechange(){this.readyState===XMLHttpRequest.DONE&&this.status===200?t.markSuccess(n.successMessage):this.readyState===XMLHttpRequest.DONE&&this.status>=400&&t.markError(window.$http.formatErrorResponseText(this.responseText))}});o.upload.addEventListener("progress",s=>{let r=Math.min(Math.ceil(s.loaded/s.total*100),100);t.updateProgress(r)}),o.setRequestHeader("Accept","application/json"),o.send(e)}createDomForFile(t){let e=ot("img",{src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.224 7.373a.924.924 0 0 0-.92.925l-.006 7.404c0 .509.412.925.921.925h5.557a.928.928 0 0 0 .926-.925v-5.553l-2.777-2.776Zm3.239 3.239V8.067l2.545 2.545z' style='fill:%23000;fill-opacity:.75'/%3E%3C/svg%3E"}),n=ot("div",{class:"dropzone-file-item-status"},[]),o=ot("div",{class:"dropzone-file-item-progress"}),s=ot("div",{class:"dropzone-file-item-image-wrap"},[e]),r=ot("div",{class:"dropzone-file-item"},[s,ot("div",{class:"dropzone-file-item-text-wrap"},[ot("div",{class:"dropzone-file-item-label"},[t.name]),Bt(),n]),o]);t.type.startsWith("image/")&&(e.src=URL.createObjectURL(t));let a=()=>{r.classList.add("dismiss"),r.addEventListener("animationend",()=>{r.remove()})};return r.addEventListener("click",a),{dom:r,progress:o,status:n,dismiss:a}}};var ln=class extends h{constructor(){super(...arguments);c(this,"container");c(this,"buttons");c(this,"contentElements");c(this,"toggleButton");c(this,"editorWrapEl");c(this,"open",!1);c(this,"tab","")}setup(){this.container=this.$el,this.buttons=this.$manyRefs.tabButton,this.contentElements=this.$manyRefs.tabContent,this.toggleButton=this.$refs.toggle,this.editorWrapEl=this.container.closest(".page-editor"),this.setupListeners(),this.setActiveTab(this.contentElements[0].dataset.tabContent||"")}setupListeners(){this.toggleButton.addEventListener("click",()=>this.toggle()),this.container.addEventListener("click",e=>{let n=e.target.closest("button");if(n instanceof HTMLButtonElement&&this.buttons.includes(n)){let o=n.dataset.tab||"";this.setActiveTab(o,!0)}})}toggle(){this.container.classList.toggle("open");let e=this.container.classList.contains("open");this.toggleButton.setAttribute("aria-expanded",e?"true":"false"),this.editorWrapEl.classList.toggle("toolbox-open",e),this.open=e,this.emitState()}setActiveTab(e,n=!1){for(let o of this.buttons)o.classList.remove("active"),o.dataset.tab===e&&o.classList.add("active");for(let o of this.contentElements)o.style.display="none",o.dataset.tabContent===e&&(o.style.display="block");n&&!this.container.classList.contains("open")&&this.toggle(),this.tab=e,this.emitState()}emitState(){let e={tab:this.tab,open:this.open};this.$emit("change",e)}};var cn=class extends h{setup(){this.container=this.$el,this.entityType=this.$opts.entityType,this.everyoneInheritToggle=this.$refs.everyoneInherit,this.roleSelect=this.$refs.roleSelect,this.roleContainer=this.$refs.roleContainer,this.setupListeners()}setupListeners(){this.everyoneInheritToggle.addEventListener("change",t=>{let e=t.target.checked,n=document.querySelectorAll('input[name^="permissions[0]["]');for(let o of n)o.disabled=e,o.checked=!1}),this.container.addEventListener("click",t=>{let e=t.target.closest("button");e&&e.dataset.roleId&&this.removeRowOnButtonClick(e)}),this.roleSelect.addEventListener("change",()=>{let t=this.roleSelect.value;t&&this.addRoleRow(t)})}async addRoleRow(t){this.roleSelect.disabled=!0;let e=this.roleSelect.querySelector(`option[value="${t}"]`);e&&e.remove();let n=await window.$http.get(`/permissions/form-row/${this.entityType}/${t}`),o=Q(n.data);this.roleContainer.append(o),this.roleSelect.disabled=!1}removeRowOnButtonClick(t){let e=t.closest(".item-list-row"),{roleId:n}=t.dataset,{roleName:o}=t.dataset,s=document.createElement("option");s.value=n,s.textContent=o,this.roleSelect.append(s),e.remove()}};var dn=class extends h{setup(){this.entityId=this.$opts.entityId,this.entityType=this.$opts.entityType,this.contentView=this.$refs.contentView,this.searchView=this.$refs.searchView,this.searchResults=this.$refs.searchResults,this.searchInput=this.$refs.searchInput,this.searchForm=this.$refs.searchForm,this.clearButton=this.$refs.clearButton,this.loadingBlock=this.$refs.loadingBlock,this.setupListeners()}setupListeners(){this.searchInput.addEventListener("change",this.runSearch.bind(this)),this.searchForm.addEventListener("submit",t=>{t.preventDefault(),this.runSearch()}),T(this.clearButton,this.clearSearch.bind(this))}runSearch(){let t=this.searchInput.value.trim();if(t.length===0){this.clearSearch();return}this.searchView.classList.remove("hidden"),this.contentView.classList.add("hidden"),this.loadingBlock.classList.remove("hidden");let e=window.baseUrl(`/search/${this.entityType}/${this.entityId}`);window.$http.get(e,{term:t}).then(n=>{this.searchResults.innerHTML=n.data}).catch(console.error).then(()=>{this.loadingBlock.classList.add("hidden")})}clearSearch(){this.searchView.classList.add("hidden"),this.contentView.classList.remove("hidden"),this.loadingBlock.classList.add("hidden"),this.searchInput.value=""}};var hn=class extends h{constructor(){super(...arguments);c(this,"elem");c(this,"input");c(this,"searchInput");c(this,"loading");c(this,"resultsContainer");c(this,"searchOptions");c(this,"search","");c(this,"lastClick",0)}setup(){this.elem=this.$el,this.input=this.$refs.input,this.searchInput=this.$refs.search,this.loading=this.$refs.loading,this.resultsContainer=this.$refs.results,this.searchOptions={entityTypes:this.$opts.entityTypes||"page,book,chapter",entityPermission:this.$opts.entityPermission||"view",searchEndpoint:this.$opts.searchEndpoint||"",initialValue:this.searchInput.value||""},this.setupListeners(),this.showLoading(),this.searchOptions.searchEndpoint&&this.initialLoad()}configureSearchOptions(e){Object.assign(this.searchOptions,e),this.reset(),this.searchInput.value=this.searchOptions.initialValue}setupListeners(){this.elem.addEventListener("click",this.onClick.bind(this));let e=0;this.searchInput.addEventListener("input",()=>{e=Date.now(),this.showLoading(),setTimeout(()=>{Date.now()-e<199||this.searchEntities(this.searchInput.value)},200)}),this.searchInput.addEventListener("keydown",n=>{n.keyCode===13&&n.preventDefault()}),I(this.$el,"[data-entity-type]","keydown",n=>{if(n.ctrlKey&&n.code==="Enter"){let o=this.$el.closest("form");if(o){o.submit(),n.preventDefault();return}}n.code==="ArrowDown"&&this.focusAdjacent(!0),n.code==="ArrowUp"&&this.focusAdjacent(!1)}),this.searchInput.addEventListener("keydown",n=>{n.code==="ArrowDown"&&this.focusAdjacent(!0)})}focusAdjacent(e=!0){let n=Array.from(this.resultsContainer.querySelectorAll("[data-entity-type]")),o=n.indexOf(document.activeElement),s=n[o+(e?1:-1)]||n[0];s instanceof HTMLElement&&s.focus()}reset(){this.searchInput.value="",this.showLoading(),this.initialLoad()}focusSearch(){this.searchInput.focus()}showLoading(){this.loading.style.display="block",this.resultsContainer.style.display="none"}hideLoading(){this.loading.style.display="none",this.resultsContainer.style.display="block"}initialLoad(){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");if(this.searchOptions.initialValue){this.searchEntities(this.searchOptions.initialValue);return}window.$http.get(this.searchUrl()).then(e=>{this.resultsContainer.innerHTML=e.data,this.hideLoading()})}searchUrl(){let e=`types=${encodeURIComponent(this.searchOptions.entityTypes)}&permission=${encodeURIComponent(this.searchOptions.entityPermission)}`;return`${this.searchOptions.searchEndpoint}?${e}`}searchEntities(e){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");this.input.value="";let n=`${this.searchUrl()}&term=${encodeURIComponent(e)}`;window.$http.get(n).then(o=>{this.resultsContainer.innerHTML=o.data,this.hideLoading()})}isDoubleClick(){let e=Date.now(),n=e-this.lastClick<300;return this.lastClick=e,n}onClick(e){let n=e.target.closest("[data-entity-type]");n instanceof HTMLElement&&(e.preventDefault(),e.stopPropagation(),this.selectItem(n))}selectItem(e){let n=this.isDoubleClick(),o=e.getAttribute("data-entity-type"),s=e.getAttribute("data-entity-id"),r=!e.classList.contains("selected")||n;this.unselectAll(),this.input.value=r?`${o}:${s}`:"";let a=e.getAttribute("href")||"",l=e.querySelector(".entity-list-item-name")?.textContent||"",d={id:Number(s),name:l,link:a};r?e.classList.add("selected"):window.$events.emit("entity-select-change"),!(!n&&!r)&&(n&&this.confirmSelection(d),r&&window.$events.emit("entity-select-change",d))}confirmSelection(e){window.$events.emit("entity-select-confirm",e)}unselectAll(){let e=this.elem.querySelectorAll(".selected");for(let n of e)n.classList.remove("selected","primary-background")}};var un=class extends h{constructor(){super(...arguments);c(this,"container");c(this,"selectButton");c(this,"selectorEl");c(this,"callback",null);c(this,"selection",null)}setup(){this.container=this.$el,this.selectButton=this.$refs.select,this.selectorEl=this.$refs.selector,this.selectButton.addEventListener("click",this.onSelectButtonClick.bind(this)),window.$events.listen("entity-select-change",this.onSelectionChange.bind(this)),window.$events.listen("entity-select-confirm",this.handleConfirmedSelection.bind(this))}show(e,n={}){this.callback=e,this.getSelector().configureSearchOptions(n),this.getPopup().show(),this.getSelector().focusSearch()}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.container,"popup")}getSelector(){return window.$components.firstOnElement(this.selectorEl,"entity-selector")}onSelectButtonClick(){this.handleConfirmedSelection(this.selection)}onSelectionChange(e){this.selection=e.hasOwnProperty("id")?e:null,this.selection?this.selectButton.removeAttribute("disabled"):this.selectButton.setAttribute("disabled","true")}handleConfirmedSelection(e){this.hide(),this.getSelector().reset(),this.callback&&e&&this.callback(e)}};var pn=class extends h{setup(){this.container=this.$el,this.name=this.$opts.name,T(this.$el,()=>{this.$emit(this.name,this.$opts)})}};var mn=class extends h{setup(){this.targetSelector=this.$opts.targetSelector,this.isOpen=this.$opts.isOpen==="true",this.updateEndpoint=this.$opts.updateEndpoint,this.$el.addEventListener("click",this.click.bind(this))}open(t){Vt(t,200)}close(t){qt(t,200)}click(t){t.preventDefault();let e=document.querySelectorAll(this.targetSelector);for(let n of e)(this.isOpen?this.close:this.open)(n);this.isOpen=!this.isOpen,this.updateSystemAjax(this.isOpen)}updateSystemAjax(t){window.$http.patch(this.updateEndpoint,{expand:t?"true":"false"})}};var fn=class extends h{setup(){this.container=this.$el,this.input=this.$refs.input,this.suggestions=this.$refs.suggestions,this.suggestionResultsWrap=this.$refs.suggestionResults,this.loadingWrap=this.$refs.loading,this.button=this.$refs.button,this.setupListeners()}setupListeners(){let t=mt(this.updateSuggestions.bind(this),200,!1);this.input.addEventListener("input",()=>{let{value:e}=this.input;e.length>0?(this.loadingWrap.style.display="block",this.suggestionResultsWrap.style.opacity="0.5",t(e)):this.hideSuggestions()}),this.input.addEventListener("dblclick",()=>{this.input.setAttribute("autocomplete","on"),this.button.focus(),this.input.focus()}),new gt(this.container,()=>{this.hideSuggestions()})}async updateSuggestions(t){let{data:e}=await window.$http.get("/search/suggest",{term:t});if(!this.input.value)return;let n=Q(e);this.suggestionResultsWrap.innerHTML="",this.suggestionResultsWrap.style.opacity="1",this.loadingWrap.style.display="none",this.suggestionResultsWrap.append(n),this.container.classList.contains("search-active")||this.showSuggestions()}showSuggestions(){this.container.classList.add("search-active"),window.requestAnimationFrame(()=>{this.suggestions.classList.add("search-suggestions-animation")})}hideSuggestions(){this.container.classList.remove("search-active"),this.suggestions.classList.remove("search-suggestions-animation"),this.suggestionResultsWrap.innerHTML=""}};var gn=class extends h{setup(){this.elem=this.$el,this.toggleButton=this.$refs.toggle,this.menu=this.$refs.menu,this.open=!1,this.toggleButton.addEventListener("click",this.onToggle.bind(this)),this.onWindowClick=this.onWindowClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}onToggle(t){this.open=!this.open,this.menu.classList.toggle("show",this.open),this.toggleButton.setAttribute("aria-expanded",this.open?"true":"false"),this.open?(this.elem.addEventListener("keydown",this.onKeyDown),window.addEventListener("click",this.onWindowClick)):(this.elem.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("click",this.onWindowClick)),t.stopPropagation()}onKeyDown(t){t.code==="Escape"&&this.onToggle(t)}onWindowClick(t){this.onToggle(t)}};var vn=class extends h{setup(){this.uploadedTo=this.$opts.uploadedTo,this.container=this.$el,this.popupEl=this.$refs.popup,this.searchForm=this.$refs.searchForm,this.searchInput=this.$refs.searchInput,this.cancelSearch=this.$refs.cancelSearch,this.listContainer=this.$refs.listContainer,this.filterTabs=this.$manyRefs.filterTabs,this.selectButton=this.$refs.selectButton,this.uploadButton=this.$refs.uploadButton,this.uploadHint=this.$refs.uploadHint,this.formContainer=this.$refs.formContainer,this.formContainerPlaceholder=this.$refs.formContainerPlaceholder,this.dropzoneContainer=this.$refs.dropzoneContainer,this.loadMore=this.$refs.loadMore,this.type="gallery",this.lastSelected={},this.lastSelectedTime=0,this.callback=null,this.resetState=()=>{this.hasData=!1,this.page=1,this.filter="all"},this.resetState(),this.setupListeners()}setupListeners(){T(this.filterTabs,n=>{this.resetAll(),this.filter=n.target.dataset.filter,this.setActiveFilterTab(this.filter),this.loadGallery()}),this.searchForm.addEventListener("submit",n=>{this.resetListView(),this.loadGallery(),this.cancelSearch.toggleAttribute("hidden",!this.searchInput.value),n.preventDefault()}),T(this.cancelSearch,()=>{this.resetListView(),this.resetSearchView(),this.loadGallery()}),I(this.container,".load-more button","click",this.runLoadMore.bind(this)),this.listContainer.addEventListener("event-emit-select-image",this.onImageSelectEvent.bind(this)),this.listContainer.addEventListener("error",n=>{n.target.src=window.baseUrl("loading_error.png")},!0),T(this.selectButton,()=>{this.callback&&this.callback(this.lastSelected),this.hide()}),I(this.formContainer,"#image-manager-delete","click",()=>{this.lastSelected&&this.loadImageEditForm(this.lastSelected.id,!0)}),I(this.formContainer,"#image-manager-rebuild-thumbs","click",async(n,o)=>{o.disabled=!0,this.lastSelected&&await this.rebuildThumbnails(this.lastSelected.id),o.disabled=!1}),this.formContainer.addEventListener("ajax-form-success",()=>{this.refreshGallery(),this.resetEditForm()}),this.container.addEventListener("dropzone-upload-success",this.refreshGallery.bind(this));let t=this.listContainer.parentElement,e=[];t.addEventListener("wheel",n=>{if(!(Math.ceil(t.scrollHeight-t.scrollTop)===t.clientHeight)||n.deltaY<1)return;let r=Date.now()-1e3;e.push(Date.now()),e=e.filter(a=>a>=r),e.length>5&&this.canLoadMore()&&this.runLoadMore()})}show(t,e="gallery"){this.resetAll(),this.callback=t,this.type=e,this.getPopup().show();let n=e!=="gallery";this.dropzoneContainer.classList.toggle("hidden",n),this.uploadButton.classList.toggle("hidden",n),this.uploadHint.classList.toggle("hidden",n),window.$components.firstOnElement(this.container,"dropzone").toggleActive(!n),this.hasData||(this.loadGallery(),this.hasData=!0)}hide(){this.getPopup().hide()}getPopup(){return window.$components.firstOnElement(this.popupEl,"popup")}async loadGallery(){let t={page:this.page,search:this.searchInput.value||null,uploaded_to:this.uploadedTo,filter_type:this.filter==="all"?null:this.filter},{data:e}=await window.$http.get(`images/${this.type}`,t);t.page===1&&(this.listContainer.innerHTML=""),this.addReturnedHtmlElementsToList(e),Zt(this.listContainer)}addReturnedHtmlElementsToList(t){let e=document.createElement("div");e.innerHTML=t;let n=e.querySelector(".load-more");n&&(n.remove(),this.loadMore.innerHTML=n.innerHTML),this.loadMore.toggleAttribute("hidden",!n),window.$components.init(e);for(let o of[...e.children])this.listContainer.appendChild(o)}setActiveFilterTab(t){for(let e of this.filterTabs){let n=e.dataset.filter===t;e.setAttribute("aria-selected",n?"true":"false")}}resetAll(){this.resetState(),this.resetListView(),this.resetSearchView(),this.resetEditForm(),this.setActiveFilterTab("all"),this.selectButton.classList.add("hidden")}resetSearchView(){this.searchInput.value="",this.cancelSearch.toggleAttribute("hidden",!0)}resetEditForm(){this.formContainer.innerHTML="",this.formContainerPlaceholder.removeAttribute("hidden")}resetListView(){Tt(this.listContainer),this.page=1}refreshGallery(){this.resetListView(),this.loadGallery()}async onImageSelectEvent(t){let e=JSON.parse(t.detail.data),n=e&&e.id===this.lastSelected.id&&Date.now()-this.lastSelectedTime<400,o=t.target.classList.contains("selected");[...this.listContainer.querySelectorAll(".selected")].forEach(s=>{s.classList.remove("selected")}),!o&&!n?(t.target.classList.add("selected"),e=await this.loadImageEditForm(e.id)):n?n&&(e=this.lastSelected):this.resetEditForm(),this.selectButton.classList.toggle("hidden",o),n&&this.callback&&(this.callback(e),this.hide()),this.lastSelected=e,this.lastSelectedTime=Date.now()}async loadImageEditForm(t,e=!1){e||(this.formContainer.innerHTML="");let n=e?{delete:!0}:{},{data:o}=await window.$http.get(`/images/edit/${t}`,n);this.formContainer.innerHTML=o,this.formContainerPlaceholder.setAttribute("hidden",""),window.$components.init(this.formContainer);let s=this.formContainer.querySelector("#image-manager-form-image-data");return JSON.parse(s.text)}runLoadMore(){Tt(this.loadMore),this.page+=1,this.loadGallery()}canLoadMore(){return this.loadMore.querySelector("button")&&!this.loadMore.hasAttribute("hidden")}async rebuildThumbnails(t){try{let e=await window.$http.put(`/images/${t}/rebuild-thumbnails`);window.$events.success(e.data),this.refreshGallery()}catch(e){window.$events.showResponseError(e)}}};var wn=class extends h{setup(){this.imageElem=this.$refs.image,this.imageInput=this.$refs.imageInput,this.resetInput=this.$refs.resetInput,this.removeInput=this.$refs.removeInput,this.resetButton=this.$refs.resetButton,this.removeButton=this.$refs.removeButton||null,this.defaultImage=this.$opts.defaultImage,this.setupListeners()}setupListeners(){this.resetButton.addEventListener("click",this.reset.bind(this)),this.removeButton&&this.removeButton.addEventListener("click",this.removeImage.bind(this)),this.imageInput.addEventListener("change",this.fileInputChange.bind(this))}fileInputChange(){this.resetInput.setAttribute("disabled","disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled");for(let t of this.imageInput.files)this.imageElem.src=window.URL.createObjectURL(t);this.imageElem.classList.remove("none")}reset(){this.imageInput.value="",this.imageElem.src=this.defaultImage,this.resetInput.removeAttribute("disabled"),this.removeInput&&this.removeInput.setAttribute("disabled","disabled"),this.imageElem.classList.remove("none")}removeImage(){this.imageInput.value="",this.imageElem.classList.add("none"),this.removeInput.removeAttribute("disabled"),this.resetInput.setAttribute("disabled","disabled")}};var bn=class extends h{setup(){this.elem=this.$el,this.menu=this.$refs.menu,this.sortInput=this.$refs.sort,this.orderInput=this.$refs.order,this.form=this.$refs.form,this.setupListeners()}setupListeners(){this.menu.addEventListener("click",t=>{t.target.closest("[data-sort-value]")!==null&&this.sortOptionClick(t)}),this.elem.addEventListener("click",t=>{t.target.closest("[data-sort-dir]")!==null&&this.sortDirectionClick(t)})}sortOptionClick(t){let e=t.target.closest("[data-sort-value]");this.sortInput.value=e.getAttribute("data-sort-value"),t.preventDefault(),this.form.submit()}sortDirectionClick(t){let e=this.orderInput.value;this.orderInput.value=e==="asc"?"desc":"asc",t.preventDefault(),this.form.submit()}};function q(i,t={},e=[]){let n=document.createElement(i),o=Object.keys(t);for(let s of o)t[s]!==null&&n.setAttribute(s,t[s]);for(let s of e)typeof s=="string"?n.append(document.createTextNode(s)):n.append(s);return n}var yn=class extends h{constructor(){super(...arguments);c(this,"button");c(this,"loadingEl",null)}setup(){this.button=this.$el;let e=this.button.form,n=()=>{setTimeout(()=>this.showLoadingState(),10)};this.button.addEventListener("click",n),e&&e.addEventListener("submit",n)}showLoadingState(){this.button.disabled=!0,this.loadingEl||(this.loadingEl=q("div",{class:"inline block"}),Tt(this.loadingEl),this.button.after(this.loadingEl))}};var En=class extends h{setup(){this.elem=this.$el,this.pageId=this.$opts.pageId,this.textDirection=this.$opts.textDirection,this.imageUploadErrorText=this.$opts.imageUploadErrorText,this.serverUploadLimitText=this.$opts.serverUploadLimitText,this.display=this.$refs.display,this.input=this.$refs.input,this.divider=this.$refs.divider,this.displayWrap=this.$refs.displayWrap;let{settingContainer:t}=this.$refs,e=t.querySelectorAll('input[type="checkbox"]');this.editor=null,window.importVersioned("markdown").then(n=>n.init({pageId:this.pageId,container:this.elem,displayEl:this.display,inputEl:this.input,drawioUrl:this.getDrawioUrl(),settingInputs:Array.from(e),text:{serverUploadLimit:this.serverUploadLimitText,imageUploadError:this.imageUploadErrorText}})).then(n=>{this.editor=n,this.setupListeners(),this.emitEditorEvents(),this.scrollToTextIfNeeded(),this.editor.actions.updateAndRender()})}emitEditorEvents(){window.$events.emitPublic(this.elem,"editor-markdown::setup",{markdownIt:this.editor.markdown.getRenderer(),displayEl:this.display,cmEditorView:this.editor.cm})}setupListeners(){this.elem.addEventListener("click",t=>{let e=t.target.closest("button[data-action]");if(e===null)return;let n=e.getAttribute("data-action");if(n==="insertImage"&&this.editor.actions.showImageInsert(),n==="insertLink"&&this.editor.actions.showLinkSelector(),n==="insertDrawing"&&(t.ctrlKey||t.metaKey)){this.editor.actions.showImageManager();return}n==="insertDrawing"&&this.editor.actions.startDrawing(),n==="fullscreen"&&this.editor.actions.fullScreen()}),this.elem.addEventListener("click",t=>{let e=t.target.closest(".editor-toolbar-label");if(!e)return;let n=this.elem.querySelectorAll(".markdown-editor-wrap");for(let o of n)o.classList.remove("active");e.closest(".markdown-editor-wrap").classList.add("active")}),this.handleDividerDrag()}handleDividerDrag(){this.divider.addEventListener("pointerdown",()=>{let e=this.elem.getBoundingClientRect(),n=s=>{let r=s.pageX-e.left,a=Math.min(Math.max(20,Math.floor(r/e.width*100)),80);this.displayWrap.style.flexBasis=`${100-a}%`,this.editor.settings.set("editorWidth",a)},o=()=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",o),this.display.style.pointerEvents=null,document.body.style.userSelect=null};this.display.style.pointerEvents="none",document.body.style.userSelect="none",window.addEventListener("pointermove",n),window.addEventListener("pointerup",o)});let t=this.editor.settings.get("editorWidth");t&&(this.displayWrap.style.flexBasis=`${100-t}%`)}scrollToTextIfNeeded(){let e=new URL(window.location).searchParams.get("content-text");e&&this.editor.actions.scrollToText(e)}getDrawioUrl(){let t=document.querySelector("[drawio-url]");return t&&t.getAttribute("drawio-url")||""}async getContent(){return this.editor.actions.getContent()}};var Cn=class extends h{setup(){this.container=this.$el,this.inputContainer=this.$refs.inputContainer,this.inviteOption=this.container.querySelector("input[name=send_invite]"),this.inviteOption&&(this.inviteOption.addEventListener("change",this.inviteOptionChange.bind(this)),this.inviteOptionChange())}inviteOptionChange(){let t=this.inviteOption.value==="true",e=this.container.querySelectorAll("input[type=password]");for(let n of e)n.disabled=t;this.inputContainer.style.display=t?"none":"block"}};var Ln=class extends h{setup(){this.container=this.$el,this.type=this.$opts.type,this.textElem=this.container.querySelector("span"),this.autoHide=this.$opts.autoHide==="true",this.initialShow=this.$opts.show==="true",this.container.style.display="grid",window.$events.listen(this.type,t=>{this.show(t)}),this.container.addEventListener("click",this.hide.bind(this)),this.initialShow&&setTimeout(()=>this.show(this.textElem.textContent),100),this.hideCleanup=this.hideCleanup.bind(this)}show(t=""){if(this.container.removeEventListener("transitionend",this.hideCleanup),this.textElem.textContent=t,this.container.style.display="grid",setTimeout(()=>{this.container.classList.add("showing")},1),this.autoHide){let e=t.split(" ").length,n=Math.max(2e3,1e3+250*e);setTimeout(this.hide.bind(this),n)}}hide(){this.container.classList.remove("showing"),this.container.addEventListener("transitionend",this.hideCleanup)}hideCleanup(){this.container.style.display="none",this.container.removeEventListener("transitionend",this.hideCleanup)}};var xn=class extends h{setup(){this.removeButton=this.$refs.remove,this.showButton=this.$refs.show,this.input=this.$refs.input,this.setupListeners()}setupListeners(){T(this.removeButton,()=>{this.input.value="",this.input.classList.add("hidden"),this.removeButton.classList.add("hidden"),this.showButton.classList.remove("hidden")}),T(this.showButton,()=>{this.input.classList.remove("hidden"),this.removeButton.classList.remove("hidden"),this.showButton.classList.add("hidden")})}};var Tn=class extends h{constructor(){super(...arguments);c(this,"commentId");c(this,"commentLocalId");c(this,"deletedText");c(this,"updatedText");c(this,"archiveText");c(this,"wysiwygEditor",null);c(this,"wysiwygTextDirection");c(this,"container");c(this,"contentContainer");c(this,"form");c(this,"formCancel");c(this,"editButton");c(this,"deleteButton");c(this,"replyButton");c(this,"archiveButton");c(this,"input")}setup(){this.commentId=this.$opts.commentId,this.commentLocalId=this.$opts.commentLocalId,this.deletedText=this.$opts.deletedText,this.updatedText=this.$opts.updatedText,this.archiveText=this.$opts.archiveText,this.wysiwygTextDirection=this.$opts.wysiwygTextDirection,this.container=this.$el,this.contentContainer=this.$refs.contentContainer,this.form=this.$refs.form,this.formCancel=this.$refs.formCancel,this.editButton=this.$refs.editButton,this.deleteButton=this.$refs.deleteButton,this.replyButton=this.$refs.replyButton,this.archiveButton=this.$refs.archiveButton,this.input=this.$refs.input,this.setupListeners()}setupListeners(){if(this.replyButton){let e={id:this.commentLocalId,element:this.container};this.replyButton.addEventListener("click",()=>this.$emit("reply",e))}this.editButton&&(this.editButton.addEventListener("click",this.startEdit.bind(this)),this.form.addEventListener("submit",this.update.bind(this)),this.formCancel.addEventListener("click",()=>this.toggleEditMode(!1))),this.deleteButton&&this.deleteButton.addEventListener("click",this.delete.bind(this)),this.archiveButton&&this.archiveButton.addEventListener("click",this.archive.bind(this))}toggleEditMode(e){this.contentContainer.toggleAttribute("hidden",e),this.form.toggleAttribute("hidden",!e)}async startEdit(){if(this.toggleEditMode(!0),this.wysiwygEditor){this.wysiwygEditor.focus();return}let e=await window.importVersioned("wysiwyg"),n=this.input.value,o=q("div",{class:"comment-editor-container"});this.input.parentElement?.appendChild(o),this.input.hidden=!0,this.wysiwygEditor=e.createBasicEditorInstance(o,n,{darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.$opts.textDirection,translations:window.editor_translations}),this.wysiwygEditor.focus()}async update(e){e.preventDefault();let n=this.showLoading();this.form.toggleAttribute("hidden",!0);let o={html:await this.wysiwygEditor?.getContentAsHtml()||""};try{let s=await window.$http.put(`/comment/${this.commentId}`,o),r=Q(s.data);this.container.replaceWith(r),window.$events.success(this.updatedText)}catch(s){console.error(s),s instanceof Lt&&window.$events.showValidationErrors(s),this.form.toggleAttribute("hidden",!1),n.remove()}}async delete(){this.showLoading(),await window.$http.delete(`/comment/${this.commentId}`),this.$emit("delete");let e=this.container.closest(".comment-branch");if(e instanceof HTMLElement){let n=window.$components.allWithinElement(e,"page-comment-reference");for(let o of n)o.hideMarker();e.remove()}window.$events.success(this.deletedText)}async archive(){this.showLoading();let n=this.archiveButton.dataset.isArchived==="true"?"unarchive":"archive",o=await window.$http.put(`/comment/${this.commentId}/${n}`);window.$events.success(this.archiveText);let s={new_thread_dom:Q(o.data)};this.$emit(n,s);let r=this.container.closest(".comment-branch"),a=window.$components.allWithinElement(r,"page-comment-reference");for(let l of a)l.hideMarker();r.remove()}showLoading(){let e=Bt();return e.classList.add("px-l"),this.container.append(e),e}};var _o='';var qo='';var Ut=null,Sn=class extends h{constructor(){super(...arguments);c(this,"link");c(this,"reference");c(this,"markerWrap",null);c(this,"viewCommentText");c(this,"jumpToThreadText");c(this,"closeText")}setup(){this.link=this.$el,this.reference=this.$opts.reference,this.viewCommentText=this.$opts.viewCommentText,this.jumpToThreadText=this.$opts.jumpToThreadText,this.closeText=this.$opts.closeText,this.showForDisplay(),window.addEventListener("editor-toolbox-change",e=>{let n=e.detail.tab,o=e.detail.open;n==="comments"&&o&&this.link.checkVisibility()?this.showForEditor():this.hideMarker()}),window.addEventListener("toggle",e=>{e.target instanceof HTMLElement&&e.target.contains(this.link)&&window.requestAnimationFrame(()=>{this.link.checkVisibility()?this.showForEditor():this.hideMarker()})},{capture:!0}),window.addEventListener("tabs-change",e=>{let n=e.detail.showing;if(!n.startsWith("comment-tab-panel"))return;document.getElementById(n)?.contains(this.link)?this.showForDisplay():this.hideMarker()})}showForDisplay(){let e=document.querySelector(".page-content");e instanceof HTMLElement&&this.link.checkVisibility()&&this.updateMarker(e)}showForEditor(){let e=document.querySelector(".editor-content-wrap");e instanceof HTMLElement&&this.updateMarker(e);let n=()=>{this.hideMarker(),setTimeout(()=>{window.$events.remove("editor-html-change",n)},1)};window.$events.listen("editor-html-change",n)}updateMarker(e){this.link.classList.remove("outdated","missing"),this.markerWrap&&this.markerWrap.remove();let[n,o,s]=this.reference.split(":"),r=document.getElementById(n);if(!r){this.link.classList.add("outdated","missing");return}Ee(r)!==o&&this.link.classList.add("outdated");let l=q("button",{type:"button",class:"content-comment-marker",title:this.viewCommentText});l.innerHTML=_o,l.addEventListener("click",u=>{this.showCommentAtMarker(l)}),this.markerWrap=q("div",{class:"content-comment-highlight"},[l]),e.append(this.markerWrap),this.positionMarker(r,s),this.link.href=`#${r.id}`,this.link.addEventListener("click",u=>{u.preventDefault(),xt(r)});let d=mt(()=>{this.positionMarker(r,s)},50,!1).bind(this);window.addEventListener("resize",d)}positionMarker(e,n){if(!this.markerWrap)return;let o=this.markerWrap.parentElement,s=o.getBoundingClientRect(),r=e.getBoundingClientRect(),[a,l]=n.split("-");if(a&&l){let p=new Range,f=ye(e,Number(a)),v=ye(e,Number(l));f&&v&&(p.setStart(f.node,f.offset),p.setEnd(v.node,v.offset),r=p.getBoundingClientRect())}let d=r.left-s.left,u=r.top-s.top+o.scrollTop;this.markerWrap.style.left=`${d}px`,this.markerWrap.style.top=`${u}px`,this.markerWrap.style.width=`${r.width}px`,this.markerWrap.style.height=`${r.height}px`}hideMarker(){Ut&&Ut(),this.markerWrap?.remove(),this.markerWrap=null}showCommentAtMarker(e){Ut&&Ut(),e.hidden=!0;let n=this.link.closest(".comment-box"),o=n.closest(".comment-branch").cloneNode(!0),s=o.querySelectorAll(".actions, form");for(let v of s)v.remove();let r=q("button",{type:"button",title:this.closeText});r.innerHTML=qo;let a=q("button",{type:"button","data-action":"jump"},[this.jumpToThreadText]),l=q("div",{class:"content-comment-window"},[q("div",{class:"content-comment-window-actions"},[a,r]),q("div",{class:"content-comment-window-content comment-container-compact comment-container-super-compact"},[o])]);e.parentElement?.append(l);let d=()=>{l.remove(),e.hidden=!1,window.removeEventListener("click",u),Ut=null},u=v=>{e.parentElement.contains(v.target)||d()};window.addEventListener("click",u),Ut=d,r.addEventListener("click",d.bind(this)),a.addEventListener("click",()=>{d(),n.scrollIntoView({behavior:"smooth"});let v=n.querySelector(".header");v.classList.add("anim-highlight"),v.addEventListener("animationend",()=>v.classList.remove("anim-highlight"))});let p=l.getBoundingClientRect(),f=document.querySelector(".page-content")?.getBoundingClientRect();if(f&&p.right>f.right){let v=p.right-f.right;l.style.left=`-${v}px`}}};var jt=class extends h{constructor(){super(...arguments);c(this,"container");c(this,"tabList");c(this,"tabs");c(this,"panels");c(this,"activeUnder");c(this,"active",null)}setup(){this.container=this.$el,this.tabList=this.container.querySelector('[role="tablist"]'),this.tabs=Array.from(this.tabList.querySelectorAll('[role="tab"]')),this.panels=Array.from(this.container.querySelectorAll(':scope > [role="tabpanel"], :scope > * > [role="tabpanel"]')),this.activeUnder=this.$opts.activeUnder?Number(this.$opts.activeUnder):1e4,this.container.addEventListener("click",e=>{let n=e.target.closest('[role="tab"]');n instanceof HTMLElement&&this.tabs.includes(n)&&this.show(n.getAttribute("aria-controls")||"")}),window.addEventListener("resize",this.updateActiveState.bind(this),{passive:!0}),this.updateActiveState()}show(e){for(let o of this.panels)o.toggleAttribute("hidden",o.id!==e);for(let o of this.tabs){let r=o.getAttribute("aria-controls")===e;o.setAttribute("aria-selected",r?"true":"false")}let n={showing:e};this.$emit("change",n)}updateActiveState(){let e=window.innerWidth!n.hasAttribute("hidden"))||this.panels[0];this.show(e.id),this.tabList.toggleAttribute("hidden",!1)}deactivate(){for(let e of this.panels)e.removeAttribute("hidden");for(let e of this.tabs)e.setAttribute("aria-selected","false");this.tabList.toggleAttribute("hidden",!0)}};var kn=class extends h{constructor(){super(...arguments);c(this,"elem");c(this,"pageId");c(this,"container");c(this,"commentCountBar");c(this,"activeTab");c(this,"archivedTab");c(this,"addButtonContainer");c(this,"archiveContainer");c(this,"activeContainer");c(this,"replyToRow");c(this,"referenceRow");c(this,"formContainer");c(this,"form");c(this,"formInput");c(this,"formReplyLink");c(this,"formReferenceLink");c(this,"addCommentButton");c(this,"hideFormButton");c(this,"removeReplyToButton");c(this,"removeReferenceButton");c(this,"wysiwygTextDirection");c(this,"wysiwygEditor",null);c(this,"createdText");c(this,"countText");c(this,"archivedCountText");c(this,"parentId",null);c(this,"contentReference","");c(this,"formReplyText","")}setup(){this.elem=this.$el,this.pageId=Number(this.$opts.pageId),this.container=this.$refs.commentContainer,this.commentCountBar=this.$refs.commentCountBar,this.activeTab=this.$refs.activeTab,this.archivedTab=this.$refs.archivedTab,this.addButtonContainer=this.$refs.addButtonContainer,this.archiveContainer=this.$refs.archiveContainer,this.activeContainer=this.$refs.activeContainer,this.replyToRow=this.$refs.replyToRow,this.referenceRow=this.$refs.referenceRow,this.formContainer=this.$refs.formContainer,this.form=this.$refs.form,this.formInput=this.$refs.formInput,this.formReplyLink=this.$refs.formReplyLink,this.formReferenceLink=this.$refs.formReferenceLink,this.addCommentButton=this.$refs.addCommentButton,this.hideFormButton=this.$refs.hideFormButton,this.removeReplyToButton=this.$refs.removeReplyToButton,this.removeReferenceButton=this.$refs.removeReferenceButton,this.wysiwygTextDirection=this.$opts.wysiwygTextDirection,this.createdText=this.$opts.createdText,this.countText=this.$opts.countText,this.archivedCountText=this.$opts.archivedCountText,this.formReplyText=this.formReplyLink?.textContent||"",this.setupListeners()}setupListeners(){this.elem.addEventListener("page-comment-delete",()=>{setTimeout(()=>{this.updateCount(),this.hideForm()},1)}),this.elem.addEventListener("page-comment-reply",e=>{this.setReply(e.detail.id,e.detail.element)}),this.elem.addEventListener("page-comment-archive",e=>{this.archiveContainer.append(e.detail.new_thread_dom),setTimeout(()=>this.updateCount(),1)}),this.elem.addEventListener("page-comment-unarchive",e=>{this.container.append(e.detail.new_thread_dom),setTimeout(()=>this.updateCount(),1)}),this.form&&(this.removeReplyToButton.addEventListener("click",this.removeReplyTo.bind(this)),this.removeReferenceButton.addEventListener("click",()=>this.setContentReference("")),this.hideFormButton.addEventListener("click",this.hideForm.bind(this)),this.addCommentButton.addEventListener("click",this.showForm.bind(this)),this.form.addEventListener("submit",this.saveComment.bind(this)))}async saveComment(e){e.preventDefault(),e.stopPropagation();let n=Bt();n.classList.add("px-l"),this.form.after(n),this.form.toggleAttribute("hidden",!0);let o={html:await this.wysiwygEditor?.getContentAsHtml()||"",parent_id:this.parentId||null,content_ref:this.contentReference};window.$http.post(`/comment/${this.pageId}`,o).then(s=>{let r=Q(s.data);o.parent_id?this.formContainer.after(r):this.container.append(r);let a=window.$components.allWithinElement(r,"page-comment-reference");for(let l of a)l.showForDisplay();window.$events.success(this.createdText),this.hideForm(),this.updateCount()}).catch(s=>{this.form.toggleAttribute("hidden",!1),window.$events.showValidationErrors(s)}),this.form.toggleAttribute("hidden",!1),n.remove()}updateCount(){let e=this.getActiveThreadCount();this.activeTab.textContent=window.$trans.choice(this.countText,e);let n=this.getArchivedThreadCount();this.archivedTab.textContent=window.$trans.choice(this.archivedCountText,n)}resetForm(){this.removeEditor(),this.formInput.value="",this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.setContentReference("")}showForm(){this.removeEditor(),this.formContainer.toggleAttribute("hidden",!1),this.addButtonContainer.toggleAttribute("hidden",!0),this.formContainer.scrollIntoView({behavior:"smooth",block:"nearest"}),this.loadEditor();let e=window.$components.firstOnElement(this.elem,"tabs");e instanceof jt&&this.formContainer.closest("#comment-tab-panel-active")&&e.show("comment-tab-panel-active")}hideForm(){this.resetForm(),this.formContainer.toggleAttribute("hidden",!0),this.getActiveThreadCount()>0?this.activeContainer.append(this.addButtonContainer):this.commentCountBar.append(this.addButtonContainer),this.addButtonContainer.toggleAttribute("hidden",!1)}async loadEditor(){if(this.wysiwygEditor){this.wysiwygEditor.focus();return}let e=await window.importVersioned("wysiwyg"),n=q("div",{class:"comment-editor-container"});this.formInput.parentElement?.appendChild(n),this.formInput.hidden=!0,this.wysiwygEditor=e.createBasicEditorInstance(n,"

    ",{darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.wysiwygTextDirection,translations:window.editor_translations}),this.wysiwygEditor.focus()}removeEditor(){this.wysiwygEditor&&(this.wysiwygEditor.remove(),this.wysiwygEditor=null)}getActiveThreadCount(){return this.container.querySelectorAll(":scope > .comment-branch:not([hidden])").length}getArchivedThreadCount(){return this.archiveContainer.querySelectorAll(":scope > .comment-branch").length}setReply(e,n){n.closest(".comment-branch").querySelector(".comment-branch-children").append(this.formContainer),this.showForm(),this.parentId=Number(e),this.replyToRow.toggleAttribute("hidden",!1),this.formReplyLink.textContent=this.formReplyText.replace("1234",String(this.parentId)),this.formReplyLink.href=`#comment${this.parentId}`}removeReplyTo(){this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.showForm()}startNewComment(e){this.resetForm(),this.showForm(),this.setContentReference(e)}setContentReference(e){this.contentReference=e,this.referenceRow.toggleAttribute("hidden",!e);let[n]=e.split(":");this.formReferenceLink.href=`#${n}`,this.formReferenceLink.onclick=function(o){o.preventDefault();let s=document.getElementById(n);s&&xt(s)}}};function ar(i,t){ai(`#page-navigation a[href="#${i}"]`,e=>{e.closest("li").classList.toggle("current-heading",t)})}function lr(i){for(let t of i){let e=t.intersectionRatio===1;ar(t.target.id,e)}}function cr(i){let t={rootMargin:"0px 0px 0px 0px",threshold:1},e=new IntersectionObserver(lr,t);for(let n of i)e.observe(n)}var $n=class extends h{setup(){if(this.container=this.$el,this.pageId=this.$opts.pageId,window.importVersioned("code").then(e=>e.highlight()),this.setupNavHighlighting(),window.location.hash){let e=window.location.hash.replace(/%20/g," ").substring(1);this.goToText(e)}let t=document.querySelector(".sidebar-page-nav");t&&I(t,"a","click",(e,n)=>{e.preventDefault(),window.$components.first("tri-layout").showContent();let o=n.getAttribute("href").substr(1);this.goToText(o),window.history.pushState(null,null,`#${o}`)})}goToText(t){let e=document.getElementById(t);if(ai(".page-content [data-highlighted]",n=>{n.removeAttribute("data-highlighted"),n.style.backgroundColor=null}),e!==null)xt(e);else{let n=ao(".page-content > div > *",t);n&&xt(n)}}setupNavHighlighting(){let t=document.querySelector(".sidebar-page-nav"),e=document.querySelector(".page-content").querySelectorAll("h1, h2, h3, h4, h5, h6");e.length>0&&t!==null&&cr(e)}};function Vo(i){let t=new Date(i*1e3),e=t.getHours(),n=t.getMinutes();return`${(e>9?"":"0")+e}:${(n>9?"":"0")+n}`}var Mn=class extends h{setup(){this.draftsEnabled=this.$opts.draftsEnabled==="true",this.editorType=this.$opts.editorType,this.pageId=Number(this.$opts.pageId),this.isNewDraft=this.$opts.pageNewDraft==="true",this.hasDefaultTitle=this.$opts.hasDefaultTitle||!1,this.container=this.$el,this.titleElem=this.$refs.titleContainer.querySelector("input"),this.saveDraftButton=this.$refs.saveDraft,this.discardDraftButton=this.$refs.discardDraft,this.discardDraftWrap=this.$refs.discardDraftWrap,this.deleteDraftButton=this.$refs.deleteDraft,this.deleteDraftWrap=this.$refs.deleteDraftWrap,this.draftDisplay=this.$refs.draftDisplay,this.draftDisplayIcon=this.$refs.draftDisplayIcon,this.changelogInput=this.$refs.changelogInput,this.changelogDisplay=this.$refs.changelogDisplay,this.changelogCounter=this.$refs.changelogCounter,this.changeEditorButtons=this.$manyRefs.changeEditor||[],this.switchDialogContainer=this.$refs.switchDialog,this.deleteDraftDialogContainer=this.$refs.deleteDraftDialog,this.draftText=this.$opts.draftText,this.autosaveFailText=this.$opts.autosaveFailText,this.editingPageText=this.$opts.editingPageText,this.draftDiscardedText=this.$opts.draftDiscardedText,this.draftDeleteText=this.$opts.draftDeleteText,this.draftDeleteFailText=this.$opts.draftDeleteFailText,this.setChangelogText=this.$opts.setChangelogText,this.autoSave={interval:null,frequency:3e4,last:0,pendingChange:!1},this.shownWarningsCache=new Set,this.pageId!==0&&this.draftsEnabled&&window.setTimeout(()=>{this.startAutoSave()},1e3),this.draftDisplay.innerHTML=this.draftText,this.setupListeners(),this.setInitialFocus()}setupListeners(){window.$events.listen("editor-save-draft",this.saveDraft.bind(this)),window.$events.listen("editor-save-page",this.savePage.bind(this));let t=()=>{this.autoSave.pendingChange=!0};window.$events.listen("editor-html-change",t),window.$events.listen("editor-markdown-change",t),this.titleElem.addEventListener("input",t);let e=mt(this.updateChangelogDisplay.bind(this),300,!1);this.changelogInput.addEventListener("input",()=>{let n=this.changelogInput.value.length;this.changelogCounter.innerText=`${n} / 180`,e()}),T(this.saveDraftButton,this.saveDraft.bind(this)),T(this.discardDraftButton,this.discardDraft.bind(this)),T(this.deleteDraftButton,this.deleteDraft.bind(this)),T(this.changeEditorButtons,this.changeEditor.bind(this))}setInitialFocus(){if(this.hasDefaultTitle){this.titleElem.select();return}window.setTimeout(()=>{window.$events.emit("editor::focus","")},500)}startAutoSave(){this.autoSave.interval=window.setInterval(this.runAutoSave.bind(this),this.autoSave.frequency)}runAutoSave(){Date.now()-this.autoSave.last{this.draftDisplayIcon.classList.remove("visible")},2e3)}async discardDraft(t=!0){let e;try{e=await window.$http.get(`/ajax/page/${this.pageId}`)}catch(n){console.error(n);return}this.autoSave.interval&&window.clearInterval(this.autoSave.interval),this.draftDisplay.innerText=this.editingPageText,this.discardDraftWrap.toggleAttribute("hidden",!0),window.$events.emit("editor::replace",{html:e.data.html,markdown:e.data.markdown}),this.titleElem.value=e.data.name,window.setTimeout(()=>{this.startAutoSave()},1e3),t&&window.$events.success(this.draftDiscardedText)}async deleteDraft(){if(await window.$components.firstOnElement(this.deleteDraftDialogContainer,"confirm-dialog").show())try{let n=this.discardDraft(!1),o=window.$http.delete(`/page-revisions/user-drafts/${this.pageId}`);await Promise.all([n,o]),window.$events.success(this.draftDeleteText),this.deleteDraftWrap.toggleAttribute("hidden",!0)}catch(n){console.error(n),window.$events.error(this.draftDeleteFailText)}}updateChangelogDisplay(){let t=this.changelogInput.value.trim();t.length===0?t=this.setChangelogText:t.length>16&&(t=`${t.slice(0,16)}...`),this.changelogDisplay.innerText=t}async changeEditor(t){t.preventDefault();let e=t.target.closest("a").href,n=window.$components.firstOnElement(this.switchDialogContainer,"confirm-dialog"),[o,s]=await Promise.all([this.saveDraft(),n.show()]);o&&s&&(window.location=e)}getEditorComponent(){return window.$components.first("markdown-editor")||window.$components.first("wysiwyg-editor")||window.$components.first("wysiwyg-editor-tinymce")}};function Dn(i,t){i.toggleAttribute("hidden",!t)}var An=class extends h{setup(){this.input=this.$refs.input,this.resetButton=this.$refs.resetButton,this.selectButton=this.$refs.selectButton,this.display=this.$refs.display,this.defaultDisplay=this.$refs.defaultDisplay,this.buttonSep=this.$refs.buttonSeperator,this.selectorEndpoint=this.$opts.selectorEndpoint,this.value=this.input.value,this.setupListeners()}setupListeners(){this.selectButton.addEventListener("click",this.showPopup.bind(this)),this.display.parentElement.addEventListener("click",this.showPopup.bind(this)),this.display.addEventListener("click",t=>t.stopPropagation()),this.resetButton.addEventListener("click",()=>{this.setValue("","")})}showPopup(){window.$components.first("entity-selector-popup").show(e=>{this.setValue(e.id,e.name)},{initialValue:"",searchEndpoint:this.selectorEndpoint,entityTypes:"page",entityPermission:"view"})}setValue(t,e){this.value=t,this.input.value=t,this.controlView(e)}controlView(t){let e=this.value&&this.value!==0;if(Dn(this.resetButton,e),Dn(this.buttonSep,e),Dn(this.defaultDisplay,!e),Dn(this.display,e),e){let n=this.getAssetIdFromVal();this.display.textContent=`#${n}, ${t}`,this.display.href=window.baseUrl(`/link/${n}`)}}getAssetIdFromVal(){return Number(this.value)}};var In=class extends h{setup(){this.container=this.$el,this.cellSelector=this.$opts.cellSelector||"td,th",this.rowSelector=this.$opts.rowSelector||"tr";for(let t of this.$manyRefs.toggleAll||[])t.addEventListener("click",this.toggleAllClick.bind(this));for(let t of this.$manyRefs.toggleRow||[])t.addEventListener("click",this.toggleRowClick.bind(this));for(let t of this.$manyRefs.toggleColumn||[])t.addEventListener("click",this.toggleColumnClick.bind(this))}toggleAllClick(t){t.preventDefault(),this.toggleAllInElement(this.container)}toggleRowClick(t){t.preventDefault(),this.toggleAllInElement(t.target.closest(this.rowSelector))}toggleColumnClick(t){t.preventDefault();let e=t.target.closest(this.cellSelector),n=Array.from(e.parentElement.children).indexOf(e),o=this.container.querySelectorAll(this.rowSelector),s=[];for(let r of o){let a=r.children[n];a&&s.push(...a.querySelectorAll("input[type=checkbox]"))}this.toggleAllInputs(s)}toggleAllInElement(t){let e=t.querySelectorAll("input[type=checkbox]");this.toggleAllInputs(e)}toggleAllInputs(t){let e=t.length>0?t[0].checked:!1;for(let n of t)n.checked=!e,n.dispatchEvent(new Event("change"))}};var Hn=class extends h{constructor(){super(...arguments);c(this,"showing",!1);c(this,"isMakingSelection",!1);c(this,"targetElement",null);c(this,"targetSelectionRange",null);c(this,"pointer");c(this,"linkInput");c(this,"linkButton");c(this,"includeInput");c(this,"includeButton");c(this,"sectionModeButton");c(this,"commentButton");c(this,"modeToggles");c(this,"modeSections");c(this,"pageId")}setup(){this.pointer=this.$refs.pointer,this.linkInput=this.$refs.linkInput,this.linkButton=this.$refs.linkButton,this.includeInput=this.$refs.includeInput,this.includeButton=this.$refs.includeButton,this.sectionModeButton=this.$refs.sectionModeButton,this.commentButton=this.$refs.commentButton,this.modeToggles=this.$manyRefs.modeToggle,this.modeSections=this.$manyRefs.modeSection,this.pageId=this.$opts.pageId,this.setupListeners()}setupListeners(){this.includeButton.addEventListener("click",()=>Hi(this.includeInput.value)),this.linkButton.addEventListener("click",()=>Hi(this.linkInput.value)),T([this.includeInput,this.linkInput],n=>{n.target.select(),n.stopPropagation()}),be(this.pointer,["click","focus"],n=>{n.stopPropagation()}),be(document.body,["click","focus"],()=>{!this.showing||this.isMakingSelection||this.hidePointer()}),ro(this.pointer,this.hidePointer.bind(this));let e=document.querySelector(".page-content");be(e,["mouseup","keyup"],n=>{n.stopPropagation();let o=n.target.closest('[id^="bkmrk"]');if(o instanceof HTMLElement&&(window.getSelection()||"").toString().length>0){let s=n instanceof MouseEvent?n.pageX:0;this.showPointerAtTarget(o,s,!1)}}),T(this.sectionModeButton,this.enterSectionSelectMode.bind(this)),T(this.modeToggles,n=>{let o=n.target;for(let r of this.modeSections){let a=!r.contains(o);r.toggleAttribute("hidden",!a)}let s=this.modeToggles.find(r=>r!==o);s&&s.focus()}),this.commentButton&&T(this.commentButton,this.createCommentAtPointer.bind(this))}hidePointer(){this.pointer.style.removeProperty("display"),this.showing=!1,this.targetElement=null,this.targetSelectionRange=null}showPointerAtTarget(e,n,o){this.targetElement=e,this.targetSelectionRange=window.getSelection()?.getRangeAt(0)||null,this.updateDomForTarget(e),this.pointer.style.display="block";let s=e.getBoundingClientRect(),r=this.pointer.getBoundingClientRect(),l=Math.min(Math.max(n,s.left),s.right)-r.width/2,d=s.top-r.height-16;this.pointer.style.left=`${l}px`,this.pointer.style.top=`${d}px`,this.showing=!0,this.isMakingSelection=!0,setTimeout(()=>{this.isMakingSelection=!1},100);let u=()=>{this.hidePointer(),window.removeEventListener("scroll",u)};e.parentElement?.insertBefore(this.pointer,e),o||window.addEventListener("scroll",u,{passive:!0})}updateDomForTarget(e){let n=window.baseUrl(`/link/${this.pageId}#${e.id}`),o=`{{@${this.pageId}#${e.id}}}`;this.linkInput.value=n,this.includeInput.value=o;let s=this.pointer.querySelector("#pointer-edit");if(s instanceof HTMLAnchorElement&&e){let{editHref:r}=s.dataset,a=e.id,l=(e.textContent||"").substring(0,50);s.href=`${r}?content-id=${a}&content-text=${encodeURIComponent(l)}`}}enterSectionSelectMode(){let e=Array.from(document.querySelectorAll('.page-content [id^="bkmrk"]'));for(let n of e)n.setAttribute("tabindex","0");e[0].focus(),Ht(e,n=>{this.showPointerAtTarget(n.target,0,!0),this.pointer.focus()})}createCommentAtPointer(){if(!this.targetElement)return;let e=this.targetElement.id,n=Ee(this.targetElement),o="";if(this.targetSelectionRange){let a=this.targetSelectionRange.commonAncestorContainer;if(this.targetElement.contains(a)){let l=li(this.targetSelectionRange.startContainer,this.targetSelectionRange.startOffset,this.targetElement),d=li(this.targetSelectionRange.endContainer,this.targetSelectionRange.endOffset,this.targetElement);o=`${l}-${d}`}}let s=`${e}:${n}:${o}`;window.$components.first("page-comments").startNewComment(s)}};var Bn=class extends h{setup(){this.container=this.$el,this.hideButtons=this.$manyRefs.hide||[],this.onkeyup=null,this.onHide=null,this.setupListeners()}setupListeners(){let t=null;this.container.addEventListener("mousedown",e=>{t=e.target}),this.container.addEventListener("click",e=>{e.target===this.container&&t===this.container&&this.hide()}),T(this.hideButtons,()=>this.hide())}hide(t=null){No(this.container,120,t),this.onkeyup&&(window.removeEventListener("keyup",this.onkeyup),this.onkeyup=null),this.onHide&&this.onHide()}show(t=null,e=null){Oo(this.container,120,t),this.onkeyup=n=>{n.key==="Escape"&&this.hide()},window.addEventListener("keyup",this.onkeyup),this.onHide=e}};var Pn=class extends h{setup(){this.container=this.$el,this.mode=this.$opts.mode,this.lightContainer=this.$refs.lightContainer,this.darkContainer=this.$refs.darkContainer,this.container.addEventListener("tabs-change",e=>{let o=e.detail.showing==="color-scheme-panel-light"?"light":"dark";this.handleModeChange(o)});let t=e=>{this.updateAppColorsFromInputs(),e.target.name.startsWith("setting-app-color")&&this.updateLightForInput(e.target)};this.container.addEventListener("change",t),this.container.addEventListener("input",t)}handleModeChange(t){this.mode=t;let e=t==="dark";document.documentElement.classList.toggle("dark-mode",e),this.updateAppColorsFromInputs()}updateAppColorsFromInputs(){let e=(this.mode==="dark"?this.darkContainer:this.lightContainer).querySelectorAll('input[type="color"]');for(let n of e){let o=n.name.split("-"),s=o.indexOf("color"),r=o.slice(1,s).join("-");r==="app"&&(r="primary");let a=`--color-${r}`;document.body.style.setProperty(a,n.value)}}updateLightForInput(t){let e=t.name.replace("-color","-color-light"),n=t.value,o=this.hexToRgb(n),s=`rgba(${[o.r,o.g,o.b,"0.15"].join(",")})`,r=this.container.querySelector(`input[name="${e}"][type="hidden"]`);r.value=s}hexToRgb(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return{r:e?parseInt(e[1],16):0,g:e?parseInt(e[2],16):0,b:e?parseInt(e[3],16):0}}};var Rn=class extends h{setup(){this.colorInput=this.$refs.input,this.resetButton=this.$refs.resetButton,this.defaultButton=this.$refs.defaultButton,this.currentColor=this.$opts.current,this.defaultColor=this.$opts.default,this.resetButton.addEventListener("click",()=>this.setValue(this.currentColor)),this.defaultButton.addEventListener("click",()=>this.setValue(this.defaultColor))}setValue(t){this.colorInput.value=t,this.colorInput.dispatchEvent(new Event("change",{bubbles:!0}))}};var On=class extends h{setup(){this.typeControl=this.$refs.typeControl,this.pagePickerContainer=this.$refs.pagePickerContainer,this.typeControl.addEventListener("change",this.controlPagePickerVisibility.bind(this)),this.controlPagePickerVisibility()}controlPagePickerVisibility(){let t=this.typeControl.value==="page";this.pagePickerContainer.style.display=t?"block":"none"}};function Nn(i,t){return{move_up(e){let n=e.parentNode,o=Array.from(n.children).indexOf(e),s=Math.max(o-1,0);n.insertBefore(e,n.children[s]||null)},move_down(e){let n=e.parentNode,o=Array.from(n.children).indexOf(e),s=Math.min(o+2,n.children.length);n.insertBefore(e,n.children[s]||null)},remove(e){i.appendChild(e)},add(e){t.appendChild(e)}}}function Fn(i,t){return e=>{let n=e.target.closest(".scroll-box-item button[data-action]");if(n){let o=n.closest(".scroll-box-item"),s=n.dataset.action;if(!s)throw new Error("No action defined for clicked button");let r=i[s];r(o),t()}}}var _n=class extends h{setup(){this.elem=this.$el,this.input=this.$refs.input,this.shelfBookList=this.$refs.shelfBookList,this.allBookList=this.$refs.allBookList,this.bookSearchInput=this.$refs.bookSearch,this.sortButtonContainer=this.$refs.sortButtonContainer,this.lastSort=null,this.initSortable(),this.setupListeners()}initSortable(){let t=this.elem.querySelectorAll(".scroll-box");for(let e of t)new ht(e,{group:"shelf-books",ghostClass:"primary-background-light",handle:".handle",animation:150,onSort:this.onChange.bind(this)})}setupListeners(){let t=Nn(this.allBookList,this.shelfBookList),e=Fn(t,this.onChange.bind(this));this.elem.addEventListener("click",e),this.bookSearchInput.addEventListener("input",()=>{this.filterBooksByName(this.bookSearchInput.value)}),this.sortButtonContainer.addEventListener("click",n=>{let o=n.target.closest("button[data-sort]");o&&this.sortShelfBooks(o.dataset.sort)})}filterBooksByName(t){this.allBookList.style.height||(this.allBookList.style.height=`${this.allBookList.getBoundingClientRect().height}px`);let e=this.allBookList.children,n=t.trim().toLowerCase();for(let o of e){let s=!t||o.textContent.toLowerCase().includes(n);o.style.display=s?null:"none"}}onChange(){let t=Array.from(this.shelfBookList.querySelectorAll("[data-id]"));this.input.value=t.map(e=>e.getAttribute("data-id")).join(",")}sortShelfBooks(t){let e=Array.from(this.shelfBookList.children),n=t===this.lastSort;e.sort((o,s)=>{let r=o.dataset[t].toLowerCase(),a=s.dataset[t].toLowerCase();return n?a.localeCompare(r):r.localeCompare(a)});for(let o of e)this.shelfBookList.append(o);this.lastSort=this.lastSort===t?null:t,this.onChange()}};function dr(i){let t={};for(let[e,n]of Object.entries(i))t[n]=e;return t}var qn=class extends h{setup(){this.container=this.$el,this.mapById=JSON.parse(this.$opts.keyMap),this.mapByShortcut=dr(this.mapById),this.hintsShowing=!1,this.hideHints=this.hideHints.bind(this),this.hintAbortController=null,this.setupListeners()}setupListeners(){window.addEventListener("keydown",t=>{if(!t.target.closest("input, select, textarea, .cm-editor, .editor-container")){if(t.key==="?"){this.hintsShowing?this.hideHints():this.showHints();return}this.handleShortcutPress(t)}})}handleShortcutPress(t){let n=[t.ctrlKey?"Ctrl":"",t.metaKey?"Cmd":"",t.key].filter(s=>!!s).join(" + "),o=this.mapByShortcut[n];o&&this.runShortcut(o)&&t.preventDefault()}runShortcut(t){let e=this.container.querySelector(`[data-shortcut="${t}"]`);return e?e.matches("input, textarea, select")?(e.focus(),!0):e.matches("a, button")?(e.click(),!0):e.matches("div[tabindex]")?(e.click(),e.focus(),!0):(console.error("Shortcut attempted to be ran for element type that does not have handling setup",e),!1):!1}showHints(){let t=document.createElement("div");t.classList.add("shortcut-container"),this.container.append(t);let e=this.container.querySelectorAll("[data-shortcut]"),n=new Set;for(let s of e){let r=s.getAttribute("data-shortcut");if(n.has(r))continue;let a=this.mapById[r];this.showHintLabel(s,a,t),n.add(r)}this.hintAbortController=new AbortController;let o=this.hintAbortController.signal;window.addEventListener("scroll",this.hideHints,{signal:o}),window.addEventListener("focus",this.hideHints,{signal:o}),window.addEventListener("blur",this.hideHints,{signal:o}),window.addEventListener("click",this.hideHints,{signal:o}),this.hintsShowing=!0}showHintLabel(t,e,n){let o=t.getBoundingClientRect(),s=document.createElement("div");s.classList.add("shortcut-hint"),s.textContent=e;let r=document.createElement("div");r.classList.add("shortcut-linkage"),r.style.left=`${o.x}px`,r.style.top=`${o.y}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,n.append(s,r);let a=s.getBoundingClientRect();s.style.insetInlineStart=`${o.x+o.width-(a.width+6)}px`,s.style.insetBlockStart=`${o.y+(o.height-a.height)/2}px`}hideHints(){this.container.querySelector(".shortcut-container").remove(),this.hintAbortController?.abort(),this.hintsShowing=!1}};var hr=["Control","Alt","Shift","Meta","Super"," ","+","Tab","Escape"],Vn=class extends h{setup(){this.input=this.$el,this.setupListeners()}setupListeners(){this.listenerRecordKey=this.listenerRecordKey.bind(this),this.input.addEventListener("focus",()=>{this.startListeningForInput()}),this.input.addEventListener("blur",()=>{this.stopListeningForInput()})}startListeningForInput(){this.input.addEventListener("keydown",this.listenerRecordKey)}listenerRecordKey(t){if(hr.includes(t.key))return;let e=[t.ctrlKey?"Ctrl":"",t.metaKey?"Cmd":"",t.key];this.input.value=e.filter(n=>!!n).join(" + ")}stopListeningForInput(){this.input.removeEventListener("keydown",this.listenerRecordKey)}};var Wn=class extends h{setup(){this.container=this.$el,this.handleSelector=this.$opts.handleSelector;let t=new ht(this.container,{handle:this.handleSelector,animation:150,onSort:()=>{this.$emit("sort",{ids:t.toArray()})},setData(e,n){let o=n.getAttribute("data-drag-content");if(o){let s=JSON.parse(o);for(let[r,a]of Object.entries(s))e.setData(r,a)}},revertOnSpill:!0,dropBubble:!0,dragoverBubble:!1})}};var Un=class extends h{constructor(){super(...arguments);c(this,"input");c(this,"configuredList");c(this,"availableList")}setup(){this.input=this.$refs.input,this.configuredList=this.$refs.configuredOperationsList,this.availableList=this.$refs.availableOperationsList,this.initSortable();let e=Nn(this.availableList,this.configuredList),n=Fn(e,this.onChange.bind(this));this.$el.addEventListener("click",n)}initSortable(){let e=[this.configuredList,this.availableList];for(let n of e)new ht(n,{group:"sort-rule-operations",ghostClass:"primary-background-light",handle:".handle",animation:150,onSort:this.onChange.bind(this)})}onChange(){let e=Array.from(this.configuredList.querySelectorAll("[data-id]"));this.input.value=e.map(n=>n.getAttribute("data-id")).join(",")}};var jn=class extends h{setup(){this.filter=this.$opts.filter,this.$el.addEventListener("change",t=>{if(this.filter&&!t.target.matches(this.filter))return;let e=this.$el.closest("form");e&&e.submit()})}};var zn=class extends h{setup(){this.addRemoveComponentEl=this.$refs.addRemove,this.container=this.$el,this.rowSelector=this.$opts.rowSelector,this.setupListeners()}setupListeners(){this.container.addEventListener("input",t=>{let e=window.$components.firstOnElement(this.addRemoveComponentEl,"add-remove-rows");!this.hasEmptyRows()&&t.target.value&&e.add()})}hasEmptyRows(){return[...this.container.querySelectorAll(this.rowSelector)].find(n=>[...n.querySelectorAll("input")].filter(o=>o.value).length===0)!==void 0}};var Kn=class extends h{setup(){this.container=this.$el,this.list=this.$refs.list,this.searchInput=this.$refs.searchInput,this.searchButton=this.$refs.searchButton,this.searchCancel=this.$refs.searchCancel,this.setupListeners()}setupListeners(){I(this.container,"[template-action]","click",this.handleTemplateActionClick.bind(this)),I(this.container,".pagination a","click",this.handlePaginationClick.bind(this)),I(this.container,".template-item-content","click",this.handleTemplateItemClick.bind(this)),I(this.container,".template-item","dragstart",this.handleTemplateItemDragStart.bind(this)),this.searchInput.addEventListener("keypress",t=>{t.key==="Enter"&&(t.preventDefault(),this.performSearch())}),this.searchButton.addEventListener("click",()=>this.performSearch()),this.searchCancel.addEventListener("click",()=>{this.searchInput.value="",this.performSearch()})}handleTemplateItemClick(t,e){let n=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(n,"replace")}handleTemplateItemDragStart(t,e){let n=e.closest("[template-id]").getAttribute("template-id");t.dataTransfer.setData("bookstack/template",n),t.dataTransfer.setData("text/plain",n)}handleTemplateActionClick(t,e){t.stopPropagation();let n=e.getAttribute("template-action"),o=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(o,n)}async insertTemplate(t,e="replace"){let n=await window.$http.get(`/templates/${t}`),o=`editor::${e}`;window.$events.emit(o,n.data)}async handlePaginationClick(t,e){t.preventDefault();let n=e.getAttribute("href"),o=await window.$http.get(n);this.list.innerHTML=o.data}async performSearch(){let t=this.searchInput.value,e=await window.$http.get("/templates",{search:t});this.searchCancel.style.display=t?"block":"none",this.list.innerHTML=e.data}};var Xn=class extends h{setup(){this.input=this.$el.querySelector("input[type=hidden]"),this.checkbox=this.$el.querySelector("input[type=checkbox]"),this.checkbox.addEventListener("change",this.stateChange.bind(this))}stateChange(){this.input.value=this.checkbox.checked?"true":"false";let t=new Event("change");this.input.dispatchEvent(t)}};var Gn=class extends h{constructor(){super(...arguments);c(this,"container");c(this,"tabs");c(this,"sidebarScrollContainers");c(this,"lastLayoutType","none");c(this,"onDestroy",null);c(this,"scrollCache",{content:0,info:0});c(this,"lastTabShown","content")}setup(){this.container=this.$refs.container,this.tabs=this.$manyRefs.tab,this.sidebarScrollContainers=this.$manyRefs.sidebarScrollContainer,this.mobileTabClick=this.mobileTabClick.bind(this),this.updateLayout(),window.addEventListener("resize",()=>{this.updateLayout()},{passive:!0}),this.setupSidebarScrollHandlers()}updateLayout(){let e="tablet";window.innerWidth<=1e3&&(e="mobile"),window.innerWidth>1400&&(e="desktop"),e!==this.lastLayoutType&&(this.onDestroy&&(this.onDestroy(),this.onDestroy=null),e==="desktop"?this.setupDesktop():e==="mobile"&&this.setupMobile(),this.lastLayoutType=e)}setupMobile(){for(let e of this.tabs)e.addEventListener("click",this.mobileTabClick);this.onDestroy=()=>{for(let e of this.tabs)e.removeEventListener("click",this.mobileTabClick)}}setupDesktop(){}mobileTabClick(e){let n=e.target.dataset.tab||"";this.showTab(n)}showContent(){this.showTab("content",!1)}showTab(e,n=!0){this.scrollCache[this.lastTabShown]=document.documentElement.scrollTop;for(let s of this.tabs){let r=s.dataset.tab===e;s.setAttribute("aria-selected",r?"true":"false")}let o=e==="info";if(this.container.classList.toggle("show-info",o),n){let r=document.querySelector("header").getBoundingClientRect().bottom;document.documentElement.scrollTop=this.scrollCache[e]||r,setTimeout(()=>{document.documentElement.scrollTop=this.scrollCache[e]||r},50)}this.lastTabShown=e}setupSidebarScrollHandlers(){for(let e of this.sidebarScrollContainers)e.addEventListener("scroll",()=>this.handleSidebarScroll(e),{passive:!0}),this.handleSidebarScroll(e);window.addEventListener("resize",()=>{for(let e of this.sidebarScrollContainers)this.handleSidebarScroll(e)})}handleSidebarScroll(e){let n=e.clientHeight!==e.scrollHeight,o=e.scrollTop===0,s=e.scrollTop+e.clientHeight===e.scrollHeight;e.parentElement&&(e.parentElement.classList.toggle("scroll-away-from-top",!o&&n),e.parentElement.classList.toggle("scroll-away-from-bottom",!s&&n))}};var Yn=class extends h{setup(){this.container=this.$el,this.input=this.$refs.input,this.userInfoContainer=this.$refs.userInfo,I(this.container,"a.dropdown-search-item","click",this.selectUser.bind(this))}selectUser(t,e){t.preventDefault(),this.input.value=e.getAttribute("data-id"),this.userInfoContainer.innerHTML=e.innerHTML,this.input.dispatchEvent(new Event("change",{bubbles:!0})),this.hide()}hide(){window.$components.firstOnElement(this.container,"dropdown").hide()}};var Jn=class extends h{setup(){this.checkboxes=this.$el.querySelectorAll('input[type="checkbox"]'),this.allCheckbox=this.$el.querySelector('input[type="checkbox"][value="all"]'),this.$el.addEventListener("change",t=>{t.target.checked&&t.target===this.allCheckbox?this.deselectIndividualEvents():t.target.checked&&(this.allCheckbox.checked=!1)})}deselectIndividualEvents(){for(let t of this.checkboxes)t!==this.allCheckbox&&(t.checked=!1)}};var Zn=class extends h{setup(){this.elem=this.$el,this.editContainer=this.$refs.editContainer,this.input=this.$refs.input,this.editor=null;let t={...window.editor_translations,imageUploadErrorText:this.$opts.imageUploadErrorText,serverUploadLimitText:this.$opts.serverUploadLimitText};window.importVersioned("wysiwyg").then(n=>{let o=this.input.value;this.editor=n.createPageEditorInstance(this.editContainer,o,{drawioUrl:this.getDrawIoUrl(),pageId:Number(this.$opts.pageId),darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.$opts.textDirection,translations:t}),window.wysiwyg=this.editor});let e=!1;this.input.form.addEventListener("submit",n=>{this.editor&&(e?e=!1:(n.preventDefault(),e=!0,this.editor.getContentAsHtml().then(o=>{this.input.value=o,setTimeout(()=>{this.input.form.requestSubmit()},5)})))})}getDrawIoUrl(){let t=document.querySelector("[drawio-url]");return t?t.getAttribute("drawio-url"):""}async getContent(){return{html:await this.editor.getContentAsHtml()}}};function Wo(i){for(let t=1;t<5;t++)i.shortcuts.add(`meta+${t}`,"",["FormatBlock",!1,`h${t+1}`]);i.shortcuts.add("meta+5","",["FormatBlock",!1,"p"]),i.shortcuts.add("meta+d","",["FormatBlock",!1,"p"]),i.shortcuts.add("meta+6","",["FormatBlock",!1,"blockquote"]),i.shortcuts.add("meta+q","",["FormatBlock",!1,"blockquote"]),i.shortcuts.add("meta+7","",["codeeditor",!1,"pre"]),i.shortcuts.add("meta+e","",["codeeditor",!1,"pre"]),i.shortcuts.add("meta+8","",["FormatBlock",!1,"code"]),i.shortcuts.add("meta+shift+E","",["FormatBlock",!1,"code"]),i.shortcuts.add("meta+o","","InsertOrderedList"),i.shortcuts.add("meta+p","","InsertUnorderedList"),i.shortcuts.add("meta+S","",()=>{window.$events.emit("editor-save-draft")}),i.shortcuts.add("meta+13","",()=>{window.$events.emit("editor-save-page")}),i.shortcuts.add("meta+9","",()=>{let t=i.selection.getNode(),e=t?t.closest(".callout"):null,n=["info","success","warning","danger"],s=(n.findIndex(a=>e&&e.classList.contains(a))+1)%n.length,r=n[s];i.formatter.apply(`callout${r}`)}),i.shortcuts.add("meta+shift+K","",()=>{let t=window.$components.first("entity-selector-popup"),e=i.selection.getContent({format:"text"}).trim();t.show(n=>{i.selection.isCollapsed()?i.insertContent(i.dom.createHTML("a",{href:n.link},i.dom.encode(n.name))):i.formatter.apply("link",{href:n.link}),i.selection.collapse(!1),i.focus()},{initialValue:e,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})})}function Uo(i){window.$events.listen("editor::replace",({html:t})=>{i.setContent(t)}),window.$events.listen("editor::append",({html:t})=>{let e=i.getContent()+t;i.setContent(e)}),window.$events.listen("editor::prepend",({html:t})=>{let e=t+i.getContent();i.setContent(e)}),window.$events.listen("editor::insert",({html:t})=>{i.insertContent(t)}),window.$events.listen("editor::focus",()=>{i.initialized&&i.focus()})}function ur(i,t){let e=i.dom.get(encodeURIComponent(t).replace(/!/g,"%21"));e&&(e.scrollIntoView(),i.selection.select(e,!0),i.selection.collapse(!1),i.focus())}function jo(i){let e=new URL(window.location).searchParams.get("content-id");e&&ur(i,e)}var Dt,Qn;function pr(i){return i&&!!(i.textContent||i.innerText)}async function mr(i,t){if(i===null||i.type.indexOf("image")!==0)throw new Error("Not an image file");let e=i.name||`image-${Date.now()}.png`,n=new FormData;return n.append("file",i,e),n.append("uploaded_to",t),(await window.$http.post(window.baseUrl("/images/gallery"),n)).data}function zo(i,t,e){let n=new Wt(e.clipboardData||e.dataTransfer);if(!n.hasItems()||n.containsTabularData())return;let o=n.getImages();for(let s of o){let r=`image-${Math.random().toString(16).slice(2)}`,a=window.baseUrl("/loading.gif");e.preventDefault(),setTimeout(()=>{i.insertContent(`

    `),mr(s,t.pageId).then(l=>{let d=l.name.replace(/"/g,""),u=`${d}`,p=i.dom.create("a",{target:"_blank",href:l.url},u);i.dom.replace(p,r)}).catch(l=>{i.dom.remove(r),window.$events.error(l?.data?.message||t.translations.imageUploadErrorText),console.error(l)})},10)}}function fr(i){let t=i.selection.getNode();t.nodeName==="IMG"&&(Dt=i.dom.getParent(t,".mceTemp"),!Dt&&t.parentNode.nodeName==="A"&&!pr(t.parentNode)&&(Dt=t.parentNode)),t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="false"&&(Qn=t)}function gr(i,t,e){let{dom:n}=i,o=window.tinymce.dom.RangeUtils.getCaretRangeFromPoint(e.clientX,e.clientY,i.getDoc()),s=e.dataTransfer&&e.dataTransfer.getData("bookstack/template");s&&(e.preventDefault(),window.$http.get(`/templates/${s}`).then(r=>{i.selection.setRng(o),i.undoManager.transact(()=>{i.execCommand("mceInsertContent",!1,r.data.html)})})),n.getParent(o.startContainer,".mceTemp")?e.preventDefault():Dt&&(e.preventDefault(),i.undoManager.transact(()=>{i.selection.setRng(o),i.selection.setNode(Dt),n.remove(Dt)})),!e.isDefaultPrevented()&&Qn&&(e.preventDefault(),i.undoManager.transact(()=>{let r=i.selection.getNode(),a=i.selection.getRng(),l=r.closest("body > *");a.startOffset>a.startContainer.length/2?l.after(Qn):l.before(Qn)})),e.isDefaultPrevented()||zo(i,t,e),Dt=null}function vr(i,t){t.preventDefault(),i.focus();let n=window.tinymce.dom.RangeUtils.getCaretRangeFromPoint(t.clientX??0,t.clientY??0,i.getDoc());i.selection.setRng(n)}function Ko(i,t){i.on("dragover",e=>vr(i,e)),i.on("dragstart",()=>fr(i)),i.on("drop",e=>gr(i,t,e)),i.on("paste",e=>zo(i,t,e))}function Xo(i){return["undo redo","styles","bold italic underline forecolor backcolor formatoverflow","alignleft aligncenter alignright alignjustify","bullist numlist listoverflow",i.textDirection==="rtl"?"ltr rtl":"","link customtable imagemanager-insert insertoverflow","code about fullscreen"].filter(n=>!!n).join(" | ")}function wr(i){i.ui.registry.addGroupToolbarButton("formatoverflow",{icon:"more-drawer",tooltip:"More",items:"strikethrough superscript subscript inlinecode removeformat"}),i.ui.registry.addGroupToolbarButton("listoverflow",{icon:"more-drawer",tooltip:"More",items:"tasklist outdent indent"}),i.ui.registry.addGroupToolbarButton("insertoverflow",{icon:"more-drawer",tooltip:"More",items:"customhr codeeditor drawio media details"})}function br(i){i.ui.registry.addContextToolbar("linkcontexttoolbar",{predicate(t){return t.closest("a")!==null},position:"node",scope:"node",items:"link unlink openlink"})}function yr(i){i.ui.registry.addContextToolbar("imagecontexttoolbar",{predicate(t){return t.closest("img")!==null&&!t.hasAttribute("data-mce-object")},position:"node",scope:"node",items:"image"})}function Er(i){i.ui.registry.addContextToolbar("objectcontexttoolbar",{predicate(t){return t.closest("img")!==null&&t.hasAttribute("data-mce-object")},position:"node",scope:"node",items:"media"})}function Go(i){wr(i),br(i),yr(i),Er(i)}var Cr={"table-delete-column":'',"table-delete-row":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',table:'',"table-delete-table":''};function Yo(i){for(let[t,e]of Object.entries(Cr))i.ui.registry.addIcon(t,e)}function Lr(i){i.serializer.addNodeFilter("br",t=>{for(let e of t)if(e.parent&&e.parent.name==="code"){let n=window.tinymce.html.Node.create("#text");n.value=` +`,e.replace(n)}})}function xr(i){i.parser.addNodeFilter("div",t=>{for(let e of t){let n=e.attr("id")||"",o=e.attr("class")||"";(n==="pointer"||o.includes("pointer"))&&e.remove()}})}function Jo(i){Lr(i),xr(i)}function Zo(i){return i.tagName.toLowerCase()==="code-block"}function ts(i,t,e,n,o){let s=window.$components.first("code-editor"),r=i.selection.getBookmark();s.open(t,e,n,(a,l)=>{o(a,l),i.focus(),i.selection.moveToBookmark(r)},()=>{i.focus(),i.selection.moveToBookmark(r)})}function Qo(i,t){let e=t.getAttribute("dir")||"";ts(i,t.getContent(),t.getLanguage(),e,(n,o)=>{t.setContent(n,o)})}function Tr(i){let t=i.getDoc(),e=t.defaultView;class n extends e.HTMLElement{constructor(){super();c(this,"editor",null);this.attachShadow({mode:"open"});let r=document.head.querySelectorAll('link[rel="stylesheet"]:not([media="print"]),style'),a=Array.from(r).map(d=>d.cloneNode(!0)),l=document.createElement("div");l.style.pointerEvents="none",l.contentEditable="false",l.classList.add("CodeMirrorContainer"),l.classList.toggle("dark-mode",document.documentElement.classList.contains("dark-mode")),this.shadowRoot.append(...a,l)}getLanguage(){let r=d=>(d.split(" ").filter(p=>p.startsWith("language-"))[0]||"").replace("language-",""),a=this.querySelector("code"),l=this.querySelector("pre");return r(l.className)||a&&r(a.className)||""}setContent(r,a){this.editor&&(this.editor.setContent(r),this.editor.setMode(a,r));let l=this.querySelector("pre");l||(l=t.createElement("pre"),this.append(l)),l.innerHTML="";let d=t.createElement("code");l.append(d),d.innerText=r,d.className=`language-${a}`}getContent(){let r=this.querySelector("code")||this.querySelector("pre"),a=document.createElement("pre");a.innerHTML=r.innerHTML.replace(/\ufeff/g,"");let l=a.querySelectorAll("br");for(let d of l)d.replaceWith(` +`);return a.textContent}connectedCallback(){let r=Date.now();if(this.editor)return;this.cleanChildContent();let a=this.getContent(),d=a.split(` +`).length*19.2+18+24;this.style.height=`${d}px`;let u=this.shadowRoot.querySelector(".CodeMirrorContainer"),p=f=>{this.editor=f.wysiwygView(u,this.shadowRoot,a,this.getLanguage()),setTimeout(()=>{this.style.height=null},12)};window.importVersioned("code").then(f=>{let v=Date.now()-r<20?20:0;setTimeout(()=>p(f),v)})}cleanChildContent(){let r=this.querySelector("pre");if(r)for(let a of r.childNodes)a.nodeName==="#text"&&a.textContent==="\uFEFF"&&a.remove()}}e.customElements.define("code-block",n)}function Sr(i){i.ui.registry.addIcon("codeblock",''),i.ui.registry.addButton("codeeditor",{tooltip:"Insert code block",icon:"codeblock",onAction(){i.execCommand("codeeditor")}}),i.ui.registry.addButton("editcodeeditor",{tooltip:"Edit code block",icon:"edit-block",onAction(){i.execCommand("codeeditor")}}),i.addCommand("codeeditor",()=>{let t=i.selection.getNode(),e=t.ownerDocument;if(Zo(t))Qo(i,t);else{let n=i.selection.getContent({format:"text"}),o=document.dir==="rtl"?"ltr":"";ts(i,n,"",o,(s,r)=>{let a=e.createElement("pre"),l=e.createElement("code");l.classList.add(`language-${r}`),l.innerText=s,o&&a.setAttribute("dir",o),a.append(l),i.insertContent(a.outerHTML)})}}),i.on("dblclick",()=>{let t=i.selection.getNode();Zo(t)&&Qo(i,t)}),i.on("PreInit",()=>{i.parser.addNodeFilter("pre",t=>{for(let e of t){let n=window.tinymce.html.Node.create("code-block",{contenteditable:"false"}),o=e.children().filter(a=>a.name==="code")[0]||null,s=e.attr("dir")||o&&o.attr("dir")||"";s&&n.attr("dir",s);let r=e.getAll("span");for(let a of r)a.unwrap();e.attr("style",null),e.wrap(n)}}),i.parser.addNodeFilter("code-block",t=>{for(let e of t)e.attr("contenteditable","false")}),i.serializer.addNodeFilter("code-block",t=>{for(let e of t){let n=e.attr("dir");n&&e.firstChild?e.firstChild.attr("dir",n):e.firstChild&&e.firstChild.attr("dir",null),e.unwrap()}})}),i.ui.registry.addContextToolbar("codeeditor",{predicate(t){return t.nodeName.toLowerCase()==="code-block"},items:"editcodeeditor",position:"node",scope:"node"}),i.on("PreInit",()=>{Tr(i)})}function es(){return Sr}function ti(i){return new Promise((t,e)=>{i.oncomplete=i.onsuccess=()=>t(i.result),i.onabort=i.onerror=()=>e(i.error)})}function kr(i,t){let e,n=()=>{if(e)return e;let o=indexedDB.open(i);return o.onupgradeneeded=()=>o.result.createObjectStore(t),e=ti(o),e.then(s=>{s.onclose=()=>e=void 0},()=>{}),e};return(o,s)=>n().then(r=>s(r.transaction(t,o).objectStore(t)))}var Bi;function Pi(){return Bi||(Bi=kr("keyval-store","keyval")),Bi}function Ri(i,t=Pi()){return t("readonly",e=>ti(e.get(i)))}function Oi(i,t,e=Pi()){return e("readwrite",n=>(n.put(t,i),ti(n.transaction)))}function Ni(i,t=Pi()){return t("readwrite",e=>(e.delete(i),ti(e.transaction)))}var it=null,qi,ei,Fi,_i="last-drawing-save";function Vi(i){it?.contentWindow?.postMessage(JSON.stringify(i),qi)}function Mr(i){Oi(_i,i.data),Fi&&Fi(i.data).then(()=>{Ni(_i)})}function Dr(i){Vi({action:"export",format:"xmlpng",xml:i.xml,spin:"Updating drawing"})}function Ar(){ei&&ei().then(i=>{Vi({action:"load",autosave:1,xml:i})})}function Ir(){let i={};it&&(window.$events.emitPublic(it,"editor-drawio::configure",{config:i}),Vi({action:"configure",config:i}))}function ns(){window.removeEventListener("message",is),it&&document.body.removeChild(it)}function is(i){if(!i.data||i.data.length<1||i.origin!==qi)return;let t=JSON.parse(i.data);t.event==="init"?Ar():t.event==="exit"?ns():t.event==="save"?Dr(t):t.event==="export"?Mr(t):t.event==="configure"&&Ir()}async function Hr(){let i=await Ri(_i),t=document.getElementById("unsaved-drawing-dialog");t||console.error("Missing expected unsaved-drawing dialog"),i&&t&&await window.$components.firstOnElement(t,"confirm-dialog").show()&&(ei=async()=>i)}async function os(i,t,e){ei=t,Fi=e,await Hr(),it=document.createElement("iframe"),it.setAttribute("frameborder","0"),window.addEventListener("message",is),it.setAttribute("src",i),it.setAttribute("class","fullscreen"),it.style.backgroundColor="#FFFFFF",document.body.appendChild(it),qi=new URL(i).origin}async function Wi(i,t){let e={image:i,uploaded_to:t};return(await window.$http.post(window.baseUrl("/images/drawio"),e)).data}function ni(){ns()}async function ss(i){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${i}`))).data.content}`}catch(t){throw t instanceof Lt&&window.$events.showResponseError(t),ni(),t}}var K=null,It=null,At={};function Ui(i){return i.hasAttribute("drawio-diagram")}function Pr(i,t=null){K=i,It=t,window.$components.first("image-manager").show(n=>{if(t){let o=t.querySelector("img");K.undoManager.transact(()=>{K.dom.setAttrib(o,"src",n.url),K.dom.setAttrib(t,"drawio-diagram",n.id)})}else{let o=`
    `;K.insertContent(o)}},"drawio")}async function Rr(i){let t=window.baseUrl("/loading.gif"),e=s=>{s.status===413?window.$events.emit("error",At.translations.serverUploadLimitText):window.$events.emit("error",At.translations.imageUploadErrorText),console.error(s)};if(It){ni();let s=It.querySelector("img");try{let r=await Wi(i,At.pageId);K.undoManager.transact(()=>{K.dom.setAttrib(s,"src",r.url),K.dom.setAttrib(It,"drawio-diagram",r.id)})}catch(r){throw e(r),new Error(`Failed to save image with error: ${r}`)}return}await eo(5);let n=`drawing-${Math.random().toString(16).slice(2)}`,o=`drawing-wrap-${Math.random().toString(16).slice(2)}`;K.insertContent(`
    `),ni();try{let s=await Wi(i,At.pageId);K.undoManager.transact(()=>{K.dom.setAttrib(n,"src",s.url),K.dom.setAttrib(o,"drawio-diagram",s.id)})}catch(s){throw K.dom.remove(o),e(s),new Error(`Failed to save image with error: ${s}`)}}function Or(){if(!It)return Promise.resolve("");let i=It.getAttribute("drawio-diagram");return ss(i)}function rs(i,t=null){K=i,It=t,os(At.drawioUrl,Or,Rr)}function Nr(i){i.addCommand("drawio",()=>{let t=i.selection.getNode();rs(i,Ui(t)?t:null)}),i.ui.registry.addIcon("diagram",``),i.ui.registry.addSplitButton("drawio",{tooltip:"Insert/edit drawing",icon:"diagram",onAction(){i.execCommand("drawio"),window.document.body.dispatchEvent(new Event("mousedown",{bubbles:!0}))},fetch(t){t([{type:"choiceitem",text:"Drawing manager",value:"drawing-manager"}])},onItemAction(t,e){if(e==="drawing-manager"){let n=i.selection.getNode();Pr(i,Ui(n)?n:null)}}}),i.on("dblclick",()=>{let t=i.selection.getNode();Ui(t)&&rs(i,t)}),i.on("SetContent",()=>{let t=i.dom.select("body > div[drawio-diagram]");t.length&&i.undoManager.transact(()=>{for(let e of t)e.setAttribute("contenteditable","false")})})}function as(i){return At=i,Nr}function Fr(i){i.addCommand("InsertHorizontalRule",()=>{let t=document.createElement("hr"),e=i.selection.getNode(),{parentNode:n}=e;n.insertBefore(t,e)}),i.ui.registry.addButton("customhr",{icon:"horizontal-rule",tooltip:"Insert horizontal line",onAction(){i.execCommand("InsertHorizontalRule")}})}function ls(){return Fr}function _r(i){i.ui.registry.addButton("imagemanager-insert",{title:"Insert image",icon:"image",tooltip:"Insert image",onAction(){window.$components.first("image-manager").show(e=>{let n=e.thumbs?.display||e.url,o=``;o+=`${e.name}`,o+="",i.execCommand("mceInsertContent",!1,o)},"gallery")}})}function cs(){return _r}function qr(i){let t={title:"About the WYSIWYG Editor",url:window.baseUrl("/help/tinymce")};i.ui.registry.addButton("about",{icon:"help",tooltip:"About the editor",onAction(){window.tinymce.activeEditor.windowManager.openUrl(t)}})}function ds(){return qr}var hs=["p","h1","h2","h3","h4","h5","h6","div","blockquote","pre","code-block","details","ul","ol","table","hr"];function ii(i){return i.selection.getNode().closest("details")}function Vr(i,t){let e=ii(i);e&&i.undoManager.transact(()=>{let n=e.querySelector("summary");n||(n=document.createElement("summary"),e.prepend(n)),n.textContent=t})}function Wr(i){return{title:"Edit collapsible block",body:{type:"panel",items:[{type:"input",name:"summary",label:"Toggle label"}]},buttons:[{type:"cancel",text:"Cancel"},{type:"submit",text:"Save",primary:!0}],onSubmit(t){let{summary:e}=t.getData();Vr(i,e),t.close()}}}function Ur(i){let t=i.querySelector("summary");return t?t.textContent:""}function us(i){let t=ii(i);i.windowManager.open(Wr(i)).setData({summary:Ur(t)})}function jr(i){let t=i.selection.getNode().closest("details"),e=i.selection.getBookmark();if(t){let n=t.querySelectorAll("details > *:not(summary, doc-root), doc-root > *");i.undoManager.transact(()=>{for(let o of n)t.parentNode.insertBefore(o,t);t.remove()})}i.focus(),i.selection.moveToBookmark(e)}function ji(i){i.attr("contenteditable",null);let t=!1;for(let e of i.children())e.name==="doc-root"&&(e.unwrap(),t=!0);t&&ji(i)}function zr(i){ji(i),i.attr("contenteditable","false");let t=window.tinymce.html.Node.create("doc-root",{contenteditable:"true"}),e=null;for(let n of i.children()){if(n.name==="summary")continue;hs.includes(n.name)?(t.append(n),e=null):(e||(e=window.tinymce.html.Node.create("p"),t.append(e)),e.append(n))}i.append(t)}function Kr(i){i.parser.addNodeFilter("details",t=>{for(let e of t)zr(e)}),i.serializer.addNodeFilter("details",t=>{for(let e of t)ji(e),e.attr("open",null)}),i.serializer.addNodeFilter("doc-root",t=>{for(let e of t)e.unwrap()})}function Xr(i){i.ui.registry.addIcon("details",''),i.ui.registry.addIcon("togglefold",''),i.ui.registry.addIcon("togglelabel",''),i.ui.registry.addButton("details",{icon:"details",tooltip:"Insert collapsible block",onAction(){i.execCommand("InsertDetailsBlock")}}),i.ui.registry.addButton("removedetails",{icon:"table-delete-table",tooltip:"Unwrap",onAction(){jr(i)}}),i.ui.registry.addButton("editdetials",{icon:"togglelabel",tooltip:"Edit label",onAction(){us(i)}}),i.on("dblclick",t=>{!ii(i)||t.target.closest("doc-root")||us(i)}),i.ui.registry.addButton("toggledetails",{icon:"togglefold",tooltip:"Toggle open/closed",onAction(){ii(i).toggleAttribute("open"),i.focus()}}),i.addCommand("InsertDetailsBlock",()=>{let t=i.selection.getContent({format:"html"}),e=document.createElement("details"),n=document.createElement("summary"),o=`details-${Date.now()}`;e.setAttribute("data-id",o),e.appendChild(n),t||(t="


    "),e.innerHTML+=t,i.insertContent(e.outerHTML),i.focus();let s=i.dom.select(`[data-id="${o}"]`)[0]||null;if(s){let r=s.querySelector("doc-root > *");r&&r.focus(),s.removeAttribute("data-id")}}),i.ui.registry.addContextToolbar("details",{predicate(t){return t.nodeName.toLowerCase()==="details"},items:"editdetials toggledetails removedetails",position:"node",scope:"node"}),i.on("PreInit",()=>{Kr(i)})}function ps(){return Xr}function Gr(i){i.ui.registry.addIcon("tableclearformatting",'');let t={items:" | tablerowheader",predicate(n){let o=n.nodeName.toLowerCase()==="table",s=i.selection.getNode(),r=s.closest("table");return!o||!r?!1:r.querySelector("tr").contains(s)},position:"node",scope:"node"};i.ui.registry.addContextToolbar("customtabletoolbarfirstrow",t),i.addCommand("tableclearformatting",()=>{let n=i.dom.getParent(i.selection.getStart(),"table");if(!n)return;let o=["class","style","width","height"],s=[n,...n.querySelectorAll(o.map(r=>`[${r}]`).join(","))];for(let r of s)for(let a of o)r.removeAttribute(a)}),i.addCommand("tableclearsizes",()=>{let n=i.dom.getParent(i.selection.getStart(),"table");if(!n)return;let o=[n,...n.querySelectorAll("tr,td,th,tbody,thead,tfoot,th>*,td>*")];for(let s of o)s.removeAttribute("width"),s.removeAttribute("height"),s.style.height=null,s.style.width=null});let e=()=>{let n=i.ui.registry.getAll().buttons;i.ui.registry.addMenuButton("customtable",{...n.table,fetch:o=>o("inserttable | cell row column | advtablesort | tableprops tableclearformatting tableclearsizes deletetable")}),i.ui.registry.addMenuItem("tableclearformatting",{icon:"tableclearformatting",text:"Clear table formatting",onSetup:n.tableprops.onSetup,onAction(){i.execCommand("tableclearformatting")}}),i.ui.registry.addMenuItem("tableclearsizes",{icon:"resize",text:"Resize to contents",onSetup:n.tableprops.onSetup,onAction(){i.execCommand("tableclearsizes")}}),i.off("PreInit",e)};i.on("PreInit",e)}function ms(){return Gr}function Yr(i){let t=i.closest("li");return t&&t.parentNode.nodeName==="UL"&&t.classList.contains("task-list-item")}function Jr(i,t,e){let n=t.getBoundingClientRect();i.clientX<=n.right&&i.clientX>=n.left&&i.clientY>=n.top&&i.clientY<=n.bottom||e.undoManager.transact(()=>{t.hasAttribute("checked")?t.removeAttribute("checked"):t.setAttribute("checked","checked")})}function Zr(i){i.attr("class","task-list-item");for(let t of i.children())t.name==="input"&&(t.attr("checked")==="checked"&&i.attr("checked","checked"),t.remove())}function Qr(i){let t=i.attr("checked")==="checked";i.attr("checked",null);let e={type:"checkbox",disabled:"disabled"};t&&(e.checked="checked");let n=window.tinymce.html.Node.create("input",e);n.shortEnded=!0,i.firstChild?i.insert(n,i.firstChild,!0):i.append(n)}function ta(i){i.ui.registry.addIcon("tasklist",''),i.ui.registry.addToggleButton("tasklist",{tooltip:"Task list",icon:"tasklist",active:!1,onAction(n){n.isActive()?i.execCommand("RemoveList"):i.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:"task-list-item"},"list-style-type":"tasklist"})},onSetup(n){i.on("NodeChange",o=>{let s=o.parents.find(a=>a.nodeName==="LI"),r=s&&s.classList.contains("task-list-item");n.setActive(!!r)})}});let t=i.ui.registry.getAll().buttons.bullist;t.onSetup=function(o){i.on("NodeChange",s=>{let r=s.parents.find(d=>d.nodeName==="LI"),a=r&&r.classList.contains("task-list-item"),l=r&&r.parentNode.nodeName==="UL";o.setActive(!!(l&&!a))})},t.onAction=function(){Yr(i.selection.getNode())&&i.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}}),i.execCommand("InsertUnorderedList",null,{"list-item-attributes":{class:null}})};let e=i.ui.registry.getAll().buttons.numlist;e.onAction=function(){i.execCommand("InsertOrderedList",null,{"list-item-attributes":{class:null}})},i.on("PreInit",()=>{i.parser.addNodeFilter("li",n=>{for(let o of n)o.attributes.map.class==="task-list-item"&&Zr(o)}),i.serializer.addNodeFilter("li",n=>{for(let o of n)o.attributes.map.class==="task-list-item"&&Qr(o)})}),i.on("click",n=>{let o=n.target;o.nodeName==="LI"&&o.classList.contains("task-list-item")&&(Jr(n,o,i),n.preventDefault())})}function fs(){return ta}function gs(i){function t(e){let n=e.querySelector("iframe, video");if(!n)return;let o=[...n.classList.values()].filter(r=>r.startsWith("align-")),s=[...e.classList.values()].filter(r=>r.startsWith("align-"));e.classList.remove(...s),e.classList.add(...o)}i.on("SetContent",()=>{let e=i.dom.select("span.mce-preview-object");for(let n of e)t(n)}),i.on("FormatApply",e=>{let n=e.format.startsWith("align");if(!(e.node instanceof i.dom.doc.defaultView.HTMLElement)||!n||!e.node.matches(".mce-preview-object"))return;let s=e.node.querySelector("iframe, video");if(s){let r=(i.formatter.get(e.format)[0]?.classes||[])[0],a=!s.classList.contains(r),d=(e.node.getAttribute("data-mce-p-class")||"").split(" ").filter(p=>!p.startsWith("align-"));a&&d.push(r);let u=d.join(" ");e.node.setAttribute("data-mce-p-class",u),s.setAttribute("class",u),i.formatter.apply(e.format,{},s),t(e.node)}})}function vs(i){let t=i.querySelectorAll('[align],[style*="text-align"],.align-center,.align-left,.align-right');for(let e of t)e.removeAttribute("align"),e.style.textAlign=null,e.classList.remove("align-center","align-right","align-left")}function zi(i){let t=i.querySelectorAll('[dir],[style*="direction"]');for(let e of t)e.removeAttribute("dir"),e.style.direction=null;vs(i),i.style.direction=null,i.style.textAlign=null,i.removeAttribute("align")}function ws(i){let t=[];i.on("TableSelectionChange",n=>{t=(n.cells||[]).map(o=>o.dom)}),i.on("TableSelectionClear",()=>{t=[]});let e={RemoveFormat:n=>{let o=["class","style","width","height","align"];for(let s of o)n.removeAttribute(s)},mceDirectionLTR:n=>{n.setAttribute("dir","ltr"),zi(n)},mceDirectionRTL:n=>{n.setAttribute("dir","rtl"),zi(n)},JustifyLeft:n=>{n.removeAttribute("align"),vs(n)}};e.JustifyRight=e.JustifyLeft,e.JustifyCenter=e.JustifyLeft,e.JustifyFull=e.JustifyLeft,i.on("ExecCommand",n=>{let o=e[n.command];if(o)for(let s of t)o(s)})}function bs(i){i.on("ExecCommand",t=>{let e=t.command;if(e!=="mceDirectionLTR"&&e!=="mceDirectionRTL")return;let n=i.selection.getSelectedBlocks();for(let o of n)zi(o)})}var ea=[{title:"Large Header",format:"h2",preview:"color: blue;"},{title:"Medium Header",format:"h3"},{title:"Small Header",format:"h4"},{title:"Tiny Header",format:"h5"},{title:"Paragraph",format:"p",exact:!0,classes:""},{title:"Blockquote",format:"blockquote"},{title:"Callouts",items:[{title:"Information",format:"calloutinfo"},{title:"Success",format:"calloutsuccess"},{title:"Warning",format:"calloutwarning"},{title:"Danger",format:"calloutdanger"}]}],na={alignleft:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video",classes:"align-left"},aligncenter:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video",classes:"align-center"},alignright:{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,iframe,video",classes:"align-right"},calloutsuccess:{block:"p",exact:!0,attributes:{class:"callout success"}},calloutinfo:{block:"p",exact:!0,attributes:{class:"callout info"}},calloutwarning:{block:"p",exact:!0,attributes:{class:"callout warning"}},calloutdanger:{block:"p",exact:!0,attributes:{class:"callout danger"}}},ia=["#BFEDD2","","#FBEEB8","","#F8CAC6","","#ECCAFA","","#C2E0F4","","#2DC26B","","#F1C40F","","#E03E2D","","#B96AD9","","#3598DB","","#169179","","#E67E23","","#BA372A","","#843FA1","","#236FA1","","#ECF0F1","","#CED4D9","","#95A5A6","","#7E8C8D","","#34495E","","#000000","","#ffffff",""];function oa(i,t,e){if(e.filetype==="file"){let n=window.$components.first("entity-selector-popup"),o=this.selection.getContent({format:"text"}).trim();n.show(s=>{i(s.link,{text:s.name,title:s.name})},{initialValue:o,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}e.filetype==="image"&&window.$components.first("image-manager").show(o=>{i(o.url,{alt:o.name})},"gallery")}function sa(i){let t=["image","table","link","autolink","fullscreen","code","customhr","autosave","lists","codeeditor","media","imagemanager","about","details","tasklist","tableadditions",i.textDirection==="rtl"?"directionality":""];return window.tinymce.PluginManager.add("codeeditor",es()),window.tinymce.PluginManager.add("customhr",ls()),window.tinymce.PluginManager.add("imagemanager",cs()),window.tinymce.PluginManager.add("about",ds()),window.tinymce.PluginManager.add("details",ps()),window.tinymce.PluginManager.add("tasklist",fs()),window.tinymce.PluginManager.add("tableadditions",ms()),i.drawioUrl&&(window.tinymce.PluginManager.add("drawio",as(i)),t.push("drawio")),t.filter(e=>!!e)}function ra(i){let t=document.head.innerHTML.split(` `),e=t.findIndex(r=>r.trim()===""),n=t.findIndex(r=>r.trim()==="");if(e===-1||n===-1)return;let o=t.slice(e+1,n).join(` -`),s=i.createElement("div");s.innerHTML=o,i.head.append(...s.children)}function ra(i){return function(e){function n(){i.darkMode&&e.contentDocument.documentElement.classList.add("dark-mode"),window.$events.emit("editor-html-change","")}e.on("ExecCommand change input NodeChange ObjectResized",n),Wo(e),zo(e,i),e.on("init",()=>{n(),Uo(e),window.editor=e,Vo(e)}),e.on("PreInit",()=>{Yo(e)}),fs(e),vs(e),ws(e),window.$events.emitPublic(i.containerElement,"editor-tinymce::setup",{editor:e}),e.ui.registry.addButton("inlinecode",{tooltip:"Inline code",icon:"sourcecode",onAction(){e.execCommand("mceToggleFormat",!1,"code")}})}}function aa(i){return` +`),s=i.createElement("div");s.innerHTML=o,i.head.append(...s.children)}function aa(i){return function(e){function n(){i.darkMode&&e.contentDocument.documentElement.classList.add("dark-mode"),window.$events.emit("editor-html-change","")}e.on("ExecCommand change input NodeChange ObjectResized",n),Uo(e),Ko(e,i),e.on("init",()=>{n(),jo(e),window.editor=e,Wo(e)}),e.on("PreInit",()=>{Jo(e)}),gs(e),ws(e),bs(e),window.$events.emitPublic(i.containerElement,"editor-tinymce::setup",{editor:e}),e.ui.registry.addButton("inlinecode",{tooltip:"Inline code",icon:"sourcecode",onAction(){e.execCommand("mceToggleFormat",!1,"code")}})}}function la(i){return` html, body, html.dark-mode { background: ${i.darkMode?"#222":"#fff"}; } @@ -19,7 +19,7 @@ body { margin-right: auto !important; overflow-y: hidden !important; }`.trim().replace(` -`,"")}function bs(i){return window.tinymce.addI18n(i.language,i.translationMap),{width:"100%",height:"100%",selector:"#html-editor",cache_suffix:`?version=${document.querySelector('script[src*="/dist/app.js"]').getAttribute("src").split("?version=")[1]}`,content_css:[window.baseUrl("/dist/styles.css")],branding:!1,skin:i.darkMode?"tinymce-5-dark":"tinymce-5",body_class:"page-content",browser_spellcheck:!0,relative_urls:!1,language:i.language,directionality:i.textDirection,remove_script_host:!1,document_base_url:window.baseUrl("/"),end_container_on_empty_block:!0,remove_trailing_brs:!1,statusbar:!1,menubar:!1,paste_data_images:!1,extended_valid_elements:"pre[*],svg[*],div[drawio-diagram],details[*],summary[*],div[*],li[class|checked|style]",automatic_uploads:!1,custom_elements:"doc-root,code-block",valid_children:["-div[p|h1|h2|h3|h4|h5|h6|blockquote|code-block]","+div[pre|img]","-doc-root[doc-root|#text]","-li[details]","+code-block[pre]","+doc-root[p|h1|h2|h3|h4|h5|h6|blockquote|code-block|div|hr]"].join(","),plugins:oa(i),contextmenu:!1,toolbar:Ko(i),content_style:aa(i),style_formats:ta,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:ea,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:na,file_picker_callback:ia,paste_preprocess(e,n){let{content:o}=n;o.indexOf('{this.editor=t[0]})}getDrawIoUrl(){let t=document.querySelector("[drawio-url]");return t?t.getAttribute("drawio-url"):""}async getContent(){return{html:this.editor.getContent()}}};var oi=class extends h{constructor(){super(...arguments);d(this,"elem");d(this,"wysiwygEditor");d(this,"textDirection")}async setup(){this.elem=this.$el,this.textDirection=this.$opts.textDirection;let e=await window.importVersioned("wysiwyg"),n=q("div",{class:"basic-editor-container"});this.elem.parentElement?.appendChild(n),this.elem.hidden=!0,this.wysiwygEditor=e.createBasicEditorInstance(n,this.elem.value,{darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.textDirection,translations:window.editor_translations}),this.wysiwygEditor.onChange(()=>{this.wysiwygEditor.getContentAsHtml().then(o=>{this.elem.value=o})})}};function Ki(i){let t=n=>n.slice(0,1).toUpperCase()+n.slice(1),e=i.split("-");return e[0]+e.slice(1).map(t).join("")}function ys(i){return i.replace(/[A-Z]/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}function la(i,t){let e={},n={},o=`${i}@`,s=`[refs*="${o}"]`,r=[...t.querySelectorAll(s)];t.matches(s)&&r.push(t);for(let a of r){let l=(a.getAttribute("refs")||"").split(" ").filter(c=>c.startsWith(o)).map(c=>c.replace(o,"")).map(Ki);for(let c of l)e[c]=a,typeof n[c]>"u"&&(n[c]=[]),n[c].push(a)}return{refs:e,manyRefs:n}}function ca(i,t){let e={},n=`option:${i}:`;for(let{name:o,value:s}of t.attributes)if(o.startsWith(n)){let r=o.replace(n,"");e[Ki(r)]=s||""}return e}var si=class{constructor(){d(this,"components",{});d(this,"componentModelMap",{});d(this,"elementComponentMap",new WeakMap)}initComponent(t,e){let n=this.componentModelMap[t];if(n===void 0)return;let o=null;try{o=new n,o.$name=t,o.$el=e;let r=la(t,e);o.$refs=r.refs,o.$manyRefs=r.manyRefs,o.$opts=ca(t,e),o.setup()}catch(r){console.error("Failed to create component",r,t,e)}if(!o)return;typeof this.components[t]>"u"&&(this.components[t]=[]),this.components[t].push(o);let s=this.elementComponentMap.get(e)||{};s[t]=o,this.elementComponentMap.set(e,s)}init(t=document){let e=t.querySelectorAll("[component],[components]");for(let n of e){let o=`${n.getAttribute("component")||""} ${n.getAttribute("components")}`.toLowerCase().split(" ").filter(Boolean);for(let s of o)this.initComponent(s,n)}}register(t){let e=Object.keys(t);for(let n of e)this.componentModelMap[ys(n)]=t[n]}first(t){return(this.components[t]||[null])[0]}get(t){return this.components[t]||[]}firstOnElement(t,e){return(this.elementComponentMap.get(t)||{})[e]||null}allWithinElement(t,e){return this.get(e).filter(o=>t.contains(o.$el))}};window.__DEV__=!1;window.baseUrl=eo;window.importVersioned=no;window.$http=new ve;window.$events=new ge;window.$trans=new we;window.$components=new si;window.$components.register(zi);window.$components.init(); +`,"")}function ys(i){return window.tinymce.addI18n(i.language,i.translationMap),{width:"100%",height:"100%",selector:"#html-editor",cache_suffix:`?version=${document.querySelector('script[src*="/dist/app.js"]').getAttribute("src").split("?version=")[1]}`,content_css:[window.baseUrl("/dist/styles.css")],branding:!1,skin:i.darkMode?"tinymce-5-dark":"tinymce-5",body_class:"page-content",browser_spellcheck:!0,relative_urls:!1,language:i.language,directionality:i.textDirection,remove_script_host:!1,document_base_url:window.baseUrl("/"),end_container_on_empty_block:!0,remove_trailing_brs:!1,statusbar:!1,menubar:!1,paste_data_images:!1,extended_valid_elements:"pre[*],svg[*],div[drawio-diagram],details[*],summary[*],div[*],li[class|checked|style]",automatic_uploads:!1,custom_elements:"doc-root,code-block",valid_children:["-div[p|h1|h2|h3|h4|h5|h6|blockquote|code-block]","+div[pre|img]","-doc-root[doc-root|#text]","-li[details]","+code-block[pre]","+doc-root[p|h1|h2|h3|h4|h5|h6|blockquote|code-block|div|hr]"].join(","),plugins:sa(i),contextmenu:!1,toolbar:Xo(i),content_style:la(i),style_formats:ea,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:na,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:ia,file_picker_callback:oa,paste_preprocess(e,n){let{content:o}=n;o.indexOf('{this.editor=t[0]})}getDrawIoUrl(){let t=document.querySelector("[drawio-url]");return t?t.getAttribute("drawio-url"):""}async getContent(){return{html:this.editor.getContent()}}};var si=class extends h{constructor(){super(...arguments);c(this,"elem");c(this,"wysiwygEditor");c(this,"textDirection")}async setup(){this.elem=this.$el,this.textDirection=this.$opts.textDirection;let e=await window.importVersioned("wysiwyg"),n=q("div",{class:"basic-editor-container"});this.elem.parentElement?.appendChild(n),this.elem.hidden=!0,this.wysiwygEditor=e.createBasicEditorInstance(n,this.elem.value,{darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.textDirection,translations:window.editor_translations}),this.wysiwygEditor.onChange(()=>{this.wysiwygEditor.getContentAsHtml().then(o=>{this.elem.value=o})})}};function Xi(i){let t=n=>n.slice(0,1).toUpperCase()+n.slice(1),e=i.split("-");return e[0]+e.slice(1).map(t).join("")}function Es(i){return i.replace(/[A-Z]/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}function ca(i,t){let e={},n={},o=`${i}@`,s=`[refs*="${o}"]`,r=[...t.querySelectorAll(s)];t.matches(s)&&r.push(t);for(let a of r){let l=(a.getAttribute("refs")||"").split(" ").filter(d=>d.startsWith(o)).map(d=>d.replace(o,"")).map(Xi);for(let d of l)e[d]=a,typeof n[d]>"u"&&(n[d]=[]),n[d].push(a)}return{refs:e,manyRefs:n}}function da(i,t){let e={},n=`option:${i}:`;for(let{name:o,value:s}of t.attributes)if(o.startsWith(n)){let r=o.replace(n,"");e[Xi(r)]=s||""}return e}var ri=class{constructor(){c(this,"components",{});c(this,"componentModelMap",{});c(this,"elementComponentMap",new WeakMap)}initComponent(t,e){let n=this.componentModelMap[t];if(n===void 0)return;let o=null;try{o=new n,o.$name=t,o.$el=e;let r=ca(t,e);o.$refs=r.refs,o.$manyRefs=r.manyRefs,o.$opts=da(t,e),o.setup()}catch(r){console.error("Failed to create component",r,t,e)}if(!o)return;typeof this.components[t]>"u"&&(this.components[t]=[]),this.components[t].push(o);let s=this.elementComponentMap.get(e)||{};s[t]=o,this.elementComponentMap.set(e,s)}init(t=document){let e=t.querySelectorAll("[component],[components]");for(let n of e){let o=`${n.getAttribute("component")||""} ${n.getAttribute("components")}`.toLowerCase().split(" ").filter(Boolean);for(let s of o)this.initComponent(s,n)}}register(t){let e=Object.keys(t);for(let n of e)this.componentModelMap[Es(n)]=t[n]}first(t){return(this.components[t]||[null])[0]}get(t){return this.components[t]||[]}firstOnElement(t,e){return(this.elementComponentMap.get(t)||{})[e]||null}allWithinElement(t,e){return this.get(e).filter(o=>t.contains(o.$el))}};window.__DEV__=!1;window.baseUrl=no;window.importVersioned=io;window.$http=new ve;window.$events=new ge;window.$trans=new we;window.$components=new ri;window.$components.register(Ki);window.$components.init(); /*! Bundled license information: sortablejs/modular/sortable.esm.js: diff --git a/public/dist/code.js b/public/dist/code.js index 3a87a631a..f378f78b0 100644 --- a/public/dist/code.js +++ b/public/dist/code.js @@ -2,15 +2,15 @@ var ls=[],YO=[];(()=>{let i="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,,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,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(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=YO[n])e=n+1;else return!0;if(e==t)return!1}}function RO(i){return i>=127462&&i<=127487}var ZO=8205;function _O(i,e,t=!0,n=!0){return(t?zO:Id)(i,e,n)}function zO(i,e,t){if(e==i.length)return e;e&&CO(i.charCodeAt(e))&&qO(i.charCodeAt(e-1))&&e--;let n=Os(i,e);for(e+=VO(n);e=0&&RO(Os(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function Id(i,e,t){for(;e>0;){let n=zO(i,e-2,t);if(n=56320&&i<57344}function qO(i){return i>=55296&&i<56320}function VO(i){return i<65536?1:2}var q=class i{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){[e,t]=mi(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),di.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=mi(this,e,t);let n=[];return this.decompose(e,t,n,0),di.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),r=new Nt(this),s=new Nt(e);for(let o=t,a=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new Nt(this,e)}iterRange(e,t=this.length){return new Un(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Mn(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]?i.empty:e.length<=32?new Ze(e):di.from(Ze.split(e,[]))}},Ze=class i extends q{constructor(e,t=Nd(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],a=r+o.length;if((t?n:a)>=e)return new cs(r,a,n,o);r=a+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new i(AO(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),a=Wn(s.text,o.text.slice(),0,s.length);if(a.length<=32)n.push(new i(a,o.length+s.length));else{let O=a.length>>1;n.push(new i(a.slice(0,O)),new i(a.slice(O)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof i))return super.replace(e,t,n);[e,t]=mi(this,e,t);let r=Wn(this.text,Wn(n.text,AO(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new i(r,s):di.from(i.split(r,[]),s)}sliceString(e,t=this.length,n=` `){[e,t]=mi(this,e,t);let r="";for(let s=0,o=0;s<=t&&oe&&o&&(r+=n),es&&(r+=a.slice(Math.max(0,e-s),t-s)),s=O+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new i(n,r)),n=[],r=-1);return r>-1&&t.push(new i(n,r)),t}},di=class i extends q{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,r){for(let s=0;;s++){let o=this.children[s],a=r+o.length,O=n+o.lines-1;if((t?O:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=O+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s=o){let l=r&((o<=e?1:0)|(O>=t?2:0));o>=e&&O<=t&&!l?n.push(a):a.decompose(e-o,t-o,n,l)}o=O+1}}replace(e,t,n){if([e,t]=mi(this,e,t),n.lines=s&&t<=a){let O=o.replace(e-s,t-s,n),l=this.lines-o.lines+O.lines;if(O.lines>4&&O.lines>l>>6){let h=this.children.slice();return h[r]=O,new i(h,this.length-(t-e)+n.length)}return super.replace(s,a,O)}s=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){[e,t]=mi(this,e,t);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=a.sliceString(e-o,t-o,n)),o=O+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let n=0,[r,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==a)return n;let O=this.children[r],l=e.children[s];if(O!=l)return n+O.scanIdentical(l,t);n+=O.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let $ of e)$.flatten(d);return new Ze(d,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,a=[],O=0,l=-1,h=[];function c(d){let $;if(d.lines>s&&d instanceof i)for(let p of d.children)c(p);else d.lines>o&&(O>o||!O)?(f(),a.push(d)):d instanceof Ze&&O&&($=h[h.length-1])instanceof Ze&&d.lines+$.lines<=32?(O+=d.lines,l+=d.length+1,h[h.length-1]=new Ze($.text.concat(d.text),$.length+1+d.length)):(O+d.lines>r&&f(),O+=d.lines,l+=d.length+1,h.push(d))}function f(){O!=0&&(a.push(h.length==1?h[0]:i.from(h,l)),l=-1,O=h.length=0)}for(let d of e)c(d);return f(),a.length==1?a[0]:new i(a,t)}};q.empty=new Ze([""],0);function Nd(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Wn(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s=t&&(O>n&&(a=a.slice(0,n-r)),r0?1:(e instanceof Ze?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,a=r instanceof Ze?r.text.length:r.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=` -`,this;e--}else if(r instanceof Ze){let O=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,O.length>Math.max(0,e))return this.value=e==0?O:t>0?O.slice(e):O.slice(0,O.length-e),this;e-=O.length}else{let O=r.children[o+(t<0?-1:0)];e>O.length?(e-=O.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(O),this.offsets.push(t>0?1:(O instanceof Ze?O.text.length:O.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Un=class{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Nt(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:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}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!=""}},Mn=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(q.prototype[Symbol.iterator]=function(){return this.iter()},Nt.prototype[Symbol.iterator]=Un.prototype[Symbol.iterator]=Mn.prototype[Symbol.iterator]=function(){return this});var cs=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function mi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function le(i,e,t=!0,n=!0){return _O(i,e,t,n)}function Fd(i){return i>=56320&&i<57344}function Hd(i){return i>=55296&&i<56320}function bs(i,e){let t=i.charCodeAt(e);if(!Hd(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return Fd(n)?(t-55296<<10)+(n-56320)+65536:t}function xs(i){return i<65536?1:2}var fs=/\r\n?|\n/,Oe=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(Oe||(Oe={})),pt=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=a}else{if(n!=Oe.Simple&&l>=e&&(n==Oe.TrackDel&&re||n==Oe.TrackBefore&&re))return null;if(l>e||l==e&&t<0&&!a)return e==r||t<0?s:s+O;s+=O}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&a>=e)return rt?"cover":!0;r=a}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}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 i(e)}static create(e){return new i(e)}},Qe=class i extends pt{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 us(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return ds(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r=0){t[r]=a,t[r+1]=o;let O=r>>1;for(;n.length0&&wt(n,t,s.text),s.forward(h),a+=h}let l=e[o++];for(;a>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,a=null;function O(h=!1){if(!h&&!r.length)return;of||c<0||f>t)throw new RangeError(`Invalid change range ${c} to ${f} (in doc of length ${t})`);let $=d?typeof d=="string"?q.of(d.split(n||fs)):d:q.empty,p=$.length;if(c==f&&p==0)return;co&&ce(r,c-o,-1),ce(r,f-c,p),wt(s,r,$),o=f}}return l(e),O(!a),a}static empty(e){return new i(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;ra&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function wt(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)a=i.sections[o++],O=i.sections[o++];e(r,l,s,h,c),r=l,s=h}}}function ds(i,e,t,n=!1){let r=[],s=n?[]:null,o=new Ft(i),a=new Ft(e);for(let O=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let l=Math.min(o.len,a.len);ce(r,l,-1),o.forward(l),a.forward(l)}else if(a.ins>=0&&(o.ins<0||O==o.i||o.off==0&&(a.len=0&&O=0){let l=0,h=o.len;for(;h;)if(a.ins==-1){let c=Math.min(h,a.len);l+=c,h-=c,a.forward(c)}else if(a.ins==0&&a.lenO||o.ins>=0&&o.len>O)&&(a||n.length>l),s.forward2(O),o.forward(O)}}}}var Ft=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?q.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?q.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)}},ui=class i{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,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new i(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return S.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return S.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return S.range(e.anchor,e.head)}static create(e,t,n){return new i(e,t,n)}},S=class i{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:i.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.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 i(e.ranges.map(t=>ui.fromJSON(t)),e.main)}static single(e,t=e){return new i([i.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,r=0;re?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(n);for(let r=1;rs.head?i.range(O,a):i.range(a,O))}}return new i(e,t)}};function LO(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var ks=0,R=class i{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=ks++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new i(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:ws),!!e.static,e.enables)}of(e){return new $i([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new $i(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new $i(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}};function ws(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}var $i=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=ks++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,O=!1,l=!1,h=[];for(let c of this.dependencies)c=="doc"?O=!0:c=="selection"?l=!0:(((t=e[c.id])!==null&&t!==void 0?t:1)&1)==0&&h.push(e[c.id]);return{create(c){return c.values[o]=n(c),1},update(c,f){if(O&&f.docChanged||l&&(f.docChanged||f.selection)||$s(c,h)){let d=n(c);if(a?!WO(d,c.values[o],r):!r(d,c.values[o]))return c.values[o]=d,1}return 0},reconfigure:(c,f)=>{let d,$=f.config.address[s];if($!=null){let p=Ln(f,$);if(this.dependencies.every(m=>m instanceof R?f.facet(m)===c.facet(m):m instanceof ge?f.field(m,!1)==c.field(m,!1):!0)||(a?WO(d=n(c),p,r):r(d=n(c),p)))return c.values[o]=p,0}else d=n(c);return c.values[o]=d,1}}}};function WO(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[O.id]),r=t.map(O=>O.type),s=n.filter(O=>!(O&1)),o=i[e.id]>>1;function a(O){let l=[];for(let h=0;hn===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Cn).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,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet(Cn),o=r.facet(Cn),a;return(a=s.find(O=>O.field==this))&&a!=o.find(O=>O.field==this)?(n.values[t]=a.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,Cn.of({field:this,create:e})]}get extension(){return this}},Dt={lowest:4,low:3,default:2,high:1,highest:0};function Ui(i){return e=>new En(e,i)}var nt={highest:Ui(Dt.highest),high:Ui(Dt.high),default:Ui(Dt.default),low:Ui(Dt.low),lowest:Ui(Dt.lowest)},En=class{constructor(e,t){this.inner=e,this.prec=t}},mt=class i{of(e){return new Ei(this,e)}reconfigure(e){return i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},Ei=class{constructor(e,t){this.compartment=e,this.inner=t}},Gn=class i{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of Jd(e,t,o))f instanceof ge?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let a=Object.create(null),O=[],l=[];for(let f of r)a[f.id]=l.length<<1,l.push(d=>f.slot(d));let h=n?.config.facets;for(let f in s){let d=s[f],$=d[0].facet,p=h&&h[f]||[];if(d.every(m=>m.type==0))if(a[$.id]=O.length<<1|1,ws(p,d))O.push(n.facet($));else{let m=$.combine(d.map(Q=>Q.value));O.push(n&&$.compare(m,n.facet($))?n.facet($):m)}else{for(let m of d)m.type==0?(a[m.id]=O.length<<1|1,O.push(m.value)):(a[m.id]=l.length<<1,l.push(Q=>m.dynamicSlot(Q)));a[$.id]=l.length<<1,l.push(m=>Kd(m,$,d))}}let c=l.map(f=>f(a));return new i(e,o,c,a,O,s)}};function Jd(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,a){let O=r.get(o);if(O!=null){if(O<=a)return;let l=n[O].indexOf(o);l>-1&&n[O].splice(l,1),o instanceof Ei&&t.delete(o.compartment)}if(r.set(o,a),Array.isArray(o))for(let l of o)s(l,a);else if(o instanceof Ei){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let l=e.get(o.compartment)||o.inner;t.set(o.compartment,l),s(l,a)}else if(o instanceof En)s(o.inner,o.prec);else if(o instanceof ge)n[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof $i)n[a].push(o),o.facet.extensions&&s(o.facet.extensions,Dt.default);else{let l=o.extension;if(!l)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(l,a)}}return s(i,Dt.default),n.reduce((o,a)=>o.concat(a))}function Mi(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Ln(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var jO=R.define(),ps=R.define({combine:i=>i.some(e=>e),static:!0}),BO=R.define({combine:i=>i.length?i[0]:void 0,static:!0}),DO=R.define(),IO=R.define(),NO=R.define(),FO=R.define({combine:i=>i.length?i[0]:!1}),be=class{constructor(e,t){this.type=e,this.value=t}static define(){return new ms}},ms=class{of(e){return new be(this,e)}},Qs=class{constructor(e){this.map=e}of(e){return new B(this,e)}},B=class i{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 i(this.type,t)}is(e){return this.type==e}static define(e={}){return new Qs(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}};B.reconfigure=B.define();B.appendConfig=B.define();var ne=class i{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&LO(n,t.newLength),s.some(a=>a.type==i.time)||(this.annotations=s.concat(i.time.of(Date.now())))}static create(e,t,n,r,s,o){return new i(e,t,n,r,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(i.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};ne.time=be.define();ne.userEvent=be.define();ne.addToHistory=be.define();ne.remote=be.define();function e$(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n=i[n]))s=i[n++],o=i[n++];else if(r=0;r--){let s=n[r](i);s instanceof ne?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ne?i=s[0]:i=KO(e,pi(s),!1)}return i}function i$(i){let e=i.startState,t=e.facet(NO),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=HO(n,gs(e,s,i.changes.newLength),!0))}return n==i?i:ne.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}var n$=[];function pi(i){return i==null?n$:Array.isArray(i)?i:[i]}var We=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(We||(We={})),r$=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ss;try{Ss=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function s$(i){if(Ss)return Ss.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||r$.test(t)))return!0}return!1}function o$(i){return e=>{if(!/\S/.test(e))return We.Space;if(s$(e))return We.Word;for(let t=0;t-1)return We.Word;return We.Other}}var D=class i{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;ar.set(l,O)),t=null),r.set(a.value.compartment,a.value.extension)):a.is(B.reconfigure)?(t=null,n=a.value):a.is(B.appendConfig)&&(t=null,n=pi(n).concat(a.value));let s;t?s=e.startState.values.slice():(t=Gn.resolve(n,r,this),s=new i(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(O,l)=>l.reconfigure(O,this),null).values);let o=e.startState.facet(ps)?e.newSelection:e.newSelection.asSingle();new i(t,e.newDoc,o,s,(a,O)=>O.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:S.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=pi(n.effects);for(let a=1;ao.spec.fromJSON(a,O)))}}return i.create({doc:e.doc,selection:S.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Gn.resolve(e.extensions||[],new Map),n=e.doc instanceof q?e.doc:q.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||fs)),r=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return LO(r,n.length),t.staticFacet(ps)||(r=r.asSingle()),new i(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(i.tabSize)}get lineBreak(){return this.facet(i.lineSeparator)||` -`}get readOnly(){return this.facet(FO)}phrase(e,...t){for(let n of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(jO))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return o$(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let O=le(t,o,!1);if(s(t.slice(O,o))!=We.Word)break;o=O}for(;ai.length?i[0]:4});D.lineSeparator=BO;D.readOnly=FO;D.phrases=R.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});D.languageData=jO;D.changeFilter=DO;D.transactionFilter=IO;D.transactionExtender=NO;mt.reconfigure=B.define();function Xt(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[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 r in e)n[r]===void 0&&(n[r]=e[r]);return n}var Ie=class{eq(e){return this==e}range(e,t=e){return Gi.create(e,t,this)}};Ie.prototype.startSide=Ie.prototype.endSide=0;Ie.prototype.point=!1;Ie.prototype.mapMode=Oe.TrackDel;var Gi=class i{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new i(e,t,n)}};function Ps(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var ys=class i{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,a=s.length;;){if(o==a)return o;let O=o+a>>1,l=s[O]-e||(n?this.value[O].endSide:this.value[O].startSide)-t;if(O==o)return l>=0?o:a;l>=0?a=O:o=O+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);sd||f==d&&l.startSide>0&&l.endSide<=0)continue;(d-f||l.endSide-l.startSide)<0||(o<0&&(o=f),l.point&&(a=Math.max(a,d-f)),n.push(l),r.push(f-o),s.push(d-o))}return{mapped:n.length?new i(r,s,n,a):null,pos:o}}},H=class i{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new i(e,t,n,r)}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:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(Ps)),this.isEmpty)return t.length?i.of(t):this;let a=new jn(this,null,-1).goto(0),O=0,l=[],h=new Ht;for(;a.value||O=0){let c=t[O++];h.addInner(c.from,c.to,c.value)||l.push(c)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=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 Li.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Li.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),a=t.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),O=UO(o,a,n),l=new It(o,O,s),h=new It(a,O,s);n.iterGaps((c,f,d)=>MO(l,c,h,f,d,r)),n.empty&&n.length==0&&MO(l,0,h,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=UO(s,o),O=new It(s,a,0).goto(n),l=new It(o,a,0).goto(n);for(;;){if(O.to!=l.to||!Ts(O.active,l.active)||O.point&&(!l.point||!O.point.eq(l.point)))return!1;if(O.to>r)return!0;O.next(),l.next()}}static spans(e,t,n,r,s=-1){let o=new It(e,null,s).goto(t),a=t,O=o.openStart;for(;;){let l=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),c=o.pointFroma&&(r.span(a,l,o.active,O),O=o.openEnd(l));if(o.to>n)return O+(o.point&&o.to>n?1:0);a=o.to,o.next()}}static of(e,t=!1){let n=new Ht;for(let r of e instanceof Gi?[e]:t?a$(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return i.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=i.empty;r=r.nextLayer)t=new i(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}};H.empty=new H([],[],null,-1);function a$(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(Ps);e=n}return i}H.empty.nextLayer=H.empty;var Ht=class i{finishChunk(e){this.chunks.push(new ys(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 i)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!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(H.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=H.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function UO(i,e,t){let n=new Map;for(let s of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&r.push(new jn(o,t,n,s));return r.length==1?r[0]:new i(r)}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--)hs(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--)hs(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(),hs(this.heap,0)}}};function hs(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}var It=class{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=Li.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){qn(this.active,e),qn(this.activeTo,e),qn(this.activeRank,e),this.minActive=EO(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t0;)t++;An(this.active,t,n),An(this.activeTo,t,r),An(this.activeRank,t,s),e&&An(e,t,this.cursor.from),this.minActive=EO(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&qn(n,r)}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=0&&n[r]=0&&!(this.activeRank[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 MO(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,a=n,O=n-e;for(;;){let l=i.to+O-t.to,h=l||i.endSide-t.endSide,c=h<0?i.to+O:t.to,f=Math.min(c,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&Ts(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(a,f,i.point,t.point):f>a&&!Ts(i.active,t.active)&&s.compareRange(a,f,i.active,t.active),c>o)break;(l||i.openEnd!=t.openEnd)&&s.boundChange&&s.boundChange(c),a=c,h<=0&&i.next(),h>=0&&t.next()}}function Ts(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;n--)i[n+1]=i[n];i[e]=t}function EO(i,e){let t=-1,n=1e9;for(let r=0;r=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=le(i,r)}return n===!0?-1:i.length}var JO=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),Xs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),el=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Ue=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,O,l){let h=[],c=/^@(\w+)\b/.exec(o[0]),f=c&&c[1]=="keyframes";if(c&&a==null)return O.push(o[0]+";");for(let d in a){let $=a[d];if(/&/.test(d))s(d.split(/,\s*/).map(p=>o.map(m=>p.replace(/&/,m))).reduce((p,m)=>p.concat(m)),$,O);else if($&&typeof $=="object"){if(!c)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),$,h,f)}else $!=null&&h.push(d.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+$+";")}(h.length||f)&&O.push((n&&!c&&!l?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(` +`,this;e--}else if(r instanceof Ze){let O=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,O.length>Math.max(0,e))return this.value=e==0?O:t>0?O.slice(e):O.slice(0,O.length-e),this;e-=O.length}else{let O=r.children[o+(t<0?-1:0)];e>O.length?(e-=O.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(O),this.offsets.push(t>0?1:(O instanceof Ze?O.text.length:O.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Un=class{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Nt(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:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}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!=""}},Mn=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(q.prototype[Symbol.iterator]=function(){return this.iter()},Nt.prototype[Symbol.iterator]=Un.prototype[Symbol.iterator]=Mn.prototype[Symbol.iterator]=function(){return this});var cs=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function mi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function le(i,e,t=!0,n=!0){return _O(i,e,t,n)}function Fd(i){return i>=56320&&i<57344}function Hd(i){return i>=55296&&i<56320}function bs(i,e){let t=i.charCodeAt(e);if(!Hd(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return Fd(n)?(t-55296<<10)+(n-56320)+65536:t}function xs(i){return i<65536?1:2}var fs=/\r\n?|\n/,Oe=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(Oe||(Oe={})),pt=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=a}else{if(n!=Oe.Simple&&l>=e&&(n==Oe.TrackDel&&re||n==Oe.TrackBefore&&re))return null;if(l>e||l==e&&t<0&&!a)return e==r||t<0?s:s+O;s+=O}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&a>=e)return rt?"cover":!0;r=a}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}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 i(e)}static create(e){return new i(e)}},Qe=class i extends pt{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 us(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return ds(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r=0){t[r]=a,t[r+1]=o;let O=r>>1;for(;n.length0&&wt(n,t,s.text),s.forward(h),a+=h}let l=e[o++];for(;a>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,a=null;function O(h=!1){if(!h&&!r.length)return;of||c<0||f>t)throw new RangeError(`Invalid change range ${c} to ${f} (in doc of length ${t})`);let $=d?typeof d=="string"?q.of(d.split(n||fs)):d:q.empty,p=$.length;if(c==f&&p==0)return;co&&ce(r,c-o,-1),ce(r,f-c,p),wt(s,r,$),o=f}}return l(e),O(!a),a}static empty(e){return new i(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;ra&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function wt(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)a=i.sections[o++],O=i.sections[o++];e(r,l,s,h,c),r=l,s=h}}}function ds(i,e,t,n=!1){let r=[],s=n?[]:null,o=new Ft(i),a=new Ft(e);for(let O=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let l=Math.min(o.len,a.len);ce(r,l,-1),o.forward(l),a.forward(l)}else if(a.ins>=0&&(o.ins<0||O==o.i||o.off==0&&(a.len=0&&O=0){let l=0,h=o.len;for(;h;)if(a.ins==-1){let c=Math.min(h,a.len);l+=c,h-=c,a.forward(c)}else if(a.ins==0&&a.lenO||o.ins>=0&&o.len>O)&&(a||n.length>l),s.forward2(O),o.forward(O)}}}}var Ft=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?q.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?q.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)}},ui=class i{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,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new i(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return S.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return S.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return S.range(e.anchor,e.head)}static create(e,t,n){return new i(e,t,n)}},S=class i{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:i.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.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 i(e.ranges.map(t=>ui.fromJSON(t)),e.main)}static single(e,t=e){return new i([i.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,r=0;re?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(n);for(let r=1;rs.head?i.range(O,a):i.range(a,O))}}return new i(e,t)}};function LO(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var ks=0,Z=class i{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=ks++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new i(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:ws),!!e.static,e.enables)}of(e){return new $i([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new $i(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new $i(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}};function ws(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}var $i=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=ks++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,O=!1,l=!1,h=[];for(let c of this.dependencies)c=="doc"?O=!0:c=="selection"?l=!0:(((t=e[c.id])!==null&&t!==void 0?t:1)&1)==0&&h.push(e[c.id]);return{create(c){return c.values[o]=n(c),1},update(c,f){if(O&&f.docChanged||l&&(f.docChanged||f.selection)||$s(c,h)){let d=n(c);if(a?!WO(d,c.values[o],r):!r(d,c.values[o]))return c.values[o]=d,1}return 0},reconfigure:(c,f)=>{let d,$=f.config.address[s];if($!=null){let p=Ln(f,$);if(this.dependencies.every(m=>m instanceof Z?f.facet(m)===c.facet(m):m instanceof ge?f.field(m,!1)==c.field(m,!1):!0)||(a?WO(d=n(c),p,r):r(d=n(c),p)))return c.values[o]=p,0}else d=n(c);return c.values[o]=d,1}}}};function WO(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[O.id]),r=t.map(O=>O.type),s=n.filter(O=>!(O&1)),o=i[e.id]>>1;function a(O){let l=[];for(let h=0;hn===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Cn).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,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet(Cn),o=r.facet(Cn),a;return(a=s.find(O=>O.field==this))&&a!=o.find(O=>O.field==this)?(n.values[t]=a.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,Cn.of({field:this,create:e})]}get extension(){return this}},Dt={lowest:4,low:3,default:2,high:1,highest:0};function Ui(i){return e=>new En(e,i)}var nt={highest:Ui(Dt.highest),high:Ui(Dt.high),default:Ui(Dt.default),low:Ui(Dt.low),lowest:Ui(Dt.lowest)},En=class{constructor(e,t){this.inner=e,this.prec=t}},mt=class i{of(e){return new Ei(this,e)}reconfigure(e){return i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},Ei=class{constructor(e,t){this.compartment=e,this.inner=t}},Gn=class i{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of Jd(e,t,o))f instanceof ge?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let a=Object.create(null),O=[],l=[];for(let f of r)a[f.id]=l.length<<1,l.push(d=>f.slot(d));let h=n?.config.facets;for(let f in s){let d=s[f],$=d[0].facet,p=h&&h[f]||[];if(d.every(m=>m.type==0))if(a[$.id]=O.length<<1|1,ws(p,d))O.push(n.facet($));else{let m=$.combine(d.map(Q=>Q.value));O.push(n&&$.compare(m,n.facet($))?n.facet($):m)}else{for(let m of d)m.type==0?(a[m.id]=O.length<<1|1,O.push(m.value)):(a[m.id]=l.length<<1,l.push(Q=>m.dynamicSlot(Q)));a[$.id]=l.length<<1,l.push(m=>Kd(m,$,d))}}let c=l.map(f=>f(a));return new i(e,o,c,a,O,s)}};function Jd(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,a){let O=r.get(o);if(O!=null){if(O<=a)return;let l=n[O].indexOf(o);l>-1&&n[O].splice(l,1),o instanceof Ei&&t.delete(o.compartment)}if(r.set(o,a),Array.isArray(o))for(let l of o)s(l,a);else if(o instanceof Ei){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let l=e.get(o.compartment)||o.inner;t.set(o.compartment,l),s(l,a)}else if(o instanceof En)s(o.inner,o.prec);else if(o instanceof ge)n[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof $i)n[a].push(o),o.facet.extensions&&s(o.facet.extensions,Dt.default);else{let l=o.extension;if(!l)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(l,a)}}return s(i,Dt.default),n.reduce((o,a)=>o.concat(a))}function Mi(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Ln(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var jO=Z.define(),ps=Z.define({combine:i=>i.some(e=>e),static:!0}),BO=Z.define({combine:i=>i.length?i[0]:void 0,static:!0}),DO=Z.define(),IO=Z.define(),NO=Z.define(),FO=Z.define({combine:i=>i.length?i[0]:!1}),be=class{constructor(e,t){this.type=e,this.value=t}static define(){return new ms}},ms=class{of(e){return new be(this,e)}},Qs=class{constructor(e){this.map=e}of(e){return new B(this,e)}},B=class i{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 i(this.type,t)}is(e){return this.type==e}static define(e={}){return new Qs(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}};B.reconfigure=B.define();B.appendConfig=B.define();var ne=class i{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&LO(n,t.newLength),s.some(a=>a.type==i.time)||(this.annotations=s.concat(i.time.of(Date.now())))}static create(e,t,n,r,s,o){return new i(e,t,n,r,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(i.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};ne.time=be.define();ne.userEvent=be.define();ne.addToHistory=be.define();ne.remote=be.define();function e$(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n=i[n]))s=i[n++],o=i[n++];else if(r=0;r--){let s=n[r](i);s instanceof ne?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ne?i=s[0]:i=KO(e,pi(s),!1)}return i}function i$(i){let e=i.startState,t=e.facet(NO),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=HO(n,gs(e,s,i.changes.newLength),!0))}return n==i?i:ne.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}var n$=[];function pi(i){return i==null?n$:Array.isArray(i)?i:[i]}var We=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(We||(We={})),r$=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ss;try{Ss=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function s$(i){if(Ss)return Ss.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||r$.test(t)))return!0}return!1}function o$(i){return e=>{if(!/\S/.test(e))return We.Space;if(s$(e))return We.Word;for(let t=0;t-1)return We.Word;return We.Other}}var D=class i{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;ar.set(l,O)),t=null),r.set(a.value.compartment,a.value.extension)):a.is(B.reconfigure)?(t=null,n=a.value):a.is(B.appendConfig)&&(t=null,n=pi(n).concat(a.value));let s;t?s=e.startState.values.slice():(t=Gn.resolve(n,r,this),s=new i(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(O,l)=>l.reconfigure(O,this),null).values);let o=e.startState.facet(ps)?e.newSelection:e.newSelection.asSingle();new i(t,e.newDoc,o,s,(a,O)=>O.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:S.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=pi(n.effects);for(let a=1;ao.spec.fromJSON(a,O)))}}return i.create({doc:e.doc,selection:S.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Gn.resolve(e.extensions||[],new Map),n=e.doc instanceof q?e.doc:q.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||fs)),r=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return LO(r,n.length),t.staticFacet(ps)||(r=r.asSingle()),new i(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(i.tabSize)}get lineBreak(){return this.facet(i.lineSeparator)||` +`}get readOnly(){return this.facet(FO)}phrase(e,...t){for(let n of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(jO))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return o$(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let O=le(t,o,!1);if(s(t.slice(O,o))!=We.Word)break;o=O}for(;ai.length?i[0]:4});D.lineSeparator=BO;D.readOnly=FO;D.phrases=Z.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});D.languageData=jO;D.changeFilter=DO;D.transactionFilter=IO;D.transactionExtender=NO;mt.reconfigure=B.define();function Xt(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[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 r in e)n[r]===void 0&&(n[r]=e[r]);return n}var Ie=class{eq(e){return this==e}range(e,t=e){return Gi.create(e,t,this)}};Ie.prototype.startSide=Ie.prototype.endSide=0;Ie.prototype.point=!1;Ie.prototype.mapMode=Oe.TrackDel;var Gi=class i{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new i(e,t,n)}};function Ps(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var ys=class i{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,a=s.length;;){if(o==a)return o;let O=o+a>>1,l=s[O]-e||(n?this.value[O].endSide:this.value[O].startSide)-t;if(O==o)return l>=0?o:a;l>=0?a=O:o=O+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);sd||f==d&&l.startSide>0&&l.endSide<=0)continue;(d-f||l.endSide-l.startSide)<0||(o<0&&(o=f),l.point&&(a=Math.max(a,d-f)),n.push(l),r.push(f-o),s.push(d-o))}return{mapped:n.length?new i(r,s,n,a):null,pos:o}}},H=class i{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new i(e,t,n,r)}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:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(Ps)),this.isEmpty)return t.length?i.of(t):this;let a=new jn(this,null,-1).goto(0),O=0,l=[],h=new Ht;for(;a.value||O=0){let c=t[O++];h.addInner(c.from,c.to,c.value)||l.push(c)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=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 Li.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Li.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),a=t.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),O=UO(o,a,n),l=new It(o,O,s),h=new It(a,O,s);n.iterGaps((c,f,d)=>MO(l,c,h,f,d,r)),n.empty&&n.length==0&&MO(l,0,h,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=UO(s,o),O=new It(s,a,0).goto(n),l=new It(o,a,0).goto(n);for(;;){if(O.to!=l.to||!Ts(O.active,l.active)||O.point&&(!l.point||!O.point.eq(l.point)))return!1;if(O.to>r)return!0;O.next(),l.next()}}static spans(e,t,n,r,s=-1){let o=new It(e,null,s).goto(t),a=t,O=o.openStart;for(;;){let l=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),c=o.pointFroma&&(r.span(a,l,o.active,O),O=o.openEnd(l));if(o.to>n)return O+(o.point&&o.to>n?1:0);a=o.to,o.next()}}static of(e,t=!1){let n=new Ht;for(let r of e instanceof Gi?[e]:t?a$(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return i.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=i.empty;r=r.nextLayer)t=new i(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}};H.empty=new H([],[],null,-1);function a$(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(Ps);e=n}return i}H.empty.nextLayer=H.empty;var Ht=class i{finishChunk(e){this.chunks.push(new ys(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 i)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!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(H.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=H.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function UO(i,e,t){let n=new Map;for(let s of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&r.push(new jn(o,t,n,s));return r.length==1?r[0]:new i(r)}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--)hs(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--)hs(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(),hs(this.heap,0)}}};function hs(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}var It=class{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=Li.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){qn(this.active,e),qn(this.activeTo,e),qn(this.activeRank,e),this.minActive=EO(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t0;)t++;An(this.active,t,n),An(this.activeTo,t,r),An(this.activeRank,t,s),e&&An(e,t,this.cursor.from),this.minActive=EO(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&qn(n,r)}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=0&&n[r]=0&&!(this.activeRank[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 MO(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,a=n,O=n-e;for(;;){let l=i.to+O-t.to,h=l||i.endSide-t.endSide,c=h<0?i.to+O:t.to,f=Math.min(c,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&Ts(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(a,f,i.point,t.point):f>a&&!Ts(i.active,t.active)&&s.compareRange(a,f,i.active,t.active),c>o)break;(l||i.openEnd!=t.openEnd)&&s.boundChange&&s.boundChange(c),a=c,h<=0&&i.next(),h>=0&&t.next()}}function Ts(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;n--)i[n+1]=i[n];i[e]=t}function EO(i,e){let t=-1,n=1e9;for(let r=0;r=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=le(i,r)}return n===!0?-1:i.length}var JO=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),Xs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),el=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Ue=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,O,l){let h=[],c=/^@(\w+)\b/.exec(o[0]),f=c&&c[1]=="keyframes";if(c&&a==null)return O.push(o[0]+";");for(let d in a){let $=a[d];if(/&/.test(d))s(d.split(/,\s*/).map(p=>o.map(m=>p.replace(/&/,m))).reduce((p,m)=>p.concat(m)),$,O);else if($&&typeof $=="object"){if(!c)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),$,h,f)}else $!=null&&h.push(d.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+$+";")}(h.length||f)&&O.push((n&&!c&&!l?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=el[JO]||1;return el[JO]=e+1,"\u037C"+e.toString(36)}static mount(e,t,n){let r=e[Xs],s=n&&n.nonce;r?s&&r.setNonce(s):r=new vs(e,s),r.mount(Array.isArray(t)?t:[t],e)}},tl=new Map,vs=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=tl.get(n);if(s)return e[Xs]=s;this.sheet=new r.CSSStyleSheet,tl.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Xs]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(O,1),s--,O=-1),O==-1){if(this.modules.splice(s++,0,a),n)for(let l=0;l",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},O$=typeof navigator<"u"&&/Mac/.test(navigator.platform),l$=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(re=0;re<10;re++)Qt[48+re]=Qt[96+re]=String(re);var re;for(re=1;re<=24;re++)Qt[re+111]="F"+re;var re;for(re=65;re<=90;re++)Qt[re]=String.fromCharCode(re+32),Qi[re]=String.fromCharCode(re);var re;for(Dn in Qt)Qi.hasOwnProperty(Dn)||(Qi[Dn]=Qt[Dn]);var Dn;function il(i){var e=O$&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||l$&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Qi:Qt)[i.keyCode]||i.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 tn(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function zs(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function ir(i,e){if(!e.anchorNode)return!1;try{return zs(i,e.anchorNode)}catch{return!1}}function nn(i){return i.nodeType==3?ei(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function Ni(i,e,t,n){return t?nl(i,e,t,n,-1)||nl(i,e,t,n,1):!1}function Jt(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function lr(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function nl(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:Ot(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=Jt(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?Ot(i):0}else return!1}}function Ot(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function yr(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function h$(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function Wl(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function c$(i,e,t,n,r,s,o,a){let O=i.ownerDocument,l=O.defaultView||window;for(let h=i,c=!1;h&&!c;)if(h.nodeType==1){let f,d=h==O.body,$=1,p=1;if(d)f=h$(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(c=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let g=h.getBoundingClientRect();({scaleX:$,scaleY:p}=Wl(h,g)),f={left:g.left,right:g.left+h.clientWidth*$,top:g.top,bottom:g.top+h.clientHeight*p}}let m=0,Q=0;if(r=="nearest")e.top0&&e.bottom>f.bottom+Q&&(Q=e.bottom-f.bottom+o)):e.bottom>f.bottom&&(Q=e.bottom-f.bottom+o,t<0&&e.top-Q0&&e.right>f.right+m&&(m=e.right-f.right+s)):e.right>f.right&&(m=e.right-f.right+s,t<0&&e.leftf.bottom||e.leftf.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function f$(i){let e=i.ownerDocument,t,n;for(let r=i.parentNode;r&&!(r==e.body||t&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:n}}var Cs=class{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?Ot(t):0),n,Math.min(e.focusOffset,n?Ot(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},gi=null;function Ul(i){if(i.setActive)return i.setActive();if(gi)return i.focus(gi);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(gi==null?{get preventScroll(){return gi={preventScroll:!0},!0}}:void 0),!gi){gi=!1;for(let t=0;tMath.max(1,i.scrollHeight-i.clientHeight-4)}function Gl(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Ot(t)}else if(t.parentNode&&!lr(t))n=Jt(t),t=t.parentNode;else return null}}function Ll(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&nt)return c.domBoundsAround(e,t,l);if(f>=e&&r==-1&&(r=O,s=l),l>t&&c.dom.parentNode==this.dom){o=O,a=h;break}h=f,l=f+c.breakAfter}return{from:s,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}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=Qo){this.markDirty();for(let r=e;rthis.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 jl(i,e,t,n,r,s,o,a,O){let{children:l}=i,h=l.length?l[e]:null,c=s.length?s[s.length-1]:null,f=c?c.breakAfter:o;if(!(e==n&&h&&!o&&!f&&s.length<2&&h.merge(t,r,s.length?c:null,t==0,a,O))){if(n0&&(!o&&s.length&&h.merge(t,h.length,s[0],!1,a,0)?h.breakAfter=s.shift().breakAfter:(t2),v={mac:Ol||/Mac/.test(ke.platform),windows:/Win/.test(ke.platform),linux:/Linux|X11/.test(ke.platform),ie:Tr,ie_version:Dl?qs.documentMode||6:Ws?+Ws[1]:As?+As[1]:0,gecko:ol,gecko_version:ol?+(/Firefox\/(\d+)/.exec(ke.userAgent)||[0,0])[1]:0,chrome:!!Rs,chrome_version:Rs?+Rs[1]:0,ios:Ol,android:/Android\b/.test(ke.userAgent),webkit:al,safari:Il,webkit_version:al?+(/\bAppleWebKit\/(\d+)/.exec(ke.userAgent)||[0,0])[1]:0,tabSize:qs.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"},$$=256,lt=class i extends K{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 i)||this.length-(t-e)+n.length>$$||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 i(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 Se(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 p$(this.dom,e,t)}},Zt=class i extends K{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let r of t)r.setParent(this)}setAttrs(e){if(Ml(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,r,s,o){return n&&(!(n instanceof i&&n.mark.eq(this.mark))||e&&s<=0||te&&t.push(n=e&&(r=s),n=O,s++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new i(this.mark,t,o)}domAtPos(e){return Nl(this,e)}coordsAt(e,t){return Hl(this,e,t)}};function p$(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?v.chrome||v.gecko||(e?(r--,o=1):s=0)?0:a.length-1];return v.safari&&!o&&O.width==0&&(O=Array.prototype.find.call(a,l=>l.width)||O),o?yr(O,o<0):O||null}var cr=class i extends K{static create(e,t,n){return new i(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=i.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,s,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&s<=0||t0)?Se.before(this.dom):Se.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 r=this.dom.getClientRects(),s=null;if(!r.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?r.length-1:0;s=r[a],!(e>0?a==0:a==r.length-1||s.top0?Se.before(this.dom):Se.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return q.empty}get isHidden(){return!0}};lt.prototype.children=cr.prototype.children=rn.prototype.children=Qo;function Nl(i,e){let t=i.dom,{children:n}=i,r=0;for(let s=0;rs&&e0;s--){let o=n[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=r;s0&&e instanceof Zt&&r.length&&(n=r[r.length-1])instanceof Zt&&n.mark.eq(e.mark)?Fl(n,e.children[0],t-1):(r.push(e),e.setParent(i)),i.length+=e.length}function Hl(i,e,t){let n=null,r=-1,s=null,o=-1;function a(l,h){for(let c=0,f=0;c=h&&(d.children.length?a(d,h-f):(!s||s.isHidden&&(t>0||Q$(s,d)))&&($>h||f==$&&d.getSide()>0)?(s=d,o=h-f):(f-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function Ms(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function g$(i){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Yt(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=Kl(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new Yt(e,n,r,t,e.widget||null,!0)}static line(e){return new on(e)}static set(e,t=!1){return H.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};U.none=H.empty;var sn=class i extends U{constructor(e){let{start:t,end:n}=Kl(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 i&&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))&&fr(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)}};sn.prototype.point=!1;var on=class i extends U{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof i&&this.spec.class==e.spec.class&&fr(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)}};on.prototype.mapMode=Oe.TrackBefore;on.prototype.point=!0;var Yt=class i extends U{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?Oe.TrackBefore:Oe.TrackAfter:Oe.TrackDel}get type(){return this.startSide!=this.endSide?Pe.WidgetRange:this.startSide<=0?Pe.WidgetBefore:Pe.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&S$(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)}};Yt.prototype.point=!0;function Kl(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function S$(i,e){return i==e||!!(i&&e&&i.compare(e))}function nr(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}var he=class i extends K{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,s,o){if(n){if(!(n instanceof i))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),Bl(this,e,t,n?n.children.slice():[],s,o),!0}split(e){let t=new i;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let s=n;s0&&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){fr(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Fl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Us(t,this.attrs||{})),n&&(this.attrs=Us({class:n},this.attrs||{}))}domAtPos(e){return Nl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(Ml(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&&(Ms(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&K.get(r)instanceof Zt;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=K.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!v.ios||!this.children.some(s=>s instanceof lt))){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 lt)||/[^ -~]/.test(n.text))return null;let r=nn(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Hl(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight=t){if(s instanceof i)return s;if(o>t)break}r=o+s.breakAfter}return null}},Kt=class i extends K{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,s,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&s<=0||t0}},an=class extends Vt{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},Fi=class i{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,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 Kt&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new he),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(In(new rn(-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 Kt)&&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 r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(In(new lt(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Yt){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 Yt)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Kt(n.widget||_t.block,a,n));else{let O=cr.create(n.widget||_t.inline,a,a?0:n.startSide),l=this.atCursorPos&&!O.isEditable&&s<=r.length&&(e0),h=!O.isEditable&&(er.length||n.startSide<=0),c=this.getLine();this.pendingBuffer==2&&!l&&!O.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),l&&(c.append(In(new rn(1),r),s),s=r.length+Math.max(0,s-r.length)),c.append(In(O,r),s),this.atCursorPos=h,this.pendingBuffer=h?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.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,r,s){let o=new i(e,t,n,s);return o.openEnd=H.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function In(i,e){for(let t of e)i=new Zt(t,[i],i.length);return i}var _t=class extends Vt{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}};_t.inline=new _t("span");_t.block=new _t("div");var te=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(te||(te={})),ti=te.LTR,go=te.RTL;function Jl(i){let e=[];for(let t=0;t=t){if(a.level==n)return o;(s<0||(r!=0?r<0?a.fromt:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function th(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;p-=3)if(rt[p+1]==-d){let m=rt[p+2],Q=m&2?r:m&4?m&1?s:r:0;Q&&(N[c]=N[rt[p]]=Q),a=p;break}}else{if(rt.length==189)break;rt[a++]=c,rt[a++]=f,rt[a++]=O}else if(($=N[c])==2||$==1){let p=$==r;O=p?0:1;for(let m=a-3;m>=0;m-=3){let Q=rt[m+2];if(Q&2)break;if(p)rt[m+2]|=2;else{if(Q&4)break;rt[m+2]|=4}}}}}function k$(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,a=rO;)$==m&&($=t[--p].from,m=p?t[p-1].to:i),N[--$]=d;O=h}else s=l,O++}}}function Gs(i,e,t,n,r,s,o){let a=n%2?2:1;if(n%2==r%2)for(let O=e,l=0;OO&&o.push(new ot(O,p.from,d));let m=p.direction==ti!=!(d%2);Ls(i,m?n+1:n,r,p.inner,p.from,p.to,o),O=p.to}$=p.to}else{if($==t||(h?N[$]!=a:N[$]==a))break;$++}f?Gs(i,O,$,n+1,r,f,o):O<$&&o.push(new ot(O,$,d)),O=$}else for(let O=t,l=s.length;O>e;){let h=!0,c=!1;if(!l||O>s[l-1].to){let p=N[O-1];p!=a&&(h=!1,c=p==16)}let f=!h&&a==1?[]:null,d=h?n:n+1,$=O;e:for(;;)if(l&&$==s[l-1].to){if(c)break e;let p=s[--l];if(!h)for(let m=p.from,Q=l;;){if(m==e)break e;if(Q&&s[Q-1].to==m)m=s[--Q].from;else{if(N[m-1]==a)break e;break}}if(f)f.push(p);else{p.toN.length;)N[N.length]=256;let n=[],r=e==ti?0:1;return Ls(i,r,r,t,0,i.length,n),n}function ih(i){return[new ot(0,i,0)]}var nh="";function X$(i,e,t,n,r){var s;let o=n.head-i.from,a=ot.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),O=e[a],l=O.side(r,t);if(o==l){let f=a+=r?1:-1;if(f<0||f>=e.length)return null;O=e[a=f],o=O.side(!r,t),l=O.side(r,t)}let h=le(i.text,o,O.forward(r,t));(hO.to)&&(h=l),nh=i.text.slice(Math.min(o,h),Math.max(o,h));let c=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return c&&h==l&&c.level+(r?0:1)i.some(e=>e)}),ch=R.define({combine:i=>i.some(e=>e)}),fh=R.define(),Hi=class i{constructor(e,t="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new i(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new i(S.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Nn=B.define({map:(i,e)=>i.map(e)}),uh=B.define();function Ee(i,e,t){let n=i.facet(ah);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))}var gt=R.define({combine:i=>i.length?i[0]:!0}),R$=0,Si=R.define({combine(i){return i.filter((e,t)=>{for(let n=0;n{let O=[];return o&&O.push(On.of(l=>{let h=l.plugin(a);return h?o(h):U.none})),s&&O.push(s(a)),O})}static fromClass(e,t){return i.define((n,r)=>new e(n,r),t)}},Ki=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}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(Ee(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.plugin.create(e,this.spec.arg)}catch(t){Ee(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){Ee(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},dh=R.define(),yo=R.define(),On=R.define(),$h=R.define(),To=R.define(),ph=R.define();function hl(i,e){let t=i.state.facet(ph);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return H.spans(n,e.from,e.to,{point(){},span(s,o,a,O){let l=s-e.from,h=o-e.from,c=r;for(let f=a.length-1;f>=0;f--,O--){let d=a[f].spec.bidiIsolate,$;if(d==null&&(d=v$(e.text,l,h)),O>0&&c.length&&($=c[c.length-1]).to==l&&$.direction==d)$.to=h,c=$.inner;else{let p={from:l,to:h,direction:d,inner:[]};c.push(p),c=p.inner}}}}),r}var mh=R.define();function Qh(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(mh)){let o=s(i);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&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}var ji=R.define(),at=class i{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new i(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 r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAh)break;s+=2}if(!O)return n;new i(O.fromA,O.toA,O.fromB,O.toB).addToSet(n),o=O.toA,a=O.toB}}},ur=class i{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Qe.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,a,O)=>r.push(new at(s,o,a,O))),this.changedRanges=r}static create(e,t,n){return new i(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>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}},dr=class extends K{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=U.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new he],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new at(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:l,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!q$(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?V$(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:l,to:h}=this.hasComposition;n=new at(l,h,e.changes.mapPos(l,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(v.ie||v.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),O=z$(o,a,e.changes);return n=at.extendWithRanges(n,O),!(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:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=v.chrome||v.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||r.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=0?r[o]:null;if(!a)break;let{fromA:O,toA:l,fromB:h,toB:c}=a,f,d,$,p;if(n&&n.range.fromBh){let x=Fi.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),P=Fi.build(this.view.state.doc,n.range.toB,c,this.decorations,this.dynamicDecorationMap);d=x.breakAtStart,$=x.openStart,p=P.openEnd;let w=this.compositionView(n);P.breakAtStart?w.breakAfter=1:P.content.length&&w.merge(w.length,w.length,P.content[0],!1,P.openStart,0)&&(w.breakAfter=P.content[0].breakAfter,P.content.shift()),x.content.length&&w.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),f=x.content.concat(w).concat(P.content)}else({content:f,breakAtStart:d,openStart:$,openEnd:p}=Fi.build(this.view.state.doc,h,c,this.decorations,this.dynamicDecorationMap));let{i:m,off:Q}=s.findPos(l,1),{i:g,off:T}=s.findPos(O,-1);jl(this,g,T,m,Q,f,d,$,p)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(uh)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new lt(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new Zt(r,[t],t.length);let n=new he;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(O=>O.flags&7)?1:0),this.markedForComposition.add(o);let a=K.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)n=r.childPos(n.off,1),r=r.children[n.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,s=!r&&!(this.view.state.facet(gt)||this.dom.tabIndex>-1)&&ir(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,O=this.moveToLine(this.domAtPos(a.anchor)),l=a.empty?O:this.moveToLine(this.domAtPos(a.head));if(v.gecko&&a.empty&&!this.hasComposition&&Z$(O)){let c=document.createTextNode("");this.view.observer.ignore(()=>O.node.insertBefore(c,O.node.childNodes[O.offset]||null)),O=l=new Se(c,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!Ni(O.node,O.offset,h.anchorNode,h.anchorOffset)||!Ni(l.node,l.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,a))&&(this.view.observer.ignore(()=>{v.android&&v.chrome&&this.dom.contains(h.focusNode)&&C$(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let c=tn(this.view.root);if(c)if(a.empty){if(v.gecko){let f=Y$(O.node,O.offset);if(f&&f!=3){let d=(f==1?Gl:Ll)(O.node,O.offset);d&&(O=new Se(d.node,d.offset))}}c.collapse(O.node,O.offset),a.bidiLevel!=null&&c.caretBidiLevel!==void 0&&(c.caretBidiLevel=a.bidiLevel)}else if(c.extend){c.collapse(O.node,O.offset);try{c.extend(l.node,l.offset)}catch{}}else{let f=document.createRange();a.anchor>a.head&&([O,l]=[l,O]),f.setEnd(l.node,l.offset),f.setStart(O.node,O.offset),c.removeAllRanges(),c.addRange(f)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(O,l)),this.impreciseAnchor=O.precise?null:new Se(h.anchorNode,h.anchorOffset),this.impreciseHead=l.precise?null:new Se(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ni(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=tn(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=he.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let O=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!O||!l||O.bottom>l.top)return;let h=this.domAtPos(t.head+t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(r,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r=0;r--){let s=K.get(t.childNodes[r]);s instanceof he&&(n=s.domAtPos(s.length))}return n?new Se(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=K.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=0;o--){let a=this.children[o],O=s-a.breakAfter,l=O-a.length;if(Oe||a.covers(1))&&(!n||a instanceof he&&!(n instanceof he&&t>=0)))n=a,r=l;else if(n&&l==e&&O==e&&a instanceof Kt&&Math.abs(t)<2){if(a.deco.startSide<0)break;o&&(n=null)}s=l}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof he))return null;for(;r.children.length;){let{i:a,off:O}=r.childPos(n,1);for(;;a++){if(a==r.children.length)return null;if((r=r.children[a]).length)break}n=O}if(!(r instanceof lt))return null;let s=le(r.text,n);if(s==n)return null;let o=ei(r.dom,n,s).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,O=this.view.textDirection==te.LTR;for(let l=0,h=0;hr)break;if(l>=n){let d=c.dom.getBoundingClientRect();if(t.push(d.height),o){let $=c.dom.lastChild,p=$?nn($):[];if(p.length){let m=p[p.length-1],Q=O?m.right-d.left:d.right-m.left;Q>a&&(a=Q,this.minWidth=s,this.minWidthFrom=l,this.minWidthTo=f)}}}l=f+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?te.RTL:te.LTR}measureTextSize(){for(let s of this.children)if(s instanceof he){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,r;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=nn(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new hr(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],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(U.replace({widget:new an(a),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return U.set(e)}updateDeco(){let e=1,t=this.view.state.facet(On).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet($h).map((s,o)=>{let a=typeof s=="function";return a&&(n=!0),a?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(H.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=Qh(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:a,offsetHeight:O}=this.view.scrollDOM;c$(this.view.scrollDOM,o,t.head{ne.from&&(t=!0)}),t}function A$(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return S.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,a=s;t<0?o=le(r.text,s,!1):a=le(r.text,s);let O=n(r.text.slice(o,a));for(;o>0;){let l=le(r.text,o,!1);if(n(r.text.slice(l,o))!=O)break;o=l}for(;ai?e.left-i:Math.max(0,i-e.right)}function U$(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function Zs(i,e){return i.tope.top+1}function cl(i,e){return ei.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function Bs(i,e,t){let n,r,s,o,a=!1,O,l,h,c;for(let $=i.firstChild;$;$=$.nextSibling){let p=nn($);for(let m=0;mT||o==T&&s>g)&&(n=$,r=Q,s=g,o=T,a=g?e0:mQ.bottom&&(!h||h.bottomQ.top)&&(l=$,c=Q):h&&Zs(h,Q)?h=fl(h,Q.bottom):c&&Zs(c,Q)&&(c=cl(c,Q.top))}}if(h&&h.bottom>=t?(n=O,r=h):c&&c.top<=t&&(n=l,r=c),!n)return{node:i,offset:0};let f=Math.max(r.left,Math.min(r.right,e));if(n.nodeType==3)return ul(n,f,t);if(a&&n.contentEditable!="false")return Bs(n,f,t);let d=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(r.left+r.right)/2?1:0);return{node:i,offset:d}}function ul(i,e,t){let n=i.nodeValue.length,r=-1,s=1e9,o=0;for(let a=0;at?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&c=(h.left+h.right)/2,d=f;if((v.chrome||v.gecko)&&ei(i,a).getBoundingClientRect().left==h.right&&(d=!f),c<=0)return{node:i,offset:a+(d?1:0)};r=a+(d?1:0),s=c}}}return{node:i,offset:r>-1?r:o>0?i.nodeValue.length:0}}function Sh(i,e,t,n=-1){var r,s;let o=i.contentDOM.getBoundingClientRect(),a=o.top+i.viewState.paddingTop,O,{docHeight:l}=i.viewState,{x:h,y:c}=e,f=c-a;if(f<0)return 0;if(f>l)return i.state.doc.length;for(let x=i.viewState.heightOracle.textHeight/2,P=!1;O=i.elementAtHeight(f),O.type!=Pe.Text;)for(;f=n>0?O.bottom+x:O.top-x,!(f>=0&&f<=l);){if(P)return t?null:0;P=!0,n=-n}c=a+f;let d=O.from;if(di.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:dl(i,o,O,h,c);let $=i.dom.ownerDocument,p=i.root.elementFromPoint?i.root:$,m=p.elementFromPoint(h,c);m&&!i.contentDOM.contains(m)&&(m=null),m||(h=Math.max(o.left+1,Math.min(o.right-1,h)),m=p.elementFromPoint(h,c),m&&!i.contentDOM.contains(m)&&(m=null));let Q,g=-1;if(m&&((r=i.docView.nearest(m))===null||r===void 0?void 0:r.isEditable)!=!1){if($.caretPositionFromPoint){let x=$.caretPositionFromPoint(h,c);x&&({offsetNode:Q,offset:g}=x)}else if($.caretRangeFromPoint){let x=$.caretRangeFromPoint(h,c);x&&({startContainer:Q,startOffset:g}=x,(!i.contentDOM.contains(Q)||v.safari&&M$(Q,g,h)||v.chrome&&E$(Q,g,h))&&(Q=void 0))}Q&&(g=Math.min(Ot(Q),g))}if(!Q||!i.docView.dom.contains(Q)){let x=he.find(i.docView,d);if(!x)return f>O.top+O.height/2?O.to:O.from;({node:Q,offset:g}=Bs(x.dom,h,c))}let T=i.docView.nearest(Q);if(!T)return null;if(T.isWidget&&((s=T.dom)===null||s===void 0?void 0:s.nodeType)==1){let x=T.dom.getBoundingClientRect();return e.yi.defaultLineHeight*1.5){let a=i.viewState.heightOracle.textHeight,O=Math.floor((r-t.top-(i.defaultLineHeight-a)*.5)/a);s+=O*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+Bn(o,s,i.state.tabSize)}function M$(i,e,t){let n,r=i;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(;;){let s=r.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let o=r.parentNode;if(!o||o.nodeName=="DIV")break;r=o}}return ei(i,n-1,n).getBoundingClientRect().right>t}function E$(i,e,t){if(e!=0)return!1;for(let r=i;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let n=i.nodeType==1?i.getBoundingClientRect():ei(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Ds(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.toe)return s;(!r||s.type==Pe.Text&&(r.type!=s.type||(t<0?s.frome)))&&(r=s)}}return r||n}return n}function G$(i,e,t,n){let r=Ds(i,e.head,e.assoc||-1),s=!n||r.type!=Pe.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),a=i.textDirectionAt(r.from),O=i.posAtCoords({x:t==(a==te.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(O!=null)return S.cursor(O,t?-1:1)}return S.cursor(t?r.to:r.from,t?-1:1)}function $l(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let a=e,O=null;;){let l=X$(r,s,o,a,t),h=nh;if(!l){if(r.number==(t?i.state.doc.lines:1))return a;h=` +`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var Qt={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:"'"},Qi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},O$=typeof navigator<"u"&&/Mac/.test(navigator.platform),l$=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(re=0;re<10;re++)Qt[48+re]=Qt[96+re]=String(re);var re;for(re=1;re<=24;re++)Qt[re+111]="F"+re;var re;for(re=65;re<=90;re++)Qt[re]=String.fromCharCode(re+32),Qi[re]=String.fromCharCode(re);var re;for(Dn in Qt)Qi.hasOwnProperty(Dn)||(Qi[Dn]=Qt[Dn]);var Dn;function il(i){var e=O$&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||l$&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Qi:Qt)[i.keyCode]||i.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 tn(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function zs(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function ir(i,e){if(!e.anchorNode)return!1;try{return zs(i,e.anchorNode)}catch{return!1}}function nn(i){return i.nodeType==3?ei(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function Ni(i,e,t,n){return t?nl(i,e,t,n,-1)||nl(i,e,t,n,1):!1}function Jt(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function lr(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function nl(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:Ot(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=Jt(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?Ot(i):0}else return!1}}function Ot(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function yr(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function h$(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function Wl(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function c$(i,e,t,n,r,s,o,a){let O=i.ownerDocument,l=O.defaultView||window;for(let h=i,c=!1;h&&!c;)if(h.nodeType==1){let f,d=h==O.body,$=1,p=1;if(d)f=h$(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(c=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let g=h.getBoundingClientRect();({scaleX:$,scaleY:p}=Wl(h,g)),f={left:g.left,right:g.left+h.clientWidth*$,top:g.top,bottom:g.top+h.clientHeight*p}}let m=0,Q=0;if(r=="nearest")e.top0&&e.bottom>f.bottom+Q&&(Q=e.bottom-f.bottom+o)):e.bottom>f.bottom&&(Q=e.bottom-f.bottom+o,t<0&&e.top-Q0&&e.right>f.right+m&&(m=e.right-f.right+s)):e.right>f.right&&(m=e.right-f.right+s,t<0&&e.leftf.bottom||e.leftf.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function f$(i){let e=i.ownerDocument,t,n;for(let r=i.parentNode;r&&!(r==e.body||t&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:n}}var Cs=class{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?Ot(t):0),n,Math.min(e.focusOffset,n?Ot(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},gi=null;function Ul(i){if(i.setActive)return i.setActive();if(gi)return i.focus(gi);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(gi==null?{get preventScroll(){return gi={preventScroll:!0},!0}}:void 0),!gi){gi=!1;for(let t=0;tMath.max(1,i.scrollHeight-i.clientHeight-4)}function Gl(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Ot(t)}else if(t.parentNode&&!lr(t))n=Jt(t),t=t.parentNode;else return null}}function Ll(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&nt)return c.domBoundsAround(e,t,l);if(f>=e&&r==-1&&(r=O,s=l),l>t&&c.dom.parentNode==this.dom){o=O,a=h;break}h=f,l=f+c.breakAfter}return{from:s,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}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=Qo){this.markDirty();for(let r=e;rthis.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 jl(i,e,t,n,r,s,o,a,O){let{children:l}=i,h=l.length?l[e]:null,c=s.length?s[s.length-1]:null,f=c?c.breakAfter:o;if(!(e==n&&h&&!o&&!f&&s.length<2&&h.merge(t,r,s.length?c:null,t==0,a,O))){if(n0&&(!o&&s.length&&h.merge(t,h.length,s[0],!1,a,0)?h.breakAfter=s.shift().breakAfter:(t2),v={mac:Ol||/Mac/.test(ke.platform),windows:/Win/.test(ke.platform),linux:/Linux|X11/.test(ke.platform),ie:Tr,ie_version:Dl?qs.documentMode||6:Ws?+Ws[1]:As?+As[1]:0,gecko:ol,gecko_version:ol?+(/Firefox\/(\d+)/.exec(ke.userAgent)||[0,0])[1]:0,chrome:!!Rs,chrome_version:Rs?+Rs[1]:0,ios:Ol,android:/Android\b/.test(ke.userAgent),webkit:al,safari:Il,webkit_version:al?+(/\bAppleWebKit\/(\d+)/.exec(ke.userAgent)||[0,0])[1]:0,tabSize:qs.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"},$$=256,lt=class i extends K{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 i)||this.length-(t-e)+n.length>$$||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 i(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 Se(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 p$(this.dom,e,t)}},Zt=class i extends K{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let r of t)r.setParent(this)}setAttrs(e){if(Ml(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,r,s,o){return n&&(!(n instanceof i&&n.mark.eq(this.mark))||e&&s<=0||te&&t.push(n=e&&(r=s),n=O,s++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new i(this.mark,t,o)}domAtPos(e){return Nl(this,e)}coordsAt(e,t){return Hl(this,e,t)}};function p$(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?v.chrome||v.gecko||(e?(r--,o=1):s=0)?0:a.length-1];return v.safari&&!o&&O.width==0&&(O=Array.prototype.find.call(a,l=>l.width)||O),o?yr(O,o<0):O||null}var cr=class i extends K{static create(e,t,n){return new i(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=i.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,s,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&s<=0||t0)?Se.before(this.dom):Se.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 r=this.dom.getClientRects(),s=null;if(!r.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?r.length-1:0;s=r[a],!(e>0?a==0:a==r.length-1||s.top0?Se.before(this.dom):Se.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return q.empty}get isHidden(){return!0}};lt.prototype.children=cr.prototype.children=rn.prototype.children=Qo;function Nl(i,e){let t=i.dom,{children:n}=i,r=0;for(let s=0;rs&&e0;s--){let o=n[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=r;s0&&e instanceof Zt&&r.length&&(n=r[r.length-1])instanceof Zt&&n.mark.eq(e.mark)?Fl(n,e.children[0],t-1):(r.push(e),e.setParent(i)),i.length+=e.length}function Hl(i,e,t){let n=null,r=-1,s=null,o=-1;function a(l,h){for(let c=0,f=0;c=h&&(d.children.length?a(d,h-f):(!s||s.isHidden&&(t>0||Q$(s,d)))&&($>h||f==$&&d.getSide()>0)?(s=d,o=h-f):(f-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function Ms(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function g$(i){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Yt(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=Kl(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new Yt(e,n,r,t,e.widget||null,!0)}static line(e){return new on(e)}static set(e,t=!1){return H.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};U.none=H.empty;var sn=class i extends U{constructor(e){let{start:t,end:n}=Kl(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 i&&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))&&fr(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)}};sn.prototype.point=!1;var on=class i extends U{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof i&&this.spec.class==e.spec.class&&fr(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)}};on.prototype.mapMode=Oe.TrackBefore;on.prototype.point=!0;var Yt=class i extends U{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?Oe.TrackBefore:Oe.TrackAfter:Oe.TrackDel}get type(){return this.startSide!=this.endSide?Pe.WidgetRange:this.startSide<=0?Pe.WidgetBefore:Pe.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&S$(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)}};Yt.prototype.point=!0;function Kl(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function S$(i,e){return i==e||!!(i&&e&&i.compare(e))}function nr(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}var he=class i extends K{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,s,o){if(n){if(!(n instanceof i))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),Bl(this,e,t,n?n.children.slice():[],s,o),!0}split(e){let t=new i;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let s=n;s0&&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){fr(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Fl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Us(t,this.attrs||{})),n&&(this.attrs=Us({class:n},this.attrs||{}))}domAtPos(e){return Nl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(Ml(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&&(Ms(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&K.get(r)instanceof Zt;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=K.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!v.ios||!this.children.some(s=>s instanceof lt))){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 lt)||/[^ -~]/.test(n.text))return null;let r=nn(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Hl(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight=t){if(s instanceof i)return s;if(o>t)break}r=o+s.breakAfter}return null}},Kt=class i extends K{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,s,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&s<=0||t0}},an=class extends Vt{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},Fi=class i{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,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 Kt&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new he),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(In(new rn(-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 Kt)&&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 r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(In(new lt(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Yt){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 Yt)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Kt(n.widget||_t.block,a,n));else{let O=cr.create(n.widget||_t.inline,a,a?0:n.startSide),l=this.atCursorPos&&!O.isEditable&&s<=r.length&&(e0),h=!O.isEditable&&(er.length||n.startSide<=0),c=this.getLine();this.pendingBuffer==2&&!l&&!O.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),l&&(c.append(In(new rn(1),r),s),s=r.length+Math.max(0,s-r.length)),c.append(In(O,r),s),this.atCursorPos=h,this.pendingBuffer=h?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.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,r,s){let o=new i(e,t,n,s);return o.openEnd=H.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function In(i,e){for(let t of e)i=new Zt(t,[i],i.length);return i}var _t=class extends Vt{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}};_t.inline=new _t("span");_t.block=new _t("div");var te=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(te||(te={})),ti=te.LTR,go=te.RTL;function Jl(i){let e=[];for(let t=0;t=t){if(a.level==n)return o;(s<0||(r!=0?r<0?a.fromt:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function th(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;p-=3)if(rt[p+1]==-d){let m=rt[p+2],Q=m&2?r:m&4?m&1?s:r:0;Q&&(N[c]=N[rt[p]]=Q),a=p;break}}else{if(rt.length==189)break;rt[a++]=c,rt[a++]=f,rt[a++]=O}else if(($=N[c])==2||$==1){let p=$==r;O=p?0:1;for(let m=a-3;m>=0;m-=3){let Q=rt[m+2];if(Q&2)break;if(p)rt[m+2]|=2;else{if(Q&4)break;rt[m+2]|=4}}}}}function k$(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,a=rO;)$==m&&($=t[--p].from,m=p?t[p-1].to:i),N[--$]=d;O=h}else s=l,O++}}}function Gs(i,e,t,n,r,s,o){let a=n%2?2:1;if(n%2==r%2)for(let O=e,l=0;OO&&o.push(new ot(O,p.from,d));let m=p.direction==ti!=!(d%2);Ls(i,m?n+1:n,r,p.inner,p.from,p.to,o),O=p.to}$=p.to}else{if($==t||(h?N[$]!=a:N[$]==a))break;$++}f?Gs(i,O,$,n+1,r,f,o):O<$&&o.push(new ot(O,$,d)),O=$}else for(let O=t,l=s.length;O>e;){let h=!0,c=!1;if(!l||O>s[l-1].to){let p=N[O-1];p!=a&&(h=!1,c=p==16)}let f=!h&&a==1?[]:null,d=h?n:n+1,$=O;e:for(;;)if(l&&$==s[l-1].to){if(c)break e;let p=s[--l];if(!h)for(let m=p.from,Q=l;;){if(m==e)break e;if(Q&&s[Q-1].to==m)m=s[--Q].from;else{if(N[m-1]==a)break e;break}}if(f)f.push(p);else{p.toN.length;)N[N.length]=256;let n=[],r=e==ti?0:1;return Ls(i,r,r,t,0,i.length,n),n}function ih(i){return[new ot(0,i,0)]}var nh="";function X$(i,e,t,n,r){var s;let o=n.head-i.from,a=ot.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),O=e[a],l=O.side(r,t);if(o==l){let f=a+=r?1:-1;if(f<0||f>=e.length)return null;O=e[a=f],o=O.side(!r,t),l=O.side(r,t)}let h=le(i.text,o,O.forward(r,t));(hO.to)&&(h=l),nh=i.text.slice(Math.min(o,h),Math.max(o,h));let c=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return c&&h==l&&c.level+(r?0:1)i.some(e=>e)}),ch=Z.define({combine:i=>i.some(e=>e)}),fh=Z.define(),Hi=class i{constructor(e,t="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new i(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new i(S.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Nn=B.define({map:(i,e)=>i.map(e)}),uh=B.define();function Ee(i,e,t){let n=i.facet(ah);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))}var gt=Z.define({combine:i=>i.length?i[0]:!0}),R$=0,Si=Z.define({combine(i){return i.filter((e,t)=>{for(let n=0;n{let O=[];return o&&O.push(On.of(l=>{let h=l.plugin(a);return h?o(h):U.none})),s&&O.push(s(a)),O})}static fromClass(e,t){return i.define((n,r)=>new e(n,r),t)}},Ki=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}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(Ee(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.plugin.create(e,this.spec.arg)}catch(t){Ee(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){Ee(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},dh=Z.define(),yo=Z.define(),On=Z.define(),$h=Z.define(),To=Z.define(),ph=Z.define();function hl(i,e){let t=i.state.facet(ph);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return H.spans(n,e.from,e.to,{point(){},span(s,o,a,O){let l=s-e.from,h=o-e.from,c=r;for(let f=a.length-1;f>=0;f--,O--){let d=a[f].spec.bidiIsolate,$;if(d==null&&(d=v$(e.text,l,h)),O>0&&c.length&&($=c[c.length-1]).to==l&&$.direction==d)$.to=h,c=$.inner;else{let p={from:l,to:h,direction:d,inner:[]};c.push(p),c=p.inner}}}}),r}var mh=Z.define();function Qh(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(mh)){let o=s(i);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&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}var ji=Z.define(),at=class i{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new i(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 r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAh)break;s+=2}if(!O)return n;new i(O.fromA,O.toA,O.fromB,O.toB).addToSet(n),o=O.toA,a=O.toB}}},ur=class i{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Qe.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,a,O)=>r.push(new at(s,o,a,O))),this.changedRanges=r}static create(e,t,n){return new i(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>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}},dr=class extends K{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=U.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new he],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new at(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:l,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!q$(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?V$(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:l,to:h}=this.hasComposition;n=new at(l,h,e.changes.mapPos(l,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(v.ie||v.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),O=z$(o,a,e.changes);return n=at.extendWithRanges(n,O),!(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:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=v.chrome||v.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||r.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=0?r[o]:null;if(!a)break;let{fromA:O,toA:l,fromB:h,toB:c}=a,f,d,$,p;if(n&&n.range.fromBh){let x=Fi.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),P=Fi.build(this.view.state.doc,n.range.toB,c,this.decorations,this.dynamicDecorationMap);d=x.breakAtStart,$=x.openStart,p=P.openEnd;let w=this.compositionView(n);P.breakAtStart?w.breakAfter=1:P.content.length&&w.merge(w.length,w.length,P.content[0],!1,P.openStart,0)&&(w.breakAfter=P.content[0].breakAfter,P.content.shift()),x.content.length&&w.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),f=x.content.concat(w).concat(P.content)}else({content:f,breakAtStart:d,openStart:$,openEnd:p}=Fi.build(this.view.state.doc,h,c,this.decorations,this.dynamicDecorationMap));let{i:m,off:Q}=s.findPos(l,1),{i:g,off:T}=s.findPos(O,-1);jl(this,g,T,m,Q,f,d,$,p)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(uh)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new lt(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new Zt(r,[t],t.length);let n=new he;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(O=>O.flags&7)?1:0),this.markedForComposition.add(o);let a=K.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)n=r.childPos(n.off,1),r=r.children[n.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,s=!r&&!(this.view.state.facet(gt)||this.dom.tabIndex>-1)&&ir(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,O=this.moveToLine(this.domAtPos(a.anchor)),l=a.empty?O:this.moveToLine(this.domAtPos(a.head));if(v.gecko&&a.empty&&!this.hasComposition&&Z$(O)){let c=document.createTextNode("");this.view.observer.ignore(()=>O.node.insertBefore(c,O.node.childNodes[O.offset]||null)),O=l=new Se(c,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!Ni(O.node,O.offset,h.anchorNode,h.anchorOffset)||!Ni(l.node,l.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,a))&&(this.view.observer.ignore(()=>{v.android&&v.chrome&&this.dom.contains(h.focusNode)&&C$(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let c=tn(this.view.root);if(c)if(a.empty){if(v.gecko){let f=Y$(O.node,O.offset);if(f&&f!=3){let d=(f==1?Gl:Ll)(O.node,O.offset);d&&(O=new Se(d.node,d.offset))}}c.collapse(O.node,O.offset),a.bidiLevel!=null&&c.caretBidiLevel!==void 0&&(c.caretBidiLevel=a.bidiLevel)}else if(c.extend){c.collapse(O.node,O.offset);try{c.extend(l.node,l.offset)}catch{}}else{let f=document.createRange();a.anchor>a.head&&([O,l]=[l,O]),f.setEnd(l.node,l.offset),f.setStart(O.node,O.offset),c.removeAllRanges(),c.addRange(f)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(O,l)),this.impreciseAnchor=O.precise?null:new Se(h.anchorNode,h.anchorOffset),this.impreciseHead=l.precise?null:new Se(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ni(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=tn(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=he.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let O=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!O||!l||O.bottom>l.top)return;let h=this.domAtPos(t.head+t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(r,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r=0;r--){let s=K.get(t.childNodes[r]);s instanceof he&&(n=s.domAtPos(s.length))}return n?new Se(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=K.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=0;o--){let a=this.children[o],O=s-a.breakAfter,l=O-a.length;if(Oe||a.covers(1))&&(!n||a instanceof he&&!(n instanceof he&&t>=0)))n=a,r=l;else if(n&&l==e&&O==e&&a instanceof Kt&&Math.abs(t)<2){if(a.deco.startSide<0)break;o&&(n=null)}s=l}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof he))return null;for(;r.children.length;){let{i:a,off:O}=r.childPos(n,1);for(;;a++){if(a==r.children.length)return null;if((r=r.children[a]).length)break}n=O}if(!(r instanceof lt))return null;let s=le(r.text,n);if(s==n)return null;let o=ei(r.dom,n,s).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,O=this.view.textDirection==te.LTR;for(let l=0,h=0;hr)break;if(l>=n){let d=c.dom.getBoundingClientRect();if(t.push(d.height),o){let $=c.dom.lastChild,p=$?nn($):[];if(p.length){let m=p[p.length-1],Q=O?m.right-d.left:d.right-m.left;Q>a&&(a=Q,this.minWidth=s,this.minWidthFrom=l,this.minWidthTo=f)}}}l=f+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?te.RTL:te.LTR}measureTextSize(){for(let s of this.children)if(s instanceof he){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,r;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=nn(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new hr(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],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(U.replace({widget:new an(a),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return U.set(e)}updateDeco(){let e=1,t=this.view.state.facet(On).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet($h).map((s,o)=>{let a=typeof s=="function";return a&&(n=!0),a?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(H.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=Qh(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:a,offsetHeight:O}=this.view.scrollDOM;c$(this.view.scrollDOM,o,t.head{ne.from&&(t=!0)}),t}function A$(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return S.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,a=s;t<0?o=le(r.text,s,!1):a=le(r.text,s);let O=n(r.text.slice(o,a));for(;o>0;){let l=le(r.text,o,!1);if(n(r.text.slice(l,o))!=O)break;o=l}for(;ai?e.left-i:Math.max(0,i-e.right)}function U$(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function Zs(i,e){return i.tope.top+1}function cl(i,e){return ei.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function Bs(i,e,t){let n,r,s,o,a=!1,O,l,h,c;for(let $=i.firstChild;$;$=$.nextSibling){let p=nn($);for(let m=0;mT||o==T&&s>g)&&(n=$,r=Q,s=g,o=T,a=g?e0:mQ.bottom&&(!h||h.bottomQ.top)&&(l=$,c=Q):h&&Zs(h,Q)?h=fl(h,Q.bottom):c&&Zs(c,Q)&&(c=cl(c,Q.top))}}if(h&&h.bottom>=t?(n=O,r=h):c&&c.top<=t&&(n=l,r=c),!n)return{node:i,offset:0};let f=Math.max(r.left,Math.min(r.right,e));if(n.nodeType==3)return ul(n,f,t);if(a&&n.contentEditable!="false")return Bs(n,f,t);let d=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(r.left+r.right)/2?1:0);return{node:i,offset:d}}function ul(i,e,t){let n=i.nodeValue.length,r=-1,s=1e9,o=0;for(let a=0;at?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&c=(h.left+h.right)/2,d=f;if((v.chrome||v.gecko)&&ei(i,a).getBoundingClientRect().left==h.right&&(d=!f),c<=0)return{node:i,offset:a+(d?1:0)};r=a+(d?1:0),s=c}}}return{node:i,offset:r>-1?r:o>0?i.nodeValue.length:0}}function Sh(i,e,t,n=-1){var r,s;let o=i.contentDOM.getBoundingClientRect(),a=o.top+i.viewState.paddingTop,O,{docHeight:l}=i.viewState,{x:h,y:c}=e,f=c-a;if(f<0)return 0;if(f>l)return i.state.doc.length;for(let x=i.viewState.heightOracle.textHeight/2,P=!1;O=i.elementAtHeight(f),O.type!=Pe.Text;)for(;f=n>0?O.bottom+x:O.top-x,!(f>=0&&f<=l);){if(P)return t?null:0;P=!0,n=-n}c=a+f;let d=O.from;if(di.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:dl(i,o,O,h,c);let $=i.dom.ownerDocument,p=i.root.elementFromPoint?i.root:$,m=p.elementFromPoint(h,c);m&&!i.contentDOM.contains(m)&&(m=null),m||(h=Math.max(o.left+1,Math.min(o.right-1,h)),m=p.elementFromPoint(h,c),m&&!i.contentDOM.contains(m)&&(m=null));let Q,g=-1;if(m&&((r=i.docView.nearest(m))===null||r===void 0?void 0:r.isEditable)!=!1){if($.caretPositionFromPoint){let x=$.caretPositionFromPoint(h,c);x&&({offsetNode:Q,offset:g}=x)}else if($.caretRangeFromPoint){let x=$.caretRangeFromPoint(h,c);x&&({startContainer:Q,startOffset:g}=x,(!i.contentDOM.contains(Q)||v.safari&&M$(Q,g,h)||v.chrome&&E$(Q,g,h))&&(Q=void 0))}Q&&(g=Math.min(Ot(Q),g))}if(!Q||!i.docView.dom.contains(Q)){let x=he.find(i.docView,d);if(!x)return f>O.top+O.height/2?O.to:O.from;({node:Q,offset:g}=Bs(x.dom,h,c))}let T=i.docView.nearest(Q);if(!T)return null;if(T.isWidget&&((s=T.dom)===null||s===void 0?void 0:s.nodeType)==1){let x=T.dom.getBoundingClientRect();return e.yi.defaultLineHeight*1.5){let a=i.viewState.heightOracle.textHeight,O=Math.floor((r-t.top-(i.defaultLineHeight-a)*.5)/a);s+=O*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+Bn(o,s,i.state.tabSize)}function M$(i,e,t){let n,r=i;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(;;){let s=r.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let o=r.parentNode;if(!o||o.nodeName=="DIV")break;r=o}}return ei(i,n-1,n).getBoundingClientRect().right>t}function E$(i,e,t){if(e!=0)return!1;for(let r=i;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let n=i.nodeType==1?i.getBoundingClientRect():ei(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Ds(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.toe)return s;(!r||s.type==Pe.Text&&(r.type!=s.type||(t<0?s.frome)))&&(r=s)}}return r||n}return n}function G$(i,e,t,n){let r=Ds(i,e.head,e.assoc||-1),s=!n||r.type!=Pe.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),a=i.textDirectionAt(r.from),O=i.posAtCoords({x:t==(a==te.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(O!=null)return S.cursor(O,t?-1:1)}return S.cursor(t?r.to:r.from,t?-1:1)}function $l(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let a=e,O=null;;){let l=X$(r,s,o,a,t),h=nh;if(!l){if(r.number==(t?i.state.doc.lines:1))return a;h=` `,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),l=i.visualLineSide(r,!t)}if(O){if(!O(h))return a}else{if(!n)return l;O=n(h)}a=l}}function L$(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==We.Space&&(r=o),r==o}}function j$(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return S.cursor(r,e.assoc);let o=e.goalColumn,a,O=i.contentDOM.getBoundingClientRect(),l=i.coordsAtPos(r,e.assoc||-1),h=i.documentTop;if(l)o==null&&(o=l.left-O.left),a=s<0?l.top:l.bottom;else{let d=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(O.right-O.left,i.defaultCharacterWidth*(r-d.from))),a=(s<0?d.top:d.bottom)+h}let c=O.left+o,f=n??i.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let $=a+(f+d)*s,p=Sh(i,{x:c,y:$},!1,s);if($O.bottom||(s<0?pr)){let m=i.docView.coordsForChar(p),Q=!m||${if(e>s&&er(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:S.cursor(n,ns)&&this.lineBreak(),r=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,r=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=r.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 O of this.points)O.node==e&&O.pos>this.text.length&&(O.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let t=K.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.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+(B$(e,n.node,n.offset)?t:0))}};function B$(i,e,t){for(;;){if(!e||t-1;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?[]:N$(e),O=new Is(a,e.state);O.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=O.text,this.newSel=F$(a,this.bounds.from)}else{let a=e.observer.selectionRange,O=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!zs(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),l=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!zs(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),h=e.viewport;if((v.ios||v.chrome)&&e.state.selection.main.empty&&O!=l&&(h.from>0||h.toDate.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,O=r.from,l=null;(s===8||v.android&&e.text.length=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,r.to))}:v.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` - `&&i.lineWrapping&&(n&&(n=S.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:q.of([" "])}),t)return bo(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,a="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),a=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:a}),!0}else return!1}function bo(i,e,t,n=-1){if(v.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(v.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ti(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.lengthr.head)&&Ti(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Ti(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=D$(i,e,t));return i.state.facet(Oh).some(O=>O(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function D$(i,e,t){let n,r=i.state,s=r.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)&&i.inputState.composing<0){let a=s.frome.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(a+e.insert.sliceString(0,void 0,i.state.lineBreak)+O))}else{let a=r.changes(e),O=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let l=i.state.sliceDoc(e.from,e.to),h,c=t&&gh(i,t.main.head);if(c){let $=e.insert.length-(e.to-e.from);h={from:c.from,to:c.to-$}}else h=i.state.doc.lineAt(s.head);let f=s.to-e.to,d=s.to-s.from;n=r.changeByRange($=>{if($.from==s.from&&$.to==s.to)return{changes:a,range:O||$.map(a)};let p=$.to-f,m=p-l.length;if($.to-$.from!=d||i.state.sliceDoc(m,p)!=l||$.to>=h.from&&$.from<=h.to)return{range:$};let Q=r.changes({from:m,to:p,insert:e.insert}),g=$.to-s.to;return{changes:Q,range:O?S.range(Math.max(0,O.anchor+g),Math.max(0,O.head+g)):$.map(Q)}})}else n={changes:a,selection:O&&r.selection.replaceRange(O)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function I$(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(n=="end"){let O=Math.max(0,s-Math.min(o,a));t-=o+O-s}if(o=o?s-t:0;s-=O,a=s+(a-o),o=s}else if(a=a?s-t:0;s-=O,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function N$(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new $r(t,n)),(r!=t||s!=n)&&e.push(new $r(r,s))),e}function F$(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?S.single(t+e,n+e):null}var Fs=class{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.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=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.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,v.safari&&e.contentDOM.addEventListener("input",()=>null),v.gecko&&cp(e.contentDOM.ownerDocument)}handleEvent(e){!np(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=H$(e),n=this.handlers,r=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&&(r.removeEventListener(s,this.handleEvent),a=null),a||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Th.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),v.android&&v.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return v.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=yh.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||K$.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:v.safari&&!v.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.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function pl(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){Ee(t.state,r)}}}function H$(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let a in s){let O=s[a];O&&t(a).handlers.push(pl(n.value,O))}if(o)for(let a in o){let O=o[a];O&&t(a).observers.push(pl(n.value,O))}}for(let n in Ne)t(n).handlers.push(Ne[n]);for(let n in Le)t(n).observers.push(Le[n]);return e}var yh=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],K$="dthko",Th=[16,17,18,20,91,92,224,225],Fn=6;function Hn(i){return Math.max(0,i)*.7+8}function J$(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var Hs=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=f$(e.contentDOM),this.atoms=e.state.facet(To).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(D.allowMultipleSelections)&&ep(e,t),this.dragging=ip(e,t)&&kh(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&J$(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let O=Qh(this.view);e.clientX-O.left<=r+Fn?t=-Hn(r-e.clientX):e.clientX+O.right>=o-Fn&&(t=Hn(e.clientX-o)),e.clientY-O.top<=s+Fn?n=-Hn(s-e.clientY):e.clientY+O.bottom>=a-Fn&&(n=Hn(e.clientY-a)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function ep(i,e){let t=i.state.facet(rh);return t.length?t[0](e):v.mac?e.metaKey:e.ctrlKey}function tp(i,e){let t=i.state.facet(sh);return t.length?t[0](e):v.mac?!e.altKey:!e.ctrlKey}function ip(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=tn(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function np(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=K.get(t))&&n.ignoreEvent(e))return!1;return!0}var Ne=Object.create(null),Le=Object.create(null),bh=v.ie&&v.ie_version<15||v.ios&&v.webkit_version<604;function rp(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),xh(i,t.value)},50)}function br(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function xh(i,e){e=br(i.state,So,e);let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(Ks!=null&&t.selection.ranges.every(O=>O.empty)&&Ks==s.toString()){let O=-1;n=t.changeByRange(l=>{let h=t.doc.lineAt(l.from);if(h.from==O)return{range:l};O=h.from;let c=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:c},range:S.cursor(l.from+c.length)}})}else o?n=t.changeByRange(O=>{let l=s.line(r++);return{changes:{from:O.from,to:O.to,insert:l.text},range:S.cursor(O.from+l.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Le.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};Ne.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);Le.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};Le.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};Ne.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(oh))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=ap(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new Hs(i,e,t,n)),n&&i.observer.ignore(()=>{Ul(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function ml(i,e,t,n){if(n==1)return S.cursor(e,t);if(n==2)return A$(i.state,e,t);{let r=he.find(i.docView,e),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,a=r?r.posAtEnd:s.to;return ae>=t.top&&e<=t.bottom&&i>=t.left&&i<=t.right;function sp(i,e,t,n){let r=he.find(i.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&Ql(t,n,o))return-1;let a=r.coordsAt(s,1);return a&&Ql(t,n,a)?1:o&&o.bottom>=n?-1:1}function gl(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:sp(i,t,e.clientX,e.clientY)}}var op=v.ie&&v.ie_version<=11,Sl=null,Pl=0,yl=0;function kh(i){if(!op)return i.detail;let e=Sl,t=yl;return Sl=i,yl=Date.now(),Pl=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(Pl+1)%3:1}function ap(i,e){let t=gl(i,e),n=kh(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,a){let O=gl(i,s),l,h=ml(i,O.pos,O.bias,n);if(t.pos!=O.pos&&!o){let c=ml(i,t.pos,t.bias,n),f=Math.min(c.from,h.from),d=Math.max(c.to,h.to);h=f1&&(l=Op(r,O.pos))?l:a?r.addRange(h):S.create([h])}}}function Op(i,e){for(let t=0;t=e)return S.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}Ne.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=S.range(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",br(i.state,Po,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ne.dragend=i=>(i.inputState.draggedContent=null,!1);function Tl(i,e,t,n){if(t=br(i.state,So,t),!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&tp(i,e)?{from:s.from,to:s.to}:null,a={from:r,insert:t},O=i.state.changes(o?[o,a]:a);i.focus(),i.dispatch({changes:O,selection:{anchor:O.mapPos(r,-1),head:O.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}Ne.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&Tl(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\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 Tl(i,e,n,!0),!0}return!1};Ne.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=bh?null:e.clipboardData;return t?(xh(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(rp(i),!1)};function lp(i,e){let t=i.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(),i.focus()},50)}function hp(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:br(i,Po,e.join(i.lineBreak)),ranges:t,linewise:n}}var Ks=null;Ne.copy=Ne.cut=(i,e)=>{let{text:t,ranges:n,linewise:r}=hp(i.state);if(!t&&!r)return!1;Ks=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=bh?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(lp(i,t),!1)};var wh=be.define();function Xh(i,e){let t=[];for(let n of i.facet(lh)){let r=n(i,e);r&&t.push(r)}return t.length?i.update({effects:t,annotations:wh.of(!0)}):null}function vh(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=Xh(i.state,e);t?i.dispatch(t):i.update([])}},10)}Le.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),vh(i)};Le.blur=i=>{i.observer.clearSelectionRange(),vh(i)};Le.compositionstart=Le.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};Le.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,v.chrome&&v.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};Le.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};Ne.beforeinput=(i,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&i.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],O=i.posAtDOM(a.startContainer,a.startOffset),l=i.posAtDOM(a.endContainer,a.endOffset);return bo(i,{from:O,to:l,insert:i.state.toText(s)},null),!0}}let r;if(v.chrome&&v.android&&(r=yh.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return v.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),v.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Le.compositionend(i,e),20),!1};var bl=new Set;function cp(i){bl.has(i)||(bl.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var xl=["pre-wrap","normal","pre-line","break-spaces"],bi=!1;function kl(){bi=!1}var Js=class{constructor(e){this.lineWrapping=e,this.doc=q.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}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)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return xl.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,O=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,O){this.heightSamples={};for(let l=0;l0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>sr&&(bi=!0),this.height=e)}replace(e,t,n){return i.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let a=r.length-1;a>=0;a--){let{fromA:O,toA:l,fromB:h,toB:c}=r[a],f=s.lineAt(O,ee.ByPosNoHeight,n.setDoc(t),0,0),d=f.to>=l?f:s.lineAt(l,ee.ByPosNoHeight,n,0,0);for(c+=d.to-l,l=d.to;a>0&&f.from<=r[a-1].toA;)O=r[a-1].fromA,h=r[a-1].fromB,a--,Os*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,r-=a.size}else if(s>r*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(r=s&&o(this.blockAt(0,n,r,s))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},Me=class i extends mr{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new st(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof i||r instanceof Rt&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Rt?r=new i(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Ve.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(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:""})`}},Rt=class i extends Ve{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,a=0;if(e.lineWrapping){let O=Math.min(this.height,e.lineHeight*s);o=O/s,this.length>s+1&&(a=(this.height-O)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:a}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:a,perChar:O}=this.heightMetrics(t,r);if(t.lineWrapping){let l=r+(e0){let s=n[n.length-1];s instanceof i?n[n.length-1]=new i(s.length+r):n.push(null,new i(r-1))}if(e>0){let s=n[0];s instanceof i?n[0]=new i(e+s.length):n.unshift(new i(e-1),null)}return Ve.of(n)}decomposeLeft(e,t){t.push(new i(e-1),null)}decomposeRight(e,t){t.push(null,new i(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],a=Math.max(t,r.from),O=-1;for(r.from>t&&o.push(new i(r.from-t-1).updateHeight(e,t));a<=s&&r.more;){let h=e.doc.lineAt(a).length;o.length&&o.push(null);let c=r.heights[r.index++];O==-1?O=c:Math.abs(c-O)>=sr&&(O=-2);let f=new Me(h,c);f.outdated=!1,o.push(f),a+=h+1}a<=s&&o.push(null,new i(s-a).updateHeight(e,a));let l=Ve.of(o);return(O<0||Math.abs(l.height-this.height)>=sr||Math.abs(O-this.heightMetrics(e,t).perLine)>=sr)&&(bi=!0),pr(this,l)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},to=class extends Ve{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,r){let s=n+this.left.height;return ea))return l;let h=t==ee.ByPosNoHeight?ee.ByPosNoHeight:ee.ByPos;return O?l.join(this.right.lineAt(a,h,n,o,a)):this.left.lineAt(a,h,n,r,s).join(l)}forEachLine(e,t,n,r,s,o){let a=r+this.left.height,O=s+this.left.length+this.break;if(this.break)e=O&&this.right.forEachLine(e,t,n,a,O,o);else{let l=this.lineAt(O,ee.ByPos,n,r,s);e=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,a,O,o)}}replace(e,t,n){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of n)s.push(a);if(e>0&&wl(s,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Ve.of(this.break?[e,null,t]:[e,t]):(this.left=pr(this.left,e),this.right=pr(this.right,t),this.setHeight(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,r){let{left:s,right:o}=this,a=t+s.length+this.break,O=null;return r&&r.from<=t+s.length&&r.more?O=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?O=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),O?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 wl(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof Rt&&(n=i[e+1])instanceof Rt&&i.splice(e-1,3,new Rt(t.length+1+n.length))}var fp=5,io=class i{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),r=this.nodes[this.nodes.length-1];r instanceof Me?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Me(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=fp)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Me(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new Rt(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 Me)return e;let t=new Me(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 r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.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 Me)&&!this.isCovered?this.nodes.push(new Me(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&c.overflow!="visible"){let f=h.getBoundingClientRect();s=Math.max(s,f.left),o=Math.min(o,f.right),a=Math.max(a,f.top),O=Math.min(l==i.parentNode?r.innerHeight:O,f.bottom)}l=c.position=="absolute"||c.position=="fixed"?h.offsetParent:h.parentNode}else if(l.nodeType==11)l=l.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,O)-(t.top+e)}}function $p(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function pp(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var Ji=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new Js(t),this.stateDeco=e.facet(On).filter(n=>typeof n!="function"),this.heightMap=Ve.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle.setDoc(e.doc),[new at(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=U.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 r=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new Pi(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Xl:new so(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Di(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(On).filter(h=>typeof h!="function");let r=e.changedRanges,s=at.extendWithRanges(r,up(n,this.stateDeco,e?e.changes:Qe.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);kl(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||bi)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let O=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headO.to)||!this.viewportIsAppropriate(O))&&(O=this.getViewport(0,t));let l=O.from!=this.viewport.from||O.to!=this.viewport.to;this.viewport=O,e.flags|=this.updateForViewport(),(l||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(ch)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?te.RTL:te.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=t.getBoundingClientRect(),O=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let l=0,h=0;if(a.width&&a.height){let{scaleX:x,scaleY:P}=Wl(t,a);(x>.005&&Math.abs(this.scaleX-x)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=x,this.scaleY=P,l|=16,o=O=!0)}let c=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=c||this.paddingBottom!=f)&&(this.paddingTop=c,this.paddingBottom=f,l|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(O=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=16);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=El(e.scrollDOM);let $=(this.printing?pp:dp)(t,this.paddingTop),p=$.top-this.pixelViewport.top,m=$.bottom-this.pixelViewport.bottom;this.pixelViewport=$;let Q=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(Q!=this.inView&&(this.inView=Q,Q&&(O=!0)),!this.inView&&!this.scrollTarget&&!$p(e.dom))return 0;let g=a.width;if((this.contentDOMWidth!=g||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,l|=16),O){let x=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(x)&&(o=!0),o||r.lineWrapping&&Math.abs(g-this.contentDOMWidth)>r.charWidth){let{lineHeight:P,charWidth:w,textHeight:k}=e.docView.measureTextSize();o=P>0&&r.refresh(s,P,w,k,Math.max(5,g/w),x),o&&(e.docView.minWidth=0,l|=16)}p>0&&m>0?h=Math.max(p,m):p<0&&m<0&&(h=Math.min(p,m)),kl();for(let P of this.viewports){let w=P.from==this.viewport.from?x:e.docView.measureVisibleLineHeights(P);this.heightMap=(o?Ve.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle,[new at(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new eo(P.from,w))}bi&&(l|=2)}let T=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return T&&(l&2&&(l|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),l|=this.updateForViewport()),(l&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}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)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,O=new Pi(r.lineAt(o-n*1e3,ee.ByHeight,s,0,0).from,r.lineAt(a+(1-n)*1e3,ee.ByHeight,s,0,0).to);if(t){let{head:l}=t.range;if(lO.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=r.lineAt(l,ee.ByPos,s,0,0),f;t.y=="center"?f=(c.top+c.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&l=a+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=te.LTR&&!n)return[];let a=[],O=(h,c,f,d)=>{if(c-hh&&QQ.from>=f.from&&Q.to<=f.to&&Math.abs(Q.from-h)Q.fromg));if(!m){if(cT.from<=c&&T.to>=c)){let T=t.moveToLineBoundary(S.cursor(c),!1,!0).head;T>h&&(c=T)}let Q=this.gapSize(f,h,c,d),g=n||Q<2e6?Q:2e6;m=new Ji(h,c,Q,g)}a.push(m)},l=h=>{if(h.length2e6)for(let w of e)w.from>=h.from&&w.fromh.from&&O(h.from,d,h,c),$t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];H.spans(t,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Di(this.heightMap.lineAt(e,ee.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Di(this.heightMap.lineAt(this.scaler.fromDOM(e),ee.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 Di(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}},Pi=class{constructor(e,t){this.from=e,this.to=t}};function mp(i,e,t){let n=[],r=i,s=0;return H.spans(t,i,e,{span(){},point(o,a){o>r&&(n.push({from:r,to:o}),s+=o-r),r=a}},20),r=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],a=o-s;if(n<=a)return s+n;n-=a}}function Jn(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function Qp(i,e){for(let t of i)if(e(t))return t}var Xl={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}},so=class i{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:a,to:O})=>{let l=t.lineAt(a,ee.ByPos,e,0,0).top,h=t.lineAt(O,ee.ByPos,e,0,0).bottom;return r+=h-l,{from:a,to:O,top:l,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);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,r=0;;t++){let s=tt.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}};function Di(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new st(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>Di(r,e)):i._content)}var er=R.define({combine:i=>i.join(" ")}),oo=R.define({combine:i=>i.indexOf(!0)>-1}),ao=Ue.newName(),Rh=Ue.newName(),Zh=Ue.newName(),Vh={"&light":"."+Rh,"&dark":"."+Zh};function Oo(i,e,t){return new Ue(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}var gp=Oo("."+ao,{"&":{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,overflowAnchor:"none"},".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:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&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,zIndex:300},"&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-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".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",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Vh),Sp={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Ys=v.ie&&v.ie_version<=11,lo=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Cs,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(v.ie&&v.ie_version<=11||v.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()}),window.EditContext&&v.android&&e.constructor.EDIT_CONTEXT!==!1&&!(v.chrome&&v.chrome_version<126)&&(this.editContext=new ho(e),e.state.facet(gt)&&(e.contentDOM.editContext=this.editContext.editContext)),Ys&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,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,r=this.selectionRange;if(n.state.facet(gt)?n.root.activeElement!=this.dom:!ir(this.dom,r))return;let s=r.anchorNode&&n.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(v.ie&&v.ie_version<=11||v.android&&v.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Ni(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=tn(e.root);if(!t)return!1;let n=v.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Pp(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=ir(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Ti(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!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:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&ir(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Ns(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,r=Ph(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}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=vl(t,e.previousSibling||e.target.previousSibling,-1),r=vl(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(gt)!=e.state.facet(gt)&&(e.view.contentDOM.editContext=e.state.facet(gt)?this.editContext.editContext:null))}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 r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function vl(i,e,t){for(;e;){let n=K.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Rl(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return Ni(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function Pp(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return Rl(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?Rl(i,t):null}var ho=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:s,head:o}=r,a=this.toEditorPos(n.updateRangeStart),O=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:a,drifted:!1});let l={from:a,to:O,insert:q.of(n.text.split(` -`))};if(l.from==this.from&&sthis.to&&(l.to=s),l.from==l.to&&!l.insert.length){let h=S.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));h.main.eq(r)||e.dispatch({selection:h,userEvent:"select"});return}if((v.mac||v.android)&&l.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(l={from:a,to:O,insert:q.of([n.text.replace("."," ")])}),this.pendingContextChange=l,!e.state.readOnly){let h=this.to-this.from+(l.to-l.from+l.insert.length);bo(e,l,S.single(this.toEditorPos(n.selectionStart,h),this.toEditorPos(n.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);o{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(o!="None"&&a!="None"){let O=this.toEditorPos(s.rangeStart),l=this.toEditorPos(s.rangeEnd);if(O{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=tn(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,a,O,l)=>{if(n)return;let h=l.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(sthis.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),l.toString()),this.to+=h}t+=h}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},X=class i{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&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||u$(e.parent)||document,this.viewState=new Qr(e.state||D.create(e)),e.scrollTo&&e.scrollTo.is(Nn)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Si).map(r=>new Ki(r));for(let r of this.plugins)r.update(this);this.observer=new lo(this),this.inputState=new Fs(this),this.inputState.ensureHandlers(this.plugins),this.docView=new dr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof ne?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,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,O=null;e.some(f=>f.annotation(wh))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,O=Xh(s,o),O||(a=1));let l=this.observer.delayedAndroidKey,h=null;if(l?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(D.phrases)!=this.state.facet(D.phrases))return this.setState(s);r=ur.create(this,s,e),r.flags|=a;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(c&&(c=c.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection;c=new Hi(d.empty?d:S.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of f.effects)d.is(Nn)&&(c=d.value.clip(this.state))}this.viewState.update(r,c),this.bidiCache=gr.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(ji)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(er)!=r.state.facet(er)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(js))try{f(r)}catch(d){Ee(this.state,d,"update listener")}(O||h)&&Promise.resolve().then(()=>{O&&this.state==O.startState&&this.dispatch(O),h&&!Ph(this,h)&&l.force&&Ti(this.contentDOM,l.key,l.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 Qr(e),this.plugins=e.facet(Si).map(n=>new Ki(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new dr(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(Si),n=e.state.facet(Si);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new Ki(s));else{let a=this.plugins[o];a.mustUpdate=e,r.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-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,r=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(El(n))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let O=this.viewState.measure(this);if(!O&&!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 l=[];O&4||([this.measureRequests,l]=[l,this.measureRequests]);let h=l.map(d=>{try{return d.read(this)}catch($){return Ee(this.state,$),Zl}}),c=ur.create(this,this.state,[]),f=!1;c.flags|=O,t?t.flags|=O:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),f=this.docView.update(c),f&&this.docViewUpdate());for(let d=0;d1||$<-1){r=r+$,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(js))a(t)}get themeClasses(){return ao+" "+(this.state.facet(oo)?Zh:Rh)+" "+this.state.facet(er)}updateAttrs(){let e=Vl(this,dh,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(gt)?"true":"false",class:"cm-content",style:`${v.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Vl(this,yo,t);let n=this.observer.ignore(()=>{let r=Ms(this.contentDOM,this.contentAttrs,t),s=Ms(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(ji);let e=this.state.facet(i.cspNonce);Ue.mount(this.root,this.styleModules.concat(gp).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;tn.plugin==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 Vs(this,e,$l(this,e,t,n))}moveByGroup(e,t){return Vs(this,e,$l(this,e,t,n=>L$(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return S.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return G$(this,e,t,n)}moveVertically(e,t,n){return Vs(this,e,j$(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(),Sh(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 r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[ot.find(s,e-r.from,-1,t)];return yr(n,o.dir==te.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(hh)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>yp)return ih(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||th(s.isolates,n=hl(this,e))))return s.order;n||(n=hl(this,e));let r=w$(e.text,t,n);return this.bidiCache.push(new gr(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||v.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ul(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(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Nn.of(new Hi(typeof e=="number"?S.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Nn.of(new Hi(S.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ge.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ge.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Ue.newName(),r=[er.of(n),ji.of(Oo(`.${n}`,e))];return t&&t.dark&&r.push(oo.of(!0)),r}static baseTheme(e){return nt.lowest(ji.of(Oo("."+ao,e,Vh)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&K.get(n)||K.get(e);return((t=r?.rootView)===null||t===void 0?void 0:t.view)||null}};X.styleModule=ji;X.inputHandler=Oh;X.clipboardInputFilter=So;X.clipboardOutputFilter=Po;X.scrollHandler=fh;X.focusChangeEffect=lh;X.perLineTextDirection=hh;X.exceptionSink=ah;X.updateListener=js;X.editable=gt;X.mouseSelectionStyle=oh;X.dragMovesSelection=sh;X.clickAddsSelectionRange=rh;X.decorations=On;X.outerDecorations=$h;X.atomicRanges=To;X.bidiIsolatedRanges=ph;X.scrollMargins=mh;X.darkTheme=oo;X.cspNonce=R.define({combine:i=>i.length?i[0]:""});X.contentAttributes=yo;X.editorAttributes=dh;X.lineWrapping=X.contentAttributes.of({class:"cm-lineWrapping"});X.announce=B.define();var yp=4096,Zl={},gr=class i{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:te.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&Us(o,t)}return t}var Tp=v.mac?"mac":v.windows?"win":v.linux?"linux":"key";function bp(i,e){let t=i.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,s,o,a;for(let O=0;On.concat(r),[]))),t}var vt=null,wp=4e3;function Xp(i,e=Tp){let t=Object.create(null),n=Object.create(null),r=(o,a)=>{let O=n[o];if(O==null)n[o]=a;else if(O!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,O,l,h)=>{var c,f;let d=t[o]||(t[o]=Object.create(null)),$=a.split(/ (?!$)/).map(Q=>bp(Q,e));for(let Q=1;Q<$.length;Q++){let g=$.slice(0,Q).join(" ");r(g,!0),d[g]||(d[g]={preventDefault:!0,stopPropagation:!1,run:[T=>{let x=vt={view:T,prefix:g,scope:o};return setTimeout(()=>{vt==x&&(vt=null)},wp),!0}]})}let p=$.join(" ");r(p,!1);let m=d[p]||(d[p]={preventDefault:!1,stopPropagation:!1,run:((f=(c=d._any)===null||c===void 0?void 0:c.run)===null||f===void 0?void 0:f.slice())||[]});O&&m.run.push(O),l&&(m.preventDefault=!0),h&&(m.stopPropagation=!0)};for(let o of i){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let l of a){let h=t[l]||(t[l]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:c}=o;for(let f in h)h[f].run.push(d=>c(d,co))}let O=o[e]||o.key;if(O)for(let l of a)s(l,O,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(l,"Shift-"+O,o.shift,o.preventDefault,o.stopPropagation)}return t}var co=null;function vp(i,e,t,n){co=e;let r=il(e),s=bs(r,0),o=xs(s)==r.length&&r!=" ",a="",O=!1,l=!1,h=!1;vt&&vt.view==t&&vt.scope==n&&(a=vt.prefix+" ",Th.indexOf(e.keyCode)<0&&(l=!0,vt=null));let c=new Set,f=m=>{if(m){for(let Q of m.run)if(!c.has(Q)&&(c.add(Q),Q(t)))return m.stopPropagation&&(h=!0),!0;m.preventDefault&&(m.stopPropagation&&(h=!0),l=!0)}return!1},d=i[n],$,p;return d&&(f(d[a+tr(r,e,!o)])?O=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(v.windows&&e.ctrlKey&&e.altKey)&&!(v.mac&&e.altKey&&!e.ctrlKey)&&($=Qt[e.keyCode])&&$!=r?(f(d[a+tr($,e,!0)])||e.shiftKey&&(p=Qi[e.keyCode])!=r&&p!=$&&f(d[a+tr(p,e,!1)]))&&(O=!0):o&&e.shiftKey&&f(d[a+tr(r,e,!0)])&&(O=!0),!O&&f(d._any)&&(O=!0)),l&&(O=!0),O&&h&&e.stopPropagation(),co=null,O}var ln=class i{constructor(e,t,n,r,s){this.className=e,this.left=t,this.top=n,this.width=r,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 r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=Yh(e);return[new i(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return Rp(e,t,n)}};function Yh(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==te.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function _l(i,e,t,n){let r=i.coordsAtPos(e,t*2);if(!r)return n;let s=i.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,a=i.posAtCoords({x:s.left+1,y:o}),O=i.posAtCoords({x:s.right-1,y:o});return a==null||O==null?n:{from:Math.max(n.from,Math.min(a,O)),to:Math.min(n.to,Math.max(a,O))}}function Rp(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),r=Math.min(t.to,i.viewport.to),s=i.textDirection==te.LTR,o=i.contentDOM,a=o.getBoundingClientRect(),O=Yh(i),l=o.querySelector(".cm-line"),h=l&&window.getComputedStyle(l),c=a.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),f=a.right-(h?parseInt(h.paddingRight):0),d=Ds(i,n,1),$=Ds(i,r,-1),p=d.type==Pe.Text?d:null,m=$.type==Pe.Text?$:null;if(p&&(i.lineWrapping||d.widgetLineBreaks)&&(p=_l(i,n,1,p)),m&&(i.lineWrapping||$.widgetLineBreaks)&&(m=_l(i,r,-1,m)),p&&m&&p.from==m.from&&p.to==m.to)return g(T(t.from,t.to,p));{let P=p?T(t.from,null,p):x(d,!1),w=m?T(null,t.to,m):x($,!0),k=[];return(p||d).to<(m||$).from-(p&&m?1:0)||d.widgetLineBreaks>1&&P.bottom+i.defaultLineHeight/2_&&E.from=me)break;qe>F&&C(Math.max(ae,F),P==null&&ae<=_,Math.min(qe,me),w==null&&qe>=j,tt.dir)}if(F=Re.to+1,F>=me)break}return I.length==0&&C(_,P==null,j,w==null,i.textDirection),{top:M,bottom:A,horizontal:I}}function x(P,w){let k=a.top+(w?P.top:P.bottom);return{top:k,bottom:k,horizontal:[]}}}function Zp(i,e){return i.constructor==e.constructor&&i.eq(e)}var fo=class{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(or)!=e.state.facet(or)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(or);for(;t!Zp(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},or=R.define();function _h(i){return[Ge.define(e=>new fo(e,i)),or.of(i)]}var hn=R.define({combine(i){return Xt(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function zh(i={}){return[hn.of(i),Vp,Yp,_p,ch.of(!0)]}function Ch(i){return i.startState.facet(hn)!=i.state.facet(hn)}var Vp=_h({above:!0,markers(i){let{state:e}=i,t=e.facet(hn),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=r.empty?r:S.cursor(r.head,r.head>r.anchor?-1:1);for(let O of ln.forRange(i,o,a))n.push(O)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Ch(i);return t&&zl(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){zl(e.state,i)},class:"cm-cursorLayer"});function zl(i,e){e.style.animationDuration=i.facet(hn).cursorBlinkRate+"ms"}var Yp=_h({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:ln.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||Ch(i)},class:"cm-selectionLayer"}),_p=nt.highest(X.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),qh=B.define({map(i,e){return i==null?null:e.mapPos(i)}}),Ii=ge.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(qh)?n.value:t,i)}}),zp=Ge.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(Ii);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"),(i.startState.field(Ii)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Ii),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(Ii)!=i&&this.view.dispatch({effects:qh.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Ah(){return[Ii,zp]}var iy=/x/.unicode!=null?"gu":"g";function xo(){return qp}var Cp=U.line({class:"cm-activeLine"}),qp=Ge.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let r=i.lineBlockAt(n.head);r.from>e&&(t.push(Cp.range(r.from)),e=r.from)}return U.set(t)}},{decorations:i=>i.decorations});var uo=2e3;function Ap(i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>uo||t.off>uo||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let O=n;O<=r;O++){let l=i.doc.line(O);l.length<=a&&s.push(S.range(l.from+o,l.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let O=n;O<=r;O++){let l=i.doc.line(O),h=Bn(l.text,o,i.tabSize,!0);if(h<0)s.push(S.cursor(l.to));else{let c=Bn(l.text,a,i.tabSize);s.push(S.range(l.from+h,l.from+c))}}}return s}function Wp(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function Cl(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),r=t-n.from,s=r>uo?-1:r==n.length?Wp(i,e.clientX):xe(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:s,off:r}}function Up(i,e){let t=Cl(i,e),n=i.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(r.changes)}},get(r,s,o){let a=Cl(i,r);if(!a)return n;let O=Ap(i.state,t,a);return O.length?o?S.create(O.concat(n.ranges)):S.create(O):n}}:null}function Wh(i){let e=i?.eventFilter||(t=>t.altKey&&t.button==0);return X.mouseSelectionStyle.of((t,n)=>e(n)?Up(t,n):null)}var Fe=class extends Ie{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Fe.prototype.elementClass="";Fe.prototype.toDOM=void 0;Fe.prototype.mapMode=Oe.TrackBefore;Fe.prototype.startSide=Fe.prototype.endSide=-1;Fe.prototype.point=!0;var ar=R.define(),Mp=R.define();var Or=R.define();var $o=R.define({combine:i=>i.some(e=>e)});function Ep(i){let e=[Gp];return i&&i.fixed===!1&&e.push($o.of(!0)),e}var Gp=Ge.fromClass(class{constructor(i){this.view=i,this.domAfter=null,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(Or).map(e=>new Sr(i,e)),this.fixed=!i.state.facet($o);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}if(i.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet($o)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=H.iter(this.view.state.facet(ar),this.view.viewport.from),n=[],r=this.gutters.map(s=>new mo(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==Pe.Text&&o){po(t,n,a.from);for(let O of r)O.line(this.view,a,n);o=!1}else if(a.widget)for(let O of r)O.widget(this.view,a)}else if(s.type==Pe.Text){po(t,n,s.from);for(let o of r)o.line(this.view,s,n)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();i&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(i){let e=i.startState.facet(Or),t=i.state.facet(Or),n=i.docChanged||i.heightChanged||i.viewportChanged||!H.eq(i.startState.facet(ar),i.state.facet(ar),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(i)&&(n=!0);else{n=!0;let r=[];for(let s of t){let o=e.indexOf(s);o<0?r.push(new Sr(this.view,s)):(this.gutters[o].update(i),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:i=>X.scrollMargins.of(e=>{let t=e.plugin(i);if(!t||t.gutters.length==0||!t.fixed)return null;let n=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==te.LTR?{left:n,right:r}:{right:n,left:r}})});function ql(i){return Array.isArray(i)?i:[i]}function po(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var mo=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=H.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let a=new Pr(e,o,s,n);r.elements.push(a),r.dom.appendChild(a.dom)}else r.elements[this.i].update(e,o,s,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];po(this.cursor,r,t.from),n.length&&(r=r.concat(n));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let s of e.state.facet(Mp)){let o=s(e,t.widget,t);o&&(r||(r=[])).push(o)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},Sr=class{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,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let O=s.getBoundingClientRect();o=(O.top+O.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,r)&&r.preventDefault()});this.markers=ql(t.markers(e)),t.initialSpacer&&(this.spacer=new Pr(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=ql(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!H.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()}},Pr=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),Lp(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let a=o,O=ss(a,O,l)||o(a,O,l):o}return n}})}}),en=class extends Fe{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function _s(i,e){return i.state.facet(yi).formatNumber(e,i.state)}var Dp=Or.compute([yi],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(jp)},lineMarker(e,t,n){return n.some(r=>r.toDOM)?null:new en(_s(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(Bp)){let s=r(e,t,n);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(yi)!=e.state.facet(yi),initialSpacer(e){return new en(_s(e,Al(e.state.doc.lines)))},updateSpacer(e,t){let n=_s(t.view,Al(t.view.state.doc.lines));return n==e.number?e:new en(n)},domEventHandlers:i.facet(yi).domEventHandlers,side:"before"}));function Uh(i={}){return[yi.of(i),Ep(),Dp]}function Al(i){let e=9;for(;e{let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.head).from;r>t&&(t=r,e.push(Ip.range(r)))}return H.of(e)});function ko(){return Np}async function Mh(i){if(window.isSecureContext&&navigator.clipboard){await navigator.clipboard.writeText(i);return}let e=document.createElement("textarea");e.setAttribute("style","position: absolute; left: -1000px; top: -1000px;"),e.value=i,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}var Fp=0,we=class{constructor(e,t){this.from=e,this.to=t}},Y=class{constructor(e={}){this.id=Fp++,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=ie.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Y.closedBy=new Y({deserialize:i=>i.split(" ")});Y.openedBy=new Y({deserialize:i=>i.split(" ")});Y.group=new Y({deserialize:i=>i.split(" ")});Y.isolate=new Y({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});Y.contextHash=new Y({perNode:!0});Y.lookAhead=new Y({perNode:!0});Y.mounted=new Y({perNode:!0});var ii=class{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Y.mounted.id]}},Hp=Object.create(null),ie=class i{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Hp,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new i(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),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 r}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(Y.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 r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(Y.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}};ie.none=new ie("",Object.create(null),0,8);var St=class i{constructor(e){this.types=e;for(let t=0;t0;for(let O=this.cursor(o|G.IncludeAnonymous);;){let l=!1;if(O.from<=s&&O.to>=r&&(!a&&O.type.isAnonymous||t(O)!==!1)){if(O.firstChild())continue;l=!0}for(;l&&n&&(a||!O.type.isAnonymous)&&n(O),!O.nextSibling();){if(!O.parent())return;l=!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:qo(ie.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new i(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new i(ie.none,t,n,r)))}static build(e){return Jp(e)}};z.empty=new z(ie.none,[],[],0);var wo=class i{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 i(this.buffer,this.index)}},zt=class i{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return ie.none}toString(){let e=[];for(let t=0;t0));O=o[O+3]);return a}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,O=0;a=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function cn(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?a.length:-1;e!=l;e+=t){let h=a[e],c=O[e]+o.from;if(Nh(r,n,c,c+h.length)){if(h instanceof zt){if(s&G.ExcludeBuffers)continue;let f=h.findChild(0,h.buffer.length,t,n-c,r);if(f>-1)return new ni(new vo(o,h,e,c),null,f)}else if(s&G.IncludeAnonymous||!h.type.isAnonymous||Co(h)){let f;if(!(s&G.IgnoreMounts)&&(f=ii.get(h))&&!f.overlay)return new i(f.tree,c,e,o);let d=new i(h,c,e,o);return s&G.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?h.children.length-1:0,t,n,r)}}}if(s&G.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 r;if(!(n&G.IgnoreOverlays)&&(r=ii.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:o,to:a}of r.overlay)if((t>0?o<=s:o=s:a>s))return new i(r.tree,r.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 Gh(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Xo(i,e,t=e.length-1){for(let n=i;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}var vo=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},ni=class i extends wr{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:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new i(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&G.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new i(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 i(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 i(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new z(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Fh(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let a=new Xe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(cn(a,e,t,!1))}}return r?Fh(r):n}var xi=class{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 Xe)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:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Xe?(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:r}=this.buffer,s=r.findChild(this.index+4,r.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&G.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&G.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&G.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 r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}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:r}=this;if(r){if(e>0){if(this.index-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&G.IncludeAnonymous||a instanceof zt||!a.type.isAnonymous||Co(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Xo(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function Co(i){return i.children.some(e=>e instanceof zt||!e.type.isAnonymous||Co(e))}function Jp(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=n.types.length}=i,a=Array.isArray(t)?new wo(t,t.length):t,O=n.types,l=0,h=0;function c(P,w,k,M,A,I){let{id:C,start:_,end:j,size:E}=a,F=h,me=l;for(;E<0;)if(a.next(),E==-1){let $t=s[C];k.push($t),M.push(_-P);return}else if(E==-3){l=C;return}else if(E==-4){h=C;return}else throw new RangeError(`Unrecognized record size: ${E}`);let Re=O[C],tt,ae,qe=_-P;if(j-_<=r&&(ae=m(a.pos-w,A))){let $t=new Uint16Array(ae.size-ae.skip),Ae=a.pos-ae.size,it=$t.length;for(;a.pos>Ae;)it=Q(ae.start,$t,it);tt=new zt($t,j-ae.start,n),qe=ae.start-P}else{let $t=a.pos-E;a.next();let Ae=[],it=[],Bt=C>=o?C:-1,fi=0,zn=j;for(;a.pos>$t;)Bt>=0&&a.id==Bt&&a.size>=0?(a.end<=zn-r&&($(Ae,it,_,fi,a.end,zn,Bt,F,me),fi=Ae.length,zn=a.end),a.next()):I>2500?f(_,$t,Ae,it):c(_,$t,Ae,it,Bt,I+1);if(Bt>=0&&fi>0&&fi-1&&fi>0){let vO=d(Re,me);tt=qo(Re,Ae,it,0,Ae.length,0,j-_,vO,vO)}else tt=p(Re,Ae,it,j-_,F-j,me)}k.push(tt),M.push(qe)}function f(P,w,k,M){let A=[],I=0,C=-1;for(;a.pos>w;){let{id:_,start:j,end:E,size:F}=a;if(F>4)a.next();else{if(C>-1&&j=0;E-=3)_[F++]=A[E],_[F++]=A[E+1]-j,_[F++]=A[E+2]-j,_[F++]=F;k.push(new zt(_,A[2]-j,n)),M.push(j-P)}}function d(P,w){return(k,M,A)=>{let I=0,C=k.length-1,_,j;if(C>=0&&(_=k[C])instanceof z){if(!C&&_.type==P&&_.length==A)return _;(j=_.prop(Y.lookAhead))&&(I=M[C]+_.length+j)}return p(P,k,M,A,I,w)}}function $(P,w,k,M,A,I,C,_,j){let E=[],F=[];for(;P.length>M;)E.push(P.pop()),F.push(w.pop()+k-A);P.push(p(n.types[C],E,F,I-A,_-I,j)),w.push(A-k)}function p(P,w,k,M,A,I,C){if(I){let _=[Y.contextHash,I];C=C?[_].concat(C):[_]}if(A>25){let _=[Y.lookAhead,A];C=C?[_].concat(C):[_]}return new z(P,w,k,M,C)}function m(P,w){let k=a.fork(),M=0,A=0,I=0,C=k.end-r,_={size:0,start:0,skip:0};e:for(let j=k.pos-P;k.pos>j;){let E=k.size;if(k.id==w&&E>=0){_.size=M,_.start=A,_.skip=I,I+=4,M+=4,k.next();continue}let F=k.pos-E;if(E<0||F=o?4:0,Re=k.start;for(k.next();k.pos>F;){if(k.size<0)if(k.size==-3)me+=4;else break e;else k.id>=o&&(me+=4);k.next()}A=Re,M+=E,I+=me}return(w<0||M==P)&&(_.size=M,_.start=A,_.skip=I),_.size>4?_:void 0}function Q(P,w,k){let{id:M,start:A,end:I,size:C}=a;if(a.next(),C>=0&&M4){let j=a.pos-(C-4);for(;a.pos>j;)k=Q(P,w,k)}w[--k]=_,w[--k]=I-P,w[--k]=A-P,w[--k]=M}else C==-3?l=M:C==-4&&(h=M);return k}let g=[],T=[];for(;a.pos>0;)c(i.start||0,i.bufferStart||0,g,T,-1,0);let x=(e=i.length)!==null&&e!==void 0?e:g.length?T[0]+g[0].length:0;return new z(O[i.topID],g.reverse(),T.reverse(),x)}var Lh=new WeakMap;function kr(i,e){if(!i.isAnonymous||e instanceof zt||e.type!=i)return 1;let t=Lh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof z)){t=1;break}t+=kr(i,n)}Lh.set(e,t)}return t}function qo(i,e,t,n,r,s,o,a,O){let l=0;for(let $=n;$=h)break;w+=k}if(T==x+1){if(w>h){let k=$[x];d(k.children,k.positions,0,k.children.length,p[x]+g);continue}c.push($[x])}else{let k=p[T-1]+$[T-1].length-P;c.push(qo(i,$,p,x,T,P,k,null,O))}f.push(P+g-s)}}return d(e,t,n,r,0),(a||O)(c,f,o)}var ki=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof ni?this.setBuffer(e.context.buffer,e.index,t):e instanceof Xe&&this.map.set(e.tree,t)}get(e){return e instanceof ni?this.getBuffer(e.context.buffer,e.index):e instanceof Xe?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)}},Pt=class i{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,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 r=[new i(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let a=0,O=0,l=0;;a++){let h=a=n)for(;o&&o.from=f.from||c<=f.to||l){let d=Math.max(f.from,O)-l,$=Math.min(f.to,c)-l;f=d>=$?null:new i(d,$,f.tree,f.offset+l,a>0,!!h)}if(f&&r.push(f),o.to>c)break;o=snew we(r.from,r.to)):[new we(0,0)]:[new we(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}},Zo=class{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 wi(i){return(e,t,n,r)=>new _o(e,i,t,n,r)}var Xr=class{constructor(e,t,n,r,s){this.parser=e,this.parse=t,this.overlay=n,this.target=r,this.from=s}};function jh(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}var Vo=class{constructor(e,t,n,r,s,o,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}},Yo=new Y({perNode:!0}),_o=class{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,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 r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new z(n.type,n.children,n.positions,n.length,n.propValues.concat([[Yo,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[Y.mounted.id]=new ii(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.stoppedAt)a=!1;else if(e.hasNode(r)){if(t){let l=t.mounts.find(h=>h.frag.from<=r.from&&h.frag.to>=r.to&&h.mount.overlay);if(l)for(let h of l.mount.overlay){let c=h.from+l.pos,f=h.to+l.pos;c>=r.from&&f<=r.to&&!t.ranges.some(d=>d.fromc)&&t.ranges.push({from:c,to:f})}}a=!1}else if(n&&(o=em(n.ranges,r.from,r.to)))a=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew we(c.from-r.from,c.to-r.from)):null,r.tree,h.length?h[0].from:r.from)),s.overlay?h.length&&(n={ranges:h,depth:0,prev:n}):a=!1}}else if(t&&(O=t.predicate(r))&&(O===!0&&(O=new we(r.from,r.to)),O.from=0&&t.ranges[l].to==O.from?t.ranges[l]={from:t.ranges[l].from,to:O.to}:t.ranges.push(O)}if(a&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let l=Dh(this.ranges,t.ranges);l.length&&(jh(l),this.inner.splice(t.index,0,new Xr(t.parser,t.parser.startParse(this.input,Ih(t.mounts,l),l),t.ranges.map(h=>new we(h.from-t.start,h.to-t.start)),t.target,l[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function em(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Bh(i,e,t,n,r,s){if(e=e&&t.enter(n,1,G.IgnoreOverlays|G.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 z)t=t.children[0];else break}return!1}},zo=class{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(Yo))!==null&&t!==void 0?t:n.to,this.inner=new vr(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(Yo))!==null&&e!==void 0?e:t.to,this.inner=new vr(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];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(Y.mounted);if(o&&o.parser==t)for(let a=this.fragI;a=s.to)break;O.tree==this.curFrag.tree&&r.push({frag:O,pos:s.from-O.offset,mount:o})}}}return r}};function Dh(i,e){let t=null,n=e;for(let r=1,s=0;r=a)break;O.to<=o||(t||(n=t=e.slice()),O.froma&&t.splice(s+1,0,new we(a,O.to))):O.to>a?t[s--]=new we(a,O.to):t.splice(s--,1))}}return n}function im(i,e,t,n){let r=0,s=0,o=!1,a=!1,O=-1e9,l=[];for(;;){let h=r==i.length?1e9:o?i[r].to:i[r].from,c=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let f=Math.max(O,t),d=Math.min(h,c,n);fnew we(f.from+n,f.to+n)),c=im(e,h,O,l);for(let f=0,d=O;;f++){let $=f==c.length,p=$?l:c[f].from;if(p>d&&t.push(new Pt(d,p,r.tree,-o,s.from>=d||s.openStart,s.to<=p||s.openEnd)),$)break;d=c[f].to}}else t.push(new Pt(O,l,r.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}var nm=0,Ye=class i{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=nm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof i&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let r=new i(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Yr(e);return n=>n.modified.indexOf(t)>-1?n:Yr.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},rm=0,Yr=class i{constructor(e){this.name=e,this.instances=[],this.id=rm++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(a=>a.base==e&&sm(t,a.modified));if(n)return n;let r=[],s=new Ye(e.name,r,e,t);for(let a of t)a.instances.push(s);let o=om(t);for(let a of e.set)if(!a.modified.length)for(let O of o)r.push(i.get(a,O));return s}};function sm(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function om(i){let e=[[]];for(let t=0;tn.length-t.length)}function se(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,a=r;for(let c=0;;){if(a=="..."&&c>0&&c+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),c+=f[0].length,c==r.length)break;let d=r[c++];if(c==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);a=r.slice(c)}let O=s.length-1,l=s[O];if(!l)throw new RangeError("Invalid path: "+r);let h=new Xi(n,o,O>0?s.slice(0,O):null);e[l]=h.sort(e[l])}}return Jh.add(e)}var Jh=new Y,Xi=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let a of s)for(let O of a.set){let l=t[O.id];if(l){o=o?o+" "+l:l;break}}return o},scope:n}}function am(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function ec(i,e,t,n=0,r=i.length){let s=new Wo(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}var Wo=class{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,r,s){let{type:o,from:a,to:O}=e;if(a>=n||O<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let l=r,h=Om(e)||Xi.empty,c=am(s,h.tags);if(c&&(l&&(l+=" "),l+=c,h.mode==1&&(r+=(r?" ":"")+c)),this.startSpan(Math.max(t,a),l),h.opaque)return;let f=e.tree&&e.tree.prop(Y.mounted);if(f&&f.overlay){let d=e.node.enter(f.overlay[0].from+a,1),$=this.highlighters.filter(m=>!m.scope||m.scope(f.tree.type)),p=e.firstChild();for(let m=0,Q=a;;m++){let g=m=T||!e.nextSibling())););if(!g||T>n)break;Q=g.to+a,Q>t&&(this.highlightRange(d.cursor(),Math.max(t,g.from+a),Math.min(n,Q),"",$),this.startSpan(Math.min(n,Q),l))}p&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling());e.parent()}}};function Om(i){let e=i.type.prop(Jh);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var b=Ye.define,Rr=b(),Ct=b(),Hh=b(Ct),Kh=b(Ct),qt=b(),Zr=b(qt),Ao=b(qt),ut=b(),ri=b(ut),ct=b(),ft=b(),Uo=b(),fn=b(Uo),Vr=b(),u={comment:Rr,lineComment:b(Rr),blockComment:b(Rr),docComment:b(Rr),name:Ct,variableName:b(Ct),typeName:Hh,tagName:b(Hh),propertyName:Kh,attributeName:b(Kh),className:b(Ct),labelName:b(Ct),namespace:b(Ct),macroName:b(Ct),literal:qt,string:Zr,docString:b(Zr),character:b(Zr),attributeValue:b(Zr),number:Ao,integer:b(Ao),float:b(Ao),bool:b(qt),regexp:b(qt),escape:b(qt),color:b(qt),url:b(qt),keyword:ct,self:b(ct),null:b(ct),atom:b(ct),unit:b(ct),modifier:b(ct),operatorKeyword:b(ct),controlKeyword:b(ct),definitionKeyword:b(ct),moduleKeyword:b(ct),operator:ft,derefOperator:b(ft),arithmeticOperator:b(ft),logicOperator:b(ft),bitwiseOperator:b(ft),compareOperator:b(ft),updateOperator:b(ft),definitionOperator:b(ft),typeOperator:b(ft),controlOperator:b(ft),punctuation:Uo,separator:b(Uo),bracket:fn,angleBracket:b(fn),squareBracket:b(fn),paren:b(fn),brace:b(fn),content:ut,heading:ri,heading1:b(ri),heading2:b(ri),heading3:b(ri),heading4:b(ri),heading5:b(ri),heading6:b(ri),contentSeparator:b(ut),list:b(ut),quote:b(ut),emphasis:b(ut),strong:b(ut),link:b(ut),monospace:b(ut),strikethrough:b(ut),inserted:b(),deleted:b(),changed:b(),invalid:b(),meta:Vr,documentMeta:b(Vr),annotation:b(Vr),processingInstruction:b(Vr),definition:Ye.defineModifier("definition"),constant:Ye.defineModifier("constant"),function:Ye.defineModifier("function"),standard:Ye.defineModifier("standard"),local:Ye.defineModifier("local"),special:Ye.defineModifier("special")};for(let i in u){let e=u[i];e instanceof Ye&&(e.name=i)}var uy=Mo([{tag:u.link,class:"tok-link"},{tag:u.heading,class:"tok-heading"},{tag:u.emphasis,class:"tok-emphasis"},{tag:u.strong,class:"tok-strong"},{tag:u.keyword,class:"tok-keyword"},{tag:u.atom,class:"tok-atom"},{tag:u.bool,class:"tok-bool"},{tag:u.url,class:"tok-url"},{tag:u.labelName,class:"tok-labelName"},{tag:u.inserted,class:"tok-inserted"},{tag:u.deleted,class:"tok-deleted"},{tag:u.literal,class:"tok-literal"},{tag:u.string,class:"tok-string"},{tag:u.number,class:"tok-number"},{tag:[u.regexp,u.escape,u.special(u.string)],class:"tok-string2"},{tag:u.variableName,class:"tok-variableName"},{tag:u.local(u.variableName),class:"tok-variableName tok-local"},{tag:u.definition(u.variableName),class:"tok-variableName tok-definition"},{tag:u.special(u.variableName),class:"tok-variableName2"},{tag:u.definition(u.propertyName),class:"tok-propertyName tok-definition"},{tag:u.typeName,class:"tok-typeName"},{tag:u.namespace,class:"tok-namespace"},{tag:u.className,class:"tok-className"},{tag:u.macroName,class:"tok-macroName"},{tag:u.propertyName,class:"tok-propertyName"},{tag:u.operator,class:"tok-operator"},{tag:u.comment,class:"tok-comment"},{tag:u.meta,class:"tok-meta"},{tag:u.invalid,class:"tok-invalid"},{tag:u.punctuation,class:"tok-punctuation"}]);var Eo,Tt=new Y;function Ri(i){return R.define({combine:i?e=>e.concat(i):void 0})}var qr=new Y,fe=class{constructor(e,t,n=[],r=""){this.data=e,this.name=r,D.prototype.hasOwnProperty("tree")||Object.defineProperty(D.prototype,"tree",{get(){return L(this)}}),this.parser=t,this.extension=[vi.of(this),D.languageData.of((s,o,a)=>{let O=tc(s,o,a),l=O.type.prop(Tt);if(!l)return[];let h=s.facet(l),c=O.type.prop(qr);if(c){let f=O.resolve(o-O.from,a);for(let d of c)if(d.test(f,s)){let $=s.facet(d.facet);return d.type=="replace"?$:$.concat(h)}}return h})].concat(n)}isActiveAt(e,t,n=-1){return tc(e,t,n).type.prop(Tt)==this.data}findRegions(e){let t=e.facet(vi);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(Tt)==this.data){n.push({from:o,to:o+s.length});return}let a=s.prop(Y.mounted);if(a){if(a.tree.prop(Tt)==this.data){if(a.overlay)for(let O of a.overlay)n.push({from:O.from+o,to:O.to+o});else n.push({from:o,to:o+s.length});return}else if(a.overlay){let O=n.length;if(r(a.tree,a.overlay[0].from+o),n.length>O)return}}for(let O=0;On.isTop?t:void 0)]}),e.name)}configure(e,t){return new i(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function L(i){let e=i.field(fe.state,!1);return e?e.tree:z.empty}var Bo=class{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=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},un=null,si=class i{constructor(e,t,n=[],r,s,o,a,O){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=O,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new i(e,t,[],z.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Bo(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=z.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Pt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=un;un=this;try{return e()}finally{un=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ic(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let O=[];if(e.iterChangedRanges((l,h,c,f)=>O.push({fromA:l,toA:h,fromB:c,toB:f})),n=Pt.applyChanges(n,O),r=z.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let l of this.skipped){let h=e.mapPos(l.from,1),c=e.mapPos(l.to,-1);he.from&&(this.fragments=ic(this.fragments,r,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 yt{createParse(t,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let O=un;if(O){for(let l of r)O.tempSkipped.push(l);e&&(O.scheduleOn=O.scheduleOn?Promise.all([O.scheduleOn,e]):e)}return this.parsedPos=o,new z(ie.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 un}};function ic(i,e,t){return Pt.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var dn=class i{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 i(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=si.create(e.facet(vi).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new i(n)}};fe.state=ge.define({create:dn.init,update(i,e){for(let t of e.effects)if(t.is(fe.setState))return t.value;return e.startState.facet(vi)!=e.state.facet(vi)?dn.init(e.state):i.apply(e)}});var ac=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ac=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var Go=typeof navigator<"u"&&(!((Eo=navigator.scheduling)===null||Eo===void 0)&&Eo.isInputPending)?()=>navigator.scheduling.isInputPending():null,lm=Ge.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(fe.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(fe.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=ac(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,O=s.context.work(()=>Go&&Go()||Date.now()>o,r+(a?0:1e5));this.chunkBudget-=Date.now()-t,(O||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:fe.setState.of(new dn(s.context))})),this.chunkBudget>0&&!(O&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ee(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()}}}),vi=R.define({combine(i){return i.length?i[0]:null},enables:i=>[fe.state,lm,X.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]}),oe=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},$n=class i{constructor(e,t,n,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,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 i(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let n=/\.([^.]+)$/.exec(t);if(n){for(let r of e)if(r.extensions.indexOf(n[1])>-1)return r}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(n)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}},hm=R.define(),Wt=R.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function At(i){let e=i.facet(Wt);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function mn(i,e){let t="",n=i.tabSize,r=i.facet(Wt)[0];if(r==" "){for(;e>=n;)t+=" ",e-=n;r=" "}for(let s=0;s=e?cm(i,t,e):null}var oi=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=At(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,t=e.length){return xe(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},de=new Y;function cm(i,e,t){let n=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=n.node){let s=[];for(let o=r;o&&!(o.fromn.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return Oc(n,i,t)}function Oc(i,e,t){for(let n=i;n;n=n.next){let r=um(n.node);if(r)return r(Do.create(e,t,n))}return 0}function fm(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function um(i){let e=i.type.prop(de);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(Y.closedBy))){let r=i.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>lc(o,!0,1,void 0,s&&!fm(o)?r.from:void 0)}return i.parent==null?dm:null}function dm(){return 0}var Do=class i extends oi{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 i(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($m(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Oc(this.context.next,this.base,this.pos)}};function $m(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function pm(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let r=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let a=t.to;;){let O=e.childAfter(a);if(!O||O==n)return null;if(!O.type.isSkipped){if(O.from>=o)return null;let l=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+l}}a=O.to}}function Ar({closing:i,align:e=!0,units:t=1}){return n=>lc(n,e,t,i)}function lc(i,e,t,n,r){let s=i.textAfter,o=s.match(/^\s*/)[0].length,a=n&&s.slice(o,o+n.length)==n||r==i.pos+o,O=e?pm(i):null;return O?a?i.column(O.from):i.column(O.to):i.baseIndent+(a?0:i.unit*t)}var hc=i=>i.baseIndent;function _e({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}var cc=R.define(),ye=new Y;function Ut(i){let e=i.firstChild,t=i.lastChild;return e&&e.toa.prop(Tt)==o.data:o?a=>a==o:void 0,this.style=Mo(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=n?new Ue(n):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},Io=R.define(),fc=R.define({combine(i){return i.length?[i[0]]:null}});function Lo(i){let e=i.facet(Io);return e.length?e:i.facet(fc)}function ea(i,e){let t=[mm],n;return i instanceof bt&&(i.module&&t.push(X.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push(fc.of(i)):n?t.push(Io.computeN([X.darkTheme],r=>r.facet(X.darkTheme)==(n=="dark")?[i]:[])):t.push(Io.of(i)),t}var No=class{constructor(e){this.markCache=Object.create(null),this.tree=L(e.state),this.decorations=this.buildDeco(e,Lo(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=L(e.state),n=Lo(e.state),r=n!=Lo(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return U.none;let n=new Ht;for(let{from:r,to:s}of e.visibleRanges)ec(this.tree,t,(o,a,O)=>{n.add(o,a,this.markCache[O]||(this.markCache[O]=U.mark({class:O})))},r,s);return n.finish()}},mm=nt.high(Ge.fromClass(No,{decorations:i=>i.decorations})),yy=bt.define([{tag:u.meta,color:"#404740"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),Qm=X.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),uc=1e4,dc="()[]{}",$c=R.define({combine(i){return Xt(i,{afterCursor:!0,brackets:dc,maxScanDistance:uc,renderMatch:Pm})}}),gm=U.mark({class:"cm-matchingBracket"}),Sm=U.mark({class:"cm-nonmatchingBracket"});function Pm(i){let e=[],t=i.matched?gm:Sm;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}var ym=ge.define({create(){return U.none},update(i,e){if(!e.docChanged&&!e.selection)return i;let t=[],n=e.state.facet($c);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=He(e.state,r.head,-1,n)||r.head>0&&He(e.state,r.head-1,1,n)||n.afterCursor&&(He(e.state,r.head,1,n)||r.headX.decorations.from(i)}),Tm=[ym,Qm];function pc(i={}){return[$c.of(i),Tm]}var Qn=new Y;function Fo(i,e,t){let n=i.prop(e<0?Y.openedBy:Y.closedBy);if(n)return n;if(i.name.length==1){let r=t.indexOf(i.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Ho(i){let e=i.type.prop(Qn);return e?e(i.node):i}function He(i,e,t,n={}){let r=n.maxScanDistance||uc,s=n.brackets||dc,o=L(i),a=o.resolveInner(e,t);for(let O=a;O;O=O.parent){let l=Fo(O.type,t,s);if(l&&O.from0?e>=h.from&&eh.from&&e<=h.to))return bm(i,e,t,O,h,l,s)}}return xm(i,e,t,o,a.type,r,s)}function bm(i,e,t,n,r,s,o){let a=n.parent,O={from:r.from,to:r.to},l=0,h=a?.cursor();if(h&&(t<0?h.childBefore(n.from):h.childAfter(n.to)))do if(t<0?h.to<=n.from:h.from>=n.to){if(l==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let l={from:t<0?e-1:e,to:t>0?e+1:e},h=i.doc.iterRange(e,t>0?i.doc.length:0),c=0;for(let f=0;!h.next().done&&f<=s;){let d=h.value;t<0&&(f+=d.length);let $=e+f*t;for(let p=t>0?0:d.length-1,m=t>0?d.length:-1;p!=m;p+=t){let Q=o.indexOf(d[p]);if(!(Q<0||n.resolveInner($+p,1).type!=r))if(Q%2==0==t>0)c++;else{if(c==1)return{start:l,end:{from:$+p,to:$+p+1},matched:Q>>1==O>>1};c--}}t>0&&(f+=d.length)}return h.done?{start:l,matched:!1}:null}function nc(i,e,t,n=0,r=0){e==null&&(e=i.search(/[^\s\u00a0]/),e==-1&&(e=i.length));let s=r;for(let o=n;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}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.lastColumnPosn?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return r(s)==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}};function km(i){return{name:i.name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||wm,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||ia,mergeTokens:i.mergeTokens!==!1}}function wm(i){if(typeof i!="object")return i;let e={};for(let t in i){let n=i[t];e[t]=n instanceof Array?n.slice():n}return e}var rc=new WeakMap,zr=class i extends fe{constructor(e){let t=Ri(e.languageData),n=km(e),r,s=new class extends yt{createParse(o,a,O){return new Ko(r,o,a,O)}};super(t,s,[],e.name),this.topNode=Zm(t,this),r=this,this.streamParser=n,this.stateAfter=new Y({perNode:!0}),this.tokenTable=e.tokenTable?new Cr(n.tokenTable):Rm}static define(e){return new i(e)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=rc.get(e.state),t!=null&&t1e4)return null;for(;s=n&&t+e.length<=r&&e.prop(i.stateAfter);if(s)return{state:i.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],O=t+e.positions[o],l=a instanceof z&&O=e.length)return e;!r&&t==0&&e.type==i.topNode&&(r=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],O;if(ot&&ta(i,s.tree,0-s.offset,t,a),l;if(O&&O.pos<=n&&(l=mc(i,s.tree,t+s.offset,O.pos+s.offset,!1)))return{state:O.state,tree:l}}return{state:i.streamParser.startState(r?At(r):4),tree:z.empty}}var Ko=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=si.get(),o=r[0].from,{state:a,tree:O}=Xm(e,n,o,this.to,s?.state);this.state=a,this.parsedPos=this.chunkStart=o+O.length;for(let l=0;ll.from<=s.viewport.from&&l.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(At(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=si.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=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==` + `&&i.lineWrapping&&(n&&(n=S.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:q.of([" "])}),t)return bo(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,a="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),a=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:a}),!0}else return!1}function bo(i,e,t,n=-1){if(v.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(v.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ti(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.lengthr.head)&&Ti(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Ti(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=D$(i,e,t));return i.state.facet(Oh).some(O=>O(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function D$(i,e,t){let n,r=i.state,s=r.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)&&i.inputState.composing<0){let a=s.frome.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(a+e.insert.sliceString(0,void 0,i.state.lineBreak)+O))}else{let a=r.changes(e),O=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let l=i.state.sliceDoc(e.from,e.to),h,c=t&&gh(i,t.main.head);if(c){let $=e.insert.length-(e.to-e.from);h={from:c.from,to:c.to-$}}else h=i.state.doc.lineAt(s.head);let f=s.to-e.to,d=s.to-s.from;n=r.changeByRange($=>{if($.from==s.from&&$.to==s.to)return{changes:a,range:O||$.map(a)};let p=$.to-f,m=p-l.length;if($.to-$.from!=d||i.state.sliceDoc(m,p)!=l||$.to>=h.from&&$.from<=h.to)return{range:$};let Q=r.changes({from:m,to:p,insert:e.insert}),g=$.to-s.to;return{changes:Q,range:O?S.range(Math.max(0,O.anchor+g),Math.max(0,O.head+g)):$.map(Q)}})}else n={changes:a,selection:O&&r.selection.replaceRange(O)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function I$(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(n=="end"){let O=Math.max(0,s-Math.min(o,a));t-=o+O-s}if(o=o?s-t:0;s-=O,a=s+(a-o),o=s}else if(a=a?s-t:0;s-=O,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function N$(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new $r(t,n)),(r!=t||s!=n)&&e.push(new $r(r,s))),e}function F$(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?S.single(t+e,n+e):null}var Fs=class{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.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=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.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,v.safari&&e.contentDOM.addEventListener("input",()=>null),v.gecko&&cp(e.contentDOM.ownerDocument)}handleEvent(e){!np(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=H$(e),n=this.handlers,r=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&&(r.removeEventListener(s,this.handleEvent),a=null),a||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Th.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),v.android&&v.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return v.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=yh.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||K$.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:v.safari&&!v.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.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function pl(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){Ee(t.state,r)}}}function H$(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let a in s){let O=s[a];O&&t(a).handlers.push(pl(n.value,O))}if(o)for(let a in o){let O=o[a];O&&t(a).observers.push(pl(n.value,O))}}for(let n in Ne)t(n).handlers.push(Ne[n]);for(let n in Le)t(n).observers.push(Le[n]);return e}var yh=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],K$="dthko",Th=[16,17,18,20,91,92,224,225],Fn=6;function Hn(i){return Math.max(0,i)*.7+8}function J$(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var Hs=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=f$(e.contentDOM),this.atoms=e.state.facet(To).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(D.allowMultipleSelections)&&ep(e,t),this.dragging=ip(e,t)&&kh(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&J$(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let O=Qh(this.view);e.clientX-O.left<=r+Fn?t=-Hn(r-e.clientX):e.clientX+O.right>=o-Fn&&(t=Hn(e.clientX-o)),e.clientY-O.top<=s+Fn?n=-Hn(s-e.clientY):e.clientY+O.bottom>=a-Fn&&(n=Hn(e.clientY-a)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function ep(i,e){let t=i.state.facet(rh);return t.length?t[0](e):v.mac?e.metaKey:e.ctrlKey}function tp(i,e){let t=i.state.facet(sh);return t.length?t[0](e):v.mac?!e.altKey:!e.ctrlKey}function ip(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=tn(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function np(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=K.get(t))&&n.ignoreEvent(e))return!1;return!0}var Ne=Object.create(null),Le=Object.create(null),bh=v.ie&&v.ie_version<15||v.ios&&v.webkit_version<604;function rp(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),xh(i,t.value)},50)}function br(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function xh(i,e){e=br(i.state,So,e);let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(Ks!=null&&t.selection.ranges.every(O=>O.empty)&&Ks==s.toString()){let O=-1;n=t.changeByRange(l=>{let h=t.doc.lineAt(l.from);if(h.from==O)return{range:l};O=h.from;let c=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:c},range:S.cursor(l.from+c.length)}})}else o?n=t.changeByRange(O=>{let l=s.line(r++);return{changes:{from:O.from,to:O.to,insert:l.text},range:S.cursor(O.from+l.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Le.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};Ne.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);Le.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};Le.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};Ne.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(oh))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=ap(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new Hs(i,e,t,n)),n&&i.observer.ignore(()=>{Ul(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function ml(i,e,t,n){if(n==1)return S.cursor(e,t);if(n==2)return A$(i.state,e,t);{let r=he.find(i.docView,e),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,a=r?r.posAtEnd:s.to;return ae>=t.top&&e<=t.bottom&&i>=t.left&&i<=t.right;function sp(i,e,t,n){let r=he.find(i.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&Ql(t,n,o))return-1;let a=r.coordsAt(s,1);return a&&Ql(t,n,a)?1:o&&o.bottom>=n?-1:1}function gl(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:sp(i,t,e.clientX,e.clientY)}}var op=v.ie&&v.ie_version<=11,Sl=null,Pl=0,yl=0;function kh(i){if(!op)return i.detail;let e=Sl,t=yl;return Sl=i,yl=Date.now(),Pl=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(Pl+1)%3:1}function ap(i,e){let t=gl(i,e),n=kh(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,a){let O=gl(i,s),l,h=ml(i,O.pos,O.bias,n);if(t.pos!=O.pos&&!o){let c=ml(i,t.pos,t.bias,n),f=Math.min(c.from,h.from),d=Math.max(c.to,h.to);h=f1&&(l=Op(r,O.pos))?l:a?r.addRange(h):S.create([h])}}}function Op(i,e){for(let t=0;t=e)return S.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}Ne.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=S.range(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",br(i.state,Po,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ne.dragend=i=>(i.inputState.draggedContent=null,!1);function Tl(i,e,t,n){if(t=br(i.state,So,t),!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&tp(i,e)?{from:s.from,to:s.to}:null,a={from:r,insert:t},O=i.state.changes(o?[o,a]:a);i.focus(),i.dispatch({changes:O,selection:{anchor:O.mapPos(r,-1),head:O.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}Ne.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&Tl(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\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 Tl(i,e,n,!0),!0}return!1};Ne.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=bh?null:e.clipboardData;return t?(xh(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(rp(i),!1)};function lp(i,e){let t=i.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(),i.focus()},50)}function hp(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:br(i,Po,e.join(i.lineBreak)),ranges:t,linewise:n}}var Ks=null;Ne.copy=Ne.cut=(i,e)=>{let{text:t,ranges:n,linewise:r}=hp(i.state);if(!t&&!r)return!1;Ks=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=bh?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(lp(i,t),!1)};var wh=be.define();function Xh(i,e){let t=[];for(let n of i.facet(lh)){let r=n(i,e);r&&t.push(r)}return t.length?i.update({effects:t,annotations:wh.of(!0)}):null}function vh(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=Xh(i.state,e);t?i.dispatch(t):i.update([])}},10)}Le.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),vh(i)};Le.blur=i=>{i.observer.clearSelectionRange(),vh(i)};Le.compositionstart=Le.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};Le.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,v.chrome&&v.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};Le.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};Ne.beforeinput=(i,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&i.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],O=i.posAtDOM(a.startContainer,a.startOffset),l=i.posAtDOM(a.endContainer,a.endOffset);return bo(i,{from:O,to:l,insert:i.state.toText(s)},null),!0}}let r;if(v.chrome&&v.android&&(r=yh.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return v.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),v.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Le.compositionend(i,e),20),!1};var bl=new Set;function cp(i){bl.has(i)||(bl.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var xl=["pre-wrap","normal","pre-line","break-spaces"],bi=!1;function kl(){bi=!1}var Js=class{constructor(e){this.lineWrapping=e,this.doc=q.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}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)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return xl.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,O=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,O){this.heightSamples={};for(let l=0;l0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>sr&&(bi=!0),this.height=e)}replace(e,t,n){return i.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let a=r.length-1;a>=0;a--){let{fromA:O,toA:l,fromB:h,toB:c}=r[a],f=s.lineAt(O,ee.ByPosNoHeight,n.setDoc(t),0,0),d=f.to>=l?f:s.lineAt(l,ee.ByPosNoHeight,n,0,0);for(c+=d.to-l,l=d.to;a>0&&f.from<=r[a-1].toA;)O=r[a-1].fromA,h=r[a-1].fromB,a--,Os*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,r-=a.size}else if(s>r*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(r=s&&o(this.blockAt(0,n,r,s))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},Me=class i extends mr{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new st(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof i||r instanceof Rt&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Rt?r=new i(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Ve.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(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:""})`}},Rt=class i extends Ve{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,a=0;if(e.lineWrapping){let O=Math.min(this.height,e.lineHeight*s);o=O/s,this.length>s+1&&(a=(this.height-O)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:a}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:a,perChar:O}=this.heightMetrics(t,r);if(t.lineWrapping){let l=r+(e0){let s=n[n.length-1];s instanceof i?n[n.length-1]=new i(s.length+r):n.push(null,new i(r-1))}if(e>0){let s=n[0];s instanceof i?n[0]=new i(e+s.length):n.unshift(new i(e-1),null)}return Ve.of(n)}decomposeLeft(e,t){t.push(new i(e-1),null)}decomposeRight(e,t){t.push(null,new i(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],a=Math.max(t,r.from),O=-1;for(r.from>t&&o.push(new i(r.from-t-1).updateHeight(e,t));a<=s&&r.more;){let h=e.doc.lineAt(a).length;o.length&&o.push(null);let c=r.heights[r.index++];O==-1?O=c:Math.abs(c-O)>=sr&&(O=-2);let f=new Me(h,c);f.outdated=!1,o.push(f),a+=h+1}a<=s&&o.push(null,new i(s-a).updateHeight(e,a));let l=Ve.of(o);return(O<0||Math.abs(l.height-this.height)>=sr||Math.abs(O-this.heightMetrics(e,t).perLine)>=sr)&&(bi=!0),pr(this,l)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},to=class extends Ve{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,r){let s=n+this.left.height;return ea))return l;let h=t==ee.ByPosNoHeight?ee.ByPosNoHeight:ee.ByPos;return O?l.join(this.right.lineAt(a,h,n,o,a)):this.left.lineAt(a,h,n,r,s).join(l)}forEachLine(e,t,n,r,s,o){let a=r+this.left.height,O=s+this.left.length+this.break;if(this.break)e=O&&this.right.forEachLine(e,t,n,a,O,o);else{let l=this.lineAt(O,ee.ByPos,n,r,s);e=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,a,O,o)}}replace(e,t,n){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of n)s.push(a);if(e>0&&wl(s,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Ve.of(this.break?[e,null,t]:[e,t]):(this.left=pr(this.left,e),this.right=pr(this.right,t),this.setHeight(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,r){let{left:s,right:o}=this,a=t+s.length+this.break,O=null;return r&&r.from<=t+s.length&&r.more?O=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?O=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),O?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 wl(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof Rt&&(n=i[e+1])instanceof Rt&&i.splice(e-1,3,new Rt(t.length+1+n.length))}var fp=5,io=class i{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),r=this.nodes[this.nodes.length-1];r instanceof Me?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Me(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=fp)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Me(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new Rt(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 Me)return e;let t=new Me(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 r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.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 Me)&&!this.isCovered?this.nodes.push(new Me(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&c.overflow!="visible"){let f=h.getBoundingClientRect();s=Math.max(s,f.left),o=Math.min(o,f.right),a=Math.max(a,f.top),O=Math.min(l==i.parentNode?r.innerHeight:O,f.bottom)}l=c.position=="absolute"||c.position=="fixed"?h.offsetParent:h.parentNode}else if(l.nodeType==11)l=l.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,O)-(t.top+e)}}function $p(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function pp(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var Ji=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new Js(t),this.stateDeco=e.facet(On).filter(n=>typeof n!="function"),this.heightMap=Ve.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle.setDoc(e.doc),[new at(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=U.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 r=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new Pi(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Xl:new so(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Di(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(On).filter(h=>typeof h!="function");let r=e.changedRanges,s=at.extendWithRanges(r,up(n,this.stateDeco,e?e.changes:Qe.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);kl(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||bi)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let O=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headO.to)||!this.viewportIsAppropriate(O))&&(O=this.getViewport(0,t));let l=O.from!=this.viewport.from||O.to!=this.viewport.to;this.viewport=O,e.flags|=this.updateForViewport(),(l||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(ch)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?te.RTL:te.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=t.getBoundingClientRect(),O=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let l=0,h=0;if(a.width&&a.height){let{scaleX:x,scaleY:P}=Wl(t,a);(x>.005&&Math.abs(this.scaleX-x)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=x,this.scaleY=P,l|=16,o=O=!0)}let c=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=c||this.paddingBottom!=f)&&(this.paddingTop=c,this.paddingBottom=f,l|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(O=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=16);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=El(e.scrollDOM);let $=(this.printing?pp:dp)(t,this.paddingTop),p=$.top-this.pixelViewport.top,m=$.bottom-this.pixelViewport.bottom;this.pixelViewport=$;let Q=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(Q!=this.inView&&(this.inView=Q,Q&&(O=!0)),!this.inView&&!this.scrollTarget&&!$p(e.dom))return 0;let g=a.width;if((this.contentDOMWidth!=g||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,l|=16),O){let x=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(x)&&(o=!0),o||r.lineWrapping&&Math.abs(g-this.contentDOMWidth)>r.charWidth){let{lineHeight:P,charWidth:w,textHeight:k}=e.docView.measureTextSize();o=P>0&&r.refresh(s,P,w,k,Math.max(5,g/w),x),o&&(e.docView.minWidth=0,l|=16)}p>0&&m>0?h=Math.max(p,m):p<0&&m<0&&(h=Math.min(p,m)),kl();for(let P of this.viewports){let w=P.from==this.viewport.from?x:e.docView.measureVisibleLineHeights(P);this.heightMap=(o?Ve.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle,[new at(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new eo(P.from,w))}bi&&(l|=2)}let T=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return T&&(l&2&&(l|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),l|=this.updateForViewport()),(l&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}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)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,O=new Pi(r.lineAt(o-n*1e3,ee.ByHeight,s,0,0).from,r.lineAt(a+(1-n)*1e3,ee.ByHeight,s,0,0).to);if(t){let{head:l}=t.range;if(lO.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=r.lineAt(l,ee.ByPos,s,0,0),f;t.y=="center"?f=(c.top+c.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&l=a+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=te.LTR&&!n)return[];let a=[],O=(h,c,f,d)=>{if(c-hh&&QQ.from>=f.from&&Q.to<=f.to&&Math.abs(Q.from-h)Q.fromg));if(!m){if(cT.from<=c&&T.to>=c)){let T=t.moveToLineBoundary(S.cursor(c),!1,!0).head;T>h&&(c=T)}let Q=this.gapSize(f,h,c,d),g=n||Q<2e6?Q:2e6;m=new Ji(h,c,Q,g)}a.push(m)},l=h=>{if(h.length2e6)for(let w of e)w.from>=h.from&&w.fromh.from&&O(h.from,d,h,c),$t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];H.spans(t,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Di(this.heightMap.lineAt(e,ee.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Di(this.heightMap.lineAt(this.scaler.fromDOM(e),ee.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 Di(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}},Pi=class{constructor(e,t){this.from=e,this.to=t}};function mp(i,e,t){let n=[],r=i,s=0;return H.spans(t,i,e,{span(){},point(o,a){o>r&&(n.push({from:r,to:o}),s+=o-r),r=a}},20),r=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],a=o-s;if(n<=a)return s+n;n-=a}}function Jn(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function Qp(i,e){for(let t of i)if(e(t))return t}var Xl={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}},so=class i{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:a,to:O})=>{let l=t.lineAt(a,ee.ByPos,e,0,0).top,h=t.lineAt(O,ee.ByPos,e,0,0).bottom;return r+=h-l,{from:a,to:O,top:l,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);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,r=0;;t++){let s=tt.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}};function Di(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new st(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>Di(r,e)):i._content)}var er=Z.define({combine:i=>i.join(" ")}),oo=Z.define({combine:i=>i.indexOf(!0)>-1}),ao=Ue.newName(),Rh=Ue.newName(),Zh=Ue.newName(),Vh={"&light":"."+Rh,"&dark":"."+Zh};function Oo(i,e,t){return new Ue(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}var gp=Oo("."+ao,{"&":{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,overflowAnchor:"none"},".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:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&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,zIndex:300},"&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-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".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",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Vh),Sp={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Ys=v.ie&&v.ie_version<=11,lo=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Cs,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(v.ie&&v.ie_version<=11||v.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()}),window.EditContext&&v.android&&e.constructor.EDIT_CONTEXT!==!1&&!(v.chrome&&v.chrome_version<126)&&(this.editContext=new ho(e),e.state.facet(gt)&&(e.contentDOM.editContext=this.editContext.editContext)),Ys&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,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,r=this.selectionRange;if(n.state.facet(gt)?n.root.activeElement!=this.dom:!ir(this.dom,r))return;let s=r.anchorNode&&n.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(v.ie&&v.ie_version<=11||v.android&&v.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Ni(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=tn(e.root);if(!t)return!1;let n=v.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Pp(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=ir(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Ti(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!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:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&ir(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Ns(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,r=Ph(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}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=vl(t,e.previousSibling||e.target.previousSibling,-1),r=vl(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(gt)!=e.state.facet(gt)&&(e.view.contentDOM.editContext=e.state.facet(gt)?this.editContext.editContext:null))}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 r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function vl(i,e,t){for(;e;){let n=K.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Rl(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return Ni(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function Pp(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return Rl(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?Rl(i,t):null}var ho=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:s,head:o}=r,a=this.toEditorPos(n.updateRangeStart),O=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:a,drifted:!1});let l={from:a,to:O,insert:q.of(n.text.split(` +`))};if(l.from==this.from&&sthis.to&&(l.to=s),l.from==l.to&&!l.insert.length){let h=S.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));h.main.eq(r)||e.dispatch({selection:h,userEvent:"select"});return}if((v.mac||v.android)&&l.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(l={from:a,to:O,insert:q.of([n.text.replace("."," ")])}),this.pendingContextChange=l,!e.state.readOnly){let h=this.to-this.from+(l.to-l.from+l.insert.length);bo(e,l,S.single(this.toEditorPos(n.selectionStart,h),this.toEditorPos(n.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);o{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(o!="None"&&a!="None"){let O=this.toEditorPos(s.rangeStart),l=this.toEditorPos(s.rangeEnd);if(O{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=tn(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,a,O,l)=>{if(n)return;let h=l.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(sthis.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),l.toString()),this.to+=h}t+=h}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},X=class i{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&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||u$(e.parent)||document,this.viewState=new Qr(e.state||D.create(e)),e.scrollTo&&e.scrollTo.is(Nn)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Si).map(r=>new Ki(r));for(let r of this.plugins)r.update(this);this.observer=new lo(this),this.inputState=new Fs(this),this.inputState.ensureHandlers(this.plugins),this.docView=new dr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof ne?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,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,O=null;e.some(f=>f.annotation(wh))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,O=Xh(s,o),O||(a=1));let l=this.observer.delayedAndroidKey,h=null;if(l?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(D.phrases)!=this.state.facet(D.phrases))return this.setState(s);r=ur.create(this,s,e),r.flags|=a;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(c&&(c=c.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection;c=new Hi(d.empty?d:S.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of f.effects)d.is(Nn)&&(c=d.value.clip(this.state))}this.viewState.update(r,c),this.bidiCache=gr.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(ji)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(er)!=r.state.facet(er)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(js))try{f(r)}catch(d){Ee(this.state,d,"update listener")}(O||h)&&Promise.resolve().then(()=>{O&&this.state==O.startState&&this.dispatch(O),h&&!Ph(this,h)&&l.force&&Ti(this.contentDOM,l.key,l.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 Qr(e),this.plugins=e.facet(Si).map(n=>new Ki(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new dr(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(Si),n=e.state.facet(Si);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new Ki(s));else{let a=this.plugins[o];a.mustUpdate=e,r.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-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,r=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(El(n))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let O=this.viewState.measure(this);if(!O&&!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 l=[];O&4||([this.measureRequests,l]=[l,this.measureRequests]);let h=l.map(d=>{try{return d.read(this)}catch($){return Ee(this.state,$),Zl}}),c=ur.create(this,this.state,[]),f=!1;c.flags|=O,t?t.flags|=O:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),f=this.docView.update(c),f&&this.docViewUpdate());for(let d=0;d1||$<-1){r=r+$,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(js))a(t)}get themeClasses(){return ao+" "+(this.state.facet(oo)?Zh:Rh)+" "+this.state.facet(er)}updateAttrs(){let e=Vl(this,dh,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(gt)?"true":"false",class:"cm-content",style:`${v.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Vl(this,yo,t);let n=this.observer.ignore(()=>{let r=Ms(this.contentDOM,this.contentAttrs,t),s=Ms(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(ji);let e=this.state.facet(i.cspNonce);Ue.mount(this.root,this.styleModules.concat(gp).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;tn.plugin==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 Vs(this,e,$l(this,e,t,n))}moveByGroup(e,t){return Vs(this,e,$l(this,e,t,n=>L$(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return S.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return G$(this,e,t,n)}moveVertically(e,t,n){return Vs(this,e,j$(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(),Sh(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 r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[ot.find(s,e-r.from,-1,t)];return yr(n,o.dir==te.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(hh)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>yp)return ih(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||th(s.isolates,n=hl(this,e))))return s.order;n||(n=hl(this,e));let r=w$(e.text,t,n);return this.bidiCache.push(new gr(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||v.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ul(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(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Nn.of(new Hi(typeof e=="number"?S.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Nn.of(new Hi(S.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ge.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ge.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Ue.newName(),r=[er.of(n),ji.of(Oo(`.${n}`,e))];return t&&t.dark&&r.push(oo.of(!0)),r}static baseTheme(e){return nt.lowest(ji.of(Oo("."+ao,e,Vh)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&K.get(n)||K.get(e);return((t=r?.rootView)===null||t===void 0?void 0:t.view)||null}};X.styleModule=ji;X.inputHandler=Oh;X.clipboardInputFilter=So;X.clipboardOutputFilter=Po;X.scrollHandler=fh;X.focusChangeEffect=lh;X.perLineTextDirection=hh;X.exceptionSink=ah;X.updateListener=js;X.editable=gt;X.mouseSelectionStyle=oh;X.dragMovesSelection=sh;X.clickAddsSelectionRange=rh;X.decorations=On;X.outerDecorations=$h;X.atomicRanges=To;X.bidiIsolatedRanges=ph;X.scrollMargins=mh;X.darkTheme=oo;X.cspNonce=Z.define({combine:i=>i.length?i[0]:""});X.contentAttributes=yo;X.editorAttributes=dh;X.lineWrapping=X.contentAttributes.of({class:"cm-lineWrapping"});X.announce=B.define();var yp=4096,Zl={},gr=class i{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:te.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&Us(o,t)}return t}var Tp=v.mac?"mac":v.windows?"win":v.linux?"linux":"key";function bp(i,e){let t=i.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,s,o,a;for(let O=0;On.concat(r),[]))),t}var vt=null,wp=4e3;function Xp(i,e=Tp){let t=Object.create(null),n=Object.create(null),r=(o,a)=>{let O=n[o];if(O==null)n[o]=a;else if(O!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,O,l,h)=>{var c,f;let d=t[o]||(t[o]=Object.create(null)),$=a.split(/ (?!$)/).map(Q=>bp(Q,e));for(let Q=1;Q<$.length;Q++){let g=$.slice(0,Q).join(" ");r(g,!0),d[g]||(d[g]={preventDefault:!0,stopPropagation:!1,run:[T=>{let x=vt={view:T,prefix:g,scope:o};return setTimeout(()=>{vt==x&&(vt=null)},wp),!0}]})}let p=$.join(" ");r(p,!1);let m=d[p]||(d[p]={preventDefault:!1,stopPropagation:!1,run:((f=(c=d._any)===null||c===void 0?void 0:c.run)===null||f===void 0?void 0:f.slice())||[]});O&&m.run.push(O),l&&(m.preventDefault=!0),h&&(m.stopPropagation=!0)};for(let o of i){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let l of a){let h=t[l]||(t[l]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:c}=o;for(let f in h)h[f].run.push(d=>c(d,co))}let O=o[e]||o.key;if(O)for(let l of a)s(l,O,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(l,"Shift-"+O,o.shift,o.preventDefault,o.stopPropagation)}return t}var co=null;function vp(i,e,t,n){co=e;let r=il(e),s=bs(r,0),o=xs(s)==r.length&&r!=" ",a="",O=!1,l=!1,h=!1;vt&&vt.view==t&&vt.scope==n&&(a=vt.prefix+" ",Th.indexOf(e.keyCode)<0&&(l=!0,vt=null));let c=new Set,f=m=>{if(m){for(let Q of m.run)if(!c.has(Q)&&(c.add(Q),Q(t)))return m.stopPropagation&&(h=!0),!0;m.preventDefault&&(m.stopPropagation&&(h=!0),l=!0)}return!1},d=i[n],$,p;return d&&(f(d[a+tr(r,e,!o)])?O=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(v.windows&&e.ctrlKey&&e.altKey)&&!(v.mac&&e.altKey&&!e.ctrlKey)&&($=Qt[e.keyCode])&&$!=r?(f(d[a+tr($,e,!0)])||e.shiftKey&&(p=Qi[e.keyCode])!=r&&p!=$&&f(d[a+tr(p,e,!1)]))&&(O=!0):o&&e.shiftKey&&f(d[a+tr(r,e,!0)])&&(O=!0),!O&&f(d._any)&&(O=!0)),l&&(O=!0),O&&h&&e.stopPropagation(),co=null,O}var ln=class i{constructor(e,t,n,r,s){this.className=e,this.left=t,this.top=n,this.width=r,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 r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=Yh(e);return[new i(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return Rp(e,t,n)}};function Yh(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==te.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function _l(i,e,t,n){let r=i.coordsAtPos(e,t*2);if(!r)return n;let s=i.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,a=i.posAtCoords({x:s.left+1,y:o}),O=i.posAtCoords({x:s.right-1,y:o});return a==null||O==null?n:{from:Math.max(n.from,Math.min(a,O)),to:Math.min(n.to,Math.max(a,O))}}function Rp(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),r=Math.min(t.to,i.viewport.to),s=i.textDirection==te.LTR,o=i.contentDOM,a=o.getBoundingClientRect(),O=Yh(i),l=o.querySelector(".cm-line"),h=l&&window.getComputedStyle(l),c=a.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),f=a.right-(h?parseInt(h.paddingRight):0),d=Ds(i,n,1),$=Ds(i,r,-1),p=d.type==Pe.Text?d:null,m=$.type==Pe.Text?$:null;if(p&&(i.lineWrapping||d.widgetLineBreaks)&&(p=_l(i,n,1,p)),m&&(i.lineWrapping||$.widgetLineBreaks)&&(m=_l(i,r,-1,m)),p&&m&&p.from==m.from&&p.to==m.to)return g(T(t.from,t.to,p));{let P=p?T(t.from,null,p):x(d,!1),w=m?T(null,t.to,m):x($,!0),k=[];return(p||d).to<(m||$).from-(p&&m?1:0)||d.widgetLineBreaks>1&&P.bottom+i.defaultLineHeight/2_&&E.from=me)break;qe>F&&C(Math.max(ae,F),P==null&&ae<=_,Math.min(qe,me),w==null&&qe>=j,tt.dir)}if(F=Re.to+1,F>=me)break}return I.length==0&&C(_,P==null,j,w==null,i.textDirection),{top:M,bottom:A,horizontal:I}}function x(P,w){let k=a.top+(w?P.top:P.bottom);return{top:k,bottom:k,horizontal:[]}}}function Zp(i,e){return i.constructor==e.constructor&&i.eq(e)}var fo=class{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(or)!=e.state.facet(or)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(or);for(;t!Zp(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},or=Z.define();function _h(i){return[Ge.define(e=>new fo(e,i)),or.of(i)]}var hn=Z.define({combine(i){return Xt(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function zh(i={}){return[hn.of(i),Vp,Yp,_p,ch.of(!0)]}function Ch(i){return i.startState.facet(hn)!=i.state.facet(hn)}var Vp=_h({above:!0,markers(i){let{state:e}=i,t=e.facet(hn),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=r.empty?r:S.cursor(r.head,r.head>r.anchor?-1:1);for(let O of ln.forRange(i,o,a))n.push(O)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Ch(i);return t&&zl(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){zl(e.state,i)},class:"cm-cursorLayer"});function zl(i,e){e.style.animationDuration=i.facet(hn).cursorBlinkRate+"ms"}var Yp=_h({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:ln.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||Ch(i)},class:"cm-selectionLayer"}),_p=nt.highest(X.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),qh=B.define({map(i,e){return i==null?null:e.mapPos(i)}}),Ii=ge.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(qh)?n.value:t,i)}}),zp=Ge.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(Ii);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"),(i.startState.field(Ii)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Ii),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(Ii)!=i&&this.view.dispatch({effects:qh.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Ah(){return[Ii,zp]}var iy=/x/.unicode!=null?"gu":"g";function xo(){return qp}var Cp=U.line({class:"cm-activeLine"}),qp=Ge.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let r=i.lineBlockAt(n.head);r.from>e&&(t.push(Cp.range(r.from)),e=r.from)}return U.set(t)}},{decorations:i=>i.decorations});var uo=2e3;function Ap(i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>uo||t.off>uo||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let O=n;O<=r;O++){let l=i.doc.line(O);l.length<=a&&s.push(S.range(l.from+o,l.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let O=n;O<=r;O++){let l=i.doc.line(O),h=Bn(l.text,o,i.tabSize,!0);if(h<0)s.push(S.cursor(l.to));else{let c=Bn(l.text,a,i.tabSize);s.push(S.range(l.from+h,l.from+c))}}}return s}function Wp(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function Cl(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),r=t-n.from,s=r>uo?-1:r==n.length?Wp(i,e.clientX):xe(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:s,off:r}}function Up(i,e){let t=Cl(i,e),n=i.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(r.changes)}},get(r,s,o){let a=Cl(i,r);if(!a)return n;let O=Ap(i.state,t,a);return O.length?o?S.create(O.concat(n.ranges)):S.create(O):n}}:null}function Wh(i){let e=i?.eventFilter||(t=>t.altKey&&t.button==0);return X.mouseSelectionStyle.of((t,n)=>e(n)?Up(t,n):null)}var Fe=class extends Ie{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Fe.prototype.elementClass="";Fe.prototype.toDOM=void 0;Fe.prototype.mapMode=Oe.TrackBefore;Fe.prototype.startSide=Fe.prototype.endSide=-1;Fe.prototype.point=!0;var ar=Z.define(),Mp=Z.define();var Or=Z.define();var $o=Z.define({combine:i=>i.some(e=>e)});function Ep(i){let e=[Gp];return i&&i.fixed===!1&&e.push($o.of(!0)),e}var Gp=Ge.fromClass(class{constructor(i){this.view=i,this.domAfter=null,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(Or).map(e=>new Sr(i,e)),this.fixed=!i.state.facet($o);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}if(i.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet($o)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=H.iter(this.view.state.facet(ar),this.view.viewport.from),n=[],r=this.gutters.map(s=>new mo(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==Pe.Text&&o){po(t,n,a.from);for(let O of r)O.line(this.view,a,n);o=!1}else if(a.widget)for(let O of r)O.widget(this.view,a)}else if(s.type==Pe.Text){po(t,n,s.from);for(let o of r)o.line(this.view,s,n)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();i&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(i){let e=i.startState.facet(Or),t=i.state.facet(Or),n=i.docChanged||i.heightChanged||i.viewportChanged||!H.eq(i.startState.facet(ar),i.state.facet(ar),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(i)&&(n=!0);else{n=!0;let r=[];for(let s of t){let o=e.indexOf(s);o<0?r.push(new Sr(this.view,s)):(this.gutters[o].update(i),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:i=>X.scrollMargins.of(e=>{let t=e.plugin(i);if(!t||t.gutters.length==0||!t.fixed)return null;let n=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==te.LTR?{left:n,right:r}:{right:n,left:r}})});function ql(i){return Array.isArray(i)?i:[i]}function po(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var mo=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=H.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let a=new Pr(e,o,s,n);r.elements.push(a),r.dom.appendChild(a.dom)}else r.elements[this.i].update(e,o,s,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];po(this.cursor,r,t.from),n.length&&(r=r.concat(n));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let s of e.state.facet(Mp)){let o=s(e,t.widget,t);o&&(r||(r=[])).push(o)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},Sr=class{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,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let O=s.getBoundingClientRect();o=(O.top+O.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,r)&&r.preventDefault()});this.markers=ql(t.markers(e)),t.initialSpacer&&(this.spacer=new Pr(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=ql(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!H.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()}},Pr=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),Lp(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let a=o,O=ss(a,O,l)||o(a,O,l):o}return n}})}}),en=class extends Fe{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function _s(i,e){return i.state.facet(yi).formatNumber(e,i.state)}var Dp=Or.compute([yi],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(jp)},lineMarker(e,t,n){return n.some(r=>r.toDOM)?null:new en(_s(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(Bp)){let s=r(e,t,n);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(yi)!=e.state.facet(yi),initialSpacer(e){return new en(_s(e,Al(e.state.doc.lines)))},updateSpacer(e,t){let n=_s(t.view,Al(t.view.state.doc.lines));return n==e.number?e:new en(n)},domEventHandlers:i.facet(yi).domEventHandlers,side:"before"}));function Uh(i={}){return[yi.of(i),Ep(),Dp]}function Al(i){let e=9;for(;e{let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.head).from;r>t&&(t=r,e.push(Ip.range(r)))}return H.of(e)});function ko(){return Np}async function Mh(i){if(window.isSecureContext&&navigator.clipboard){await navigator.clipboard.writeText(i);return}let e=document.createElement("textarea");e.setAttribute("style","position: absolute; left: -1000px; top: -1000px;"),e.value=i,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}var Fp=0,we=class{constructor(e,t){this.from=e,this.to=t}},Y=class{constructor(e={}){this.id=Fp++,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=ie.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Y.closedBy=new Y({deserialize:i=>i.split(" ")});Y.openedBy=new Y({deserialize:i=>i.split(" ")});Y.group=new Y({deserialize:i=>i.split(" ")});Y.isolate=new Y({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});Y.contextHash=new Y({perNode:!0});Y.lookAhead=new Y({perNode:!0});Y.mounted=new Y({perNode:!0});var ii=class{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Y.mounted.id]}},Hp=Object.create(null),ie=class i{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Hp,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new i(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),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 r}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(Y.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 r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(Y.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}};ie.none=new ie("",Object.create(null),0,8);var St=class i{constructor(e){this.types=e;for(let t=0;t0;for(let O=this.cursor(o|G.IncludeAnonymous);;){let l=!1;if(O.from<=s&&O.to>=r&&(!a&&O.type.isAnonymous||t(O)!==!1)){if(O.firstChild())continue;l=!0}for(;l&&n&&(a||!O.type.isAnonymous)&&n(O),!O.nextSibling();){if(!O.parent())return;l=!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:qo(ie.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new i(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new i(ie.none,t,n,r)))}static build(e){return Jp(e)}};z.empty=new z(ie.none,[],[],0);var wo=class i{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 i(this.buffer,this.index)}},zt=class i{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return ie.none}toString(){let e=[];for(let t=0;t0));O=o[O+3]);return a}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,O=0;a=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function cn(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?a.length:-1;e!=l;e+=t){let h=a[e],c=O[e]+o.from;if(Nh(r,n,c,c+h.length)){if(h instanceof zt){if(s&G.ExcludeBuffers)continue;let f=h.findChild(0,h.buffer.length,t,n-c,r);if(f>-1)return new ni(new vo(o,h,e,c),null,f)}else if(s&G.IncludeAnonymous||!h.type.isAnonymous||Co(h)){let f;if(!(s&G.IgnoreMounts)&&(f=ii.get(h))&&!f.overlay)return new i(f.tree,c,e,o);let d=new i(h,c,e,o);return s&G.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?h.children.length-1:0,t,n,r)}}}if(s&G.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 r;if(!(n&G.IgnoreOverlays)&&(r=ii.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:o,to:a}of r.overlay)if((t>0?o<=s:o=s:a>s))return new i(r.tree,r.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 Gh(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Xo(i,e,t=e.length-1){for(let n=i;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}var vo=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},ni=class i extends wr{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:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new i(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&G.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new i(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 i(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 i(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new z(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Fh(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let a=new Xe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(cn(a,e,t,!1))}}return r?Fh(r):n}var xi=class{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 Xe)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:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Xe?(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:r}=this.buffer,s=r.findChild(this.index+4,r.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&G.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&G.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&G.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 r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}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:r}=this;if(r){if(e>0){if(this.index-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&G.IncludeAnonymous||a instanceof zt||!a.type.isAnonymous||Co(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Xo(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function Co(i){return i.children.some(e=>e instanceof zt||!e.type.isAnonymous||Co(e))}function Jp(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=n.types.length}=i,a=Array.isArray(t)?new wo(t,t.length):t,O=n.types,l=0,h=0;function c(P,w,k,M,A,I){let{id:C,start:_,end:j,size:E}=a,F=h,me=l;for(;E<0;)if(a.next(),E==-1){let $t=s[C];k.push($t),M.push(_-P);return}else if(E==-3){l=C;return}else if(E==-4){h=C;return}else throw new RangeError(`Unrecognized record size: ${E}`);let Re=O[C],tt,ae,qe=_-P;if(j-_<=r&&(ae=m(a.pos-w,A))){let $t=new Uint16Array(ae.size-ae.skip),Ae=a.pos-ae.size,it=$t.length;for(;a.pos>Ae;)it=Q(ae.start,$t,it);tt=new zt($t,j-ae.start,n),qe=ae.start-P}else{let $t=a.pos-E;a.next();let Ae=[],it=[],Bt=C>=o?C:-1,fi=0,zn=j;for(;a.pos>$t;)Bt>=0&&a.id==Bt&&a.size>=0?(a.end<=zn-r&&($(Ae,it,_,fi,a.end,zn,Bt,F,me),fi=Ae.length,zn=a.end),a.next()):I>2500?f(_,$t,Ae,it):c(_,$t,Ae,it,Bt,I+1);if(Bt>=0&&fi>0&&fi-1&&fi>0){let vO=d(Re,me);tt=qo(Re,Ae,it,0,Ae.length,0,j-_,vO,vO)}else tt=p(Re,Ae,it,j-_,F-j,me)}k.push(tt),M.push(qe)}function f(P,w,k,M){let A=[],I=0,C=-1;for(;a.pos>w;){let{id:_,start:j,end:E,size:F}=a;if(F>4)a.next();else{if(C>-1&&j=0;E-=3)_[F++]=A[E],_[F++]=A[E+1]-j,_[F++]=A[E+2]-j,_[F++]=F;k.push(new zt(_,A[2]-j,n)),M.push(j-P)}}function d(P,w){return(k,M,A)=>{let I=0,C=k.length-1,_,j;if(C>=0&&(_=k[C])instanceof z){if(!C&&_.type==P&&_.length==A)return _;(j=_.prop(Y.lookAhead))&&(I=M[C]+_.length+j)}return p(P,k,M,A,I,w)}}function $(P,w,k,M,A,I,C,_,j){let E=[],F=[];for(;P.length>M;)E.push(P.pop()),F.push(w.pop()+k-A);P.push(p(n.types[C],E,F,I-A,_-I,j)),w.push(A-k)}function p(P,w,k,M,A,I,C){if(I){let _=[Y.contextHash,I];C=C?[_].concat(C):[_]}if(A>25){let _=[Y.lookAhead,A];C=C?[_].concat(C):[_]}return new z(P,w,k,M,C)}function m(P,w){let k=a.fork(),M=0,A=0,I=0,C=k.end-r,_={size:0,start:0,skip:0};e:for(let j=k.pos-P;k.pos>j;){let E=k.size;if(k.id==w&&E>=0){_.size=M,_.start=A,_.skip=I,I+=4,M+=4,k.next();continue}let F=k.pos-E;if(E<0||F=o?4:0,Re=k.start;for(k.next();k.pos>F;){if(k.size<0)if(k.size==-3)me+=4;else break e;else k.id>=o&&(me+=4);k.next()}A=Re,M+=E,I+=me}return(w<0||M==P)&&(_.size=M,_.start=A,_.skip=I),_.size>4?_:void 0}function Q(P,w,k){let{id:M,start:A,end:I,size:C}=a;if(a.next(),C>=0&&M4){let j=a.pos-(C-4);for(;a.pos>j;)k=Q(P,w,k)}w[--k]=_,w[--k]=I-P,w[--k]=A-P,w[--k]=M}else C==-3?l=M:C==-4&&(h=M);return k}let g=[],T=[];for(;a.pos>0;)c(i.start||0,i.bufferStart||0,g,T,-1,0);let x=(e=i.length)!==null&&e!==void 0?e:g.length?T[0]+g[0].length:0;return new z(O[i.topID],g.reverse(),T.reverse(),x)}var Lh=new WeakMap;function kr(i,e){if(!i.isAnonymous||e instanceof zt||e.type!=i)return 1;let t=Lh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof z)){t=1;break}t+=kr(i,n)}Lh.set(e,t)}return t}function qo(i,e,t,n,r,s,o,a,O){let l=0;for(let $=n;$=h)break;w+=k}if(T==x+1){if(w>h){let k=$[x];d(k.children,k.positions,0,k.children.length,p[x]+g);continue}c.push($[x])}else{let k=p[T-1]+$[T-1].length-P;c.push(qo(i,$,p,x,T,P,k,null,O))}f.push(P+g-s)}}return d(e,t,n,r,0),(a||O)(c,f,o)}var ki=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof ni?this.setBuffer(e.context.buffer,e.index,t):e instanceof Xe&&this.map.set(e.tree,t)}get(e){return e instanceof ni?this.getBuffer(e.context.buffer,e.index):e instanceof Xe?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)}},Pt=class i{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,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 r=[new i(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let a=0,O=0,l=0;;a++){let h=a=n)for(;o&&o.from=f.from||c<=f.to||l){let d=Math.max(f.from,O)-l,$=Math.min(f.to,c)-l;f=d>=$?null:new i(d,$,f.tree,f.offset+l,a>0,!!h)}if(f&&r.push(f),o.to>c)break;o=snew we(r.from,r.to)):[new we(0,0)]:[new we(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}},Zo=class{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 wi(i){return(e,t,n,r)=>new _o(e,i,t,n,r)}var Xr=class{constructor(e,t,n,r,s){this.parser=e,this.parse=t,this.overlay=n,this.target=r,this.from=s}};function jh(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}var Vo=class{constructor(e,t,n,r,s,o,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}},Yo=new Y({perNode:!0}),_o=class{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,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 r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new z(n.type,n.children,n.positions,n.length,n.propValues.concat([[Yo,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[Y.mounted.id]=new ii(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.stoppedAt)a=!1;else if(e.hasNode(r)){if(t){let l=t.mounts.find(h=>h.frag.from<=r.from&&h.frag.to>=r.to&&h.mount.overlay);if(l)for(let h of l.mount.overlay){let c=h.from+l.pos,f=h.to+l.pos;c>=r.from&&f<=r.to&&!t.ranges.some(d=>d.fromc)&&t.ranges.push({from:c,to:f})}}a=!1}else if(n&&(o=em(n.ranges,r.from,r.to)))a=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew we(c.from-r.from,c.to-r.from)):null,r.tree,h.length?h[0].from:r.from)),s.overlay?h.length&&(n={ranges:h,depth:0,prev:n}):a=!1}}else if(t&&(O=t.predicate(r))&&(O===!0&&(O=new we(r.from,r.to)),O.from=0&&t.ranges[l].to==O.from?t.ranges[l]={from:t.ranges[l].from,to:O.to}:t.ranges.push(O)}if(a&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let l=Dh(this.ranges,t.ranges);l.length&&(jh(l),this.inner.splice(t.index,0,new Xr(t.parser,t.parser.startParse(this.input,Ih(t.mounts,l),l),t.ranges.map(h=>new we(h.from-t.start,h.to-t.start)),t.target,l[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function em(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Bh(i,e,t,n,r,s){if(e=e&&t.enter(n,1,G.IgnoreOverlays|G.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 z)t=t.children[0];else break}return!1}},zo=class{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(Yo))!==null&&t!==void 0?t:n.to,this.inner=new vr(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(Yo))!==null&&e!==void 0?e:t.to,this.inner=new vr(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];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(Y.mounted);if(o&&o.parser==t)for(let a=this.fragI;a=s.to)break;O.tree==this.curFrag.tree&&r.push({frag:O,pos:s.from-O.offset,mount:o})}}}return r}};function Dh(i,e){let t=null,n=e;for(let r=1,s=0;r=a)break;O.to<=o||(t||(n=t=e.slice()),O.froma&&t.splice(s+1,0,new we(a,O.to))):O.to>a?t[s--]=new we(a,O.to):t.splice(s--,1))}}return n}function im(i,e,t,n){let r=0,s=0,o=!1,a=!1,O=-1e9,l=[];for(;;){let h=r==i.length?1e9:o?i[r].to:i[r].from,c=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let f=Math.max(O,t),d=Math.min(h,c,n);fnew we(f.from+n,f.to+n)),c=im(e,h,O,l);for(let f=0,d=O;;f++){let $=f==c.length,p=$?l:c[f].from;if(p>d&&t.push(new Pt(d,p,r.tree,-o,s.from>=d||s.openStart,s.to<=p||s.openEnd)),$)break;d=c[f].to}}else t.push(new Pt(O,l,r.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}var nm=0,Ye=class i{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=nm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof i&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let r=new i(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Yr(e);return n=>n.modified.indexOf(t)>-1?n:Yr.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},rm=0,Yr=class i{constructor(e){this.name=e,this.instances=[],this.id=rm++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(a=>a.base==e&&sm(t,a.modified));if(n)return n;let r=[],s=new Ye(e.name,r,e,t);for(let a of t)a.instances.push(s);let o=om(t);for(let a of e.set)if(!a.modified.length)for(let O of o)r.push(i.get(a,O));return s}};function sm(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function om(i){let e=[[]];for(let t=0;tn.length-t.length)}function se(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,a=r;for(let c=0;;){if(a=="..."&&c>0&&c+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),c+=f[0].length,c==r.length)break;let d=r[c++];if(c==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);a=r.slice(c)}let O=s.length-1,l=s[O];if(!l)throw new RangeError("Invalid path: "+r);let h=new Xi(n,o,O>0?s.slice(0,O):null);e[l]=h.sort(e[l])}}return Jh.add(e)}var Jh=new Y,Xi=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let a of s)for(let O of a.set){let l=t[O.id];if(l){o=o?o+" "+l:l;break}}return o},scope:n}}function am(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function ec(i,e,t,n=0,r=i.length){let s=new Wo(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}var Wo=class{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,r,s){let{type:o,from:a,to:O}=e;if(a>=n||O<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let l=r,h=Om(e)||Xi.empty,c=am(s,h.tags);if(c&&(l&&(l+=" "),l+=c,h.mode==1&&(r+=(r?" ":"")+c)),this.startSpan(Math.max(t,a),l),h.opaque)return;let f=e.tree&&e.tree.prop(Y.mounted);if(f&&f.overlay){let d=e.node.enter(f.overlay[0].from+a,1),$=this.highlighters.filter(m=>!m.scope||m.scope(f.tree.type)),p=e.firstChild();for(let m=0,Q=a;;m++){let g=m=T||!e.nextSibling())););if(!g||T>n)break;Q=g.to+a,Q>t&&(this.highlightRange(d.cursor(),Math.max(t,g.from+a),Math.min(n,Q),"",$),this.startSpan(Math.min(n,Q),l))}p&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling());e.parent()}}};function Om(i){let e=i.type.prop(Jh);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var b=Ye.define,Rr=b(),Ct=b(),Hh=b(Ct),Kh=b(Ct),qt=b(),Zr=b(qt),Ao=b(qt),ut=b(),ri=b(ut),ct=b(),ft=b(),Uo=b(),fn=b(Uo),Vr=b(),u={comment:Rr,lineComment:b(Rr),blockComment:b(Rr),docComment:b(Rr),name:Ct,variableName:b(Ct),typeName:Hh,tagName:b(Hh),propertyName:Kh,attributeName:b(Kh),className:b(Ct),labelName:b(Ct),namespace:b(Ct),macroName:b(Ct),literal:qt,string:Zr,docString:b(Zr),character:b(Zr),attributeValue:b(Zr),number:Ao,integer:b(Ao),float:b(Ao),bool:b(qt),regexp:b(qt),escape:b(qt),color:b(qt),url:b(qt),keyword:ct,self:b(ct),null:b(ct),atom:b(ct),unit:b(ct),modifier:b(ct),operatorKeyword:b(ct),controlKeyword:b(ct),definitionKeyword:b(ct),moduleKeyword:b(ct),operator:ft,derefOperator:b(ft),arithmeticOperator:b(ft),logicOperator:b(ft),bitwiseOperator:b(ft),compareOperator:b(ft),updateOperator:b(ft),definitionOperator:b(ft),typeOperator:b(ft),controlOperator:b(ft),punctuation:Uo,separator:b(Uo),bracket:fn,angleBracket:b(fn),squareBracket:b(fn),paren:b(fn),brace:b(fn),content:ut,heading:ri,heading1:b(ri),heading2:b(ri),heading3:b(ri),heading4:b(ri),heading5:b(ri),heading6:b(ri),contentSeparator:b(ut),list:b(ut),quote:b(ut),emphasis:b(ut),strong:b(ut),link:b(ut),monospace:b(ut),strikethrough:b(ut),inserted:b(),deleted:b(),changed:b(),invalid:b(),meta:Vr,documentMeta:b(Vr),annotation:b(Vr),processingInstruction:b(Vr),definition:Ye.defineModifier("definition"),constant:Ye.defineModifier("constant"),function:Ye.defineModifier("function"),standard:Ye.defineModifier("standard"),local:Ye.defineModifier("local"),special:Ye.defineModifier("special")};for(let i in u){let e=u[i];e instanceof Ye&&(e.name=i)}var uy=Mo([{tag:u.link,class:"tok-link"},{tag:u.heading,class:"tok-heading"},{tag:u.emphasis,class:"tok-emphasis"},{tag:u.strong,class:"tok-strong"},{tag:u.keyword,class:"tok-keyword"},{tag:u.atom,class:"tok-atom"},{tag:u.bool,class:"tok-bool"},{tag:u.url,class:"tok-url"},{tag:u.labelName,class:"tok-labelName"},{tag:u.inserted,class:"tok-inserted"},{tag:u.deleted,class:"tok-deleted"},{tag:u.literal,class:"tok-literal"},{tag:u.string,class:"tok-string"},{tag:u.number,class:"tok-number"},{tag:[u.regexp,u.escape,u.special(u.string)],class:"tok-string2"},{tag:u.variableName,class:"tok-variableName"},{tag:u.local(u.variableName),class:"tok-variableName tok-local"},{tag:u.definition(u.variableName),class:"tok-variableName tok-definition"},{tag:u.special(u.variableName),class:"tok-variableName2"},{tag:u.definition(u.propertyName),class:"tok-propertyName tok-definition"},{tag:u.typeName,class:"tok-typeName"},{tag:u.namespace,class:"tok-namespace"},{tag:u.className,class:"tok-className"},{tag:u.macroName,class:"tok-macroName"},{tag:u.propertyName,class:"tok-propertyName"},{tag:u.operator,class:"tok-operator"},{tag:u.comment,class:"tok-comment"},{tag:u.meta,class:"tok-meta"},{tag:u.invalid,class:"tok-invalid"},{tag:u.punctuation,class:"tok-punctuation"}]);var Eo,Tt=new Y;function Ri(i){return Z.define({combine:i?e=>e.concat(i):void 0})}var qr=new Y,fe=class{constructor(e,t,n=[],r=""){this.data=e,this.name=r,D.prototype.hasOwnProperty("tree")||Object.defineProperty(D.prototype,"tree",{get(){return L(this)}}),this.parser=t,this.extension=[vi.of(this),D.languageData.of((s,o,a)=>{let O=tc(s,o,a),l=O.type.prop(Tt);if(!l)return[];let h=s.facet(l),c=O.type.prop(qr);if(c){let f=O.resolve(o-O.from,a);for(let d of c)if(d.test(f,s)){let $=s.facet(d.facet);return d.type=="replace"?$:$.concat(h)}}return h})].concat(n)}isActiveAt(e,t,n=-1){return tc(e,t,n).type.prop(Tt)==this.data}findRegions(e){let t=e.facet(vi);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(Tt)==this.data){n.push({from:o,to:o+s.length});return}let a=s.prop(Y.mounted);if(a){if(a.tree.prop(Tt)==this.data){if(a.overlay)for(let O of a.overlay)n.push({from:O.from+o,to:O.to+o});else n.push({from:o,to:o+s.length});return}else if(a.overlay){let O=n.length;if(r(a.tree,a.overlay[0].from+o),n.length>O)return}}for(let O=0;On.isTop?t:void 0)]}),e.name)}configure(e,t){return new i(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function L(i){let e=i.field(fe.state,!1);return e?e.tree:z.empty}var Bo=class{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=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},un=null,si=class i{constructor(e,t,n=[],r,s,o,a,O){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=O,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new i(e,t,[],z.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Bo(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=z.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Pt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=un;un=this;try{return e()}finally{un=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ic(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let O=[];if(e.iterChangedRanges((l,h,c,f)=>O.push({fromA:l,toA:h,fromB:c,toB:f})),n=Pt.applyChanges(n,O),r=z.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let l of this.skipped){let h=e.mapPos(l.from,1),c=e.mapPos(l.to,-1);he.from&&(this.fragments=ic(this.fragments,r,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 yt{createParse(t,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let O=un;if(O){for(let l of r)O.tempSkipped.push(l);e&&(O.scheduleOn=O.scheduleOn?Promise.all([O.scheduleOn,e]):e)}return this.parsedPos=o,new z(ie.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 un}};function ic(i,e,t){return Pt.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var dn=class i{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 i(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=si.create(e.facet(vi).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new i(n)}};fe.state=ge.define({create:dn.init,update(i,e){for(let t of e.effects)if(t.is(fe.setState))return t.value;return e.startState.facet(vi)!=e.state.facet(vi)?dn.init(e.state):i.apply(e)}});var ac=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ac=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var Go=typeof navigator<"u"&&(!((Eo=navigator.scheduling)===null||Eo===void 0)&&Eo.isInputPending)?()=>navigator.scheduling.isInputPending():null,lm=Ge.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(fe.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(fe.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=ac(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,O=s.context.work(()=>Go&&Go()||Date.now()>o,r+(a?0:1e5));this.chunkBudget-=Date.now()-t,(O||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:fe.setState.of(new dn(s.context))})),this.chunkBudget>0&&!(O&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ee(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()}}}),vi=Z.define({combine(i){return i.length?i[0]:null},enables:i=>[fe.state,lm,X.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]}),oe=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},$n=class i{constructor(e,t,n,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,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 i(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let n=/\.([^.]+)$/.exec(t);if(n){for(let r of e)if(r.extensions.indexOf(n[1])>-1)return r}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(n)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}},hm=Z.define(),Wt=Z.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function At(i){let e=i.facet(Wt);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function mn(i,e){let t="",n=i.tabSize,r=i.facet(Wt)[0];if(r==" "){for(;e>=n;)t+=" ",e-=n;r=" "}for(let s=0;s=e?cm(i,t,e):null}var oi=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=At(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,t=e.length){return xe(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},de=new Y;function cm(i,e,t){let n=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=n.node){let s=[];for(let o=r;o&&!(o.fromn.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return Oc(n,i,t)}function Oc(i,e,t){for(let n=i;n;n=n.next){let r=um(n.node);if(r)return r(Do.create(e,t,n))}return 0}function fm(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function um(i){let e=i.type.prop(de);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(Y.closedBy))){let r=i.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>lc(o,!0,1,void 0,s&&!fm(o)?r.from:void 0)}return i.parent==null?dm:null}function dm(){return 0}var Do=class i extends oi{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 i(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($m(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Oc(this.context.next,this.base,this.pos)}};function $m(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function pm(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let r=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let a=t.to;;){let O=e.childAfter(a);if(!O||O==n)return null;if(!O.type.isSkipped){if(O.from>=o)return null;let l=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+l}}a=O.to}}function Ar({closing:i,align:e=!0,units:t=1}){return n=>lc(n,e,t,i)}function lc(i,e,t,n,r){let s=i.textAfter,o=s.match(/^\s*/)[0].length,a=n&&s.slice(o,o+n.length)==n||r==i.pos+o,O=e?pm(i):null;return O?a?i.column(O.from):i.column(O.to):i.baseIndent+(a?0:i.unit*t)}var hc=i=>i.baseIndent;function _e({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}var cc=Z.define(),ye=new Y;function Ut(i){let e=i.firstChild,t=i.lastChild;return e&&e.toa.prop(Tt)==o.data:o?a=>a==o:void 0,this.style=Mo(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=n?new Ue(n):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},Io=Z.define(),fc=Z.define({combine(i){return i.length?[i[0]]:null}});function Lo(i){let e=i.facet(Io);return e.length?e:i.facet(fc)}function ea(i,e){let t=[mm],n;return i instanceof bt&&(i.module&&t.push(X.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push(fc.of(i)):n?t.push(Io.computeN([X.darkTheme],r=>r.facet(X.darkTheme)==(n=="dark")?[i]:[])):t.push(Io.of(i)),t}var No=class{constructor(e){this.markCache=Object.create(null),this.tree=L(e.state),this.decorations=this.buildDeco(e,Lo(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=L(e.state),n=Lo(e.state),r=n!=Lo(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return U.none;let n=new Ht;for(let{from:r,to:s}of e.visibleRanges)ec(this.tree,t,(o,a,O)=>{n.add(o,a,this.markCache[O]||(this.markCache[O]=U.mark({class:O})))},r,s);return n.finish()}},mm=nt.high(Ge.fromClass(No,{decorations:i=>i.decorations})),yy=bt.define([{tag:u.meta,color:"#404740"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),Qm=X.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),uc=1e4,dc="()[]{}",$c=Z.define({combine(i){return Xt(i,{afterCursor:!0,brackets:dc,maxScanDistance:uc,renderMatch:Pm})}}),gm=U.mark({class:"cm-matchingBracket"}),Sm=U.mark({class:"cm-nonmatchingBracket"});function Pm(i){let e=[],t=i.matched?gm:Sm;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}var ym=ge.define({create(){return U.none},update(i,e){if(!e.docChanged&&!e.selection)return i;let t=[],n=e.state.facet($c);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=He(e.state,r.head,-1,n)||r.head>0&&He(e.state,r.head-1,1,n)||n.afterCursor&&(He(e.state,r.head,1,n)||r.headX.decorations.from(i)}),Tm=[ym,Qm];function pc(i={}){return[$c.of(i),Tm]}var Qn=new Y;function Fo(i,e,t){let n=i.prop(e<0?Y.openedBy:Y.closedBy);if(n)return n;if(i.name.length==1){let r=t.indexOf(i.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Ho(i){let e=i.type.prop(Qn);return e?e(i.node):i}function He(i,e,t,n={}){let r=n.maxScanDistance||uc,s=n.brackets||dc,o=L(i),a=o.resolveInner(e,t);for(let O=a;O;O=O.parent){let l=Fo(O.type,t,s);if(l&&O.from0?e>=h.from&&eh.from&&e<=h.to))return bm(i,e,t,O,h,l,s)}}return xm(i,e,t,o,a.type,r,s)}function bm(i,e,t,n,r,s,o){let a=n.parent,O={from:r.from,to:r.to},l=0,h=a?.cursor();if(h&&(t<0?h.childBefore(n.from):h.childAfter(n.to)))do if(t<0?h.to<=n.from:h.from>=n.to){if(l==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let l={from:t<0?e-1:e,to:t>0?e+1:e},h=i.doc.iterRange(e,t>0?i.doc.length:0),c=0;for(let f=0;!h.next().done&&f<=s;){let d=h.value;t<0&&(f+=d.length);let $=e+f*t;for(let p=t>0?0:d.length-1,m=t>0?d.length:-1;p!=m;p+=t){let Q=o.indexOf(d[p]);if(!(Q<0||n.resolveInner($+p,1).type!=r))if(Q%2==0==t>0)c++;else{if(c==1)return{start:l,end:{from:$+p,to:$+p+1},matched:Q>>1==O>>1};c--}}t>0&&(f+=d.length)}return h.done?{start:l,matched:!1}:null}function nc(i,e,t,n=0,r=0){e==null&&(e=i.search(/[^\s\u00a0]/),e==-1&&(e=i.length));let s=r;for(let o=n;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}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.lastColumnPosn?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return r(s)==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}};function km(i){return{name:i.name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||wm,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||ia,mergeTokens:i.mergeTokens!==!1}}function wm(i){if(typeof i!="object")return i;let e={};for(let t in i){let n=i[t];e[t]=n instanceof Array?n.slice():n}return e}var rc=new WeakMap,zr=class i extends fe{constructor(e){let t=Ri(e.languageData),n=km(e),r,s=new class extends yt{createParse(o,a,O){return new Ko(r,o,a,O)}};super(t,s,[],e.name),this.topNode=Zm(t,this),r=this,this.streamParser=n,this.stateAfter=new Y({perNode:!0}),this.tokenTable=e.tokenTable?new Cr(n.tokenTable):Rm}static define(e){return new i(e)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=rc.get(e.state),t!=null&&t1e4)return null;for(;s=n&&t+e.length<=r&&e.prop(i.stateAfter);if(s)return{state:i.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],O=t+e.positions[o],l=a instanceof z&&O=e.length)return e;!r&&t==0&&e.type==i.topNode&&(r=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],O;if(ot&&ta(i,s.tree,0-s.offset,t,a),l;if(O&&O.pos<=n&&(l=mc(i,s.tree,t+s.offset,O.pos+s.offset,!1)))return{state:O.state,tree:l}}return{state:i.streamParser.startState(r?At(r):4),tree:z.empty}}var Ko=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=si.get(),o=r[0].from,{state:a,tree:O}=Xm(e,n,o,this.to,s?.state);this.state=a,this.parsedPos=this.chunkStart=o+O.length;for(let l=0;ll.from<=s.viewport.from&&l.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(At(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=si.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=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==` `&&(t="");else{let n=t.indexOf(` -`);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 r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=n||(t=t.slice(0,s-(n-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,a=this.lineAfter(o);t+=a,n=o+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(n>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let a=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=n:this.chunk.push(e,t,n,s),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new _r(t,e?e.state.tabSize:4,e?At(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=Qc(s.token,o,this.state);if(a&&(r=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPose.start)return r}throw new Error("Stream parser failed to advance stream.")}var ia=Object.create(null),pn=[ie.none],vm=new St(pn),sc=[],oc=Object.create(null),gc=Object.create(null);for(let[i,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"]])gc[i]=Sc(ia,e);var Cr=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),gc)}resolve(e){return e?this.table[e]||(this.table[e]=Sc(this.extra,e)):0}},Rm=new Cr(ia);function jo(i,e){sc.indexOf(i)>-1||(sc.push(i),console.warn(e))}function Sc(i,e){let t=[];for(let a of e.split(" ")){let O=[];for(let l of a.split(".")){let h=i[l]||u[l];h?typeof h=="function"?O.length?O=O.map(h):jo(l,`Modifier ${l} used at start of tag`):O.length?jo(l,`Tag ${l} used as modifier`):O=Array.isArray(h)?h:[h]:jo(l,`Unknown highlighting tag ${l}`)}for(let l of O)t.push(l)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+t.map(a=>a.id),s=oc[r];if(s)return s.id;let o=oc[r]=ie.define({id:pn.length,name:n,props:[se({[n]:t})]});return pn.push(o),o.id}function Zm(i,e){let t=ie.define({id:pn.length,name:"Document",props:[Tt.add(()=>i),de.add(()=>n=>e.getIndent(n))],top:!0});return pn.push(t),t}var Ty={rtl:U.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:te.RTL}),ltr:U.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:te.LTR}),auto:U.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Vm=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=la(i.state,t.from);return n.line?Ym(i):n.block?zm(i):!1};function Oa(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}var Ym=Oa(Am,0);var _m=Oa(vc,0);var zm=Oa((i,e)=>vc(i,e,qm(e)),0);function la(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var gn=50;function Cm(i,{open:e,close:t},n,r){let s=i.sliceDoc(n-gn,n),o=i.sliceDoc(r,r+gn),a=/\s*$/.exec(s)[0].length,O=/^\s*/.exec(o)[0].length,l=s.length-a;if(s.slice(l-e.length,l)==e&&o.slice(O,O+t.length)==t)return{open:{pos:n-a,margin:a&&1},close:{pos:r+O,margin:O&&1}};let h,c;r-n<=2*gn?h=c=i.sliceDoc(n,r):(h=i.sliceDoc(n,n+gn),c=i.sliceDoc(r-gn,r));let f=/^\s*/.exec(h)[0].length,d=/\s*$/.exec(c)[0].length,$=c.length-d-t.length;return h.slice(f,f+e.length)==e&&c.slice($,$+t.length)==t?{open:{pos:n+f+e.length,margin:/\s/.test(h.charAt(f+e.length))?1:0},close:{pos:r-d-t.length,margin:/\s/.test(c.charAt($-1))?1:0}}:null}function qm(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),r=t.to<=n.to?n:i.doc.lineAt(t.to);r.from>n.from&&r.from==t.to&&(r=t.to==n.to+1?n:i.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function vc(i,e,t=e.selection.ranges){let n=t.map(s=>la(e,s.from).block);if(!n.every(s=>s))return null;let r=t.map((s,o)=>Cm(e,n[o],s.from,s.to));if(i!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(i!=1&&r.some(s=>s)){let s=[];for(let o=0,a;or&&(s==o||o>c.from)){r=c.from;let f=/^\s*/.exec(c.text)[0].length,d=f==c.length,$=c.text.slice(f,f+l.length)==l?f:-1;fs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:O,indent:l,empty:h,single:c}of n)(c||!h)&&s.push({from:a.from+l,insert:O+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:O}of n)if(a>=0){let l=o.from+a,h=l+O.length;o.text[h-o.from]==" "&&h++,s.push({from:l,to:h})}return{changes:s}}return null}var ra=be.define(),Wm=be.define(),Um=R.define(),Rc=R.define({combine(i){return Xt(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Zc=ge.define({create(){return ai.empty},update(i,e){let t=e.state.facet(Rc),n=e.annotation(ra);if(n){let O=Ke.fromTransaction(e,n.selection),l=n.side,h=l==0?i.undone:i.done;return O?h=Ur(h,h.length,t.minDepth,O):h=zc(h,e.startState.selection),new ai(l==0?n.rest:h,l==0?h:n.rest)}let r=e.annotation(Wm);if((r=="full"||r=="before")&&(i=i.isolate()),e.annotation(ne.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let s=Ke.fromTransaction(e),o=e.annotation(ne.time),a=e.annotation(ne.userEvent);return s?i=i.addChanges(s,o,a,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(r=="full"||r=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new ai(i.done.map(Ke.fromJSON),i.undone.map(Ke.fromJSON))}});function Vc(i={}){return[Zc,Rc.of(i),X.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?Yc:e.inputType=="historyRedo"?sa:null;return n?(e.preventDefault(),n(t)):!1}})]}function Mr(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let r=t.field(Zc,!1);if(!r)return!1;let s=r.pop(i,t,e);return s?(n(s),!0):!1}}var Yc=Mr(0,!1),sa=Mr(1,!1),Mm=Mr(0,!0),Em=Mr(1,!0);var Ke=class i{constructor(e,t,n,r,s){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new i(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(r=>r.toJSON())}}static fromJSON(e){return new i(e.changes&&Qe.fromJSON(e.changes),[],e.mapped&&pt.fromJSON(e.mapped),e.startSelection&&S.fromJSON(e.startSelection),e.selectionsAfter.map(S.fromJSON))}static fromTransaction(e,t){let n=je;for(let r of e.startState.facet(Um)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new i(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,je)}static selection(e){return new i(void 0,je,void 0,void 0,e)}};function Ur(i,e,t,n){let r=e+1>t+20?e-t-1:0,s=i.slice(r,e);return s.push(n),s}function Gm(i,e){let t=[],n=!1;return i.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,a)=>{for(let O=0;O=l&&o<=h&&(n=!0)}}),n}function Lm(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function _c(i,e){return i.length?e.length?i.concat(e):i:e}var je=[],jm=200;function zc(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-jm));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Ur(i,i.length-1,1e9,t.setSelAfter(n)))}else return[Ke.selection([e])]}function Bm(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function na(i,e){if(!i.length)return i;let t=i.length,n=je;for(;t;){let r=Dm(i[t-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=i.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,n=r.selectionsAfter}return n.length?[Ke.selection(n)]:je}function Dm(i,e,t){let n=_c(i.selectionsAfter.length?i.selectionsAfter.map(a=>a.map(e)):je,t);if(!i.changes)return Ke.selection(n);let r=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new Ke(r,B.mapEffects(i.effects,e),o,i.startSelection.map(s),n)}var Im=/^(input\.type|delete)($|\.)/,ai=class i{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new i(this.done,this.undone):this}addChanges(e,t,n,r,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!n||Im.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):Er(t,e))}function $e(i){return i.textDirectionAt(i.state.selection.main.head)==te.LTR}var Ac=i=>qc(i,!$e(i)),Wc=i=>qc(i,$e(i));function Uc(i,e){return Je(i,t=>t.empty?i.moveByGroup(t,e):Er(t,e))}var Nm=i=>Uc(i,!$e(i)),Fm=i=>Uc(i,$e(i));var Zy=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function Hm(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function Gr(i,e,t){let n=L(i).resolveInner(e.head),r=t?Y.closedBy:Y.openedBy;for(let O=e.head;;){let l=t?n.childAfter(O):n.childBefore(O);if(!l)break;Hm(i,l,r)?n=l:O=t?l.to:l.from}let s=n.type.prop(r),o,a;return s&&(o=t?He(i,n.from,1):He(i,n.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?n.to:n.from,S.cursor(a,t?-1:1)}var Km=i=>Je(i,e=>Gr(i.state,e,!$e(i))),Jm=i=>Je(i,e=>Gr(i.state,e,$e(i)));function Mc(i,e){return Je(i,t=>{if(!t.empty)return Er(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}var Ec=i=>Mc(i,!1),Gc=i=>Mc(i,!0);function Lc(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):Er(o,e));if(r.eq(n.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),a=i.scrollDOM.getBoundingClientRect(),O=a.top+t.marginTop,l=a.bottom-t.marginBottom;o&&o.top>O&&o.bottomjc(i,!1),oa=i=>jc(i,!0);function Mt(i,e,t){let n=i.lineBlockAt(e.head),r=i.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?n.to:n.from)&&(r=i.moveToLineBoundary(e,t,!1)),!t&&r.head==n.from&&n.length){let s=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=S.cursor(n.from+s))}return r}var eQ=i=>Je(i,e=>Mt(i,e,!0)),tQ=i=>Je(i,e=>Mt(i,e,!1)),iQ=i=>Je(i,e=>Mt(i,e,!$e(i))),nQ=i=>Je(i,e=>Mt(i,e,$e(i))),rQ=i=>Je(i,e=>S.cursor(i.lineBlockAt(e.head).from,1)),sQ=i=>Je(i,e=>S.cursor(i.lineBlockAt(e.head).to,-1));function oQ(i,e,t){let n=!1,r=Zi(i.selection,s=>{let o=He(i,s.head,-1)||He(i,s.head,1)||s.head>0&&He(i,s.head-1,1)||s.headoQ(i,e,!1);function Be(i,e){let t=Zi(i.state.selection,n=>{let r=e(n);return S.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(dt(i.state,t)),!0)}function Bc(i,e){return Be(i,t=>i.moveByChar(t,e))}var Dc=i=>Bc(i,!$e(i)),Ic=i=>Bc(i,$e(i));function Nc(i,e){return Be(i,t=>i.moveByGroup(t,e))}var OQ=i=>Nc(i,!$e(i)),lQ=i=>Nc(i,$e(i));var hQ=i=>Be(i,e=>Gr(i.state,e,!$e(i))),cQ=i=>Be(i,e=>Gr(i.state,e,$e(i)));function Fc(i,e){return Be(i,t=>i.moveVertically(t,e))}var Hc=i=>Fc(i,!1),Kc=i=>Fc(i,!0);function Jc(i,e){return Be(i,t=>i.moveVertically(t,e,Lc(i).height))}var yc=i=>Jc(i,!1),Tc=i=>Jc(i,!0),fQ=i=>Be(i,e=>Mt(i,e,!0)),uQ=i=>Be(i,e=>Mt(i,e,!1)),dQ=i=>Be(i,e=>Mt(i,e,!$e(i))),$Q=i=>Be(i,e=>Mt(i,e,$e(i))),pQ=i=>Be(i,e=>S.cursor(i.lineBlockAt(e.head).from)),mQ=i=>Be(i,e=>S.cursor(i.lineBlockAt(e.head).to)),bc=({state:i,dispatch:e})=>(e(dt(i,{anchor:0})),!0),xc=({state:i,dispatch:e})=>(e(dt(i,{anchor:i.doc.length})),!0),kc=({state:i,dispatch:e})=>(e(dt(i,{anchor:i.selection.main.anchor,head:0})),!0),wc=({state:i,dispatch:e})=>(e(dt(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),QQ=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),gQ=({state:i,dispatch:e})=>{let t=Lr(i).map(({from:n,to:r})=>S.range(n,Math.min(r+1,i.doc.length)));return e(i.update({selection:S.create(t),userEvent:"select"})),!0},SQ=({state:i,dispatch:e})=>{let t=Zi(i.selection,n=>{let r=L(i),s=r.resolveStack(n.from,1);if(n.empty){let o=r.resolveStack(n.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from=n.to||a.to>n.to&&a.from<=n.from)&&o.next)return S.range(a.to,a.from)}return n});return t.eq(i.selection)?!1:(e(dt(i,t)),!0)},PQ=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=S.create([t.main]):t.main.empty||(n=S.create([S.cursor(t.main.head)])),n?(e(dt(i,n)),!0):!1};function Sn(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,r=n.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let O=e(s);Oo&&(t="delete.forward",O=Wr(i,O,!0)),o=Math.min(o,O),a=Math.max(a,O)}else o=Wr(i,o,!1),a=Wr(i,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:S.cursor(o,or(i)))n.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}var ef=(i,e,t)=>Sn(i,n=>{let r=n.from,{state:s}=i,o=s.doc.lineAt(r),a,O;if(t&&!e&&r>o.from&&ref(i,!1,!0);var tf=i=>ef(i,!0,!1),nf=(i,e)=>Sn(i,t=>{let n=t.head,{state:r}=i,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let a=null;;){if(n==(e?s.to:s.from)){n==t.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let O=le(s.text,n-s.from,e)+s.from,l=s.text.slice(Math.min(n,O)-s.from,Math.max(n,O)-s.from),h=o(l);if(a!=null&&h!=a)break;(l!=" "||n!=t.head)&&(a=h),n=O}return n}),rf=i=>nf(i,!1),yQ=i=>nf(i,!0),TQ=i=>Sn(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headSn(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),xQ=i=>Sn(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:q.of(["",""])},range:S.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},wQ=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let r=n.from,s=i.doc.lineAt(r),o=r==s.from?r-1:le(s.text,r-s.from,!1)+s.from,a=r==s.to?r+1:le(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:i.doc.slice(r,a).append(i.doc.slice(o,r))},range:S.cursor(a)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Lr(i){let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.from),s=i.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=i.doc.lineAt(n.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});t=s.number+1}return e}function sf(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let s of Lr(i)){if(t?s.to==i.doc.length:s.from==0)continue;let o=i.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+i.lineBreak});for(let O of s.ranges)r.push(S.range(Math.min(i.doc.length,O.anchor+a),Math.min(i.doc.length,O.head+a)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let O of s.ranges)r.push(S.range(O.anchor-a,O.head-a))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:S.create(r,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var XQ=({state:i,dispatch:e})=>sf(i,e,!1),vQ=({state:i,dispatch:e})=>sf(i,e,!0);function of(i,e,t){if(i.readOnly)return!1;let n=[];for(let r of Lr(i))t?n.push({from:r.from,insert:i.doc.slice(r.from,r.to)+i.lineBreak}):n.push({from:r.to,insert:i.lineBreak+i.doc.slice(r.from,r.to)});return e(i.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var RQ=({state:i,dispatch:e})=>of(i,e,!1),ZQ=({state:i,dispatch:e})=>of(i,e,!0),VQ=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(Lr(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(i.lineWrapping){let o=i.lineBlockAt(r.head),a=i.coordsAtPos(r.head,r.assoc||1);a&&(s=o.bottom+i.documentTop-a.bottom+i.defaultLineHeight/2)}return i.moveVertically(r,!0,s)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function YQ(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=L(i).resolveInner(e),n=t.childBefore(e),r=t.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(Y.closedBy))&&s.indexOf(r.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(r.from).from&&!/\S/.test(i.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}var Xc=af(!1),_Q=af(!0);function af(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,a=e.doc.lineAt(s),O=!i&&s==o&&YQ(e,s);i&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let l=new oi(e,{simulateBreak:s,simulateDoubleBreak:!!O}),h=Jo(l,s);for(h==null&&(h=xe(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let r=[];for(let o=n.from;o<=n.to;){let a=i.doc.lineAt(o);a.number>t&&(n.empty||n.to>a.from)&&(e(a,r,n),t=a.number),o=a.to+1}let s=i.changes(r);return{changes:r,range:S.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}var zQ=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new oi(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=ha(i,(s,o,a)=>{let O=Jo(n,s.from);if(O==null)return;/\S/.test(s.text)||(O=0);let l=/^\s*/.exec(s.text)[0],h=mn(i,O);(l!=h||a.fromi.readOnly?!1:(e(i.update(ha(i,(t,n)=>{n.push({from:t.from,insert:i.facet(Wt)})}),{userEvent:"input.indent"})),!0),lf=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(ha(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=xe(r,i.tabSize),o=0,a=mn(i,Math.max(0,s-At(i)));for(;o(i.setTabFocusMode(),!0);var qQ=[{key:"Ctrl-b",run:Ac,shift:Dc,preventDefault:!0},{key:"Ctrl-f",run:Wc,shift:Ic},{key:"Ctrl-p",run:Ec,shift:Hc},{key:"Ctrl-n",run:Gc,shift:Kc},{key:"Ctrl-a",run:rQ,shift:pQ},{key:"Ctrl-e",run:sQ,shift:mQ},{key:"Ctrl-d",run:tf},{key:"Ctrl-h",run:aa},{key:"Ctrl-k",run:TQ},{key:"Ctrl-Alt-h",run:rf},{key:"Ctrl-o",run:kQ},{key:"Ctrl-t",run:wQ},{key:"Ctrl-v",run:oa}],AQ=[{key:"ArrowLeft",run:Ac,shift:Dc,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Nm,shift:OQ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:iQ,shift:dQ,preventDefault:!0},{key:"ArrowRight",run:Wc,shift:Ic,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Fm,shift:lQ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:nQ,shift:$Q,preventDefault:!0},{key:"ArrowUp",run:Ec,shift:Hc,preventDefault:!0},{mac:"Cmd-ArrowUp",run:bc,shift:kc},{mac:"Ctrl-ArrowUp",run:Pc,shift:yc},{key:"ArrowDown",run:Gc,shift:Kc,preventDefault:!0},{mac:"Cmd-ArrowDown",run:xc,shift:wc},{mac:"Ctrl-ArrowDown",run:oa,shift:Tc},{key:"PageUp",run:Pc,shift:yc},{key:"PageDown",run:oa,shift:Tc},{key:"Home",run:tQ,shift:uQ,preventDefault:!0},{key:"Mod-Home",run:bc,shift:kc},{key:"End",run:eQ,shift:fQ,preventDefault:!0},{key:"Mod-End",run:xc,shift:wc},{key:"Enter",run:Xc,shift:Xc},{key:"Mod-a",run:QQ},{key:"Backspace",run:aa,shift:aa},{key:"Delete",run:tf},{key:"Mod-Backspace",mac:"Alt-Backspace",run:rf},{key:"Mod-Delete",mac:"Alt-Delete",run:yQ},{mac:"Mod-Backspace",run:bQ},{mac:"Mod-Delete",run:xQ}].concat(qQ.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),ca=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Km,shift:hQ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Jm,shift:cQ},{key:"Alt-ArrowUp",run:XQ},{key:"Shift-Alt-ArrowUp",run:RQ},{key:"Alt-ArrowDown",run:vQ},{key:"Shift-Alt-ArrowDown",run:ZQ},{key:"Escape",run:PQ},{key:"Mod-Enter",run:_Q},{key:"Alt-l",mac:"Ctrl-l",run:gQ},{key:"Mod-i",run:SQ,preventDefault:!0},{key:"Mod-[",run:lf},{key:"Mod-]",run:Of},{key:"Mod-Alt-\\",run:zQ},{key:"Shift-Mod-k",run:VQ},{key:"Shift-Mod-\\",run:aQ},{key:"Mod-/",run:Vm},{key:"Alt-A",run:_m},{key:"Ctrl-m",mac:"Shift-Alt-m",run:CQ}].concat(AQ),hf={key:"Tab",run:Of,shift:lf};var WQ="#e5c07b",cf="#e06c75",UQ="#56b6c2",MQ="#ffffff",jr="#abb2bf",ua="#7d8799",EQ="#61afef",GQ="#98c379",ff="#d19a66",LQ="#c678dd",jQ="#21252b",uf="#2c313a",df="#282c34",fa="#353a42",BQ="#3E4451",$f="#528bff";var pf=X.theme({"&":{color:jr,backgroundColor:df},".cm-content":{caretColor:$f},".cm-cursor, .cm-dropCursor":{borderLeftColor:$f},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:BQ},".cm-panels":{backgroundColor:jQ,color:jr},".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:df,color:ua,border:"none"},".cm-activeLineGutter":{backgroundColor:uf},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:fa},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:fa,borderBottomColor:fa},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:uf,color:jr}}},{dark:!0}),mf=bt.define([{tag:u.keyword,color:LQ},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:cf},{tag:[u.function(u.variableName),u.labelName],color:EQ},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:ff},{tag:[u.definition(u.name),u.separator],color:jr},{tag:[u.typeName,u.className,u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:WQ},{tag:[u.operator,u.operatorKeyword,u.url,u.escape,u.regexp,u.link,u.special(u.string)],color:UQ},{tag:[u.meta,u.comment],color:ua},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.link,color:ua,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:cf},{tag:[u.atom,u.bool,u.special(u.variableName)],color:ff},{tag:[u.processingInstruction,u.string,u.inserted],color:GQ},{tag:u.invalid,color:MQ}]);var DQ=bt.define([{tag:u.meta,color:"#388938"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.compareOperator,color:"#708"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),IQ={"&":{backgroundColor:"#FFF",color:"#000"},"&.cm-focused":{outline:"none"},".cm-line":{lineHeight:"1.6"}};function Qf(i){let e=document.documentElement.classList.contains("dark-mode"),t=e?pf:X.theme(IQ),n=e?mf:DQ,r={darkModeActive:e,registerViewTheme(s){let o=s();o&&(t=X.theme(o))},registerHighlightStyle(s){let o=s(u)||[];o.length&&(n=bt.define(o))}};return window.$events.emitPublic(i,"library-cm6::configure-theme",r),[t,ea(n)]}function gf(i){return[Qf(i),Uh(),zh(),Ah(),pc(),Wh()]}function NQ(){let i=new mt,e={focus(t,n){n.dispatch({effects:i.reconfigure([ko(),xo()])})},blur(t,n){n.dispatch({effects:i.reconfigure([])})}};return[i.of([]),X.domEventHandlers(e)]}function da(i){return[...gf(i),NQ(),ht.of([...ca]),D.readOnly.of(!0)]}function Br(i){return[...gf(i),ko(),xo(),Vc(),ht.of([...ca,...Cc,hf]),X.lineWrapping]}var ma=class i{constructor(e,t,n,r,s,o,a,O,l,h=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=O,this.curContext=l,this.lookAhead=h,this.parent=c}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 r=e.parser.context;return new i(e,[],t,n,n,0,[],0,r?new Dr(r,r.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,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizeO;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]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,r);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let a=!1;for(let O=o;O>0&&this.buffer[O-2]>n;O-=4)if(this.buffer[O-1]>=0){a=!0;break}if(a)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,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;(r>this.pos||t<=o.maxNode)&&(this.pos=r,o.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4)}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}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),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,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 Qa(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)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sO&1&&a==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!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=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let O=o&65535,l=this.stack.length-a*3;if(l>=0&&e.getGoto(this.stack[l],O,!1)>=0)return a<<19|65536|O}}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;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Dr=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Qa=class{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 r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},ga=class i{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 i(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 i(this.stack,this.pos,this.index)}};function Pn(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let O=o-32;if(O>=46&&(O-=46,a=!0),s+=O,a)break;s*=46}t?t[r++]=s:t=new e(s)}return t}var Vi=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Sf=new Vi,Sa=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Sf,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,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&na.to&&(this.chunk2=this.chunk2.slice(0,a.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Sf,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},Et=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;xf(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};Et.prototype.contextual=Et.prototype.fallback=Et.prototype.extend=!1;var Gt=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?Pn(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(xf(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};Gt.prototype.contextual=Et.prototype.fallback=Et.prototype.extend=!1;var J=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function xf(i,e,t,n,r,s){let o=0,a=1<0){let $=i[d];if(O.allows($)&&(e.token.value==-1||e.token.value==$||HQ($,e.token.value,r,s))){e.acceptToken($);break}}let h=e.next,c=0,f=i[o+2];if(e.next<0&&f>c&&i[l+f*3-3]==65535){o=i[l+f*3-1];continue e}for(;c>1,$=l+d+(d<<1),p=i[$],m=i[$+1]||65536;if(h=m)c=d+1;else{o=i[$+2],e.advance();continue e}}break}}function Pf(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function HQ(i,e,t,n){let r=Pf(t,n,e);return r<0||Pf(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}var Pa=class{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?yf(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?yf(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof z){if(o==e){if(o=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}}},ya=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Vi)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,O=0;for(let l=0;lc.end+25&&(O=Math.max(c.lookAhead,O)),c.value!=0)){let f=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!h.extend&&(n=c,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return O&&e.setLookAhead(O),!n&&e.pos==this.stream.end&&(n=new Vi,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 Vi,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Pa(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,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;ot)n.push(a);else{if(this.advanceStack(a,n,e))continue;{r||(r=[],s=[]),r.push(a);let O=this.tokens.getMainToken(a);s.push(O.value,O.end)}}break}}if(!n.length){let o=r&&KQ(r);if(o)return ze&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw ze&&r&&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&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return ze&&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,O)=>O.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;o500&&l.buffer.length>500)if((a.score-l.score||a.buffer.length-l.buffer.length)>0)n.splice(O--,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 ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let l=e.curContext&&e.curContext.tracker.strict,h=l?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(f>-1&&c.length&&(!l||(c.prop(Y.contextHash)||0)==h))return e.useNode(c,f),ze&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof z)||c.children.length==0||c.positions[0]>0)break;let d=c.children[0];if(d instanceof z&&c.positions[0]==0)c=d;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),ze&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let O=this.tokens.getActions(e);for(let l=0;lr?t.push($):n.push($)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Tf(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),ze&&console.log(h+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let c=a.split(),f=h;for(let d=0;c.forceReduce()&&d<10&&(ze&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));d++)ze&&(f=this.stackID(c)+" -> ");for(let d of a.recoverByInsert(O))ze&&console.log(h+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>a.pos?(l==a.pos&&(l++,O=0),a.recoverByDelete(O,l),ze&&console.log(h+this.stackID(a)+` (via recover-delete ${this.parser.getName(O)})`),Tf(a,n)):(!r||r.scorei,Lt=class{constructor(e){this.start=e.start,this.shift=e.shift||pa,this.reduce=e.reduce||pa,this.reuse=e.reuse||pa,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},pe=class i extends yt{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;ae.topRules[a][1]),r=[];for(let a=0;a=0)s(h,O,a[l++]);else{let c=a[l+-h];for(let f=-h;f>0;f--)s(a[l++],O,c);l++}}}this.nodeSet=new St(t.map((a,O)=>ie.define({name:O>=this.minRepeatTerm?void 0:a,id:O,props:r[O],top:n.indexOf(O)>-1,error:O==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(O)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Pn(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new Et(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 r=new Ta(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],a=o&1,O=r[s++];if(a&&n)return O;for(let l=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=xt(this.data,s+2);else break;r=t(xt(this.data,s+1))}return r}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=xt(this.data,n+2);else break;if((this.data[n+2]&1)==0){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(i.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 r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{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[r]=bf(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 r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}var JQ=122,kf=1,eg=123,tg=124,Xf=2,ig=125,ng=3,rg=4,vf=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],sg=58,og=40,Rf=95,ag=91,Ir=45,Og=46,lg=35,hg=37,cg=38,fg=92,ug=10,dg=42;function yn(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function xa(i){return i>=48&&i<=57}function wf(i){return xa(i)||i>=97&&i<=102||i>=65&&i<=70}var Zf=(i,e,t)=>(n,r)=>{for(let s=!1,o=0,a=0;;a++){let{next:O}=n;if(yn(O)||O==Ir||O==Rf||s&&xa(O))!s&&(O!=Ir||a>0)&&(s=!0),o===a&&O==Ir&&o++,n.advance();else if(O==fg&&n.peek(1)!=ug){if(n.advance(),wf(n.next)){do n.advance();while(wf(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();s=!0}else{s&&n.acceptToken(o==2&&r.canShift(Xf)?e:O==og?t:i);break}}},$g=new J(Zf(eg,Xf,tg)),pg=new J(Zf(ig,ng,rg)),mg=new J(i=>{if(vf.includes(i.peek(-1))){let{next:e}=i;(yn(e)||e==Rf||e==lg||e==Og||e==dg||e==ag||e==sg&&yn(i.peek(1))||e==Ir||e==cg)&&i.acceptToken(JQ)}}),Qg=new J(i=>{if(!vf.includes(i.peek(-1))){let{next:e}=i;if(e==hg&&(i.advance(),i.acceptToken(kf)),yn(e)){do i.advance();while(yn(i.next)||xa(i.next));i.acceptToken(kf)}}}),gg=se({"AtKeyword import charset namespace keyframes media supports":u.definitionKeyword,"from to selector":u.keyword,NamespaceName:u.namespace,KeyframeName:u.labelName,KeyframeRangeName:u.operatorKeyword,TagName:u.tagName,ClassName:u.className,PseudoClassName:u.constant(u.className),IdName:u.labelName,"FeatureName PropertyName":u.propertyName,AttributeName:u.attributeName,NumberLiteral:u.number,KeywordQuery:u.keyword,UnaryQueryOp:u.operatorKeyword,"CallTag ValueName":u.atom,VariableName:u.variableName,Callee:u.operatorKeyword,Unit:u.unit,"UniversalSelector NestingSelector":u.definitionOperator,"MatchOp CompareOp":u.compareOperator,"ChildOp SiblingOp, LogicOp":u.logicOperator,BinOp:u.arithmeticOperator,Important:u.modifier,Comment:u.blockComment,ColorLiteral:u.color,"ParenthesizedContent StringLiteral":u.string,":":u.punctuation,"PseudoOp #":u.derefOperator,"; ,":u.separator,"( )":u.paren,"[ ]":u.squareBracket,"{ }":u.brace}),Sg={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},Pg={__proto__:null,or:98,and:98,not:106,only:106,layer:170},yg={__proto__:null,selector:112,layer:166},Tg={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope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:123,get:i=>bg[i]||-1}],tokenPrec:1963});var ka=null;function wa(){if(!ka&&typeof document=="object"&&document.body){let{style:i}=document.body,e=[],t=new Set;for(let n in i)n!="cssText"&&n!="cssFloat"&&typeof i[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(n)||(e.push(n),t.add(n)));ka=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return ka||[]}var Yf=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(i=>({type:"class",label:i})),_f=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(i=>({type:"keyword",label:i})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(i=>({type:"constant",label:i}))),xg=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(i=>({type:"type",label:i})),kg=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(i=>({type:"keyword",label:i})),kt=/^(\w[\w-]*|-\w[\w-]*|)$/,wg=/^-(-[\w-]*)?$/;function Xg(i,e){var t;if((i.name=="("||i.type.isError)&&(i=i.parent||i),i.name!="ArgList")return!1;let n=(t=i.parent)===null||t===void 0?void 0:t.firstChild;return n?.name!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}var zf=new ki,vg=["Declaration"];function Rg(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function Cf(i,e,t){if(e.to-e.from>4096){let n=zf.get(e);if(n)return n;let r=[],s=new Set,o=e.cursor(G.IncludeAnonymous);if(o.firstChild())do for(let a of Cf(i,o.node,t))s.has(a.label)||(s.add(a.label),r.push(a));while(o.nextSibling());return zf.set(e,r),r}else{let n=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(vg)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=i.sliceString(s.from,s.to);r.has(a)||(r.add(a),n.push({label:a,type:"variable"}))}}),n}}var Zg=i=>e=>{let{state:t,pos:n}=e,r=L(t).resolveInner(n,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:wa(),validFor:kt};if(r.name=="ValueName")return{from:r.from,options:_f,validFor:kt};if(r.name=="PseudoClassName")return{from:r.from,options:Yf,validFor:kt};if(i(r)||(e.explicit||s)&&Xg(r,t.doc))return{from:i(r)||s?r.from:n,options:Cf(t.doc,Rg(r),i),validFor:wg};if(r.name=="TagName"){for(let{parent:O}=r;O;O=O.parent)if(O.name=="Block")return{from:r.from,options:wa(),validFor:kt};return{from:r.from,options:xg,validFor:kt}}if(r.name=="AtKeyword")return{from:r.from,options:kg,validFor:kt};if(!e.explicit)return null;let o=r.resolve(n),a=o.childBefore(n);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:Yf,validFor:kt}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:_f,validFor:kt}:o.name=="Block"||o.name=="Styles"?{from:n,options:wa(),validFor:kt}:null},Vg=Zg(i=>i.name=="VariableName"),Tn=ue.define({name:"css",parser:Vf.configure({props:[de.add({Declaration:_e()}),ye.add({"Block KeyframeList":Ut})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Nr(){return new oe(Tn,Tn.data.of({autocomplete:Vg}))}var Yg=se({String:u.string,Number:u.number,"True False":u.bool,PropertyName:u.propertyName,Null:u.null,", :":u.separator,"[ ]":u.squareBracket,"{ }":u.brace}),qf=pe.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Yg],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~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#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!]~$zO]~~$}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~&yO[~~'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});var _g=ue.define({name:"json",parser:qf.configure({props:[de.add({Object:_e({except:/^\s*\}/}),Array:_e({except:/^\s*\]/})}),ye.add({"Object Array":Ut})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Af(){return new oe(_g)}var zg=315,Cg=316,Wf=1,qg=2,Ag=3,Wg=4,Ug=317,Mg=319,Eg=320,Gg=5,Lg=6,jg=0,va=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Uf=125,Bg=59,Ra=47,Dg=42,Ig=43,Ng=45,Fg=60,Hg=44,Kg=63,Jg=46,eS=91,tS=new Lt({start:!1,shift(i,e){return e==Gg||e==Lg||e==Mg?i:e==Eg},strict:!1}),iS=new J((i,e)=>{let{next:t}=i;(t==Uf||t==-1||e.context)&&i.acceptToken(Ug)},{contextual:!0,fallback:!0}),nS=new J((i,e)=>{let{next:t}=i,n;va.indexOf(t)>-1||t==Ra&&((n=i.peek(1))==Ra||n==Dg)||t!=Uf&&t!=Bg&&t!=-1&&!e.context&&i.acceptToken(zg)},{contextual:!0}),rS=new J((i,e)=>{i.next==eS&&!e.context&&i.acceptToken(Cg)},{contextual:!0}),sS=new J((i,e)=>{let{next:t}=i;if(t==Ig||t==Ng){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(Wf);i.acceptToken(n?Wf:qg)}}else t==Kg&&i.peek(1)==Jg&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(Ag))},{contextual:!0});function Xa(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}var oS=new J((i,e)=>{if(i.next!=Fg||!e.dialectEnabled(jg)||(i.advance(),i.next==Ra))return;let t=0;for(;va.indexOf(i.next)>-1;)i.advance(),t++;if(Xa(i.next,!0)){for(i.advance(),t++;Xa(i.next,!1);)i.advance(),t++;for(;va.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==Hg)return;for(let n=0;;n++){if(n==7){if(!Xa(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Wg,-t)}),aS=se({"get set async static":u.modifier,"for while do if else switch try catch finally return throw break continue default case":u.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":u.operatorKeyword,"let var const using function class extends":u.definitionKeyword,"import export from":u.moduleKeyword,"with debugger new":u.keyword,TemplateString:u.special(u.string),super:u.atom,BooleanLiteral:u.bool,this:u.self,null:u.null,Star:u.modifier,VariableName:u.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":u.function(u.variableName),VariableDefinition:u.definition(u.variableName),Label:u.labelName,PropertyName:u.propertyName,PrivatePropertyName:u.special(u.propertyName),"CallExpression/MemberExpression/PropertyName":u.function(u.propertyName),"FunctionDeclaration/VariableDefinition":u.function(u.definition(u.variableName)),"ClassDeclaration/VariableDefinition":u.definition(u.className),"NewExpression/VariableName":u.className,PropertyDefinition:u.definition(u.propertyName),PrivatePropertyDefinition:u.definition(u.special(u.propertyName)),UpdateOp:u.updateOperator,"LineComment Hashbang":u.lineComment,BlockComment:u.blockComment,Number:u.number,String:u.string,Escape:u.escape,ArithOp:u.arithmeticOperator,LogicOp:u.logicOperator,BitOp:u.bitwiseOperator,CompareOp:u.compareOperator,RegExp:u.regexp,Equals:u.definitionOperator,Arrow:u.function(u.punctuation),": Spread":u.punctuation,"( )":u.paren,"[ ]":u.squareBracket,"{ }":u.brace,"InterpolationStart InterpolationEnd":u.special(u.brace),".":u.derefOperator,", ;":u.separator,"@":u.meta,TypeName:u.typeName,TypeDefinition:u.definition(u.typeName),"type enum interface implements namespace module declare":u.definitionKeyword,"abstract global Privacy readonly override":u.modifier,"is keyof unique infer asserts":u.operatorKeyword,JSXAttributeValue:u.attributeValue,JSXText:u.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":u.angleBracket,"JSXIdentifier JSXNameSpacedName":u.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":u.attributeName,"JSXBuiltin/JSXIdentifier":u.standard(u.tagName)}),OS={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,for:474,of:483,while:486,with:490,do:494,if:498,else:500,switch:504,case:510,try:516,catch:520,finally:524,return:528,throw:532,break:536,continue:540,debugger:544},lS={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},hS={__proto__:null,"<":193},Mf=pe.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Ik'#IkO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JqO6[Q!0MxO'#JrO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO7eQMhO'#F|O9[Q`O'#F{OOQ!0Lf'#Jr'#JrOOQ!0Lb'#Jq'#JqO9aQ`O'#GwOOQ['#K^'#K^O9lQ`O'#IXO9qQ!0LrO'#IYOOQ['#J_'#J_OOQ['#I^'#I^Q`QlOOQ`QlOOO9yQ!L^O'#DvO:QQlO'#EOO:XQlO'#EQO9gQ`O'#GsO:`QMhO'#CoO:nQ`O'#EnO:yQ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Q'^-`1g5qQ%svQ%{yQ&S|Q&h!VS'U!e-WQ'd!iS'j!r!yU*h$|*X*lQ+l%|Q+y&UQ,_&bQ-^']Q-h'eQ-p'kQ0U*nQ1q,`R < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:379,context:tS,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,236,242,244,246,248,251,257,263,265,267,269,271,273,274,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[aS],skippedNodes:[0,5,6,277],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$J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!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(b~~",141,339),new Gt("j~RQYZXz{^~^O(P~~aP!P!Qd~iO(Q~~",25,322)],topRules:{Script:[0,7],SingleExpression:[1,275],SingleClassItem:[2,276]},dialects:{jsx:0,ts:15098},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:326,get:i=>OS[i]||-1},{term:342,get:i=>lS[i]||-1},{term:95,get:i=>hS[i]||-1}],tokenPrec:15124});var Fr=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=L(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),r=t.text.slice(n-t.from,this.pos-t.from),s=r.search(fS(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function Ef(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function cS(i){let e=Object.create(null),t=Object.create(null);for(let{label:r}of i){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:cS(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function jf(i,e){return t=>{for(let n=L(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}function fS(i,e){var t;let{source:n}=i,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?i:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}var uS=be.define();var QT=typeof navigator=="object"&&/Win/.test(navigator.platform);var dS=X.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",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:"'\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"}}}),Za=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},Va=class i{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,Oe.TrackDel),n=e.mapPos(this.to,1,Oe.TrackDel);return t==null||n==null?null:new i(this.field,t,n)}},Ya=class i{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let O of this.lines){if(n.length){let l=o,h=/^\t*/.exec(O)[0].length;for(let c=0;cnew Va(O.field,r[O.line]+O.from,r[O.line]+O.to));return{text:n,ranges:a}}static parse(e){let t=[],n=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,O=s[2]||s[3]||"",l=-1,h=O.replace(/\\[{}]/g,c=>c[1]);for(let c=0;c=l&&f.field++}r.push(new Za(l,n.length,s.index,s.index+h.length)),o=o.slice(0,s.index)+O+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,O,l)=>{for(let h of r)h.line==n.length&&h.from>l&&(h.from--,h.to--);return O}),n.push(o)}return new i(n,r)}},$S=U.widget({widget:new class extends Vt{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),pS=U.mark({class:"cm-snippetField"}),Yi=class i{constructor(e,t){this.ranges=e,this.active=t,this.deco=U.set(e.map(n=>(n.from==n.to?$S:pS).range(n.from,n.to)))}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new i(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))}},xn=B.define({map(i,e){return i&&i.map(e)}}),mS=B.define(),bn=ge.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(xn))return t.value;if(t.is(mS)&&i)return new Yi(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>X.decorations.from(i,e=>e?e.deco:U.none)});function _a(i,e){return S.create(i.filter(t=>t.field==e).map(t=>S.range(t.from,t.to)))}function QS(i){let e=Ya.parse(i);return(t,n,r,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,r),{main:O}=t.state.selection,l={changes:{from:r,to:s==O.from?O.to:s,insert:q.of(o)},scrollIntoView:!0,annotations:n?[uS.of(n),ne.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=_a(a,0)),a.some(h=>h.field>0)){let h=new Yi(a,0),c=l.effects=[xn.of(h)];t.state.field(bn,!1)===void 0&&c.push(B.appendConfig.of([bn,TS,bS,dS]))}t.dispatch(t.state.update(l))}}function Bf(i){return({state:e,dispatch:t})=>{let n=e.field(bn,!1);if(!n||i<0&&n.active==0)return!1;let r=n.active+i,s=i>0&&!n.ranges.some(o=>o.field==r+i);return t(e.update({selection:_a(n.ranges,r),effects:xn.of(s?null:new Yi(n.ranges,r)),scrollIntoView:!0})),!0}}var gS=({state:i,dispatch:e})=>i.field(bn,!1)?(e(i.update({effects:xn.of(null)})),!0):!1,SS=Bf(1),PS=Bf(-1);var yS=[{key:"Tab",run:SS,shift:PS},{key:"Escape",run:gS}],Gf=R.define({combine(i){return i.length?i[0]:yS}}),TS=nt.highest(ht.compute([Gf],i=>i.facet(Gf)));function Te(i,e){return Object.assign(Object.assign({},e),{apply:QS(i)})}var bS=X.domEventHandlers({mousedown(i,e){let t=e.state.field(bn,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==t.active?!1:(e.dispatch({selection:_a(t.ranges,r.field),effects:xn.of(t.ranges.some(s=>s.field>r.field)?new Yi(t.ranges,r.field):null),scrollIntoView:!0}),!0)}});var Df=new class extends Ie{};Df.startSide=1;Df.endSide=-1;var gT=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent);var Hf=[Te("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Te("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Te("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Te("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Te("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Te(`try { +`);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 r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=n||(t=t.slice(0,s-(n-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,a=this.lineAfter(o);t+=a,n=o+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(n>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let a=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=n:this.chunk.push(e,t,n,s),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new _r(t,e?e.state.tabSize:4,e?At(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=Qc(s.token,o,this.state);if(a&&(r=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPose.start)return r}throw new Error("Stream parser failed to advance stream.")}var ia=Object.create(null),pn=[ie.none],vm=new St(pn),sc=[],oc=Object.create(null),gc=Object.create(null);for(let[i,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"]])gc[i]=Sc(ia,e);var Cr=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),gc)}resolve(e){return e?this.table[e]||(this.table[e]=Sc(this.extra,e)):0}},Rm=new Cr(ia);function jo(i,e){sc.indexOf(i)>-1||(sc.push(i),console.warn(e))}function Sc(i,e){let t=[];for(let a of e.split(" ")){let O=[];for(let l of a.split(".")){let h=i[l]||u[l];h?typeof h=="function"?O.length?O=O.map(h):jo(l,`Modifier ${l} used at start of tag`):O.length?jo(l,`Tag ${l} used as modifier`):O=Array.isArray(h)?h:[h]:jo(l,`Unknown highlighting tag ${l}`)}for(let l of O)t.push(l)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+t.map(a=>a.id),s=oc[r];if(s)return s.id;let o=oc[r]=ie.define({id:pn.length,name:n,props:[se({[n]:t})]});return pn.push(o),o.id}function Zm(i,e){let t=ie.define({id:pn.length,name:"Document",props:[Tt.add(()=>i),de.add(()=>n=>e.getIndent(n))],top:!0});return pn.push(t),t}var Ty={rtl:U.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:te.RTL}),ltr:U.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:te.LTR}),auto:U.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Vm=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=la(i.state,t.from);return n.line?Ym(i):n.block?zm(i):!1};function Oa(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}var Ym=Oa(Am,0);var _m=Oa(vc,0);var zm=Oa((i,e)=>vc(i,e,qm(e)),0);function la(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var gn=50;function Cm(i,{open:e,close:t},n,r){let s=i.sliceDoc(n-gn,n),o=i.sliceDoc(r,r+gn),a=/\s*$/.exec(s)[0].length,O=/^\s*/.exec(o)[0].length,l=s.length-a;if(s.slice(l-e.length,l)==e&&o.slice(O,O+t.length)==t)return{open:{pos:n-a,margin:a&&1},close:{pos:r+O,margin:O&&1}};let h,c;r-n<=2*gn?h=c=i.sliceDoc(n,r):(h=i.sliceDoc(n,n+gn),c=i.sliceDoc(r-gn,r));let f=/^\s*/.exec(h)[0].length,d=/\s*$/.exec(c)[0].length,$=c.length-d-t.length;return h.slice(f,f+e.length)==e&&c.slice($,$+t.length)==t?{open:{pos:n+f+e.length,margin:/\s/.test(h.charAt(f+e.length))?1:0},close:{pos:r-d-t.length,margin:/\s/.test(c.charAt($-1))?1:0}}:null}function qm(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),r=t.to<=n.to?n:i.doc.lineAt(t.to);r.from>n.from&&r.from==t.to&&(r=t.to==n.to+1?n:i.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function vc(i,e,t=e.selection.ranges){let n=t.map(s=>la(e,s.from).block);if(!n.every(s=>s))return null;let r=t.map((s,o)=>Cm(e,n[o],s.from,s.to));if(i!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(i!=1&&r.some(s=>s)){let s=[];for(let o=0,a;or&&(s==o||o>c.from)){r=c.from;let f=/^\s*/.exec(c.text)[0].length,d=f==c.length,$=c.text.slice(f,f+l.length)==l?f:-1;fs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:O,indent:l,empty:h,single:c}of n)(c||!h)&&s.push({from:a.from+l,insert:O+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:O}of n)if(a>=0){let l=o.from+a,h=l+O.length;o.text[h-o.from]==" "&&h++,s.push({from:l,to:h})}return{changes:s}}return null}var ra=be.define(),Wm=be.define(),Um=Z.define(),Rc=Z.define({combine(i){return Xt(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Zc=ge.define({create(){return ai.empty},update(i,e){let t=e.state.facet(Rc),n=e.annotation(ra);if(n){let O=Ke.fromTransaction(e,n.selection),l=n.side,h=l==0?i.undone:i.done;return O?h=Ur(h,h.length,t.minDepth,O):h=zc(h,e.startState.selection),new ai(l==0?n.rest:h,l==0?h:n.rest)}let r=e.annotation(Wm);if((r=="full"||r=="before")&&(i=i.isolate()),e.annotation(ne.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let s=Ke.fromTransaction(e),o=e.annotation(ne.time),a=e.annotation(ne.userEvent);return s?i=i.addChanges(s,o,a,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(r=="full"||r=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new ai(i.done.map(Ke.fromJSON),i.undone.map(Ke.fromJSON))}});function Vc(i={}){return[Zc,Rc.of(i),X.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?Yc:e.inputType=="historyRedo"?sa:null;return n?(e.preventDefault(),n(t)):!1}})]}function Mr(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let r=t.field(Zc,!1);if(!r)return!1;let s=r.pop(i,t,e);return s?(n(s),!0):!1}}var Yc=Mr(0,!1),sa=Mr(1,!1),Mm=Mr(0,!0),Em=Mr(1,!0);var Ke=class i{constructor(e,t,n,r,s){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new i(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(r=>r.toJSON())}}static fromJSON(e){return new i(e.changes&&Qe.fromJSON(e.changes),[],e.mapped&&pt.fromJSON(e.mapped),e.startSelection&&S.fromJSON(e.startSelection),e.selectionsAfter.map(S.fromJSON))}static fromTransaction(e,t){let n=je;for(let r of e.startState.facet(Um)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new i(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,je)}static selection(e){return new i(void 0,je,void 0,void 0,e)}};function Ur(i,e,t,n){let r=e+1>t+20?e-t-1:0,s=i.slice(r,e);return s.push(n),s}function Gm(i,e){let t=[],n=!1;return i.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,a)=>{for(let O=0;O=l&&o<=h&&(n=!0)}}),n}function Lm(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function _c(i,e){return i.length?e.length?i.concat(e):i:e}var je=[],jm=200;function zc(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-jm));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Ur(i,i.length-1,1e9,t.setSelAfter(n)))}else return[Ke.selection([e])]}function Bm(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function na(i,e){if(!i.length)return i;let t=i.length,n=je;for(;t;){let r=Dm(i[t-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=i.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,n=r.selectionsAfter}return n.length?[Ke.selection(n)]:je}function Dm(i,e,t){let n=_c(i.selectionsAfter.length?i.selectionsAfter.map(a=>a.map(e)):je,t);if(!i.changes)return Ke.selection(n);let r=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new Ke(r,B.mapEffects(i.effects,e),o,i.startSelection.map(s),n)}var Im=/^(input\.type|delete)($|\.)/,ai=class i{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new i(this.done,this.undone):this}addChanges(e,t,n,r,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!n||Im.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):Er(t,e))}function $e(i){return i.textDirectionAt(i.state.selection.main.head)==te.LTR}var Ac=i=>qc(i,!$e(i)),Wc=i=>qc(i,$e(i));function Uc(i,e){return Je(i,t=>t.empty?i.moveByGroup(t,e):Er(t,e))}var Nm=i=>Uc(i,!$e(i)),Fm=i=>Uc(i,$e(i));var Zy=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function Hm(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function Gr(i,e,t){let n=L(i).resolveInner(e.head),r=t?Y.closedBy:Y.openedBy;for(let O=e.head;;){let l=t?n.childAfter(O):n.childBefore(O);if(!l)break;Hm(i,l,r)?n=l:O=t?l.to:l.from}let s=n.type.prop(r),o,a;return s&&(o=t?He(i,n.from,1):He(i,n.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?n.to:n.from,S.cursor(a,t?-1:1)}var Km=i=>Je(i,e=>Gr(i.state,e,!$e(i))),Jm=i=>Je(i,e=>Gr(i.state,e,$e(i)));function Mc(i,e){return Je(i,t=>{if(!t.empty)return Er(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}var Ec=i=>Mc(i,!1),Gc=i=>Mc(i,!0);function Lc(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):Er(o,e));if(r.eq(n.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),a=i.scrollDOM.getBoundingClientRect(),O=a.top+t.marginTop,l=a.bottom-t.marginBottom;o&&o.top>O&&o.bottomjc(i,!1),oa=i=>jc(i,!0);function Mt(i,e,t){let n=i.lineBlockAt(e.head),r=i.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?n.to:n.from)&&(r=i.moveToLineBoundary(e,t,!1)),!t&&r.head==n.from&&n.length){let s=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=S.cursor(n.from+s))}return r}var eQ=i=>Je(i,e=>Mt(i,e,!0)),tQ=i=>Je(i,e=>Mt(i,e,!1)),iQ=i=>Je(i,e=>Mt(i,e,!$e(i))),nQ=i=>Je(i,e=>Mt(i,e,$e(i))),rQ=i=>Je(i,e=>S.cursor(i.lineBlockAt(e.head).from,1)),sQ=i=>Je(i,e=>S.cursor(i.lineBlockAt(e.head).to,-1));function oQ(i,e,t){let n=!1,r=Zi(i.selection,s=>{let o=He(i,s.head,-1)||He(i,s.head,1)||s.head>0&&He(i,s.head-1,1)||s.headoQ(i,e,!1);function Be(i,e){let t=Zi(i.state.selection,n=>{let r=e(n);return S.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(dt(i.state,t)),!0)}function Bc(i,e){return Be(i,t=>i.moveByChar(t,e))}var Dc=i=>Bc(i,!$e(i)),Ic=i=>Bc(i,$e(i));function Nc(i,e){return Be(i,t=>i.moveByGroup(t,e))}var OQ=i=>Nc(i,!$e(i)),lQ=i=>Nc(i,$e(i));var hQ=i=>Be(i,e=>Gr(i.state,e,!$e(i))),cQ=i=>Be(i,e=>Gr(i.state,e,$e(i)));function Fc(i,e){return Be(i,t=>i.moveVertically(t,e))}var Hc=i=>Fc(i,!1),Kc=i=>Fc(i,!0);function Jc(i,e){return Be(i,t=>i.moveVertically(t,e,Lc(i).height))}var yc=i=>Jc(i,!1),Tc=i=>Jc(i,!0),fQ=i=>Be(i,e=>Mt(i,e,!0)),uQ=i=>Be(i,e=>Mt(i,e,!1)),dQ=i=>Be(i,e=>Mt(i,e,!$e(i))),$Q=i=>Be(i,e=>Mt(i,e,$e(i))),pQ=i=>Be(i,e=>S.cursor(i.lineBlockAt(e.head).from)),mQ=i=>Be(i,e=>S.cursor(i.lineBlockAt(e.head).to)),bc=({state:i,dispatch:e})=>(e(dt(i,{anchor:0})),!0),xc=({state:i,dispatch:e})=>(e(dt(i,{anchor:i.doc.length})),!0),kc=({state:i,dispatch:e})=>(e(dt(i,{anchor:i.selection.main.anchor,head:0})),!0),wc=({state:i,dispatch:e})=>(e(dt(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),QQ=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),gQ=({state:i,dispatch:e})=>{let t=Lr(i).map(({from:n,to:r})=>S.range(n,Math.min(r+1,i.doc.length)));return e(i.update({selection:S.create(t),userEvent:"select"})),!0},SQ=({state:i,dispatch:e})=>{let t=Zi(i.selection,n=>{let r=L(i),s=r.resolveStack(n.from,1);if(n.empty){let o=r.resolveStack(n.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from=n.to||a.to>n.to&&a.from<=n.from)&&o.next)return S.range(a.to,a.from)}return n});return t.eq(i.selection)?!1:(e(dt(i,t)),!0)},PQ=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=S.create([t.main]):t.main.empty||(n=S.create([S.cursor(t.main.head)])),n?(e(dt(i,n)),!0):!1};function Sn(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,r=n.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let O=e(s);Oo&&(t="delete.forward",O=Wr(i,O,!0)),o=Math.min(o,O),a=Math.max(a,O)}else o=Wr(i,o,!1),a=Wr(i,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:S.cursor(o,or(i)))n.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}var ef=(i,e,t)=>Sn(i,n=>{let r=n.from,{state:s}=i,o=s.doc.lineAt(r),a,O;if(t&&!e&&r>o.from&&ref(i,!1,!0);var tf=i=>ef(i,!0,!1),nf=(i,e)=>Sn(i,t=>{let n=t.head,{state:r}=i,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let a=null;;){if(n==(e?s.to:s.from)){n==t.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let O=le(s.text,n-s.from,e)+s.from,l=s.text.slice(Math.min(n,O)-s.from,Math.max(n,O)-s.from),h=o(l);if(a!=null&&h!=a)break;(l!=" "||n!=t.head)&&(a=h),n=O}return n}),rf=i=>nf(i,!1),yQ=i=>nf(i,!0),TQ=i=>Sn(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headSn(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),xQ=i=>Sn(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:q.of(["",""])},range:S.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},wQ=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let r=n.from,s=i.doc.lineAt(r),o=r==s.from?r-1:le(s.text,r-s.from,!1)+s.from,a=r==s.to?r+1:le(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:i.doc.slice(r,a).append(i.doc.slice(o,r))},range:S.cursor(a)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Lr(i){let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.from),s=i.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=i.doc.lineAt(n.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});t=s.number+1}return e}function sf(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let s of Lr(i)){if(t?s.to==i.doc.length:s.from==0)continue;let o=i.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+i.lineBreak});for(let O of s.ranges)r.push(S.range(Math.min(i.doc.length,O.anchor+a),Math.min(i.doc.length,O.head+a)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let O of s.ranges)r.push(S.range(O.anchor-a,O.head-a))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:S.create(r,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var XQ=({state:i,dispatch:e})=>sf(i,e,!1),vQ=({state:i,dispatch:e})=>sf(i,e,!0);function of(i,e,t){if(i.readOnly)return!1;let n=[];for(let r of Lr(i))t?n.push({from:r.from,insert:i.doc.slice(r.from,r.to)+i.lineBreak}):n.push({from:r.to,insert:i.lineBreak+i.doc.slice(r.from,r.to)});return e(i.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var RQ=({state:i,dispatch:e})=>of(i,e,!1),ZQ=({state:i,dispatch:e})=>of(i,e,!0),VQ=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(Lr(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(i.lineWrapping){let o=i.lineBlockAt(r.head),a=i.coordsAtPos(r.head,r.assoc||1);a&&(s=o.bottom+i.documentTop-a.bottom+i.defaultLineHeight/2)}return i.moveVertically(r,!0,s)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function YQ(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=L(i).resolveInner(e),n=t.childBefore(e),r=t.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(Y.closedBy))&&s.indexOf(r.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(r.from).from&&!/\S/.test(i.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}var Xc=af(!1),_Q=af(!0);function af(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,a=e.doc.lineAt(s),O=!i&&s==o&&YQ(e,s);i&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let l=new oi(e,{simulateBreak:s,simulateDoubleBreak:!!O}),h=Jo(l,s);for(h==null&&(h=xe(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let r=[];for(let o=n.from;o<=n.to;){let a=i.doc.lineAt(o);a.number>t&&(n.empty||n.to>a.from)&&(e(a,r,n),t=a.number),o=a.to+1}let s=i.changes(r);return{changes:r,range:S.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}var zQ=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new oi(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=ha(i,(s,o,a)=>{let O=Jo(n,s.from);if(O==null)return;/\S/.test(s.text)||(O=0);let l=/^\s*/.exec(s.text)[0],h=mn(i,O);(l!=h||a.fromi.readOnly?!1:(e(i.update(ha(i,(t,n)=>{n.push({from:t.from,insert:i.facet(Wt)})}),{userEvent:"input.indent"})),!0),lf=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(ha(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=xe(r,i.tabSize),o=0,a=mn(i,Math.max(0,s-At(i)));for(;o(i.setTabFocusMode(),!0);var qQ=[{key:"Ctrl-b",run:Ac,shift:Dc,preventDefault:!0},{key:"Ctrl-f",run:Wc,shift:Ic},{key:"Ctrl-p",run:Ec,shift:Hc},{key:"Ctrl-n",run:Gc,shift:Kc},{key:"Ctrl-a",run:rQ,shift:pQ},{key:"Ctrl-e",run:sQ,shift:mQ},{key:"Ctrl-d",run:tf},{key:"Ctrl-h",run:aa},{key:"Ctrl-k",run:TQ},{key:"Ctrl-Alt-h",run:rf},{key:"Ctrl-o",run:kQ},{key:"Ctrl-t",run:wQ},{key:"Ctrl-v",run:oa}],AQ=[{key:"ArrowLeft",run:Ac,shift:Dc,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Nm,shift:OQ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:iQ,shift:dQ,preventDefault:!0},{key:"ArrowRight",run:Wc,shift:Ic,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Fm,shift:lQ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:nQ,shift:$Q,preventDefault:!0},{key:"ArrowUp",run:Ec,shift:Hc,preventDefault:!0},{mac:"Cmd-ArrowUp",run:bc,shift:kc},{mac:"Ctrl-ArrowUp",run:Pc,shift:yc},{key:"ArrowDown",run:Gc,shift:Kc,preventDefault:!0},{mac:"Cmd-ArrowDown",run:xc,shift:wc},{mac:"Ctrl-ArrowDown",run:oa,shift:Tc},{key:"PageUp",run:Pc,shift:yc},{key:"PageDown",run:oa,shift:Tc},{key:"Home",run:tQ,shift:uQ,preventDefault:!0},{key:"Mod-Home",run:bc,shift:kc},{key:"End",run:eQ,shift:fQ,preventDefault:!0},{key:"Mod-End",run:xc,shift:wc},{key:"Enter",run:Xc,shift:Xc},{key:"Mod-a",run:QQ},{key:"Backspace",run:aa,shift:aa},{key:"Delete",run:tf},{key:"Mod-Backspace",mac:"Alt-Backspace",run:rf},{key:"Mod-Delete",mac:"Alt-Delete",run:yQ},{mac:"Mod-Backspace",run:bQ},{mac:"Mod-Delete",run:xQ}].concat(qQ.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),ca=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Km,shift:hQ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Jm,shift:cQ},{key:"Alt-ArrowUp",run:XQ},{key:"Shift-Alt-ArrowUp",run:RQ},{key:"Alt-ArrowDown",run:vQ},{key:"Shift-Alt-ArrowDown",run:ZQ},{key:"Escape",run:PQ},{key:"Mod-Enter",run:_Q},{key:"Alt-l",mac:"Ctrl-l",run:gQ},{key:"Mod-i",run:SQ,preventDefault:!0},{key:"Mod-[",run:lf},{key:"Mod-]",run:Of},{key:"Mod-Alt-\\",run:zQ},{key:"Shift-Mod-k",run:VQ},{key:"Shift-Mod-\\",run:aQ},{key:"Mod-/",run:Vm},{key:"Alt-A",run:_m},{key:"Ctrl-m",mac:"Shift-Alt-m",run:CQ}].concat(AQ),hf={key:"Tab",run:Of,shift:lf};var WQ="#e5c07b",cf="#e06c75",UQ="#56b6c2",MQ="#ffffff",jr="#abb2bf",ua="#7d8799",EQ="#61afef",GQ="#98c379",ff="#d19a66",LQ="#c678dd",jQ="#21252b",uf="#2c313a",df="#282c34",fa="#353a42",BQ="#3E4451",$f="#528bff";var pf=X.theme({"&":{color:jr,backgroundColor:df},".cm-content":{caretColor:$f},".cm-cursor, .cm-dropCursor":{borderLeftColor:$f},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:BQ},".cm-panels":{backgroundColor:jQ,color:jr},".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:df,color:ua,border:"none"},".cm-activeLineGutter":{backgroundColor:uf},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:fa},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:fa,borderBottomColor:fa},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:uf,color:jr}}},{dark:!0}),mf=bt.define([{tag:u.keyword,color:LQ},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:cf},{tag:[u.function(u.variableName),u.labelName],color:EQ},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:ff},{tag:[u.definition(u.name),u.separator],color:jr},{tag:[u.typeName,u.className,u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:WQ},{tag:[u.operator,u.operatorKeyword,u.url,u.escape,u.regexp,u.link,u.special(u.string)],color:UQ},{tag:[u.meta,u.comment],color:ua},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.link,color:ua,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:cf},{tag:[u.atom,u.bool,u.special(u.variableName)],color:ff},{tag:[u.processingInstruction,u.string,u.inserted],color:GQ},{tag:u.invalid,color:MQ}]);var DQ=bt.define([{tag:u.meta,color:"#388938"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.compareOperator,color:"#708"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),IQ={"&":{backgroundColor:"#FFF",color:"#000"},"&.cm-focused":{outline:"none"},".cm-line":{lineHeight:"1.6"}};function Qf(i){let e=document.documentElement.classList.contains("dark-mode"),t=e?pf:X.theme(IQ),n=e?mf:DQ,r={darkModeActive:e,registerViewTheme(s){let o=s();o&&(t=X.theme(o))},registerHighlightStyle(s){let o=s(u)||[];o.length&&(n=bt.define(o))}};return window.$events.emitPublic(i,"library-cm6::configure-theme",r),[t,ea(n)]}function gf(i){return[Qf(i),Uh(),zh(),Ah(),pc(),Wh()]}function NQ(){let i=new mt,e={focus(t,n){n.dispatch({effects:i.reconfigure([ko(),xo()])})},blur(t,n){n.dispatch({effects:i.reconfigure([])})}};return[i.of([]),X.domEventHandlers(e)]}function da(i){return[...gf(i),NQ(),ht.of([...ca]),D.readOnly.of(!0)]}function Br(i){return[...gf(i),ko(),xo(),Vc(),ht.of([...ca,...Cc,hf]),X.lineWrapping]}var ma=class i{constructor(e,t,n,r,s,o,a,O,l,h=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=O,this.curContext=l,this.lookAhead=h,this.parent=c}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 r=e.parser.context;return new i(e,[],t,n,n,0,[],0,r?new Dr(r,r.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,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizeO;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]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,r);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let a=!1;for(let O=o;O>0&&this.buffer[O-2]>n;O-=4)if(this.buffer[O-1]>=0){a=!0;break}if(a)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,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;(r>this.pos||t<=o.maxNode)&&(this.pos=r,o.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4)}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}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),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,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 Qa(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)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sO&1&&a==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!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=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let O=o&65535,l=this.stack.length-a*3;if(l>=0&&e.getGoto(this.stack[l],O,!1)>=0)return a<<19|65536|O}}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;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Dr=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Qa=class{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 r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},ga=class i{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 i(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 i(this.stack,this.pos,this.index)}};function Pn(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let O=o-32;if(O>=46&&(O-=46,a=!0),s+=O,a)break;s*=46}t?t[r++]=s:t=new e(s)}return t}var Vi=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Sf=new Vi,Sa=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Sf,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,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&na.to&&(this.chunk2=this.chunk2.slice(0,a.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Sf,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},Et=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;xf(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};Et.prototype.contextual=Et.prototype.fallback=Et.prototype.extend=!1;var Gt=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?Pn(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(xf(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};Gt.prototype.contextual=Et.prototype.fallback=Et.prototype.extend=!1;var J=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function xf(i,e,t,n,r,s){let o=0,a=1<0){let $=i[d];if(O.allows($)&&(e.token.value==-1||e.token.value==$||HQ($,e.token.value,r,s))){e.acceptToken($);break}}let h=e.next,c=0,f=i[o+2];if(e.next<0&&f>c&&i[l+f*3-3]==65535){o=i[l+f*3-1];continue e}for(;c>1,$=l+d+(d<<1),p=i[$],m=i[$+1]||65536;if(h=m)c=d+1;else{o=i[$+2],e.advance();continue e}}break}}function Pf(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function HQ(i,e,t,n){let r=Pf(t,n,e);return r<0||Pf(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}var Pa=class{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?yf(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?yf(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof z){if(o==e){if(o=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}}},ya=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Vi)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,O=0;for(let l=0;lc.end+25&&(O=Math.max(c.lookAhead,O)),c.value!=0)){let f=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!h.extend&&(n=c,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return O&&e.setLookAhead(O),!n&&e.pos==this.stream.end&&(n=new Vi,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 Vi,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Pa(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,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;ot)n.push(a);else{if(this.advanceStack(a,n,e))continue;{r||(r=[],s=[]),r.push(a);let O=this.tokens.getMainToken(a);s.push(O.value,O.end)}}break}}if(!n.length){let o=r&&KQ(r);if(o)return ze&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw ze&&r&&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&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return ze&&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,O)=>O.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;o500&&l.buffer.length>500)if((a.score-l.score||a.buffer.length-l.buffer.length)>0)n.splice(O--,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 ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let l=e.curContext&&e.curContext.tracker.strict,h=l?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(f>-1&&c.length&&(!l||(c.prop(Y.contextHash)||0)==h))return e.useNode(c,f),ze&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof z)||c.children.length==0||c.positions[0]>0)break;let d=c.children[0];if(d instanceof z&&c.positions[0]==0)c=d;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),ze&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let O=this.tokens.getActions(e);for(let l=0;lr?t.push($):n.push($)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Tf(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),ze&&console.log(h+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let c=a.split(),f=h;for(let d=0;c.forceReduce()&&d<10&&(ze&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));d++)ze&&(f=this.stackID(c)+" -> ");for(let d of a.recoverByInsert(O))ze&&console.log(h+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>a.pos?(l==a.pos&&(l++,O=0),a.recoverByDelete(O,l),ze&&console.log(h+this.stackID(a)+` (via recover-delete ${this.parser.getName(O)})`),Tf(a,n)):(!r||r.scorei,Lt=class{constructor(e){this.start=e.start,this.shift=e.shift||pa,this.reduce=e.reduce||pa,this.reuse=e.reuse||pa,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},pe=class i extends yt{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;ae.topRules[a][1]),r=[];for(let a=0;a=0)s(h,O,a[l++]);else{let c=a[l+-h];for(let f=-h;f>0;f--)s(a[l++],O,c);l++}}}this.nodeSet=new St(t.map((a,O)=>ie.define({name:O>=this.minRepeatTerm?void 0:a,id:O,props:r[O],top:n.indexOf(O)>-1,error:O==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(O)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Pn(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new Et(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 r=new Ta(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],a=o&1,O=r[s++];if(a&&n)return O;for(let l=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=xt(this.data,s+2);else break;r=t(xt(this.data,s+1))}return r}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=xt(this.data,n+2);else break;if((this.data[n+2]&1)==0){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(i.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 r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{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[r]=bf(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 r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}var JQ=122,kf=1,eg=123,tg=124,Xf=2,ig=125,ng=3,rg=4,vf=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],sg=58,og=40,Rf=95,ag=91,Ir=45,Og=46,lg=35,hg=37,cg=38,fg=92,ug=10,dg=42;function yn(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function xa(i){return i>=48&&i<=57}function wf(i){return xa(i)||i>=97&&i<=102||i>=65&&i<=70}var Zf=(i,e,t)=>(n,r)=>{for(let s=!1,o=0,a=0;;a++){let{next:O}=n;if(yn(O)||O==Ir||O==Rf||s&&xa(O))!s&&(O!=Ir||a>0)&&(s=!0),o===a&&O==Ir&&o++,n.advance();else if(O==fg&&n.peek(1)!=ug){if(n.advance(),wf(n.next)){do n.advance();while(wf(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();s=!0}else{s&&n.acceptToken(o==2&&r.canShift(Xf)?e:O==og?t:i);break}}},$g=new J(Zf(eg,Xf,tg)),pg=new J(Zf(ig,ng,rg)),mg=new J(i=>{if(vf.includes(i.peek(-1))){let{next:e}=i;(yn(e)||e==Rf||e==lg||e==Og||e==dg||e==ag||e==sg&&yn(i.peek(1))||e==Ir||e==cg)&&i.acceptToken(JQ)}}),Qg=new J(i=>{if(!vf.includes(i.peek(-1))){let{next:e}=i;if(e==hg&&(i.advance(),i.acceptToken(kf)),yn(e)){do i.advance();while(yn(i.next)||xa(i.next));i.acceptToken(kf)}}}),gg=se({"AtKeyword import charset namespace keyframes media supports":u.definitionKeyword,"from to selector":u.keyword,NamespaceName:u.namespace,KeyframeName:u.labelName,KeyframeRangeName:u.operatorKeyword,TagName:u.tagName,ClassName:u.className,PseudoClassName:u.constant(u.className),IdName:u.labelName,"FeatureName PropertyName":u.propertyName,AttributeName:u.attributeName,NumberLiteral:u.number,KeywordQuery:u.keyword,UnaryQueryOp:u.operatorKeyword,"CallTag ValueName":u.atom,VariableName:u.variableName,Callee:u.operatorKeyword,Unit:u.unit,"UniversalSelector NestingSelector":u.definitionOperator,"MatchOp CompareOp":u.compareOperator,"ChildOp SiblingOp, LogicOp":u.logicOperator,BinOp:u.arithmeticOperator,Important:u.modifier,Comment:u.blockComment,ColorLiteral:u.color,"ParenthesizedContent StringLiteral":u.string,":":u.punctuation,"PseudoOp #":u.derefOperator,"; ,":u.separator,"( )":u.paren,"[ ]":u.squareBracket,"{ }":u.brace}),Sg={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},Pg={__proto__:null,or:98,and:98,not:106,only:106,layer:170},yg={__proto__:null,selector:112,layer:166},Tg={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},bg={__proto__:null,to:207},Vf=pe.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5: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:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!hO[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hyS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hSg[i]||-1},{term:125,get:i=>Pg[i]||-1},{term:4,get:i=>yg[i]||-1},{term:25,get:i=>Tg[i]||-1},{term:123,get:i=>bg[i]||-1}],tokenPrec:1963});var ka=null;function wa(){if(!ka&&typeof document=="object"&&document.body){let{style:i}=document.body,e=[],t=new Set;for(let n in i)n!="cssText"&&n!="cssFloat"&&typeof i[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(n)||(e.push(n),t.add(n)));ka=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return ka||[]}var Yf=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(i=>({type:"class",label:i})),_f=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(i=>({type:"keyword",label:i})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(i=>({type:"constant",label:i}))),xg=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(i=>({type:"type",label:i})),kg=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(i=>({type:"keyword",label:i})),kt=/^(\w[\w-]*|-\w[\w-]*|)$/,wg=/^-(-[\w-]*)?$/;function Xg(i,e){var t;if((i.name=="("||i.type.isError)&&(i=i.parent||i),i.name!="ArgList")return!1;let n=(t=i.parent)===null||t===void 0?void 0:t.firstChild;return n?.name!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}var zf=new ki,vg=["Declaration"];function Rg(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function Cf(i,e,t){if(e.to-e.from>4096){let n=zf.get(e);if(n)return n;let r=[],s=new Set,o=e.cursor(G.IncludeAnonymous);if(o.firstChild())do for(let a of Cf(i,o.node,t))s.has(a.label)||(s.add(a.label),r.push(a));while(o.nextSibling());return zf.set(e,r),r}else{let n=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(vg)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=i.sliceString(s.from,s.to);r.has(a)||(r.add(a),n.push({label:a,type:"variable"}))}}),n}}var Zg=i=>e=>{let{state:t,pos:n}=e,r=L(t).resolveInner(n,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:wa(),validFor:kt};if(r.name=="ValueName")return{from:r.from,options:_f,validFor:kt};if(r.name=="PseudoClassName")return{from:r.from,options:Yf,validFor:kt};if(i(r)||(e.explicit||s)&&Xg(r,t.doc))return{from:i(r)||s?r.from:n,options:Cf(t.doc,Rg(r),i),validFor:wg};if(r.name=="TagName"){for(let{parent:O}=r;O;O=O.parent)if(O.name=="Block")return{from:r.from,options:wa(),validFor:kt};return{from:r.from,options:xg,validFor:kt}}if(r.name=="AtKeyword")return{from:r.from,options:kg,validFor:kt};if(!e.explicit)return null;let o=r.resolve(n),a=o.childBefore(n);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:Yf,validFor:kt}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:_f,validFor:kt}:o.name=="Block"||o.name=="Styles"?{from:n,options:wa(),validFor:kt}:null},Vg=Zg(i=>i.name=="VariableName"),Tn=ue.define({name:"css",parser:Vf.configure({props:[de.add({Declaration:_e()}),ye.add({"Block KeyframeList":Ut})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Nr(){return new oe(Tn,Tn.data.of({autocomplete:Vg}))}var Yg=se({String:u.string,Number:u.number,"True False":u.bool,PropertyName:u.propertyName,Null:u.null,", :":u.separator,"[ ]":u.squareBracket,"{ }":u.brace}),qf=pe.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Yg],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~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#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!]~$zO]~~$}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~&yO[~~'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});var _g=ue.define({name:"json",parser:qf.configure({props:[de.add({Object:_e({except:/^\s*\}/}),Array:_e({except:/^\s*\]/})}),ye.add({"Object Array":Ut})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Af(){return new oe(_g)}var zg=315,Cg=316,Wf=1,qg=2,Ag=3,Wg=4,Ug=317,Mg=319,Eg=320,Gg=5,Lg=6,jg=0,va=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Uf=125,Bg=59,Ra=47,Dg=42,Ig=43,Ng=45,Fg=60,Hg=44,Kg=63,Jg=46,eS=91,tS=new Lt({start:!1,shift(i,e){return e==Gg||e==Lg||e==Mg?i:e==Eg},strict:!1}),iS=new J((i,e)=>{let{next:t}=i;(t==Uf||t==-1||e.context)&&i.acceptToken(Ug)},{contextual:!0,fallback:!0}),nS=new J((i,e)=>{let{next:t}=i,n;va.indexOf(t)>-1||t==Ra&&((n=i.peek(1))==Ra||n==Dg)||t!=Uf&&t!=Bg&&t!=-1&&!e.context&&i.acceptToken(zg)},{contextual:!0}),rS=new J((i,e)=>{i.next==eS&&!e.context&&i.acceptToken(Cg)},{contextual:!0}),sS=new J((i,e)=>{let{next:t}=i;if(t==Ig||t==Ng){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(Wf);i.acceptToken(n?Wf:qg)}}else t==Kg&&i.peek(1)==Jg&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(Ag))},{contextual:!0});function Xa(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}var oS=new J((i,e)=>{if(i.next!=Fg||!e.dialectEnabled(jg)||(i.advance(),i.next==Ra))return;let t=0;for(;va.indexOf(i.next)>-1;)i.advance(),t++;if(Xa(i.next,!0)){for(i.advance(),t++;Xa(i.next,!1);)i.advance(),t++;for(;va.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==Hg)return;for(let n=0;;n++){if(n==7){if(!Xa(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Wg,-t)}),aS=se({"get set async static":u.modifier,"for while do if else switch try catch finally return throw break continue default case":u.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":u.operatorKeyword,"let var const using function class extends":u.definitionKeyword,"import export from":u.moduleKeyword,"with debugger new":u.keyword,TemplateString:u.special(u.string),super:u.atom,BooleanLiteral:u.bool,this:u.self,null:u.null,Star:u.modifier,VariableName:u.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":u.function(u.variableName),VariableDefinition:u.definition(u.variableName),Label:u.labelName,PropertyName:u.propertyName,PrivatePropertyName:u.special(u.propertyName),"CallExpression/MemberExpression/PropertyName":u.function(u.propertyName),"FunctionDeclaration/VariableDefinition":u.function(u.definition(u.variableName)),"ClassDeclaration/VariableDefinition":u.definition(u.className),"NewExpression/VariableName":u.className,PropertyDefinition:u.definition(u.propertyName),PrivatePropertyDefinition:u.definition(u.special(u.propertyName)),UpdateOp:u.updateOperator,"LineComment Hashbang":u.lineComment,BlockComment:u.blockComment,Number:u.number,String:u.string,Escape:u.escape,ArithOp:u.arithmeticOperator,LogicOp:u.logicOperator,BitOp:u.bitwiseOperator,CompareOp:u.compareOperator,RegExp:u.regexp,Equals:u.definitionOperator,Arrow:u.function(u.punctuation),": Spread":u.punctuation,"( )":u.paren,"[ ]":u.squareBracket,"{ }":u.brace,"InterpolationStart InterpolationEnd":u.special(u.brace),".":u.derefOperator,", ;":u.separator,"@":u.meta,TypeName:u.typeName,TypeDefinition:u.definition(u.typeName),"type enum interface implements namespace module declare":u.definitionKeyword,"abstract global Privacy readonly override":u.modifier,"is keyof unique infer asserts":u.operatorKeyword,JSXAttributeValue:u.attributeValue,JSXText:u.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":u.angleBracket,"JSXIdentifier JSXNameSpacedName":u.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":u.attributeName,"JSXBuiltin/JSXIdentifier":u.standard(u.tagName)}),OS={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,for:474,of:483,while:486,with:490,do:494,if:498,else:500,switch:504,case:510,try:516,catch:520,finally:524,return:528,throw:532,break:536,continue:540,debugger:544},lS={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},hS={__proto__:null,"<":193},Mf=pe.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO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xHxPHx!EkP!HuP!K{P!LP!LZ!L_!L_P!HrP!Lc!LcP# iP# mHxPHx# s#$xCW@zP@zP@z@zP#&V@z@z#(i@z#+a@z#-m@z@z#.]#0q#0q#0v#1P#0q#1[PP#0qP@z#1t@z#5s@z@z6bPPP#9xPPP#:c#:cP#:cP#:y#:cPP#;PP#:vP#:v#;d#:v#S#>Y#>d#>j#>t#>z#?[#?b#@S#@f#@l#@r#AQ#Ag#C[#Cj#Cq#E]#Ek#G]#Gk#Gq#Gw#G}#HX#H_#He#Ho#IR#IXPPPPPPPPPPP#I_PPPPPPP#JS#MZ#Ns#Nz$ SPPP$&nP$&w$)p$0Z$0^$0a$1`$1c$1j$1rP$1x$1{P$2i$2m$3e$4s$4x$5`PP$5e$5k$5o$5r$5v$5z$6v$7_$7v$7z$7}$8Q$8W$8Z$8_$8cR!|RoqOXst!Z#d%l&p&r&s&u,n,s2S2VY!vQ'^-`1g5qQ%svQ%{yQ&S|Q&h!VS'U!e-WQ'd!iS'j!r!yU*h$|*X*lQ+l%|Q+y&UQ,_&bQ-^']Q-h'eQ-p'kQ0U*nQ1q,`R < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:379,context:tS,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,236,242,244,246,248,251,257,263,265,267,269,271,273,274,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["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$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Vp(Y!b'|0/l$]#t(S,2j(d$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[nS,rS,sS,oS,2,3,4,5,6,7,8,9,10,11,12,13,14,iS,new Gt("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(b~~",141,339),new Gt("j~RQYZXz{^~^O(P~~aP!P!Qd~iO(Q~~",25,322)],topRules:{Script:[0,7],SingleExpression:[1,275],SingleClassItem:[2,276]},dialects:{jsx:0,ts:15098},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:326,get:i=>OS[i]||-1},{term:342,get:i=>lS[i]||-1},{term:95,get:i=>hS[i]||-1}],tokenPrec:15124});var Fr=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=L(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),r=t.text.slice(n-t.from,this.pos-t.from),s=r.search(fS(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function Ef(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function cS(i){let e=Object.create(null),t=Object.create(null);for(let{label:r}of i){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:cS(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function jf(i,e){return t=>{for(let n=L(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}function fS(i,e){var t;let{source:n}=i,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?i:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}var uS=be.define();var QT=typeof navigator=="object"&&/Win/.test(navigator.platform);var dS=X.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",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:"'\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"}}}),Za=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},Va=class i{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,Oe.TrackDel),n=e.mapPos(this.to,1,Oe.TrackDel);return t==null||n==null?null:new i(this.field,t,n)}},Ya=class i{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let O of this.lines){if(n.length){let l=o,h=/^\t*/.exec(O)[0].length;for(let c=0;cnew Va(O.field,r[O.line]+O.from,r[O.line]+O.to));return{text:n,ranges:a}}static parse(e){let t=[],n=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,O=s[2]||s[3]||"",l=-1,h=O.replace(/\\[{}]/g,c=>c[1]);for(let c=0;c=l&&f.field++}r.push(new Za(l,n.length,s.index,s.index+h.length)),o=o.slice(0,s.index)+O+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,O,l)=>{for(let h of r)h.line==n.length&&h.from>l&&(h.from--,h.to--);return O}),n.push(o)}return new i(n,r)}},$S=U.widget({widget:new class extends Vt{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),pS=U.mark({class:"cm-snippetField"}),Yi=class i{constructor(e,t){this.ranges=e,this.active=t,this.deco=U.set(e.map(n=>(n.from==n.to?$S:pS).range(n.from,n.to)))}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new i(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))}},xn=B.define({map(i,e){return i&&i.map(e)}}),mS=B.define(),bn=ge.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(xn))return t.value;if(t.is(mS)&&i)return new Yi(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>X.decorations.from(i,e=>e?e.deco:U.none)});function _a(i,e){return S.create(i.filter(t=>t.field==e).map(t=>S.range(t.from,t.to)))}function QS(i){let e=Ya.parse(i);return(t,n,r,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,r),{main:O}=t.state.selection,l={changes:{from:r,to:s==O.from?O.to:s,insert:q.of(o)},scrollIntoView:!0,annotations:n?[uS.of(n),ne.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=_a(a,0)),a.some(h=>h.field>0)){let h=new Yi(a,0),c=l.effects=[xn.of(h)];t.state.field(bn,!1)===void 0&&c.push(B.appendConfig.of([bn,TS,bS,dS]))}t.dispatch(t.state.update(l))}}function Bf(i){return({state:e,dispatch:t})=>{let n=e.field(bn,!1);if(!n||i<0&&n.active==0)return!1;let r=n.active+i,s=i>0&&!n.ranges.some(o=>o.field==r+i);return t(e.update({selection:_a(n.ranges,r),effects:xn.of(s?null:new Yi(n.ranges,r)),scrollIntoView:!0})),!0}}var gS=({state:i,dispatch:e})=>i.field(bn,!1)?(e(i.update({effects:xn.of(null)})),!0):!1,SS=Bf(1),PS=Bf(-1);var yS=[{key:"Tab",run:SS,shift:PS},{key:"Escape",run:gS}],Gf=Z.define({combine(i){return i.length?i[0]:yS}}),TS=nt.highest(ht.compute([Gf],i=>i.facet(Gf)));function Te(i,e){return Object.assign(Object.assign({},e),{apply:QS(i)})}var bS=X.domEventHandlers({mousedown(i,e){let t=e.state.field(bn,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==t.active?!1:(e.dispatch({selection:_a(t.ranges,r.field),effects:xn.of(t.ranges.some(s=>s.field>r.field)?new Yi(t.ranges,r.field):null),scrollIntoView:!0}),!0)}});var Df=new class extends Ie{};Df.startSide=1;Df.endSide=-1;var gT=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent);var Hf=[Te("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Te("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Te("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Te("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Te("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Te(`try { \${} } catch (\${error}) { \${} @@ -27,6 +27,6 @@ var ls=[],YO=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2, `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=TP;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let n=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].tothis.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=is.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e=="number"&&(e=new z(this.parser.nodeSet.types[e],Ai,Ai,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(aO(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?id(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let t=aO(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(y.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e=="string"?W(this.parser.getNodeType(e),t,n,r):new rs(e,t)}get buffer(){return new ns(this.parser.nodeSet)}};function id(i,e,t,n,r){let s=i[e].to,o=[],a=[],O=t.from+n;function l(h,c){for(;c?h>=s:h>s;){let f=i[e+1].from-s;n+=f,h+=f,e++,s=i[e].to}}for(let h=t.firstChild;h;h=h.nextSibling){l(h.from+n,!0);let c=h.from+n,f,d=r.get(h.tree);d?f=d:h.to+n>s?(f=id(i,e,h,n,r),l(h.to+n,!1)):f=h.toTree(),o.push(f),a.push(c-O)}return l(t.to+n,!1),new z(t.type,o,a,t.to+n-O,t.tree?t.tree.propValues:void 0)}var Zn=class i extends yt{constructor(e,t,n,r,s,o,a,O,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=O,this.wrappers=l,this.nodeTypes=Object.create(null);for(let h of e.types)this.nodeTypes[h.name]=h.id}createParse(e,t,n){let r=new nO(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let t=rO(e);if(!t)return this;let{nodeSet:n,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),O=this.inlineParsers.slice(),l=this.inlineNames.slice(),h=this.endLeafBlock.slice(),c=this.wrappers;if(Xn(t.defineNodes)){r=Object.assign({},r);let f=n.types.slice(),d;for(let $ of t.defineNodes){let{name:p,block:m,composite:Q,style:g}=typeof $=="string"?{name:$}:$;if(f.some(P=>P.name==p))continue;Q&&(r[f.length]=(P,w,k)=>Q(w,k,P.value));let T=f.length,x=Q?["Block","BlockContext"]:m?T>=y.ATXHeading1&&T<=y.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(ie.define({id:T,name:p,props:x&&[[Y.group,x]]})),g&&(d||(d={}),Array.isArray(g)||g instanceof Ye?d[p]=g:Object.assign(d,g))}n=new St(f),d&&(n=n.extend(se(d)))}if(Xn(t.props)&&(n=n.extend(...t.props)),Xn(t.remove))for(let f of t.remove){let d=this.blockNames.indexOf(f),$=this.inlineNames.indexOf(f);d>-1&&(s[d]=o[d]=void 0),$>-1&&(O[$]=void 0)}if(Xn(t.parseBlock))for(let f of t.parseBlock){let d=a.indexOf(f.name);if(d>-1)s[d]=f.parse,o[d]=f.leaf;else{let $=f.before?ts(a,f.before):f.after?ts(a,f.after)+1:a.length-1;s.splice($,0,f.parse),o.splice($,0,f.leaf),a.splice($,0,f.name)}f.endLeaf&&h.push(f.endLeaf)}if(Xn(t.parseInline))for(let f of t.parseInline){let d=l.indexOf(f.name);if(d>-1)O[d]=f.parse;else{let $=f.before?ts(l,f.before):f.after?ts(l,f.after)+1:l.length-1;O.splice($,0,f.parse),l.splice($,0,f.name)}}return t.wrap&&(c=c.concat(t.wrap)),new i(n,s,o,a,h,r,O,l,c)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new oO(this,e,t);e:for(let r=t;r=0){r=a;continue e}}r++}return n.resolveMarkers(0)}};function Xn(i){return i!=null&&i.length>0}function rO(i){if(!Array.isArray(i))return i;if(i.length==0)return null;let e=rO(i[0]);if(i.length==1)return e;let t=rO(i.slice(1));if(!t||!e)return e||t;let n=(o,a)=>(o||Ai).concat(a||Ai),r=e.wrap,s=t.wrap;return{props:n(e.props,t.props),defineNodes:n(e.defineNodes,t.defineNodes),parseBlock:n(e.parseBlock,t.parseBlock),parseInline:n(e.parseInline,t.parseInline),remove:n(e.remove,t.remove),wrap:r?s?(o,a,O,l)=>r(s(o,a,O,l),a,O,l):r:s}}function ts(i,e){let t=i.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}var nd=[ie.none];for(let i=1,e;e=y[i];i++)nd[i]=ie.define({id:i,name:e,props:i>=y.Escape?[]:[[Y.group,i in Bu?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});var Ai=[],ns=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return z.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},ci=class{constructor(e,t,n,r=Ai){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new ns(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},rs=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Ai}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function W(i,e,t,n){return new ci(i,e,t,n)}var rd={resolve:"Emphasis",mark:"EmphasisMark"},sd={resolve:"Emphasis",mark:"EmphasisMark"},qi={},sO={},ve=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},Au="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",Vn=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Vn=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}var Fa={Escape(i,e,t){if(e!=92||t==i.end-1)return-1;let n=i.char(t+1);for(let r=0;r]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(n);if(r)return i.append(W(y.Autolink,t,t+1+r[0].length,[W(y.LinkMark,t,t+1),W(y.URL,t+1,t+r[0].length),W(y.LinkMark,t+r[0].length,t+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(s)return i.append(W(y.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return i.append(W(y.ProcessingInstruction,t,t+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return a?i.append(W(y.HTMLTag,t,t+1+a[0].length)):-1},Emphasis(i,e,t){if(e!=95&&e!=42)return-1;let n=t+1;for(;i.char(n)==e;)n++;let r=i.slice(t-1,t),s=i.slice(n,n+1),o=Vn.test(r),a=Vn.test(s),O=/\s|^$/.test(r),l=/\s|^$/.test(s),h=!l&&(!a||O||o),c=!O&&(!o||l||a),f=h&&(e==42||!c||o),d=c&&(e==42||!h||a);return i.append(new ve(e==95?rd:sd,t,n,(f?1:0)|(d?2:0)))},HardBreak(i,e,t){if(e==92&&i.char(t+1)==10)return i.append(W(y.HardBreak,t,t+2));if(e==32){let n=t+1;for(;i.char(n)==32;)n++;if(i.char(n)==10&&n>=t+2)return i.append(W(y.HardBreak,t,n+1))}return-1},Link(i,e,t){return e==91?i.append(new ve(qi,t,t+1,1)):-1},Image(i,e,t){return e==33&&i.char(t+1)==91?i.append(new ve(sO,t,t+2,1)):-1},LinkEnd(i,e,t){if(e!=93)return-1;for(let n=i.parts.length-1;n>=0;n--){let r=i.parts[n];if(r instanceof ve&&(r.type==qi||r.type==sO)){if(!r.side||i.skipSpace(r.to)==t&&!/[(\[]/.test(i.slice(t+1,t+2)))return i.parts[n]=null,-1;let s=i.takeContent(n),o=i.parts[n]=bP(i,s,r.type==qi?y.Link:y.Image,r.from,t+1);if(r.type==qi)for(let a=0;ae?W(y.URL,e+t,s+t):s==i.length?null:!1}}function ad(i,e,t){let n=i.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let r=n==40?41:n;for(let s=e+1,o=!1;s=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new ve(e,t,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof ve&&(t.type==qi||t.type==sO))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n=e;O--){let p=this.parts[O];if(p instanceof ve&&p.side&1&&p.type==r.type&&!(s&&(r.side&1||p.side&2)&&(p.to-p.from+o)%3==0&&((p.to-p.from)%3||o%3))){a=p;break}}if(!a)continue;let l=r.type.resolve,h=[],c=a.from,f=r.to;if(s){let p=Math.min(2,a.to-a.from,o);c=a.to-p,f=r.from+p,l=p==1?"Emphasis":"StrongEmphasis"}a.type.mark&&h.push(this.elt(a.type.mark,c,a.to));for(let p=O+1;p=0;t--){let n=this.parts[t];if(n instanceof ve&&n.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return vn(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e=="string"?W(this.parser.getNodeType(e),t,n,r):new rs(e,t)}};function aO(i,e){if(!e.length)return i;if(!i.length)return e;let t=i.slice(),n=0;for(let r of e){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` -`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Y.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,O=o,l=a;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let h=ld(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,h);else{let c=new z(e.parser.nodeSet.types[y.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(c,t.tree),e.addNode(c,h)}if(t.type.is("Block")&&(xP.indexOf(t.type.id)<0?(o=t.to-n,a=e.block.children.length):(o=O,a=l,O=t.to-n,l=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}};function ld(i,e){let t=i;for(let n=1;nes[i]),Object.keys(es).map(i=>td[i]),Object.keys(es),yP,Bu,Object.keys(Fa).map(i=>Fa[i]),Object.keys(Fa),[]);function wP(i,e,t){let n=[];for(let r=i.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function cd(i){let{codeParser:e,htmlParser:t}=i;return{wrap:wi((r,s)=>{let o=r.type.id;if(e&&(o==y.CodeBlock||o==y.FencedCode)){let a="";if(o==y.FencedCode){let l=r.node.getChild(y.CodeInfo);l&&(a=s.read(l.from,l.to))}let O=e(a);if(O)return{parser:O,overlay:l=>l.type.id==y.CodeText}}else if(t&&(o==y.HTMLBlock||o==y.HTMLTag||o==y.CommentBlock))return{parser:t,overlay:wP(r.node,r.from,r.to)};return null})}}var XP={resolve:"Strikethrough",mark:"StrikethroughMark"},vP={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":u.strikethrough}},{name:"StrikethroughMark",style:u.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let n=i.slice(t-1,t),r=i.slice(t+2,t+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),a=Vn.test(n),O=Vn.test(r);return i.addDelimiter(XP,t,t+2,!o&&(!O||s||a),!s&&(!a||o||O))},after:"Emphasis"}]};function Rn(i,e,t=0,n,r=0){let s=0,o=!0,a=-1,O=-1,l=!1,h=()=>{n.push(i.elt("TableCell",r+a,r+O,i.parser.parseInline(e.slice(a,O),r+a)))};for(let c=t;c-1)&&s++,o=!1,n&&(a>-1&&h(),n.push(i.elt("TableDelimiter",c+r,c+r+1))),a=O=-1):(l||f!=32&&f!=9)&&(a<0&&(a=c),O=c+1),l=!l&&f==92}return a>-1&&(s++,n&&h()),s}function Wu(i,e){for(let t=e;tr instanceof ss)||!Wu(e.text,e.basePos))return!1;let n=i.peekLine();return fd.test(n)&&Rn(i,e.text,e.basePos)==Rn(i,n,e.basePos)},before:"SetextHeading"}]},lO=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},ZP={defineNodes:[{name:"Task",block:!0,style:u.list},{name:"TaskMarker",style:u.atom}],parseBlock:[{name:"TaskList",leaf(i,e){return/^\[[ xX]\][ \t]/.test(e.content)&&i.parentType().name=="ListItem"?new lO:null},after:"SetextHeading"}]},Uu=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Mu=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,VP=/[\w-]+\.[\w-]+($|\/)/,Eu=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Gu=/\/[a-zA-Z\d@.]+/gy;function Lu(i,e,t,n){let r=0;for(let s=e;s-1)return-1;let n=e+t[0].length;for(;;){let r=i[n-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&Lu(i,e,n,")")>Lu(i,e,n,"("))n--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(i.slice(e,n))))n=e+s.index;else break}return n}function ju(i,e){Eu.lastIndex=e;let t=Eu.exec(i);if(!t)return-1;let n=t[0][t[0].length-1];return n=="_"||n=="-"?-1:e+t[0].length-(n=="."?1:0)}var _P={parseInline:[{name:"Autolink",parse(i,e,t){let n=t-i.offset;if(n&&/\w/.test(i.text[n-1]))return-1;Uu.lastIndex=n;let r=Uu.exec(i.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=YP(i.text,n+r[0].length),s>-1&&i.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(i.text.slice(n,s));s=n+o[0].length}}else r[3]?s=ju(i.text,n):(s=ju(i.text,n+r[0].length),s>-1&&r[0]=="xmpp:"&&(Gu.lastIndex=s,r=Gu.exec(i.text),r&&(s=r.index+r[0].length)));return s<0?-1:(i.addElement(i.elt("URL",t,s+i.offset)),s+i.offset)}}]},ud=[RP,ZP,vP,_P];function dd(i,e,t){return(n,r,s)=>{if(r!=i||n.char(s+1)==i)return-1;let o=[n.elt(t,s,s+1)];for(let a=s+1;a"}}}),Pd=new Y,yd=hd.configure({props:[ye.add(i=>!i.is("Block")||i.is("Document")||$O(i)!=null||zP(i)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Pd.add($O),de.add({Document:()=>null}),Tt.add({Document:Sd})]});function $O(i){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(i.name);return e?+e[1]:void 0}function zP(i){return i.name=="OrderedList"||i.name=="BulletList"}function CP(i,e){let t=i;for(;;){let n=t.nextSibling,r;if(!n||(r=$O(n.type))!=null&&r<=e)break;t=n}return t.to}var qP=cc.of((i,e,t)=>{for(let n=L(i).resolveInner(t,-1);n&&!(n.fromt)return{from:t,to:s}}return null});function mO(i){return new fe(Sd,i,[qP],"markdown")}var AP=mO(yd),WP=yd.configure([ud,pd,$d,md,{props:[ye.add({Table:(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}]),pO=mO(WP);function UP(i,e){return t=>{if(t&&i){let n=null;if(t=/\S*/.exec(t)[0],typeof i=="function"?n=i(t):n=$n.matchLanguageName(i,t,!0),n instanceof $n)return n.support?n.support.language.parser:si.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}var Yn=class{constructor(e,t,n,r,s,o,a){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=a}blank(e,t=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length0;r--)n+=" ";return n+(t?this.spaceAfter:"")}}marker(e,t){let n=this.node.name=="OrderedList"?String(+bd(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function Td(i,e){let t=[],n=[];for(let r=i;r;r=r.parent){if(r.name=="FencedCode")return n;(r.name=="ListItem"||r.name=="Blockquote")&&t.push(r)}for(let r=t.length-1;r>=0;r--){let s=t[r],o,a=e.lineAt(s.from),O=s.from-a.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(O))))n.push(new Yn(s,O,O+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(O)))){let l=o[3],h=o[0].length;l.length>=4&&(l=l.slice(0,l.length-4),h-=4),n.push(new Yn(s.parent,O,O+h,o[1],l,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(O)))){let l=o[4],h=o[0].length;l.length>4&&(l=l.slice(0,l.length-4),h-=4);let c=o[2];o[3]&&(c+=o[3].replace(/[xX]/," ")),n.push(new Yn(s.parent,O,O+h,o[1],l,c,s))}}return n}function bd(i,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(i.from,i.from+10))}function uO(i,e,t,n=0){for(let r=-1,s=i;;){if(s.name=="ListItem"){let a=bd(s,e),O=+a[2];if(r>=0){if(O!=r+1)return;t.push({from:s.from+a[1].length,to:s.from+a[0].length,insert:String(r+2+n)})}r=O}let o=s.nextSibling;if(!o)break;s=o}}function QO(i,e){let t=/^[ \t]*/.exec(i)[0].length;if(!t||e.facet(Wt)!=" ")return i;let n=xe(i,4,t),r="";for(let s=n;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+i.slice(t)}var MP=({state:i,dispatch:e})=>{let t=L(i),{doc:n}=i,r=null,s=i.changeByRange(o=>{if(!o.empty||!pO.isActiveAt(i,o.from,-1)&&!pO.isActiveAt(i,o.from,1))return r={range:o};let a=o.from,O=n.lineAt(a),l=Td(t.resolveInner(a,-1),n);for(;l.length&&l[l.length-1].from>a-O.from;)l.pop();if(!l.length)return r={range:o};let h=l[l.length-1];if(h.to-h.spaceAfter.length>a-O.from)return r={range:o};let c=a>=h.to-h.spaceAfter.length&&!/\S/.test(O.text.slice(h.to));if(h.item&&c){let m=h.node.firstChild,Q=h.node.getChild("ListItem","ListItem");if(m.to>=a||Q&&Q.to0&&!/[^\s>]/.test(n.lineAt(O.from-1).text)){let g=l.length>1?l[l.length-2]:null,T,x="";g&&g.item?(T=O.from+g.from,x=g.marker(n,1)):T=O.from+(g?g.to:0);let P=[{from:T,to:a,insert:x}];return h.node.name=="OrderedList"&&uO(h.item,n,P,-2),g&&g.node.name=="OrderedList"&&uO(g.item,n,P),{range:S.cursor(T+x.length),changes:P}}else{let g=gd(l,i,O);return{range:S.cursor(a+g.length+1),changes:{from:O.from,insert:g+i.lineBreak}}}}if(h.node.name=="Blockquote"&&c&&O.from){let m=n.lineAt(O.from-1),Q=/>\s*$/.exec(m.text);if(Q&&Q.index==h.from){let g=i.changes([{from:m.from+Q.index,to:m.to},{from:O.from+h.from,to:O.to}]);return{range:o.map(g),changes:g}}}let f=[];h.node.name=="OrderedList"&&uO(h.item,n,f);let d=h.item&&h.item.from]*/.exec(O.text)[0].length>=h.to)for(let m=0,Q=l.length-1;m<=Q;m++)$+=m==Q&&!d?l[m].marker(n,1):l[m].blank(mO.from&&/\s/.test(O.text.charAt(p-O.from-1));)p--;return $=QO($,i),EP(h.node,i.doc)&&($=gd(l,i,O)+i.lineBreak+$),f.push({from:p,to:a,insert:i.lineBreak+$}),{range:S.cursor(p+$.length+1),changes:f}});return r?!1:(e(i.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)};function Qd(i){return i.name=="QuoteMark"||i.name=="ListMark"}function EP(i,e){if(i.name!="OrderedList"&&i.name!="BulletList")return!1;let t=i.firstChild,n=i.getChild("ListItem","ListItem");if(!n)return!1;let r=e.lineAt(t.to),s=e.lineAt(n.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let t=L(i),n=null,r=i.changeByRange(s=>{let o=s.from,{doc:a}=i;if(s.empty&&pO.isActiveAt(i,s.from)){let O=a.lineAt(o),l=Td(GP(t,o),a);if(l.length){let h=l[l.length-1],c=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(o-O.from>c&&!/\S/.test(O.text.slice(c,o-O.from)))return{range:S.cursor(O.from+c),changes:{from:O.from+c,to:o}};if(o-O.from==c&&(!h.item||O.from<=h.item.from||!/\S/.test(O.text.slice(0,h.to)))){let f=O.from+h.from;if(h.item&&h.node.from=97&&i<=122||i>=65&&i<=90}function _n(i){return i==95||i>=128||Rd(i)}function SO(i){return i>=48&&i<=55||i>=97&&i<=102||i>=65&&i<=70}var O1={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},l1=new J(i=>{if(i.next==40){i.advance();let e=0;for(;vd(i.peek(e));)e++;let t="",n;for(;Rd(n=i.peek(e));)t+=String.fromCharCode(n),e++;for(;vd(i.peek(e));)e++;i.peek(e)==41&&O1[t.toLowerCase()]&&i.acceptToken(IP)}else if(i.next==60&&i.peek(1)==60&&i.peek(2)==60){for(let n=0;n<3;n++)i.advance();for(;i.next==32||i.next==9;)i.advance();let e=i.next==39;if(e&&i.advance(),!_n(i.next))return;let t=String.fromCharCode(i.next);for(;i.advance(),!(!_n(i.next)&&!(i.next>=48&&i.next<=55));)t+=String.fromCharCode(i.next);if(e){if(i.next!=39)return;i.advance()}if(i.next!=10&&i.next!=13)return;for(;;){let n=i.next==10||i.next==13;if(i.advance(),i.next<0)return;if(n){for(;i.next==32||i.next==9;)i.advance();let r=!0;for(let s=0;s{i.next<0&&i.acceptToken(JP)}),c1=new J((i,e)=>{i.next==63&&e.canShift(kd)&&i.peek(1)==62&&i.acceptToken(kd)});function f1(i){let e=i.peek(1);if(e==110||e==114||e==116||e==118||e==101||e==102||e==92||e==36||e==34||e==123)return 2;if(e>=48&&e<=55){let t=2,n;for(;t<5&&(n=i.peek(t))>=48&&n<=55;)t++;return t}if(e==120&&SO(i.peek(2)))return SO(i.peek(3))?4:3;if(e==117&&i.peek(2)==123)for(let t=3;;t++){let n=i.peek(t);if(n==125)return t==2?0:t+1;if(!SO(n))break}return 0}var u1=new J((i,e)=>{let t=!1;for(;!(i.next==34||i.next<0||i.next==36&&(_n(i.peek(1))||i.peek(1)==123)||i.next==123&&i.peek(1)==36);t=!0){if(i.next==92){let n=f1(i);if(n){if(t)break;return i.acceptToken(HP,n)}}else if(!t&&(i.next==91||i.next==45&&i.peek(1)==62&&_n(i.peek(2))||i.next==63&&i.peek(1)==45&&i.peek(2)==62&&_n(i.peek(3)))&&e.canShift(KP))break;i.advance()}t&&i.acceptToken(FP)}),d1=se({"Visibility abstract final static":u.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":u.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":u.controlKeyword,"and or xor yield unset clone instanceof insteadof":u.operatorKeyword,"function fn class trait implements extends const enum global interface use var":u.definitionKeyword,"include include_once require require_once namespace":u.moduleKeyword,"new from echo print array list as":u.keyword,null:u.null,Boolean:u.bool,VariableName:u.variableName,"NamespaceName/...":u.namespace,"NamedType/...":u.typeName,Name:u.name,"CallExpression/Name":u.function(u.variableName),"LabelStatement/Name":u.labelName,"MemberExpression/Name":u.propertyName,"MemberExpression/VariableName":u.special(u.propertyName),"ScopedExpression/ClassMemberName/Name":u.propertyName,"ScopedExpression/ClassMemberName/VariableName":u.special(u.propertyName),"CallExpression/MemberExpression/Name":u.function(u.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":u.function(u.propertyName),"MethodDeclaration/Name":u.function(u.definition(u.variableName)),"FunctionDefinition/Name":u.function(u.definition(u.variableName)),"ClassDeclaration/Name":u.definition(u.className),UpdateOp:u.updateOperator,ArithOp:u.arithmeticOperator,"LogicOp IntersectionType/&":u.logicOperator,BitOp:u.bitwiseOperator,CompareOp:u.compareOperator,ControlOp:u.controlOperator,AssignOp:u.definitionOperator,"$ ConcatOp":u.operator,LineComment:u.lineComment,BlockComment:u.blockComment,Integer:u.integer,Float:u.float,String:u.string,ShellExpression:u.special(u.string),"=> ->":u.punctuation,"( )":u.paren,"#[ [ ]":u.squareBracket,"${ { }":u.brace,"-> ?->":u.derefOperator,", ; :: : \\":u.separator,"PhpOpen PhpClose":u.processingInstruction}),$1={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},Zd=pe.deserialize({version:14,states:"%#[Q`OWOOQhQaOOP%oO`OOOOO#t'#Hh'#HhO%tO#|O'#DuOOO#u'#Dx'#DxQ&SOWO'#DxO&XO$VOOOOQ#u'#Dy'#DyO&lQaO'#D}O'[QdO'#EQO+QQd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a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T$x{$|Q(q%QQ(v%TQ(y%VR2b1WQ%c!]Q(u%SQ,d(tQ/W,cQ/Y,eQ1Q/XR2_1RQ%q!fR)m%rR/p-O",nodeNames:"\u26A0 ( HeredocString EscapeSequence abstract LogicOp array as Boolean break case catch clone const continue default declare do echo else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach from function global goto if implements include include_once LogicOp insteadof interface list match namespace new null LogicOp print readonly require require_once return switch throw trait try unset use var Visibility while LogicOp yield LineComment BlockComment TextInterpolation PhpClose Text PhpOpen Template TextInterpolation EmptyStatement ; } { Block : LabelStatement Name ExpressionStatement ConditionalExpression LogicOp MatchExpression ) ( ParenthesizedExpression MatchBlock MatchArm , => AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> Name VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp IntersectionType OptionalType NamedType QualifiedName \\ NamespaceName Name NamespaceName Name ScopedExpression :: ClassMemberName DynamicMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter PropertyHooks PropertyHook UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:318,nodeProps:[["group",-36,2,8,49,82,84,86,89,94,95,103,107,108,112,113,116,120,126,132,137,139,140,154,155,156,157,160,161,173,174,188,190,191,192,193,194,200,"Expression",-28,75,79,81,83,201,203,208,210,211,214,217,218,219,220,221,223,224,225,226,227,228,229,230,231,234,235,239,240,"Statement",-4,121,123,124,125,"Type"],["isolate",-4,67,68,71,200,""],["openedBy",70,"phpOpen",77,"{",87,"(",102,"#["],["closedBy",72,"phpClose",78,"}",88,")",165,"]"]],propSources:[d1],skippedNodes:[0],repeatNodeCount:32,tokenData:"!GQ_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!]!,P!]!^!-a!^!_!-}!_!`!1S!`!a!2d!a!b!3t!b!c!7^!c!d!7z!d!e!9Y!e!}!7z!}#O!;b#O#P!V<%lO8VR9WV'TP%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ9rV%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ:^O%`QQ:aRO;'S9m;'S;=`:j;=`O9mQ:oW%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l9m<%lO9mQ;[P;=`<%l9mR;fV'TP%`QOY$zYZ%fZ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name:"php",parser:Zd.configure({props:[de.add({IfStatement:_e({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:_e({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},ColonBlock:i=>i.baseIndent+i.unit,"Block EnumBody DeclarationList":Ar({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"String BlockComment":()=>null,Statement:_e({except:/^({|end(for|foreach|switch|while)\b)/})}),ye.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":Ut,ColonBlock(i){return{from:i.from+1,to:i.to}},BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function Vd(i={}){let e=[],t;if(i.baseLanguage!==null)if(i.baseLanguage)t=i.baseLanguage;else{let n=Ci({matchClosingTags:!1});e.push(n.support),t=n.language}return new oe(p1.configure({wrap:t&&wi(n=>n.type.isTop?{parser:t.parser,overlay:r=>r.name=="Text"}:null),top:i.plain?"Program":"Template"}),e)}var m1=pe.deserialize({version:14,states:"%^QYQPOOO!YQQO'#CaO#RQQO'#CrOOQO'#Ct'#CtQYQPOOOOQO'#C}'#C}O#]QQO'#CzO$ZQQO'#CoOOQO'#Cz'#CzOOQO'#Cu'#CuO$lQQO,58{OOQO,58{,58{O$sQQO,59^O$sQQO,59^OOQO,59^,59^OOQO-E6r-E6rO$zQQO'#CfOOQO,58|,58|OOQO'#C|'#C|O%]QSO'#C{O%hQQO,59ZOOQO-E6s-E6sOOQO1G.g1G.gO%mQQO1G.xOOQO1G.x1G.xO%tQQO,59QO%yQSO'#CvO&bQSO,59gOOQO1G.u1G.uOOQO7+$d7+$dOOQO1G.l1G.lOOQO,59b,59bOOQO-E6t-E6t",stateData:"&{~OmOSPOS~OSPOeQOgRO~OVUOZTO[TO]TO^WO_WO`WOaWObWOtVOuWO~ORZO~PeOVUOZTO[TO]TO^WO_WO`WObWOtVOuWO~Oa[Od^O~P!aOX`ORnXVnXZnX[nX]nX^nX_nX`nXanXbnXtnXunXdnX~OVbOZTO[TO]TOsoP~ORfO~PeOdhO~PeOVbOZTO[TO]TOWoP~OrjOsoXWoX~OslO~OdmO~PeOWnO~OVbOZTO[TO]TOrjXsjXWjX~OrjOsoaWoa~Og[]a_^`bVmPZ`~",goto:"#brPPPPPswPPP!PPPPPPPPPwPPsP!S!Y!hPPP!n!v!|#TTROS]WPQY[]gRaUQSOR_SQYPQ]QUeY]gRg[QkcRpk]XPQY[]gQdVRi`ScV`Roj[WPQY[]gVbV`j",nodeNames:"\u26A0 BlockComment Template }} {{ InsertBlock Function Identifier ) ( FunctionParamList String Boolean Number ChainedIdentifier Comparison Operator CodeTag Math Array %} {% CodeBlock PlainText",maxTerm:37,nodeProps:[["openedBy",3,"{{",8,"(",20,"{%"],["closedBy",4,"}}",9,")",21,"%}"]],skippedNodes:[0,1],repeatNodeCount:3,tokenData:"#Jr~R!^OX$}XY&ZYZ&ZZ]$}]^&Z^p$}pq&Zqr'Wrs(Ysu$}uv-cvw$}wx.gxy3Wyz3nz{4U{|4r|}5Y}!O5r!O!P>u!P!Q?]!Q!R:[!R![=m![!]?y!]!^$}!^!_@a!_!`@}!`!a@a!a!c$}!c!}6}!}#OAk#O#P$}#P#QBR#Q#R$}#R#S6}#S#T$}#T#UBi#U#V!'f#V#X6}#X#Y!,h#Y#Z# Y#Z#]6}#]#^#'g#^#a6}#a#b#.T#b#c#5r#c#d#8[#d#g6}#g#h#9h#h#i#AV#i#j!.Q#j#k!@V#k#l#Co#l#o6}#o#p#Ge#p#q>u#q#r#In#r;'S$};'S;=`&O<%lO$}P%STgPO#o$}#o#p%c#p;'S$};'S;=`&O<%lO$}P%fWOs$}tu$}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}}!O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#h6}#h#iE_#i#o6}#o#p%c#p;'S$};'S;=`&O<%lO$}~#8cagPV~O}$}}!O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#f6}#f#gE_#g#o6}#o#p%c#p;'S$};'S;=`&O<%lO$}~#9ocgPV~O}$}}!O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#X6}#X#Y#:z#Y#h6}#h#i#m#g#o6}#o#p%c#p;'S$};'S;=`&O<%lO$}~#>tagPV~O}$}}!O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#h6}#h#i#?y#i#o6}#o#p%c#p;'S$};'S;=`&O<%lO$}~#@QagPV~O}$}}!O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#g6}#g#h!=65&&i<=90||i==95||i>=97&&i<=122||i>=161}function v1(i){return i==9||i==10||i==13||i==32}var _d=null,zd=null,Cd=0;function yO(i,e){let t=i.pos+e;if(zd==i&&Cd==t)return _d;for(;v1(i.peek(e));)e++;let n="";for(;;){let r=i.peek(e);if(!X1(r))break;n+=String.fromCharCode(r),e++}return zd=i,Cd=t,_d=n||null}function qd(i,e){this.name=i,this.parent=e}var R1=new Lt({start:null,shift(i,e,t,n){return e==PO?new qd(yO(n,1)||"",i):i},reduce(i,e){return e==k1&&i?i.parent:i},reuse(i,e,t,n){let r=e.type.id;return r==PO||r==w1?new qd(yO(n,1)||"",i):i},strict:!1}),Z1=new J((i,e)=>{if(i.next==60){if(i.advance(),i.next==47){i.advance();let t=yO(i,0);if(!t)return i.acceptToken(y1);if(e.context&&t==e.context.name)return i.acceptToken(g1);for(let n=e.context;n;n=n.parent)if(n.name==t)return i.acceptToken(S1,-2);i.acceptToken(P1)}else if(i.next!=33&&i.next!=63)return i.acceptToken(PO)}},{contextual:!0});function TO(i,e){return new J(t=>{let n=0,r=e.charCodeAt(0);e:for(;!(t.next<0);t.advance(),n++)if(t.next==r){for(let s=1;s"),Y1=TO(b1,"?>"),_1=TO(x1,"]]>"),z1=se({Text:u.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":u.angleBracket,TagName:u.tagName,"MismatchedCloseTag/TagName":[u.tagName,u.invalid],AttributeName:u.attributeName,AttributeValue:u.attributeValue,Is:u.definitionOperator,"EntityReference CharacterReference":u.character,Comment:u.blockComment,ProcessingInst:u.processingInstruction,DoctypeDecl:u.documentMeta,Cdata:u.special(u.string)}),Ad=pe.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$f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.from,t.to):""}function bO(i,e){let t=e&&e.firstChild;return!t||t.name!="OpenTag"?"":as(i,t)}function C1(i,e,t){let n=e&&e.getChildren("Attribute").find(s=>s.from<=t&&s.to>=t),r=n&&n.getChild("AttributeName");return r?i.sliceString(r.from,r.to):""}function xO(i){for(let e=i&&i.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function q1(i,e){var t;let n=L(i).resolveInner(e,-1),r=null;for(let s=n;!r&&s.parent;s=s.parent)(s.name=="OpenTag"||s.name=="CloseTag"||s.name=="SelfClosingTag"||s.name=="MismatchedCloseTag")&&(r=s);if(r&&(r.to>e||r.lastChild.type.isError)){let s=r.parent;if(n.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:s}:{type:"openTag",from:n.from,context:xO(s)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:r};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:r};let o=n==r||n.name=="Attribute"?n.childBefore(e):n;return o?.name=="StartTag"?{type:"openTag",from:e,context:xO(s)}:o?.name=="StartCloseTag"&&o.to<=e?{type:"closeTag",from:e,context:s}:o?.name=="Is"?{type:"attrValue",from:e,context:r}:o?{type:"attrName",from:e,context:r}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:e,context:n.parent};for(;n.parent&&n.to==e&&!(!((t=n.lastChild)===null||t===void 0)&&t.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:e,context:n.name=="Element"?n:xO(n)}:null}var wO=class{constructor(e,t,n){this.attrs=t,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:"type"},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=e.textContent?e.textContent.map(r=>({label:r,type:"text"})):[]}},kO=/^[:\-\.\w\u00b7-\uffff]*$/;function Wd(i){return Object.assign(Object.assign({type:"property"},i.completion||{}),{label:i.name})}function Ud(i){return typeof i=="string"?{label:`"${i}"`,type:"constant"}:/^"/.test(i.label)?i:Object.assign(Object.assign({},i),{label:`"${i.label}"`})}function A1(i,e){let t=[],n=[],r=Object.create(null);for(let O of e){let l=Wd(O);t.push(l),O.global&&n.push(l),O.values&&(r[O.name]=O.values.map(Ud))}let s=[],o=[],a=Object.create(null);for(let O of i){let l=n,h=r;O.attributes&&(l=l.concat(O.attributes.map(f=>typeof f=="string"?t.find(d=>d.label==f)||{label:f,type:"property"}:(f.values&&(h==r&&(h=Object.create(h)),h[f.name]=f.values.map(Ud)),Wd(f)))));let c=new wO(O,l,h);a[c.name]=c,s.push(c),O.top&&o.push(c)}o.length||(o=s);for(let O=0;O{var l;let{doc:h}=O.state,c=q1(O.state,O.pos);if(!c||c.type=="tag"&&!O.explicit)return null;let{type:f,from:d,context:$}=c;if(f=="openTag"){let p=o,m=bO(h,$);if(m){let Q=a[m];p=Q?.children||s}return{from:d,options:p.map(Q=>Q.completion),validFor:kO}}else if(f=="closeTag"){let p=bO(h,$);return p?{from:d,to:O.pos+(h.sliceString(O.pos,O.pos+1)==">"?1:0),options:[((l=a[p])===null||l===void 0?void 0:l.closeNameCompletion)||{label:p+">",type:"type"}],validFor:kO}:null}else if(f=="attrName"){let p=a[as(h,$)];return{from:d,options:p?.attrs||n,validFor:kO}}else if(f=="attrValue"){let p=C1(h,$,d);if(!p)return null;let m=a[as(h,$)],Q=(m?.attrValues||r)[p];return!Q||!Q.length?null:{from:d,to:O.pos+(h.sliceString(O.pos,O.pos+1)=='"'?1:0),options:Q,validFor:/^"[^"]*"?$/}}else if(f=="tag"){let p=bO(h,$),m=a[p],Q=[],g=$&&$.lastChild;p&&(!g||g.name!="CloseTag"||as(h,g)!=p)&&Q.push(m?m.closeCompletion:{label:"",type:"type",boost:2});let T=Q.concat((m?.children||($?s:o)).map(x=>x.openCompletion));if($&&m?.text.length){let x=$.firstChild;x.to>O.pos-20&&!/\S/.test(O.state.sliceDoc(x.to,O.pos))&&(T=T.concat(m.text))}return{from:d,options:T,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}var XO=ue.define({name:"xml",parser:Ad.configure({props:[de.add({Element(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),ye.add({Element(i){let e=i.firstChild,t=i.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:i.to}}}),Qn.add({"OpenTag CloseTag":i=>i.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function Ed(i={}){let e=[XO.data.of({autocomplete:A1(i.elements||[],i.attributes||[])})];return i.autoCloseTags!==!1&&e.push(W1),new oe(XO,e)}function Md(i,e,t=i.length){if(!e)return"";let n=e.firstChild,r=n&&n.getChild("TagName");return r?i.sliceString(r.from,Math.min(r.to,t)):""}var W1=X.inputHandler.of((i,e,t,n,r)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!XO.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,a=o.changeByRange(O=>{var l,h,c;let{head:f}=O,d=o.doc.sliceString(f-1,f)==n,$=L(o).resolveInner(f,-1),p;if(d&&n==">"&&$.name=="EndTag"){let m=$.parent;if(((h=(l=m.parent)===null||l===void 0?void 0:l.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(p=Md(o.doc,m.parent,f))){let Q=f+(o.doc.sliceString(f,f+1)===">"?1:0),g=``;return{range:O,changes:{from:f,to:Q,insert:g}}}}else if(d&&n=="/"&&$.name=="StartCloseTag"){let m=$.parent;if($.from==f-2&&((c=m.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(p=Md(o.doc,m,f))){let Q=f+(o.doc.sliceString(f,f+1)===">"?1:0),g=`${p}>`;return{range:S.cursor(f+g.length,-1),changes:{from:f,to:Q,insert:g}}}}return{range:O}});return a.changes.empty?!1:(i.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var Z=async i=>{let e=await window.importVersioned("legacy-modes");return zr.define(e[i])},U1={bash:()=>Z("shell"),c:()=>Z("c"),css:async()=>Nr(),"c++":()=>Z("cpp"),"c#":()=>Z("csharp"),clj:()=>Z("clojure"),clojure:()=>Z("clojure"),csharp:()=>Z("csharp"),dart:()=>Z("dart"),diff:()=>Z("diff"),for:()=>Z("fortran"),fortran:()=>Z("fortran"),"f#":()=>Z("fSharp"),fsharp:()=>Z("fSharp"),go:()=>Z("go"),haskell:()=>Z("haskell"),hs:()=>Z("haskell"),html:async()=>Ci({selfClosingTags:!0}),ini:()=>Z("properties"),java:()=>Z("java"),javascript:async()=>Oi(),json:async()=>Af(),js:async()=>Oi(),jl:()=>Z("julia"),julia:()=>Z("julia"),kotlin:()=>Z("kotlin"),latex:()=>Z("stex"),lua:()=>Z("lua"),markdown:async()=>os(),matlab:()=>Z("octave"),md:async()=>os(),mdown:async()=>os(),ml:()=>Z("sml"),mssql:()=>Z("msSQL"),mysql:()=>Z("mySQL"),nginx:()=>Z("nginx"),octave:()=>Z("octave"),pas:()=>Z("pascal"),pascal:()=>Z("pascal"),perl:()=>Z("perl"),pgsql:()=>Z("pgSQL"),php:async i=>{let e=i.includes("Z("perl"),"pl/sql":()=>Z("plSQL"),postgresql:()=>Z("pgSQL"),powershell:()=>Z("powerShell"),properties:()=>Z("properties"),ocaml:()=>Z("oCaml"),py:()=>Z("python"),python:()=>Z("python"),r:()=>Z("r"),rb:()=>Z("ruby"),rs:()=>Z("rust"),ruby:()=>Z("ruby"),rust:()=>Z("rust"),sas:()=>Z("sas"),scala:()=>Z("scala"),scheme:()=>Z("scheme"),shell:()=>Z("shell"),sh:()=>Z("shell"),smarty:()=>Z("smarty"),stext:()=>Z("stex"),swift:()=>Z("swift"),toml:()=>Z("toml"),ts:async()=>Oi({typescript:!0}),twig:async()=>Yd(),typescript:async()=>Oi({typescript:!0}),sql:()=>Z("standardSQL"),sqlite:()=>Z("sqlite"),vbs:()=>Z("vbScript"),vbscript:()=>Z("vbScript"),"vb.net":()=>Z("vb"),vbnet:()=>Z("vb"),xml:async()=>Ed(),yaml:()=>Z("yaml"),yml:()=>Z("yaml")};function Gd(i,e){let t=i.trim().replace(/^\./g,"").toLowerCase(),n=U1[t];if(!(typeof n>"u"))return n(e)}var Ld=new WeakMap;function Wi(i,e){let t=new mt;e.extensions.push(t.of([]));let n={usage:i,editorViewConfig:e,libEditorView:X,libEditorState:D,libCompartment:mt};window.$events.emitPublic(e.parent,"library-cm6::pre-init",n);let r=new X(e);return Ld.set(r,t),window.$events.emitPublic(e.parent,"library-cm6::post-init",{editorView:r,...n}),r}async function jd(i,e,t){let n=Ld.get(i),r=await Gd(e,t);i.dispatch({effects:n.reconfigure(r||[])})}var jt=class{constructor(e){this.ev=e}getContent(){return this.ev.state.doc.toString()}setContent(e){let{doc:t}=this.ev.state;this.ev.dispatch({changes:{from:0,to:t.length,insert:e}})}focus(){this.ev.focus()}setMode(e,t=""){jd(this.ev,e,t)}};function M1(i){let e='',t='',n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("cm-copy-button"),n.innerHTML=e,i.dom.appendChild(n);let r=620,s=60;n.addEventListener("click",()=>{Mh(i.state.doc.toString()),n.classList.add("success"),setTimeout(()=>{n.innerHTML=t},s/2),setTimeout(()=>{n.classList.remove("success")},r),setTimeout(()=>{n.innerHTML=e},r+s/2)})}function E1(i){let e="",t=i.querySelector("code");return t&&t.hasAttribute("dir")?e=t.getAttribute("dir"):i.hasAttribute("dir")&&(e=i.getAttribute("dir")),e}function Bd(i){let e=i.querySelector("code[class^=language-]");i.innerHTML=i.innerHTML.replace(//gi,` +`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Y.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,O=o,l=a;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let h=ld(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,h);else{let c=new z(e.parser.nodeSet.types[y.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(c,t.tree),e.addNode(c,h)}if(t.type.is("Block")&&(xP.indexOf(t.type.id)<0?(o=t.to-n,a=e.block.children.length):(o=O,a=l,O=t.to-n,l=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}};function ld(i,e){let t=i;for(let n=1;nes[i]),Object.keys(es).map(i=>td[i]),Object.keys(es),yP,Bu,Object.keys(Fa).map(i=>Fa[i]),Object.keys(Fa),[]);function wP(i,e,t){let n=[];for(let r=i.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function cd(i){let{codeParser:e,htmlParser:t}=i;return{wrap:wi((r,s)=>{let o=r.type.id;if(e&&(o==y.CodeBlock||o==y.FencedCode)){let a="";if(o==y.FencedCode){let l=r.node.getChild(y.CodeInfo);l&&(a=s.read(l.from,l.to))}let O=e(a);if(O)return{parser:O,overlay:l=>l.type.id==y.CodeText}}else if(t&&(o==y.HTMLBlock||o==y.HTMLTag||o==y.CommentBlock))return{parser:t,overlay:wP(r.node,r.from,r.to)};return null})}}var XP={resolve:"Strikethrough",mark:"StrikethroughMark"},vP={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":u.strikethrough}},{name:"StrikethroughMark",style:u.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let n=i.slice(t-1,t),r=i.slice(t+2,t+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),a=Vn.test(n),O=Vn.test(r);return i.addDelimiter(XP,t,t+2,!o&&(!O||s||a),!s&&(!a||o||O))},after:"Emphasis"}]};function Rn(i,e,t=0,n,r=0){let s=0,o=!0,a=-1,O=-1,l=!1,h=()=>{n.push(i.elt("TableCell",r+a,r+O,i.parser.parseInline(e.slice(a,O),r+a)))};for(let c=t;c-1)&&s++,o=!1,n&&(a>-1&&h(),n.push(i.elt("TableDelimiter",c+r,c+r+1))),a=O=-1):(l||f!=32&&f!=9)&&(a<0&&(a=c),O=c+1),l=!l&&f==92}return a>-1&&(s++,n&&h()),s}function Wu(i,e){for(let t=e;tr instanceof ss)||!Wu(e.text,e.basePos))return!1;let n=i.peekLine();return fd.test(n)&&Rn(i,e.text,e.basePos)==Rn(i,n,e.basePos)},before:"SetextHeading"}]},lO=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},ZP={defineNodes:[{name:"Task",block:!0,style:u.list},{name:"TaskMarker",style:u.atom}],parseBlock:[{name:"TaskList",leaf(i,e){return/^\[[ xX]\][ \t]/.test(e.content)&&i.parentType().name=="ListItem"?new lO:null},after:"SetextHeading"}]},Uu=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Mu=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,VP=/[\w-]+\.[\w-]+($|\/)/,Eu=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Gu=/\/[a-zA-Z\d@.]+/gy;function Lu(i,e,t,n){let r=0;for(let s=e;s-1)return-1;let n=e+t[0].length;for(;;){let r=i[n-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&Lu(i,e,n,")")>Lu(i,e,n,"("))n--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(i.slice(e,n))))n=e+s.index;else break}return n}function ju(i,e){Eu.lastIndex=e;let t=Eu.exec(i);if(!t)return-1;let n=t[0][t[0].length-1];return n=="_"||n=="-"?-1:e+t[0].length-(n=="."?1:0)}var _P={parseInline:[{name:"Autolink",parse(i,e,t){let n=t-i.offset;if(n&&/\w/.test(i.text[n-1]))return-1;Uu.lastIndex=n;let r=Uu.exec(i.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=YP(i.text,n+r[0].length),s>-1&&i.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(i.text.slice(n,s));s=n+o[0].length}}else r[3]?s=ju(i.text,n):(s=ju(i.text,n+r[0].length),s>-1&&r[0]=="xmpp:"&&(Gu.lastIndex=s,r=Gu.exec(i.text),r&&(s=r.index+r[0].length)));return s<0?-1:(i.addElement(i.elt("URL",t,s+i.offset)),s+i.offset)}}]},ud=[RP,ZP,vP,_P];function dd(i,e,t){return(n,r,s)=>{if(r!=i||n.char(s+1)==i)return-1;let o=[n.elt(t,s,s+1)];for(let a=s+1;a"}}}),Pd=new Y,yd=hd.configure({props:[ye.add(i=>!i.is("Block")||i.is("Document")||$O(i)!=null||zP(i)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Pd.add($O),de.add({Document:()=>null}),Tt.add({Document:Sd})]});function $O(i){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(i.name);return e?+e[1]:void 0}function zP(i){return i.name=="OrderedList"||i.name=="BulletList"}function CP(i,e){let t=i;for(;;){let n=t.nextSibling,r;if(!n||(r=$O(n.type))!=null&&r<=e)break;t=n}return t.to}var qP=cc.of((i,e,t)=>{for(let n=L(i).resolveInner(t,-1);n&&!(n.fromt)return{from:t,to:s}}return null});function mO(i){return new fe(Sd,i,[qP],"markdown")}var AP=mO(yd),WP=yd.configure([ud,pd,$d,md,{props:[ye.add({Table:(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}]),pO=mO(WP);function UP(i,e){return t=>{if(t&&i){let n=null;if(t=/\S*/.exec(t)[0],typeof i=="function"?n=i(t):n=$n.matchLanguageName(i,t,!0),n instanceof $n)return n.support?n.support.language.parser:si.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}var Yn=class{constructor(e,t,n,r,s,o,a){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=a}blank(e,t=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length0;r--)n+=" ";return n+(t?this.spaceAfter:"")}}marker(e,t){let n=this.node.name=="OrderedList"?String(+bd(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function Td(i,e){let t=[],n=[];for(let r=i;r;r=r.parent){if(r.name=="FencedCode")return n;(r.name=="ListItem"||r.name=="Blockquote")&&t.push(r)}for(let r=t.length-1;r>=0;r--){let s=t[r],o,a=e.lineAt(s.from),O=s.from-a.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(O))))n.push(new Yn(s,O,O+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(O)))){let l=o[3],h=o[0].length;l.length>=4&&(l=l.slice(0,l.length-4),h-=4),n.push(new Yn(s.parent,O,O+h,o[1],l,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(O)))){let l=o[4],h=o[0].length;l.length>4&&(l=l.slice(0,l.length-4),h-=4);let c=o[2];o[3]&&(c+=o[3].replace(/[xX]/," ")),n.push(new Yn(s.parent,O,O+h,o[1],l,c,s))}}return n}function bd(i,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(i.from,i.from+10))}function uO(i,e,t,n=0){for(let r=-1,s=i;;){if(s.name=="ListItem"){let a=bd(s,e),O=+a[2];if(r>=0){if(O!=r+1)return;t.push({from:s.from+a[1].length,to:s.from+a[0].length,insert:String(r+2+n)})}r=O}let o=s.nextSibling;if(!o)break;s=o}}function QO(i,e){let t=/^[ \t]*/.exec(i)[0].length;if(!t||e.facet(Wt)!=" ")return i;let n=xe(i,4,t),r="";for(let s=n;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+i.slice(t)}var MP=({state:i,dispatch:e})=>{let t=L(i),{doc:n}=i,r=null,s=i.changeByRange(o=>{if(!o.empty||!pO.isActiveAt(i,o.from,-1)&&!pO.isActiveAt(i,o.from,1))return r={range:o};let a=o.from,O=n.lineAt(a),l=Td(t.resolveInner(a,-1),n);for(;l.length&&l[l.length-1].from>a-O.from;)l.pop();if(!l.length)return r={range:o};let h=l[l.length-1];if(h.to-h.spaceAfter.length>a-O.from)return r={range:o};let c=a>=h.to-h.spaceAfter.length&&!/\S/.test(O.text.slice(h.to));if(h.item&&c){let m=h.node.firstChild,Q=h.node.getChild("ListItem","ListItem");if(m.to>=a||Q&&Q.to0&&!/[^\s>]/.test(n.lineAt(O.from-1).text)){let g=l.length>1?l[l.length-2]:null,T,x="";g&&g.item?(T=O.from+g.from,x=g.marker(n,1)):T=O.from+(g?g.to:0);let P=[{from:T,to:a,insert:x}];return h.node.name=="OrderedList"&&uO(h.item,n,P,-2),g&&g.node.name=="OrderedList"&&uO(g.item,n,P),{range:S.cursor(T+x.length),changes:P}}else{let g=gd(l,i,O);return{range:S.cursor(a+g.length+1),changes:{from:O.from,insert:g+i.lineBreak}}}}if(h.node.name=="Blockquote"&&c&&O.from){let m=n.lineAt(O.from-1),Q=/>\s*$/.exec(m.text);if(Q&&Q.index==h.from){let g=i.changes([{from:m.from+Q.index,to:m.to},{from:O.from+h.from,to:O.to}]);return{range:o.map(g),changes:g}}}let f=[];h.node.name=="OrderedList"&&uO(h.item,n,f);let d=h.item&&h.item.from]*/.exec(O.text)[0].length>=h.to)for(let m=0,Q=l.length-1;m<=Q;m++)$+=m==Q&&!d?l[m].marker(n,1):l[m].blank(mO.from&&/\s/.test(O.text.charAt(p-O.from-1));)p--;return $=QO($,i),EP(h.node,i.doc)&&($=gd(l,i,O)+i.lineBreak+$),f.push({from:p,to:a,insert:i.lineBreak+$}),{range:S.cursor(p+$.length+1),changes:f}});return r?!1:(e(i.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)};function Qd(i){return i.name=="QuoteMark"||i.name=="ListMark"}function EP(i,e){if(i.name!="OrderedList"&&i.name!="BulletList")return!1;let t=i.firstChild,n=i.getChild("ListItem","ListItem");if(!n)return!1;let r=e.lineAt(t.to),s=e.lineAt(n.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let t=L(i),n=null,r=i.changeByRange(s=>{let o=s.from,{doc:a}=i;if(s.empty&&pO.isActiveAt(i,s.from)){let O=a.lineAt(o),l=Td(GP(t,o),a);if(l.length){let h=l[l.length-1],c=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(o-O.from>c&&!/\S/.test(O.text.slice(c,o-O.from)))return{range:S.cursor(O.from+c),changes:{from:O.from+c,to:o}};if(o-O.from==c&&(!h.item||O.from<=h.item.from||!/\S/.test(O.text.slice(0,h.to)))){let f=O.from+h.from;if(h.item&&h.node.from=97&&i<=122||i>=65&&i<=90}function _n(i){return i==95||i>=128||Rd(i)}function SO(i){return i>=48&&i<=55||i>=97&&i<=102||i>=65&&i<=70}var O1={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},l1=new J(i=>{if(i.next==40){i.advance();let e=0;for(;vd(i.peek(e));)e++;let t="",n;for(;Rd(n=i.peek(e));)t+=String.fromCharCode(n),e++;for(;vd(i.peek(e));)e++;i.peek(e)==41&&O1[t.toLowerCase()]&&i.acceptToken(IP)}else if(i.next==60&&i.peek(1)==60&&i.peek(2)==60){for(let n=0;n<3;n++)i.advance();for(;i.next==32||i.next==9;)i.advance();let e=i.next==39;if(e&&i.advance(),!_n(i.next))return;let t=String.fromCharCode(i.next);for(;i.advance(),!(!_n(i.next)&&!(i.next>=48&&i.next<=55));)t+=String.fromCharCode(i.next);if(e){if(i.next!=39)return;i.advance()}if(i.next!=10&&i.next!=13)return;for(;;){let n=i.next==10||i.next==13;if(i.advance(),i.next<0)return;if(n){for(;i.next==32||i.next==9;)i.advance();let r=!0;for(let s=0;s{i.next<0&&i.acceptToken(JP)}),c1=new J((i,e)=>{i.next==63&&e.canShift(kd)&&i.peek(1)==62&&i.acceptToken(kd)});function f1(i){let e=i.peek(1);if(e==110||e==114||e==116||e==118||e==101||e==102||e==92||e==36||e==34||e==123)return 2;if(e>=48&&e<=55){let t=2,n;for(;t<5&&(n=i.peek(t))>=48&&n<=55;)t++;return t}if(e==120&&SO(i.peek(2)))return SO(i.peek(3))?4:3;if(e==117&&i.peek(2)==123)for(let t=3;;t++){let n=i.peek(t);if(n==125)return t==2?0:t+1;if(!SO(n))break}return 0}var u1=new J((i,e)=>{let t=!1;for(;!(i.next==34||i.next<0||i.next==36&&(_n(i.peek(1))||i.peek(1)==123)||i.next==123&&i.peek(1)==36);t=!0){if(i.next==92){let n=f1(i);if(n){if(t)break;return i.acceptToken(HP,n)}}else if(!t&&(i.next==91||i.next==45&&i.peek(1)==62&&_n(i.peek(2))||i.next==63&&i.peek(1)==45&&i.peek(2)==62&&_n(i.peek(3)))&&e.canShift(KP))break;i.advance()}t&&i.acceptToken(FP)}),d1=se({"Visibility abstract final static":u.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":u.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":u.controlKeyword,"and or xor yield unset clone instanceof insteadof":u.operatorKeyword,"function fn class trait implements extends const enum global interface use var":u.definitionKeyword,"include include_once require require_once namespace":u.moduleKeyword,"new from echo print array list as":u.keyword,null:u.null,Boolean:u.bool,VariableName:u.variableName,"NamespaceName/...":u.namespace,"NamedType/...":u.typeName,Name:u.name,"CallExpression/Name":u.function(u.variableName),"LabelStatement/Name":u.labelName,"MemberExpression/Name":u.propertyName,"MemberExpression/VariableName":u.special(u.propertyName),"ScopedExpression/ClassMemberName/Name":u.propertyName,"ScopedExpression/ClassMemberName/VariableName":u.special(u.propertyName),"CallExpression/MemberExpression/Name":u.function(u.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":u.function(u.propertyName),"MethodDeclaration/Name":u.function(u.definition(u.variableName)),"FunctionDefinition/Name":u.function(u.definition(u.variableName)),"ClassDeclaration/Name":u.definition(u.className),UpdateOp:u.updateOperator,ArithOp:u.arithmeticOperator,"LogicOp IntersectionType/&":u.logicOperator,BitOp:u.bitwiseOperator,CompareOp:u.compareOperator,ControlOp:u.controlOperator,AssignOp:u.definitionOperator,"$ ConcatOp":u.operator,LineComment:u.lineComment,BlockComment:u.blockComment,Integer:u.integer,Float:u.float,String:u.string,ShellExpression:u.special(u.string),"=> ->":u.punctuation,"( )":u.paren,"#[ [ ]":u.squareBracket,"${ { }":u.brace,"-> ?->":u.derefOperator,", ; :: : \\":u.separator,"PhpOpen PhpClose":u.processingInstruction}),$1={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},Zd=pe.deserialize({version:14,states:"%#[Q`OWOOQhQaOOP%oO`OOOOO#t'#Hh'#HhO%tO#|O'#DuOOO#u'#Dx'#DxQ&SOWO'#DxO&XO$VOOOOQ#u'#Dy'#DyO&lQaO'#D}O'[QdO'#EQO+QQdO'#IqO+_QdO'#ERO-RQaO'#EXO/bQ`O'#EUO/gQ`O'#E_O2UQaO'#E_O2]Q`O'#EgO2bQ`O'#EqO-RQaO'#EqO2mQpO'#FOO2rQ`O'#FOOOQS'#Iq'#IqO2wQ`O'#ExOOQS'#Ih'#IhO5SQdO'#IeO9UQeO'#F]O-RQaO'#FlO-RQaO'#FmO-RQaO'#FnO-RQaO'#FoO-RQaO'#FoO-RQaO'#F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%rR/p-O",nodeNames:"\u26A0 ( HeredocString EscapeSequence abstract LogicOp array as Boolean break case catch clone const continue default declare do echo else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach from function global goto if implements include include_once LogicOp insteadof interface list match namespace new null LogicOp print readonly require require_once return switch throw trait try unset use var Visibility while LogicOp yield LineComment BlockComment TextInterpolation PhpClose Text PhpOpen Template TextInterpolation EmptyStatement ; } { Block : LabelStatement Name ExpressionStatement ConditionalExpression LogicOp MatchExpression ) ( ParenthesizedExpression MatchBlock MatchArm , => AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> Name VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp IntersectionType OptionalType NamedType QualifiedName \\ NamespaceName Name NamespaceName Name ScopedExpression :: ClassMemberName DynamicMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter PropertyHooks PropertyHook UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:318,nodeProps:[["group",-36,2,8,49,82,84,86,89,94,95,103,107,108,112,113,116,120,126,132,137,139,140,154,155,156,157,160,161,173,174,188,190,191,192,193,194,200,"Expression",-28,75,79,81,83,201,203,208,210,211,214,217,218,219,220,221,223,224,225,226,227,228,229,230,231,234,235,239,240,"Statement",-4,121,123,124,125,"Type"],["isolate",-4,67,68,71,200,""],["openedBy",70,"phpOpen",77,"{",87,"(",102,"#["],["closedBy",72,"phpClose",78,"}",88,")",165,"]"]],propSources:[d1],skippedNodes:[0],repeatNodeCount:32,tokenData:"!GQ_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!]!,P!]!^!-a!^!_!-}!_!`!1S!`!a!2d!a!b!3t!b!c!7^!c!d!7z!d!e!9Y!e!}!7z!}#O!;b#O#P!V<%lO8VR9WV'TP%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ9rV%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ:^O%`QQ:aRO;'S9m;'S;=`:j;=`O9mQ:oW%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l9m<%lO9mQ;[P;=`<%l9mR;fV'TP%`QOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRV<%l~8V~O8V~~%fR=OW'TPOY8VYZ9PZ!^8V!^!_;{!_;'S8V;'S;=`=h;=`<%l9m<%lO8VR=mW%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l8V<%lO9mR>YP;=`<%l8VR>dV!zQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV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]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s;=`<%l!?]<%lO!?]Q!@sO%UQQ!@vP;=`<%l!?]R!@|]OY!=yYZ!>qZ!a!=y!a!b!?]!b#O!=y#O#P!Au#P#S!=y#S#T!CP#T;'S!=y;'S;=`!Cm<%l~!=y~O!=y~~%fR!AzW'TPOY!=yYZ!>qZ!^!=y!^!_!@y!_;'S!=y;'S;=`!Bd;=`<%l!?]<%lO!=yR!BgWO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s;=`<%l!=y<%lO!?]R!CWV%UQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!CpP;=`<%l!=y_!CzV!p^'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!DjY$UQ#n['TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`#p$z#p#q!EY#q;'S$z;'S;=`&W<%lO$zR!EaV$SQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!E}V!oQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FkV$eQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[l1,u1,c1,0,1,2,3,h1],topRules:{Template:[0,73],Program:[1,241]},dynamicPrecedences:{298:1},specialized:[{term:284,get:(i,e)=>Xd(i)<<1,external:Xd},{term:284,get:i=>$1[i]||-1}],tokenPrec:29883});var p1=ue.define({name:"php",parser:Zd.configure({props:[de.add({IfStatement:_e({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:_e({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},ColonBlock:i=>i.baseIndent+i.unit,"Block EnumBody DeclarationList":Ar({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"String BlockComment":()=>null,Statement:_e({except:/^({|end(for|foreach|switch|while)\b)/})}),ye.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":Ut,ColonBlock(i){return{from:i.from+1,to:i.to}},BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function Vd(i={}){let e=[],t;if(i.baseLanguage!==null)if(i.baseLanguage)t=i.baseLanguage;else{let n=Ci({matchClosingTags:!1});e.push(n.support),t=n.language}return new oe(p1.configure({wrap:t&&wi(n=>n.type.isTop?{parser:t.parser,overlay:r=>r.name=="Text"}:null),top:i.plain?"Program":"Template"}),e)}var m1=pe.deserialize({version:14,states:"%^QYQPOOO!YQQO'#CaO#RQQO'#CrOOQO'#Ct'#CtQYQPOOOOQO'#C}'#C}O#]QQO'#CzO$ZQQO'#CoOOQO'#Cz'#CzOOQO'#Cu'#CuO$lQQO,58{OOQO,58{,58{O$sQQO,59^O$sQQO,59^OOQO,59^,59^OOQO-E6r-E6rO$zQQO'#CfOOQO,58|,58|OOQO'#C|'#C|O%]QSO'#C{O%hQQO,59ZOOQO-E6s-E6sOOQO1G.g1G.gO%mQQO1G.xOOQO1G.x1G.xO%tQQO,59QO%yQSO'#CvO&bQSO,59gOOQO1G.u1G.uOOQO7+$d7+$dOOQO1G.l1G.lOOQO,59b,59bOOQO-E6t-E6t",stateData:"&{~OmOSPOS~OSPOeQOgRO~OVUOZTO[TO]TO^WO_WO`WOaWObWOtVOuWO~ORZO~PeOVUOZTO[TO]TO^WO_WO`WObWOtVOuWO~Oa[Od^O~P!aOX`ORnXVnXZnX[nX]nX^nX_nX`nXanXbnXtnXunXdnX~OVbOZTO[TO]TOsoP~ORfO~PeOdhO~PeOVbOZTO[TO]TOWoP~OrjOsoXWoX~OslO~OdmO~PeOWnO~OVbOZTO[TO]TOrjXsjXWjX~OrjOsoaWoa~Og[]a_^`bVmPZ`~",goto:"#brPPPPPswPPP!PPPPPPPPPwPPsP!S!Y!hPPP!n!v!|#TTROS]WPQY[]gRaUQSOR_SQYPQ]QUeY]gRg[QkcRpk]XPQY[]gQdVRi`ScV`Roj[WPQY[]gVbV`j",nodeNames:"\u26A0 BlockComment Template }} {{ InsertBlock Function Identifier ) ( FunctionParamList String Boolean Number ChainedIdentifier Comparison Operator CodeTag Math Array %} {% CodeBlock PlainText",maxTerm:37,nodeProps:[["openedBy",3,"{{",8,"(",20,"{%"],["closedBy",4,"}}",9,")",21,"%}"]],skippedNodes:[0,1],repeatNodeCount:3,tokenData:"#Jr~R!^OX$}XY&ZYZ&ZZ]$}]^&Z^p$}pq&Zqr'Wrs(Ysu$}uv-cvw$}wx.gxy3Wyz3nz{4U{|4r|}5Y}!O5r!O!P>u!P!Q?]!Q!R:[!R![=m![!]?y!]!^$}!^!_@a!_!`@}!`!a@a!a!c$}!c!}6}!}#OAk#O#P$}#P#QBR#Q#R$}#R#S6}#S#T$}#T#UBi#U#V!'f#V#X6}#X#Y!,h#Y#Z# Y#Z#]6}#]#^#'g#^#a6}#a#b#.T#b#c#5r#c#d#8[#d#g6}#g#h#9h#h#i#AV#i#j!.Q#j#k!@V#k#l#Co#l#o6}#o#p#Ge#p#q>u#q#r#In#r;'S$};'S;=`&O<%lO$}P%STgPO#o$}#o#p%c#p;'S$};'S;=`&O<%lO$}P%fWOs$}tu$}v#o$}#p;'S$};'S;=`&O<%l~$}~O$}~~&UP&RP;=`<%l$}P&ZOgP~&b[gPm~OX$}XY&ZYZ&ZZ]$}]^&Z^p$}pq&Zq#o$}#o#p%c#p;'S$};'S;=`&O<%lO$}~']VgPO!_$}!_!`'r!`#o$}#o#p%c#p;'S$};'S;=`&O<%lO$}~'yTgP_~O#o$}#o#p%c#p;'S$};'S;=`&O<%lO$}~(aXgPZ~Or(Y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O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#X6}#X#Y#:z#Y#h6}#h#i#m#g#o6}#o#p%c#p;'S$};'S;=`&O<%lO$}~#>tagPV~O}$}}!O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#h6}#h#i#?y#i#o6}#o#p%c#p;'S$};'S;=`&O<%lO$}~#@QagPV~O}$}}!O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#g6}#g#h!=65&&i<=90||i==95||i>=97&&i<=122||i>=161}function v1(i){return i==9||i==10||i==13||i==32}var _d=null,zd=null,Cd=0;function yO(i,e){let t=i.pos+e;if(zd==i&&Cd==t)return _d;for(;v1(i.peek(e));)e++;let n="";for(;;){let r=i.peek(e);if(!X1(r))break;n+=String.fromCharCode(r),e++}return zd=i,Cd=t,_d=n||null}function qd(i,e){this.name=i,this.parent=e}var R1=new Lt({start:null,shift(i,e,t,n){return e==PO?new qd(yO(n,1)||"",i):i},reduce(i,e){return e==k1&&i?i.parent:i},reuse(i,e,t,n){let r=e.type.id;return r==PO||r==w1?new qd(yO(n,1)||"",i):i},strict:!1}),Z1=new J((i,e)=>{if(i.next==60){if(i.advance(),i.next==47){i.advance();let t=yO(i,0);if(!t)return i.acceptToken(y1);if(e.context&&t==e.context.name)return i.acceptToken(g1);for(let n=e.context;n;n=n.parent)if(n.name==t)return i.acceptToken(S1,-2);i.acceptToken(P1)}else if(i.next!=33&&i.next!=63)return i.acceptToken(PO)}},{contextual:!0});function TO(i,e){return new J(t=>{let n=0,r=e.charCodeAt(0);e:for(;!(t.next<0);t.advance(),n++)if(t.next==r){for(let s=1;s"),Y1=TO(b1,"?>"),_1=TO(x1,"]]>"),z1=se({Text:u.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":u.angleBracket,TagName:u.tagName,"MismatchedCloseTag/TagName":[u.tagName,u.invalid],AttributeName:u.attributeName,AttributeValue:u.attributeValue,Is:u.definitionOperator,"EntityReference CharacterReference":u.character,Comment:u.blockComment,ProcessingInst:u.processingInstruction,DoctypeDecl:u.documentMeta,Cdata:u.special(u.string)}),Ad=pe.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<c!|;'S(o;'S;=`)]<%lO(oi>jX|W!O`Or(ors&osv(owx'}x!r(o!r!s?V!s;'S(o;'S;=`)]<%lO(oi?^X|W!O`Or(ors&osv(owx'}x!g(o!g!h?y!h;'S(o;'S;=`)]<%lO(oi@QY|W!O`Or?yrs@psv?yvwA[wxBdx!`?y!`!aCr!a;'S?y;'S;=`Db<%lO?ya@uV!O`Ov@pvxA[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#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[Z1,V1,Y1,_1,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function as(i,e){let t=e&&e.getChild("TagName");return t?i.sliceString(t.from,t.to):""}function bO(i,e){let t=e&&e.firstChild;return!t||t.name!="OpenTag"?"":as(i,t)}function C1(i,e,t){let n=e&&e.getChildren("Attribute").find(s=>s.from<=t&&s.to>=t),r=n&&n.getChild("AttributeName");return r?i.sliceString(r.from,r.to):""}function xO(i){for(let e=i&&i.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function q1(i,e){var t;let n=L(i).resolveInner(e,-1),r=null;for(let s=n;!r&&s.parent;s=s.parent)(s.name=="OpenTag"||s.name=="CloseTag"||s.name=="SelfClosingTag"||s.name=="MismatchedCloseTag")&&(r=s);if(r&&(r.to>e||r.lastChild.type.isError)){let s=r.parent;if(n.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:s}:{type:"openTag",from:n.from,context:xO(s)};if(n.name=="AttributeName")return{type:"attrName",from:n.from,context:r};if(n.name=="AttributeValue")return{type:"attrValue",from:n.from,context:r};let o=n==r||n.name=="Attribute"?n.childBefore(e):n;return o?.name=="StartTag"?{type:"openTag",from:e,context:xO(s)}:o?.name=="StartCloseTag"&&o.to<=e?{type:"closeTag",from:e,context:s}:o?.name=="Is"?{type:"attrValue",from:e,context:r}:o?{type:"attrName",from:e,context:r}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:e,context:n.parent};for(;n.parent&&n.to==e&&!(!((t=n.lastChild)===null||t===void 0)&&t.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:e,context:n.name=="Element"?n:xO(n)}:null}var wO=class{constructor(e,t,n){this.attrs=t,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:"type"},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=e.textContent?e.textContent.map(r=>({label:r,type:"text"})):[]}},kO=/^[:\-\.\w\u00b7-\uffff]*$/;function Wd(i){return Object.assign(Object.assign({type:"property"},i.completion||{}),{label:i.name})}function Ud(i){return typeof i=="string"?{label:`"${i}"`,type:"constant"}:/^"/.test(i.label)?i:Object.assign(Object.assign({},i),{label:`"${i.label}"`})}function A1(i,e){let t=[],n=[],r=Object.create(null);for(let O of e){let l=Wd(O);t.push(l),O.global&&n.push(l),O.values&&(r[O.name]=O.values.map(Ud))}let s=[],o=[],a=Object.create(null);for(let O of i){let l=n,h=r;O.attributes&&(l=l.concat(O.attributes.map(f=>typeof f=="string"?t.find(d=>d.label==f)||{label:f,type:"property"}:(f.values&&(h==r&&(h=Object.create(h)),h[f.name]=f.values.map(Ud)),Wd(f)))));let c=new wO(O,l,h);a[c.name]=c,s.push(c),O.top&&o.push(c)}o.length||(o=s);for(let O=0;O{var l;let{doc:h}=O.state,c=q1(O.state,O.pos);if(!c||c.type=="tag"&&!O.explicit)return null;let{type:f,from:d,context:$}=c;if(f=="openTag"){let p=o,m=bO(h,$);if(m){let Q=a[m];p=Q?.children||s}return{from:d,options:p.map(Q=>Q.completion),validFor:kO}}else if(f=="closeTag"){let p=bO(h,$);return p?{from:d,to:O.pos+(h.sliceString(O.pos,O.pos+1)==">"?1:0),options:[((l=a[p])===null||l===void 0?void 0:l.closeNameCompletion)||{label:p+">",type:"type"}],validFor:kO}:null}else if(f=="attrName"){let p=a[as(h,$)];return{from:d,options:p?.attrs||n,validFor:kO}}else if(f=="attrValue"){let p=C1(h,$,d);if(!p)return null;let m=a[as(h,$)],Q=(m?.attrValues||r)[p];return!Q||!Q.length?null:{from:d,to:O.pos+(h.sliceString(O.pos,O.pos+1)=='"'?1:0),options:Q,validFor:/^"[^"]*"?$/}}else if(f=="tag"){let p=bO(h,$),m=a[p],Q=[],g=$&&$.lastChild;p&&(!g||g.name!="CloseTag"||as(h,g)!=p)&&Q.push(m?m.closeCompletion:{label:"",type:"type",boost:2});let T=Q.concat((m?.children||($?s:o)).map(x=>x.openCompletion));if($&&m?.text.length){let x=$.firstChild;x.to>O.pos-20&&!/\S/.test(O.state.sliceDoc(x.to,O.pos))&&(T=T.concat(m.text))}return{from:d,options:T,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}var XO=ue.define({name:"xml",parser:Ad.configure({props:[de.add({Element(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),ye.add({Element(i){let e=i.firstChild,t=i.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:i.to}}}),Qn.add({"OpenTag CloseTag":i=>i.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function Ed(i={}){let e=[XO.data.of({autocomplete:A1(i.elements||[],i.attributes||[])})];return i.autoCloseTags!==!1&&e.push(W1),new oe(XO,e)}function Md(i,e,t=i.length){if(!e)return"";let n=e.firstChild,r=n&&n.getChild("TagName");return r?i.sliceString(r.from,Math.min(r.to,t)):""}var W1=X.inputHandler.of((i,e,t,n,r)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!XO.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,a=o.changeByRange(O=>{var l,h,c;let{head:f}=O,d=o.doc.sliceString(f-1,f)==n,$=L(o).resolveInner(f,-1),p;if(d&&n==">"&&$.name=="EndTag"){let m=$.parent;if(((h=(l=m.parent)===null||l===void 0?void 0:l.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(p=Md(o.doc,m.parent,f))){let Q=f+(o.doc.sliceString(f,f+1)===">"?1:0),g=``;return{range:O,changes:{from:f,to:Q,insert:g}}}}else if(d&&n=="/"&&$.name=="StartCloseTag"){let m=$.parent;if($.from==f-2&&((c=m.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(p=Md(o.doc,m,f))){let Q=f+(o.doc.sliceString(f,f+1)===">"?1:0),g=`${p}>`;return{range:S.cursor(f+g.length,-1),changes:{from:f,to:Q,insert:g}}}}return{range:O}});return a.changes.empty?!1:(i.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var R=async i=>{let e=await window.importVersioned("legacy-modes");return zr.define(e[i])},U1={bash:()=>R("shell"),c:()=>R("c"),css:async()=>Nr(),"c++":()=>R("cpp"),"c#":()=>R("csharp"),clj:()=>R("clojure"),clojure:()=>R("clojure"),csharp:()=>R("csharp"),dart:()=>R("dart"),diff:()=>R("diff"),for:()=>R("fortran"),fortran:()=>R("fortran"),"f#":()=>R("fSharp"),fsharp:()=>R("fSharp"),go:()=>R("go"),groovy:()=>R("groovy"),haskell:()=>R("haskell"),hs:()=>R("haskell"),html:async()=>Ci({selfClosingTags:!0}),ini:()=>R("properties"),java:()=>R("java"),javascript:async()=>Oi(),json:async()=>Af(),js:async()=>Oi(),jl:()=>R("julia"),julia:()=>R("julia"),kotlin:()=>R("kotlin"),latex:()=>R("stex"),lua:()=>R("lua"),markdown:async()=>os(),matlab:()=>R("octave"),md:async()=>os(),mdown:async()=>os(),ml:()=>R("sml"),mssql:()=>R("msSQL"),mysql:()=>R("mySQL"),nginx:()=>R("nginx"),octave:()=>R("octave"),pas:()=>R("pascal"),pascal:()=>R("pascal"),perl:()=>R("perl"),pgsql:()=>R("pgSQL"),php:async i=>{let e=i.includes("R("perl"),"pl/sql":()=>R("plSQL"),postgresql:()=>R("pgSQL"),powershell:()=>R("powerShell"),properties:()=>R("properties"),ocaml:()=>R("oCaml"),py:()=>R("python"),python:()=>R("python"),r:()=>R("r"),rb:()=>R("ruby"),rs:()=>R("rust"),ruby:()=>R("ruby"),rust:()=>R("rust"),sas:()=>R("sas"),scala:()=>R("scala"),scheme:()=>R("scheme"),shell:()=>R("shell"),sh:()=>R("shell"),smarty:()=>R("smarty"),stext:()=>R("stex"),swift:()=>R("swift"),toml:()=>R("toml"),ts:async()=>Oi({typescript:!0}),twig:async()=>Yd(),typescript:async()=>Oi({typescript:!0}),sql:()=>R("standardSQL"),sqlite:()=>R("sqlite"),vbs:()=>R("vbScript"),vbscript:()=>R("vbScript"),"vb.net":()=>R("vb"),vbnet:()=>R("vb"),xml:async()=>Ed(),yaml:()=>R("yaml"),yml:()=>R("yaml")};function Gd(i,e){let t=i.trim().replace(/^\./g,"").toLowerCase(),n=U1[t];if(!(typeof n>"u"))return n(e)}var Ld=new WeakMap;function Wi(i,e){let t=new mt;e.extensions.push(t.of([]));let n={usage:i,editorViewConfig:e,libEditorView:X,libEditorState:D,libCompartment:mt};window.$events.emitPublic(e.parent,"library-cm6::pre-init",n);let r=new X(e);return Ld.set(r,t),window.$events.emitPublic(e.parent,"library-cm6::post-init",{editorView:r,...n}),r}async function jd(i,e,t){let n=Ld.get(i),r=await Gd(e,t);i.dispatch({effects:n.reconfigure(r||[])})}var jt=class{constructor(e){this.ev=e}getContent(){return this.ev.state.doc.toString()}setContent(e){let{doc:t}=this.ev.state;this.ev.dispatch({changes:{from:0,to:t.length,insert:e}})}focus(){this.ev.focus()}setMode(e,t=""){jd(this.ev,e,t)}};function M1(i){let e='',t='',n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("cm-copy-button"),n.innerHTML=e,i.dom.appendChild(n);let r=620,s=60;n.addEventListener("click",()=>{Mh(i.state.doc.toString()),n.classList.add("success"),setTimeout(()=>{n.innerHTML=t},s/2),setTimeout(()=>{n.classList.remove("success")},r),setTimeout(()=>{n.innerHTML=e},r+s/2)})}function E1(i){let e="",t=i.querySelector("code");return t&&t.hasAttribute("dir")?e=t.getAttribute("dir"):i.hasAttribute("dir")&&(e=i.getAttribute("dir")),e}function Bd(i){let e=i.querySelector("code[class^=language-]");i.innerHTML=i.innerHTML.replace(//gi,` `);let t=i.textContent.trimEnd(),n="";e!==null&&(n=e.className.replace("language-",""));let r=document.createElement("div");i.parentNode.insertBefore(r,i);let s=E1(i);s&&r.setAttribute("dir",s);let o=Wi("content-code-block",{parent:r,doc:t,extensions:da(r)});new jt(o).setMode(n,t),i.remove(),M1(o)}function Wb(i){let e=i.querySelectorAll("pre");for(let t of e)Bd(t)}function Ub(){let i=document.querySelectorAll(".page-content pre, .comment-box .content pre");for(let e of i)Bd(e)}function Mb(i,e,t,n){let r=Wi("content-code-block",{parent:i,doc:t,extensions:da(i),root:e}),s=new jt(r);return s.setMode(n,t),s}function Eb(i,e){let t=i.textContent,n={parent:i.parentElement,doc:t,extensions:[...Br(i.parentElement)]},r=new jt(Wi("code-editor",n));return r.setMode(e,t),i.style.display="none",r}function Gb(i,e){let t=i.value,n={parent:i.parentElement,doc:t,extensions:[...Br(i.parentElement),X.updateListener.of(o=>{o.docChanged&&(i.value=o.state.doc.toString())})]},r=Wi("code-input",n),s=new jt(r);return s.setMode(e,t),i.style.display="none",s}function Lb(i,e,t,n){let r=i.textContent,s={parent:i.parentElement,doc:r,extensions:[ht.of(n),...Br(i.parentElement),X.updateListener.of(a=>{e(a)}),X.domEventHandlers(t)]};window.$events.emitPublic(i,"editor-markdown-cm6::pre-init",{editorViewConfig:s});let o=Wi("markdown-editor",s);return new jt(o).setMode("markdown",""),i.style.display="none",o}export{Ub as highlight,Wb as highlightWithin,Gb as inlineEditor,Lb as markdownEditor,Eb as popupEditor,Mb as wysiwygView}; //# sourceMappingURL=code.js.map diff --git a/public/dist/legacy-modes.js b/public/dist/legacy-modes.js index 1395157a0..541ff65e2 100644 --- a/public/dist/legacy-modes.js +++ b/public/dist/legacy-modes.js @@ -1,3 +1,3 @@ // See the "/licenses" URI for full package license details -function Ye(e,n,t,r,i,o){this.indented=e,this.column=n,this.type=t,this.info=r,this.align=i,this.prev=o}function Ie(e,n,t,r){var i=e.indented;return e.context&&e.context.type=="statement"&&t!="statement"&&(i=e.context.indented),e.context=new Ye(i,n,t,r,null,e.context)}function ve(e){var n=e.context.type;return(n==")"||n=="]"||n=="}")&&(e.indented=e.context.indented),e.context=e.context.prev}function Pn(e,n,t){if(n.prevToken=="variable"||n.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,t))||n.typeAtEndOfLine&&e.column()==e.indentation())return!0}function Xe(e){for(;;){if(!e||e.type=="top")return!0;if(e.type=="}"&&e.prev.info!="namespace")return!1;e=e.prev}}function H(e){var n=e.statementIndentUnit,t=e.dontAlignCalls,r=e.keywords||{},i=e.types||{},o=e.builtin||{},a=e.blockKeywords||{},p=e.defKeywords||{},S=e.atoms||{},E=e.hooks||{},x=e.multiLineStrings,c=e.indentStatements!==!1,d=e.indentSwitch!==!1,y=e.namespaceSeparator,O=e.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,K=e.numberStart||/[\d\.]/,M=e.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,u=e.isOperatorChar||/[+\-*&%=<>!?|\/]/,T=e.isIdentifierChar||/[\w\$_\xa1-\uffff]/,w=e.isReservedIdentifier||!1,C,l;function s(m,f){var z=m.next();if(E[z]){var v=E[z](m,f);if(v!==!1)return v}if(z=='"'||z=="'")return f.tokenize=I(z),f.tokenize(m,f);if(K.test(z)){if(m.backUp(1),m.match(M))return"number";m.next()}if(O.test(z))return C=z,null;if(z=="/"){if(m.eat("*"))return f.tokenize=k,k(m,f);if(m.eat("/"))return m.skipToEnd(),"comment"}if(u.test(z)){for(;!m.match(/^\/[\/*]/,!1)&&m.eat(u););return"operator"}if(m.eatWhile(T),y)for(;m.match(y);)m.eatWhile(T);var D=m.current();return ee(r,D)?(ee(a,D)&&(C="newstatement"),ee(p,D)&&(l=!0),"keyword"):ee(i,D)?"type":ee(o,D)||w&&w(D)?(ee(a,D)&&(C="newstatement"),"builtin"):ee(S,D)?"atom":"variable"}function I(m){return function(f,z){for(var v=!1,D,J=!1;(D=f.next())!=null;){if(D==m&&!v){J=!0;break}v=!v&&D=="\\"}return(J||!(v||x))&&(z.tokenize=null),"string"}}function k(m,f){for(var z=!1,v;v=m.next();){if(v=="/"&&z){f.tokenize=null;break}z=v=="*"}return"comment"}function L(m,f){e.typeFirstDefinitions&&m.eol()&&Xe(f.context)&&(f.typeAtEndOfLine=Pn(m,f,m.pos))}return{name:e.name,startState:function(m){return{tokenize:null,context:new Ye(-m,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(m,f){var z=f.context;if(m.sol()&&(z.align==null&&(z.align=!1),f.indented=m.indentation(),f.startOfLine=!0),m.eatSpace())return L(m,f),null;C=l=null;var v=(f.tokenize||s)(m,f);if(v=="comment"||v=="meta")return v;if(z.align==null&&(z.align=!0),C==";"||C==":"||C==","&&m.match(/^\s*(?:\/\/.*)?$/,!1))for(;f.context.type=="statement";)ve(f);else if(C=="{")Ie(f,m.column(),"}");else if(C=="[")Ie(f,m.column(),"]");else if(C=="(")Ie(f,m.column(),")");else if(C=="}"){for(;z.type=="statement";)z=ve(f);for(z.type=="}"&&(z=ve(f));z.type=="statement";)z=ve(f)}else C==z.type?ve(f):c&&((z.type=="}"||z.type=="top")&&C!=";"||z.type=="statement"&&C=="newstatement")&&Ie(f,m.column(),"statement",m.current());if(v=="variable"&&(f.prevToken=="def"||e.typeFirstDefinitions&&Pn(m,f,m.start)&&Xe(f.context)&&m.match(/^\s*\(/,!1))&&(v="def"),E.token){var D=E.token(m,f,v);D!==void 0&&(v=D)}return v=="def"&&e.styleDefs===!1&&(v="variable"),f.startOfLine=!1,f.prevToken=l?"def":v||C,L(m,f),v},indent:function(m,f,z){if(m.tokenize!=s&&m.tokenize!=null||m.typeAtEndOfLine&&Xe(m.context))return null;var v=m.context,D=f&&f.charAt(0),J=D==v.type;if(v.type=="statement"&&D=="}"&&(v=v.prev),e.dontIndentStatements)for(;v.type=="statement"&&e.dontIndentStatements.test(v.info);)v=v.prev;if(E.indent){var ye=E.indent(m,v,f,z.unit);if(typeof ye=="number")return ye}var Ze=v.prev&&v.prev.info=="switch";if(e.allmanIndentation&&/[{(]/.test(D)){for(;v.type!="top"&&v.type!="}";)v=v.prev;return v.indented}return v.type=="statement"?v.indented+(D=="{"?0:n||z.unit):v.align&&(!t||v.type!=")")?v.column+(J?0:1):v.type==")"&&!J?v.indented+(n||z.unit):v.indented+(J?0:z.unit)+(!J&&Ze&&!/^(?:case|default)\b/.test(f)?z.unit:0)},languageData:{indentOnInput:d?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}},autocomplete:Object.keys(r).concat(Object.keys(i)).concat(Object.keys(o)).concat(Object.keys(S)),...e.languageData}}}function b(e){for(var n={},t=e.split(" "),r=0;r!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,n){return e.match('""')?(n.tokenize=Bn,n.tokenize(e,n)):!1},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?"character":(e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(e,n){var t=n.context;return t.type=="}"&&t.align&&e.eat(">")?(n.context=new Ye(t.indented,t.column,t.type,t.info,null,t.prev),"operator"):!1},"/":function(e,n){return e.eat("*")?(n.tokenize=ke(1),n.tokenize(e,n)):!1}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});function _r(e){return function(n,t){for(var r=!1,i,o=!1;!n.eol();){if(!e&&!r&&n.match('"')){o=!0;break}if(e&&n.match('"""')){o=!0;break}i=n.next(),!r&&i=="$"&&n.match("{")&&n.skipTo("}"),r=!r&&i=="\\"&&!e}return(o||!e)&&(t.tokenize=null),"string"}}var xr=H({name:"kotlin",keywords:b("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:b("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:b("catch class do else finally for if where try while enum"),defKeywords:b("class val var object interface fun"),atoms:b("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,n){return n.prevToken=="."?"variable":"operator"},'"':function(e,n){return n.tokenize=_r(e.match('""')),n.tokenize(e,n)},"/":function(e,n){return e.eat("*")?(n.tokenize=ke(1),n.tokenize(e,n)):!1},indent:function(e,n,t,r){var i=t&&t.charAt(0);if((e.prevToken=="}"||e.prevToken==")")&&t=="")return e.indented;if(e.prevToken=="operator"&&t!="}"&&e.context.type!="}"||e.prevToken=="variable"&&i=="."||(e.prevToken=="}"||e.prevToken==")")&&i==".")return r*2+n.indented;if(n.align&&n.type=="}")return n.indented+(e.context.type==(t||"").charAt(0)?0:r)}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}}),_l=H({name:"shader",keywords:b("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:b("for while do if else struct"),builtin:b("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:b("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":oe}}),xl=H({name:"nesc",keywords:b(_e+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:xe,blockKeywords:b(we),atoms:b("null true false"),hooks:{"#":oe}}),wl=H({name:"objectivec",keywords:b(_e+" "+Nn),types:Fn,builtin:b(qn),blockKeywords:b(we+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:b(Oe+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:b("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:Pe,hooks:{"#":oe,"*":Ae}}),Sl=H({name:"objectivecpp",keywords:b(_e+" "+Nn+" "+$n),types:Fn,builtin:b(qn),blockKeywords:b(we+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:b(Oe+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:b("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:Pe,hooks:{"#":oe,"*":Ae,u:ie,U:ie,L:ie,R:ie,0:F,1:F,2:F,3:F,4:F,5:F,6:F,7:F,8:F,9:F,token:function(e,n,t){if(t=="variable"&&e.peek()=="("&&(n.prevToken==";"||n.prevToken==null||n.prevToken=="}")&&Mn(e.current()))return"def"}},namespaceSeparator:"::"}),zl=H({name:"squirrel",keywords:b("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:xe,blockKeywords:b("case catch class else for foreach if switch try while"),defKeywords:b("function local class"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":oe}}),Re=null;function jn(e){return function(n,t){for(var r=!1,i,o=!1;!n.eol();){if(!r&&n.match('"')&&(e=="single"||n.match('""'))){o=!0;break}if(!r&&n.match("``")){Re=jn(e),o=!0;break}i=n.next(),r=e=="single"&&!r&&i=="\\"}return o&&(t.tokenize=null),"string"}}var El=H({name:"ceylon",keywords:b("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var n=e.charAt(0);return n===n.toUpperCase()&&n!==n.toLowerCase()},blockKeywords:b("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:b("class dynamic function interface module object package value"),builtin:b("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:b("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,n){return n.tokenize=jn(e.match('""')?"triple":"single"),n.tokenize(e,n)},"`":function(e,n){return!Re||!e.match("`")?!1:(n.tokenize=Re,Re=null,n.tokenize(e,n))},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?"string.special":(e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},token:function(e,n,t){if((t=="variable"||t=="type")&&n.prevToken==".")return"variableName.special"}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});function wr(e){(e.interpolationStack||(e.interpolationStack=[])).push(e.tokenize)}function Wn(e){return(e.interpolationStack||(e.interpolationStack=[])).pop()}function Sr(e){return e.interpolationStack?e.interpolationStack.length:0}function Je(e,n,t,r){var i=!1;if(n.eat(e))if(n.eat(e))i=!0;else return"string";function o(a,p){for(var S=!1;!a.eol();){if(!r&&!S&&a.peek()=="$")return wr(p),p.tokenize=zr,"string";var E=a.next();if(E==e&&!S&&(!i||a.match(e+e))){p.tokenize=null;break}S=!r&&!S&&E=="\\"}return"string"}return t.tokenize=o,o(n,t)}function zr(e,n){return e.eat("$"),e.eat("{")?n.tokenize=null:n.tokenize=Er,null}function Er(e,n){return e.eatWhile(/[\w_]/),n.tokenize=Wn(n),"variable"}var Tr=H({name:"dart",keywords:b("this super static final const abstract class extends external factory implements mixin get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as extension on yield late required sealed base interface when inline"),blockKeywords:b("try catch finally do else for if switch while"),builtin:b("void bool num int double dynamic var String Null Never"),atoms:b("true false null"),number:/^(?:0x[a-f\d_]+|(?:[\d_]+\.?[\d_]*|\.[\d_]+)(?:e[-+]?[\d_]+)?)/i,hooks:{"@":function(e){return e.eatWhile(/[\w\$_\.]/),"meta"},"'":function(e,n){return Je("'",e,n,!1)},'"':function(e,n){return Je('"',e,n,!1)},r:function(e,n){var t=e.peek();return t=="'"||t=='"'?Je(e.next(),e,n,!0):!1},"}":function(e,n){return Sr(n)>0?(n.tokenize=Wn(n),null):!1},"/":function(e,n){return e.eat("*")?(n.tokenize=ke(1),n.tokenize(e,n)):!1},token:function(e,n,t){if(t=="variable"){var r=RegExp("^[_$]*[A-Z][a-zA-Z0-9_$]*$","g");if(r.test(e.current()))return"type"}}}});var Un=["false","nil","true"],Kn=[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],Hn=["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],Cr=["->","->>","as->","binding","bound-fn","case","catch","comment","cond","cond->","cond->>","condp","def","definterface","defmethod","defn","defmacro","defprotocol","defrecord","defstruct","deftype","do","doseq","dotimes","doto","extend","extend-protocol","extend-type","fn","for","future","if","if-let","if-not","if-some","let","letfn","locking","loop","ns","proxy","reify","struct-map","some->","some->>","try","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn"],Ir=Le(Un),Rr=Le(Kn),Or=Le(Hn),Ar=Le(Cr),Pr=/^(?:[\\\[\]\s"(),;@^`{}~]|$)/,Lr=/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,Dr=/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,$r=/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/;function en(e,n){if(e.eatSpace()||e.eat(","))return["space",null];if(e.match(Lr))return[null,"number"];if(e.match(Dr))return[null,"string.special"];if(e.eat(/^"/))return(n.tokenize=Nr)(e,n);if(e.eat(/^[(\[{]/))return["open","bracket"];if(e.eat(/^[)\]}]/))return["close","bracket"];if(e.eat(/^;/))return e.skipToEnd(),["space","comment"];if(e.eat(/^[#'@^`~]/))return[null,"meta"];var t=e.match($r),r=t&&t[0];return r?r==="comment"&&n.lastToken==="("?(n.tokenize=qr)(e,n):Se(r,Ir)||r.charAt(0)===":"?["symbol","atom"]:Se(r,Rr)||Se(r,Or)?["symbol","keyword"]:n.lastToken==="("?["symbol","builtin"]:["symbol","variable"]:(e.next(),e.eatWhile(function(i){return!Se(i,Pr)}),[null,"error"])}function Nr(e,n){for(var t=!1,r;r=e.next();){if(r==='"'&&!t){n.tokenize=en;break}t=!t&&r==="\\"}return[null,"string"]}function qr(e,n){for(var t=1,r;r=e.next();)if(r===")"&&t--,r==="("&&t++,t===0){e.backUp(1),n.tokenize=en;break}return["space","comment"]}function Le(e){for(var n={},t=0;t\/\:]/,Ur=/^\.(and|or|eq|lt|le|gt|ge|ne|not|eqv|neqv)\./i;function Kr(e,n){if(e.match(Ur))return"operator";var t=e.next();if(t=="!")return e.skipToEnd(),"comment";if(t=='"'||t=="'")return n.tokenize=Hr(t),n.tokenize(e,n);if(/[\[\]\(\),]/.test(t))return null;if(/\d/.test(t))return e.eatWhile(/[\w\.]/),"number";if(Zn.test(t))return e.eatWhile(Zn),"operator";e.eatWhile(/[\w\$_]/);var r=e.current().toLowerCase();return Br.hasOwnProperty(r)?"keyword":jr.hasOwnProperty(r)||Wr.hasOwnProperty(r)?"builtin":"variable"}function Hr(e){return function(n,t){for(var r=!1,i,o=!1;(i=n.next())!=null;){if(i==e&&!r){o=!0;break}r=!r&&i=="\\"}return(o||!r)&&(t.tokenize=null),"string"}}var Gr={name:"fortran",startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var t=(n.tokenize||Kr)(e,n);return t=="comment"||t=="meta",t}};var Zr={break:!0,case:!0,chan:!0,const:!0,continue:!0,default:!0,defer:!0,else:!0,fallthrough:!0,for:!0,func:!0,go:!0,goto:!0,if:!0,import:!0,interface:!0,map:!0,package:!0,range:!0,return:!0,select:!0,struct:!0,switch:!0,type:!0,var:!0,bool:!0,byte:!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,int:!0,uint:!0,uintptr:!0,error:!0,rune:!0,any:!0,comparable:!0},Qr={true:!0,false:!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,delete:!0,imag:!0,len:!0,make:!0,new:!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},Qn=/[+\-*&^%:=<>!|\/]/,ne;function De(e,n){var t=e.next();if(t=='"'||t=="'"||t=="`")return n.tokenize=Vr(t),n.tokenize(e,n);if(/[\d\.]/.test(t))return t=="."?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):t=="0"?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(t))return ne=t,null;if(t=="/"){if(e.eat("*"))return n.tokenize=Vn,Vn(e,n);if(e.eat("/"))return e.skipToEnd(),"comment"}if(Qn.test(t))return e.eatWhile(Qn),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var r=e.current();return Zr.propertyIsEnumerable(r)?((r=="case"||r=="default")&&(ne="case"),"keyword"):Qr.propertyIsEnumerable(r)?"atom":"variable"}function Vr(e){return function(n,t){for(var r=!1,i,o=!1;(i=n.next())!=null;){if(i==e&&!r){o=!0;break}r=!r&&e!="`"&&i=="\\"}return(o||!(r||e=="`"))&&(t.tokenize=De),"string"}}function Vn(e,n){for(var t=!1,r;r=e.next();){if(r=="/"&&t){n.tokenize=De;break}t=r=="*"}return"comment"}function Jn(e,n,t,r,i){this.indented=e,this.column=n,this.type=t,this.align=r,this.prev=i}function tn(e,n,t){return e.context=new Jn(e.indented,n,t,null,e.context)}function Xn(e){if(e.context.prev){var n=e.context.type;return(n==")"||n=="]"||n=="}")&&(e.indented=e.context.indented),e.context=e.context.prev}}var Xr={name:"go",startState:function(e){return{tokenize:null,context:new Jn(-e,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,n){var t=n.context;if(e.sol()&&(t.align==null&&(t.align=!1),n.indented=e.indentation(),n.startOfLine=!0,t.type=="case"&&(t.type="}")),e.eatSpace())return null;ne=null;var r=(n.tokenize||De)(e,n);return r=="comment"||(t.align==null&&(t.align=!0),ne=="{"?tn(n,e.column(),"}"):ne=="["?tn(n,e.column(),"]"):ne=="("?tn(n,e.column(),")"):ne=="case"?t.type="case":(ne=="}"&&t.type=="}"||ne==t.type)&&Xn(n),n.startOfLine=!1),r},indent:function(e,n,t){if(e.tokenize!=De&&e.tokenize!=null)return null;var r=e.context,i=n&&n.charAt(0);if(r.type=="case"&&/^(?:case|default)\b/.test(n))return r.indented;var o=i==r.type;return r.align?r.column+(o?0:1):r.indented+(o?0:t.unit)},languageData:{indentOnInput:/^\s([{}]|case |default\s*:)$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}};function an(e,n,t){return n(t),t(e,n)}var Jr=/[a-z_]/,Yr=/[A-Z]/,rn=/\d/,ei=/[0-9A-Fa-f]/,ni=/[0-7]/,Yn=/[a-z_A-Z0-9'\xa1-\uffff]/,on=/[-!#$%&*+.\/<=>?@\\^|~:]/,ti=/[(),;[\]`{}]/,nt=/[ \t\v\f]/;function fe(e,n){if(e.eatWhile(nt))return null;var t=e.next();if(ti.test(t)){if(t=="{"&&e.eat("-")){var r="comment";return e.eat("#")&&(r="meta"),an(e,n,tt(r,1))}return null}if(t=="'")return e.eat("\\"),e.next(),e.eat("'")?"string":"error";if(t=='"')return an(e,n,rt);if(Yr.test(t))return e.eatWhile(Yn),e.eat(".")?"qualifier":"type";if(Jr.test(t))return e.eatWhile(Yn),"variable";if(rn.test(t)){if(t=="0"){if(e.eat(/[xX]/))return e.eatWhile(ei),"integer";if(e.eat(/[oO]/))return e.eatWhile(ni),"number"}e.eatWhile(rn);var r="number";return e.match(/^\.\d+/)&&(r="number"),e.eat(/[eE]/)&&(r="number",e.eat(/[-+]/),e.eatWhile(rn)),r}return t=="."&&e.eat(".")?"keyword":on.test(t)?t=="-"&&e.eat(/-/)&&(e.eatWhile(/-/),!e.eat(on))?(e.skipToEnd(),"comment"):(e.eatWhile(on),"variable"):"error"}function tt(e,n){return n==0?fe:function(t,r){for(var i=n;!t.eol();){var o=t.next();if(o=="{"&&t.eat("-"))++i;else if(o=="-"&&t.eat("}")&&(--i,i==0))return r(fe),e}return r(tt(e,i)),e}}function rt(e,n){for(;!e.eol();){var t=e.next();if(t=='"')return n(fe),"string";if(t=="\\"){if(e.eol()||e.eat(nt))return n(ri),"string";e.eat("&")||e.next()}}return n(fe),"error"}function ri(e,n){return e.eat("\\")?an(e,n,rt):(e.next(),n(fe),"error")}var et=function(){var e={};function n(t){return function(){for(var r=0;r","@","~","=>"),n("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<*","<=","<$>","<*>","=<<","==",">",">=",">>",">>=","^","^^","||","*","*>","**"),n("builtin")("Applicative","Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),n("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","pure","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3"),e}(),ii={name:"haskell",startState:function(){return{f:fe}},copyState:function(e){return{f:e.f}},token:function(e,n){var t=n.f(e,function(i){n.f=i}),r=e.current();return et.hasOwnProperty(r)?et[r]:t},languageData:{commentTokens:{line:"--",block:{open:"{-",close:"-}"}}}};function ae(e,n,t){return typeof t>"u"&&(t=""),typeof n>"u"&&(n="\\b"),new RegExp("^"+t+"(("+e.join(")|(")+"))"+n)}var oi="\\\\[0-7]{1,3}",ai="\\\\x[A-Fa-f0-9]{1,2}",li=`\\\\[abefnrtv0%?'"\\\\]`,ci="([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])",at=["[<>]:","[<>=]=","<<=?",">>>?=?","=>","--?>","<--[->]?","\\/\\/","\\.{2,3}","[\\.\\\\%*+\\-<>!\\/^|&]=?","\\?","\\$","~",":"],si=ae(["[<>]:","[<>=]=","[!=]==","<<=?",">>>?=?","=>?","--?>","<--[->]?","\\/\\/","[\\\\%*+\\-<>!\\/^|&\\u00F7\\u22BB]=?","\\?","\\$","~",":","\\u00D7","\\u2208","\\u2209","\\u220B","\\u220C","\\u2218","\\u221A","\\u221B","\\u2229","\\u222A","\\u2260","\\u2264","\\u2265","\\u2286","\\u2288","\\u228A","\\u22C5","\\b(in|isa)\\b(?!.?\\()"],""),ui=/^[;,()[\]{}]/,di=/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/,fi=ae([oi,ai,li,ci],"'"),pi=["begin","function","type","struct","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"],mi=["end","else","elseif","catch","finally"],lt=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","where","macro","module","baremodule","struct","type","mutable","immutable","quote","typealias","abstract","primitive","bitstype"],ct=["true","false","nothing","NaN","Inf"],hi=ae(pi),gi=ae(mi),bi=ae(lt),yi=ae(ct),vi=/^@[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,ki=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,_i=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/,xi=ae(at,"","@"),wi=ae(at,"",":");function it(e){return e.nestedArrays>0}function Si(e){return e.nestedGenerators>0}function ot(e,n){return typeof n>"u"&&(n=0),e.scopes.length<=n?null:e.scopes[e.scopes.length-(n+1)]}function pe(e,n){if(e.match("#=",!1))return n.tokenize=Ei,n.tokenize(e,n);var t=n.leavingExpr;if(e.sol()&&(t=!1),n.leavingExpr=!1,t&&e.match(/^'+/))return"operator";if(e.match(/\.{4,}/))return"error";if(e.match(/\.{1,3}/))return"operator";if(e.eatSpace())return null;var r=e.peek();if(r==="#")return e.skipToEnd(),"comment";if(r==="["&&(n.scopes.push("["),n.nestedArrays++),r==="("&&(n.scopes.push("("),n.nestedGenerators++),it(n)&&r==="]"){for(;n.scopes.length&&ot(n)!=="[";)n.scopes.pop();n.scopes.pop(),n.nestedArrays--,n.leavingExpr=!0}if(Si(n)&&r===")"){for(;n.scopes.length&&ot(n)!=="(";)n.scopes.pop();n.scopes.pop(),n.nestedGenerators--,n.leavingExpr=!0}if(it(n)){if(n.lastToken=="end"&&e.match(":"))return"operator";if(e.match("end"))return"number"}var i;if((i=e.match(hi,!1))&&n.scopes.push(i[0]),e.match(gi,!1)&&n.scopes.pop(),e.match(/^::(?![:\$])/))return n.tokenize=zi,n.tokenize(e,n);if(!t&&(e.match(ki)||e.match(wi)))return"builtin";if(e.match(si))return"operator";if(e.match(/^\.?\d/,!1)){var o=RegExp(/^im\b/),a=!1;if(e.match(/^0x\.[0-9a-f_]+p[\+\-]?[_\d]+/i)&&(a=!0),e.match(/^0x[0-9a-f_]+/i)&&(a=!0),e.match(/^0b[01_]+/i)&&(a=!0),e.match(/^0o[0-7_]+/i)&&(a=!0),e.match(/^(?:(?:\d[_\d]*)?\.(?!\.)(?:\d[_\d]*)?|\d[_\d]*\.(?!\.)(?:\d[_\d]*))?([Eef][\+\-]?[_\d]+)?/i)&&(a=!0),e.match(/^\d[_\d]*(e[\+\-]?\d+)?/i)&&(a=!0),a)return e.match(o),n.leavingExpr=!0,"number"}if(e.match("'"))return n.tokenize=Ti,n.tokenize(e,n);if(e.match(_i))return n.tokenize=Ci(e.current()),n.tokenize(e,n);if(e.match(vi)||e.match(xi))return"meta";if(e.match(ui))return null;if(e.match(bi))return"keyword";if(e.match(yi))return"builtin";var p=n.isDefinition||n.lastToken=="function"||n.lastToken=="macro"||n.lastToken=="type"||n.lastToken=="struct"||n.lastToken=="immutable";return e.match(di)?p?e.peek()==="."?(n.isDefinition=!0,"variable"):(n.isDefinition=!1,"def"):(n.leavingExpr=!0,"variable"):(e.next(),"error")}function zi(e,n){return e.match(/.*?(?=[,;{}()=\s]|$)/),e.match("{")?n.nestedParameters++:e.match("}")&&n.nestedParameters>0&&n.nestedParameters--,n.nestedParameters>0?e.match(/.*?(?={|})/)||e.next():n.nestedParameters==0&&(n.tokenize=pe),"builtin"}function Ei(e,n){return e.match("#=")&&n.nestedComments++,e.match(/.*?(?=(#=|=#))/)||e.skipToEnd(),e.match("=#")&&(n.nestedComments--,n.nestedComments==0&&(n.tokenize=pe)),"comment"}function Ti(e,n){var t=!1,r;if(e.match(fi))t=!0;else if(r=e.match(/\\u([a-f0-9]{1,4})(?=')/i)){var i=parseInt(r[1],16);(i<=55295||i>=57344)&&(t=!0,e.next())}else if(r=e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var i=parseInt(r[1],16);i<=1114111&&(t=!0,e.next())}return t?(n.leavingExpr=!0,n.tokenize=pe,"string"):(e.match(/^[^']+(?=')/)||e.skipToEnd(),e.match("'")&&(n.tokenize=pe),"error")}function Ci(e){e.substr(-3)==='"""'?e='"""':e.substr(-1)==='"'&&(e='"');function n(t,r){if(t.eat("\\"))t.next();else{if(t.match(e))return r.tokenize=pe,r.leavingExpr=!0,"string";t.eat(/[`"]/)}return t.eatWhile(/[^\\`"]/),"string"}return n}var Ii={name:"julia",startState:function(){return{tokenize:pe,scopes:[],lastToken:null,leavingExpr:!1,isDefinition:!1,nestedArrays:0,nestedComments:0,nestedGenerators:0,nestedParameters:0,firstParenPos:-1}},token:function(e,n){var t=n.tokenize(e,n),r=e.current();return r&&t&&(n.lastToken=r),t},indent:function(e,n,t){var r=0;return(n==="]"||n===")"||/^end\b/.test(n)||/^else/.test(n)||/^catch\b/.test(n)||/^elseif\b/.test(n)||/^finally/.test(n))&&(r=-1),(e.scopes.length+r)*t.unit},languageData:{indentOnInput:/^\s*(end|else|catch|finally)\b$/,commentTokens:{line:"#",block:{open:"#=",close:"=#"}},closeBrackets:{brackets:["(","[","{",'"']},autocomplete:lt.concat(ct)}};function Ri(e){return new RegExp("^(?:"+e.join("|")+")","i")}function $e(e){return new RegExp("^(?:"+e.join("|")+")$","i")}var Oi=$e(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),Ai=$e(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),Pi=$e(["function","if","repeat","do","\\(","{"]),Li=$e(["end","until","\\)","}"]),Di=Ri(["end","until","\\)","}","else","elseif"]);function st(e){for(var n=0;e.eat("=");)++n;return e.eat("["),n}function ln(e,n){var t=e.next();return t=="-"&&e.eat("-")?e.eat("[")&&e.eat("[")?(n.cur=ut(st(e),"comment"))(e,n):(e.skipToEnd(),"comment"):t=='"'||t=="'"?(n.cur=$i(t))(e,n):t=="["&&/[\[=]/.test(e.peek())?(n.cur=ut(st(e),"string"))(e,n):/\d/.test(t)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(t)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function ut(e,n){return function(t,r){for(var i=null,o;(o=t.next())!=null;)if(i==null)o=="]"&&(i=0);else if(o=="=")++i;else if(o=="]"&&i==e){r.cur=ln;break}else i=null;return n}}function $i(e){return function(n,t){for(var r=!1,i;(i=n.next())!=null&&!(i==e&&!r);)r=!r&&i=="\\";return r||(t.cur=ln),"string"}}var Ni={name:"lua",startState:function(){return{basecol:0,indentDepth:0,cur:ln}},token:function(e,n){if(e.eatSpace())return null;var t=n.cur(e,n),r=e.current();return t=="variable"&&(Ai.test(r)?t="keyword":Oi.test(r)&&(t="builtin")),t!="comment"&&t!="string"&&(Pi.test(r)?++n.indentDepth:Li.test(r)&&--n.indentDepth),t},indent:function(e,n,t){var r=Di.test(n);return e.basecol+t.unit*(e.indentDepth-(r?1:0))},languageData:{indentOnInput:/^\s*(?:end|until|else|\)|\})$/,commentTokens:{line:"--",block:{open:"--[[",close:"]]--"}}}};function cn(e){var n={as:"keyword",do:"keyword",else:"keyword",end:"keyword",exception:"keyword",fun:"keyword",functor:"keyword",if:"keyword",in:"keyword",include:"keyword",let:"keyword",of:"keyword",open:"keyword",rec:"keyword",struct:"keyword",then:"keyword",type:"keyword",val:"keyword",while:"keyword",with:"keyword"},t=e.extraWords||{};for(var r in t)t.hasOwnProperty(r)&&(n[r]=e.extraWords[r]);var i=[];for(var o in n)i.push(o);function a(x,c){var d=x.next();if(d==='"')return c.tokenize=p,c.tokenize(x,c);if(d==="{"&&x.eat("|"))return c.longString=!0,c.tokenize=E,c.tokenize(x,c);if(d==="("&&x.match(/^\*(?!\))/))return c.commentLevel++,c.tokenize=S,c.tokenize(x,c);if(d==="~"||d==="?")return x.eatWhile(/\w/),"variableName.special";if(d==="`")return x.eatWhile(/\w/),"quote";if(d==="/"&&e.slashComments&&x.eat("/"))return x.skipToEnd(),"comment";if(/\d/.test(d))return d==="0"&&x.eat(/[bB]/)&&x.eatWhile(/[01]/),d==="0"&&x.eat(/[xX]/)&&x.eatWhile(/[0-9a-fA-F]/),d==="0"&&x.eat(/[oO]/)?x.eatWhile(/[0-7]/):(x.eatWhile(/[\d_]/),x.eat(".")&&x.eatWhile(/[\d]/),x.eat(/[eE]/)&&x.eatWhile(/[\d\-+]/)),"number";if(/[+\-*&%=<>!?|@\.~:]/.test(d))return"operator";if(/[\w\xa1-\uffff]/.test(d)){x.eatWhile(/[\w\xa1-\uffff]/);var y=x.current();return n.hasOwnProperty(y)?n[y]:"variable"}return null}function p(x,c){for(var d,y=!1,O=!1;(d=x.next())!=null;){if(d==='"'&&!O){y=!0;break}O=!O&&d==="\\"}return y&&!O&&(c.tokenize=a),"string"}function S(x,c){for(var d,y;c.commentLevel>0&&(y=x.next())!=null;)d==="("&&y==="*"&&c.commentLevel++,d==="*"&&y===")"&&c.commentLevel--,d=y;return c.commentLevel<=0&&(c.tokenize=a),"comment"}function E(x,c){for(var d,y;c.longString&&(y=x.next())!=null;)d==="|"&&y==="}"&&(c.longString=!1),d=y;return c.longString||(c.tokenize=a),"string"}return{startState:function(){return{tokenize:a,commentLevel:0,longString:!1}},token:function(x,c){return x.eatSpace()?null:c.tokenize(x,c)},languageData:{autocomplete:i,commentTokens:{line:e.slashComments?"//":void 0,block:{open:"(*",close:"*)"}}}}}var qi=cn({name:"ocaml",extraWords:{and:"keyword",assert:"keyword",begin:"keyword",class:"keyword",constraint:"keyword",done:"keyword",downto:"keyword",external:"keyword",function:"keyword",initializer:"keyword",lazy:"keyword",match:"keyword",method:"keyword",module:"keyword",mutable:"keyword",new:"keyword",nonrec:"keyword",object:"keyword",private:"keyword",sig:"keyword",to:"keyword",try:"keyword",value:"keyword",virtual:"keyword",when:"keyword",raise:"builtin",failwith:"builtin",true:"builtin",false:"builtin",asr:"builtin",land:"builtin",lor:"builtin",lsl:"builtin",lsr:"builtin",lxor:"builtin",mod:"builtin",or:"builtin",raise_notrace:"builtin",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin",int:"type",float:"type",bool:"type",char:"type",string:"type",unit:"type",List:"builtin"}}),Fi=cn({name:"fsharp",extraWords:{abstract:"keyword",assert:"keyword",base:"keyword",begin:"keyword",class:"keyword",default:"keyword",delegate:"keyword","do!":"keyword",done:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",extern:"keyword",finally:"keyword",for:"keyword",function:"keyword",global:"keyword",inherit:"keyword",inline:"keyword",interface:"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",match:"keyword",member:"keyword",module:"keyword",mutable:"keyword",namespace:"keyword",new:"keyword",null:"keyword",override:"keyword",private:"keyword",public:"keyword","return!":"keyword",return:"keyword",select:"keyword",static:"keyword",to:"keyword",try:"keyword",upcast:"keyword","use!":"keyword",use:"keyword",void:"keyword",when:"keyword","yield!":"keyword",yield:"keyword",atomic:"keyword",break:"keyword",checked:"keyword",component:"keyword",const:"keyword",constraint:"keyword",constructor:"keyword",continue:"keyword",eager:"keyword",event:"keyword",external:"keyword",fixed:"keyword",method:"keyword",mixin:"keyword",object:"keyword",parallel:"keyword",process:"keyword",protected:"keyword",pure:"keyword",sealed:"keyword",tailcall:"keyword",trait:"keyword",virtual:"keyword",volatile:"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin",Option:"builtin",int:"builtin",string:"builtin",not:"builtin",true:"builtin",false:"builtin",raise:"builtin",failwith:"builtin"},slashComments:!0}),Mi=cn({name:"sml",extraWords:{abstype:"keyword",and:"keyword",andalso:"keyword",case:"keyword",datatype:"keyword",fn:"keyword",handle:"keyword",infix:"keyword",infixr:"keyword",local:"keyword",nonfix:"keyword",op:"keyword",orelse:"keyword",raise:"keyword",withtype:"keyword",eqtype:"keyword",sharing:"keyword",sig:"keyword",signature:"keyword",structure:"keyword",where:"keyword",true:"keyword",false:"keyword",int:"builtin",real:"builtin",string:"builtin",char:"builtin",bool:"builtin"},slashComments:!0});function sn(e){for(var n={},t=e.split(" "),r=0;r*\/]/.test(r)?Z(null,"select-op"):/[;{}:\[\]]/.test(r)?Z(null,r):(e.eatWhile(/[\w\\\-]/),Z("variable","variable"))}function dt(e,n){for(var t=!1,r;(r=e.next())!=null;){if(t&&r=="/"){n.tokenize=Ne;break}t=r=="*"}return Z("comment","comment")}function ft(e,n){for(var t=0,r;(r=e.next())!=null;){if(t>=2&&r==">"){n.tokenize=Ne;break}t=r=="-"?t+1:0}return Z("comment","comment")}function Ui(e){return function(n,t){for(var r=!1,i;(i=n.next())!=null&&!(i==e&&!r);)r=!r&&i=="\\";return r||(t.tokenize=Ne),Z("string","string")}}var Ki={name:"nginx",startState:function(){return{tokenize:Ne,baseIndent:0,stack:[]}},token:function(e,n){if(e.eatSpace())return null;le=null;var t=n.tokenize(e,n),r=n.stack[n.stack.length-1];return le=="hash"&&r=="rule"?t="atom":t=="variable"&&(r=="rule"?t="number":(!r||r=="@media{")&&(t="tag")),r=="rule"&&/^[\{\};]$/.test(le)&&n.stack.pop(),le=="{"?r=="@media"?n.stack[n.stack.length-1]="@media{":n.stack.push("{"):le=="}"?n.stack.pop():le=="@media"?n.stack.push("@media"):r=="{"&&le!="comment"&&n.stack.push("rule"),t},indent:function(e,n,t){var r=e.stack.length;return/^\}/.test(n)&&(r-=e.stack[e.stack.length-1]=="rule"?2:1),e.baseIndent+r*t.unit},languageData:{indentOnInput:/^\s*\}$/}};function un(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var Hi=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),Gi=new RegExp("^[\\(\\[\\{\\},:=;\\.]"),Zi=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),Qi=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),Vi=new RegExp("^((>>=)|(<<=))"),Xi=new RegExp("^[\\]\\)]"),Ji=new RegExp("^[_A-Za-z\xA1-\uFFFF][_A-Za-z0-9\xA1-\uFFFF]*"),Yi=un(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),eo=un(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);function pt(e,n){return!e.sol()&&e.peek()==="'"?(e.next(),n.tokenize=me,"operator"):(n.tokenize=me,me(e,n))}function no(e,n){return e.match(/^.*%}/)?(n.tokenize=me,"comment"):(e.skipToEnd(),"comment")}function me(e,n){if(e.eatSpace())return null;if(e.match("%{"))return n.tokenize=no,e.skipToEnd(),"comment";if(e.match(/^[%#]/))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return e.tokenize=me,"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)||e.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}if(e.match(un(["nan","NaN","inf","Inf"])))return"number";var t=e.match(/^"(?:[^"]|"")*("|$)/)||e.match(/^'(?:[^']|'')*('|$)/);return t?t[1]?"string":"error":e.match(eo)?"keyword":e.match(Yi)?"builtin":e.match(Ji)?"variable":e.match(Hi)||e.match(Zi)?"operator":e.match(Gi)||e.match(Qi)||e.match(Vi)?null:e.match(Xi)?(n.tokenize=pt,null):(e.next(),"error")}var to={name:"octave",startState:function(){return{tokenize:me}},token:function(e,n){var t=n.tokenize(e,n);return(t==="number"||t==="variable")&&(n.tokenize=pt),t},languageData:{commentTokens:{line:"%"}}};function B(e,n){return e.string.charAt(e.pos+(n||0))}function mt(e,n){if(n){var t=e.pos-n;return e.string.substr(t>=0?t:0,n)}else return e.string.substr(0,e.pos-1)}function dn(e,n){var t=e.string.length,r=t-e.pos+1;return e.string.substr(e.pos,n&&n=(r=e.string.length-1)?e.pos=r:e.pos=t}var ze={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,if:[1,1],elsif:[1,1],else:[1,1],while:[1,1],unless:[1,1],for:[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,break:1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,continue:[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,default:1,defined:1,delete:1,die:1,do:1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,goto:1,grep:1,hex:1,import:1,index:1,int:1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,new:1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,package:1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,return:1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},A="string.special",P=/[goseximacplud]/;function _(e,n,t,r,i){return n.chain=null,n.style=null,n.tail=null,n.tokenize=function(o,a){for(var p=!1,S,E=0;S=o.next();){if(S===t[E]&&!p)return t[++E]!==void 0?(a.chain=t[E],a.style=r,a.tail=i):i&&o.eatWhile(i),a.tokenize=qe,r;p=!p&&S=="\\"}return r},n.tokenize(e,n)}function fn(e,n,t){return n.tokenize=function(r,i){return r.string==t&&(i.tokenize=qe),r.skipToEnd(),"string"},n.tokenize(e,n)}function qe(e,n){if(e.eatSpace())return null;if(n.chain)return _(e,n,n.chain,n.style,n.tail);if(e.match(/^(\-?((\d[\d_]*)?\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F_]+|0b[01_]+|\d[\d_]*(e[+-]?\d+)?)/))return"number";if(e.match(/^<<(?=[_a-zA-Z])/))return e.eatWhile(/\w/),fn(e,n,e.current().substr(2));if(e.sol()&&e.match(/^\=item(?!\w)/))return fn(e,n,"=cut");var t=e.next();if(t=='"'||t=="'"){if(mt(e,3)=="<<"+t){var r=e.pos;e.eatWhile(/\w/);var i=e.current().substr(1);if(i&&e.eat(t))return fn(e,n,i);e.pos=r}return _(e,n,[t],"string")}if(t=="q"){var o=B(e,-2);if(!(o&&/\w/.test(o))){if(o=B(e,0),o=="x"){if(o=B(e,1),o=="(")return N(e,2),_(e,n,[")"],A,P);if(o=="[")return N(e,2),_(e,n,["]"],A,P);if(o=="{")return N(e,2),_(e,n,["}"],A,P);if(o=="<")return N(e,2),_(e,n,[">"],A,P);if(/[\^'"!~\/]/.test(o))return N(e,1),_(e,n,[e.eat(o)],A,P)}else if(o=="q"){if(o=B(e,1),o=="(")return N(e,2),_(e,n,[")"],"string");if(o=="[")return N(e,2),_(e,n,["]"],"string");if(o=="{")return N(e,2),_(e,n,["}"],"string");if(o=="<")return N(e,2),_(e,n,[">"],"string");if(/[\^'"!~\/]/.test(o))return N(e,1),_(e,n,[e.eat(o)],"string")}else if(o=="w"){if(o=B(e,1),o=="(")return N(e,2),_(e,n,[")"],"bracket");if(o=="[")return N(e,2),_(e,n,["]"],"bracket");if(o=="{")return N(e,2),_(e,n,["}"],"bracket");if(o=="<")return N(e,2),_(e,n,[">"],"bracket");if(/[\^'"!~\/]/.test(o))return N(e,1),_(e,n,[e.eat(o)],"bracket")}else if(o=="r"){if(o=B(e,1),o=="(")return N(e,2),_(e,n,[")"],A,P);if(o=="[")return N(e,2),_(e,n,["]"],A,P);if(o=="{")return N(e,2),_(e,n,["}"],A,P);if(o=="<")return N(e,2),_(e,n,[">"],A,P);if(/[\^'"!~\/]/.test(o))return N(e,1),_(e,n,[e.eat(o)],A,P)}else if(/[\^'"!~\/(\[{<]/.test(o)){if(o=="(")return N(e,1),_(e,n,[")"],"string");if(o=="[")return N(e,1),_(e,n,["]"],"string");if(o=="{")return N(e,1),_(e,n,["}"],"string");if(o=="<")return N(e,1),_(e,n,[">"],"string");if(/[\^'"!~\/]/.test(o))return _(e,n,[e.eat(o)],"string")}}}if(t=="m"){var o=B(e,-2);if(!(o&&/\w/.test(o))&&(o=e.eat(/[(\[{<\^'"!~\/]/),o)){if(/[\^'"!~\/]/.test(o))return _(e,n,[o],A,P);if(o=="(")return _(e,n,[")"],A,P);if(o=="[")return _(e,n,["]"],A,P);if(o=="{")return _(e,n,["}"],A,P);if(o=="<")return _(e,n,[">"],A,P)}}if(t=="s"){var o=/[\/>\]})\w]/.test(B(e,-2));if(!o&&(o=e.eat(/[(\[{<\^'"!~\/]/),o))return o=="["?_(e,n,["]","]"],A,P):o=="{"?_(e,n,["}","}"],A,P):o=="<"?_(e,n,[">",">"],A,P):o=="("?_(e,n,[")",")"],A,P):_(e,n,[o,o],A,P)}if(t=="y"){var o=/[\/>\]})\w]/.test(B(e,-2));if(!o&&(o=e.eat(/[(\[{<\^'"!~\/]/),o))return o=="["?_(e,n,["]","]"],A,P):o=="{"?_(e,n,["}","}"],A,P):o=="<"?_(e,n,[">",">"],A,P):o=="("?_(e,n,[")",")"],A,P):_(e,n,[o,o],A,P)}if(t=="t"){var o=/[\/>\]})\w]/.test(B(e,-2));if(!o&&(o=e.eat("r"),o&&(o=e.eat(/[(\[{<\^'"!~\/]/),o)))return o=="["?_(e,n,["]","]"],A,P):o=="{"?_(e,n,["}","}"],A,P):o=="<"?_(e,n,[">",">"],A,P):o=="("?_(e,n,[")",")"],A,P):_(e,n,[o,o],A,P)}if(t=="`")return _(e,n,[t],"builtin");if(t=="/")return/~\s*$/.test(mt(e))?_(e,n,[t],A,P):"operator";if(t=="$"){var r=e.pos;if(e.eatWhile(/\d/)||e.eat("{")&&e.eatWhile(/\d/)&&e.eat("}"))return"builtin";e.pos=r}if(/[$@%]/.test(t)){var r=e.pos;if(e.eat("^")&&e.eat(/[A-Z]/)||!/[@$%&]/.test(B(e,-2))&&e.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var o=e.current();if(ze[o])return"builtin"}e.pos=r}if(/[$@%&]/.test(t)&&(e.eatWhile(/[\w$]/)||e.eat("{")&&e.eatWhile(/[\w$]/)&&e.eat("}"))){var o=e.current();return ze[o]?"builtin":"variable"}if(t=="#"&&B(e,-2)!="$")return e.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(t)){var r=e.pos;if(e.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),ze[e.current()])return"operator";e.pos=r}if(t=="_"&&e.pos==1){if(dn(e,6)=="_END__")return _(e,n,["\0"],"comment");if(dn(e,7)=="_DATA__")return _(e,n,["\0"],"builtin");if(dn(e,7)=="_C__")return _(e,n,["\0"],"string")}if(/\w/.test(t)){var r=e.pos;if(B(e,-2)=="{"&&(B(e,0)=="}"||e.eatWhile(/\w/)&&B(e,0)=="}"))return"string";e.pos=r}if(/[A-Z]/.test(t)){var a=B(e,-2),r=e.pos;if(e.eatWhile(/[A-Z_]/),/[\da-z]/.test(B(e,0)))e.pos=r;else{var o=ze[e.current()];return o?(o[1]&&(o=o[0]),a!=":"?o==1?"keyword":o==2?"def":o==3?"atom":o==4?"operator":o==5?"builtin":"meta":"meta"):"meta"}}if(/[a-zA-Z_]/.test(t)){var a=B(e,-2);e.eatWhile(/\w/);var o=ze[e.current()];return o?(o[1]&&(o=o[0]),a!=":"?o==1?"keyword":o==2?"def":o==3?"atom":o==4?"operator":o==5?"builtin":"meta":"meta"):"meta"}return null}var ro={name:"perl",startState:function(){return{tokenize:qe,chain:null,style:null,tail:null}},token:function(e,n){return(n.tokenize||qe)(e,n)},languageData:{commentTokens:{line:"#"},wordChars:"$"}};function io(e){for(var n={},t=e.split(" "),r=0;r!?|\/]/;function lo(e,n){var t=e.next();if(t=="#"&&n.startOfLine)return e.skipToEnd(),"meta";if(t=='"'||t=="'")return n.tokenize=co(t),n.tokenize(e,n);if(t=="("&&e.eat("*"))return n.tokenize=gt,gt(e,n);if(t=="{")return n.tokenize=bt,bt(e,n);if(/[\[\]\(\),;\:\.]/.test(t))return null;if(/\d/.test(t))return e.eatWhile(/[\w\.]/),"number";if(t=="/"&&e.eat("/"))return e.skipToEnd(),"comment";if(ht.test(t))return e.eatWhile(ht),"operator";e.eatWhile(/[\w\$_]/);var r=e.current().toLowerCase();return oo.propertyIsEnumerable(r)?"keyword":ao.propertyIsEnumerable(r)?"atom":"variable"}function co(e){return function(n,t){for(var r=!1,i,o=!1;(i=n.next())!=null;){if(i==e&&!r){o=!0;break}r=!r&&i=="\\"}return(o||!r)&&(t.tokenize=null),"string"}}function gt(e,n){for(var t=!1,r;r=e.next();){if(r==")"&&t){n.tokenize=null;break}t=r=="*"}return"comment"}function bt(e,n){for(var t;t=e.next();)if(t=="}"){n.tokenize=null;break}return"comment"}var so={name:"pascal",startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var t=(n.tokenize||lo)(e,n);return t=="comment"||t=="meta",t},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{block:{open:"(*",close:"*)"}}}};function he(e,n){n=n||{};for(var t=n.prefix!==void 0?n.prefix:"^",r=n.suffix!==void 0?n.suffix:"\\b",i=0;i/,ho=he([po,mo],{suffix:""}),go=/^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i,bo=/^[A-Za-z\_][A-Za-z\-\_\d]*\b/,yo=/[A-Z]:|%|\?/i,vo=he([/Add-(Computer|Content|History|Member|PSSnapin|Type)/,/Checkpoint-Computer/,/Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/,/Compare-Object/,/Complete-Transaction/,/Connect-PSSession/,/ConvertFrom-(Csv|Json|SecureString|StringData)/,/Convert-Path/,/ConvertTo-(Csv|Html|Json|SecureString|Xml)/,/Copy-Item(Property)?/,/Debug-Process/,/Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/Disconnect-PSSession/,/Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/(Enter|Exit)-PSSession/,/Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/,/ForEach-Object/,/Format-(Custom|List|Table|Wide)/,new RegExp("Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)"),/Group-Object/,/Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/,/ImportSystemModules/,/Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/,/Join-Path/,/Limit-EventLog/,/Measure-(Command|Object)/,/Move-Item(Property)?/,new RegExp("New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)"),/Out-(Default|File|GridView|Host|Null|Printer|String)/,/Pause/,/(Pop|Push)-Location/,/Read-Host/,/Receive-(Job|PSSession)/,/Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/,/Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/,/Rename-(Computer|Item(Property)?)/,/Reset-ComputerMachinePassword/,/Resolve-Path/,/Restart-(Computer|Service)/,/Restore-Computer/,/Resume-(Job|Service)/,/Save-Help/,/Select-(Object|String|Xml)/,/Send-MailMessage/,new RegExp("Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)"),/Show-(Command|ControlPanelItem|EventLog)/,/Sort-Object/,/Split-Path/,/Start-(Job|Process|Service|Sleep|Transaction|Transcript)/,/Stop-(Computer|Job|Process|Service|Transcript)/,/Suspend-(Job|Service)/,/TabExpansion2/,/Tee-Object/,/Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/,/Trace-Command/,/Unblock-File/,/Undo-Transaction/,/Unregister-(Event|PSSessionConfiguration)/,/Update-(FormatData|Help|List|TypeData)/,/Use-Transaction/,/Wait-(Event|Job|Process)/,/Where-Object/,/Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/,/cd|help|mkdir|more|oss|prompt/,/ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/,/echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/,/group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/,/measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/,/rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/,/sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/],{prefix:"",suffix:""}),ko=he([/[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/,/FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/,/MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/,/PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/,/PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/,/WarningPreference|WhatIfPreference/,/Event|EventArgs|EventSubscriber|Sender/,/Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/,/true|false|null/],{prefix:"\\$",suffix:""}),_o=he([yo,vo,ko],{suffix:_t}),yt={keyword:uo,number:go,operator:ho,builtin:_o,punctuation:fo,variable:bo};function te(e,n){var t=n.returnStack[n.returnStack.length-1];if(t&&t.shouldReturnFrom(n))return n.tokenize=t.tokenize,n.returnStack.pop(),n.tokenize(e,n);if(e.eatSpace())return null;if(e.eat("("))return n.bracketNesting+=1,"punctuation";if(e.eat(")"))return n.bracketNesting-=1,"punctuation";for(var r in yt)if(e.match(yt[r]))return r;var i=e.next();if(i==="'")return xo(e,n);if(i==="$")return mn(e,n);if(i==='"')return xt(e,n);if(i==="<"&&e.eat("#"))return n.tokenize=vt,vt(e,n);if(i==="#")return e.skipToEnd(),"comment";if(i==="@"){var o=e.eat(/["']/);if(o&&e.eol())return n.tokenize=Fe,n.startQuote=o[0],Fe(e,n);if(e.eol())return"error";if(e.peek().match(/[({]/))return"punctuation";if(e.peek().match(pn))return mn(e,n)}return"error"}function xo(e,n){for(var t;(t=e.peek())!=null;)if(e.next(),t==="'"&&!e.eat("'"))return n.tokenize=te,"string";return"error"}function xt(e,n){for(var t;(t=e.peek())!=null;){if(t==="$")return n.tokenize=wo,"string";if(e.next(),t==="`"){e.next();continue}if(t==='"'&&!e.eat('"'))return n.tokenize=te,"string"}return"error"}function wo(e,n){return wt(e,n,xt)}function So(e,n){return n.tokenize=Fe,n.startQuote='"',Fe(e,n)}function zo(e,n){return wt(e,n,So)}function wt(e,n,t){if(e.match("$(")){var r=n.bracketNesting;return n.returnStack.push({shouldReturnFrom:function(i){return i.bracketNesting===r},tokenize:t}),n.tokenize=te,n.bracketNesting+=1,"punctuation"}else return e.next(),n.returnStack.push({shouldReturnFrom:function(){return!0},tokenize:t}),n.tokenize=mn,n.tokenize(e,n)}function vt(e,n){for(var t=!1,r;(r=e.next())!=null;){if(t&&r==">"){n.tokenize=te;break}t=r==="#"}return"comment"}function mn(e,n){var t=e.peek();return e.eat("{")?(n.tokenize=kt,kt(e,n)):t!=null&&t.match(pn)?(e.eatWhile(pn),n.tokenize=te,"variable"):(n.tokenize=te,"error")}function kt(e,n){for(var t;(t=e.next())!=null;)if(t==="}"){n.tokenize=te;break}return"variable"}function Fe(e,n){var t=n.startQuote;if(e.sol()&&e.match(new RegExp(t+"@")))n.tokenize=te;else if(t==='"')for(;!e.eol();){var r=e.peek();if(r==="$")return n.tokenize=zo,"string";e.next(),r==="`"&&e.next()}else e.skipToEnd();return"string"}var Eo={name:"powershell",startState:function(){return{returnStack:[],bracketNesting:0,tokenize:te}},token:function(e,n){return n.tokenize(e,n)},languageData:{commentTokens:{line:"#",block:{open:"<#",close:"#>"}}}};var To={name:"properties",token:function(e,n){var t=e.sol()||n.afterSection,r=e.eol();if(n.afterSection=!1,t&&(n.nextMultiline?(n.inMultiline=!0,n.nextMultiline=!1):n.position="def"),r&&!n.nextMultiline&&(n.inMultiline=!1,n.position="def"),t)for(;e.eatSpace(););var i=e.next();return t&&(i==="#"||i==="!"||i===";")?(n.position="comment",e.skipToEnd(),"comment"):t&&i==="["?(n.afterSection=!0,e.skipTo("]"),e.eat("]"),"header"):i==="="||i===":"?(n.position="quote",null):(i==="\\"&&n.position==="quote"&&e.eol()&&(n.nextMultiline=!0),n.position)},startState:function(){return{position:"def",nextMultiline:!1,inMultiline:!1,afterSection:!1}}};function hn(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var Co=hn(["and","or","not","is"]),St=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],zt=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function Q(e){return e.scopes[e.scopes.length-1]}function Et(e){for(var n="error",t=e.delimiters||e.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,r=[e.singleOperators,e.doubleOperators,e.doubleDelimiters,e.tripleDelimiters,e.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],i=0;ik?u(l,s):L0&&w(l,s)&&(m+=" "+n),m}}return O(l,s)}function O(l,s,I){if(l.eatSpace())return null;if(!I&&l.match(/^#.*/))return"comment";if(l.match(/^[0-9\.]/,!1)){var k=!1;if(l.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(k=!0),l.match(/^[\d_]+\.\d*/)&&(k=!0),l.match(/^\.\d+/)&&(k=!0),k)return l.eat(/J/i),"number";var L=!1;if(l.match(/^0x[0-9a-f_]+/i)&&(L=!0),l.match(/^0b[01_]+/i)&&(L=!0),l.match(/^0o[0-7_]+/i)&&(L=!0),l.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(l.eat(/J/i),L=!0),l.match(/^0(?![\dx])/i)&&(L=!0),L)return l.eat(/L/i),"number"}if(l.match(x)){var m=l.current().toLowerCase().indexOf("f")!==-1;return m?(s.tokenize=K(l.current(),s.tokenize),s.tokenize(l,s)):(s.tokenize=M(l.current(),s.tokenize),s.tokenize(l,s))}for(var f=0;f=0;)l=l.substr(1);var I=l.length==1,k="string";function L(f){return function(z,v){var D=O(z,v,!0);return D=="punctuation"&&(z.current()=="{"?v.tokenize=L(f+1):z.current()=="}"&&(f>1?v.tokenize=L(f-1):v.tokenize=m)),D}}function m(f,z){for(;!f.eol();)if(f.eatWhile(/[^'"\{\}\\]/),f.eat("\\")){if(f.next(),I&&f.eol())return k}else{if(f.match(l))return z.tokenize=s,k;if(f.match("{{"))return k;if(f.match("{",!1))return z.tokenize=L(0),f.current()?k:z.tokenize(f,z);if(f.match("}}"))return k;if(f.match("}"))return n;f.eat(/['"]/)}if(I){if(e.singleLineStringErrors)return n;z.tokenize=s}return k}return m.isString=!0,m}function M(l,s){for(;"rubf".indexOf(l.charAt(0).toLowerCase())>=0;)l=l.substr(1);var I=l.length==1,k="string";function L(m,f){for(;!m.eol();)if(m.eatWhile(/[^'"\\]/),m.eat("\\")){if(m.next(),I&&m.eol())return k}else{if(m.match(l))return f.tokenize=s,k;m.eat(/['"]/)}if(I){if(e.singleLineStringErrors)return n;f.tokenize=s}return k}return L.isString=!0,L}function u(l,s){for(;Q(s).type!="py";)s.scopes.pop();s.scopes.push({offset:Q(s).offset+l.indentUnit,type:"py",align:null})}function T(l,s,I){var k=l.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:l.column()+1;s.scopes.push({offset:s.indent+(o||l.indentUnit),type:I,align:k})}function w(l,s){for(var I=l.indentation();s.scopes.length>1&&Q(s).offset>I;){if(Q(s).type!="py")return!0;s.scopes.pop()}return Q(s).offset!=I}function C(l,s){l.sol()&&(s.beginningOfLine=!0,s.dedent=!1);var I=s.tokenize(l,s),k=l.current();if(s.beginningOfLine&&k=="@")return l.match(E,!1)?"meta":S?"operator":n;if(/\S/.test(k)&&(s.beginningOfLine=!1),(I=="variable"||I=="builtin")&&s.lastToken=="meta"&&(I="meta"),(k=="pass"||k=="return")&&(s.dedent=!0),k=="lambda"&&(s.lambda=!0),k==":"&&!s.lambda&&Q(s).type=="py"&&l.match(/^\s*(?:#|$)/,!1)&&u(l,s),k.length==1&&!/string|comment/.test(I)){var L="[({".indexOf(k);if(L!=-1&&T(l,s,"])}".slice(L,L+1)),L="])}".indexOf(k),L!=-1)if(Q(s).type==k)s.indent=s.scopes.pop().offset-(o||l.indentUnit);else return n}return s.dedent&&l.eol()&&Q(s).type=="py"&&s.scopes.length>1&&s.scopes.pop(),I}return{name:"python",startState:function(){return{tokenize:y,scopes:[{offset:0,type:"py",align:null}],indent:0,lastToken:null,lambda:!1,dedent:0}},token:function(l,s){var I=s.errorToken;I&&(s.errorToken=!1);var k=C(l,s);return k&&k!="comment"&&(s.lastToken=k=="keyword"||k=="punctuation"?l.current():k),k=="punctuation"&&(k=null),l.eol()&&s.lambda&&(s.lambda=!1),I?n:k},indent:function(l,s,I){if(l.tokenize!=y)return l.tokenize.isString?null:0;var k=Q(l),L=k.type==s.charAt(0)||k.type=="py"&&!l.dedent&&/^(else:|elif |except |finally:)/.test(s);return k.align!=null?k.align-(L?1:0):k.offset-(L?o||I.unit:0)},languageData:{autocomplete:St.concat(zt).concat(["exec","print"]),indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,commentTokens:{line:"#"},closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""']}}}}var Io=function(e){return e.split(" ")},Ro=Et({}),jl=Et({extra_keywords:Io("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")});function Be(e){for(var n={},t=0;t=!&|~$:]/,V;function vn(e,n){V=null;var t=e.next();if(t=="#")return e.skipToEnd(),"comment";if(t=="0"&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if(t=="."&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(t))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if(t=="'"||t=='"')return n.tokenize=$o(t),"string";if(t=="`")return e.match(/[^`]+`/),"string.special";if(t=="."&&e.match(/.(?:[.]|\d+)/))return"keyword";if(/[a-zA-Z\.]/.test(t)){e.eatWhile(/[\w\.]/);var r=e.current();return Ao.propertyIsEnumerable(r)?"atom":Lo.propertyIsEnumerable(r)?(Do.propertyIsEnumerable(r)&&!e.match(/\s*if(\s+|$)/,!1)&&(V="block"),"keyword"):Po.propertyIsEnumerable(r)?"builtin":"variable"}else return t=="%"?(e.skipTo("%")&&e.next(),"variableName.special"):t=="<"&&e.eat("-")||t=="<"&&e.match("<-")||t=="-"&&e.match(/>>?/)||t=="="&&n.ctx.argList?"operator":Tt.test(t)?(t=="$"||e.eatWhile(Tt),"operator"):/[\(\){}\[\];]/.test(t)?(V=t,t==";"?"punctuation":null):null}function $o(e){return function(n,t){if(n.eat("\\")){var r=n.next();return r=="x"?n.match(/^[a-f0-9]{2}/i):(r=="u"||r=="U")&&n.eat("{")&&n.skipTo("}")?n.next():r=="u"?n.match(/^[a-f0-9]{4}/i):r=="U"?n.match(/^[a-f0-9]{8}/i):/[0-7]/.test(r)&&n.match(/^[0-7]{1,2}/),"string.special"}else{for(var i;(i=n.next())!=null;){if(i==e){t.tokenize=vn;break}if(i=="\\"){n.backUp(1);break}}return"string"}}}var Ct=1,gn=2,bn=4;function Me(e,n,t){e.ctx={type:n,indent:e.indent,flags:0,column:t.column(),prev:e.ctx}}function It(e,n){var t=e.ctx;e.ctx={type:t.type,indent:t.indent,flags:t.flags|n,column:t.column,prev:t.prev}}function yn(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}var No={name:"r",startState:function(e){return{tokenize:vn,ctx:{type:"top",indent:-e,flags:gn},indent:0,afterIdent:!1}},token:function(e,n){if(e.sol()&&((n.ctx.flags&3)==0&&(n.ctx.flags|=gn),n.ctx.flags&bn&&yn(n),n.indent=e.indentation()),e.eatSpace())return null;var t=n.tokenize(e,n);return t!="comment"&&(n.ctx.flags&gn)==0&&It(n,Ct),(V==";"||V=="{"||V=="}")&&n.ctx.type=="block"&&yn(n),V=="{"?Me(n,"}",e):V=="("?(Me(n,")",e),n.afterIdent&&(n.ctx.argList=!0)):V=="["?Me(n,"]",e):V=="block"?Me(n,"block",e):V==n.ctx.type?yn(n):n.ctx.type=="block"&&t!="comment"&&It(n,bn),n.afterIdent=t=="variable"||t=="keyword",t},indent:function(e,n,t){if(e.tokenize!=vn)return 0;var r=n&&n.charAt(0),i=e.ctx,o=r==i.type;return i.flags&bn&&(i=i.prev),i.type=="block"?i.indent+(r=="{"?0:t.unit):i.flags&Ct?i.column+(o?0:1):i.indent+(o?0:t.unit)},languageData:{wordChars:".",commentTokens:{line:"#"},autocomplete:Rt.concat(Ot,At)}};function _n(e){for(var n={},t=0,r=e.length;t]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if(t=="@"&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"propertyName";if(t=="$")return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variableName.special";if(/[a-zA-Z_\xa1-\uffff]/.test(t))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"variable";if(t=="|"&&(n.varList||n.lastTok=="{"||n.lastTok=="do"))return X="|",null;if(/[\(\)\[\]{}\\;]/.test(t))return X=t,null;if(t=="-"&&e.eat(">"))return"operator";if(/[=+\-\/*:\.^%<>~|]/.test(t)){var p=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return t=="."&&!p&&(X="."),"operator"}else return null}}}function jo(e){for(var n=e.pos,t=0,r,i=!1,o=!1;(r=e.next())!=null;)if(o)o=!1;else{if("[{(".indexOf(r)>-1)t++;else if("]})".indexOf(r)>-1){if(t--,t<0)break}else if(r=="/"&&t==0){i=!0;break}o=r=="\\"}return e.backUp(e.pos-n),i}function kn(e){return e||(e=1),function(n,t){if(n.peek()=="}"){if(e==1)return t.tokenize.pop(),t.tokenize[t.tokenize.length-1](n,t);t.tokenize[t.tokenize.length-1]=kn(e-1)}else n.peek()=="{"&&(t.tokenize[t.tokenize.length-1]=kn(e+1));return je(n,t)}}function Wo(){var e=!1;return function(n,t){return e?(t.tokenize.pop(),t.tokenize[t.tokenize.length-1](n,t)):(e=!0,je(n,t))}}function Ee(e,n,t,r){return function(i,o){var a=!1,p;for(o.context.type==="read-quoted-paused"&&(o.context=o.context.prev,i.eat("}"));(p=i.next())!=null;){if(p==e&&(r||!a)){o.tokenize.pop();break}if(t&&p=="#"&&!a){if(i.eat("{")){e=="}"&&(o.context={prev:o.context,type:"read-quoted-paused"}),o.tokenize.push(kn());break}else if(/[@\$]/.test(i.peek())){o.tokenize.push(Wo());break}}a=!a&&p=="\\"}return n}}function Uo(e,n){return function(t,r){return n&&t.eatSpace(),t.match(e)?r.tokenize.pop():t.skipToEnd(),"string"}}function Ko(e,n){return e.sol()&&e.match("=end")&&e.eol()&&n.tokenize.pop(),e.skipToEnd(),"comment"}var Ho={name:"ruby",startState:function(e){return{tokenize:[je],indented:0,context:{type:"top",indented:-e},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,n){X=null,e.sol()&&(n.indented=e.indentation());var t=n.tokenize[n.tokenize.length-1](e,n),r,i=X;if(t=="variable"){var o=e.current();t=n.lastTok=="."?"property":qo.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":n.lastTok=="def"||n.lastTok=="class"||n.varList?"def":"variable",t=="keyword"&&(i=o,Fo.propertyIsEnumerable(o)?r="indent":Mo.propertyIsEnumerable(o)?r="dedent":((o=="if"||o=="unless")&&e.column()==e.indentation()||o=="do"&&n.context.indented2&&a.token&&typeof a.token!="string"){t.pending=[];for(var E=2;E-1)return null;var i=t.indent.length-1,o=e[t.state];e:for(;;){for(var a=0;a!]+/,token:"operator"},{regex:/[a-zA-Z_]\w*!/,token:"macroName"},{regex:/[a-zA-Z_]\w*/,token:"variable"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0}],string:[{regex:/"/,token:"string",next:"start"},{regex:/(?:[^\\"]|\\(?:.|$))*/,token:"string"}],string_raw:[{regex:/"/,token:"string",next:"start"},{regex:/[^"]*/,token:"string"}],string_raw_hash:[{regex:/"#+/,token:"string",next:"start"},{regex:/(?:[^"]|"(?!#))*/,token:"string"}],comment:[{regex:/.*?\*\//,token:"comment",next:"start"},{regex:/.*/,token:"comment"}],languageData:{name:"rust",dontIndentStates:["comment"],indentOnInput:/^\s*\}$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}});var q={},Nt={eq:"operator",lt:"operator",le:"operator",gt:"operator",ge:"operator",in:"operator",ne:"operator",or:"operator"},Yo=/(<=|>=|!=|<>)/,ea=/[=\(:\),{}.*<>+\-\/^\[\]]/;function j(e,n,t){if(t)for(var r=n.split(" "),i=0;iinteger char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),oa=Ut("define let letrec let* lambda define-macro defmacro let-syntax letrec-syntax let-values let*-values define-syntax syntax-rules define-values when unless");function aa(e,n,t){this.indent=e,this.type=n,this.prev=t}function xn(e,n,t){e.indentStack=new aa(n,t,e.indentStack)}function la(e){e.indentStack=e.indentStack.prev}var ca=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),sa=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),ua=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),da=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);function fa(e){return e.match(ca)}function pa(e){return e.match(sa)}function wn(e,n){return n===!0&&e.backUp(1),e.match(da)}function ma(e){return e.match(ua)}function Wt(e,n){for(var t,r=!1;(t=e.next())!=null;){if(t==n.token&&!r){n.state.mode=!1;break}r=!r&&t=="\\"}}var ha={name:"scheme",startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1,sExprQuote:!1}},token:function(e,n){if(n.indentStack==null&&e.sol()&&(n.indentation=e.indentation()),e.eatSpace())return null;var t=null;switch(n.mode){case"string":Wt(e,{token:'"',state:n}),t=qt;break;case"symbol":Wt(e,{token:"|",state:n}),t=Ft;break;case"comment":for(var r,i=!1;(r=e.next())!=null;){if(r=="#"&&i){n.mode=!1;break}i=r=="|"}t=se;break;case"s-expr-comment":if(n.mode=!1,e.peek()=="("||e.peek()=="[")n.sExprComment=0;else{e.eatWhile(/[^\s\(\)\[\]]/),t=se;break}default:var o=e.next();if(o=='"')n.mode="string",t=qt;else if(o=="'")e.peek()=="("||e.peek()=="["?(typeof n.sExprQuote!="number"&&(n.sExprQuote=0),t=Te):(e.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),t=Te);else if(o=="|")n.mode="symbol",t=Ft;else if(o=="#")if(e.eat("|"))n.mode="comment",t=se;else if(e.eat(/[tf]/i))t=Te;else if(e.eat(";"))n.mode="s-expr-comment",t=se;else{var a=null,p=!1,S=!0;e.eat(/[ei]/i)?p=!0:e.backUp(1),e.match(/^#b/i)?a=fa:e.match(/^#o/i)?a=pa:e.match(/^#x/i)?a=ma:e.match(/^#d/i)?a=wn:e.match(/^[-+0-9.]/,!1)?(S=!1,a=wn):p||e.eat("#"),a!=null&&(S&&!p&&e.match(/^#[ei]/i),a(e)&&(t=Mt))}else if(/^[-+0-9.]/.test(o)&&wn(e,!0))t=Mt;else if(o==";")e.skipToEnd(),t=se;else if(o=="("||o=="["){for(var E="",x=e.column(),c;(c=e.eat(/[^\s\(\[\;\)\]]/))!=null;)E+=c;E.length>0&&oa.propertyIsEnumerable(E)?xn(n,x+ia,o):(e.eatSpace(),e.eol()||e.peek()==";"?xn(n,x+1,o):xn(n,x+e.current().length,o)),e.backUp(e.current().length-1),typeof n.sExprComment=="number"&&n.sExprComment++,typeof n.sExprQuote=="number"&&n.sExprQuote++,t=Bt}else o==")"||o=="]"?(t=Bt,n.indentStack!=null&&n.indentStack.type==(o==")"?"(":"[")&&(la(n),typeof n.sExprComment=="number"&&--n.sExprComment==0&&(t=se,n.sExprComment=!1),typeof n.sExprQuote=="number"&&--n.sExprQuote==0&&(t=Te,n.sExprQuote=!1))):(e.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),jt&&jt.propertyIsEnumerable(e.current())?t=ra:t="variable")}return typeof n.sExprComment=="number"?se:typeof n.sExprQuote=="number"?Te:t},indent:function(e){return e.indentStack==null?e.indentation:e.indentStack.indent},languageData:{closeBrackets:{brackets:["(","[","{",'"']},commentTokens:{line:";;"}}};var Sn={};function zn(e,n){for(var t=0;t1&&e.eat("$");var t=e.next();return/['"({]/.test(t)?(n.tokens[0]=We(t,t=="("?"quote":t=="{"?"def":"string"),be(e,n)):(/\d/.test(t)||e.eatWhile(/\w/),n.tokens.shift(),"def")};function ya(e){return function(n,t){return n.sol()&&n.string==e&&t.tokens.shift(),n.skipToEnd(),"string.special"}}function be(e,n){return(n.tokens[0]||ga)(e,n)}var va={name:"shell",startState:function(){return{tokens:[]}},token:function(e,n){return be(e,n)},languageData:{autocomplete:Kt.concat(Ht,Gt),closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}};function G(e){var n=e.client||{},t=e.atoms||{false:!0,true:!0,null:!0},r=e.builtin||h(Vt),i=e.keywords||h(de),o=e.operatorChars||/^[*+\-%<>!=&|~^\/]/,a=e.support||{},p=e.hooks||{},S=e.dateSQL||{date:!0,time:!0,timestamp:!0},E=e.backslashStringEscapes!==!1,x=e.brackets||/^[\{}\(\)\[\]]/,c=e.punctuation||/^[;.,:]/;function d(u,T){var w=u.next();if(p[w]){var C=p[w](u,T);if(C!==!1)return C}if(a.hexNumber&&(w=="0"&&u.match(/^[xX][0-9a-fA-F]+/)||(w=="x"||w=="X")&&u.match(/^'[0-9a-fA-F]*'/)))return"number";if(a.binaryNumber&&((w=="b"||w=="B")&&u.match(/^'[01]+'/)||w=="0"&&u.match(/^b[01]*/)))return"number";if(w.charCodeAt(0)>47&&w.charCodeAt(0)<58)return u.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),a.decimallessFloat&&u.match(/^\.(?!\.)/),"number";if(w=="?"&&(u.eatSpace()||u.eol()||u.eat(";")))return"macroName";if(w=="'"||w=='"'&&a.doubleQuote)return T.tokenize=y(w),T.tokenize(u,T);if((a.nCharCast&&(w=="n"||w=="N")||a.charsetCast&&w=="_"&&u.match(/[a-z][a-z0-9]*/i))&&(u.peek()=="'"||u.peek()=='"'))return"keyword";if(a.escapeConstant&&(w=="e"||w=="E")&&(u.peek()=="'"||u.peek()=='"'&&a.doubleQuote))return T.tokenize=function(s,I){return(I.tokenize=y(s.next(),!0))(s,I)},"keyword";if(a.commentSlashSlash&&w=="/"&&u.eat("/"))return u.skipToEnd(),"comment";if(a.commentHash&&w=="#"||w=="-"&&u.eat("-")&&(!a.commentSpaceRequired||u.eat(" ")))return u.skipToEnd(),"comment";if(w=="/"&&u.eat("*"))return T.tokenize=O(1),T.tokenize(u,T);if(w=="."){if(a.zerolessFloat&&u.match(/^(?:\d+(?:e[+-]?\d+)?)/i))return"number";if(u.match(/^\.+/))return null;if(a.ODBCdotTable&&u.match(/^[\w\d_$#]+/))return"type"}else{if(o.test(w))return u.eatWhile(o),"operator";if(x.test(w))return"bracket";if(c.test(w))return u.eatWhile(c),"punctuation";if(w=="{"&&(u.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||u.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";u.eatWhile(/^[_\w\d]/);var l=u.current().toLowerCase();return S.hasOwnProperty(l)&&(u.match(/^( )+'[^']*'/)||u.match(/^( )+"[^"]*"/))?"number":t.hasOwnProperty(l)?"atom":r.hasOwnProperty(l)?"type":i.hasOwnProperty(l)?"keyword":n.hasOwnProperty(l)?"builtin":null}}function y(u,T){return function(w,C){for(var l=!1,s;(s=w.next())!=null;){if(s==u&&!l){C.tokenize=d;break}l=(E||T)&&!l&&s=="\\"}return"string"}}function O(u){return function(T,w){var C=T.match(/^.*?(\/\*|\*\/)/);return C?C[1]=="/*"?w.tokenize=O(u+1):u>1?w.tokenize=O(u-1):w.tokenize=d:T.skipToEnd(),"comment"}}function K(u,T,w){T.context={prev:T.context,indent:u.indentation(),col:u.column(),type:w}}function M(u){u.indent=u.context.indent,u.context=u.context.prev}return{name:"sql",startState:function(){return{tokenize:d,context:null}},token:function(u,T){if(u.sol()&&T.context&&T.context.align==null&&(T.context.align=!1),T.tokenize==d&&u.eatSpace())return null;var w=T.tokenize(u,T);if(w=="comment")return w;T.context&&T.context.align==null&&(T.context.align=!0);var C=u.current();return C=="("?K(u,T,")"):C=="["?K(u,T,"]"):T.context&&T.context.type==C&&M(T),w},indent:function(u,T,w){var C=u.context;if(!C)return null;var l=T.charAt(0)==C.type;return C.align?C.col+(l?0:1):C.indent+(l?0:w.unit)},languageData:{commentTokens:{line:a.commentSlashSlash?"//":a.commentHash?"#":"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}}}function En(e){for(var n;(n=e.next())!=null;)if(n=="`"&&!e.eat("`"))return"string.special";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"string.special":null}function ka(e){for(var n;(n=e.next())!=null;)if(n=='"'&&!e.eat('"'))return"string.special";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"string.special":null}function ue(e){return e.eat("@")&&(e.match("session."),e.match("local."),e.match("global.")),e.eat("'")?(e.match(/^.*'/),"string.special"):e.eat('"')?(e.match(/^.*"/),"string.special"):e.eat("`")?(e.match(/^.*`/),"string.special"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"string.special":null}function Qt(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"string.special":null}var de="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";function h(e){for(var n={},t=e.split(" "),r=0;r!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:/]/,backslashStringEscapes:!1,dateSQL:h("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":ue}}),wa=G({client:h("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:h(de+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:h("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:h("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:h("date time timestamp"),support:h("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":ue,"`":En,"\\":Qt}}),Jl=G({client:h("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:h(de+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group group_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:h("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:h("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:h("date time timestamp"),support:h("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":ue,"`":En,"\\":Qt}}),Sa=G({client:h("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:h(de+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:h("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:h("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:h("date time timestamp datetime"),support:h("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":ue,":":ue,"?":ue,$:ue,'"':ka,"`":En}}),Yl=G({client:{},keywords:h("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:h("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:h("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:h("commentSlashSlash decimallessFloat"),hooks:{}}),za=G({client:h("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:h("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:h("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*\/+\-%<>!=~]/,dateSQL:h("date time timestamp"),support:h("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),ec=G({keywords:h("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"),builtin:h("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"),atoms:h("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:h("date timestamp"),support:h("ODBCdotTable doubleQuote binaryNumber hexNumber")}),Ea=G({client:h("source"),keywords:h(de+"a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"),builtin:h("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:h("false true null unknown"),operatorChars:/^[*\/+\-%<>!=&|^\/#@?~]/,backslashStringEscapes:!1,dateSQL:h("date time timestamp"),support:h("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast escapeConstant")}),nc=G({keywords:h("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:h("false true"),builtin:h("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),tc=G({client:h("source"),keywords:h("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:h("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:h("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:h("date time timestamp"),support:h("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),rc=G({keywords:h("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:h("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:h("false true null"),operatorChars:/^[*\/+\-%<>!=~&|^]/,dateSQL:h("date time timestamp"),support:h("ODBCdotTable doubleQuote zerolessFloat")}),ic=G({client:h("source"),keywords:h("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:h("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:h("time"),support:h("decimallessFloat zerolessFloat binaryNumber hexNumber")});function Xt(e){function n(c,d){c.cmdState.push(d)}function t(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function r(c){var d=c.cmdState.pop();d&&d.closeBracket()}function i(c){for(var d=c.cmdState,y=d.length-1;y>=0;y--){var O=d[y];if(O.name!="DEFAULT")return O}return{styleIdentifier:function(){return null}}}function o(c,d,y){return function(){this.name=c,this.bracketNo=0,this.style=d,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var a={};a.importmodule=o("importmodule","tag",["string","builtin"]),a.documentclass=o("documentclass","tag",["","atom"]),a.usepackage=o("usepackage","tag",["atom"]),a.begin=o("begin","tag",["atom"]),a.end=o("end","tag",["atom"]),a.label=o("label","tag",["atom"]),a.ref=o("ref","tag",["atom"]),a.eqref=o("eqref","tag",["atom"]),a.cite=o("cite","tag",["atom"]),a.bibitem=o("bibitem","tag",["atom"]),a.Bibitem=o("Bibitem","tag",["atom"]),a.RBibitem=o("RBibitem","tag",["atom"]),a.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function p(c,d){c.f=d}function S(c,d){var y;if(c.match(/^\\[a-zA-Z@\xc0-\u1fff\u2060-\uffff]+/)){var O=c.current().slice(1);return y=a.hasOwnProperty(O)?a[O]:a.DEFAULT,y=new y,n(d,y),p(d,x),y.style}if(c.match(/^\\[$&%#{}_]/)||c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return p(d,function(M,u){return E(M,u,"\\]")}),"keyword";if(c.match("\\("))return p(d,function(M,u){return E(M,u,"\\)")}),"keyword";if(c.match("$$"))return p(d,function(M,u){return E(M,u,"$$")}),"keyword";if(c.match("$"))return p(d,function(M,u){return E(M,u,"$")}),"keyword";var K=c.next();if(K=="%")return c.skipToEnd(),"comment";if(K=="}"||K=="]"){if(y=t(d),y)y.closeBracket(K),p(d,x);else return"error";return"bracket"}else return K=="{"||K=="["?(y=a.DEFAULT,y=new y,n(d,y),"bracket"):/\d/.test(K)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),y=i(d),y.name=="begin"&&(y.argument=c.current()),y.styleIdentifier())}function E(c,d,y){if(c.eatSpace())return null;if(y&&c.match(y))return p(d,S),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variableName.special";if(c.match(/^\\[$&%#{}_]/)||c.match(/^\\[,;!\/]/)||c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var O=c.next();return O=="{"||O=="}"||O=="["||O=="]"||O=="("||O==")"?"bracket":O=="%"?(c.skipToEnd(),"comment"):"error"}function x(c,d){var y=c.peek(),O;return y=="{"||y=="["?(O=t(d),O.openBracket(y),c.eat(y),p(d,S),"bracket"):/[ \t\r]/.test(y)?(c.eat(y),null):(p(d,S),r(d),S(c,d))}return{name:"stex",startState:function(){var c=e?function(d,y){return E(d,y)}:S;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,d){return d.f(c,d)},blankLine:function(c){c.f=S,c.cmdState.length=0},languageData:{commentTokens:{line:"%"}}}}var Ta=Xt(!1),ac=Xt(!0);function Ue(e){for(var n={},t=0;t~^?!",Pa=":;,.(){}[]",La=/^\-?0b[01][01_]*/,Da=/^\-?0o[0-7][0-7_]*/,$a=/^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/,Na=/^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/,qa=/^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/,Fa=/^\.(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/,Ma=/^\#[A-Za-z]+/,Ba=/^@(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/;function Jt(e,n,t){if(e.sol()&&(n.indented=e.indentation()),e.eatSpace())return null;var r=e.peek();if(r=="/"){if(e.match("//"))return e.skipToEnd(),"comment";if(e.match("/*"))return n.tokenize.push(Tn),Tn(e,n)}if(e.match(Ma))return"builtin";if(e.match(Ba))return"attribute";if(e.match(La)||e.match(Da)||e.match($a)||e.match(Na))return"number";if(e.match(Fa))return"property";if(Aa.indexOf(r)>-1)return e.next(),"operator";if(Pa.indexOf(r)>-1)return e.next(),e.match(".."),"punctuation";var i;if(i=e.match(/("""|"|')/)){var o=Wa.bind(null,i[0]);return n.tokenize.push(o),o(e,n)}if(e.match(qa)){var a=e.current();return Oa.hasOwnProperty(a)?"type":Ra.hasOwnProperty(a)?"atom":Ca.hasOwnProperty(a)?(Ia.hasOwnProperty(a)&&(n.prev="define"),"keyword"):t=="define"?"def":"variable"}return e.next(),null}function ja(){var e=0;return function(n,t,r){var i=Jt(n,t,r);if(i=="punctuation"){if(n.current()=="(")++e;else if(n.current()==")"){if(e==0)return n.backUp(1),t.tokenize.pop(),t.tokenize[t.tokenize.length-1](n,t);--e}}return i}}function Wa(e,n,t){for(var r=e.length==1,i,o=!1;i=n.peek();)if(o){if(n.next(),i=="(")return t.tokenize.push(ja()),"string";o=!1}else{if(n.match(e))return t.tokenize.pop(),"string";n.next(),o=i=="\\"}return r&&t.tokenize.pop(),"string"}function Tn(e,n){for(var t;t=e.next();)if(t==="/"&&e.eat("*"))n.tokenize.push(Tn);else if(t==="*"&&e.eat("/")){n.tokenize.pop();break}return"comment"}function Ua(e,n,t){this.prev=e,this.align=n,this.indented=t}function Ka(e,n){var t=n.match(/^\s*($|\/[\/\*]|[)}\]])/,!1)?null:n.column()+1;e.context=new Ua(e.context,t,e.indented)}function Ha(e){e.context&&(e.indented=e.context.indented,e.context=e.context.prev)}var Ga={name:"swift",startState:function(){return{prev:null,context:null,indented:0,tokenize:[]}},token:function(e,n){var t=n.prev;n.prev=null;var r=n.tokenize[n.tokenize.length-1]||Jt,i=r(e,n,t);if(!i||i=="comment"?n.prev=t:n.prev||(n.prev=i),i=="punctuation"){var o=/[\(\[\{]|([\]\)\}])/.exec(e.current());o&&(o[1]?Ha:Ka)(n,e)}return i},indent:function(e,n,t){var r=e.context;if(!r)return 0;var i=/^[\]\}\)]/.test(n);return r.align!=null?r.align-(i?1:0):r.indented+(i?0:t.unit)},languageData:{indentOnInput:/^\s*[\)\}\]]$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}};var Za={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(e,n){if(!n.inString&&(e.peek()=='"'||e.peek()=="'")&&(n.stringType=e.peek(),e.next(),n.inString=!0),e.sol()&&n.inArray===0&&(n.lhs=!0),n.inString){for(;n.inString&&!e.eol();)e.peek()===n.stringType?(e.next(),n.inString=!1):e.peek()==="\\"?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return n.lhs?"property":"string"}else{if(n.inArray&&e.peek()==="]")return e.next(),n.inArray--,"bracket";if(n.lhs&&e.peek()==="["&&e.skipTo("]"))return e.next(),e.peek()==="]"&&e.next(),"atom";if(e.peek()==="#")return e.skipToEnd(),"comment";if(e.eatSpace())return null;if(n.lhs&&e.eatWhile(function(t){return t!="="&&t!=" "}))return"property";if(n.lhs&&e.peek()==="=")return e.next(),n.lhs=!1,null;if(!n.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!n.lhs&&(e.match("true")||e.match("false")))return"atom";if(!n.lhs&&e.peek()==="[")return n.inArray++,e.next(),"bracket";if(!n.lhs&&e.match(/^\-?\d+(?:\.\d+)?/))return"number";e.eatSpace()||e.next()}return null},languageData:{commentTokens:{line:"#"}}};var Ke="error";function ce(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}var Qa=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),Va=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),Xa=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),Ja=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),Ya=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),el=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),Yt=["class","module","sub","enum","select","while","if","function","get","set","property","try","structure","synclock","using","with"],er=["else","elseif","case","catch","finally"],nr=["next","loop"],tr=["and","andalso","or","orelse","xor","in","not","is","isnot","like"],nl=ce(tr),rr=["#const","#else","#elseif","#end","#if","#region","addhandler","addressof","alias","as","byref","byval","cbool","cbyte","cchar","cdate","cdbl","cdec","cint","clng","cobj","compare","const","continue","csbyte","cshort","csng","cstr","cuint","culng","cushort","declare","default","delegate","dim","directcast","each","erase","error","event","exit","explicit","false","for","friend","gettype","goto","handles","implements","imports","infer","inherits","interface","isfalse","istrue","lib","me","mod","mustinherit","mustoverride","my","mybase","myclass","namespace","narrowing","new","nothing","notinheritable","notoverridable","of","off","on","operator","option","optional","out","overloads","overridable","overrides","paramarray","partial","private","protected","public","raiseevent","readonly","redim","removehandler","resume","return","shadows","shared","static","step","stop","strict","then","throw","to","true","trycast","typeof","until","until","when","widening","withevents","writeonly"],ir=["object","boolean","char","string","byte","sbyte","short","ushort","int16","uint16","integer","uinteger","int32","uint32","long","ulong","int64","uint64","decimal","single","double","float","date","datetime","intptr","uintptr"],tl=ce(rr),rl=ce(ir),il='"',ol=ce(Yt),or=ce(er),ar=ce(nr),lr=ce(["end"]),al=ce(["do"]),ll=null;function Cn(e,n){n.currentIndent++}function Ce(e,n){n.currentIndent--}function In(e,n){if(e.eatSpace())return null;var t=e.peek();if(t==="'")return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var r=!1;if((e.match(/^\d*\.\d+F?/i)||e.match(/^\d+\.\d*F?/)||e.match(/^\.\d+F?/))&&(r=!0),r)return e.eat(/J/i),"number";var i=!1;if(e.match(/^&H[0-9a-f]+/i)||e.match(/^&O[0-7]+/i)?i=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),i=!0):e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}return e.match(il)?(n.tokenize=cl(e.current()),n.tokenize(e,n)):e.match(Ya)||e.match(Ja)?null:e.match(Xa)||e.match(Qa)||e.match(nl)?"operator":e.match(Va)?null:e.match(al)?(Cn(e,n),n.doInCurrentLine=!0,"keyword"):e.match(ol)?(n.doInCurrentLine?n.doInCurrentLine=!1:Cn(e,n),"keyword"):e.match(or)?"keyword":e.match(lr)?(Ce(e,n),Ce(e,n),"keyword"):e.match(ar)?(Ce(e,n),"keyword"):e.match(rl)||e.match(tl)?"keyword":e.match(el)?"variable":(e.next(),Ke)}function cl(e){var n=e.length==1,t="string";return function(r,i){for(;!r.eol();){if(r.eatWhile(/[^'"]/),r.match(e))return i.tokenize=In,t;r.eat(/['"]/)}return n&&(i.tokenize=In),t}}function sl(e,n){var t=n.tokenize(e,n),r=e.current();if(r===".")return t=n.tokenize(e,n),t==="variable"?"variable":Ke;var i="[({".indexOf(r);return i!==-1&&Cn(e,n),ll==="dedent"&&Ce(e,n)||(i="])}".indexOf(r),i!==-1&&Ce(e,n))?Ke:t}var ul={name:"vb",startState:function(){return{tokenize:In,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,n){e.sol()&&(n.currentIndent+=n.nextLineIndent,n.nextLineIndent=0,n.doInCurrentLine=0);var t=sl(e,n);return n.lastToken={style:t,content:e.current()},t},indent:function(e,n,t){var r=n.replace(/^\s+|\s+$/g,"");return r.match(ar)||r.match(lr)||r.match(or)?t.unit*(e.currentIndent-1):e.currentIndent<0?0:e.currentIndent*t.unit},languageData:{closeBrackets:{brackets:["(","[","{",'"']},commentTokens:{line:"'"},autocomplete:Yt.concat(er).concat(nr).concat(tr).concat(rr).concat(ir)}};function cr(e){var n="error";function t(g){return new RegExp("^(("+g.join(")|(")+"))\\b","i")}var r=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),i=new RegExp("^((<>)|(<=)|(>=))"),o=new RegExp("^[\\.,]"),a=new RegExp("^[\\(\\)]"),p=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),S=["class","sub","select","while","if","function","property","with","for"],E=["else","elseif","case"],x=["next","loop","wend"],c=t(["and","or","not","xor","is","mod","eqv","imp"]),d=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],y=["true","false","nothing","empty","null"],O=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],K=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],M=["WScript","err","debug","RegExp"],u=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],T=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],w=["server","response","request","session","application"],C=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],l=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],s=T.concat(u);M=M.concat(K),e.isASP&&(M=M.concat(w),s=s.concat(l,C));var I=t(d),k=t(y),L=t(O),m=t(M),f=t(s),z='"',v=t(S),D=t(E),J=t(x),ye=t(["end"]),Ze=t(["do"]),ur=t(["on error resume next","exit"]),dr=t(["rem"]);function An(g,R){R.currentIndent++}function Qe(g,R){R.currentIndent--}function Ve(g,R){if(g.eatSpace())return null;var $=g.peek();if($==="'"||g.match(dr))return g.skipToEnd(),"comment";if(g.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!g.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var W=!1;if((g.match(/^\d*\.\d+/i)||g.match(/^\d+\.\d*/)||g.match(/^\.\d+/))&&(W=!0),W)return g.eat(/J/i),"number";var re=!1;if(g.match(/^&H[0-9a-f]+/i)||g.match(/^&O[0-7]+/i)?re=!0:g.match(/^[1-9]\d*F?/)?(g.eat(/J/i),re=!0):g.match(/^0(?![\dx])/i)&&(re=!0),re)return g.eat(/L/i),"number"}return g.match(z)?(R.tokenize=fr(g.current()),R.tokenize(g,R)):g.match(i)||g.match(r)||g.match(c)?"operator":g.match(o)?null:g.match(a)?"bracket":g.match(ur)?(R.doInCurrentLine=!0,"keyword"):g.match(Ze)?(An(g,R),R.doInCurrentLine=!0,"keyword"):g.match(v)?(R.doInCurrentLine?R.doInCurrentLine=!1:An(g,R),"keyword"):g.match(D)?"keyword":g.match(ye)?(Qe(g,R),Qe(g,R),"keyword"):g.match(J)?(R.doInCurrentLine?R.doInCurrentLine=!1:Qe(g,R),"keyword"):g.match(I)?"keyword":g.match(k)?"atom":g.match(f)?"variableName.special":g.match(L)||g.match(m)?"builtin":g.match(p)?"variable":(g.next(),n)}function fr(g){var R=g.length==1,$="string";return function(W,re){for(;!W.eol();){if(W.eatWhile(/[^'"]/),W.match(g))return re.tokenize=Ve,$;W.eat(/['"]/)}return R&&(re.tokenize=Ve),$}}function pr(g,R){var $=R.tokenize(g,R),W=g.current();return W==="."?($=R.tokenize(g,R),W=g.current(),$&&($.substr(0,8)==="variable"||$==="builtin"||$==="keyword")?(($==="builtin"||$==="keyword")&&($="variable"),s.indexOf(W.substr(1))>-1&&($="keyword"),$):n):$}return{name:"vbscript",startState:function(){return{tokenize:Ve,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(g,R){g.sol()&&(R.currentIndent+=R.nextLineIndent,R.nextLineIndent=0,R.doInCurrentLine=0);var $=pr(g,R);return R.lastToken={style:$,content:g.current()},$===null&&($=null),$},indent:function(g,R,$){var W=R.replace(/^\s+|\s+$/g,"");return W.match(J)||W.match(ye)||W.match(D)?$.unit*(g.currentIndent-1):g.currentIndent<0?0:g.currentIndent*$.unit}}}var dl=cr({}),dc=cr({isASP:!0});var fl=["true","false","on","off","yes","no"],pl=new RegExp("\\b(("+fl.join(")|(")+"))$","i"),ml={name:"yaml",token:function(e,n){var t=e.peek(),r=n.escaped;if(n.escaped=!1,t=="#"&&(e.pos==0||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match("---")||e.match("..."))return"def";if(e.match(/^\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return t=="{"?n.inlinePairs++:t=="}"?n.inlinePairs--:t=="["?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!r&&t==",")return e.next(),"meta";if(n.inlinePairs>0&&!r&&t==",")return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(n.inlinePairs==0&&e.match(/^\s*-?[0-9\.\,]+\s?$/)||n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(pl))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped=t=="\\",e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}};var Rn={token:e=>e.skipToEnd()},On=["debug","extends","function","include","literal"],Y={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/},Ge;function U(e,n){return Ge=n,e}function hl(e,n,t){return n.tokenize=t,t(e,n)}function gl(e,n){return!1}function He(e,n){let t=e.string,r;for(let o=e.pos;r=t.indexOf("{",o),o=r+1,!(r===-1||!gl()););if(r===e.pos)return e.match("{"),e.eat("*")?hl(e,n,yl("comment","*}")):(n.depth++,n.tokenize=sr,Ge="startTag","tag");r>-1&&(e.string=t.slice(0,r));let i=Rn.token(e,n.base);return r>-1&&(e.string=t),i}function sr(e,n){if(e.match("}",!0))return n.tokenize=He,U("tag",null);if(e.match("{",!0))return n.depth++,U("tag","startTag");let t=e.next();if(t==="$")return e.eatWhile(Y.validIdentifier),U("variable-2","variable");if(t==="|")return U("operator","pipe");if(t===".")return U("operator","property");if(Y.stringChar.test(t))return n.tokenize=bl(t),U("string","string");if(Y.operatorChars.test(t))return e.eatWhile(Y.operatorChars),U("operator","operator");if(t==="["||t==="]")return U("bracket","bracket");if(t==="("||t===")")return U("bracket","operator");if(/\d/.test(t))return e.eatWhile(/\d/),U("number","number");{if(n.last==="variable"){if(t==="@")return e.eatWhile(Y.validIdentifier),U("property","property");if(t==="|")return e.eatWhile(Y.validIdentifier),U("qualifier","modifier")}else{if(n.last==="pipe")return e.eatWhile(Y.validIdentifier),U("qualifier","modifier");if(n.last==="whitespace")return e.eatWhile(Y.validIdentifier),U("attribute","modifier")}if(n.last==="property")return e.eatWhile(Y.validIdentifier),U("property",null);if(/\s/.test(t))return Ge="whitespace",null;let r="";t!=="/"&&(r+=t);let i=null;for(;i=e.eat(Y.validIdentifier);)r+=i;for(let o=0,a=On.length;o|[*\]])\s*$|\*$/.test(e.string.slice(0,t))||n.typeAtEndOfLine&&e.column()==e.indentation())return!0}function xn(e){for(;;){if(!e||e.type=="top")return!0;if(e.type=="}"&&e.prev.info!="namespace")return!1;e=e.prev}}function ne(e){var n=e.statementIndentUnit,t=e.dontAlignCalls,r=e.keywords||{},i=e.types||{},o=e.builtin||{},a=e.blockKeywords||{},s=e.defKeywords||{},_=e.atoms||{},z=e.hooks||{},S=e.multiLineStrings,c=e.indentStatements!==!1,f=e.indentSwitch!==!1,y=e.namespaceSeparator,R=e.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,Q=e.numberStart||/[\d\.]/,U=e.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,d=e.isOperatorChar||/[+\-*&%=<>!?|\/]/,C=e.isIdentifierChar||/[\w\$_\xa1-\uffff]/,E=e.isReservedIdentifier||!1,I,l;function u(m,p){var T=m.next();if(z[T]){var k=z[T](m,p);if(k!==!1)return k}if(T=='"'||T=="'")return p.tokenize=A(T),p.tokenize(m,p);if(Q.test(T)){if(m.backUp(1),m.match(U))return"number";m.next()}if(R.test(T))return I=T,null;if(T=="/"){if(m.eat("*"))return p.tokenize=x,x(m,p);if(m.eat("/"))return m.skipToEnd(),"comment"}if(d.test(T)){for(;!m.match(/^\/[\/*]/,!1)&&m.eat(d););return"operator"}if(m.eatWhile(C),y)for(;m.match(y);)m.eatWhile(C);var $=m.current();return de(r,$)?(de(a,$)&&(I="newstatement"),de(s,$)&&(l=!0),"keyword"):de(i,$)?"type":de(o,$)||E&&E($)?(de(a,$)&&(I="newstatement"),"builtin"):de(_,$)?"atom":"variable"}function A(m){return function(p,T){for(var k=!1,$,ce=!1;($=p.next())!=null;){if($==m&&!k){ce=!0;break}k=!k&&$=="\\"}return(ce||!(k||S))&&(T.tokenize=null),"string"}}function x(m,p){for(var T=!1,k;k=m.next();){if(k=="/"&&T){p.tokenize=null;break}T=k=="*"}return"comment"}function L(m,p){e.typeFirstDefinitions&&m.eol()&&xn(p.context)&&(p.typeAtEndOfLine=pt(m,p,m.pos))}return{name:e.name,startState:function(m){return{tokenize:null,context:new Sn(-m,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(m,p){var T=p.context;if(m.sol()&&(T.align==null&&(T.align=!1),p.indented=m.indentation(),p.startOfLine=!0),m.eatSpace())return L(m,p),null;I=l=null;var k=(p.tokenize||u)(m,p);if(k=="comment"||k=="meta")return k;if(T.align==null&&(T.align=!0),I==";"||I==":"||I==","&&m.match(/^\s*(?:\/\/.*)?$/,!1))for(;p.context.type=="statement";)De(p);else if(I=="{")Ke(p,m.column(),"}");else if(I=="[")Ke(p,m.column(),"]");else if(I=="(")Ke(p,m.column(),")");else if(I=="}"){for(;T.type=="statement";)T=De(p);for(T.type=="}"&&(T=De(p));T.type=="statement";)T=De(p)}else I==T.type?De(p):c&&((T.type=="}"||T.type=="top")&&I!=";"||T.type=="statement"&&I=="newstatement")&&Ke(p,m.column(),"statement",m.current());if(k=="variable"&&(p.prevToken=="def"||e.typeFirstDefinitions&&pt(m,p,m.start)&&xn(p.context)&&m.match(/^\s*\(/,!1))&&(k="def"),z.token){var $=z.token(m,p,k);$!==void 0&&(k=$)}return k=="def"&&e.styleDefs===!1&&(k="variable"),p.startOfLine=!1,p.prevToken=l?"def":k||I,L(m,p),k},indent:function(m,p,T){if(m.tokenize!=u&&m.tokenize!=null||m.typeAtEndOfLine&&xn(m.context))return null;var k=m.context,$=p&&p.charAt(0),ce=$==k.type;if(k.type=="statement"&&$=="}"&&(k=k.prev),e.dontIndentStatements)for(;k.type=="statement"&&e.dontIndentStatements.test(k.info);)k=k.prev;if(z.indent){var Pe=z.indent(m,k,p,T.unit);if(typeof Pe=="number")return Pe}var yn=k.prev&&k.prev.info=="switch";if(e.allmanIndentation&&/[{(]/.test($)){for(;k.type!="top"&&k.type!="}";)k=k.prev;return k.indented}return k.type=="statement"?k.indented+($=="{"?0:n||T.unit):k.align&&(!t||k.type!=")")?k.column+(ce?0:1):k.type==")"&&!ce?k.indented+(n||T.unit):k.indented+(ce?0:T.unit)+(!ce&&yn&&!/^(?:case|default)\b/.test(p)?T.unit:0)},languageData:{indentOnInput:f?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}},autocomplete:Object.keys(r).concat(Object.keys(i)).concat(Object.keys(o)).concat(Object.keys(_)),...e.languageData}}}function v(e){for(var n={},t=e.split(" "),r=0;r!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,n){return e.match('""')?(n.tokenize=_t,n.tokenize(e,n)):!1},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?"character":(e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(e,n){var t=n.context;return t.type=="}"&&t.align&&e.eat(">")?(n.context=new Sn(t.indented,t.column,t.type,t.info,null,t.prev),"operator"):!1},"/":function(e,n){return e.eat("*")?(n.tokenize=Le(1),n.tokenize(e,n)):!1}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});function bi(e){return function(n,t){for(var r=!1,i,o=!1;!n.eol();){if(!e&&!r&&n.match('"')){o=!0;break}if(e&&n.match('"""')){o=!0;break}i=n.next(),!r&&i=="$"&&n.match("{")&&n.skipTo("}"),r=!r&&i=="\\"&&!e}return(o||!e)&&(t.tokenize=null),"string"}}var vi=ne({name:"kotlin",keywords:v("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:v("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:v("catch class do else finally for if where try while enum"),defKeywords:v("class val var object interface fun"),atoms:v("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,n){return n.prevToken=="."?"variable":"operator"},'"':function(e,n){return n.tokenize=bi(e.match('""')),n.tokenize(e,n)},"/":function(e,n){return e.eat("*")?(n.tokenize=Le(1),n.tokenize(e,n)):!1},indent:function(e,n,t,r){var i=t&&t.charAt(0);if((e.prevToken=="}"||e.prevToken==")")&&t=="")return e.indented;if(e.prevToken=="operator"&&t!="}"&&e.context.type!="}"||e.prevToken=="variable"&&i=="."||(e.prevToken=="}"||e.prevToken==")")&&i==".")return r*2+n.indented;if(n.align&&n.type=="}")return n.indented+(e.context.type==(t||"").charAt(0)?0:r)}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}}),Bc=ne({name:"shader",keywords:v("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:v("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:v("for while do if else struct"),builtin:v("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:v("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":ve}}),Wc=ne({name:"nesc",keywords:v($e+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:Ne,blockKeywords:v(Fe),atoms:v("null true false"),hooks:{"#":ve}}),jc=ne({name:"objectivec",keywords:v($e+" "+bt),types:yt,builtin:v(vt),blockKeywords:v(Fe+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:v(Ze+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:v("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:Qe,hooks:{"#":ve,"*":Ge}}),Uc=ne({name:"objectivecpp",keywords:v($e+" "+bt+" "+gt),types:yt,builtin:v(vt),blockKeywords:v(Fe+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:v(Ze+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:v("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:Qe,hooks:{"#":ve,"*":Ge,u:be,U:be,L:be,R:be,0:W,1:W,2:W,3:W,4:W,5:W,6:W,7:W,8:W,9:W,token:function(e,n,t){if(t=="variable"&&e.peek()=="("&&(n.prevToken==";"||n.prevToken==null||n.prevToken=="}")&&kt(e.current()))return"def"}},namespaceSeparator:"::"}),Vc=ne({name:"squirrel",keywords:v("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:Ne,blockKeywords:v("case catch class else for foreach if switch try while"),defKeywords:v("function local class"),typeFirstDefinitions:!0,atoms:v("true false null"),hooks:{"#":ve}}),He=null;function xt(e){return function(n,t){for(var r=!1,i,o=!1;!n.eol();){if(!r&&n.match('"')&&(e=="single"||n.match('""'))){o=!0;break}if(!r&&n.match("``")){He=xt(e),o=!0;break}i=n.next(),r=e=="single"&&!r&&i=="\\"}return o&&(t.tokenize=null),"string"}}var Kc=ne({name:"ceylon",keywords:v("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var n=e.charAt(0);return n===n.toUpperCase()&&n!==n.toLowerCase()},blockKeywords:v("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:v("class dynamic function interface module object package value"),builtin:v("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:v("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,n){return n.tokenize=xt(e.match('""')?"triple":"single"),n.tokenize(e,n)},"`":function(e,n){return!He||!e.match("`")?!1:(n.tokenize=He,He=null,n.tokenize(e,n))},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?"string.special":(e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},token:function(e,n,t){if((t=="variable"||t=="type")&&n.prevToken==".")return"variableName.special"}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});function yi(e){(e.interpolationStack||(e.interpolationStack=[])).push(e.tokenize)}function wt(e){return(e.interpolationStack||(e.interpolationStack=[])).pop()}function ki(e){return e.interpolationStack?e.interpolationStack.length:0}function wn(e,n,t,r){var i=!1;if(n.eat(e))if(n.eat(e))i=!0;else return"string";function o(a,s){for(var _=!1;!a.eol();){if(!r&&!_&&a.peek()=="$")return yi(s),s.tokenize=_i,"string";var z=a.next();if(z==e&&!_&&(!i||a.match(e+e))){s.tokenize=null;break}_=!r&&!_&&z=="\\"}return"string"}return t.tokenize=o,o(n,t)}function _i(e,n){return e.eat("$"),e.eat("{")?n.tokenize=null:n.tokenize=xi,null}function xi(e,n){return e.eatWhile(/[\w_]/),n.tokenize=wt(n),"variable"}var wi=ne({name:"dart",keywords:v("this super static final const abstract class extends external factory implements mixin get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as extension on yield late required sealed base interface when inline"),blockKeywords:v("try catch finally do else for if switch while"),builtin:v("void bool num int double dynamic var String Null Never"),atoms:v("true false null"),number:/^(?:0x[a-f\d_]+|(?:[\d_]+\.?[\d_]*|\.[\d_]+)(?:e[-+]?[\d_]+)?)/i,hooks:{"@":function(e){return e.eatWhile(/[\w\$_\.]/),"meta"},"'":function(e,n){return wn("'",e,n,!1)},'"':function(e,n){return wn('"',e,n,!1)},r:function(e,n){var t=e.peek();return t=="'"||t=='"'?wn(e.next(),e,n,!0):!1},"}":function(e,n){return ki(n)>0?(n.tokenize=wt(n),null):!1},"/":function(e,n){return e.eat("*")?(n.tokenize=Le(1),n.tokenize(e,n)):!1},token:function(e,n,t){if(t=="variable"){var r=RegExp("^[_$]*[A-Z][a-zA-Z0-9_$]*$","g");if(r.test(e.current()))return"type"}}}});var St=["false","nil","true"],zt=[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],Et=["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],Si=["->","->>","as->","binding","bound-fn","case","catch","comment","cond","cond->","cond->>","condp","def","definterface","defmethod","defn","defmacro","defprotocol","defrecord","defstruct","deftype","do","doseq","dotimes","doto","extend","extend-protocol","extend-type","fn","for","future","if","if-let","if-not","if-some","let","letfn","locking","loop","ns","proxy","reify","struct-map","some->","some->>","try","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn"],zi=Xe(St),Ei=Xe(zt),Ti=Xe(Et),Ci=Xe(Si),Ii=/^(?:[\\\[\]\s"(),;@^`{}~]|$)/,Ai=/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,Oi=/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,Ri=/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/;function zn(e,n){if(e.eatSpace()||e.eat(","))return["space",null];if(e.match(Ai))return[null,"number"];if(e.match(Oi))return[null,"string.special"];if(e.eat(/^"/))return(n.tokenize=Pi)(e,n);if(e.eat(/^[(\[{]/))return["open","bracket"];if(e.eat(/^[)\]}]/))return["close","bracket"];if(e.eat(/^;/))return e.skipToEnd(),["space","comment"];if(e.eat(/^[#'@^`~]/))return[null,"meta"];var t=e.match(Ri),r=t&&t[0];return r?r==="comment"&&n.lastToken==="("?(n.tokenize=Di)(e,n):qe(r,zi)||r.charAt(0)===":"?["symbol","atom"]:qe(r,Ei)||qe(r,Ti)?["symbol","keyword"]:n.lastToken==="("?["symbol","builtin"]:["symbol","variable"]:(e.next(),e.eatWhile(function(i){return!qe(i,Ii)}),[null,"error"])}function Pi(e,n){for(var t=!1,r;r=e.next();){if(r==='"'&&!t){n.tokenize=zn;break}t=!t&&r==="\\"}return[null,"string"]}function Di(e,n){for(var t=1,r;r=e.next();)if(r===")"&&t--,r==="("&&t++,t===0){e.backUp(1),n.tokenize=zn;break}return["space","comment"]}function Xe(e){for(var n={},t=0;t\/\:]/,Mi=/^\.(and|or|eq|lt|le|gt|ge|ne|not|eqv|neqv)\./i;function Bi(e,n){if(e.match(Mi))return"operator";var t=e.next();if(t=="!")return e.skipToEnd(),"comment";if(t=='"'||t=="'")return n.tokenize=Wi(t),n.tokenize(e,n);if(/[\[\]\(\),]/.test(t))return null;if(/\d/.test(t))return e.eatWhile(/[\w\.]/),"number";if(Ct.test(t))return e.eatWhile(Ct),"operator";e.eatWhile(/[\w\$_]/);var r=e.current().toLowerCase();return Ni.hasOwnProperty(r)?"keyword":Fi.hasOwnProperty(r)||qi.hasOwnProperty(r)?"builtin":"variable"}function Wi(e){return function(n,t){for(var r=!1,i,o=!1;(i=n.next())!=null;){if(i==e&&!r){o=!0;break}r=!r&&i=="\\"}return(o||!r)&&(t.tokenize=null),"string"}}var ji={name:"fortran",startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var t=(n.tokenize||Bi)(e,n);return t=="comment"||t=="meta",t}};var Ui={break:!0,case:!0,chan:!0,const:!0,continue:!0,default:!0,defer:!0,else:!0,fallthrough:!0,for:!0,func:!0,go:!0,goto:!0,if:!0,import:!0,interface:!0,map:!0,package:!0,range:!0,return:!0,select:!0,struct:!0,switch:!0,type:!0,var:!0,bool:!0,byte:!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,int:!0,uint:!0,uintptr:!0,error:!0,rune:!0,any:!0,comparable:!0},Vi={true:!0,false:!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,delete:!0,imag:!0,len:!0,make:!0,new:!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},It=/[+\-*&^%:=<>!|\/]/,fe;function Je(e,n){var t=e.next();if(t=='"'||t=="'"||t=="`")return n.tokenize=Ki(t),n.tokenize(e,n);if(/[\d\.]/.test(t))return t=="."?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):t=="0"?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(t))return fe=t,null;if(t=="/"){if(e.eat("*"))return n.tokenize=At,At(e,n);if(e.eat("/"))return e.skipToEnd(),"comment"}if(It.test(t))return e.eatWhile(It),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var r=e.current();return Ui.propertyIsEnumerable(r)?((r=="case"||r=="default")&&(fe="case"),"keyword"):Vi.propertyIsEnumerable(r)?"atom":"variable"}function Ki(e){return function(n,t){for(var r=!1,i,o=!1;(i=n.next())!=null;){if(i==e&&!r){o=!0;break}r=!r&&e!="`"&&i=="\\"}return(o||!(r||e=="`"))&&(t.tokenize=Je),"string"}}function At(e,n){for(var t=!1,r;r=e.next();){if(r=="/"&&t){n.tokenize=Je;break}t=r=="*"}return"comment"}function Rt(e,n,t,r,i){this.indented=e,this.column=n,this.type=t,this.align=r,this.prev=i}function Tn(e,n,t){return e.context=new Rt(e.indented,n,t,null,e.context)}function Ot(e){if(e.context.prev){var n=e.context.type;return(n==")"||n=="]"||n=="}")&&(e.indented=e.context.indented),e.context=e.context.prev}}var Hi={name:"go",startState:function(e){return{tokenize:null,context:new Rt(-e,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,n){var t=n.context;if(e.sol()&&(t.align==null&&(t.align=!1),n.indented=e.indentation(),n.startOfLine=!0,t.type=="case"&&(t.type="}")),e.eatSpace())return null;fe=null;var r=(n.tokenize||Je)(e,n);return r=="comment"||(t.align==null&&(t.align=!0),fe=="{"?Tn(n,e.column(),"}"):fe=="["?Tn(n,e.column(),"]"):fe=="("?Tn(n,e.column(),")"):fe=="case"?t.type="case":(fe=="}"&&t.type=="}"||fe==t.type)&&Ot(n),n.startOfLine=!1),r},indent:function(e,n,t){if(e.tokenize!=Je&&e.tokenize!=null)return null;var r=e.context,i=n&&n.charAt(0);if(r.type=="case"&&/^(?:case|default)\b/.test(n))return r.indented;var o=i==r.type;return r.align?r.column+(o?0:1):r.indented+(o?0:t.unit)},languageData:{indentOnInput:/^\s([{}]|case |default\s*:)$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}};function en(e){for(var n={},t=e.split(" "),r=0;r"))return X="->",null;if(/[+\-*&%=<>!?|\/~]/.test(t))return e.eatWhile(/[+\-*&%=<>|~]/),"operator";if(e.eatWhile(/[\w\$_]/),t=="@")return e.eatWhile(/[\w\$_\.]/),"meta";if(n.lastToken==".")return"property";if(e.eat(":"))return X="proplabel","property";var r=e.current();return Xi.propertyIsEnumerable(r)?"atom":Zi.propertyIsEnumerable(r)?(Gi.propertyIsEnumerable(r)?X="newstatement":Qi.propertyIsEnumerable(r)&&(X="standalone"),"keyword"):"variable"}In.isBase=!0;function Pt(e,n,t){var r=!1;if(e!="/"&&n.eat(e))if(n.eat(e))r=!0;else return"string";function i(o,a){for(var s=!1,_,z=!r;(_=o.next())!=null;){if(_==e&&!s){if(!r)break;if(o.match(e+e)){z=!0;break}}if(e=='"'&&_=="$"&&!s){if(o.eat("{"))return a.tokenize.push(Ji()),"string";if(o.match(/^\w/,!1))return a.tokenize.push(Yi),"string"}s=!s&&_=="\\"}return z&&a.tokenize.pop(),"string"}return t.tokenize.push(i),i(n,t)}function Ji(){var e=1;function n(t,r){if(t.peek()=="}"){if(e--,e==0)return r.tokenize.pop(),r.tokenize[r.tokenize.length-1](t,r)}else t.peek()=="{"&&e++;return In(t,r)}return n.isBase=!0,n}function Yi(e,n){var t=e.match(/^(\.|[\w\$_]+)/);return(!t||!e.match(t[0]=="."?/^[\w$_]/:/^\./))&&n.tokenize.pop(),t?t[0]=="."?null:"variable":n.tokenize[n.tokenize.length-1](e,n)}function Dt(e,n){for(var t=!1,r;r=e.next();){if(r=="/"&&t){n.tokenize.pop();break}t=r=="*"}return"comment"}function Cn(e,n){return!e||e=="operator"||e=="->"||/[\.\[\{\(,;:]/.test(e)||e=="newstatement"||e=="keyword"||e=="proplabel"||e=="standalone"&&!n}function Lt(e,n,t,r,i){this.indented=e,this.column=n,this.type=t,this.align=r,this.prev=i}function Ye(e,n,t){return e.context=new Lt(e.indented,n,t,null,e.context)}function xe(e){var n=e.context.type;return(n==")"||n=="]"||n=="}")&&(e.indented=e.context.indented),e.context=e.context.prev}var eo={name:"groovy",startState:function(e){return{tokenize:[In],context:new Lt(-e,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,n){var t=n.context;if(e.sol()&&(t.align==null&&(t.align=!1),n.indented=e.indentation(),n.startOfLine=!0,t.type=="statement"&&!Cn(n.lastToken,!0)&&(xe(n),t=n.context)),e.eatSpace())return null;X=null;var r=n.tokenize[n.tokenize.length-1](e,n);if(r=="comment")return r;if(t.align==null&&(t.align=!0),(X==";"||X==":")&&t.type=="statement")xe(n);else if(X=="->"&&t.type=="statement"&&t.prev.type=="}")xe(n),n.context.align=!1;else if(X=="{")Ye(n,e.column(),"}");else if(X=="[")Ye(n,e.column(),"]");else if(X=="(")Ye(n,e.column(),")");else if(X=="}"){for(;t.type=="statement";)t=xe(n);for(t.type=="}"&&(t=xe(n));t.type=="statement";)t=xe(n)}else X==t.type?xe(n):(t.type=="}"||t.type=="top"||t.type=="statement"&&X=="newstatement")&&Ye(n,e.column(),"statement");return n.startOfLine=!1,n.lastToken=X||r,r},indent:function(e,n,t){if(!e.tokenize[e.tokenize.length-1].isBase)return null;var r=n&&n.charAt(0),i=e.context;i.type=="statement"&&!Cn(e.lastToken,!0)&&(i=i.prev);var o=r==i.type;return i.type=="statement"?i.indented+(r=="{"?0:t.unit):i.align?i.column+(o?0:1):i.indented+(o?0:t.unit)},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""']}}};function j(e){return{type:e,style:"keyword"}}var $t=j("keyword a"),An=j("keyword b"),Me=j("keyword c"),no=j("operator"),On={type:"atom",style:"atom"},nn={type:"attribute",style:"attribute"},J=j("typedef"),Nt={if:$t,while:$t,else:An,do:An,try:An,return:Me,break:Me,continue:Me,new:Me,throw:Me,var:j("var"),inline:nn,static:nn,using:j("import"),public:nn,private:nn,cast:j("cast"),import:j("import"),macro:j("macro"),function:j("function"),catch:j("catch"),untyped:j("untyped"),callback:j("cb"),for:j("for"),switch:j("switch"),case:j("case"),default:j("default"),in:no,never:j("property_access"),trace:j("trace"),class:J,abstract:J,enum:J,interface:J,typedef:J,extends:J,implements:J,dynamic:J,true:On,false:On,null:On},Rn=/[+\-*&%=<>!?|]/;function Ft(e,n,t){return n.tokenize=t,t(e,n)}function Mt(e,n){for(var t=!1,r;(r=e.next())!=null;){if(r==n&&!t)return!0;t=!t&&r=="\\"}}var J,Bt;function ee(e,n,t){return J=e,Bt=t,n}function tn(e,n){var t=e.next();if(t=='"'||t=="'")return Ft(e,n,to(t));if(/[\[\]{}\(\),;\:\.]/.test(t))return ee(t);if(t=="0"&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),ee("number","number");if(/\d/.test(t)||t=="-"&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/),ee("number","number");if(n.reAllowed&&t=="~"&&e.eat(/\//))return Mt(e,"/"),e.eatWhile(/[gimsu]/),ee("regexp","string.special");if(t=="/")return e.eat("*")?Ft(e,n,ro):e.eat("/")?(e.skipToEnd(),ee("comment","comment")):(e.eatWhile(Rn),ee("operator",null,e.current()));if(t=="#")return e.skipToEnd(),ee("conditional","meta");if(t=="@")return e.eat(/:/),e.eatWhile(/[\w_]/),ee("metadata","meta");if(Rn.test(t))return e.eatWhile(Rn),ee("operator",null,e.current());var r;if(/[A-Z]/.test(t))return e.eatWhile(/[\w_<>]/),r=e.current(),ee("type","type",r);e.eatWhile(/[\w_]/);var r=e.current(),i=Nt.propertyIsEnumerable(r)&&Nt[r];return i&&n.kwAllowed?ee(i.type,i.style,r):ee("variable","variable",r)}function to(e){return function(n,t){return Mt(n,e)&&(t.tokenize=tn),ee("string","string")}}function ro(e,n){for(var t=!1,r;r=e.next();){if(r=="/"&&t){n.tokenize=tn;break}t=r=="*"}return ee("comment","comment")}var Wt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0};function jt(e,n,t,r,i,o){this.indented=e,this.column=n,this.type=t,this.prev=i,this.info=o,r!=null&&(this.align=r)}function io(e,n){for(var t=e.localVars;t;t=t.next)if(t.name==n)return!0}function oo(e,n,t,r,i){var o=e.cc;for(F.state=e,F.stream=i,F.marked=null,F.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():pe;if(a(t,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return F.marked?F.marked:t=="variable"&&io(e,r)?"variableName.local":t=="variable"&&ao(e,r)?"variableName.special":n}}}function ao(e,n){if(/[a-z]/.test(n.charAt(0)))return!1;for(var t=e.importedtypes.length,r=0;r=0;e--)F.cc.push(arguments[e])}function g(){return me.apply(null,arguments),!0}function qt(e,n){for(var t=n;t;t=t.next)if(t.name==e)return!0;return!1}function on(e){var n=F.state;if(n.context){if(F.marked="def",qt(e,n.localVars))return;n.localVars={name:e,next:n.localVars}}else if(n.globalVars){if(qt(e,n.globalVars))return;n.globalVars={name:e,next:n.globalVars}}}var lo={name:"this",next:null};function Dn(){F.state.context||(F.state.localVars=lo),F.state.context={prev:F.state.context,vars:F.state.localVars}}function rn(){F.state.localVars=F.state.context.vars,F.state.context=F.state.context.prev}rn.lex=!0;function V(e,n){var t=function(){var r=F.state;r.lexical=new jt(r.indented,F.stream.column(),e,null,r.lexical,n)};return t.lex=!0,t}function B(){var e=F.state;e.lexical.prev&&(e.lexical.type==")"&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}B.lex=!0;function Y(e){function n(t){return t==e?g():e==";"?me():g(n)}return n}function pe(e){return e=="@"?g(Ln):e=="var"?g(V("vardef"),Nn,Y(";"),B):e=="keyword a"?g(V("form"),re,pe,B):e=="keyword b"?g(V("form"),pe,B):e=="{"?g(V("}"),Dn,$n,B,rn):e==";"?g():e=="attribute"?g(Vt):e=="function"?g(Be):e=="for"?g(V("form"),Y("("),V(")"),mo,Y(")"),B,pe,B):e=="variable"?g(V("stat"),so):e=="switch"?g(V("form"),re,V("}","switch"),Y("{"),$n,B,B):e=="case"?g(re,Y(":")):e=="default"?g(Y(":")):e=="catch"?g(V("form"),Dn,Y("("),Zt,Y(")"),pe,B,rn):e=="import"?g(Kt,Y(";")):e=="typedef"?g(uo):me(V("stat"),re,Y(";"),B)}function re(e){return Wt.hasOwnProperty(e)||e=="type"?g(ue):e=="function"?g(Be):e=="keyword c"?g(Pn):e=="("?g(V(")"),Pn,Y(")"),B,ue):e=="operator"?g(re):e=="["?g(V("]"),Ee(Pn,"]"),B,ue):e=="{"?g(V("}"),Ee(po,"}"),B,ue):g()}function Pn(e){return e.match(/[;\}\)\],]/)?me():me(re)}function ue(e,n){if(e=="operator"&&/\+\+|--/.test(n))return g(ue);if(e=="operator"||e==":")return g(re);if(e!=";"){if(e=="(")return g(V(")"),Ee(re,")"),B,ue);if(e==".")return g(fo,ue);if(e=="[")return g(V("]"),re,Y("]"),B,ue)}}function Vt(e){if(e=="attribute")return g(Vt);if(e=="function")return g(Be);if(e=="var")return g(Nn)}function Ln(e){if(e==":"||e=="variable")return g(Ln);if(e=="(")return g(V(")"),Ee(co,")"),B,pe)}function co(e){if(e=="variable")return g()}function Kt(e,n){if(e=="variable"&&/[A-Z]/.test(n.charAt(0)))return Ut(n),g();if(e=="variable"||e=="property"||e=="."||n=="*")return g(Kt)}function uo(e,n){if(e=="variable"&&/[A-Z]/.test(n.charAt(0)))return Ut(n),g();if(e=="type"&&/[A-Z]/.test(n.charAt(0)))return g()}function so(e){return e==":"?g(B,pe):me(ue,Y(";"),B)}function fo(e){if(e=="variable")return F.marked="property",g()}function po(e){if(e=="variable"&&(F.marked="property"),Wt.hasOwnProperty(e))return g(Y(":"),re)}function Ee(e,n){function t(r){return r==","?g(e,t):r==n?g():g(Y(n))}return function(r){return r==n?g():me(e,t)}}function $n(e){return e=="}"?g():me(pe,$n)}function Nn(e,n){return e=="variable"?(on(n),g(an,Ht)):g()}function Ht(e,n){if(n=="=")return g(re,Ht);if(e==",")return g(Nn)}function mo(e,n){return e=="variable"?(on(n),g(ho,re)):me()}function ho(e,n){if(n=="in")return g()}function Be(e,n){if(e=="variable"||e=="type")return on(n),g(Be);if(n=="new")return g(Be);if(e=="(")return g(V(")"),Dn,Ee(Zt,")"),B,an,pe,rn)}function an(e){if(e==":")return g(go)}function go(e){if(e=="type"||e=="variable")return g();if(e=="{")return g(V("}"),Ee(bo,"}"),B)}function bo(e){if(e=="variable")return g(an)}function Zt(e,n){if(e=="variable")return on(n),g(an)}var vo={name:"haxe",startState:function(e){var n=["Int","Float","String","Void","Std","Bool","Dynamic","Array"],t={tokenize:tn,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new jt(-e,0,"block",!1),importedtypes:n,context:null,indented:0};return t},token:function(e,n){if(e.sol()&&(n.lexical.hasOwnProperty("align")||(n.lexical.align=!1),n.indented=e.indentation()),e.eatSpace())return null;var t=n.tokenize(e,n);return J=="comment"?t:(n.reAllowed=!!(J=="operator"||J=="keyword c"||J.match(/^[\[{}\(,;:]$/)),n.kwAllowed=J!=".",oo(n,t,J,Bt,e))},indent:function(e,n,t){if(e.tokenize!=tn)return 0;var r=n&&n.charAt(0),i=e.lexical;i.type=="stat"&&r=="}"&&(i=i.prev);var o=i.type,a=r==o;return o=="vardef"?i.indented+4:o=="form"&&r=="{"?i.indented:o=="stat"||o=="form"?i.indented+t.unit:i.info=="switch"&&!a?i.indented+(/^(?:case|default)\b/.test(n)?t.unit:2*t.unit):i.align?i.column+(a?0:1):i.indented+(a?0:t.unit)},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}};function Mn(e,n,t){return n(t),t(e,n)}var yo=/[a-z_]/,ko=/[A-Z]/,Fn=/\d/,_o=/[0-9A-Fa-f]/,xo=/[0-7]/,Gt=/[a-z_A-Z0-9'\xa1-\uffff]/,qn=/[-!#$%&*+.\/<=>?@\\^|~:]/,wo=/[(),;[\]`{}]/,Xt=/[ \t\v\f]/;function Te(e,n){if(e.eatWhile(Xt))return null;var t=e.next();if(wo.test(t)){if(t=="{"&&e.eat("-")){var r="comment";return e.eat("#")&&(r="meta"),Mn(e,n,Jt(r,1))}return null}if(t=="'")return e.eat("\\"),e.next(),e.eat("'")?"string":"error";if(t=='"')return Mn(e,n,Yt);if(ko.test(t))return e.eatWhile(Gt),e.eat(".")?"qualifier":"type";if(yo.test(t))return e.eatWhile(Gt),"variable";if(Fn.test(t)){if(t=="0"){if(e.eat(/[xX]/))return e.eatWhile(_o),"integer";if(e.eat(/[oO]/))return e.eatWhile(xo),"number"}e.eatWhile(Fn);var r="number";return e.match(/^\.\d+/)&&(r="number"),e.eat(/[eE]/)&&(r="number",e.eat(/[-+]/),e.eatWhile(Fn)),r}return t=="."&&e.eat(".")?"keyword":qn.test(t)?t=="-"&&e.eat(/-/)&&(e.eatWhile(/-/),!e.eat(qn))?(e.skipToEnd(),"comment"):(e.eatWhile(qn),"variable"):"error"}function Jt(e,n){return n==0?Te:function(t,r){for(var i=n;!t.eol();){var o=t.next();if(o=="{"&&t.eat("-"))++i;else if(o=="-"&&t.eat("}")&&(--i,i==0))return r(Te),e}return r(Jt(e,i)),e}}function Yt(e,n){for(;!e.eol();){var t=e.next();if(t=='"')return n(Te),"string";if(t=="\\"){if(e.eol()||e.eat(Xt))return n(So),"string";e.eat("&")||e.next()}}return n(Te),"error"}function So(e,n){return e.eat("\\")?Mn(e,n,Yt):(e.next(),n(Te),"error")}var Qt=function(){var e={};function n(t){return function(){for(var r=0;r","@","~","=>"),n("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<*","<=","<$>","<*>","=<<","==",">",">=",">>",">>=","^","^^","||","*","*>","**"),n("builtin")("Applicative","Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),n("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","pure","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3"),e}(),zo={name:"haskell",startState:function(){return{f:Te}},copyState:function(e){return{f:e.f}},token:function(e,n){var t=n.f(e,function(i){n.f=i}),r=e.current();return Qt.hasOwnProperty(r)?Qt[r]:t},languageData:{commentTokens:{line:"--",block:{open:"{-",close:"-}"}}}};function ye(e,n,t){return typeof t>"u"&&(t=""),typeof n>"u"&&(n="\\b"),new RegExp("^"+t+"(("+e.join(")|(")+"))"+n)}var Eo="\\\\[0-7]{1,3}",To="\\\\x[A-Fa-f0-9]{1,2}",Co=`\\\\[abefnrtv0%?'"\\\\]`,Io="([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])",tr=["[<>]:","[<>=]=","<<=?",">>>?=?","=>","--?>","<--[->]?","\\/\\/","\\.{2,3}","[\\.\\\\%*+\\-<>!\\/^|&]=?","\\?","\\$","~",":"],Ao=ye(["[<>]:","[<>=]=","[!=]==","<<=?",">>>?=?","=>?","--?>","<--[->]?","\\/\\/","[\\\\%*+\\-<>!\\/^|&\\u00F7\\u22BB]=?","\\?","\\$","~",":","\\u00D7","\\u2208","\\u2209","\\u220B","\\u220C","\\u2218","\\u221A","\\u221B","\\u2229","\\u222A","\\u2260","\\u2264","\\u2265","\\u2286","\\u2288","\\u228A","\\u22C5","\\b(in|isa)\\b(?!.?\\()"],""),Oo=/^[;,()[\]{}]/,Ro=/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/,Po=ye([Eo,To,Co,Io],"'"),Do=["begin","function","type","struct","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"],Lo=["end","else","elseif","catch","finally"],rr=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","where","macro","module","baremodule","struct","type","mutable","immutable","quote","typealias","abstract","primitive","bitstype"],ir=["true","false","nothing","NaN","Inf"],$o=ye(Do),No=ye(Lo),Fo=ye(rr),qo=ye(ir),Mo=/^@[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,Bo=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,Wo=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/,jo=ye(tr,"","@"),Uo=ye(tr,"",":");function er(e){return e.nestedArrays>0}function Vo(e){return e.nestedGenerators>0}function nr(e,n){return typeof n>"u"&&(n=0),e.scopes.length<=n?null:e.scopes[e.scopes.length-(n+1)]}function Ce(e,n){if(e.match("#=",!1))return n.tokenize=Ho,n.tokenize(e,n);var t=n.leavingExpr;if(e.sol()&&(t=!1),n.leavingExpr=!1,t&&e.match(/^'+/))return"operator";if(e.match(/\.{4,}/))return"error";if(e.match(/\.{1,3}/))return"operator";if(e.eatSpace())return null;var r=e.peek();if(r==="#")return e.skipToEnd(),"comment";if(r==="["&&(n.scopes.push("["),n.nestedArrays++),r==="("&&(n.scopes.push("("),n.nestedGenerators++),er(n)&&r==="]"){for(;n.scopes.length&&nr(n)!=="[";)n.scopes.pop();n.scopes.pop(),n.nestedArrays--,n.leavingExpr=!0}if(Vo(n)&&r===")"){for(;n.scopes.length&&nr(n)!=="(";)n.scopes.pop();n.scopes.pop(),n.nestedGenerators--,n.leavingExpr=!0}if(er(n)){if(n.lastToken=="end"&&e.match(":"))return"operator";if(e.match("end"))return"number"}var i;if((i=e.match($o,!1))&&n.scopes.push(i[0]),e.match(No,!1)&&n.scopes.pop(),e.match(/^::(?![:\$])/))return n.tokenize=Ko,n.tokenize(e,n);if(!t&&(e.match(Bo)||e.match(Uo)))return"builtin";if(e.match(Ao))return"operator";if(e.match(/^\.?\d/,!1)){var o=RegExp(/^im\b/),a=!1;if(e.match(/^0x\.[0-9a-f_]+p[\+\-]?[_\d]+/i)&&(a=!0),e.match(/^0x[0-9a-f_]+/i)&&(a=!0),e.match(/^0b[01_]+/i)&&(a=!0),e.match(/^0o[0-7_]+/i)&&(a=!0),e.match(/^(?:(?:\d[_\d]*)?\.(?!\.)(?:\d[_\d]*)?|\d[_\d]*\.(?!\.)(?:\d[_\d]*))?([Eef][\+\-]?[_\d]+)?/i)&&(a=!0),e.match(/^\d[_\d]*(e[\+\-]?\d+)?/i)&&(a=!0),a)return e.match(o),n.leavingExpr=!0,"number"}if(e.match("'"))return n.tokenize=Zo,n.tokenize(e,n);if(e.match(Wo))return n.tokenize=Go(e.current()),n.tokenize(e,n);if(e.match(Mo)||e.match(jo))return"meta";if(e.match(Oo))return null;if(e.match(Fo))return"keyword";if(e.match(qo))return"builtin";var s=n.isDefinition||n.lastToken=="function"||n.lastToken=="macro"||n.lastToken=="type"||n.lastToken=="struct"||n.lastToken=="immutable";return e.match(Ro)?s?e.peek()==="."?(n.isDefinition=!0,"variable"):(n.isDefinition=!1,"def"):(n.leavingExpr=!0,"variable"):(e.next(),"error")}function Ko(e,n){return e.match(/.*?(?=[,;{}()=\s]|$)/),e.match("{")?n.nestedParameters++:e.match("}")&&n.nestedParameters>0&&n.nestedParameters--,n.nestedParameters>0?e.match(/.*?(?={|})/)||e.next():n.nestedParameters==0&&(n.tokenize=Ce),"builtin"}function Ho(e,n){return e.match("#=")&&n.nestedComments++,e.match(/.*?(?=(#=|=#))/)||e.skipToEnd(),e.match("=#")&&(n.nestedComments--,n.nestedComments==0&&(n.tokenize=Ce)),"comment"}function Zo(e,n){var t=!1,r;if(e.match(Po))t=!0;else if(r=e.match(/\\u([a-f0-9]{1,4})(?=')/i)){var i=parseInt(r[1],16);(i<=55295||i>=57344)&&(t=!0,e.next())}else if(r=e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var i=parseInt(r[1],16);i<=1114111&&(t=!0,e.next())}return t?(n.leavingExpr=!0,n.tokenize=Ce,"string"):(e.match(/^[^']+(?=')/)||e.skipToEnd(),e.match("'")&&(n.tokenize=Ce),"error")}function Go(e){e.substr(-3)==='"""'?e='"""':e.substr(-1)==='"'&&(e='"');function n(t,r){if(t.eat("\\"))t.next();else{if(t.match(e))return r.tokenize=Ce,r.leavingExpr=!0,"string";t.eat(/[`"]/)}return t.eatWhile(/[^\\`"]/),"string"}return n}var Qo={name:"julia",startState:function(){return{tokenize:Ce,scopes:[],lastToken:null,leavingExpr:!1,isDefinition:!1,nestedArrays:0,nestedComments:0,nestedGenerators:0,nestedParameters:0,firstParenPos:-1}},token:function(e,n){var t=n.tokenize(e,n),r=e.current();return r&&t&&(n.lastToken=r),t},indent:function(e,n,t){var r=0;return(n==="]"||n===")"||/^end\b/.test(n)||/^else/.test(n)||/^catch\b/.test(n)||/^elseif\b/.test(n)||/^finally/.test(n))&&(r=-1),(e.scopes.length+r)*t.unit},languageData:{indentOnInput:/^\s*(end|else|catch|finally)\b$/,commentTokens:{line:"#",block:{open:"#=",close:"=#"}},closeBrackets:{brackets:["(","[","{",'"']},autocomplete:rr.concat(ir)}};function Xo(e){return new RegExp("^(?:"+e.join("|")+")","i")}function ln(e){return new RegExp("^(?:"+e.join("|")+")$","i")}var Jo=ln(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),Yo=ln(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),ea=ln(["function","if","repeat","do","\\(","{"]),na=ln(["end","until","\\)","}"]),ta=Xo(["end","until","\\)","}","else","elseif"]);function or(e){for(var n=0;e.eat("=");)++n;return e.eat("["),n}function Bn(e,n){var t=e.next();return t=="-"&&e.eat("-")?e.eat("[")&&e.eat("[")?(n.cur=ar(or(e),"comment"))(e,n):(e.skipToEnd(),"comment"):t=='"'||t=="'"?(n.cur=ra(t))(e,n):t=="["&&/[\[=]/.test(e.peek())?(n.cur=ar(or(e),"string"))(e,n):/\d/.test(t)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(t)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function ar(e,n){return function(t,r){for(var i=null,o;(o=t.next())!=null;)if(i==null)o=="]"&&(i=0);else if(o=="=")++i;else if(o=="]"&&i==e){r.cur=Bn;break}else i=null;return n}}function ra(e){return function(n,t){for(var r=!1,i;(i=n.next())!=null&&!(i==e&&!r);)r=!r&&i=="\\";return r||(t.cur=Bn),"string"}}var ia={name:"lua",startState:function(){return{basecol:0,indentDepth:0,cur:Bn}},token:function(e,n){if(e.eatSpace())return null;var t=n.cur(e,n),r=e.current();return t=="variable"&&(Yo.test(r)?t="keyword":Jo.test(r)&&(t="builtin")),t!="comment"&&t!="string"&&(ea.test(r)?++n.indentDepth:na.test(r)&&--n.indentDepth),t},indent:function(e,n,t){var r=ta.test(n);return e.basecol+t.unit*(e.indentDepth-(r?1:0))},languageData:{indentOnInput:/^\s*(?:end|until|else|\)|\})$/,commentTokens:{line:"--",block:{open:"--[[",close:"]]--"}}}};function Wn(e){var n={as:"keyword",do:"keyword",else:"keyword",end:"keyword",exception:"keyword",fun:"keyword",functor:"keyword",if:"keyword",in:"keyword",include:"keyword",let:"keyword",of:"keyword",open:"keyword",rec:"keyword",struct:"keyword",then:"keyword",type:"keyword",val:"keyword",while:"keyword",with:"keyword"},t=e.extraWords||{};for(var r in t)t.hasOwnProperty(r)&&(n[r]=e.extraWords[r]);var i=[];for(var o in n)i.push(o);function a(S,c){var f=S.next();if(f==='"')return c.tokenize=s,c.tokenize(S,c);if(f==="{"&&S.eat("|"))return c.longString=!0,c.tokenize=z,c.tokenize(S,c);if(f==="("&&S.match(/^\*(?!\))/))return c.commentLevel++,c.tokenize=_,c.tokenize(S,c);if(f==="~"||f==="?")return S.eatWhile(/\w/),"variableName.special";if(f==="`")return S.eatWhile(/\w/),"quote";if(f==="/"&&e.slashComments&&S.eat("/"))return S.skipToEnd(),"comment";if(/\d/.test(f))return f==="0"&&S.eat(/[bB]/)&&S.eatWhile(/[01]/),f==="0"&&S.eat(/[xX]/)&&S.eatWhile(/[0-9a-fA-F]/),f==="0"&&S.eat(/[oO]/)?S.eatWhile(/[0-7]/):(S.eatWhile(/[\d_]/),S.eat(".")&&S.eatWhile(/[\d]/),S.eat(/[eE]/)&&S.eatWhile(/[\d\-+]/)),"number";if(/[+\-*&%=<>!?|@\.~:]/.test(f))return"operator";if(/[\w\xa1-\uffff]/.test(f)){S.eatWhile(/[\w\xa1-\uffff]/);var y=S.current();return n.hasOwnProperty(y)?n[y]:"variable"}return null}function s(S,c){for(var f,y=!1,R=!1;(f=S.next())!=null;){if(f==='"'&&!R){y=!0;break}R=!R&&f==="\\"}return y&&!R&&(c.tokenize=a),"string"}function _(S,c){for(var f,y;c.commentLevel>0&&(y=S.next())!=null;)f==="("&&y==="*"&&c.commentLevel++,f==="*"&&y===")"&&c.commentLevel--,f=y;return c.commentLevel<=0&&(c.tokenize=a),"comment"}function z(S,c){for(var f,y;c.longString&&(y=S.next())!=null;)f==="|"&&y==="}"&&(c.longString=!1),f=y;return c.longString||(c.tokenize=a),"string"}return{startState:function(){return{tokenize:a,commentLevel:0,longString:!1}},token:function(S,c){return S.eatSpace()?null:c.tokenize(S,c)},languageData:{autocomplete:i,commentTokens:{line:e.slashComments?"//":void 0,block:{open:"(*",close:"*)"}}}}}var oa=Wn({name:"ocaml",extraWords:{and:"keyword",assert:"keyword",begin:"keyword",class:"keyword",constraint:"keyword",done:"keyword",downto:"keyword",external:"keyword",function:"keyword",initializer:"keyword",lazy:"keyword",match:"keyword",method:"keyword",module:"keyword",mutable:"keyword",new:"keyword",nonrec:"keyword",object:"keyword",private:"keyword",sig:"keyword",to:"keyword",try:"keyword",value:"keyword",virtual:"keyword",when:"keyword",raise:"builtin",failwith:"builtin",true:"builtin",false:"builtin",asr:"builtin",land:"builtin",lor:"builtin",lsl:"builtin",lsr:"builtin",lxor:"builtin",mod:"builtin",or:"builtin",raise_notrace:"builtin",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin",int:"type",float:"type",bool:"type",char:"type",string:"type",unit:"type",List:"builtin"}}),aa=Wn({name:"fsharp",extraWords:{abstract:"keyword",assert:"keyword",base:"keyword",begin:"keyword",class:"keyword",default:"keyword",delegate:"keyword","do!":"keyword",done:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",extern:"keyword",finally:"keyword",for:"keyword",function:"keyword",global:"keyword",inherit:"keyword",inline:"keyword",interface:"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",match:"keyword",member:"keyword",module:"keyword",mutable:"keyword",namespace:"keyword",new:"keyword",null:"keyword",override:"keyword",private:"keyword",public:"keyword","return!":"keyword",return:"keyword",select:"keyword",static:"keyword",to:"keyword",try:"keyword",upcast:"keyword","use!":"keyword",use:"keyword",void:"keyword",when:"keyword","yield!":"keyword",yield:"keyword",atomic:"keyword",break:"keyword",checked:"keyword",component:"keyword",const:"keyword",constraint:"keyword",constructor:"keyword",continue:"keyword",eager:"keyword",event:"keyword",external:"keyword",fixed:"keyword",method:"keyword",mixin:"keyword",object:"keyword",parallel:"keyword",process:"keyword",protected:"keyword",pure:"keyword",sealed:"keyword",tailcall:"keyword",trait:"keyword",virtual:"keyword",volatile:"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin",Option:"builtin",int:"builtin",string:"builtin",not:"builtin",true:"builtin",false:"builtin",raise:"builtin",failwith:"builtin"},slashComments:!0}),la=Wn({name:"sml",extraWords:{abstype:"keyword",and:"keyword",andalso:"keyword",case:"keyword",datatype:"keyword",fn:"keyword",handle:"keyword",infix:"keyword",infixr:"keyword",local:"keyword",nonfix:"keyword",op:"keyword",orelse:"keyword",raise:"keyword",withtype:"keyword",eqtype:"keyword",sharing:"keyword",sig:"keyword",signature:"keyword",structure:"keyword",where:"keyword",true:"keyword",false:"keyword",int:"builtin",real:"builtin",string:"builtin",char:"builtin",bool:"builtin"},slashComments:!0});function jn(e){for(var n={},t=e.split(" "),r=0;r*\/]/.test(r)?ie(null,"select-op"):/[;{}:\[\]]/.test(r)?ie(null,r):(e.eatWhile(/[\w\\\-]/),ie("variable","variable"))}function lr(e,n){for(var t=!1,r;(r=e.next())!=null;){if(t&&r=="/"){n.tokenize=cn;break}t=r=="*"}return ie("comment","comment")}function cr(e,n){for(var t=0,r;(r=e.next())!=null;){if(t>=2&&r==">"){n.tokenize=cn;break}t=r=="-"?t+1:0}return ie("comment","comment")}function da(e){return function(n,t){for(var r=!1,i;(i=n.next())!=null&&!(i==e&&!r);)r=!r&&i=="\\";return r||(t.tokenize=cn),ie("string","string")}}var fa={name:"nginx",startState:function(){return{tokenize:cn,baseIndent:0,stack:[]}},token:function(e,n){if(e.eatSpace())return null;ke=null;var t=n.tokenize(e,n),r=n.stack[n.stack.length-1];return ke=="hash"&&r=="rule"?t="atom":t=="variable"&&(r=="rule"?t="number":(!r||r=="@media{")&&(t="tag")),r=="rule"&&/^[\{\};]$/.test(ke)&&n.stack.pop(),ke=="{"?r=="@media"?n.stack[n.stack.length-1]="@media{":n.stack.push("{"):ke=="}"?n.stack.pop():ke=="@media"?n.stack.push("@media"):r=="{"&&ke!="comment"&&n.stack.push("rule"),t},indent:function(e,n,t){var r=e.stack.length;return/^\}/.test(n)&&(r-=e.stack[e.stack.length-1]=="rule"?2:1),e.baseIndent+r*t.unit},languageData:{indentOnInput:/^\s*\}$/}};function Un(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var pa=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),ma=new RegExp("^[\\(\\[\\{\\},:=;\\.]"),ha=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),ga=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),ba=new RegExp("^((>>=)|(<<=))"),va=new RegExp("^[\\]\\)]"),ya=new RegExp("^[_A-Za-z\xA1-\uFFFF][_A-Za-z0-9\xA1-\uFFFF]*"),ka=Un(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),_a=Un(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);function ur(e,n){return!e.sol()&&e.peek()==="'"?(e.next(),n.tokenize=Ie,"operator"):(n.tokenize=Ie,Ie(e,n))}function xa(e,n){return e.match(/^.*%}/)?(n.tokenize=Ie,"comment"):(e.skipToEnd(),"comment")}function Ie(e,n){if(e.eatSpace())return null;if(e.match("%{"))return n.tokenize=xa,e.skipToEnd(),"comment";if(e.match(/^[%#]/))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return e.tokenize=Ie,"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)||e.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}if(e.match(Un(["nan","NaN","inf","Inf"])))return"number";var t=e.match(/^"(?:[^"]|"")*("|$)/)||e.match(/^'(?:[^']|'')*('|$)/);return t?t[1]?"string":"error":e.match(_a)?"keyword":e.match(ka)?"builtin":e.match(ya)?"variable":e.match(pa)||e.match(ha)?"operator":e.match(ma)||e.match(ga)||e.match(ba)?null:e.match(va)?(n.tokenize=ur,null):(e.next(),"error")}var wa={name:"octave",startState:function(){return{tokenize:Ie}},token:function(e,n){var t=n.tokenize(e,n);return(t==="number"||t==="variable")&&(n.tokenize=ur),t},languageData:{commentTokens:{line:"%"}}};function K(e,n){return e.string.charAt(e.pos+(n||0))}function sr(e,n){if(n){var t=e.pos-n;return e.string.substr(t>=0?t:0,n)}else return e.string.substr(0,e.pos-1)}function Vn(e,n){var t=e.string.length,r=t-e.pos+1;return e.string.substr(e.pos,n&&n=(r=e.string.length-1)?e.pos=r:e.pos=t}var We={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,if:[1,1],elsif:[1,1],else:[1,1],while:[1,1],unless:[1,1],for:[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,break:1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,continue:[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,default:1,defined:1,delete:1,die:1,do:1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,goto:1,grep:1,hex:1,import:1,index:1,int:1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,new:1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,package:1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,return:1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},P="string.special",D=/[goseximacplud]/;function w(e,n,t,r,i){return n.chain=null,n.style=null,n.tail=null,n.tokenize=function(o,a){for(var s=!1,_,z=0;_=o.next();){if(_===t[z]&&!s)return t[++z]!==void 0?(a.chain=t[z],a.style=r,a.tail=i):i&&o.eatWhile(i),a.tokenize=un,r;s=!s&&_=="\\"}return r},n.tokenize(e,n)}function Kn(e,n,t){return n.tokenize=function(r,i){return r.string==t&&(i.tokenize=un),r.skipToEnd(),"string"},n.tokenize(e,n)}function un(e,n){if(e.eatSpace())return null;if(n.chain)return w(e,n,n.chain,n.style,n.tail);if(e.match(/^(\-?((\d[\d_]*)?\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F_]+|0b[01_]+|\d[\d_]*(e[+-]?\d+)?)/))return"number";if(e.match(/^<<(?=[_a-zA-Z])/))return e.eatWhile(/\w/),Kn(e,n,e.current().substr(2));if(e.sol()&&e.match(/^\=item(?!\w)/))return Kn(e,n,"=cut");var t=e.next();if(t=='"'||t=="'"){if(sr(e,3)=="<<"+t){var r=e.pos;e.eatWhile(/\w/);var i=e.current().substr(1);if(i&&e.eat(t))return Kn(e,n,i);e.pos=r}return w(e,n,[t],"string")}if(t=="q"){var o=K(e,-2);if(!(o&&/\w/.test(o))){if(o=K(e,0),o=="x"){if(o=K(e,1),o=="(")return q(e,2),w(e,n,[")"],P,D);if(o=="[")return q(e,2),w(e,n,["]"],P,D);if(o=="{")return q(e,2),w(e,n,["}"],P,D);if(o=="<")return q(e,2),w(e,n,[">"],P,D);if(/[\^'"!~\/]/.test(o))return q(e,1),w(e,n,[e.eat(o)],P,D)}else if(o=="q"){if(o=K(e,1),o=="(")return q(e,2),w(e,n,[")"],"string");if(o=="[")return q(e,2),w(e,n,["]"],"string");if(o=="{")return q(e,2),w(e,n,["}"],"string");if(o=="<")return q(e,2),w(e,n,[">"],"string");if(/[\^'"!~\/]/.test(o))return q(e,1),w(e,n,[e.eat(o)],"string")}else if(o=="w"){if(o=K(e,1),o=="(")return q(e,2),w(e,n,[")"],"bracket");if(o=="[")return q(e,2),w(e,n,["]"],"bracket");if(o=="{")return q(e,2),w(e,n,["}"],"bracket");if(o=="<")return q(e,2),w(e,n,[">"],"bracket");if(/[\^'"!~\/]/.test(o))return q(e,1),w(e,n,[e.eat(o)],"bracket")}else if(o=="r"){if(o=K(e,1),o=="(")return q(e,2),w(e,n,[")"],P,D);if(o=="[")return q(e,2),w(e,n,["]"],P,D);if(o=="{")return q(e,2),w(e,n,["}"],P,D);if(o=="<")return q(e,2),w(e,n,[">"],P,D);if(/[\^'"!~\/]/.test(o))return q(e,1),w(e,n,[e.eat(o)],P,D)}else if(/[\^'"!~\/(\[{<]/.test(o)){if(o=="(")return q(e,1),w(e,n,[")"],"string");if(o=="[")return q(e,1),w(e,n,["]"],"string");if(o=="{")return q(e,1),w(e,n,["}"],"string");if(o=="<")return q(e,1),w(e,n,[">"],"string");if(/[\^'"!~\/]/.test(o))return w(e,n,[e.eat(o)],"string")}}}if(t=="m"){var o=K(e,-2);if(!(o&&/\w/.test(o))&&(o=e.eat(/[(\[{<\^'"!~\/]/),o)){if(/[\^'"!~\/]/.test(o))return w(e,n,[o],P,D);if(o=="(")return w(e,n,[")"],P,D);if(o=="[")return w(e,n,["]"],P,D);if(o=="{")return w(e,n,["}"],P,D);if(o=="<")return w(e,n,[">"],P,D)}}if(t=="s"){var o=/[\/>\]})\w]/.test(K(e,-2));if(!o&&(o=e.eat(/[(\[{<\^'"!~\/]/),o))return o=="["?w(e,n,["]","]"],P,D):o=="{"?w(e,n,["}","}"],P,D):o=="<"?w(e,n,[">",">"],P,D):o=="("?w(e,n,[")",")"],P,D):w(e,n,[o,o],P,D)}if(t=="y"){var o=/[\/>\]})\w]/.test(K(e,-2));if(!o&&(o=e.eat(/[(\[{<\^'"!~\/]/),o))return o=="["?w(e,n,["]","]"],P,D):o=="{"?w(e,n,["}","}"],P,D):o=="<"?w(e,n,[">",">"],P,D):o=="("?w(e,n,[")",")"],P,D):w(e,n,[o,o],P,D)}if(t=="t"){var o=/[\/>\]})\w]/.test(K(e,-2));if(!o&&(o=e.eat("r"),o&&(o=e.eat(/[(\[{<\^'"!~\/]/),o)))return o=="["?w(e,n,["]","]"],P,D):o=="{"?w(e,n,["}","}"],P,D):o=="<"?w(e,n,[">",">"],P,D):o=="("?w(e,n,[")",")"],P,D):w(e,n,[o,o],P,D)}if(t=="`")return w(e,n,[t],"builtin");if(t=="/")return/~\s*$/.test(sr(e))?w(e,n,[t],P,D):"operator";if(t=="$"){var r=e.pos;if(e.eatWhile(/\d/)||e.eat("{")&&e.eatWhile(/\d/)&&e.eat("}"))return"builtin";e.pos=r}if(/[$@%]/.test(t)){var r=e.pos;if(e.eat("^")&&e.eat(/[A-Z]/)||!/[@$%&]/.test(K(e,-2))&&e.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var o=e.current();if(We[o])return"builtin"}e.pos=r}if(/[$@%&]/.test(t)&&(e.eatWhile(/[\w$]/)||e.eat("{")&&e.eatWhile(/[\w$]/)&&e.eat("}"))){var o=e.current();return We[o]?"builtin":"variable"}if(t=="#"&&K(e,-2)!="$")return e.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(t)){var r=e.pos;if(e.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),We[e.current()])return"operator";e.pos=r}if(t=="_"&&e.pos==1){if(Vn(e,6)=="_END__")return w(e,n,["\0"],"comment");if(Vn(e,7)=="_DATA__")return w(e,n,["\0"],"builtin");if(Vn(e,7)=="_C__")return w(e,n,["\0"],"string")}if(/\w/.test(t)){var r=e.pos;if(K(e,-2)=="{"&&(K(e,0)=="}"||e.eatWhile(/\w/)&&K(e,0)=="}"))return"string";e.pos=r}if(/[A-Z]/.test(t)){var a=K(e,-2),r=e.pos;if(e.eatWhile(/[A-Z_]/),/[\da-z]/.test(K(e,0)))e.pos=r;else{var o=We[e.current()];return o?(o[1]&&(o=o[0]),a!=":"?o==1?"keyword":o==2?"def":o==3?"atom":o==4?"operator":o==5?"builtin":"meta":"meta"):"meta"}}if(/[a-zA-Z_]/.test(t)){var a=K(e,-2);e.eatWhile(/\w/);var o=We[e.current()];return o?(o[1]&&(o=o[0]),a!=":"?o==1?"keyword":o==2?"def":o==3?"atom":o==4?"operator":o==5?"builtin":"meta":"meta"):"meta"}return null}var Sa={name:"perl",startState:function(){return{tokenize:un,chain:null,style:null,tail:null}},token:function(e,n){return(n.tokenize||un)(e,n)},languageData:{commentTokens:{line:"#"},wordChars:"$"}};function za(e){for(var n={},t=e.split(" "),r=0;r!?|\/]/;function Ca(e,n){var t=e.next();if(t=="#"&&n.startOfLine)return e.skipToEnd(),"meta";if(t=='"'||t=="'")return n.tokenize=Ia(t),n.tokenize(e,n);if(t=="("&&e.eat("*"))return n.tokenize=fr,fr(e,n);if(t=="{")return n.tokenize=pr,pr(e,n);if(/[\[\]\(\),;\:\.]/.test(t))return null;if(/\d/.test(t))return e.eatWhile(/[\w\.]/),"number";if(t=="/"&&e.eat("/"))return e.skipToEnd(),"comment";if(dr.test(t))return e.eatWhile(dr),"operator";e.eatWhile(/[\w\$_]/);var r=e.current().toLowerCase();return Ea.propertyIsEnumerable(r)?"keyword":Ta.propertyIsEnumerable(r)?"atom":"variable"}function Ia(e){return function(n,t){for(var r=!1,i,o=!1;(i=n.next())!=null;){if(i==e&&!r){o=!0;break}r=!r&&i=="\\"}return(o||!r)&&(t.tokenize=null),"string"}}function fr(e,n){for(var t=!1,r;r=e.next();){if(r==")"&&t){n.tokenize=null;break}t=r=="*"}return"comment"}function pr(e,n){for(var t;t=e.next();)if(t=="}"){n.tokenize=null;break}return"comment"}var Aa={name:"pascal",startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var t=(n.tokenize||Ca)(e,n);return t=="comment"||t=="meta",t},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{block:{open:"(*",close:"*)"}}}};function Ae(e,n){n=n||{};for(var t=n.prefix!==void 0?n.prefix:"^",r=n.suffix!==void 0?n.suffix:"\\b",i=0;i/,La=Ae([Pa,Da],{suffix:""}),$a=/^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i,Na=/^[A-Za-z\_][A-Za-z\-\_\d]*\b/,Fa=/[A-Z]:|%|\?/i,qa=Ae([/Add-(Computer|Content|History|Member|PSSnapin|Type)/,/Checkpoint-Computer/,/Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/,/Compare-Object/,/Complete-Transaction/,/Connect-PSSession/,/ConvertFrom-(Csv|Json|SecureString|StringData)/,/Convert-Path/,/ConvertTo-(Csv|Html|Json|SecureString|Xml)/,/Copy-Item(Property)?/,/Debug-Process/,/Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/Disconnect-PSSession/,/Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/(Enter|Exit)-PSSession/,/Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/,/ForEach-Object/,/Format-(Custom|List|Table|Wide)/,new RegExp("Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)"),/Group-Object/,/Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/,/ImportSystemModules/,/Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/,/Join-Path/,/Limit-EventLog/,/Measure-(Command|Object)/,/Move-Item(Property)?/,new RegExp("New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)"),/Out-(Default|File|GridView|Host|Null|Printer|String)/,/Pause/,/(Pop|Push)-Location/,/Read-Host/,/Receive-(Job|PSSession)/,/Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/,/Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/,/Rename-(Computer|Item(Property)?)/,/Reset-ComputerMachinePassword/,/Resolve-Path/,/Restart-(Computer|Service)/,/Restore-Computer/,/Resume-(Job|Service)/,/Save-Help/,/Select-(Object|String|Xml)/,/Send-MailMessage/,new RegExp("Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)"),/Show-(Command|ControlPanelItem|EventLog)/,/Sort-Object/,/Split-Path/,/Start-(Job|Process|Service|Sleep|Transaction|Transcript)/,/Stop-(Computer|Job|Process|Service|Transcript)/,/Suspend-(Job|Service)/,/TabExpansion2/,/Tee-Object/,/Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/,/Trace-Command/,/Unblock-File/,/Undo-Transaction/,/Unregister-(Event|PSSessionConfiguration)/,/Update-(FormatData|Help|List|TypeData)/,/Use-Transaction/,/Wait-(Event|Job|Process)/,/Where-Object/,/Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/,/cd|help|mkdir|more|oss|prompt/,/ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/,/echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/,/group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/,/measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/,/rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/,/sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/],{prefix:"",suffix:""}),Ma=Ae([/[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/,/FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/,/MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/,/PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/,/PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/,/WarningPreference|WhatIfPreference/,/Event|EventArgs|EventSubscriber|Sender/,/Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/,/true|false|null/],{prefix:"\\$",suffix:""}),Ba=Ae([Fa,qa,Ma],{suffix:br}),mr={keyword:Oa,number:$a,operator:La,builtin:Ba,punctuation:Ra,variable:Na};function he(e,n){var t=n.returnStack[n.returnStack.length-1];if(t&&t.shouldReturnFrom(n))return n.tokenize=t.tokenize,n.returnStack.pop(),n.tokenize(e,n);if(e.eatSpace())return null;if(e.eat("("))return n.bracketNesting+=1,"punctuation";if(e.eat(")"))return n.bracketNesting-=1,"punctuation";for(var r in mr)if(e.match(mr[r]))return r;var i=e.next();if(i==="'")return Wa(e,n);if(i==="$")return Zn(e,n);if(i==='"')return vr(e,n);if(i==="<"&&e.eat("#"))return n.tokenize=hr,hr(e,n);if(i==="#")return e.skipToEnd(),"comment";if(i==="@"){var o=e.eat(/["']/);if(o&&e.eol())return n.tokenize=sn,n.startQuote=o[0],sn(e,n);if(e.eol())return"error";if(e.peek().match(/[({]/))return"punctuation";if(e.peek().match(Hn))return Zn(e,n)}return"error"}function Wa(e,n){for(var t;(t=e.peek())!=null;)if(e.next(),t==="'"&&!e.eat("'"))return n.tokenize=he,"string";return"error"}function vr(e,n){for(var t;(t=e.peek())!=null;){if(t==="$")return n.tokenize=ja,"string";if(e.next(),t==="`"){e.next();continue}if(t==='"'&&!e.eat('"'))return n.tokenize=he,"string"}return"error"}function ja(e,n){return yr(e,n,vr)}function Ua(e,n){return n.tokenize=sn,n.startQuote='"',sn(e,n)}function Va(e,n){return yr(e,n,Ua)}function yr(e,n,t){if(e.match("$(")){var r=n.bracketNesting;return n.returnStack.push({shouldReturnFrom:function(i){return i.bracketNesting===r},tokenize:t}),n.tokenize=he,n.bracketNesting+=1,"punctuation"}else return e.next(),n.returnStack.push({shouldReturnFrom:function(){return!0},tokenize:t}),n.tokenize=Zn,n.tokenize(e,n)}function hr(e,n){for(var t=!1,r;(r=e.next())!=null;){if(t&&r==">"){n.tokenize=he;break}t=r==="#"}return"comment"}function Zn(e,n){var t=e.peek();return e.eat("{")?(n.tokenize=gr,gr(e,n)):t!=null&&t.match(Hn)?(e.eatWhile(Hn),n.tokenize=he,"variable"):(n.tokenize=he,"error")}function gr(e,n){for(var t;(t=e.next())!=null;)if(t==="}"){n.tokenize=he;break}return"variable"}function sn(e,n){var t=n.startQuote;if(e.sol()&&e.match(new RegExp(t+"@")))n.tokenize=he;else if(t==='"')for(;!e.eol();){var r=e.peek();if(r==="$")return n.tokenize=Va,"string";e.next(),r==="`"&&e.next()}else e.skipToEnd();return"string"}var Ka={name:"powershell",startState:function(){return{returnStack:[],bracketNesting:0,tokenize:he}},token:function(e,n){return n.tokenize(e,n)},languageData:{commentTokens:{line:"#",block:{open:"<#",close:"#>"}}}};var Ha={name:"properties",token:function(e,n){var t=e.sol()||n.afterSection,r=e.eol();if(n.afterSection=!1,t&&(n.nextMultiline?(n.inMultiline=!0,n.nextMultiline=!1):n.position="def"),r&&!n.nextMultiline&&(n.inMultiline=!1,n.position="def"),t)for(;e.eatSpace(););var i=e.next();return t&&(i==="#"||i==="!"||i===";")?(n.position="comment",e.skipToEnd(),"comment"):t&&i==="["?(n.afterSection=!0,e.skipTo("]"),e.eat("]"),"header"):i==="="||i===":"?(n.position="quote",null):(i==="\\"&&n.position==="quote"&&e.eol()&&(n.nextMultiline=!0),n.position)},startState:function(){return{position:"def",nextMultiline:!1,inMultiline:!1,afterSection:!1}}};function Gn(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var Za=Gn(["and","or","not","is"]),kr=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],_r=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function oe(e){return e.scopes[e.scopes.length-1]}function xr(e){for(var n="error",t=e.delimiters||e.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,r=[e.singleOperators,e.doubleOperators,e.doubleDelimiters,e.tripleDelimiters,e.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],i=0;ix?d(l,u):L0&&E(l,u)&&(m+=" "+n),m}}return R(l,u)}function R(l,u,A){if(l.eatSpace())return null;if(!A&&l.match(/^#.*/))return"comment";if(l.match(/^[0-9\.]/,!1)){var x=!1;if(l.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(x=!0),l.match(/^[\d_]+\.\d*/)&&(x=!0),l.match(/^\.\d+/)&&(x=!0),x)return l.eat(/J/i),"number";var L=!1;if(l.match(/^0x[0-9a-f_]+/i)&&(L=!0),l.match(/^0b[01_]+/i)&&(L=!0),l.match(/^0o[0-7_]+/i)&&(L=!0),l.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(l.eat(/J/i),L=!0),l.match(/^0(?![\dx])/i)&&(L=!0),L)return l.eat(/L/i),"number"}if(l.match(S)){var m=l.current().toLowerCase().indexOf("f")!==-1;return m?(u.tokenize=Q(l.current(),u.tokenize),u.tokenize(l,u)):(u.tokenize=U(l.current(),u.tokenize),u.tokenize(l,u))}for(var p=0;p=0;)l=l.substr(1);var A=l.length==1,x="string";function L(p){return function(T,k){var $=R(T,k,!0);return $=="punctuation"&&(T.current()=="{"?k.tokenize=L(p+1):T.current()=="}"&&(p>1?k.tokenize=L(p-1):k.tokenize=m)),$}}function m(p,T){for(;!p.eol();)if(p.eatWhile(/[^'"\{\}\\]/),p.eat("\\")){if(p.next(),A&&p.eol())return x}else{if(p.match(l))return T.tokenize=u,x;if(p.match("{{"))return x;if(p.match("{",!1))return T.tokenize=L(0),p.current()?x:T.tokenize(p,T);if(p.match("}}"))return x;if(p.match("}"))return n;p.eat(/['"]/)}if(A){if(e.singleLineStringErrors)return n;T.tokenize=u}return x}return m.isString=!0,m}function U(l,u){for(;"rubf".indexOf(l.charAt(0).toLowerCase())>=0;)l=l.substr(1);var A=l.length==1,x="string";function L(m,p){for(;!m.eol();)if(m.eatWhile(/[^'"\\]/),m.eat("\\")){if(m.next(),A&&m.eol())return x}else{if(m.match(l))return p.tokenize=u,x;m.eat(/['"]/)}if(A){if(e.singleLineStringErrors)return n;p.tokenize=u}return x}return L.isString=!0,L}function d(l,u){for(;oe(u).type!="py";)u.scopes.pop();u.scopes.push({offset:oe(u).offset+l.indentUnit,type:"py",align:null})}function C(l,u,A){var x=l.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:l.column()+1;u.scopes.push({offset:u.indent+(o||l.indentUnit),type:A,align:x})}function E(l,u){for(var A=l.indentation();u.scopes.length>1&&oe(u).offset>A;){if(oe(u).type!="py")return!0;u.scopes.pop()}return oe(u).offset!=A}function I(l,u){l.sol()&&(u.beginningOfLine=!0,u.dedent=!1);var A=u.tokenize(l,u),x=l.current();if(u.beginningOfLine&&x=="@")return l.match(z,!1)?"meta":_?"operator":n;if(/\S/.test(x)&&(u.beginningOfLine=!1),(A=="variable"||A=="builtin")&&u.lastToken=="meta"&&(A="meta"),(x=="pass"||x=="return")&&(u.dedent=!0),x=="lambda"&&(u.lambda=!0),x==":"&&!u.lambda&&oe(u).type=="py"&&l.match(/^\s*(?:#|$)/,!1)&&d(l,u),x.length==1&&!/string|comment/.test(A)){var L="[({".indexOf(x);if(L!=-1&&C(l,u,"])}".slice(L,L+1)),L="])}".indexOf(x),L!=-1)if(oe(u).type==x)u.indent=u.scopes.pop().offset-(o||l.indentUnit);else return n}return u.dedent&&l.eol()&&oe(u).type=="py"&&u.scopes.length>1&&u.scopes.pop(),A}return{name:"python",startState:function(){return{tokenize:y,scopes:[{offset:0,type:"py",align:null}],indent:0,lastToken:null,lambda:!1,dedent:0}},token:function(l,u){var A=u.errorToken;A&&(u.errorToken=!1);var x=I(l,u);return x&&x!="comment"&&(u.lastToken=x=="keyword"||x=="punctuation"?l.current():x),x=="punctuation"&&(x=null),l.eol()&&u.lambda&&(u.lambda=!1),A?n:x},indent:function(l,u,A){if(l.tokenize!=y)return l.tokenize.isString?null:0;var x=oe(l),L=x.type==u.charAt(0)||x.type=="py"&&!l.dedent&&/^(else:|elif |except |finally:)/.test(u);return x.align!=null?x.align-(L?1:0):x.offset-(L?o||A.unit:0)},languageData:{autocomplete:kr.concat(_r).concat(["exec","print"]),indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,commentTokens:{line:"#"},closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""']}}}}var Ga=function(e){return e.split(" ")},Qa=xr({}),su=xr({extra_keywords:Ga("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")});function fn(e){for(var n={},t=0;t=!&|~$:]/,ae;function Yn(e,n){ae=null;var t=e.next();if(t=="#")return e.skipToEnd(),"comment";if(t=="0"&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if(t=="."&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(t))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if(t=="'"||t=='"')return n.tokenize=tl(t),"string";if(t=="`")return e.match(/[^`]+`/),"string.special";if(t=="."&&e.match(/.(?:[.]|\d+)/))return"keyword";if(/[a-zA-Z\.]/.test(t)){e.eatWhile(/[\w\.]/);var r=e.current();return Ja.propertyIsEnumerable(r)?"atom":el.propertyIsEnumerable(r)?(nl.propertyIsEnumerable(r)&&!e.match(/\s*if(\s+|$)/,!1)&&(ae="block"),"keyword"):Ya.propertyIsEnumerable(r)?"builtin":"variable"}else return t=="%"?(e.skipTo("%")&&e.next(),"variableName.special"):t=="<"&&e.eat("-")||t=="<"&&e.match("<-")||t=="-"&&e.match(/>>?/)||t=="="&&n.ctx.argList?"operator":wr.test(t)?(t=="$"||e.eatWhile(wr),"operator"):/[\(\){}\[\];]/.test(t)?(ae=t,t==";"?"punctuation":null):null}function tl(e){return function(n,t){if(n.eat("\\")){var r=n.next();return r=="x"?n.match(/^[a-f0-9]{2}/i):(r=="u"||r=="U")&&n.eat("{")&&n.skipTo("}")?n.next():r=="u"?n.match(/^[a-f0-9]{4}/i):r=="U"?n.match(/^[a-f0-9]{8}/i):/[0-7]/.test(r)&&n.match(/^[0-7]{1,2}/),"string.special"}else{for(var i;(i=n.next())!=null;){if(i==e){t.tokenize=Yn;break}if(i=="\\"){n.backUp(1);break}}return"string"}}}var Sr=1,Qn=2,Xn=4;function dn(e,n,t){e.ctx={type:n,indent:e.indent,flags:0,column:t.column(),prev:e.ctx}}function zr(e,n){var t=e.ctx;e.ctx={type:t.type,indent:t.indent,flags:t.flags|n,column:t.column,prev:t.prev}}function Jn(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}var rl={name:"r",startState:function(e){return{tokenize:Yn,ctx:{type:"top",indent:-e,flags:Qn},indent:0,afterIdent:!1}},token:function(e,n){if(e.sol()&&((n.ctx.flags&3)==0&&(n.ctx.flags|=Qn),n.ctx.flags&Xn&&Jn(n),n.indent=e.indentation()),e.eatSpace())return null;var t=n.tokenize(e,n);return t!="comment"&&(n.ctx.flags&Qn)==0&&zr(n,Sr),(ae==";"||ae=="{"||ae=="}")&&n.ctx.type=="block"&&Jn(n),ae=="{"?dn(n,"}",e):ae=="("?(dn(n,")",e),n.afterIdent&&(n.ctx.argList=!0)):ae=="["?dn(n,"]",e):ae=="block"?dn(n,"block",e):ae==n.ctx.type?Jn(n):n.ctx.type=="block"&&t!="comment"&&zr(n,Xn),n.afterIdent=t=="variable"||t=="keyword",t},indent:function(e,n,t){if(e.tokenize!=Yn)return 0;var r=n&&n.charAt(0),i=e.ctx,o=r==i.type;return i.flags&Xn&&(i=i.prev),i.type=="block"?i.indent+(r=="{"?0:t.unit):i.flags&Sr?i.column+(o?0:1):i.indent+(o?0:t.unit)},languageData:{wordChars:".",commentTokens:{line:"#"},autocomplete:Er.concat(Tr,Cr)}};function nt(e){for(var n={},t=0,r=e.length;t]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if(t=="@"&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"propertyName";if(t=="$")return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variableName.special";if(/[a-zA-Z_\xa1-\uffff]/.test(t))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"variable";if(t=="|"&&(n.varList||n.lastTok=="{"||n.lastTok=="do"))return le="|",null;if(/[\(\)\[\]{}\\;]/.test(t))return le=t,null;if(t=="-"&&e.eat(">"))return"operator";if(/[=+\-\/*:\.^%<>~|]/.test(t)){var s=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return t=="."&&!s&&(le="."),"operator"}else return null}}}function cl(e){for(var n=e.pos,t=0,r,i=!1,o=!1;(r=e.next())!=null;)if(o)o=!1;else{if("[{(".indexOf(r)>-1)t++;else if("]})".indexOf(r)>-1){if(t--,t<0)break}else if(r=="/"&&t==0){i=!0;break}o=r=="\\"}return e.backUp(e.pos-n),i}function et(e){return e||(e=1),function(n,t){if(n.peek()=="}"){if(e==1)return t.tokenize.pop(),t.tokenize[t.tokenize.length-1](n,t);t.tokenize[t.tokenize.length-1]=et(e-1)}else n.peek()=="{"&&(t.tokenize[t.tokenize.length-1]=et(e+1));return pn(n,t)}}function ul(){var e=!1;return function(n,t){return e?(t.tokenize.pop(),t.tokenize[t.tokenize.length-1](n,t)):(e=!0,pn(n,t))}}function je(e,n,t,r){return function(i,o){var a=!1,s;for(o.context.type==="read-quoted-paused"&&(o.context=o.context.prev,i.eat("}"));(s=i.next())!=null;){if(s==e&&(r||!a)){o.tokenize.pop();break}if(t&&s=="#"&&!a){if(i.eat("{")){e=="}"&&(o.context={prev:o.context,type:"read-quoted-paused"}),o.tokenize.push(et());break}else if(/[@\$]/.test(i.peek())){o.tokenize.push(ul());break}}a=!a&&s=="\\"}return n}}function sl(e,n){return function(t,r){return n&&t.eatSpace(),t.match(e)?r.tokenize.pop():t.skipToEnd(),"string"}}function dl(e,n){return e.sol()&&e.match("=end")&&e.eol()&&n.tokenize.pop(),e.skipToEnd(),"comment"}var fl={name:"ruby",startState:function(e){return{tokenize:[pn],indented:0,context:{type:"top",indented:-e},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,n){le=null,e.sol()&&(n.indented=e.indentation());var t=n.tokenize[n.tokenize.length-1](e,n),r,i=le;if(t=="variable"){var o=e.current();t=n.lastTok=="."?"property":il.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":n.lastTok=="def"||n.lastTok=="class"||n.varList?"def":"variable",t=="keyword"&&(i=o,ol.propertyIsEnumerable(o)?r="indent":al.propertyIsEnumerable(o)?r="dedent":((o=="if"||o=="unless")&&e.column()==e.indentation()||o=="do"&&n.context.indented2&&a.token&&typeof a.token!="string"){t.pending=[];for(var z=2;z-1)return null;var i=t.indent.length-1,o=e[t.state];e:for(;;){for(var a=0;a!]+/,token:"operator"},{regex:/[a-zA-Z_]\w*!/,token:"macroName"},{regex:/[a-zA-Z_]\w*/,token:"variable"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0}],string:[{regex:/"/,token:"string",next:"start"},{regex:/(?:[^\\"]|\\(?:.|$))*/,token:"string"}],string_raw:[{regex:/"/,token:"string",next:"start"},{regex:/[^"]*/,token:"string"}],string_raw_hash:[{regex:/"#+/,token:"string",next:"start"},{regex:/(?:[^"]|"(?!#))*/,token:"string"}],comment:[{regex:/.*?\*\//,token:"comment",next:"start"},{regex:/.*/,token:"comment"}],languageData:{name:"rust",dontIndentStates:["comment"],indentOnInput:/^\s*\}$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}});var M={},Pr={eq:"operator",lt:"operator",le:"operator",gt:"operator",ge:"operator",in:"operator",ne:"operator",or:"operator"},yl=/(<=|>=|!=|<>)/,kl=/[=\(:\),{}.*<>+\-\/^\[\]]/;function H(e,n,t){if(t)for(var r=n.split(" "),i=0;iinteger char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),zl=Mr("define let letrec let* lambda define-macro defmacro let-syntax letrec-syntax let-values let*-values define-syntax syntax-rules define-values when unless");function El(e,n,t){this.indent=e,this.type=n,this.prev=t}function tt(e,n,t){e.indentStack=new El(n,t,e.indentStack)}function Tl(e){e.indentStack=e.indentStack.prev}var Cl=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),Il=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),Al=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),Ol=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);function Rl(e){return e.match(Cl)}function Pl(e){return e.match(Il)}function rt(e,n){return n===!0&&e.backUp(1),e.match(Ol)}function Dl(e){return e.match(Al)}function qr(e,n){for(var t,r=!1;(t=e.next())!=null;){if(t==n.token&&!r){n.state.mode=!1;break}r=!r&&t=="\\"}}var Ll={name:"scheme",startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1,sExprQuote:!1}},token:function(e,n){if(n.indentStack==null&&e.sol()&&(n.indentation=e.indentation()),e.eatSpace())return null;var t=null;switch(n.mode){case"string":qr(e,{token:'"',state:n}),t=Dr;break;case"symbol":qr(e,{token:"|",state:n}),t=Lr;break;case"comment":for(var r,i=!1;(r=e.next())!=null;){if(r=="#"&&i){n.mode=!1;break}i=r=="|"}t=we;break;case"s-expr-comment":if(n.mode=!1,e.peek()=="("||e.peek()=="[")n.sExprComment=0;else{e.eatWhile(/[^\s\(\)\[\]]/),t=we;break}default:var o=e.next();if(o=='"')n.mode="string",t=Dr;else if(o=="'")e.peek()=="("||e.peek()=="["?(typeof n.sExprQuote!="number"&&(n.sExprQuote=0),t=Ue):(e.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),t=Ue);else if(o=="|")n.mode="symbol",t=Lr;else if(o=="#")if(e.eat("|"))n.mode="comment",t=we;else if(e.eat(/[tf]/i))t=Ue;else if(e.eat(";"))n.mode="s-expr-comment",t=we;else{var a=null,s=!1,_=!0;e.eat(/[ei]/i)?s=!0:e.backUp(1),e.match(/^#b/i)?a=Rl:e.match(/^#o/i)?a=Pl:e.match(/^#x/i)?a=Dl:e.match(/^#d/i)?a=rt:e.match(/^[-+0-9.]/,!1)?(_=!1,a=rt):s||e.eat("#"),a!=null&&(_&&!s&&e.match(/^#[ei]/i),a(e)&&(t=$r))}else if(/^[-+0-9.]/.test(o)&&rt(e,!0))t=$r;else if(o==";")e.skipToEnd(),t=we;else if(o=="("||o=="["){for(var z="",S=e.column(),c;(c=e.eat(/[^\s\(\[\;\)\]]/))!=null;)z+=c;z.length>0&&zl.propertyIsEnumerable(z)?tt(n,S+Sl,o):(e.eatSpace(),e.eol()||e.peek()==";"?tt(n,S+1,o):tt(n,S+e.current().length,o)),e.backUp(e.current().length-1),typeof n.sExprComment=="number"&&n.sExprComment++,typeof n.sExprQuote=="number"&&n.sExprQuote++,t=Nr}else o==")"||o=="]"?(t=Nr,n.indentStack!=null&&n.indentStack.type==(o==")"?"(":"[")&&(Tl(n),typeof n.sExprComment=="number"&&--n.sExprComment==0&&(t=we,n.sExprComment=!1),typeof n.sExprQuote=="number"&&--n.sExprQuote==0&&(t=Ue,n.sExprQuote=!1))):(e.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),Fr&&Fr.propertyIsEnumerable(e.current())?t=wl:t="variable")}return typeof n.sExprComment=="number"?we:typeof n.sExprQuote=="number"?Ue:t},indent:function(e){return e.indentStack==null?e.indentation:e.indentStack.indent},languageData:{closeBrackets:{brackets:["(","[","{",'"']},commentTokens:{line:";;"}}};var it={};function ot(e,n){for(var t=0;t1&&e.eat("$");var t=e.next();return/['"({]/.test(t)?(n.tokens[0]=mn(t,t=="("?"quote":t=="{"?"def":"string"),Re(e,n)):(/\d/.test(t)||e.eatWhile(/\w/),n.tokens.shift(),"def")};function Fl(e){return function(n,t){return n.sol()&&n.string==e&&t.tokens.shift(),n.skipToEnd(),"string.special"}}function Re(e,n){return(n.tokens[0]||$l)(e,n)}var ql={name:"shell",startState:function(){return{tokens:[]}},token:function(e,n){return Re(e,n)},languageData:{autocomplete:Br.concat(Wr,jr),closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}};function te(e){var n=e.client||{},t=e.atoms||{false:!0,true:!0,null:!0},r=e.builtin||h(Kr),i=e.keywords||h(ze),o=e.operatorChars||/^[*+\-%<>!=&|~^\/]/,a=e.support||{},s=e.hooks||{},_=e.dateSQL||{date:!0,time:!0,timestamp:!0},z=e.backslashStringEscapes!==!1,S=e.brackets||/^[\{}\(\)\[\]]/,c=e.punctuation||/^[;.,:]/;function f(d,C){var E=d.next();if(s[E]){var I=s[E](d,C);if(I!==!1)return I}if(a.hexNumber&&(E=="0"&&d.match(/^[xX][0-9a-fA-F]+/)||(E=="x"||E=="X")&&d.match(/^'[0-9a-fA-F]*'/)))return"number";if(a.binaryNumber&&((E=="b"||E=="B")&&d.match(/^'[01]+'/)||E=="0"&&d.match(/^b[01]*/)))return"number";if(E.charCodeAt(0)>47&&E.charCodeAt(0)<58)return d.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),a.decimallessFloat&&d.match(/^\.(?!\.)/),"number";if(E=="?"&&(d.eatSpace()||d.eol()||d.eat(";")))return"macroName";if(E=="'"||E=='"'&&a.doubleQuote)return C.tokenize=y(E),C.tokenize(d,C);if((a.nCharCast&&(E=="n"||E=="N")||a.charsetCast&&E=="_"&&d.match(/[a-z][a-z0-9]*/i))&&(d.peek()=="'"||d.peek()=='"'))return"keyword";if(a.escapeConstant&&(E=="e"||E=="E")&&(d.peek()=="'"||d.peek()=='"'&&a.doubleQuote))return C.tokenize=function(u,A){return(A.tokenize=y(u.next(),!0))(u,A)},"keyword";if(a.commentSlashSlash&&E=="/"&&d.eat("/"))return d.skipToEnd(),"comment";if(a.commentHash&&E=="#"||E=="-"&&d.eat("-")&&(!a.commentSpaceRequired||d.eat(" ")))return d.skipToEnd(),"comment";if(E=="/"&&d.eat("*"))return C.tokenize=R(1),C.tokenize(d,C);if(E=="."){if(a.zerolessFloat&&d.match(/^(?:\d+(?:e[+-]?\d+)?)/i))return"number";if(d.match(/^\.+/))return null;if(a.ODBCdotTable&&d.match(/^[\w\d_$#]+/))return"type"}else{if(o.test(E))return d.eatWhile(o),"operator";if(S.test(E))return"bracket";if(c.test(E))return d.eatWhile(c),"punctuation";if(E=="{"&&(d.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||d.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";d.eatWhile(/^[_\w\d]/);var l=d.current().toLowerCase();return _.hasOwnProperty(l)&&(d.match(/^( )+'[^']*'/)||d.match(/^( )+"[^"]*"/))?"number":t.hasOwnProperty(l)?"atom":r.hasOwnProperty(l)?"type":i.hasOwnProperty(l)?"keyword":n.hasOwnProperty(l)?"builtin":null}}function y(d,C){return function(E,I){for(var l=!1,u;(u=E.next())!=null;){if(u==d&&!l){I.tokenize=f;break}l=(z||C)&&!l&&u=="\\"}return"string"}}function R(d){return function(C,E){var I=C.match(/^.*?(\/\*|\*\/)/);return I?I[1]=="/*"?E.tokenize=R(d+1):d>1?E.tokenize=R(d-1):E.tokenize=f:C.skipToEnd(),"comment"}}function Q(d,C,E){C.context={prev:C.context,indent:d.indentation(),col:d.column(),type:E}}function U(d){d.indent=d.context.indent,d.context=d.context.prev}return{name:"sql",startState:function(){return{tokenize:f,context:null}},token:function(d,C){if(d.sol()&&C.context&&C.context.align==null&&(C.context.align=!1),C.tokenize==f&&d.eatSpace())return null;var E=C.tokenize(d,C);if(E=="comment")return E;C.context&&C.context.align==null&&(C.context.align=!0);var I=d.current();return I=="("?Q(d,C,")"):I=="["?Q(d,C,"]"):C.context&&C.context.type==I&&U(C),E},indent:function(d,C,E){var I=d.context;if(!I)return null;var l=C.charAt(0)==I.type;return I.align?I.col+(l?0:1):I.indent+(l?0:E.unit)},languageData:{commentTokens:{line:a.commentSlashSlash?"//":a.commentHash?"#":"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}}}function at(e){for(var n;(n=e.next())!=null;)if(n=="`"&&!e.eat("`"))return"string.special";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"string.special":null}function Ml(e){for(var n;(n=e.next())!=null;)if(n=='"'&&!e.eat('"'))return"string.special";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"string.special":null}function Se(e){return e.eat("@")&&(e.match("session."),e.match("local."),e.match("global.")),e.eat("'")?(e.match(/^.*'/),"string.special"):e.eat('"')?(e.match(/^.*"/),"string.special"):e.eat("`")?(e.match(/^.*`/),"string.special"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"string.special":null}function Vr(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"string.special":null}var ze="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";function h(e){for(var n={},t=e.split(" "),r=0;r!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:/]/,backslashStringEscapes:!1,dateSQL:h("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":Se}}),jl=te({client:h("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:h(ze+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:h("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:h("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:h("date time timestamp"),support:h("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":Se,"`":at,"\\":Vr}}),ku=te({client:h("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:h(ze+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group group_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:h("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:h("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:h("date time timestamp"),support:h("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":Se,"`":at,"\\":Vr}}),Ul=te({client:h("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:h(ze+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:h("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:h("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:h("date time timestamp datetime"),support:h("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":Se,":":Se,"?":Se,$:Se,'"':Ml,"`":at}}),_u=te({client:{},keywords:h("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:h("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:h("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:h("commentSlashSlash decimallessFloat"),hooks:{}}),Vl=te({client:h("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:h("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:h("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*\/+\-%<>!=~]/,dateSQL:h("date time timestamp"),support:h("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),xu=te({keywords:h("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"),builtin:h("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"),atoms:h("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:h("date timestamp"),support:h("ODBCdotTable doubleQuote binaryNumber hexNumber")}),Kl=te({client:h("source"),keywords:h(ze+"a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"),builtin:h("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:h("false true null unknown"),operatorChars:/^[*\/+\-%<>!=&|^\/#@?~]/,backslashStringEscapes:!1,dateSQL:h("date time timestamp"),support:h("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast escapeConstant")}),wu=te({keywords:h("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:h("false true"),builtin:h("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),Su=te({client:h("source"),keywords:h("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:h("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:h("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:h("date time timestamp"),support:h("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),zu=te({keywords:h("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:h("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:h("false true null"),operatorChars:/^[*\/+\-%<>!=~&|^]/,dateSQL:h("date time timestamp"),support:h("ODBCdotTable doubleQuote zerolessFloat")}),Eu=te({client:h("source"),keywords:h("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:h("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:h("time"),support:h("decimallessFloat zerolessFloat binaryNumber hexNumber")});function Hr(e){function n(c,f){c.cmdState.push(f)}function t(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function r(c){var f=c.cmdState.pop();f&&f.closeBracket()}function i(c){for(var f=c.cmdState,y=f.length-1;y>=0;y--){var R=f[y];if(R.name!="DEFAULT")return R}return{styleIdentifier:function(){return null}}}function o(c,f,y){return function(){this.name=c,this.bracketNo=0,this.style=f,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var a={};a.importmodule=o("importmodule","tag",["string","builtin"]),a.documentclass=o("documentclass","tag",["","atom"]),a.usepackage=o("usepackage","tag",["atom"]),a.begin=o("begin","tag",["atom"]),a.end=o("end","tag",["atom"]),a.label=o("label","tag",["atom"]),a.ref=o("ref","tag",["atom"]),a.eqref=o("eqref","tag",["atom"]),a.cite=o("cite","tag",["atom"]),a.bibitem=o("bibitem","tag",["atom"]),a.Bibitem=o("Bibitem","tag",["atom"]),a.RBibitem=o("RBibitem","tag",["atom"]),a.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function s(c,f){c.f=f}function _(c,f){var y;if(c.match(/^\\[a-zA-Z@\xc0-\u1fff\u2060-\uffff]+/)){var R=c.current().slice(1);return y=a.hasOwnProperty(R)?a[R]:a.DEFAULT,y=new y,n(f,y),s(f,S),y.style}if(c.match(/^\\[$&%#{}_]/)||c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return s(f,function(U,d){return z(U,d,"\\]")}),"keyword";if(c.match("\\("))return s(f,function(U,d){return z(U,d,"\\)")}),"keyword";if(c.match("$$"))return s(f,function(U,d){return z(U,d,"$$")}),"keyword";if(c.match("$"))return s(f,function(U,d){return z(U,d,"$")}),"keyword";var Q=c.next();if(Q=="%")return c.skipToEnd(),"comment";if(Q=="}"||Q=="]"){if(y=t(f),y)y.closeBracket(Q),s(f,S);else return"error";return"bracket"}else return Q=="{"||Q=="["?(y=a.DEFAULT,y=new y,n(f,y),"bracket"):/\d/.test(Q)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),y=i(f),y.name=="begin"&&(y.argument=c.current()),y.styleIdentifier())}function z(c,f,y){if(c.eatSpace())return null;if(y&&c.match(y))return s(f,_),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variableName.special";if(c.match(/^\\[$&%#{}_]/)||c.match(/^\\[,;!\/]/)||c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var R=c.next();return R=="{"||R=="}"||R=="["||R=="]"||R=="("||R==")"?"bracket":R=="%"?(c.skipToEnd(),"comment"):"error"}function S(c,f){var y=c.peek(),R;return y=="{"||y=="["?(R=t(f),R.openBracket(y),c.eat(y),s(f,_),"bracket"):/[ \t\r]/.test(y)?(c.eat(y),null):(s(f,_),r(f),_(c,f))}return{name:"stex",startState:function(){var c=e?function(f,y){return z(f,y)}:_;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,f){return f.f(c,f)},blankLine:function(c){c.f=_,c.cmdState.length=0},languageData:{commentTokens:{line:"%"}}}}var Hl=Hr(!1),Cu=Hr(!0);function hn(e){for(var n={},t=0;t~^?!",Yl=":;,.(){}[]",ec=/^\-?0b[01][01_]*/,nc=/^\-?0o[0-7][0-7_]*/,tc=/^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/,rc=/^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/,ic=/^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/,oc=/^\.(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/,ac=/^\#[A-Za-z]+/,lc=/^@(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/;function Zr(e,n,t){if(e.sol()&&(n.indented=e.indentation()),e.eatSpace())return null;var r=e.peek();if(r=="/"){if(e.match("//"))return e.skipToEnd(),"comment";if(e.match("/*"))return n.tokenize.push(lt),lt(e,n)}if(e.match(ac))return"builtin";if(e.match(lc))return"attribute";if(e.match(ec)||e.match(nc)||e.match(tc)||e.match(rc))return"number";if(e.match(oc))return"property";if(Jl.indexOf(r)>-1)return e.next(),"operator";if(Yl.indexOf(r)>-1)return e.next(),e.match(".."),"punctuation";var i;if(i=e.match(/("""|"|')/)){var o=uc.bind(null,i[0]);return n.tokenize.push(o),o(e,n)}if(e.match(ic)){var a=e.current();return Xl.hasOwnProperty(a)?"type":Ql.hasOwnProperty(a)?"atom":Zl.hasOwnProperty(a)?(Gl.hasOwnProperty(a)&&(n.prev="define"),"keyword"):t=="define"?"def":"variable"}return e.next(),null}function cc(){var e=0;return function(n,t,r){var i=Zr(n,t,r);if(i=="punctuation"){if(n.current()=="(")++e;else if(n.current()==")"){if(e==0)return n.backUp(1),t.tokenize.pop(),t.tokenize[t.tokenize.length-1](n,t);--e}}return i}}function uc(e,n,t){for(var r=e.length==1,i,o=!1;i=n.peek();)if(o){if(n.next(),i=="(")return t.tokenize.push(cc()),"string";o=!1}else{if(n.match(e))return t.tokenize.pop(),"string";n.next(),o=i=="\\"}return r&&t.tokenize.pop(),"string"}function lt(e,n){for(var t;t=e.next();)if(t==="/"&&e.eat("*"))n.tokenize.push(lt);else if(t==="*"&&e.eat("/")){n.tokenize.pop();break}return"comment"}function sc(e,n,t){this.prev=e,this.align=n,this.indented=t}function dc(e,n){var t=n.match(/^\s*($|\/[\/\*]|[)}\]])/,!1)?null:n.column()+1;e.context=new sc(e.context,t,e.indented)}function fc(e){e.context&&(e.indented=e.context.indented,e.context=e.context.prev)}var pc={name:"swift",startState:function(){return{prev:null,context:null,indented:0,tokenize:[]}},token:function(e,n){var t=n.prev;n.prev=null;var r=n.tokenize[n.tokenize.length-1]||Zr,i=r(e,n,t);if(!i||i=="comment"?n.prev=t:n.prev||(n.prev=i),i=="punctuation"){var o=/[\(\[\{]|([\]\)\}])/.exec(e.current());o&&(o[1]?fc:dc)(n,e)}return i},indent:function(e,n,t){var r=e.context;if(!r)return 0;var i=/^[\]\}\)]/.test(n);return r.align!=null?r.align-(i?1:0):r.indented+(i?0:t.unit)},languageData:{indentOnInput:/^\s*[\)\}\]]$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}};var mc={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(e,n){if(!n.inString&&(e.peek()=='"'||e.peek()=="'")&&(n.stringType=e.peek(),e.next(),n.inString=!0),e.sol()&&n.inArray===0&&(n.lhs=!0),n.inString){for(;n.inString&&!e.eol();)e.peek()===n.stringType?(e.next(),n.inString=!1):e.peek()==="\\"?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return n.lhs?"property":"string"}else{if(n.inArray&&e.peek()==="]")return e.next(),n.inArray--,"bracket";if(n.lhs&&e.peek()==="["&&e.skipTo("]"))return e.next(),e.peek()==="]"&&e.next(),"atom";if(e.peek()==="#")return e.skipToEnd(),"comment";if(e.eatSpace())return null;if(n.lhs&&e.eatWhile(function(t){return t!="="&&t!=" "}))return"property";if(n.lhs&&e.peek()==="=")return e.next(),n.lhs=!1,null;if(!n.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!n.lhs&&(e.match("true")||e.match("false")))return"atom";if(!n.lhs&&e.peek()==="[")return n.inArray++,e.next(),"bracket";if(!n.lhs&&e.match(/^\-?\d+(?:\.\d+)?/))return"number";e.eatSpace()||e.next()}return null},languageData:{commentTokens:{line:"#"}}};var gn="error";function _e(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}var hc=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),gc=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),bc=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),vc=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),yc=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),kc=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),Gr=["class","module","sub","enum","select","while","if","function","get","set","property","try","structure","synclock","using","with"],Qr=["else","elseif","case","catch","finally"],Xr=["next","loop"],Jr=["and","andalso","or","orelse","xor","in","not","is","isnot","like"],_c=_e(Jr),Yr=["#const","#else","#elseif","#end","#if","#region","addhandler","addressof","alias","as","byref","byval","cbool","cbyte","cchar","cdate","cdbl","cdec","cint","clng","cobj","compare","const","continue","csbyte","cshort","csng","cstr","cuint","culng","cushort","declare","default","delegate","dim","directcast","each","erase","error","event","exit","explicit","false","for","friend","gettype","goto","handles","implements","imports","infer","inherits","interface","isfalse","istrue","lib","me","mod","mustinherit","mustoverride","my","mybase","myclass","namespace","narrowing","new","nothing","notinheritable","notoverridable","of","off","on","operator","option","optional","out","overloads","overridable","overrides","paramarray","partial","private","protected","public","raiseevent","readonly","redim","removehandler","resume","return","shadows","shared","static","step","stop","strict","then","throw","to","true","trycast","typeof","until","until","when","widening","withevents","writeonly"],ei=["object","boolean","char","string","byte","sbyte","short","ushort","int16","uint16","integer","uinteger","int32","uint32","long","ulong","int64","uint64","decimal","single","double","float","date","datetime","intptr","uintptr"],xc=_e(Yr),wc=_e(ei),Sc='"',zc=_e(Gr),ni=_e(Qr),ti=_e(Xr),ri=_e(["end"]),Ec=_e(["do"]),Tc=null;function ct(e,n){n.currentIndent++}function Ve(e,n){n.currentIndent--}function ut(e,n){if(e.eatSpace())return null;var t=e.peek();if(t==="'")return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var r=!1;if((e.match(/^\d*\.\d+F?/i)||e.match(/^\d+\.\d*F?/)||e.match(/^\.\d+F?/))&&(r=!0),r)return e.eat(/J/i),"number";var i=!1;if(e.match(/^&H[0-9a-f]+/i)||e.match(/^&O[0-7]+/i)?i=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),i=!0):e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}return e.match(Sc)?(n.tokenize=Cc(e.current()),n.tokenize(e,n)):e.match(yc)||e.match(vc)?null:e.match(bc)||e.match(hc)||e.match(_c)?"operator":e.match(gc)?null:e.match(Ec)?(ct(e,n),n.doInCurrentLine=!0,"keyword"):e.match(zc)?(n.doInCurrentLine?n.doInCurrentLine=!1:ct(e,n),"keyword"):e.match(ni)?"keyword":e.match(ri)?(Ve(e,n),Ve(e,n),"keyword"):e.match(ti)?(Ve(e,n),"keyword"):e.match(wc)||e.match(xc)?"keyword":e.match(kc)?"variable":(e.next(),gn)}function Cc(e){var n=e.length==1,t="string";return function(r,i){for(;!r.eol();){if(r.eatWhile(/[^'"]/),r.match(e))return i.tokenize=ut,t;r.eat(/['"]/)}return n&&(i.tokenize=ut),t}}function Ic(e,n){var t=n.tokenize(e,n),r=e.current();if(r===".")return t=n.tokenize(e,n),t==="variable"?"variable":gn;var i="[({".indexOf(r);return i!==-1&&ct(e,n),Tc==="dedent"&&Ve(e,n)||(i="])}".indexOf(r),i!==-1&&Ve(e,n))?gn:t}var Ac={name:"vb",startState:function(){return{tokenize:ut,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,n){e.sol()&&(n.currentIndent+=n.nextLineIndent,n.nextLineIndent=0,n.doInCurrentLine=0);var t=Ic(e,n);return n.lastToken={style:t,content:e.current()},t},indent:function(e,n,t){var r=n.replace(/^\s+|\s+$/g,"");return r.match(ti)||r.match(ri)||r.match(ni)?t.unit*(e.currentIndent-1):e.currentIndent<0?0:e.currentIndent*t.unit},languageData:{closeBrackets:{brackets:["(","[","{",'"']},commentTokens:{line:"'"},autocomplete:Gr.concat(Qr).concat(Xr).concat(Jr).concat(Yr).concat(ei)}};function ii(e){var n="error";function t(b){return new RegExp("^(("+b.join(")|(")+"))\\b","i")}var r=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),i=new RegExp("^((<>)|(<=)|(>=))"),o=new RegExp("^[\\.,]"),a=new RegExp("^[\\(\\)]"),s=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),_=["class","sub","select","while","if","function","property","with","for"],z=["else","elseif","case"],S=["next","loop","wend"],c=t(["and","or","not","xor","is","mod","eqv","imp"]),f=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],y=["true","false","nothing","empty","null"],R=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],Q=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],U=["WScript","err","debug","RegExp"],d=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],C=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],E=["server","response","request","session","application"],I=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],l=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],u=C.concat(d);U=U.concat(Q),e.isASP&&(U=U.concat(E),u=u.concat(l,I));var A=t(f),x=t(y),L=t(R),m=t(U),p=t(u),T='"',k=t(_),$=t(z),ce=t(S),Pe=t(["end"]),yn=t(["do"]),ai=t(["on error resume next","exit"]),li=t(["rem"]);function ft(b,O){O.currentIndent++}function kn(b,O){O.currentIndent--}function _n(b,O){if(b.eatSpace())return null;var N=b.peek();if(N==="'"||b.match(li))return b.skipToEnd(),"comment";if(b.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!b.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var Z=!1;if((b.match(/^\d*\.\d+/i)||b.match(/^\d+\.\d*/)||b.match(/^\.\d+/))&&(Z=!0),Z)return b.eat(/J/i),"number";var ge=!1;if(b.match(/^&H[0-9a-f]+/i)||b.match(/^&O[0-7]+/i)?ge=!0:b.match(/^[1-9]\d*F?/)?(b.eat(/J/i),ge=!0):b.match(/^0(?![\dx])/i)&&(ge=!0),ge)return b.eat(/L/i),"number"}return b.match(T)?(O.tokenize=ci(b.current()),O.tokenize(b,O)):b.match(i)||b.match(r)||b.match(c)?"operator":b.match(o)?null:b.match(a)?"bracket":b.match(ai)?(O.doInCurrentLine=!0,"keyword"):b.match(yn)?(ft(b,O),O.doInCurrentLine=!0,"keyword"):b.match(k)?(O.doInCurrentLine?O.doInCurrentLine=!1:ft(b,O),"keyword"):b.match($)?"keyword":b.match(Pe)?(kn(b,O),kn(b,O),"keyword"):b.match(ce)?(O.doInCurrentLine?O.doInCurrentLine=!1:kn(b,O),"keyword"):b.match(A)?"keyword":b.match(x)?"atom":b.match(p)?"variableName.special":b.match(L)||b.match(m)?"builtin":b.match(s)?"variable":(b.next(),n)}function ci(b){var O=b.length==1,N="string";return function(Z,ge){for(;!Z.eol();){if(Z.eatWhile(/[^'"]/),Z.match(b))return ge.tokenize=_n,N;Z.eat(/['"]/)}return O&&(ge.tokenize=_n),N}}function ui(b,O){var N=O.tokenize(b,O),Z=b.current();return Z==="."?(N=O.tokenize(b,O),Z=b.current(),N&&(N.substr(0,8)==="variable"||N==="builtin"||N==="keyword")?((N==="builtin"||N==="keyword")&&(N="variable"),u.indexOf(Z.substr(1))>-1&&(N="keyword"),N):n):N}return{name:"vbscript",startState:function(){return{tokenize:_n,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(b,O){b.sol()&&(O.currentIndent+=O.nextLineIndent,O.nextLineIndent=0,O.doInCurrentLine=0);var N=ui(b,O);return O.lastToken={style:N,content:b.current()},N===null&&(N=null),N},indent:function(b,O,N){var Z=O.replace(/^\s+|\s+$/g,"");return Z.match(ce)||Z.match(Pe)||Z.match($)?N.unit*(b.currentIndent-1):b.currentIndent<0?0:b.currentIndent*N.unit}}}var Oc=ii({}),Pu=ii({isASP:!0});var Rc=["true","false","on","off","yes","no"],Pc=new RegExp("\\b(("+Rc.join(")|(")+"))$","i"),Dc={name:"yaml",token:function(e,n){var t=e.peek(),r=n.escaped;if(n.escaped=!1,t=="#"&&(e.pos==0||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match("---")||e.match("..."))return"def";if(e.match(/^\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return t=="{"?n.inlinePairs++:t=="}"?n.inlinePairs--:t=="["?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!r&&t==",")return e.next(),"meta";if(n.inlinePairs>0&&!r&&t==",")return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(n.inlinePairs==0&&e.match(/^\s*-?[0-9\.\,]+\s?$/)||n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(Pc))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped=t=="\\",e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}};var st={token:e=>e.skipToEnd()},dt=["debug","extends","function","include","literal"],se={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/},vn;function G(e,n){return vn=n,e}function Lc(e,n,t){return n.tokenize=t,t(e,n)}function $c(e,n){return!1}function bn(e,n){let t=e.string,r;for(let o=e.pos;r=t.indexOf("{",o),o=r+1,!(r===-1||!$c()););if(r===e.pos)return e.match("{"),e.eat("*")?Lc(e,n,Fc("comment","*}")):(n.depth++,n.tokenize=oi,vn="startTag","tag");r>-1&&(e.string=t.slice(0,r));let i=st.token(e,n.base);return r>-1&&(e.string=t),i}function oi(e,n){if(e.match("}",!0))return n.tokenize=bn,G("tag",null);if(e.match("{",!0))return n.depth++,G("tag","startTag");let t=e.next();if(t==="$")return e.eatWhile(se.validIdentifier),G("variable-2","variable");if(t==="|")return G("operator","pipe");if(t===".")return G("operator","property");if(se.stringChar.test(t))return n.tokenize=Nc(t),G("string","string");if(se.operatorChars.test(t))return e.eatWhile(se.operatorChars),G("operator","operator");if(t==="["||t==="]")return G("bracket","bracket");if(t==="("||t===")")return G("bracket","operator");if(/\d/.test(t))return e.eatWhile(/\d/),G("number","number");{if(n.last==="variable"){if(t==="@")return e.eatWhile(se.validIdentifier),G("property","property");if(t==="|")return e.eatWhile(se.validIdentifier),G("qualifier","modifier")}else{if(n.last==="pipe")return e.eatWhile(se.validIdentifier),G("qualifier","modifier");if(n.last==="whitespace")return e.eatWhile(se.validIdentifier),G("attribute","modifier")}if(n.last==="property")return e.eatWhile(se.validIdentifier),G("property",null);if(/\s/.test(t))return vn="whitespace",null;let r="";t!=="/"&&(r+=t);let i=null;for(;i=e.eat(se.validIdentifier);)r+=i;for(let o=0,a=dt.length;ostrong,strong>b,strong>.bold,strong>.strong,b>strong,b>b,b>.bold,b>.strong,.bold>strong,.bold>b,.bold>.bold,.bold>.strong,.strong>strong,.strong>b,.strong>.bold,.strong>.strong{font-weight:bolder}em,i,.italic{font-style:italic}small,p.small,span.small,.text-small{font-size:.75rem}sup,.superscript{vertical-align:super;font-size:.8em}sub,.subscript{vertical-align:sub;font-size:.8em}pre{font-size:12px;border:1px solid #ddd;background-color:#fff;border-color:#ddd;border-radius:4px;padding-inline-start:26px;position:relative;padding-top:3px;padding-bottom:3px}html.dark-mode pre{background-color:#2b2b2b}html.dark-mode pre{border-color:#111}pre:before{content:"";display:block;position:absolute;top:0;width:22.4px;inset-inline-start:0;height:100%;background-color:#f5f5f5;border-inline-end:1px solid #ddd}html.dark-mode pre:before{background-color:#313335}html.dark-mode pre:before{border-inline-end:none}@media print{pre{padding-left:12px}pre:before{display:none}}blockquote{display:block;position:relative;border-left:4px solid rgba(0,0,0,0);border-left-color:var(--color-primary);background-color:#f8f8f8;padding:12px 16px 12px 32px;overflow:auto}html.dark-mode blockquote{background-color:#333}blockquote:before{content:"“";font-size:2em;font-weight:bold;position:absolute;top:12px;left:12px;color:#777}.text-mono{font-family:var(--font-code)}.text-uppercase{text-transform:uppercase}.text-capitals{text-transform:capitalize}.code-base,span.code,code{font-size:.84em;border:1px solid #ddd;border-radius:3px;background-color:#f8f8f8;border-color:#ddd}html.dark-mode .code-base,html.dark-mode span.code,html.dark-mode code{background-color:#2b2b2b}html.dark-mode .code-base,html.dark-mode span.code,html.dark-mode code{border-color:#444}code{display:inline;padding:1px 3px;white-space:pre-wrap;line-height:1.2em}span.code{padding:1px 6px}pre code{background-color:rgba(0,0,0,0);border:0;font-size:1em;display:block;line-height:1.6}span.highlight{font-weight:bold;padding:2px 4px}ul,ol{padding-left:32px;padding-right:32px;display:flow-root}ul p,ol p{margin:0}ul{list-style:disc}ul ul{list-style:circle}ul label{margin:0}ol{list-style:decimal}li>ol,li>ul{margin-top:0;margin-bottom:0;margin-block-end:0;margin-block-start:0;padding-block-end:0;padding-block-start:0;padding-left:19.2px;padding-right:19.2px}li.checkbox-item,li.task-list-item{display:list-item;list-style:none;margin-left:-19.2px;margin-inline-start:-19.2px;margin-inline-end:0}li.checkbox-item input[type=checkbox],li.task-list-item input[type=checkbox]{margin-right:6px;margin-inline-end:6px;margin-inline-start:0}li.checkbox-item li.checkbox-item,li.checkbox-item li.task-list-item,li.task-list-item li.checkbox-item,li.task-list-item li.task-list-item{margin-left:6px;margin-inline-start:6px;margin-inline-end:0}.underlined{text-decoration:underline}.text-center{text-align:center}.text-left{text-align:start}.text-right{text-align:end}@media screen and (min-width: 361px){.text-xxs-center{text-align:center}.text-xxs-left{text-align:start}.text-xxs-right{text-align:end}}@media screen and (min-width: 401px){.text-xs-center{text-align:center}.text-xs-left{text-align:start}.text-xs-right{text-align:end}}@media screen and (min-width: 601px){.text-s-center{text-align:center}.text-s-left{text-align:start}.text-s-right{text-align:end}}@media screen and (min-width: 881px){.text-m-center{text-align:center}.text-m-left{text-align:start}.text-m-right{text-align:end}}@media screen and (min-width: 1001px){.text-l-center{text-align:center}.text-l-left{text-align:start}.text-l-right{text-align:end}}@media screen and (min-width: 1101px){.text-xl-center{text-align:center}.text-xl-left{text-align:start}.text-xl-right{text-align:end}}.text-bigger{font-size:1.1em}.text-large{font-size:1.6666em}.no-color{color:inherit}.break-text{white-space:normal;word-wrap:break-word;overflow-wrap:break-word}.text-limit-lines-1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-limit-lines-2{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.header-group{margin:16px 0}.header-group h1,.header-group h2,.header-group h3,.header-group h4,.header-group h5,.header-group h6{margin:0}span.sep{color:#bbb;padding:0 6px}.list>*{display:block}.svg-icon{width:1em;height:1em;display:inline-block;position:relative;bottom:-0.105em;margin-inline-end:6px;pointer-events:none;fill:currentColor}.primary-background{background-color:var(--color-primary) !important}.primary-background-light{background-color:var(--color-primary-light)}html.dark-mode .primary-background-light{background:#000}html.dark-mode .primary-background-light .text-link{color:#aaa !important}.link-background{background-color:var(--color-link) !important}.text-pos,.text-pos:hover,.text-pos-hover:hover{color:var(--color-positive) !important;fill:var(--color-positive) !important}.text-warn,.text-warn:hover,.text-warn-hover:hover{color:var(--color-warning) !important;fill:var(--color-warning) !important}.text-neg,.text-neg:hover,.text-neg-hover:hover{color:var(--color-negative) !important;fill:var(--color-negative) !important}.text-primary,.text-primary:hover,.text-primary-hover:hover{color:var(--color-primary) !important;fill:var(--color-primary) !important}.text-link,.text-link:hover,.text-link-hover:hover{color:var(--color-link) !important;fill:var(--color-link) !important}.text-muted{color:#575757 !important;fill:currentColor !important}html.dark-mode .text-muted{color:#888 !important}.text-dark{color:#222 !important;fill:currentColor !important}html.dark-mode .text-dark{color:#ccc !important}.text-white{color:#fff;fill:currentColor !important}.text-bookshelf,.text-bookshelf:hover{color:var(--color-bookshelf);fill:var(--color-bookshelf)}.text-book,.text-book:hover{color:var(--color-book);fill:var(--color-book)}.text-page,.text-page:hover{color:var(--color-page);fill:var(--color-page)}.text-page.draft,.text-page.draft:hover{color:var(--color-page-draft);fill:var(--color-page-draft)}.text-chapter,.text-chapter:hover{color:var(--color-chapter);fill:var(--color-chapter)}.bg-white{background-color:#fff}.bg-book{background-color:var(--color-book)}.bg-chapter{background-color:var(--color-chapter)}.bg-bookshelf{background-color:var(--color-bookshelf)}.container{max-width:1400px;margin-inline-start:auto;margin-inline-end:auto;padding-inline-start:16px;padding-inline-end:16px}.container.medium{max-width:1100px}.container.small{max-width:840px}.container.very-small{max-width:480px}.grid{display:grid;grid-column-gap:24px;grid-row-gap:24px}.grid>*{min-width:0}.grid.half{grid-template-columns:1fr 1fr}.grid.third{grid-template-columns:1fr 1fr 1fr}.grid.left-focus{grid-template-columns:2fr 1fr}.grid.right-focus{grid-template-columns:1fr 3fr}.grid.gap-y-xs{grid-row-gap:6px}.grid.gap-xl{grid-column-gap:32px;grid-row-gap:32px}.grid.gap-xxl{grid-column-gap:48px;grid-row-gap:48px}.grid.v-center{align-items:center}.grid.v-end{align-items:end}.grid.no-gap{grid-row-gap:0;grid-column-gap:0}.grid.no-row-gap{grid-row-gap:0}@media screen and (max-width: 880px){.grid.third:not(.no-break){grid-template-columns:1fr 1fr}.grid.half:not(.no-break),.grid.left-focus:not(.no-break),.grid.right-focus:not(.no-break){grid-template-columns:1fr}.grid.half.collapse-xs{grid-template-columns:1fr 1fr}.grid.gap-xl{grid-column-gap:16px;grid-row-gap:16px}.grid.right-focus.reverse-collapse>*:nth-child(2){order:0}.grid.right-focus.reverse-collapse>*:nth-child(1){order:1}}@media screen and (max-width: 600px){.grid.third:not(.no-break){grid-template-columns:1fr}}@media screen and (max-width: 400px){.grid.half.collapse-xs{grid-template-columns:1fr}}#content{flex:1 0 auto}body.flexbox{display:flex;flex-direction:column;align-items:stretch;height:100%;min-height:100%;max-height:100%;overflow:hidden}body.flexbox #content{flex:1;display:flex;min-height:0}.flex-fill{display:flex;align-items:stretch;min-height:0;max-width:100%;position:relative}.flex-container-row{display:flex;flex-direction:row}.flex-container-row.v-center{align-items:center}.flex-container-column{display:flex;flex-direction:column}.flex-container-row.inline,.flex-container-column.inline{display:inline-flex !important}.flex-container-column.wrap,.flex-container-row.wrap{flex-wrap:wrap}.flex{min-height:0;flex:1;max-width:100%}.flex.fit-content{flex-basis:auto;flex-grow:0}.flex.fill-area{flex-grow:1;flex-shrink:0;min-width:fit-content}.flex-2{min-height:0;flex:2;max-width:100%}.flex-3{min-height:0;flex:3;max-width:100%}.flex-none{flex:none}.justify-flex-start{justify-content:flex-start}.justify-flex-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-space-between{justify-content:space-between}.items-center{align-items:center}.items-stretch{align-items:stretch}.min-width-xxxxs{min-width:60px}.min-width-xxxs{min-width:80px}.min-width-xxs{min-width:100px}.min-width-xs{min-width:120px}.min-width-s{min-width:160px}.min-width-m{min-width:200px}.min-width-l{min-width:240px}.min-width-xl{min-width:280px}.min-width-xxl{min-width:320px}.block{display:block !important;position:relative}.inline{display:inline !important}.block.inline{display:inline-block !important}.relative{position:relative}.fixed{position:fixed;z-index:20}.fixed.top-right{top:0;right:0}.hidden{display:none !important}.overflow-hidden{overflow:hidden}.height-fill{height:100%}.height-auto{height:auto !important}.float{float:left}.float.right{float:right}.sticky-top-m{position:sticky;top:16px}@media screen and (max-width: 360px){.hide-under-xxs{display:none !important}}@media screen and (min-width: 361px){.hide-over-xxs{display:none !important}}@media screen and (max-width: 400px){.hide-under-xs{display:none !important}}@media screen and (min-width: 401px){.hide-over-xs{display:none !important}}@media screen and (max-width: 600px){.hide-under-s{display:none !important}}@media screen and (min-width: 601px){.hide-over-s{display:none !important}}@media screen and (max-width: 880px){.hide-under-m{display:none !important}}@media screen and (min-width: 881px){.hide-over-m{display:none !important}}@media screen and (max-width: 1000px){.hide-under-l{display:none !important}}@media screen and (min-width: 1001px){.hide-over-l{display:none !important}}@media screen and (max-width: 1100px){.hide-under-xl{display:none !important}}@media screen and (min-width: 1101px){.hide-over-xl{display:none !important}}[hidden]{display:none !important}.screen-reader-only{position:absolute;inset-inline-start:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.rounded{border-radius:4px}.dual-column-content{columns:2}@media screen and (max-width: 880px){.dual-column-content{columns:1}}.clearfix::before,.clearfix::after{content:" ";display:table}.clearfix::after{clear:both}.tri-layout-container{display:grid;margin-inline-start:32px;margin-inline-end:32px;grid-template-columns:1fr 4fr 1fr;grid-template-areas:"a b c";grid-column-gap:32px;position:relative}.tri-layout-sides{grid-column-start:a;grid-column-end:c;grid-row:1;min-width:0;z-index:4}.tri-layout-sides-content{display:grid;grid-template-areas:"a b c";grid-template-columns:1fr 4fr 1fr;height:100%}.tri-layout-middle{grid-area:b;padding-top:16px;min-width:0;z-index:5}.tri-layout-right{grid-area:c;min-width:0;position:relative}.tri-layout-left{grid-area:a;min-width:0;position:relative}@media screen and (min-width: 1401px){.tri-layout-left-contents,.tri-layout-right-contents{padding:32px 16px;position:sticky;top:0;max-height:100vh;min-height:50vh;overflow-y:scroll;overflow-x:hidden;height:100%;scrollbar-width:none;-ms-overflow-style:none}.tri-layout-left-contents::-webkit-scrollbar,.tri-layout-right-contents::-webkit-scrollbar{display:none}.tri-layout-middle-contents{max-width:940px;margin:0 auto}}@media screen and (min-width: 1401px)and (max-width: 1700px){.tri-layout-sides-content,.tri-layout-container{grid-template-columns:1fr 972px 1fr}.tri-layout-container{grid-column-gap:12px;margin-inline-start:16px;margin-inline-end:16px}}@media screen and (max-width: 1400px){.tri-layout-container{grid-template-areas:"a b b";grid-template-columns:1fr 3fr;grid-template-rows:min-content min-content 1fr;margin-inline-start:19px;margin-inline-end:19px}.tri-layout-sides{grid-column-start:a;grid-column-end:a}.tri-layout-sides-content{display:block}}@media screen and (min-width: 1001px)and (max-width: 1400px){.tri-layout-sides-content{position:sticky;top:0;max-height:100vh;min-height:50vh;overflow-y:scroll;overflow-x:hidden;height:100%;scrollbar-width:none;-ms-overflow-style:none;padding-inline:16px;margin-inline:-16px}.tri-layout-sides-content::-webkit-scrollbar{display:none}}@media screen and (min-width: 1001px){.tri-layout-mobile-tabs{display:none}.tri-layout-left-contents>*,.tri-layout-right-contents>*{opacity:.6;transition:opacity ease-in-out 120ms}html.dark-mode .tri-layout-left-contents>*,html.dark-mode .tri-layout-right-contents>*{opacity:.75}.tri-layout-left-contents>*:hover,.tri-layout-left-contents>*:focus-within,.tri-layout-right-contents>*:hover,.tri-layout-right-contents>*:focus-within{opacity:1 !important}}@media screen and (min-width: 1001px)and (prefers-contrast: more){.tri-layout-left-contents>*,.tri-layout-right-contents>*{opacity:1 !important}}@media screen and (max-width: 1000px){.tri-layout-container{grid-template-areas:none;grid-template-columns:1fr;grid-column-gap:0;padding-inline-end:6px;padding-inline-start:6px}.tri-layout-container .tri-layout-sides{padding-inline-start:16px;padding-inline-end:16px;grid-column:1/1}.tri-layout-container .tri-layout-left>*,.tri-layout-container .tri-layout-right>*{display:none;pointer-events:none}.tri-layout-container .tri-layout-left,.tri-layout-container .tri-layout-right{padding-top:0 !important}.tri-layout-container .tri-layout-middle{grid-area:none;grid-row:3;grid-column:1/1;z-index:1;overflow:hidden;transition:transform ease-in-out 240ms}.tri-layout-container .tri-layout-left{grid-row:2}.tri-layout-container.show-info{overflow:hidden}.tri-layout-container.show-info .tri-layout-middle{display:none}.tri-layout-container.show-info .tri-layout-right>*,.tri-layout-container.show-info .tri-layout-left>*{display:block;pointer-events:auto}}@media screen and (max-width: 880px){.tri-layout-container{margin-inline-start:0;margin-inline-end:0}}.scroll-away-from-top:before,.scroll-away-from-bottom:after{content:"";display:block;position:absolute;color:#f2f2f2;left:0;top:0;width:100%;height:50px;background:linear-gradient(to bottom, currentColor, transparent);z-index:2}html.dark-mode .scroll-away-from-top:before,html.dark-mode .scroll-away-from-bottom:after{color:#111}.scroll-away-from-bottom:after{top:auto;bottom:0;background:linear-gradient(to top, currentColor, transparent)}.card{background-color:#fff;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);border-radius:3px;break-inside:avoid}html.dark-mode .card{background-color:#222}.card .body,.card p.empty-text{padding-block:16px}.card a,.card p{word-wrap:break-word;word-break:break-word}.card-title{padding:16px 16px 6px;margin:0;font-size:14px;color:#222;fill:#222;font-weight:400}.card-title a{line-height:1}.card-footer-link,button.card-footer-link{display:block;padding:12px 16px;line-height:1;border-top:1px solid;width:100%;text-align:left;border-color:#ddd;border-radius:0 0 3px 3px;font-size:.9em;margin-top:6px}html.dark-mode .card-footer-link,html.dark-mode button.card-footer-link{border-color:#555}.card-footer-link:hover,button.card-footer-link:hover{text-decoration:none;background-color:#f2f2f2}html.dark-mode .card-footer-link:hover,html.dark-mode button.card-footer-link:hover{background-color:#2d2d2d}.card-footer-link:focus,button.card-footer-link:focus{background-color:#eee;outline:1px dotted #666;outline-offset:-2px}html.dark-mode .card-footer-link:focus,html.dark-mode button.card-footer-link:focus{background-color:#222}.card.border-card{border:1px solid;border-color:#ddd}html.dark-mode .card.border-card{border-color:#000}.card.drag-card{border:1px solid #ddd;border-color:#ddd;background-color:#fff;border-radius:4px;display:flex;padding:0 0 0 40px;margin:12px 0;position:relative}html.dark-mode .card.drag-card{border-color:#000}html.dark-mode .card.drag-card{background-color:#333}.card.drag-card .drag-card-action{cursor:pointer}.card.drag-card .handle,.card.drag-card .drag-card-action{display:flex;align-items:center;text-align:center;justify-content:center;width:28px;flex-grow:0;padding:0 6px}.card.drag-card .handle:hover,.card.drag-card .drag-card-action:hover{background-color:#eee}html.dark-mode .card.drag-card .handle:hover,html.dark-mode .card.drag-card .drag-card-action:hover{background-color:#2d2d2d}.card.drag-card .handle .svg-icon,.card.drag-card .drag-card-action .svg-icon{margin-inline-end:0px}.card.drag-card .outline input{margin:12px 0;width:100%}.card.drag-card .outline{position:relative}.card.drag-card .handle{background-color:#eee;left:0;position:absolute;top:0;bottom:0}html.dark-mode .card.drag-card .handle{background-color:#2d2d2d}.card.drag-card>div{padding:0 12px;max-width:80%;flex:1}.grid-card{display:flex;flex-direction:column;border:1px solid #ddd;border-color:#ddd;margin-bottom:24px;border-radius:4px;overflow:hidden;min-width:100px;color:#444;transition:border-color ease-in-out 120ms,box-shadow ease-in-out 120ms}html.dark-mode .grid-card{border-color:#000}.grid-card:hover{color:#444;text-decoration:none;box-shadow:0 1px 6px -1px rgba(0,0,0,.1)}html.dark-mode .grid-card:hover{box-shadow:0 1px 6px -1px rgba(0,0,0,.5)}.grid-card h2{width:100%;font-size:1.5em;margin:0 0 10px}.grid-card p{font-size:.7rem;margin:0;line-height:1.6em}.grid-card .grid-card-content{flex:1;border-top:0;border-bottom-width:2px}.grid-card .grid-card-content,.grid-card .grid-card-footer{padding:24px}.grid-card .grid-card-content+.grid-card-footer{padding-top:0}.book-grid-item .grid-card-footer p.small{font-size:.8em;margin:0}.content-wrap.card{padding:16px 48px;margin-inline-start:auto;margin-inline-end:auto;margin-bottom:24px;overflow:initial;min-height:60vh;border-radius:8px}.content-wrap.card.auto-height{min-height:0}.content-wrap.card.fill-width{width:100%}@media screen and (max-width: 1400px){.content-wrap.card{padding:16px 32px}}@media screen and (max-width: 880px){.content-wrap.card{padding:16px 24px}}@media screen and (max-width: 600px){.content-wrap.card{padding:16px 16px}}.sub-card{box-shadow:0 1px 3px 0 rgba(0,0,0,.1);border:1.5px solid;border-color:#e2e2e2;border-radius:4px}html.dark-mode .sub-card{border-color:#444}.outline-hover{border:1px solid rgba(0,0,0,0) !important}.outline-hover:hover{border:1px solid rgba(0,0,0,.1) !important}.fade-in-when-active{opacity:.6;transition:opacity ease-in-out 120ms}html.dark-mode .fade-in-when-active{opacity:.7}.fade-in-when-active:hover,.fade-in-when-active:focus-within{opacity:1 !important}@media(prefers-contrast: more){.fade-in-when-active{opacity:1 !important}}.tag-item{display:inline-flex;margin-bottom:6px;margin-inline-end:6px;border-radius:4px;border:1px solid;overflow:hidden;font-size:.85em;border-color:#ccc}html.dark-mode .tag-item{border-color:#666}.tag-item a,.tag-item span,.tag-item a:hover,.tag-item a:active{padding:4px 8px;color:rgba(0,0,0,.7);transition:background-color ease-in-out 80ms;text-decoration:none}html.dark-mode .tag-item a,html.dark-mode .tag-item span,html.dark-mode .tag-item a:hover,html.dark-mode .tag-item a:active{color:hsla(0,0%,100%,.8)}.tag-item a:hover{background-color:hsla(0,0%,100%,.7)}html.dark-mode .tag-item a:hover{background-color:hsla(0,0%,100%,.3)}.tag-item svg{fill:rgba(0,0,0,.5)}html.dark-mode .tag-item svg{fill:hsla(0,0%,100%,.5)}.tag-item .tag-value{border-inline-start:1px solid;border-color:#ddd;background-color:hsla(0,0%,100%,.5)}html.dark-mode .tag-item .tag-value{border-color:#666}html.dark-mode .tag-item .tag-value{background-color:hsla(0,0%,100%,.2)}.tag-name.highlight,.tag-value.highlight{font-weight:bold}.tag-list div:last-child .tag-item{margin-bottom:0}.item-list-row .tag-item{margin-bottom:0}.api-method{font-size:.75rem;background-color:#888;padding:6px;line-height:1.3;opacity:.7;vertical-align:top;border-radius:3px;color:#fff;display:inline-block;min-width:60px;text-align:center;font-weight:bold}.api-method[data-method=GET]{background-color:#077b70}.api-method[data-method=POST]{background-color:#cf4d03}.api-method[data-method=PUT]{background-color:#0288d1}.api-method[data-method=DELETE]{background-color:#ab0f0e}.sticky-sidebar{position:sticky;top:16px;max-height:calc(100vh - 16px);overflow-y:auto}button{background-color:rgba(0,0,0,0);border:0;font-size:100%}.button{text-decoration:none;font-size:.85rem;line-height:1.4em;padding:7.8px 16px;margin-top:6px;margin-bottom:6px;display:inline-block;font-weight:400;outline:0;border-radius:4px;cursor:pointer;transition:background-color ease-in-out 120ms,filter ease-in-out 120ms,box-shadow ease-in-out 120ms;box-shadow:none;background-color:var(--color-primary);color:#fff;border:1px solid var(--color-primary);vertical-align:top}.button:hover,.button:focus,.button:active{background-color:var(--color-primary);text-decoration:none;color:#fff}.button:hover{box-shadow:0 0 4px 1px #ccc;filter:brightness(110%)}html.dark-mode .button:hover{box-shadow:0 0 4px 1px rgba(0,0,0,.5)}.button:focus{outline:1px dotted currentColor;outline-offset:-6px;box-shadow:none;filter:brightness(90%)}.button:active{outline:0}.button.outline{background-color:rgba(0,0,0,0);color:#666;fill:currentColor;border:1px solid;border-color:#ccc}html.dark-mode .button.outline{color:#aaa}html.dark-mode .button.outline{border-color:#666}.button.outline:hover,.button.outline:focus,.button.outline:active{color:#444;border:1px solid #ccc;box-shadow:0 1px 4px 0 rgba(0,0,0,.1);background-color:#f2f2f2;background-color:#f8f8f8;filter:none}html.dark-mode .button.outline:hover,html.dark-mode .button.outline:focus,html.dark-mode .button.outline:active{color:#bbb}html.dark-mode .button.outline:hover,html.dark-mode .button.outline:focus,html.dark-mode .button.outline:active{background-color:#444}.button.outline:active{border-color:#bbb;background-color:#ddd;color:#666;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.button+.button{margin-inline-start:12px}.button.small{font-size:.75rem;padding:7.2px 12px}.text-button{cursor:pointer;background-color:rgba(0,0,0,0);padding:0;margin:0;border:none;user-select:none;font-size:.75rem;line-height:1.4em;color:var(--color-link)}.text-button:active{outline:0}.text-button:hover{text-decoration:none}.text-button:hover,.text-button:focus{color:var(--color-link);fill:var(--color-link)}.text-button.hover-underline:hover{text-decoration:underline}.button.block{width:100%;text-align:start;display:block}.button.icon .svg-icon,.icon-button .svg-icon,.text-button.icon .svg-icon{margin-inline-end:0}.icon-button{text-align:center;border:1px solid rgba(0,0,0,0)}.icon-button:hover{background-color:rgba(0,0,0,.05);border-radius:4px;border-color:#ddd;cursor:pointer}html.dark-mode .icon-button:hover{border-color:#444}.button.svg{display:flex;align-items:center;padding:12px 16px;padding-bottom:10px;width:100%}.button.svg svg{display:inline-block;width:24px;height:24px;bottom:auto;margin-inline-end:16px}.button[disabled]{background-color:#bbb;cursor:default;border-color:#ccc}.button[disabled]:hover{background-color:#bbb;cursor:default;box-shadow:none}table{min-width:100px;max-width:100%}table thead{background-color:#f8f8f8;font-weight:500}html.dark-mode table thead{background-color:#333}table td,table th{min-width:10px;padding:6px 8px;border:1px solid #ddd;overflow:auto;line-height:1.2;word-break:break-word;vertical-align:top}table td p,table th p{margin:0}table.table{width:100%}table.table tr td,table.table tr th{border-bottom:1px solid rgba(0,0,0,.05)}table.table th,table.table td{text-align:start;border:none;padding:12px 12px;vertical-align:middle;margin:0;overflow:visible}table.table th{font-weight:bold}table.table tr:hover{background-color:#f2f2f2}html.dark-mode table.table tr:hover{background-color:#333}table.table .text-right{text-align:end}table.table .text-center{text-align:center}table.table td.actions{overflow:visible}table.table a{display:inline-block}table.table.expand-to-padding{margin-left:-12px;margin-right:-12px;width:calc(100% + 2*12px);max-width:calc(100% + 2*12px)}table.no-style td{border:0;padding:0}table.list-table{margin:0 -6px}table.list-table td{border:0;vertical-align:middle;padding:6px}.input-base,input[type=text],input[type=number],input[type=email],input[type=date],input[type=search],input[type=url],input[type=color],input[type=password],select,textarea,.fake-input{border-radius:3px;border:1px solid #d4d4d4;background-color:#fff;border-color:#d4d4d4;color:#666;display:inline-block;font-size:14px;padding:10.8px;height:40px;width:250px;max-width:100%}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{background-color:#333}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{border-color:#111}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{color:#aaa}.input-base.neg,input.neg[type=text],input.neg[type=number],input.neg[type=email],input.neg[type=date],input.neg[type=search],input.neg[type=url],input.neg[type=color],input.neg[type=password],select.neg,textarea.neg,.neg.fake-input,.input-base.invalid,input.invalid[type=text],input.invalid[type=number],input.invalid[type=email],input.invalid[type=date],input.invalid[type=search],input.invalid[type=url],input.invalid[type=color],input.invalid[type=password],select.invalid,textarea.invalid,.invalid.fake-input{border:1px solid var(--color-negative)}.input-base.pos,input.pos[type=text],input.pos[type=number],input.pos[type=email],input.pos[type=date],input.pos[type=search],input.pos[type=url],input.pos[type=color],input.pos[type=password],select.pos,textarea.pos,.pos.fake-input,.input-base.valid,input.valid[type=text],input.valid[type=number],input.valid[type=email],input.valid[type=date],input.valid[type=search],input.valid[type=url],input.valid[type=color],input.valid[type=password],select.valid,textarea.valid,.valid.fake-input{border:1px solid var(--color-positive)}.input-base.disabled,input.disabled[type=text],input.disabled[type=number],input.disabled[type=email],input.disabled[type=date],input.disabled[type=search],input.disabled[type=url],input.disabled[type=color],input.disabled[type=password],select.disabled,textarea.disabled,.disabled.fake-input,.input-base[disabled],input[disabled][type=text],input[disabled][type=number],input[disabled][type=email],input[disabled][type=date],input[disabled][type=search],input[disabled][type=url],input[disabled][type=color],input[disabled][type=password],select[disabled],textarea[disabled],[disabled].fake-input{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAMUlEQVQIW2NkwAGuXbv2nxGbHEhCS0uLEUMSJgHShCKJLIEiiS4Bl8QmAZbEJQGSBAC62BuJ+tt7zgAAAABJRU5ErkJggg==)}.input-base[readonly],input[readonly][type=text],input[readonly][type=number],input[readonly][type=email],input[readonly][type=date],input[readonly][type=search],input[readonly][type=url],input[readonly][type=color],input[readonly][type=password],select[readonly],textarea[readonly],[readonly].fake-input{background-color:#f8f8f8}.input-base:focus,input[type=text]:focus,input[type=number]:focus,input[type=email]:focus,input[type=date]:focus,input[type=search]:focus,input[type=url]:focus,input[type=color]:focus,input[type=password]:focus,select:focus,textarea:focus,.fake-input:focus{border-color:var(--color-primary);outline:1px solid var(--color-primary)}.input-fill-width{width:100% !important}.fake-input{overflow:auto}#html-editor{display:none}#markdown-editor{position:relative;z-index:5}#markdown-editor #markdown-editor-input{font-style:normal;font-weight:400;padding:6px 16px;color:#444;background-color:#fff;border-radius:0;height:100%;font-size:14px;line-height:1.2;max-height:100%;flex:1;border:0;width:100%;margin:0}html.dark-mode #markdown-editor #markdown-editor-input{color:#aaa}html.dark-mode #markdown-editor #markdown-editor-input{background-color:#222}#markdown-editor #markdown-editor-input:focus{outline:0}#markdown-editor.fullscreen{position:fixed;top:0;left:0;height:100%;z-index:2}.markdown-editor-wrap{border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-color:#ddd;position:relative;flex:1;min-width:0}html.dark-mode .markdown-editor-wrap{border-color:#000}.markdown-editor-wrap+.markdown-editor-wrap{flex-basis:50%;flex-shrink:0;flex-grow:0}.markdown-editor-wrap .cm-editor{flex:1;max-width:100%;border:0;margin:0}.markdown-panel-divider{width:2px;background-color:#ddd;cursor:col-resize}html.dark-mode .markdown-panel-divider{background-color:#000}@media screen and (max-width: 880px){#markdown-editor{flex-direction:column}#markdown-editor .markdown-editor-wrap{width:100%;max-width:100%;flex-grow:1;flex-basis:auto !important;min-height:0}.editor-toolbar-label{float:none !important;border-color:#ddd;display:block}html.dark-mode .editor-toolbar-label{border-color:#555}.markdown-editor-wrap:not(.active) .editor-toolbar+div,.markdown-editor-wrap:not(.active) .editor-toolbar .buttons,.markdown-editor-wrap:not(.active) .markdown-display{display:none}#markdown-editor .markdown-editor-wrap:not(.active){flex-grow:0;flex:none}}.markdown-editor-display{background-color:#fff}.markdown-editor-display body{display:block;background-color:#fff;padding-inline-start:12px;padding-inline-end:12px;max-width:864px}.markdown-editor-display [drawio-diagram]:hover{outline:2px solid var(--color-primary)}html.markdown-editor-display.dark-mode{background-color:#222}html.markdown-editor-display.dark-mode body{background-color:#222}.editor-toolbar{height:32px;width:100%;font-size:11px;line-height:1.6;border-bottom:1px solid #ccc;background-color:#fff;border-color:#ccc;flex:none}html.dark-mode .editor-toolbar{background-color:#333}html.dark-mode .editor-toolbar{border-color:#000}html.dark-mode .editor-toolbar button{color:#aaa}.editor-toolbar .buttons{font-size:14px}.editor-toolbar .buttons .dropdown-menu{padding:0}.editor-toolbar .buttons .toggle-switch{margin:12px 0}.editor-toolbar .buttons button{font-size:.9rem;width:2rem;text-align:center;border-left:1px solid;border-color:#ddd}html.dark-mode .editor-toolbar .buttons button{border-color:#555}.editor-toolbar .buttons button svg{margin-inline-end:0}.editor-toolbar .buttons button:hover{background-color:#ddd}html.dark-mode .editor-toolbar .buttons button:hover{background-color:#222}label{color:#666;display:block;line-height:1.4em;font-size:.94em;font-weight:400;padding-bottom:2px;margin-bottom:.2em}html.dark-mode label{color:#ddd}label.inline{display:inline-block}label.radio,label.checkbox{font-weight:400;user-select:none}label.radio input[type=radio],label.radio input[type=checkbox],label.checkbox input[type=radio],label.checkbox input[type=checkbox]{margin-inline-end:6px}label.inline.checkbox{margin-inline-end:16px}label+p.small{margin-bottom:.8em}table.form-table{max-width:100%}table.form-table td{overflow:hidden;padding:1.5px 0}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:url("data:image/svg+xml;utf8,");background-size:10px 12px;background-position:calc(100% - 20px) 64%;background-repeat:no-repeat}html[dir=rtl] select{background-position:20px 70%}input[type=date]{width:190px}input[type=color]{height:60px}input[type=color].small{height:42px;width:60px;padding:2px}.toggle-switch{user-select:none;display:inline-grid;grid-template-columns:28px 1fr;align-items:center;margin:16px 0}.toggle-switch .custom-checkbox{width:16px;height:16px;border-radius:2px;display:inline-block;border:2px solid currentColor;overflow:hidden;fill:currentColor}.toggle-switch .custom-checkbox .svg-icon{width:100%;height:100%;margin:0;bottom:auto;top:-1.5px;left:0;transition:transform ease-in-out 120ms;transform:scale(0);transform-origin:center center}.toggle-switch input[type=checkbox]{display:none}.toggle-switch input[type=checkbox]:checked+.custom-checkbox .svg-icon{transform:scale(1)}.toggle-switch .custom-checkbox:hover{background-color:rgba(0,0,0,.05);opacity:.8}.toggle-switch input[type=checkbox][disabled]~*{opacity:.8;cursor:not-allowed}.toggle-switch input[type=checkbox][disabled]~.custom-checkbox{border-color:#999;color:#999 !important;background:#f2f2f2}.toggle-switch-list .toggle-switch{margin:6px 0}.toggle-switch-list.compact .toggle-switch{margin:1px 0}.form-group{margin-bottom:12px}.setting-list>div{border-bottom:1px solid #ddd;padding:32px 0}.setting-list>div:last-child{border-bottom:none}.setting-list-label{color:#222;color:#222;font-size:1rem}html.dark-mode .setting-list-label{color:#ddd}.setting-list-label+p.small{margin-bottom:0}.setting-list-label+.grid{margin-top:16px}.setting-list .grid input[type=text],.setting-list .grid input[type=email],.setting-list .grid input[type=password],.setting-list .grid select,.stretch-inputs input[type=text],.stretch-inputs input[type=email],.stretch-inputs input[type=password],.stretch-inputs select{width:100%}.simple-code-input{background-color:#f8f8f8;font-family:monospace;font-size:12px;min-height:100px;display:block;width:100%}.form-group div.text-pos,.form-group div.text-neg,.form-group p.text-post,.form-group p.text-neg{padding:6px 0}.form-group.collapsible{padding:0 16px;border:1px solid;border-color:#ddd;border-radius:4px}html.dark-mode .form-group.collapsible{border-color:#000}.form-group.collapsible .collapse-title{margin-inline-start:-16px;margin-inline-end:-16px;padding:12px 16px;display:block;width:calc(100% + 32px);text-align:start}.form-group.collapsible .collapse-title,.form-group.collapsible .collapse-title label{cursor:pointer}.form-group.collapsible .collapse-title label{padding-bottom:0;margin-bottom:0;color:inherit}.form-group.collapsible .collapse-title label:before{display:inline-block;content:"▸";margin-inline-end:16px;transition:all ease-in-out 400ms;transform:rotate(0)}.form-group.collapsible .collapse-content{display:none;padding-bottom:16px}.form-group.collapsible.open .collapse-title label:before{transform:rotate(90deg)}.form-group.ambrosia-container,.form-group.ambrosia-container *{position:absolute !important;height:1px !important;width:1px !important;margin:-1px !important;padding:0 !important;background:rgba(0,0,0,0) !important;color:rgba(0,0,0,0) !important;border:none !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important}.title-input input[type=text]{display:block;width:100%;padding:12px;margin-top:0;font-size:2em;height:auto}.description-input textarea{display:block;width:100%;padding:12px;font-size:14px;color:#666;height:auto}.description-input>.tox-tinymce{border:1px solid #ddd !important;border-color:#ddd !important;border-radius:3px}html.dark-mode .description-input>.tox-tinymce{border-color:#000 !important}.description-input>.tox-tinymce .tox-toolbar__primary{justify-content:end}.search-box{max-width:100%;position:relative}.search-box button[tabindex="-1"]{background-color:rgba(0,0,0,0);border:none;color:#666;padding:0;cursor:pointer;position:absolute;inset-inline-start:8px;top:10px}html.dark-mode .search-box button[tabindex="-1"]{color:#aaa}.search-box input{display:block;padding:9px;padding-inline-start:28px;width:300px;max-width:100%;height:auto}.search-box.flexible input{width:100%}.search-box button.search-box-cancel{left:auto;right:0}.contained-search-box{display:flex;height:38px;z-index:-1}.contained-search-box.floating{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);border-radius:4px;overflow:hidden}html.dark-mode .contained-search-box.floating{border:1px solid #000}.contained-search-box input,.contained-search-box button{height:100%;border-radius:0;border:1px solid #ddd;border-color:#ddd;margin-inline-start:-1px}html.dark-mode .contained-search-box input,html.dark-mode .contained-search-box button{border-color:#000}.contained-search-box input:last-child,.contained-search-box button:last-child{border-inline-end:0}.contained-search-box input{border:0;flex:5;padding:6px 12px}.contained-search-box input:focus,.contained-search-box input:active{outline:1px dotted var(--color-primary);outline-offset:-2px;border:0}.contained-search-box button{border:0;width:48px;border-inline-start:1px solid #ddd;background-color:#fff;background-color:#fff;color:#444}html.dark-mode .contained-search-box button{background-color:#333}html.dark-mode .contained-search-box button{color:#aaa}.contained-search-box button:focus{outline:1px dotted var(--color-primary);outline-offset:-2px}.contained-search-box svg{margin:0}@media screen and (max-width: 600px){.contained-search-box{width:180px}}.outline>input{border:0;border-bottom:2px solid #ddd;border-radius:0}.outline>input:focus,.outline>input:active{border:0;border-bottom:2px solid #aaa;outline:0}.image-picker img{background-color:#bbb;max-width:100%}.custom-file-input{overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;height:1px;border:0;clip:rect(0, 0, 0, 0)}.custom-file-input:focus+label{border-color:var(--color-primary);outline:1px solid var(--color-primary)}.custom-simple-file-input{max-width:100%;border:1px solid;border-color:#ddd;border-radius:4px;padding:12px 16px}html.dark-mode .custom-simple-file-input{border-color:#666}.custom-simple-file-input::file-selector-button{background-color:rgba(0,0,0,0);text-decoration:none;font-size:.8rem;line-height:1.4em;padding:6px 12px;border:1px solid;font-weight:400;outline:0;border-radius:4px;cursor:pointer;margin-right:16px;color:#666;border-color:#ccc}html.dark-mode .custom-simple-file-input::file-selector-button{color:#aaa}html.dark-mode .custom-simple-file-input::file-selector-button{border-color:#666}.custom-simple-file-input::file-selector-button:hover,.custom-simple-file-input::file-selector-button:focus,.custom-simple-file-input::file-selector-button:active{color:#444;border:1px solid #ccc;box-shadow:0 1px 4px 0 rgba(0,0,0,.1);background-color:#f2f2f2;background-color:#f8f8f8;filter:none}html.dark-mode .custom-simple-file-input::file-selector-button:hover,html.dark-mode .custom-simple-file-input::file-selector-button:focus,html.dark-mode .custom-simple-file-input::file-selector-button:active{color:#bbb}html.dark-mode .custom-simple-file-input::file-selector-button:hover,html.dark-mode .custom-simple-file-input::file-selector-button:focus,html.dark-mode .custom-simple-file-input::file-selector-button:active{background-color:#444}.custom-simple-file-input::file-selector-button:active{border-color:#bbb;background-color:#ddd;color:#666;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}input.shortcut-input{width:auto;max-width:120px;height:auto}.anim.fadeIn{opacity:0;animation-name:fadeIn;animation-duration:120ms;animation-timing-function:ease-in-out;animation-fill-mode:forwards}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.search-suggestions-animation{animation-name:searchSuggestions;animation-duration:120ms;animation-fill-mode:forwards;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99)}@keyframes searchSuggestions{0%{opacity:.5;transform:scale(0.9)}100%{opacity:1;transform:scale(1)}}@keyframes loadingBob{0%{transform:translate3d(0, 0, 0)}30%{transform:translate3d(0, 0, 0)}50%{transform:translate3d(0, -10px, 0)}70%{transform:translate3d(0, 0, 0)}100%{transform:translate3d(0, 0, 0)}}@keyframes pointer{0%{transform:translate3d(0, 20px, 0) scale3d(0, 0, 0)}100%{transform:translate3d(0, 0, 0) scale3d(1, 1, 1)}}.anim.pointer{transform-origin:50% 100%;animation-name:pointer;animation-duration:180ms;animation-delay:0s;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99)}@keyframes highlight{0%{background-color:var(--color-primary-light)}33%{background-color:rgba(0,0,0,0)}66%{background-color:var(--color-primary-light)}100%{background-color:rgba(0,0,0,0)}}.anim-highlight{animation-name:highlight;animation-duration:2s;animation-delay:0s;animation-timing-function:linear}.tox.tox-fullscreen{position:fixed;top:0;height:100%;width:100%;max-width:100%;z-index:100}.tox.tox-tinymce{border-inline:0;border-bottom:0}.page-content.mce-content-body{padding-block-start:1rem;padding-block-end:1rem;outline:0;display:block;max-width:870px}.wysiwyg-input.mce-content-body{padding-block-start:1rem;padding-block-end:1rem;outline:0;display:block}.wysiwyg-input.mce-content-body:before{padding:1rem;top:4px;font-style:italic;color:rgba(34,47,62,.5)}html.dark-mode .wysiwyg-input.mce-content-body:before{color:rgba(155,155,155,.5)}.page-content.mce-content-body doc-root{display:block}.page-content.mce-content-body code-block{display:block}body.page-content.mce-content-body{padding-bottom:5rem}.tox .tox-pop__dialog .tox-toolbar{background:rgba(0,0,0,0) !important}.tox-toolbar__primary{justify-content:center}.page-content.mce-content-body code-block>*{pointer-events:none}.page-content.mce-content-body code-block pre{display:none}.page-content.mce-content-body details summary{pointer-events:none}.page-content.mce-content-body details doc-root{padding:12px;margin-left:-10px;margin-right:-10px;margin-bottom:-10px;margin-top:-10px;overflow:hidden}.page-content.mce-content-body .mce-preview-object.align-right{float:right !important;margin:6px 0 6px 12px}.page-content.mce-content-body .mce-preview-object.align-left{float:left !important;margin:6px 16px 16px 0}.page-content.mce-content-body .mce-preview-object.align-center{display:block;margin-left:auto;margin-right:auto}.page-content.mce-content-body .mce-preview-object iframe,.page-content.mce-content-body .mce-preview-object video{display:block;margin:0 !important;float:none !important}.page-content.mce-content-body td[data-mce-selected]::after,.page-content.mce-content-body th[data-mce-selected]::after{top:1px;left:1px;bottom:1px;right:1px;outline:1px dashed #1a85ff;outline-offset:0}.dark-mode .tox .tox-toolbar__primary,.dark-mode .tox .tox-menu,.dark-mode .tox .tox-dialog__header,.dark-mode .tox .tox-dialog,.dark-mode .tox .tox-dialog__footer,.dark-mode .tox .tox-pop__dialog,.dark-mode .tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#333 !important}.dark-mode .tox .tox-tbtn svg,.dark-mode .tox .tox-tbtn,.dark-mode .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#dbdbdb;fill:#dbdbdb}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{width:6em !important}.tox-menu .tox-collection__item blockquote::before{content:none}.tox-menu .tox-collection__item blockquote{border-left:4px solid var(--color-primary) !important;padding:4px 6px !important}.tox-menu .tox-collection__item blockquote{border-left:4px solid var(--color-primary) !important;padding:4px 6px !important}.tox-menu .tox-collection__item p[style*=background-color]{padding:4px 6px !important;border-left:3px solid currentColor !important}.tox-menu .tox-collection__item[title^="<"]>div>div{font-family:var(--font-code) !important;border:1px solid #ddd !important;background-color:#eee !important;padding:4px 6px !important}.tox-menu .tox-collection__item-label{line-height:normal !important}.page-content.mce-content-body .task-list-item{margin-inline-start:0;position:relative}.page-content.mce-content-body .task-list-item>input[type=checkbox]{display:none}.page-content.mce-content-body .task-list-item:before{content:"";display:inline-block;border:2px solid #ccc;width:12px;height:12px;border-radius:2px;margin-inline-end:8px;vertical-align:text-top;cursor:pointer;position:absolute;inset-inline-start:-24px;top:4px}.page-content.mce-content-body .task-list-item[checked]:before{background-color:#ccc;background-image:url('data:image/svg+xml;utf8,');background-position:50% 50%;background-size:100% 100%}:root{--editor-color-primary: #206ea7}.editor-container{background-color:#fff;position:relative}html.dark-mode .editor-container{background-color:#222}.editor-container.fullscreen{z-index:500}.editor-toolbar-main{display:flex;flex-wrap:wrap;justify-content:center;border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-color:#ddd}html.dark-mode .editor-toolbar-main{border-color:#000}@media screen and (max-width: 1100px){.editor-toolbar-main{overflow-x:scroll;flex-wrap:nowrap;justify-content:start}}body.editor-is-fullscreen{overflow:hidden}body.editor-is-fullscreen .edit-area{z-index:20}.editor-content-area{min-height:100%;padding-block:1rem}.editor-content-area:focus{outline:0}.editor-content-wrap{position:relative;overflow-y:scroll;padding-inline:12px;flex:1}.comment-editor-container,.basic-editor-container{border-left:1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd;border-radius:3px;border-color:#ddd}html.dark-mode .comment-editor-container,html.dark-mode .basic-editor-container{border-color:#000}.comment-editor-container .editor-toolbar-main,.basic-editor-container .editor-toolbar-main{border-radius:3px 3px 0 0;justify-content:end}.basic-editor-container .editor-content-area{padding-bottom:0}.editor-button{font-size:12px;padding:4px;color:#444;color:#444;border-radius:4px;display:flex;align-items:center;justify-content:center;margin:2px}html.dark-mode .editor-button{color:#999}.editor-button:hover{background-color:#eee;background-color:#eee;cursor:pointer;color:#000}html.dark-mode .editor-button:hover{background-color:#333}.editor-button[disabled]{pointer-events:none;cursor:not-allowed;opacity:.6}.editor-button-active,.editor-button-active:hover{background-color:#ceebff;color:#000}html.dark-mode .editor-button-active,html.dark-mode .editor-button-active:hover{background-color:#444}.editor-button-long{display:flex !important;flex-direction:row;align-items:center;justify-content:start;gap:.5rem}.editor-button-text{font-weight:400;color:#000;font-size:14px;flex:1;padding-inline-end:4px}html.dark-mode .editor-button-text{color:#aaa}.editor-button-format-preview{padding:4px 6px;display:block}.editor-button-long .editor-button-icon{width:24px;height:24px}.editor-button-icon svg{width:24px;height:24px;color:inherit;fill:currentColor;display:block}.editor-menu-button-icon{width:24px;height:24px}.editor-menu-button-icon svg{fill:#888}.editor-container[dir=rtl] .editor-menu-button-icon{rotate:180deg}.editor-button-with-menu-container{display:flex;flex-direction:row;gap:0;align-items:stretch;border-radius:4px}.editor-button-with-menu-container .editor-dropdown-menu-container{display:flex}.editor-button-with-menu-container .editor-dropdown-menu-container>.editor-dropdown-menu{top:100%}.editor-button-with-menu-container .editor-dropdown-menu-container>.editor-button{padding-inline:4px;margin-inline-start:-3px}.editor-button-with-menu-container .editor-dropdown-menu-container>.editor-button svg{width:12px;height:12px}.editor-button-with-menu-container:hover{outline:1px solid;outline-color:#ddd;outline-offset:-3px}html.dark-mode .editor-button-with-menu-container:hover{outline-color:#111}.editor-dropdown-menu-container{position:relative}.editor-dropdown-menu{position:absolute;border:1px solid;background-color:#fff;border-color:#fff;box-shadow:0 0 6px 0 rgba(0,0,0,.15);z-index:99;display:flex;flex-direction:row;border-radius:3px}html.dark-mode .editor-dropdown-menu{background-color:#292929}html.dark-mode .editor-dropdown-menu{border-color:#333}html.dark-mode .editor-dropdown-menu{box-shadow:0 1px 4px 0 rgba(0,0,0,.4)}.editor-dropdown-menu-vertical{display:flex;flex-direction:column;align-items:stretch;min-width:160px}.editor-dropdown-menu-vertical .editor-button{border-bottom:0;text-align:start;display:block;width:100%}.editor-dropdown-menu-vertical>.editor-dropdown-menu-container .editor-dropdown-menu{inset-inline-start:100%;top:0}.editor-separator{display:block;height:1px;opacity:.8;background-color:#ddd}html.dark-mode .editor-separator{background-color:#000}.editor-format-menu-toggle{width:130px;height:32px;font-size:13px;overflow:hidden;padding-inline:12px;justify-content:start;background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-position:98% 50%;background-size:28px}.editor-container[dir=rtl] .editor-format-menu-toggle{background-position:2% 50%}.editor-format-menu .editor-dropdown-menu{min-width:300px}.editor-format-menu .editor-dropdown-menu .editor-dropdown-menu{min-width:220px}.editor-format-menu .editor-dropdown-menu .editor-button-icon{display:none}.editor-format-menu .editor-dropdown-menu .editor-dropdown-menu-container>.editor-button{padding:8px 10px}.editor-overflow-container{display:flex;border-inline:1px solid #ddd;padding-inline:4px;border-color:#ddd}html.dark-mode .editor-overflow-container{border-color:#000}.editor-overflow-container:first-child{border-inline-start:none}.editor-overflow-container:last-child{border-inline-end:none}.editor-overflow-container+.editor-overflow-container{border-inline-start:none}.editor-context-toolbar{position:fixed;border:1px solid #ddd;background-color:#fff;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.12);padding:.2rem;border-radius:4px;display:flex;flex-direction:row}html.dark-mode .editor-context-toolbar{background-color:#222}html.dark-mode .editor-context-toolbar{border-color:#333}html.dark-mode .editor-context-toolbar{box-shadow:0 1px 4px 0 rgba(0,0,0,.4)}.editor-context-toolbar:before{content:"";z-index:-1;display:block;width:8px;height:8px;position:absolute;background-color:#fff;border-top:1px solid #ddd;border-left:1px solid #ddd;border-color:#ddd;transform:rotate(45deg);left:50%;margin-left:-4px;top:-5px}html.dark-mode .editor-context-toolbar:before{background-color:#222}html.dark-mode .editor-context-toolbar:before{border-color:#333}.editor-context-toolbar.is-above:before{top:calc(100% - 5px);transform:rotate(225deg)}.editor-modal-wrapper{position:fixed;display:flex;align-items:center;justify-content:center;z-index:999;background-color:rgba(0,0,0,.5);width:100%;height:100%}.editor-modal{background-color:#fff;border-radius:4px;overflow:hidden;box-shadow:0 0 15px 0 rgba(0,0,0,.3);margin:6px;max-height:100%;overflow-y:auto}html.dark-mode .editor-modal{background-color:#222}.editor-modal-header{display:flex;justify-content:space-between;align-items:stretch;background-color:var(--color-primary);color:#fff}.editor-modal-title{padding:8px 16px}.editor-modal-close{color:#fff;padding:8px 16px;align-items:center;justify-content:center;cursor:pointer}.editor-modal-close:hover{background-color:hsla(0,0%,100%,.1)}.editor-modal-close svg{width:1rem;height:1rem;fill:currentColor;display:block}.editor-modal-body{padding:16px}.editor-color-select-row{display:flex}.editor-color-select-option{width:28px;height:28px;cursor:pointer;display:flex;align-items:center;justify-content:center}.editor-color-select-option:hover{border-radius:3px;box-sizing:border-box;z-index:3;box-shadow:0 0 4px 1px rgba(0,0,0,.25)}.editor-color-select-option[data-color=""] svg{width:20px;height:20px;fill:#888}.editor-table-creator-row{display:flex}.editor-table-creator-cell{border:1px solid;border-color:#ddd;width:15px;height:15px;cursor:pointer}html.dark-mode .editor-table-creator-cell{border-color:#000}.editor-table-creator-cell.active{background-color:var(--editor-color-primary)}.editor-table-creator-display{text-align:center;padding:.2em}.editor-external-content{min-width:500px;min-height:500px}.editor-external-content h4:first-child{margin-top:0}.editor-image-wrap{position:relative;display:inline-flex}.editor-node-resizer{position:absolute;left:0;right:auto;display:inline-block;outline:2px dashed var(--editor-color-primary);direction:ltr;pointer-events:none}.editor-node-resizer-handle{pointer-events:auto;position:absolute;display:block;width:10px;height:10px;border:2px solid var(--editor-color-primary);z-index:3;background-color:#fff;user-select:none}html.dark-mode .editor-node-resizer-handle{background-color:#000}.editor-node-resizer-handle.nw{inset-inline-start:-5px;inset-block-start:-5px;cursor:nw-resize}.editor-node-resizer-handle.ne{inset-inline-end:-5px;inset-block-start:-5px;cursor:ne-resize}.editor-node-resizer-handle.se{inset-inline-end:-5px;inset-block-end:-5px;cursor:se-resize}.editor-node-resizer-handle.sw{inset-inline-start:-5px;inset-block-end:-5px;cursor:sw-resize}.editor-node-resizer-ghost{opacity:.5;display:none;position:absolute;left:0;top:0;width:100%;height:100%;z-index:2;pointer-events:none;background-color:var(--editor-color-primary)}.editor-node-resizer.active .editor-node-resizer-ghost{display:block}.editor-content-area details[contenteditable=false],.editor-content-area summary[contenteditable=false]{user-select:none}.editor-content-area details[contenteditable=false]>details *{pointer-events:none}.editor-content-area details summary{caret-color:rgba(0,0,0,0)}.editor-content-area details.selected{outline:1px dashed var(--editor-color-primary);outline-offset:1px}.editor-table-marker{position:fixed;background-color:var(--editor-color-primary);z-index:3;user-select:none;opacity:0}.editor-table-marker:hover,.editor-table-marker.active{opacity:.4}.editor-table-marker-column{width:4px;cursor:col-resize}.editor-table-marker-row{height:4px;cursor:row-resize}.editor-code-block-wrap{user-select:none}.editor-code-block-wrap>*{pointer-events:none}.editor-code-block-wrap.selected .cm-editor{border:1px dashed var(--editor-color-primary)}.editor-diagram.selected{outline:2px dashed var(--editor-color-primary)}.editor-media-wrap{display:inline-block;cursor:not-allowed}.editor-media-wrap iframe,.editor-media-wrap video{pointer-events:none}.editor-media-wrap.align-left{float:left}.editor-media-wrap.align-right{float:right}.editor-media-wrap.align-center{display:block;margin-inline:auto}.editor-content-area .task-list-item{margin-left:0;position:relative}.editor-content-area .task-list-item>input[type=checkbox]{display:none}.editor-content-area .task-list-item:before{content:"";display:inline-block;border:2px solid #ccc;width:12px;height:12px;border-radius:2px;margin-right:8px;vertical-align:text-top;cursor:pointer;position:absolute;left:-24px;top:4px}.editor-content-area .task-list-item[checked]:before{background-color:#ccc;background-image:url('data:image/svg+xml;utf8,');background-position:50% 50%;background-size:100% 100%}.editor-form-field-wrapper{margin-bottom:.5rem}.editor-form-field-input{display:block;width:260px;min-width:100px;max-width:100%;border:1px solid;border-color:#ddd;padding:.5rem;border-radius:4px;color:#444}html.dark-mode .editor-form-field-input{border-color:#000}html.dark-mode .editor-form-field-input{color:#bbb}@media screen and (max-width: 400px){.editor-form-field-input{min-width:160px}}textarea.editor-form-field-input{font-family:var(--font-code);width:350px;height:250px;font-size:12px}.editor-form-field-label{color:#444;font-weight:700;font-size:12px}.editor-form-actions{display:flex;justify-content:end;gap:12px;margin-top:16px}.editor-form-actions>button{display:block;font-size:.85rem;line-height:1.4em;padding:7.8px 16px;font-weight:400;border-radius:4px;cursor:pointer;box-shadow:none}.editor-form-actions>button:focus{outline:1px dotted currentColor;outline-offset:-6px;box-shadow:none;filter:brightness(90%)}.editor-form-action-primary{background-color:var(--color-primary);color:#fff;border:1px solid var(--color-primary)}.editor-form-action-primary:hover{box-shadow:0 0 4px 1px #ccc;filter:brightness(110%)}html.dark-mode .editor-form-action-primary:hover{box-shadow:0 0 4px 1px rgba(0,0,0,.5)}.editor-form-action-secondary{border:1px solid;border-color:#ccc;color:#666}html.dark-mode .editor-form-action-secondary{border-color:#666}html.dark-mode .editor-form-action-secondary{color:#aaa}.editor-form-action-secondary:hover,.editor-form-action-secondary:focus,.editor-form-action-secondary:active{color:#444;border:1px solid #ccc;box-shadow:0 1px 4px 0 rgba(0,0,0,.1);background-color:#f2f2f2;background-color:#f8f8f8;filter:none}html.dark-mode .editor-form-action-secondary:hover,html.dark-mode .editor-form-action-secondary:focus,html.dark-mode .editor-form-action-secondary:active{color:#bbb}html.dark-mode .editor-form-action-secondary:hover,html.dark-mode .editor-form-action-secondary:focus,html.dark-mode .editor-form-action-secondary:active{background-color:#444}.editor-form-action-secondary:active{border-color:#bbb;background-color:#ddd;color:#666;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.editor-form-tab-container{display:flex;flex-direction:row;gap:2rem}.editor-form-tab-controls{display:flex;flex-direction:column;align-items:stretch;gap:.25rem}@media screen and (max-width: 880px){.editor-form-tab-container{flex-direction:column;gap:.5rem}.editor-form-tab-controls{flex-direction:row}}.editor-form-tab-control{font-weight:bold;font-size:14px;color:#444;border-bottom:2px solid rgba(0,0,0,0);position:relative;cursor:pointer;padding:.25rem .5rem;text-align:start}html.dark-mode .editor-form-tab-control{color:#666}.editor-form-tab-control[aria-selected=true]{border-color:var(--editor-color-primary);color:var(--editor-color-primary) !important}.editor-form-tab-control[aria-selected=true]:after,.editor-form-tab-control:hover:after{background-color:var(--editor-color-primary);opacity:.15;content:"";display:block;position:absolute;left:0;top:0;width:100%;height:100%}.editor-form-tab-contents{width:260px;max-width:100%}.editor-action-input-container{display:flex;flex-direction:row;align-items:end;justify-content:space-between;gap:.1rem}.editor-action-input-container .editor-button{margin-bottom:12px}.editor-action-input-container input{width:220px}.editor-color-field-container{position:relative}.editor-color-field-container input{padding-left:36px}.editor-color-field-container .editor-dropdown-menu-container{position:absolute;bottom:0}textarea.editor-form-field-input[name=source]{width:1000px;height:600px;max-height:60vh;max-width:80vw}.editor-theme-bold{font-weight:bold}.editor-theme-italic{font-style:italic}.editor-theme-strikethrough{text-decoration-line:line-through}.editor-theme-underline{text-decoration-line:underline}.editor-theme-underline-strikethrough{text-decoration:underline line-through}.cm-editor{font-size:12px;border:1px solid #ddd;line-height:1.4;margin-bottom:24px}.page-content .cm-editor,.CodeMirrorContainer .cm-editor{border-radius:4px}.cm-editor .cm-line{line-height:1.6}.cm-editor .cm-line,.cm-editor .cm-gutter{font-family:var(--font-code)}.dark-mode .cm-editor{border-color:#444}.cm-copy-button{position:absolute;display:flex;align-items:center;justify-content:center;top:-1px;inset-inline-end:-1px;background-color:#eee;border:1px solid #ddd;border-start-end-radius:4px;background-color:#eee;border-color:#ddd;color:#444;line-height:0;cursor:pointer;z-index:5;user-select:none;opacity:0;pointer-events:none;width:32px;height:32px;transition:background-color linear 60ms,color linear 60ms}html.dark-mode .cm-copy-button{background-color:#333}html.dark-mode .cm-copy-button{border-color:#444}html.dark-mode .cm-copy-button{color:#888}.cm-copy-button svg{fill:currentColor}.cm-copy-button.success{background:var(--color-positive);color:#fff}.cm-copy-button:focus{outline:0 !important}.cm-editor:hover .cm-copy-button{user-select:all;opacity:.6;pointer-events:all}.notification{position:fixed;top:0;right:0;margin:32px;padding:16px 24px;background-color:#fff;background-color:#fff;border-radius:4px;border-inline-start:6px solid currentColor;box-shadow:0 1px 6px 1px rgba(22,22,22,.2);z-index:999999;cursor:pointer;max-width:360px;transition:transform ease-in-out 280ms;transform:translateX(580px);display:grid;grid-template-columns:42px 1fr 12px;color:#444;font-weight:700}html.dark-mode .notification{background-color:#444}.notification span,.notification svg{vertical-align:middle;justify-self:center;align-self:center}.notification svg{width:2.8rem;height:2.8rem;padding-inline-end:12px;fill:currentColor}.notification .dismiss{margin-top:-8px}.notification .dismiss svg{height:1rem;color:#444}html.dark-mode .notification .dismiss svg{color:#888}.notification span{vertical-align:middle;line-height:1.3}html.dark-mode .notification span{color:#bbb}.notification.pos{color:var(--color-positive)}.notification.neg{color:var(--color-negative)}.notification.warning{color:var(--color-warning)}.notification.showing{transform:translateX(0)}.notification.showing:hover{transform:translate3d(0, -2px, 0)}.chapter-contents-toggle{cursor:pointer;margin:0;transition:all ease-in-out 180ms;user-select:none}.chapter-contents-toggle svg[data-icon=caret-right]{margin-inline-end:0;font-size:1rem;transition:all ease-in-out 180ms;transform:rotate(0deg);transform-origin:50% 50%}.chapter-contents-toggle.open svg[data-icon=caret-right]{transform:rotate(90deg)}.chapter-contents-toggle svg[data-icon=caret-right]+*{margin-inline-start:3px}[overlay],.popup-background{background-color:rgba(0,0,0,.333);position:fixed;z-index:95536;width:100%;height:100%;min-width:100%;min-height:100%;top:0;left:0;right:0;bottom:0;align-items:center;justify-content:center;display:none}html.dark-mode [overlay],html.dark-mode .popup-background{background-color:rgba(0,0,0,.6)}.popup-body-wrap{display:flex}.popup-body{background-color:#fff;max-height:90%;max-width:1200px;width:90%;height:auto;margin:2% auto;border-radius:4px;box-shadow:0 0 15px 0 rgba(0,0,0,.3);overflow:hidden;z-index:999;display:flex;flex-direction:column;position:relative}html.dark-mode .popup-body{background-color:#333}.popup-body.small{margin:2% auto;width:800px;max-width:90%}.popup-body.very-small{margin:2% auto;width:600px;max-width:90%}.popup-body:before{display:flex;align-self:flex-start}.popup-body .popup-content{overflow-y:auto}.popup-body:focus{outline:0}.popup-header button,.popup-footer button{margin:0;border-radius:0;box-shadow:none;color:#fff;padding:6px 16px;cursor:pointer}.popup-header button:not(.popup-header-close){font-size:.8rem}.popup-header button:hover{background-color:hsla(0,0%,100%,.1)}.popup-footer{justify-content:end;background-color:var(--color-primary-light);min-height:41px}.popup-footer button{padding:10px 16px}.popup-header-close{border:0;color:#fff;font-size:16px;cursor:pointer}.popup-header-close svg{margin-right:0}.popup-header,.popup-footer{display:flex;position:relative;height:40px;flex:0}.popup-header .popup-title,.popup-footer .popup-title{color:#fff;margin-inline-end:auto;padding:8px 16px}.popup-header.flex-container-row,.popup-footer.flex-container-row{display:flex !important}body.flexbox-support #entity-selector-wrap .popup-body .form-group{height:444px;min-height:444px}#entity-selector-wrap .popup-body .form-group{margin:0}.popup-body .entity-selector-container{flex:1}.dropzone-overlay{position:absolute;display:flex;justify-content:center;align-items:center;font-size:1.333rem;width:98%;height:98%;left:1%;top:1%;border-radius:4px;border:1px dashed var(--color-primary);font-style:italic;box-sizing:content-box;background-clip:padding-box;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23a9a9a9' fill-opacity='0.52' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");background-color:var(--color-primary);color:#fff;opacity:.8;z-index:9;pointer-events:none;animation:dzAnimIn 240ms ease-in-out}.dropzone-landing-area{background-color:var(--color-primary-light);padding:16px 24px;width:100%;border:1px dashed var(--color-primary);color:var(--color-primary);border-radius:4px}@keyframes dzAnimIn{0%{opacity:0;transform:scale(0.7)}60%{transform:scale(1.1)}100%{transform:scale(1);opacity:.8}}@keyframes dzFileItemIn{0%{opacity:.5;transform:translateY(28px)}100%{opacity:1;transform:translateY(0)}}@keyframes dzFileItemOut{0%{opacity:1;transform:translateY(0)}100%{opacity:.5;transform:translateY(28px)}}.dropzone-file-item{width:260px;height:80px;position:relative;display:flex;margin:1rem;flex-direction:row;background:#fff;box-shadow:0 1px 6px 1px rgba(22,22,22,.2);border-radius:4px;overflow:hidden;padding-bottom:3px;animation:dzFileItemIn ease-in-out 240ms;transition:transform ease-in-out 120ms,box-shadow ease-in-out 120ms;cursor:pointer}html.dark-mode .dropzone-file-item{background:#444}.dropzone-file-item:hover{transform:translateY(-3px);box-shadow:0 3px 8px 1px rgba(22,22,22,.2)}.dropzone-file-item.dismiss{animation:dzFileItemOut ease-in-out 240ms}.dropzone-file-item .loading-container{text-align:start !important;margin:0}.dropzone-file-item-image-wrap{width:80px;position:relative;background-color:var(--color-primary-light)}.dropzone-file-item-image-wrap img{object-fit:cover;width:100%;height:100%;opacity:.8}.dropzone-file-item-text-wrap{flex:1;display:block;padding:1rem;overflow:auto}.dropzone-file-item-progress{position:absolute;bottom:0;left:0;font-size:0;height:3px;background-color:var(--color-primary);transition:width ease-in-out 240ms}.dropzone-file-item-label{line-height:1.2;margin-bottom:.2rem}.dropzone-file-item-label,.dropzone-file-item-status{align-items:center;font-size:.8rem;font-weight:700}.dropzone-file-item-status[data-status]{display:flex;font-size:.6rem;font-weight:500;line-height:1.2}.dropzone-file-item-status[data-status=success]{color:var(--color-positive)}.dropzone-file-item-status[data-status=error]{color:var(--color-negative)}.dropzone-file-item-status[data-status]+.dropzone-file-item-label{display:none}.image-manager-body{min-height:70vh}.image-manager-filter-bar{position:sticky;top:0;z-index:5;background-color:hsla(0,0%,100%,.85)}html.dark-mode .image-manager-filter-bar{background-color:rgba(80,80,80,.85)}.image-manager-filter-bar-bg{position:absolute;left:0;top:0;width:100%;height:100%;opacity:.15;z-index:-1}.image-manager-filters{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);border-radius:4px;overflow:hidden;border-bottom:0 !important}html.dark-mode .image-manager-filters{border:1px solid #000 !important}.image-manager-filters button{line-height:0;background-color:#fff}html.dark-mode .image-manager-filters button{background-color:#333}.image-manager-filters svg{margin:0}.image-manager-list{padding:3px;display:grid;grid-template-columns:repeat(auto-fill, minmax(max(140px, 17%), 1fr));gap:3px;z-index:3}.image-manager-list>div{aspect-ratio:1}.image-manager-list .image{display:block;position:relative;border-radius:0;margin:0;width:100%;text-align:start;padding:0;cursor:pointer;aspect-ratio:1;border-color:#ddd;transition:all linear 80ms;overflow:hidden}html.dark-mode .image-manager-list .image{border-color:#000}.image-manager-list .image.selected{background-color:var(--color-primary-light);outline:currentColor 3px solid;border-radius:3px;transform:scale3d(0.95, 0.95, 0.95)}.image-manager-list .image img{width:100%;max-width:100%;display:block;object-fit:cover;height:auto}.image-manager-list .image .image-meta{opacity:0;position:absolute;width:100%;bottom:0;left:0;color:#eee;background-color:rgba(0,0,0,.7);font-size:10px;padding:3px 4px;pointer-events:none;transition:opacity ease-in-out 80ms}.image-manager-list .image .image-meta span{display:block}.image-manager-list .image.selected .image-meta,.image-manager-list .image:hover .image-meta,.image-manager-list .image:focus .image-meta{opacity:1}@media screen and (max-width: 880px){.image-manager-list .image .image-meta{display:none}}.image-manager .load-more{text-align:center;padding:12px 16px;clear:both}.image-manager .load-more .loading-container{margin:0}.image-manager .loading-container{text-align:center}.image-manager-list .image-manager-list-warning{grid-column:1/-1;aspect-ratio:auto}.image-manager-warning{background:#fff;color:var(--color-warning);font-weight:bold;border-inline:3px solid var(--color-warning)}html.dark-mode .image-manager-warning{background:#333}.image-manager-sidebar{width:300px;margin:0 auto;overflow-y:auto;overflow-x:hidden;border-inline-start:1px solid #ddd;border-color:#ddd}html.dark-mode .image-manager-sidebar{border-color:#000}.image-manager-sidebar .inner{min-height:auto;padding:16px}.image-manager-sidebar .image-manager-viewer img{max-width:100%;max-height:180px;display:block;margin:0 auto 16px auto;box-shadow:0 1px 21px 1px rgba(76,76,76,.3)}.image-manager-sidebar .image-manager-viewer{height:196px;display:flex;align-items:center;justify-content:center}.image-manager-sidebar .image-manager-viewer a{display:inline-block}@media screen and (max-width: 880px){.image-manager-sidebar{border-inline-start:0}}.image-manager-content{display:flex;flex-direction:column;flex:1;overflow-y:scroll}.image-manager-content .container{width:100%}.image-manager-content .full-tab{text-align:center}.tab-container.bordered [role=tablist] button[role=tab]{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd}html.dark-mode .tab-container.bordered [role=tablist] button[role=tab]{border-inline-end-color:#000}.tab-container.bordered [role=tablist] button[role=tab]:last-child{border-inline-end:none}.tab-container [role=tablist]{display:flex;align-items:end;justify-items:start;text-align:start;border-bottom:1px solid #ddd;border-color:#ddd;margin-bottom:16px}html.dark-mode .tab-container [role=tablist]{border-color:#444}.tab-container [role=tablist] button[role=tab]{display:inline-block;padding:12px;color:rgba(0,0,0,.5);cursor:pointer;border-bottom:2px solid rgba(0,0,0,0);margin-bottom:-1px}html.dark-mode .tab-container [role=tablist] button[role=tab]{color:hsla(0,0%,100%,.5)}.tab-container [role=tablist] button[role=tab][aria-selected=true]{color:var(--color-link) !important;border-bottom-color:var(--color-link) !important;outline:0 !important}.tab-container [role=tablist] button[role=tab]:hover,.tab-container [role=tablist] button[role=tab]:focus{color:rgba(0,0,0,.8);border-bottom-color:rgba(0,0,0,.2)}html.dark-mode .tab-container [role=tablist] button[role=tab]:hover,html.dark-mode .tab-container [role=tablist] button[role=tab]:focus{color:hsla(0,0%,100%,.8)}html.dark-mode .tab-container [role=tablist] button[role=tab]:hover,html.dark-mode .tab-container [role=tablist] button[role=tab]:focus{border-bottom-color:hsla(0,0%,100%,.2)}.tab-container [role=tablist] button[role=tab]:focus{outline:1px dotted var(--color-primary);outline-offset:-2px}.tab-container [role=tablist].controls-card{margin-bottom:0;border-bottom:0;padding:0 6px}.tab-container [role=tabpanel].no-outline:focus{outline:none}.image-picker .none{display:none}.code-editor .CodeMirror{height:auto;min-height:50vh;border-bottom:0}.code-editor .lang-options{overflow-y:scroll;flex-basis:200px;flex-grow:1}.code-editor .lang-options button{display:block;padding:6px 16px;border-bottom:1px solid;color:#333;border-bottom-color:#eee;cursor:pointer;width:100%;text-align:left;font-family:var(--font-code);font-size:.7rem;padding-left:30px}html.dark-mode .code-editor .lang-options button{color:#aaa}html.dark-mode .code-editor .lang-options button{border-bottom-color:#000}.code-editor .lang-options button:hover,.code-editor .lang-options button.active{background-color:var(--color-primary-light);color:var(--color-primary)}.code-editor button.lang-option-favorite-toggle{position:absolute;top:0;left:0;width:28px;font-size:1rem;border:0;line-height:1;padding:2px;z-index:2;height:100%;text-align:center;color:var(--color-primary)}.code-editor button.lang-option-favorite-toggle svg{margin:0}.code-editor button[data-favourite=true]~.action-favourite,.code-editor button[data-favourite=false]~.action-unfavourite{display:none}.code-editor .action-favourite{opacity:.5}.code-editor button:hover~.action-favourite{opacity:1}.code-editor label{background-color:var(--color-primary-light);width:100%;color:var(--color-primary);padding:3px 12px;margin-bottom:0}.code-editor-language-list{position:relative;width:160px;z-index:2;align-items:stretch}.code-editor-language-list input{border-radius:0;border:0;border-bottom:1px solid #ddd;padding:6px 12px;height:auto}.code-editor-main{flex:1;min-width:0}.code-editor-main .cm-editor{margin-bottom:0;z-index:1;max-width:100%;width:100%}.code-editor-body-wrap{height:80vh}@media screen and (max-width: 600px){.code-editor .lang-options{display:none}.code-editor-body-wrap{flex-direction:column}.code-editor-language-list,.code-editor-language-list input{width:100%}}.comments-container{padding-inline:32px}@media screen and (max-width: 880px){.comments-container{padding-inline:6px}}.comment-box{border-radius:4px;border:1px solid #ddd;border-color:#ddd;background-color:#fff}html.dark-mode .comment-box{border-color:#000}html.dark-mode .comment-box{background-color:#222}.comment-box .content{font-size:.666em;padding:6px 12px}.comment-box .content p,.comment-box .content ul,.comment-box .content ol{font-size:14px;margin:.5em 0}.comment-box .actions{opacity:0;transition:opacity ease-in-out 120ms}.comment-box:hover .actions,.comment-box:focus-within .actions{opacity:1}.comment-box .actions button:focus{outline:1px dotted var(--color-primary)}@media screen and (max-width: 880px){.comment-box .actions{opacity:1}}.comment-box .header{border-bottom:1px solid #ddd;padding:6px 12px;border-color:#ddd}html.dark-mode .comment-box .header{border-color:#000}.comment-box .header a{color:inherit}.comment-box .header .text-muted{color:#999}.comment-box .header .meta a,.comment-box .header .meta span{white-space:nowrap}.comment-box .header .right-meta .text-muted{opacity:.8}.comment-thread-indicator{border-inline-start:3px dotted #ddd;border-color:#ddd;margin-inline-start:6px;width:24px;height:calc(100% - 16px)}html.dark-mode .comment-thread-indicator{border-color:#444}.comment-reference-indicator-wrap a{float:left;margin-top:6px;font-size:12px;display:inline-block;font-weight:bold;position:relative;border-radius:4px;overflow:hidden;padding:2px 6px 2px 0;margin-inline-end:6px;color:var(--color-link)}.comment-reference-indicator-wrap a span{display:none}.comment-reference-indicator-wrap a.outdated span{display:inline}.comment-reference-indicator-wrap a.outdated.missing{color:var(--color-warning);pointer-events:none}.comment-reference-indicator-wrap a svg{width:24px;margin-inline-end:0}.comment-reference-indicator-wrap a:after{background-color:currentColor;content:"";width:100%;height:100%;position:absolute;left:0;top:0;opacity:.15}.comment-reference-indicator-wrap a[href="#"]{color:#444;pointer-events:none}.comment-branch .comment-box{margin-bottom:16px}.comment-branch .comment-branch .comment-branch .comment-branch .comment-thread-indicator{display:none}.comment-reply{display:none;margin:0 !important;margin-bottom:-3px !important}.comment-branch .comment-branch .comment-branch .comment-branch .comment-reply{display:block}.comment-container .empty-state{display:none}.comment-container:not(:has([component=page-comment])) .empty-state{display:block}.comment-container-compact .comment-box{margin-bottom:6px}.comment-container-compact .comment-box .meta{font-size:.8rem}.comment-container-compact .comment-box .header{padding:6px}.comment-container-compact .comment-box .right-meta{display:none}.comment-container-compact .comment-box .content{padding:6px 12px}.comment-container-compact .comment-thread-indicator{width:16px}.comment-container-super-compact .comment-box .meta{font-size:12px}.comment-container-super-compact .comment-box .avatar{width:22px;height:22px;margin-inline-end:2px !important}.comment-container-super-compact .comment-box .content{padding:3px 12px;line-height:1.2}.comment-container-super-compact .comment-box .content p{font-size:12px}.comment-container-super-compact .comment-thread-indicator{width:9px;margin-inline-start:3px}#tag-manager .drag-card{max-width:500px}.template-item{cursor:pointer;position:relative}.template-item:hover,.template-item .template-item-actions button:hover{background-color:#f2f2f2}.template-item .template-item-actions{position:absolute;top:0;inset-inline-end:0;width:50px;height:100%;display:flex;flex-direction:column;border-inline-start:1px solid;border-color:#ddd}html.dark-mode .template-item .template-item-actions{border-color:#000}.template-item .template-item-actions button{cursor:pointer;flex:1;background-color:#fff;border:0;border-top:1px solid;border-color:#ddd}html.dark-mode .template-item .template-item-actions button{background-color:#222}html.dark-mode .template-item .template-item-actions button{border-color:#000}.template-item .template-item-actions button svg{margin:0}.template-item .template-item-actions button:first-child{border-top:0}.dropdown-search{position:relative}.dropdown-search-toggle-breadcrumb{border:1px solid rgba(0,0,0,0);border-radius:4px;line-height:normal;padding:6px;opacity:.6;cursor:pointer}.dropdown-search-toggle-breadcrumb:hover{opacity:1;border-color:#ddd}html.dark-mode .dropdown-search-toggle-breadcrumb:hover{border-color:#444}.dropdown-search-toggle-breadcrumb .svg-icon{margin-inline-end:0}.dropdown-search-toggle-select{display:flex;gap:12px;line-height:normal}.dropdown-search-toggle-select .svg-icon{height:26px;width:26px;margin:0}.dropdown-search-toggle-select .avatar{height:22px;width:22px}.dropdown-search-toggle-select .avatar+span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-search-toggle-select .dropdown-search-toggle-caret{font-size:1.15rem}.dropdown-search-toggle-select-label{min-width:0;white-space:nowrap}.dropdown-search-toggle-select-caret{line-height:0;margin-left:auto;margin-top:-2px;display:flex;align-items:center}.dropdown-search-dropdown{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);overflow:hidden;min-height:100px;width:240px;display:none;position:absolute;z-index:80;right:0;top:0;margin-top:16px}html[dir=rtl] .dropdown-search-dropdown{right:auto;left:-16px}.dropdown-search-dropdown .dropdown-search-search .svg-icon{position:absolute;left:12px;top:11px;fill:#888;pointer-events:none}html[dir=rtl] .dropdown-search-dropdown .dropdown-search-search .svg-icon{right:12px;left:auto}.dropdown-search-dropdown .dropdown-search-list{max-height:400px;overflow-y:scroll;text-align:start}.dropdown-search-dropdown .dropdown-search-item{padding:12px 16px}.dropdown-search-dropdown .dropdown-search-item:hover,.dropdown-search-dropdown .dropdown-search-item:focus{background-color:#f2f2f2;text-decoration:none}.dropdown-search-dropdown input,.dropdown-search-dropdown input:focus{padding-inline-start:32px;border-radius:0;border:0;border-bottom:1px solid #ddd}.dropdown-search-dropdown input:focus{outline:0}@media screen and (max-width: 1000px){.dropdown-search-dropdown{inset-inline:16px auto}.dropdown-search-dropdown .dropdown-search-list{max-height:240px}}.item-list{box-shadow:0 1px 3px 0 rgba(0,0,0,.1)}.item-list-row{border:1.5px solid;border-color:#e2e2e2;border-bottom-width:0}html.dark-mode .item-list-row{border-color:#444}.item-list-row label{padding-bottom:0}.item-list-row:hover{background-color:#f6f6f6}html.dark-mode .item-list-row:hover{background-color:#333}.item-list-row:first-child{border-radius:4px 4px 0 0}.item-list-row:last-child{border-radius:0 0 4px 4px;border-bottom-width:1.5px}.item-list-row:first-child:last-child{border-radius:4px}.item-list-row-toggle-all{visibility:hidden}.item-list-row:hover .item-list-row-toggle-all{visibility:visible}.status-indicator-active,.status-indicator-inactive{width:8px;height:8px;border-radius:50%;display:inline-block}.status-indicator-active{background-color:var(--color-positive)}.status-indicator-inactive{background-color:var(--color-negative)}.shortcut-container{background-color:rgba(0,0,0,.25);pointer-events:none;position:fixed;left:0;top:0;width:100%;height:100%;z-index:99}.shortcut-linkage{position:fixed;box-shadow:0 0 4px 0 #fff;border-radius:3px}.shortcut-hint{position:fixed;padding:3px 3px;font-size:.85rem;font-weight:700;line-height:1;background-color:#eee;border-radius:3px;border:1px solid #b4b4b4;box-shadow:0 1px 1px rgba(0,0,0,.2),0 2px 0 0 hsla(0,0%,100%,.7) inset;color:#333}.back-to-top{background-color:var(--color-primary);position:fixed;bottom:16px;right:24px;padding:5px 7px;cursor:pointer;color:#fff;fill:#fff;width:40px;height:40px;border-radius:40px;transition:all ease-in-out 180ms;opacity:0;z-index:999;overflow:hidden}.back-to-top svg{width:26.6666666667px;height:26.6666666667px;margin-inline-end:4px}.back-to-top:hover{width:136px;opacity:1 !important}.back-to-top .inner{width:136px}.back-to-top span{position:relative;vertical-align:top;line-height:2}.scroll-box{list-style:none;padding:0;margin:0;max-height:280px;overflow-y:scroll;border:1px solid;border-color:#ddd;border-radius:3px;min-height:20px;background-color:#eee}html.dark-mode .scroll-box{border-color:#000}html.dark-mode .scroll-box{background-color:#000}.scroll-box-item{border-bottom:1px solid;border-top:1px solid;border-color:#ddd;margin-top:-1px;background-color:#fff;display:flex;align-items:flex-start;padding:1px}html.dark-mode .scroll-box-item{border-color:#000}html.dark-mode .scroll-box-item{background-color:#222}.scroll-box-item:last-child{border-bottom:0}.scroll-box-item:hover{cursor:pointer;background-color:#f8f8f8}html.dark-mode .scroll-box-item:hover{background-color:#333}.scroll-box-item.items-center{align-items:center}.scroll-box-item .handle{color:#aaa;cursor:grab}.scroll-box-item button{opacity:.6;line-height:1}.scroll-box-item .handle svg{margin:0}.scroll-box-item>*{padding:6px 16px}.scroll-box-item .handle+*{padding-left:0}.scroll-box-item:hover .handle{color:#444}html.dark-mode .scroll-box-item:hover .handle{color:#fff}.scroll-box-item:hover button{opacity:1}.scroll-box-item a:hover{text-decoration:none}input.scroll-box-search,.scroll-box-header-item{font-size:.8rem;border:1px solid;border-color:#ddd;background-color:#fff;margin-bottom:-1px;border-radius:3px 3px 0 0;width:100%;max-width:100%;height:auto;line-height:1.4;color:#666}html.dark-mode input.scroll-box-search,html.dark-mode .scroll-box-header-item{border-color:#000}html.dark-mode input.scroll-box-search,html.dark-mode .scroll-box-header-item{background-color:#222}.scroll-box-search+.scroll-box,.scroll-box-header-item+.scroll-box{border-radius:0 0 3px 3px}.scroll-box.configured-option-list [data-action=add]{display:none}.scroll-box.available-option-list [data-action=remove],.scroll-box.available-option-list [data-action=move_up],.scroll-box.available-option-list [data-action=move_down]{display:none}.scroll-box>li.empty-state{display:none}.scroll-box>li.empty-state:last-child{display:list-item}details.section-expander summary{border-top:1px solid #ddd;border-color:#ddd;font-weight:bold;font-size:12px;color:#888;cursor:pointer;padding-block:6px}html.dark-mode details.section-expander summary{border-color:#000}details.section-expander:open summary{margin-bottom:12px}details.section-expander{border-bottom:1px solid #ddd;border-color:#ddd}html.dark-mode details.section-expander{border-color:#000}header.grid{grid-template-columns:minmax(max-content, 2fr) 1fr minmax(max-content, 2fr)}@media screen and (max-width: 1000px){header.grid{grid-template-columns:1fr;grid-row-gap:0}}header{position:relative;display:block;z-index:11;top:0;color:#fafafa;border-bottom:1px solid #ddd;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);border-bottom-color:#ddd}html.dark-mode header{border-bottom-color:#000}header .header-links{display:flex;align-items:center;justify-content:end}header .links{display:inline-block;vertical-align:top}header .links a{display:inline-block;padding:10px 16px;color:#fff;border-radius:3px}header .links a:hover{text-decoration:none;background-color:hsla(0,0%,100%,.15)}header .dropdown-container{padding-inline-start:16px;padding-inline-end:0}header .avatar,header .user-name{display:inline-block}header .avatar{width:30px;height:30px}header .user-name{vertical-align:top;position:relative;display:inline-flex;align-items:center;cursor:pointer;padding:12px;margin:0 -12px;border-radius:3px;gap:6px;color:#fff}header .user-name>span{padding-inline-start:6px;display:inline-block;line-height:1}header .user-name>svg{font-size:18px;margin-top:-2px;margin-inline-end:0}header .user-name:hover{background-color:hsla(0,0%,100%,.15)}@media screen and (min-width: 1001px)and (max-width: 1100px){header .user-name{padding-inline-start:6px}header .user-name .name{display:none}}.header *,.primary-background *{outline-color:#fff}header .search-box{display:inline-block}header .search-box input{background-color:rgba(0,0,0,.2);border:1px solid hsla(0,0%,100%,.2);border-radius:40px;color:#eee;z-index:2;height:auto;padding:9px;padding-inline-start:40px}header .search-box input:focus{outline:none;border:1px solid hsla(0,0%,100%,.4)}header .search-box input::placeholder{color:#fff;opacity:.6}@media screen and (min-width: 1001px)and (max-width: 1100px){header .search-box{max-width:200px}}header .search-box:focus-within #header-search-box-button{opacity:1}#header-search-box-button{z-index:1;inset-inline-start:16px;top:10px;color:#fff;opacity:.6;color:hsla(0,0%,100%,.8)}html.dark-mode #header-search-box-button{color:#aaa}#header-search-box-button svg{margin-inline-end:0}.global-search-suggestions{display:none;position:absolute;top:-12px;left:0;right:0;z-index:-1;margin-left:-48px;margin-right:-48px;padding-top:56px;border-radius:3px;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);transform-origin:top center;opacity:.5;transform:scale(0.9)}.global-search-suggestions .entity-item-snippet p{display:none}.global-search-suggestions .entity-item-snippet{font-size:.8rem}.global-search-suggestions .entity-list-item-name{font-size:.9rem;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.global-search-suggestions .global-search-loading{position:absolute;width:100%}header .search-box.search-active:focus-within .global-search-suggestions{display:block}header .search-box.search-active:focus-within input{background-color:#eee;border-color:#ddd}html.dark-mode header .search-box.search-active:focus-within input{background-color:#333}html.dark-mode header .search-box.search-active:focus-within input{border-color:#111}header .search-box.search-active:focus-within #header-search-box-button,header .search-box.search-active:focus-within input{color:#444}html.dark-mode header .search-box.search-active:focus-within #header-search-box-button,html.dark-mode header .search-box.search-active:focus-within input{color:#aaa}.logo{display:inline-flex;padding:6px 12px;margin:6px -12px;gap:12px;align-items:center;border-radius:4px}.logo:hover{color:#fff;text-decoration:none;background-color:hsla(0,0%,100%,.15)}.logo-text{font-size:1.8em;color:#fff;font-weight:400;line-height:1}.logo-image{height:43px}.mobile-menu-toggle{color:#fff;fill:#fff;font-size:2em;border:2px solid hsla(0,0%,100%,.8);border-radius:4px;padding:0 6px;line-height:1;cursor:pointer;user-select:none}.mobile-menu-toggle svg{margin:0;bottom:-2px}@media screen and (max-width: 1000px){header .header-links{background-color:#fff;display:none;z-index:10;inset-inline-end:16px;border-radius:4px;overflow:hidden;position:absolute;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);margin-top:16px;padding:6px 0}html.dark-mode header .header-links{background-color:#333}header .header-links.show{display:block}header .links a,header .dropdown-container ul li a,header .dropdown-container ul li button{text-align:start;display:grid;align-items:center;padding:8px 16px;gap:16px;color:#444;grid-template-columns:16px auto;line-height:1.4;color:#444}html.dark-mode header .links a,html.dark-mode header .dropdown-container ul li a,html.dark-mode header .dropdown-container ul li button{color:#eee}header .links a svg,header .dropdown-container ul li a svg,header .dropdown-container ul li button svg{margin-inline-end:12px;width:16px}header .links a:hover,header .dropdown-container ul li a:hover,header .dropdown-container ul li button:hover{background-color:var(--color-primary-light);color:var(--color-primary);text-decoration:none}header .links a:focus,header .dropdown-container ul li a:focus,header .dropdown-container ul li button:focus{background-color:#eee;outline-color:var(--color-primary);color:var(--color-primary)}html.dark-mode header .links a:focus,html.dark-mode header .dropdown-container ul li a:focus,html.dark-mode header .dropdown-container ul li button:focus{background-color:#333}header .dropdown-container{display:block;padding-inline-start:0}header .links{display:block}header .dropdown-container ul{display:block !important;position:relative;background-color:rgba(0,0,0,0);border:0;padding:0;margin:0;box-shadow:none}}.tri-layout-mobile-tabs{position:sticky;top:0;z-index:5;background-color:#fff;border-bottom:1px solid #ddd;border-bottom-color:#ddd;box-shadow:0 1px 6px -1px rgba(0,0,0,.1)}html.dark-mode .tri-layout-mobile-tabs{border-bottom-color:#333}.tri-layout-mobile-tab{text-align:center;border-bottom:3px solid #bbb;cursor:pointer;margin:0;background-color:#fff;border-bottom-color:#bbb}html.dark-mode .tri-layout-mobile-tab{background-color:#222}html.dark-mode .tri-layout-mobile-tab{border-bottom-color:#333}.tri-layout-mobile-tab:first-child{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd}html.dark-mode .tri-layout-mobile-tab:first-child{border-inline-end-color:#000}.tri-layout-mobile-tab[aria-selected=true]{border-bottom-color:currentColor !important}.breadcrumbs{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;opacity:.7}.breadcrumbs .icon-list-item{width:auto;padding-top:6px;padding-bottom:6px}.breadcrumbs .separator{display:inline-block;fill:#aaa;font-size:1.6em;line-height:.8;margin:-2px 0 0}.breadcrumbs:hover,.breadcrumbs:focus-within{opacity:1}@media(prefers-contrast: more){.breadcrumbs{opacity:1}}@media screen and (max-width: 1000px){.breadcrumbs .icon-list-item{padding:6px}.breadcrumbs .icon-list-item>span+span{display:none}.breadcrumbs .icon-list-item>span:first-child{margin-inline-end:0}}.faded a,.faded button,.faded span,.faded span>div{color:#666;fill:#666}.faded .text-button{opacity:.5;transition:all ease-in-out 120ms}.faded .text-button:hover{opacity:1;text-decoration:none}.faded span.faded-text{display:inline-block;padding:12px}footer{flex-shrink:0;padding:1rem 1rem 2rem 1rem;text-align:center}footer a{margin:0 .5em}body.flexbox footer{display:none}.book-contents .entity-list-item .icon{width:4px;border-radius:1px;justify-self:stretch;align-self:stretch;height:auto;margin-inline-end:6px}.book-contents .entity-list-item .icon:after{opacity:.5}.book-contents .entity-list-item .icon svg{display:none}.book-contents .entity-list-item p{margin-bottom:0}.book-contents .entity-list-item .inner-page{padding-top:0;padding-bottom:0}.entity-list-item+.chapter-expansion{display:flex;padding:0 16px 16px 16px;align-items:center;border:0;width:100%;position:relative}.entity-list-item+.chapter-expansion>.icon{width:4px;height:auto;border-radius:0 0 1px 1px;align-self:stretch;flex-shrink:0}.entity-list-item+.chapter-expansion>.icon:before{position:absolute;top:0;left:0;width:100%;height:1px;background-color:currentColor;content:"";opacity:.5}.entity-list-item+.chapter-expansion>.icon:after{opacity:.5}.entity-list-item+.chapter-expansion .icon svg{display:none}.entity-list-item+.chapter-expansion>.content{flex:1}.entity-list-item+.chapter-expansion .chapter-contents-toggle{border-radius:0 4px 4px 0;padding:6px 19px;width:100%;text-align:start}.entity-list-item+.chapter-expansion .chapter-contents-toggle:hover{background-color:rgba(0,0,0,.06)}.entity-list-item.has-children{padding-bottom:0}.entity-list-item.has-children>.icon{border-radius:4px 4px 0 0}.inset-list{display:none}.inset-list .entity-list-item-name{font-size:1rem}.inset-list .entity-list-item-children{padding-top:0;padding-bottom:0}.sidebar-page-nav{list-style:none;margin-block-start:12px;margin-block-end:16px;margin-inline-start:6px;margin-inline-end:0;position:relative}.sidebar-page-nav:after{content:"";display:block;position:absolute;left:0;background-color:rgba(0,0,0,.2);width:2px;top:5px;bottom:5px;z-index:0}html[dir=rtl] .sidebar-page-nav:after{left:auto;right:0}html.dark-mode .sidebar-page-nav:after{background-color:hsla(0,0%,100%,.2)}.sidebar-page-nav li{margin-bottom:4px;font-size:.95em;position:relative}.sidebar-page-nav .h1{padding-inline-start:16px}.sidebar-page-nav .h2{padding-inline-start:24px}.sidebar-page-nav .h3{padding-inline-start:32px}.sidebar-page-nav .h4{padding-inline-start:40px}.sidebar-page-nav .h5{padding-inline-start:48px}.sidebar-page-nav .h6{padding-inline-start:56px}.sidebar-page-nav .current-heading{font-weight:bold}.sidebar-page-nav li:not(.current-heading) .sidebar-page-nav-bullet{background-color:#bbb !important}html.dark-mode .sidebar-page-nav li:not(.current-heading) .sidebar-page-nav-bullet{background-color:#666 !important}.sidebar-page-nav .sidebar-page-nav-bullet{width:6px;height:6px;position:absolute;left:-2px;top:30%;border-radius:50%;box-shadow:0 0 0 6px #f2f2f2;box-shadow:0 0 0 6px #f2f2f2;z-index:1}html.dark-mode .sidebar-page-nav .sidebar-page-nav-bullet{box-shadow:0 0 0 6px #111}html[dir=rtl] .sidebar-page-nav .sidebar-page-nav-bullet{left:auto;right:-2px}.book-tree .sidebar-page-list{list-style:none;margin-block-start:6px;margin-block-end:0;margin-inline-start:-12px;margin-inline-end:-12px;padding-inline-start:0;padding-inline-end:0}.book-tree .sidebar-page-list ul{list-style:none;padding-inline-start:1rem;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item{padding-top:2px;padding-bottom:2px;background-clip:content-box;border-radius:0 3px 3px 0;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item .content{width:100%;padding-top:6px;padding-bottom:6px;max-width:calc(100% - 20px)}.book-tree .sidebar-page-list .entity-list-item.selected{background-color:rgba(0,0,0,.06)}html.dark-mode .book-tree .sidebar-page-list .entity-list-item.selected{background-color:hsla(0,0%,100%,.06)}.book-tree .sidebar-page-list .entity-list-item.no-hover{margin-top:-6px;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item-name{font-size:1em;margin:0;margin-inline-end:16px}.book-tree .sidebar-page-list .chapter-child-menu{font-size:.8rem;margin-top:-0.2rem;margin-inline-start:-1rem}.book-tree .sidebar-page-list .chapter-contents-toggle{display:block;width:100%;text-align:start;padding:3px 12px 6px 12px;border-radius:0 3px 3px 0;line-height:1;margin-top:-3px;margin-bottom:-3px}.book-tree .sidebar-page-list .chapter-contents-toggle:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .book-tree .sidebar-page-list .chapter-contents-toggle:hover{background-color:hsla(0,0%,100%,.06)}.book-tree .sidebar-page-list .entity-list-item .icon{z-index:2;width:4px;height:auto;align-self:stretch;flex-shrink:0;border-radius:1px;opacity:.8}.book-tree .sidebar-page-list .entity-list-item .icon:after{opacity:1}.book-tree .sidebar-page-list .entity-list-item .icon svg{display:none}.chapter-child-menu ul.sub-menu{display:none;padding-inline-start:0;position:relative;margin-bottom:0}.sortable-page-list,.sortable-page-sublist{list-style:none}.sort-box{margin-bottom:16px;padding:16px 32px;position:relative}.sort-box summary:focus{outline:1px dashed var(--color-primary);outline-offset:5px}.sort-box::before{pointer-events:none;content:"";border-radius:4px;opacity:.5;border:2px solid var(--color-book);display:block;top:0;bottom:0;left:0;right:0;position:absolute}.sort-box-options{display:flex;flex-wrap:wrap;justify-content:space-between}.sort-box-options .button{margin-inline-start:0}.sortable-page-list{margin-inline-start:0;padding:0}.sortable-page-list .entity-list-item>span:first-child{align-self:flex-start}.sortable-page-list .sortable-selected,.sortable-page-list .sortable-selected:hover{outline:1px dotted var(--color-primary);background-color:var(--color-primary-light) !important}.sortable-page-list .entity-list-item>div{display:block;flex:1}.sortable-page-list>ul{margin-inline-start:0}.sortable-page-list .sortable-page-sublist{margin-bottom:16px;margin-top:0;padding-inline-start:16px}.sortable-page-list li{background-color:#fff;border:1px solid;border-color:#ddd;margin-top:-1px;min-height:38px}html.dark-mode .sortable-page-list li{background-color:#222}html.dark-mode .sortable-page-list li{border-color:#666}.sortable-page-list li.text-page,.sortable-page-list li.text-chapter{border-inline-start:2px solid currentColor}.sortable-page-list li:first-child{margin-top:6px}.sortable-page-list li.placeholder{position:relative}.sortable-page-list li.placeholder:before{position:absolute}.sort-box summary{list-style:none;font-size:.9rem;cursor:pointer}.sort-box summary::-webkit-details-marker{display:none}details.sort-box summary .caret-container svg{transition:transform ease-in-out 120ms}details.sort-box[open] summary .caret-container svg{transform:rotate(90deg)}.sort-box-actions .icon-button{opacity:.6}.sort-box .flex-container-row:hover .sort-box-actions .icon-button,.sort-box .flex-container-row:focus-within .sort-box-actions .icon-button{opacity:1}.sort-box-actions .icon-button[disabled]{visibility:hidden}.sort-box-actions .dropdown-menu button[disabled]{display:none}.sort-list-handle{cursor:grab}.activity-list-item{padding:12px 0;display:grid;grid-template-columns:min-content 1fr;grid-column-gap:16px;font-size:.9em}.card .activity-list-item{padding-block:12px}.user-list-item{display:inline-grid;padding:12px;grid-template-columns:min-content 1fr;grid-column-gap:16px;font-size:.9em;align-items:center}.user-list-item>div:first-child{line-height:0}ul.pagination{display:inline-flex;list-style:none;margin:16px 0;padding-inline-start:1px}ul.pagination li:first-child a,ul.pagination li:first-child span{border-radius:3px 0 0 3px}ul.pagination li:last-child a,ul.pagination li:last-child span{border-radius:0 3px 3px 0}ul.pagination a,ul.pagination span{display:block;padding:3px 12px;border:1px solid #ccc;margin-inline-start:-1px;user-select:none;color:#555;border-color:#ccc}html.dark-mode ul.pagination a,html.dark-mode ul.pagination span{color:#eee}html.dark-mode ul.pagination a,html.dark-mode ul.pagination span{border-color:#666}ul.pagination li.disabled{cursor:not-allowed}ul.pagination li.active span{color:#111;background-color:rgba(0,0,0,.05)}html.dark-mode ul.pagination li.active span{color:#eee}html.dark-mode ul.pagination li.active span{background-color:rgba(0,0,0,.5)}.compact ul.pagination{margin:0}.entity-list,.icon-list{margin:0 -16px}.entity-list h4,.icon-list h4{margin:0}.entity-list hr,.icon-list hr{margin:0}.entity-list .text-small.text-muted,.icon-list .text-small.text-muted{color:#aaa;font-size:.75em;margin-top:6px}.entity-list .text-muted p.text-muted,.icon-list .text-muted p.text-muted{margin-top:0}.entity-list .page.draft .text-page,.icon-list .page.draft .text-page{color:var(--color-page-draft);fill:var(--color-page-draft)}.entity-list>.dropdown-container,.icon-list>.dropdown-container{display:block}.icon-list hr{margin:12px 16px;max-width:140px;opacity:.25;height:1.1px}.icon-list hr+hr,.icon-list hr:first-child,.icon-list hr:last-child{display:none}.entity-list-item,.icon-list-item{padding:12px 16px;display:flex;align-items:center;gap:16px;background-color:rgba(0,0,0,0);border:0;width:100%;position:relative;word-break:break-word}.entity-list-item h4 a,.icon-list-item h4 a{color:#666}.entity-list-item>span:first-child,.icon-list-item>span:first-child{flex-basis:1.88em;flex:none}.entity-list-item>span:last-child,.icon-list-item>span:last-child{flex:1;text-align:start}.entity-list-item>.content,.icon-list-item>.content{min-width:0}.entity-list-item:not(.no-hover),.icon-list-item:not(.no-hover){cursor:pointer}.entity-list-item:not(.no-hover):hover,.icon-list-item:not(.no-hover):hover{background-color:rgba(0,0,0,.06);text-decoration:none;border-radius:4px}html.dark-mode .entity-list-item:not(.no-hover):hover,html.dark-mode .icon-list-item:not(.no-hover):hover{background-color:hsla(0,0%,100%,.06)}.entity-list-item.outline-hover:hover,.icon-list-item.outline-hover:hover{background-color:rgba(0,0,0,0)}.entity-list-item:focus,.icon-list-item:focus{background-color:#eee;outline:1px dotted #666;outline-offset:-2px}html.dark-mode .entity-list-item:focus,html.dark-mode .icon-list-item:focus{background-color:#222}.entity-list-item.disabled{pointer-events:none;cursor:not-allowed;opacity:.8;user-select:none;background:var(--bg-disabled)}.entity-list-item-path-sep{display:inline-block;vertical-align:top;position:relative;top:1px}.entity-list-item-path-sep svg{margin-inline-end:0}.split-icon-list-item{display:flex;align-items:center;gap:16px;background-color:rgba(0,0,0,0);border:0;width:100%;position:relative;word-break:break-word;border-radius:4px}.split-icon-list-item>a{padding:12px 16px;display:flex;align-items:center;gap:16px;flex:1}.split-icon-list-item>a:hover{text-decoration:none}.split-icon-list-item .icon{flex-basis:1.88em;flex:none}.split-icon-list-item:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .split-icon-list-item:hover{background-color:hsla(0,0%,100%,.06)}.icon-list-item-dropdown{margin-inline-start:auto;align-self:stretch;display:flex;align-items:stretch;border-inline-start:1px solid rgba(0,0,0,.1);visibility:hidden}.split-icon-list-item:hover .icon-list-item-dropdown,.split-icon-list-item:focus-within .icon-list-item-dropdown{visibility:visible}.icon-list-item-dropdown-toggle{padding:6px;display:flex;align-items:center;cursor:pointer;color:#888}html.dark-mode .icon-list-item-dropdown-toggle{color:#999}.icon-list-item-dropdown-toggle svg{margin:0}.icon-list-item-dropdown-toggle:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .icon-list-item-dropdown-toggle:hover{background-color:hsla(0,0%,100%,.06)}.card .entity-list-item:not(.no-hover,.book-contents .entity-list-item):hover{background-color:#f2f2f2;border-radius:0}html.dark-mode .card .entity-list-item:not(.no-hover,.book-contents .entity-list-item):hover{background-color:#2d2d2d}.card .entity-list-item .entity-list-item:hover{background-color:#eee}.entity-list-item-children{padding:16px 24px}.entity-list-item-children>div{overflow:hidden;padding:0 0 6px 0}.entity-list-item-children .entity-chip{text-overflow:ellipsis;height:2.5em;overflow:hidden;text-align:start;display:block;white-space:nowrap}.entity-list-item-children>.entity-list>.entity-list-item:last-child{margin-bottom:-6px}.entity-list-item-image{align-self:stretch;width:140px;flex:none;background-size:cover;background-position:50% 50%;border-radius:3px;position:relative;margin-inline-end:24px}.entity-list-item-image.entity-list-item-image-wide{width:220px}.entity-list-item-image .svg-icon{color:#fff;font-size:1.66rem;margin-inline-end:0;position:absolute;bottom:6px;left:6px}html.dark-mode .entity-list-item-image .svg-icon{color:hsla(0,0%,100%,.6)}@media screen and (max-width: 880px){.entity-list-item-image{width:80px}}.chapter>.entity-list-item-image{width:60px}.entity-list.compact{font-size:8.4px}.entity-list.compact h4,.entity-list.compact a{line-height:1.2}.entity-list.compact .entity-item-snippet{display:none}.entity-list.compact .entity-list-item p{font-size:11.2px;padding-top:6px}.entity-list.compact .entity-list-item p:empty{padding-top:0}.entity-list.compact p{margin:0}.entity-list.compact>p.empty-text{display:block;font-size:14px}.entity-list.compact hr{margin:0}@media screen and (max-width: 880px){.entity-list.compact h4{font-size:1.666em}}.entity-item-tags{font-size:.75rem;opacity:1}.entity-item-tags .primary-background-light{background:rgba(0,0,0,0)}.entity-item-tags .tag-name{background-color:rgba(0,0,0,.05)}.dropdown-container{display:inline-block;vertical-align:top;position:relative}.dropdown-menu{display:none;position:absolute;z-index:999;top:0;list-style:none;inset-inline-end:0;margin:16px 0;background-color:#fff;box-shadow:0 1px 6px 0 rgba(0,0,0,.18);border-radius:3px;min-width:180px;padding:6px 0;color:#555;fill:currentColor;text-align:start !important;max-height:500px;overflow-y:auto}html.dark-mode .dropdown-menu{background-color:#333}html.dark-mode .dropdown-menu{color:#eee}.dropdown-menu.anchor-left{inset-inline-end:auto;inset-inline-start:0}.dropdown-menu.wide{min-width:220px}.dropdown-menu.xl-limited{width:280px;max-width:100%}.dropdown-menu .text-muted{color:#999;fill:#999}.dropdown-menu li.active a{font-weight:600}.dropdown-menu button{width:100%;text-align:start}.dropdown-menu li.border-bottom{border-bottom:1px solid #ddd}.dropdown-menu li hr{margin:6px 0}.dropdown-menu .icon-item,.dropdown-menu .text-item,.dropdown-menu .label-item{padding:8px 16px;color:#555;fill:currentColor;white-space:nowrap;line-height:1.4;cursor:pointer}html.dark-mode .dropdown-menu .icon-item,html.dark-mode .dropdown-menu .text-item,html.dark-mode .dropdown-menu .label-item{color:#eee}.dropdown-menu .icon-item.break-text,.dropdown-menu .text-item.break-text,.dropdown-menu .label-item.break-text{white-space:normal;word-wrap:break-word;overflow-wrap:break-word}.dropdown-menu .icon-item:hover,.dropdown-menu .icon-item:focus,.dropdown-menu .text-item:hover,.dropdown-menu .text-item:focus,.dropdown-menu .label-item:hover,.dropdown-menu .label-item:focus{text-decoration:none;background-color:var(--color-primary-light);color:var(--color-primary)}.dropdown-menu .icon-item:focus,.dropdown-menu .text-item:focus,.dropdown-menu .label-item:focus{outline:1px solid var(--color-primary);outline-offset:-2px}.dropdown-menu .icon-item svg,.dropdown-menu .text-item svg,.dropdown-menu .label-item svg{margin-inline-end:12px;display:inline-block;width:16px}.dropdown-menu .text-item{display:block}.dropdown-menu .label-item{display:grid;align-items:center;grid-template-columns:auto min-content;gap:16px}.dropdown-menu .label-item>*:nth-child(2){opacity:.7}.dropdown-menu .label-item>*:nth-child(2):hover{opacity:1}.dropdown-menu .icon-item{display:grid;align-items:start;grid-template-columns:16px auto;gap:16px}.dropdown-menu .icon-item svg{margin-inline-end:0;margin-block-start:1px}.tri-layout-right .dropdown-menu,.tri-layout-left .dropdown-menu{inset-inline-end:6px}.featured-image-container{position:relative;overflow:hidden;min-height:140px;background-size:cover;background-position:50% 50%;transition:opacity ease-in-out 240ms}.featured-image-container a{display:block}.featured-image-container img{display:block;width:100%;max-width:100%;height:auto}.featured-image-container-wrap{position:relative}.featured-image-container-wrap .svg-icon{color:#fff;font-size:2rem;margin-inline-end:0;position:absolute;bottom:10px;left:6px}html.dark-mode .featured-image-container-wrap .svg-icon{color:hsla(0,0%,100%,.6)}.grid-card:hover .featured-image-container{opacity:.5}.action-link{background:rgba(0,0,0,0);border:none;color:currentColor;padding:16px 0}.active-link-list a{display:inline-block;padding:12px}.active-link-list a:not(.active){color:#444}html.dark-mode .active-link-list a:not(.active){color:#888}.active-link-list a:hover{background-color:rgba(0,0,0,.05);border-radius:4px;text-decoration:none}html.dark-mode .active-link-list a:hover{background-color:hsla(0,0%,100%,.05)}.active-link-list.in-sidebar a{display:block;margin-bottom:6px}.active-link-list.in-sidebar a.active{border-radius:4px;background-color:rgba(0,0,0,.05)}html.dark-mode .active-link-list.in-sidebar a.active{background-color:hsla(0,0%,100%,.05)}.entity-meta-item{display:flex;line-height:1.2;margin:.6em 0;align-content:start;gap:12px}.entity-meta-item a{line-height:1.2}.entity-meta-item svg{flex-shrink:0;width:1em;margin:0}.page-editor{display:flex;flex-direction:column;align-items:stretch}.page-editor .edit-area{flex:1;flex-direction:column;z-index:10;border-radius:0 0 8px 8px}.page-editor .mce-tinymce{box-shadow:none}.page-editor .mce-top-part::before{box-shadow:none}.page-editor-page-area{width:100%;border-radius:8px;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);min-width:300px;background-color:#fff}html.dark-mode .page-editor-page-area{background-color:#333}.page-edit-toolbar{width:100%;margin:0 auto;display:grid;grid-template-columns:minmax(max-content, 2fr) 1.5fr minmax(max-content, 2fr);align-items:center}@media screen and (min-width: 1401px){.page-editor-wysiwyg2024 .page-edit-toolbar,.page-editor-wysiwyg2024 .page-editor-page-area,.page-editor-wysiwyg .page-edit-toolbar,.page-editor-wysiwyg .page-editor-page-area{max-width:1140px}.page-editor-wysiwyg .floating-toolbox,.page-editor-wysiwyg2024 .floating-toolbox{position:absolute}}@media screen and (max-width: 880px){.page-edit-toolbar{display:flex;flex-direction:row;justify-content:space-between}}.title-input.page-title{font-size:.8em}.title-input.page-title .input{border:0;margin-bottom:-1px}.title-input.page-title input[type=text]{max-width:840px;margin:0 auto;border:none;height:auto;display:block;width:100%;font-size:20px;border-radius:8px}.title-input.page-title input[type=text]:focus{position:relative;outline-offset:-1px;outline:1px dashed var(--color-primary);box-shadow:0 1px 6px -1px rgba(0,0,0,.1);z-index:50}.page-editor-markdown .title-input.page-title input[type=text]{max-width:100%}body.tox-fullscreen .page-editor .edit-area,body.markdown-fullscreen .page-editor .edit-area{z-index:12}body.tox-fullscreen .page-editor,body.tox-fullscreen .flex-fill,body.markdown-fullscreen .page-editor,body.markdown-fullscreen .flex-fill{overflow:visible}@media screen and (max-width: 600px){.page-edit-toolbar{overflow-x:scroll;overflow-y:visible}.page-edit-toolbar{white-space:nowrap}.page-edit-toolbar>div{display:inline-block}}.page-save-mobile-button{position:fixed;z-index:30;border-radius:50%;width:52px;height:52px;font-size:26px;inset-inline-end:6px;bottom:12px;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);background-color:currentColor;text-align:center}.page-save-mobile-button svg{fill:#fff;margin-inline-end:0}.draft-notification{pointer-events:none;transform:scale(0);transition:transform ease-in-out 120ms;transform-origin:50% 50%}.draft-notification.visible{transform:scale(1)}.page-style.editor{padding:0 !important}.pointer-container{position:fixed;display:none;left:0;z-index:10}.pointer{border:1px solid #ccc;border-color:#ccc;border-radius:4px;box-shadow:0 0 12px 1px rgba(0,0,0,.1);background-color:#fff;width:328px}html.dark-mode .pointer{border-color:#000}html.dark-mode .pointer{background-color:#333}.pointer:before{position:absolute;left:50%;bottom:-9px;width:16px;height:16px;margin-inline-start:-8px;content:"";display:block;transform:rotate(45deg);transform-origin:50% 50%;border-right:1px solid #ccc;border-bottom:1px solid #ccc;z-index:56;background-color:#fff;border-color:#ccc}html.dark-mode .pointer:before{background-color:#333}html.dark-mode .pointer:before{border-color:#000}.pointer input,.pointer button,.pointer a{position:relative;height:28px;font-size:12px;vertical-align:top;padding:5px 16px}.pointer input{background-color:#fff;border:1px solid #ddd;border-color:#ddd;color:#666;width:auto;flex:1;z-index:58;padding:5px;border-radius:0}html.dark-mode .pointer input{border-color:#000}.pointer .text-button{color:#444}html.dark-mode .pointer .text-button{color:#aaa}.pointer .input-group .button{line-height:1;margin-inline-start:-1px;margin-block:0;box-shadow:none;border-radius:0}.pointer a.button{margin:0}.pointer .svg-icon{width:1.2em;height:1.2em}.pointer .button{border-color:#ddd}html.dark-mode .pointer .button{border-color:#000}.content-comment-highlight{position:absolute;left:0;top:0;width:0;height:0;user-select:none;pointer-events:none}.content-comment-highlight:after{content:"";position:absolute;left:0;top:0;width:100%;height:100%;background-color:var(--color-primary);opacity:.25}.content-comment-window{font-size:14px;line-height:1.4;position:absolute;top:calc(100% + 3px);left:0;z-index:92;pointer-events:all;min-width:min(340px,80vw);background-color:#fff;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);border-radius:4px;overflow:hidden}html.dark-mode .content-comment-window{background-color:#222}.content-comment-window-actions{background-color:var(--color-primary);color:#fff;display:flex;align-items:center;justify-content:end;gap:6px}.content-comment-window-actions button{color:#fff;font-size:12px;padding:6px;line-height:1;cursor:pointer}.content-comment-window-actions button[data-action=jump]{text-decoration:underline}.content-comment-window-actions svg{fill:currentColor;width:12px}.content-comment-window-content{padding:6px 12px 6px 6px;max-height:200px;overflow-y:scroll}.content-comment-window-content .comment-reference-indicator-wrap{display:none}.content-comment-marker{position:absolute;right:-16px;top:-16px;pointer-events:all;width:min(1.5em,32px);height:min(1.5em,32px);border-radius:min(.75em,32px);display:flex;align-items:center;justify-content:center;background-color:var(--color-primary);box-shadow:0 2px 2px 1px rgba(0,0,0,.13);color:#fff;cursor:pointer;z-index:90;transform:scale(1);transition:transform ease-in-out 120ms}.content-comment-marker svg{fill:#fff;width:80%}.page-content [id^=bkmrk-]:hover .content-comment-marker{transform:scale(1.15)}.floating-toolbox{background-color:#fff;overflow:hidden;align-items:stretch;flex-direction:row;display:flex;max-height:100%;border-radius:8px;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);margin-bottom:auto;margin-inline-start:24px;position:relative}html.dark-mode .floating-toolbox{background-color:#222}.floating-toolbox.open{position:relative;right:0;max-width:480px;margin-bottom:0}.floating-toolbox:not(.open) .toolbox-tab-content{display:none !important}.floating-toolbox .toolbox-toggle svg{transition:transform ease-in-out 180ms}.floating-toolbox .toolbox-toggle{transition:background-color ease-in-out 180ms}.floating-toolbox.open .toolbox-toggle{background-color:rgba(255,0,0,.2)}.floating-toolbox.open .toolbox-toggle svg{transform:rotate(180deg)}.floating-toolbox>div{flex:1;position:relative}.floating-toolbox .tabs{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd;width:40px;flex:0 1 auto;margin-inline-end:-1px}html.dark-mode .floating-toolbox .tabs{border-inline-end-color:#000}.floating-toolbox .tabs-inner{background-color:#fff}html.dark-mode .floating-toolbox .tabs-inner{background-color:#222}.floating-toolbox .tabs svg{padding:0;margin:0}.floating-toolbox .tabs-inner>button{color:rgba(0,0,0,.7);display:block;cursor:pointer;padding:10px 6px;font-size:18px;line-height:1.6}html.dark-mode .floating-toolbox .tabs-inner>button{color:hsla(0,0%,100%,.5)}.floating-toolbox .tabs-inner>button:hover,.floating-toolbox.open .tabs-inner>button.active{color:var(--color-link) !important;position:relative}.floating-toolbox .tabs-inner>button:hover:after,.floating-toolbox.open .tabs-inner>button.active:after{content:"";display:block;position:absolute;left:0;width:100%;top:0;height:100%;background-color:currentColor;opacity:.075}.floating-toolbox.open .tabs-inner>button.active{border-inline-end:1px solid var(--color-link);margin-inline-end:-1px}.floating-toolbox h4{font-size:24px;margin:16px 0 0 0;padding:0 24px 12px 24px}.floating-toolbox .tags input{max-width:100%;width:100%;min-width:50px}.floating-toolbox .tags td,.floating-toolbox .inline-start-table>div>div>div{padding-inline-end:12px;padding-top:12px;position:relative}.floating-toolbox .handle{user-select:none;cursor:move;fill:#999}.floating-toolbox form{display:flex;flex:1;flex-direction:column;overflow-y:scroll}.floating-toolbox table td,.floating-toolbox table th{overflow:visible}@media screen and (max-width: 1400px){.floating-toolbox{margin-inline-start:12px}}@media screen and (max-width: 600px){.page-editor-page-area-wrap{margin:4px !important}.floating-toolbox{margin-inline-start:4px}.floating-toolbox .tabs{width:32px}.floating-toolbox .tabs-inner>button{font-size:12px}.page-edit-toolbar{padding-block:0 !important}.page-editor.toolbox-open .page-editor-page-area{display:none}}.toolbox-tab-content{display:none;overflow-y:auto;padding-bottom:45px}.suggestion-box{top:auto;margin:-4px 0 0;right:auto;left:0;padding:0}.suggestion-box li{display:block;border-bottom:1px solid #ddd}.suggestion-box li:last-child{border-bottom:0}.comments-container h5{color:#888;font-weight:normal;margin-top:.5em}.comment-editor .CodeMirror,.comment-editor .CodeMirror-scroll{min-height:175px}.mce-floatpanel[aria-label="Insert/edit media"] .mce-open{display:none}.entity-list-item>span:first-child,.icon-list-item>span:first-child,.split-icon-list-item>a>.icon,.chapter-expansion>.icon{font-size:.8rem;width:1.88em;height:1.88em;flex-shrink:0;display:flex;align-items:center;justify-content:center;text-align:center;border-radius:1em;position:relative;overflow:hidden}.entity-list-item>span:first-child svg,.icon-list-item>span:first-child svg,.split-icon-list-item>a>.icon svg,.chapter-expansion>.icon svg{margin:0;bottom:0}.entity-list-item>span:first-child:after,.icon-list-item>span:first-child:after,.split-icon-list-item>a>.icon:after,.chapter-expansion>.icon:after{content:"";position:absolute;background-color:currentColor;opacity:.2;left:0;top:0;width:100%;height:100%}.entity-chip{display:inline-block;align-items:center;justify-content:center;text-align:center;font-size:.9em;border-radius:3px;position:relative;overflow:hidden;padding:6px 12px;fill:currentColor;opacity:.85;transition:opacity ease-in-out 120ms}.entity-chip:after{content:"";position:absolute;background-color:currentColor;opacity:.15;left:0;top:0;width:100%;height:100%}.entity-chip:hover{text-decoration:none;opacity:1}@media(prefers-contrast: more){.entity-chip{opacity:1}}.page-content{width:100%;max-width:840px;margin:0 auto;overflow-wrap:break-word;position:relative}.page-content .align-left{text-align:left}.page-content img.align-left,.page-content table.align-left,.page-content iframe.align-left,.page-content video.align-left{float:left !important;margin:6px 16px 16px 0}.page-content .align-right{text-align:right !important}.page-content img.align-right,.page-content table.align-right,.page-content iframe.align-right,.page-content video.align-right{float:right !important;margin:6px 0 6px 12px}.page-content .align-center{text-align:center}.page-content img.align-center,.page-content video.align-center,.page-content iframe.align-center{display:block}.page-content img.align-center,.page-content table.align-center,.page-content iframe.align-center,.page-content video.align-center{margin-left:auto;margin-right:auto}.page-content .align-justify{text-align:justify}.page-content h1,.page-content h2,.page-content h3,.page-content h4,.page-content h5,.page-content h6,.page-content pre{clear:left}.page-content hr{clear:both;margin:16px 0}.page-content table{hyphens:auto;table-layout:fixed;max-width:100%;height:auto !important}.page-content ins,.page-content del{text-decoration:none}.page-content ins{background:#dbffdb}.page-content del{background:#ffecec}.page-content details{border:1px solid;border-color:#ddd;margin-bottom:1em;padding:12px}html.dark-mode .page-content details{border-color:#555}.page-content details>summary{margin-top:-12px;margin-left:-12px;margin-right:-12px;margin-bottom:-12px;font-weight:bold;background-color:#eee;padding:6px 12px}html.dark-mode .page-content details>summary{background-color:#333}.page-content details[open]>summary{margin-bottom:12px;border-bottom:1px solid;border-color:#ddd}html.dark-mode .page-content details[open]>summary{border-color:#555}.page-content details>summary+*{margin-top:.2em}.page-content details:after{content:"";display:block;clear:both}.page-content li>input[type=checkbox]{vertical-align:top;margin-top:.3em}.page-content p:empty{min-height:1.6em}.page-content.page-revision pre code{white-space:pre-wrap}.page-content .cm-editor{margin-bottom:1.375em}.page-content video,.page-content iframe{max-width:100%}.page-content a{text-decoration:underline}body .page-content img,.page-content img:not([data-mce-object]){max-width:100%;height:auto}.callout{border-left:3px solid #bbb;border-inline-start:3px solid #bbb;border-inline-end:none;background-color:#eee;padding:12px;padding-left:32px;padding-inline-start:32px;padding-inline-end:12px;display:block;position:relative;overflow:auto}.callout:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMTUzODAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bTEgMTVoLTJ2LTZoMnY2em0wLThoLTJWN2gydjJ6Ii8+PC9zdmc+");background-repeat:no-repeat;content:"";width:1.2em;height:1.2em;left:8px;inset-inline-start:8px;inset-inline-end:unset;top:50%;margin-top:-9px;display:inline-block;position:absolute;line-height:1;opacity:.8}.callout.success{border-color:#0f7d15;background-color:#eafdeb;color:#063409}html.dark-mode .callout.success{border-color:#4aa850}html.dark-mode .callout.success{background-color:#122913}html.dark-mode .callout.success{color:#4aa850}.callout.success:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+")}.callout.danger{border-color:#ab0f0e;background-color:#fcdbdb;color:#4d0706}html.dark-mode .callout.danger{border-color:#e85c5b}html.dark-mode .callout.danger{background-color:#250505}html.dark-mode .callout.danger{color:#e85c5b}.callout.danger:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==")}.callout.info{border-color:#0288d1;background-color:#d3efff;color:#01466c}html.dark-mode .callout.info{border-color:#0288d1}html.dark-mode .callout.info{background-color:#001825}html.dark-mode .callout.info{color:#0288d1}.callout.warning{border-color:#cf4d03;background-color:#fee3d3;color:#6a2802}html.dark-mode .callout.warning{border-color:#de8a5a}html.dark-mode .callout.warning{background-color:#30170a}html.dark-mode .callout.warning{color:#de8a5a}.callout.warning:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiNjUzMWMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEgMjFoMjJMMTIgMiAxIDIxem0xMi0zaC0ydi0yaDJ2MnptMC00aC0ydi00aDJ2NHoiLz48L3N2Zz4=")}.callout a{color:inherit;text-decoration:underline}@media print{html,body{font-size:12px;background-color:#fff}.page-content{margin:0 auto}.print-hidden{display:none !important}.tri-layout-container{grid-template-columns:1fr;grid-template-areas:"b";margin-inline-start:0;margin-inline-end:0;display:block}.card{box-shadow:none}.content-wrap.card{padding-inline-start:0;padding-inline-end:0}}.dragged{position:absolute;opacity:.5;z-index:2000}body.dragging,body.dragging *{cursor:move !important}.avatar{border-radius:100%;background-color:#eee;width:30px;height:30px}html.dark-mode .avatar{background-color:#000}.avatar.med{width:40px;height:40px}.avatar.large{width:80px;height:80px}.avatar.huge{width:120px;height:120px}.avatar.square{border-radius:3px}html.dark-mode .avatar[src$="user_avatar.png"]{filter:invert(1)}.loading-container{position:relative;display:block;margin:32px auto}.loading-container>div{width:10px;height:10px;border-radius:10px;display:inline-block;vertical-align:top;transform:translate3d(-10px, 0, 0);margin-top:6px;animation-name:loadingBob;animation-duration:1.4s;animation-iteration-count:infinite;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99);margin-inline-end:4px;background-color:var(--color-page);animation-delay:-300ms}.loading-container>div:first-child{left:-16px;background-color:var(--color-book);animation-delay:-600ms}.loading-container>div:last-of-type{left:16px;background-color:var(--color-chapter);animation-delay:0ms}.loading-container>span{margin-inline-start:12px;font-style:italic;color:#888;vertical-align:top}.inline.block .loading-container{margin:6px 12px}.skip-to-content-link{position:fixed;top:-52px;left:0;background-color:#fff;z-index:15;border-radius:0 4px 4px 0;display:block;box-shadow:0 0 4px 1px rgba(0,0,0,.5);font-weight:bold}.skip-to-content-link:focus{top:32px;outline-offset:-10px;outline:2px dotted var(--color-link)}.entity-selector{border:1px solid #ddd;border-color:#ddd;border-radius:3px;overflow:hidden;font-size:.8em}html.dark-mode .entity-selector{border-color:#111}.entity-selector input[type=text]{width:100%;display:block;border-radius:0;border:0;border-bottom:1px solid #ddd;font-size:16px;padding:12px 16px}.entity-selector input[type=text]:focus{outline:1px solid var(--color-primary);border-radius:3px 3px 0 0;outline-offset:-1px}.entity-selector .entity-list{overflow-y:scroll;height:400px;background-color:#eee;margin-inline-end:0;margin-inline-start:0}html.dark-mode .entity-selector .entity-list{background-color:#222}.entity-selector .entity-list-item{background-color:#fff}html.dark-mode .entity-selector .entity-list-item{background-color:#222}.entity-selector .entity-list-item p{margin-bottom:0}.entity-selector .entity-list-item:focus{outline:2px dotted var(--color-primary);outline-offset:-4px}.entity-selector .entity-list-item.selected{background-color:rgba(0,0,0,.05)}html.dark-mode .entity-selector .entity-list-item.selected{background-color:hsla(0,0%,100%,.05)}.entity-selector .loading{height:400px;padding-top:24px}.entity-selector.compact{font-size:10px}.entity-selector.compact .entity-item-snippet{display:none}.entity-selector.compact h4{font-size:14px}.entity-selector.small .entity-list-item{padding:6px 16px}.entity-selector.small .entity-list,.entity-selector.small .loading{height:300px}.entity-selector.small input[type=text]{font-size:13px;padding:6px 16px;height:auto}.fullscreen{border:0;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;z-index:150}@media screen and (min-width: 601px)and (max-width: 880px){#home-default>.grid.third{display:block;columns:2;column-gap:24px !important}}.list-sort-container{display:inline-block}.list-sort-container form{display:inline-block}.list-sort-container .list-sort{display:inline-grid;margin-inline-start:12px;grid-template-columns:minmax(120px, max-content) 40px;font-size:.9rem;border:2px solid #ddd;border-color:#ddd;border-radius:4px}html.dark-mode .list-sort-container .list-sort{border-color:#444}.list-sort-container .list-sort-label{font-weight:bold;display:inline-block}.list-sort-container .list-sort-label,.list-sort-container .list-sort-toggle{color:#555}html.dark-mode .list-sort-container .list-sort-label,html.dark-mode .list-sort-container .list-sort-toggle{color:#888}.list-sort-container .list-sort-type{text-align:start}.list-sort-container .list-sort-toggle,.list-sort-container .list-sort-dir{padding:8px 12px;cursor:pointer}.list-sort-container .list-sort-dir{border-inline-start:2px solid #ddd;color:#888;border-color:#ddd}html.dark-mode .list-sort-container .list-sort-dir{border-color:#444}.list-sort-container .list-sort-dir .svg-icon{transition:transform ease-in-out 120ms}.list-sort-container .list-sort-dir:hover .svg-icon{transform:rotate(180deg)}.list-sort-container .list-sort-toggle{display:block;width:100%;text-align:start}.import-item{border-inline-start:2px solid currentColor;padding-inline-start:6px}/*# sourceMappingURL=styles.css.map */ +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after{content:"";content:none}q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}.dummy-style{color:red}:root{--font-body: -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Roboto, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--font-code: Lucida Console, DejaVu Sans Mono, Ubuntu Mono, Monaco, monospace;--color-primary: #206ea7;--color-primary-light: rgba(32,110,167,0.15);--color-link: #206ea7;--color-page: #206ea7;--color-page-draft: #7e50b1;--color-chapter: #af4d0d;--color-book: #077b70;--color-bookshelf: #a94747;--color-positive: #0f7d15;--color-negative: #ab0f0e;--color-info: #0288D1;--color-warning: #cf4d03;--bg-disabled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25'%3E%3Cdefs%3E%3Cpattern id='doodad' width='19' height='19' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform='rotate(143)'%3E%3Crect width='100%25' height='100%25' fill='rgba(42, 67, 101,0)'/%3E%3Cpath d='M-10 30h60v20h-60zM-10-10h60v20h-60' fill='rgba(26, 32, 44,0)'/%3E%3Cpath d='M-10 10h60v20h-60zM-10-30h60v20h-60z' fill='rgba(0, 0, 0,0.05)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23doodad)' height='200%25' width='200%25'/%3E%3C/svg%3E")}:root.dark-mode{--bg-disabled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25'%3E%3Cdefs%3E%3Cpattern id='doodad' width='19' height='19' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform='rotate(143)'%3E%3Crect width='100%25' height='100%25' fill='rgba(42, 67, 101,0)'/%3E%3Cpath d='M-10 30h60v20h-60zM-10-10h60v20h-60' fill='rgba(26, 32, 44,0)'/%3E%3Cpath d='M-10 10h60v20h-60zM-10-30h60v20h-60z' fill='rgba(255, 255, 255,0.05)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23doodad)' height='200%25' width='200%25'/%3E%3C/svg%3E");color-scheme:only dark;--color-positive: #4aa850;--color-negative: #e85c5b;--color-warning: #de8a5a}:root:not(.dark-mode){color-scheme:only light}.m-none{margin:0 !important}.mx-none{margin-inline-start:0 !important;margin-inline-end:0 !important}.my-none{margin-top:0 !important;margin-bottom:0 !important}.mt-none{margin-top:0 !important}.mr-none{margin-inline-end:0 !important}.mb-none{margin-bottom:0 !important}.ml-none{margin-inline-start:0 !important}.m-xxs{margin:3px !important}.mx-xxs{margin-inline-start:3px !important;margin-inline-end:3px !important}.my-xxs{margin-top:3px !important;margin-bottom:3px !important}.mt-xxs{margin-top:3px !important}.mr-xxs{margin-inline-end:3px !important}.mb-xxs{margin-bottom:3px !important}.ml-xxs{margin-inline-start:3px !important}.m-xs{margin:6px !important}.mx-xs{margin-inline-start:6px !important;margin-inline-end:6px !important}.my-xs{margin-top:6px !important;margin-bottom:6px !important}.mt-xs{margin-top:6px !important}.mr-xs{margin-inline-end:6px !important}.mb-xs{margin-bottom:6px !important}.ml-xs{margin-inline-start:6px !important}.m-s{margin:12px !important}.mx-s{margin-inline-start:12px !important;margin-inline-end:12px !important}.my-s{margin-top:12px !important;margin-bottom:12px !important}.mt-s{margin-top:12px !important}.mr-s{margin-inline-end:12px !important}.mb-s{margin-bottom:12px !important}.ml-s{margin-inline-start:12px !important}.m-m{margin:16px !important}.mx-m{margin-inline-start:16px !important;margin-inline-end:16px !important}.my-m{margin-top:16px !important;margin-bottom:16px !important}.mt-m{margin-top:16px !important}.mr-m{margin-inline-end:16px !important}.mb-m{margin-bottom:16px !important}.ml-m{margin-inline-start:16px !important}.m-l{margin:24px !important}.mx-l{margin-inline-start:24px !important;margin-inline-end:24px !important}.my-l{margin-top:24px !important;margin-bottom:24px !important}.mt-l{margin-top:24px !important}.mr-l{margin-inline-end:24px !important}.mb-l{margin-bottom:24px !important}.ml-l{margin-inline-start:24px !important}.m-xl{margin:32px !important}.mx-xl{margin-inline-start:32px !important;margin-inline-end:32px !important}.my-xl{margin-top:32px !important;margin-bottom:32px !important}.mt-xl{margin-top:32px !important}.mr-xl{margin-inline-end:32px !important}.mb-xl{margin-bottom:32px !important}.ml-xl{margin-inline-start:32px !important}.m-xxl{margin:48px !important}.mx-xxl{margin-inline-start:48px !important;margin-inline-end:48px !important}.my-xxl{margin-top:48px !important;margin-bottom:48px !important}.mt-xxl{margin-top:48px !important}.mr-xxl{margin-inline-end:48px !important}.mb-xxl{margin-bottom:48px !important}.ml-xxl{margin-inline-start:48px !important}.m-auto{margin:auto !important}.mx-auto{margin-inline-start:auto !important;margin-inline-end:auto !important}.my-auto{margin-top:auto !important;margin-bottom:auto !important}.mt-auto{margin-top:auto !important}.mr-auto{margin-inline-end:auto !important}.mb-auto{margin-bottom:auto !important}.ml-auto{margin-inline-start:auto !important}.p-none{padding:0 !important}.px-none{padding-inline-start:0 !important;padding-inline-end:0 !important}.py-none{padding-top:0 !important;padding-bottom:0 !important}.pt-none{padding-top:0 !important}.pr-none{padding-inline-end:0 !important}.pb-none{padding-bottom:0 !important}.pl-none{padding-inline-start:0 !important}.p-xxs{padding:3px !important}.px-xxs{padding-inline-start:3px !important;padding-inline-end:3px !important}.py-xxs{padding-top:3px !important;padding-bottom:3px !important}.pt-xxs{padding-top:3px !important}.pr-xxs{padding-inline-end:3px !important}.pb-xxs{padding-bottom:3px !important}.pl-xxs{padding-inline-start:3px !important}.p-xs{padding:6px !important}.px-xs{padding-inline-start:6px !important;padding-inline-end:6px !important}.py-xs{padding-top:6px !important;padding-bottom:6px !important}.pt-xs{padding-top:6px !important}.pr-xs{padding-inline-end:6px !important}.pb-xs{padding-bottom:6px !important}.pl-xs{padding-inline-start:6px !important}.p-s{padding:12px !important}.px-s{padding-inline-start:12px !important;padding-inline-end:12px !important}.py-s{padding-top:12px !important;padding-bottom:12px !important}.pt-s{padding-top:12px !important}.pr-s{padding-inline-end:12px !important}.pb-s{padding-bottom:12px !important}.pl-s{padding-inline-start:12px !important}.p-m{padding:16px !important}.px-m{padding-inline-start:16px !important;padding-inline-end:16px !important}.py-m{padding-top:16px !important;padding-bottom:16px !important}.pt-m{padding-top:16px !important}.pr-m{padding-inline-end:16px !important}.pb-m{padding-bottom:16px !important}.pl-m{padding-inline-start:16px !important}.p-l{padding:24px !important}.px-l{padding-inline-start:24px !important;padding-inline-end:24px !important}.py-l{padding-top:24px !important;padding-bottom:24px !important}.pt-l{padding-top:24px !important}.pr-l{padding-inline-end:24px !important}.pb-l{padding-bottom:24px !important}.pl-l{padding-inline-start:24px !important}.p-xl{padding:32px !important}.px-xl{padding-inline-start:32px !important;padding-inline-end:32px !important}.py-xl{padding-top:32px !important;padding-bottom:32px !important}.pt-xl{padding-top:32px !important}.pr-xl{padding-inline-end:32px !important}.pb-xl{padding-bottom:32px !important}.pl-xl{padding-inline-start:32px !important}.p-xxl{padding:48px !important}.px-xxl{padding-inline-start:48px !important;padding-inline-end:48px !important}.py-xxl{padding-top:48px !important;padding-bottom:48px !important}.pt-xxl{padding-top:48px !important}.pr-xxl{padding-inline-end:48px !important}.pb-xxl{padding-bottom:48px !important}.pl-xxl{padding-inline-start:48px !important}.p-auto{padding:auto !important}.px-auto{padding-inline-start:auto !important;padding-inline-end:auto !important}.py-auto{padding-top:auto !important;padding-bottom:auto !important}.pt-auto{padding-top:auto !important}.pr-auto{padding-inline-end:auto !important}.pb-auto{padding-bottom:auto !important}.pl-auto{padding-inline-start:auto !important}.gap-none{gap:0 !important}.gap-x-none{column-gap:0 !important}.gap-y-none{row-gap:0 !important}.gap-xxs{gap:3px !important}.gap-x-xxs{column-gap:3px !important}.gap-y-xxs{row-gap:3px !important}.gap-xs{gap:6px !important}.gap-x-xs{column-gap:6px !important}.gap-y-xs{row-gap:6px !important}.gap-s{gap:12px !important}.gap-x-s{column-gap:12px !important}.gap-y-s{row-gap:12px !important}.gap-m{gap:16px !important}.gap-x-m{column-gap:16px !important}.gap-y-m{row-gap:16px !important}.gap-l{gap:24px !important}.gap-x-l{column-gap:24px !important}.gap-y-l{row-gap:24px !important}.gap-xl{gap:32px !important}.gap-x-xl{column-gap:32px !important}.gap-y-xl{row-gap:32px !important}.gap-xxl{gap:48px !important}.gap-x-xxl{column-gap:48px !important}.gap-y-xxl{row-gap:48px !important}.gap-auto{gap:auto !important}.gap-x-auto{column-gap:auto !important}.gap-y-auto{row-gap:auto !important}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}*{box-sizing:border-box;outline-color:var(--color-primary);outline-width:1px}*:focus{outline-style:dotted}html{height:100%;overflow-y:scroll;background-color:#f2f2f2}html.flexbox{overflow-y:hidden}html.dark-mode{background-color:#111}body{font-size:14px;line-height:1.6;color:#444;-webkit-font-smoothing:antialiased;height:100%;display:flex;flex-direction:column}html.dark-mode body{color:#aaa}body,button,input,select,label,textarea{font-family:var(--font-body)}pre,#markdown-editor-input,.text-mono,.code-base,span.code,code{font-family:var(--font-code)}h1{font-size:3.425em;line-height:1.22222222em;margin-top:.48888889em;margin-bottom:.48888889em}h2{font-size:2.8275em;line-height:1.294117647em;margin-top:.8627451em;margin-bottom:.43137255em}h3{font-size:2.333em;line-height:1.221428572em;margin-top:.78571429em;margin-bottom:.43137255em}h4{font-size:1.666em;line-height:1.375em;margin-top:.78571429em;margin-bottom:.43137255em}h1,h2,h3,h4,h5,h6{font-weight:400;position:relative;display:block;font-family:var(--font-heading, var(--font-body));color:#222}html.dark-mode h1,html.dark-mode h2,html.dark-mode h3,html.dark-mode h4,html.dark-mode h5,html.dark-mode h6{color:#bbb}h5{font-size:1.4em}h5,h6{line-height:1.2em;margin-top:.78571429em;margin-bottom:.66em}@media screen and (max-width: 600px){h1{font-size:2.8275em}h2{font-size:2.333em}h3{font-size:1.666em}h4{font-size:1.333em}h5{font-size:1.161616em}}.list-heading{font-size:2rem}h2.list-heading{font-size:1.333rem}a{color:var(--color-link);fill:currentColor;cursor:pointer;text-decoration:none;transition:filter ease-in-out 80ms;line-height:1.6}a:hover{text-decoration:underline}a.icon{display:inline-block}a svg{position:relative;display:inline-block}a:focus img:only-child{outline:2px dashed var(--color-link);outline-offset:2px}a.no-link-style{color:inherit}a.no-link-style:hover{text-decoration:none}.blended-links a{color:inherit}.blended-links a svg{fill:currentColor}p,ul,ol,pre,table,blockquote{margin-top:.3em;margin-bottom:1.375em}hr{border:0;height:1px;background:#eaeaea;margin-bottom:24px}html.dark-mode hr{background:#555}hr.faded{background-image:linear-gradient(to right, #FFF, #e3e0e0 20%, #e3e0e0 80%, #FFF)}hr.darker{background:#ddd}html.dark-mode hr.darker{background:#666}hr.margin-top,hr.even{margin-top:24px}strong,b,.bold,.strong{font-weight:bold}strong>strong,strong>b,strong>.bold,strong>.strong,b>strong,b>b,b>.bold,b>.strong,.bold>strong,.bold>b,.bold>.bold,.bold>.strong,.strong>strong,.strong>b,.strong>.bold,.strong>.strong{font-weight:bolder}em,i,.italic{font-style:italic}small,p.small,span.small,.text-small{font-size:.75rem}sup,.superscript{vertical-align:super;font-size:.8em}sub,.subscript{vertical-align:sub;font-size:.8em}pre{font-size:12px;border:1px solid #ddd;background-color:#fff;border-color:#ddd;border-radius:4px;padding-inline-start:26px;position:relative;padding-top:3px;padding-bottom:3px}html.dark-mode pre{background-color:#2b2b2b}html.dark-mode pre{border-color:#111}pre:before{content:"";display:block;position:absolute;top:0;width:22.4px;inset-inline-start:0;height:100%;background-color:#f5f5f5;border-inline-end:1px solid #ddd}html.dark-mode pre:before{background-color:#313335}html.dark-mode pre:before{border-inline-end:none}@media print{pre{padding-left:12px}pre:before{display:none}}blockquote{display:block;position:relative;border-left:4px solid rgba(0,0,0,0);border-left-color:var(--color-primary);background-color:#f8f8f8;padding:12px 16px 12px 32px;overflow:auto}html.dark-mode blockquote{background-color:#333}blockquote:before{content:"“";font-size:2em;font-weight:bold;position:absolute;top:12px;left:12px;color:#777}.text-mono{font-family:var(--font-code)}.text-uppercase{text-transform:uppercase}.text-capitals{text-transform:capitalize}.code-base,span.code,code{font-size:.84em;border:1px solid #ddd;border-radius:3px;background-color:#f8f8f8;border-color:#ddd}html.dark-mode .code-base,html.dark-mode span.code,html.dark-mode code{background-color:#2b2b2b}html.dark-mode .code-base,html.dark-mode span.code,html.dark-mode code{border-color:#444}code{display:inline;padding:1px 3px;white-space:pre-wrap;line-height:1.2em}span.code{padding:1px 6px}pre code{background-color:rgba(0,0,0,0);border:0;font-size:1em;display:block;line-height:1.6}span.highlight{font-weight:bold;padding:2px 4px}ul,ol{padding-left:32px;padding-right:32px;display:flow-root}ul p,ol p{margin:0}ul{list-style:disc}ul ul{list-style:circle}ul label{margin:0}ol{list-style:decimal}li>ol,li>ul{margin-top:0;margin-bottom:0;margin-block-end:0;margin-block-start:0;padding-block-end:0;padding-block-start:0;padding-left:19.2px;padding-right:19.2px}li.checkbox-item,li.task-list-item{display:list-item;list-style:none;margin-left:-19.2px;margin-inline-start:-19.2px;margin-inline-end:0}li.checkbox-item input[type=checkbox],li.task-list-item input[type=checkbox]{margin-right:6px;margin-inline-end:6px;margin-inline-start:0}li.checkbox-item li.checkbox-item,li.checkbox-item li.task-list-item,li.task-list-item li.checkbox-item,li.task-list-item li.task-list-item{margin-left:6px;margin-inline-start:6px;margin-inline-end:0}.underlined{text-decoration:underline}.text-center{text-align:center}.text-left{text-align:start}.text-right{text-align:end}@media screen and (min-width: 361px){.text-xxs-center{text-align:center}.text-xxs-left{text-align:start}.text-xxs-right{text-align:end}}@media screen and (min-width: 401px){.text-xs-center{text-align:center}.text-xs-left{text-align:start}.text-xs-right{text-align:end}}@media screen and (min-width: 601px){.text-s-center{text-align:center}.text-s-left{text-align:start}.text-s-right{text-align:end}}@media screen and (min-width: 881px){.text-m-center{text-align:center}.text-m-left{text-align:start}.text-m-right{text-align:end}}@media screen and (min-width: 1001px){.text-l-center{text-align:center}.text-l-left{text-align:start}.text-l-right{text-align:end}}@media screen and (min-width: 1101px){.text-xl-center{text-align:center}.text-xl-left{text-align:start}.text-xl-right{text-align:end}}.text-bigger{font-size:1.1em}.text-large{font-size:1.6666em}.no-color{color:inherit}.break-text{white-space:normal;word-wrap:break-word;overflow-wrap:break-word}.text-limit-lines-1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-limit-lines-2{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.header-group{margin:16px 0}.header-group h1,.header-group h2,.header-group h3,.header-group h4,.header-group h5,.header-group h6{margin:0}span.sep{color:#bbb;padding:0 6px}.list>*{display:block}.svg-icon{width:1em;height:1em;display:inline-block;position:relative;bottom:-0.105em;margin-inline-end:6px;pointer-events:none;fill:currentColor}.primary-background{background-color:var(--color-primary) !important}.primary-background-light{background-color:var(--color-primary-light)}html.dark-mode .primary-background-light{background:#000}html.dark-mode .primary-background-light .text-link{color:#aaa !important}.link-background{background-color:var(--color-link) !important}.text-pos,.text-pos:hover,.text-pos-hover:hover{color:var(--color-positive) !important;fill:var(--color-positive) !important}.text-warn,.text-warn:hover,.text-warn-hover:hover{color:var(--color-warning) !important;fill:var(--color-warning) !important}.text-neg,.text-neg:hover,.text-neg-hover:hover{color:var(--color-negative) !important;fill:var(--color-negative) !important}.text-primary,.text-primary:hover,.text-primary-hover:hover{color:var(--color-primary) !important;fill:var(--color-primary) !important}.text-link,.text-link:hover,.text-link-hover:hover{color:var(--color-link) !important;fill:var(--color-link) !important}.text-muted{color:#575757 !important;fill:currentColor !important}html.dark-mode .text-muted{color:#888 !important}.text-dark{color:#222 !important;fill:currentColor !important}html.dark-mode .text-dark{color:#ccc !important}.text-white{color:#fff;fill:currentColor !important}.text-bookshelf,.text-bookshelf:hover{color:var(--color-bookshelf);fill:var(--color-bookshelf)}.text-book,.text-book:hover{color:var(--color-book);fill:var(--color-book)}.text-page,.text-page:hover{color:var(--color-page);fill:var(--color-page)}.text-page.draft,.text-page.draft:hover{color:var(--color-page-draft);fill:var(--color-page-draft)}.text-chapter,.text-chapter:hover{color:var(--color-chapter);fill:var(--color-chapter)}.bg-white{background-color:#fff}.bg-book{background-color:var(--color-book)}.bg-chapter{background-color:var(--color-chapter)}.bg-bookshelf{background-color:var(--color-bookshelf)}.container{max-width:1400px;margin-inline-start:auto;margin-inline-end:auto;padding-inline-start:16px;padding-inline-end:16px}.container.medium{max-width:1100px}.container.small{max-width:840px}.container.very-small{max-width:480px}.grid{display:grid;grid-column-gap:24px;grid-row-gap:24px}.grid>*{min-width:0}.grid.half{grid-template-columns:1fr 1fr}.grid.third{grid-template-columns:1fr 1fr 1fr}.grid.left-focus{grid-template-columns:2fr 1fr}.grid.right-focus{grid-template-columns:1fr 3fr}.grid.gap-y-xs{grid-row-gap:6px}.grid.gap-xl{grid-column-gap:32px;grid-row-gap:32px}.grid.gap-xxl{grid-column-gap:48px;grid-row-gap:48px}.grid.v-center{align-items:center}.grid.v-end{align-items:end}.grid.no-gap{grid-row-gap:0;grid-column-gap:0}.grid.no-row-gap{grid-row-gap:0}@media screen and (max-width: 880px){.grid.third:not(.no-break){grid-template-columns:1fr 1fr}.grid.half:not(.no-break),.grid.left-focus:not(.no-break),.grid.right-focus:not(.no-break){grid-template-columns:1fr}.grid.half.collapse-xs{grid-template-columns:1fr 1fr}.grid.gap-xl{grid-column-gap:16px;grid-row-gap:16px}.grid.right-focus.reverse-collapse>*:nth-child(2){order:0}.grid.right-focus.reverse-collapse>*:nth-child(1){order:1}}@media screen and (max-width: 600px){.grid.third:not(.no-break){grid-template-columns:1fr}}@media screen and (max-width: 400px){.grid.half.collapse-xs{grid-template-columns:1fr}}#content{flex:1 0 auto}body.flexbox{display:flex;flex-direction:column;align-items:stretch;height:100%;min-height:100%;max-height:100%;overflow:hidden}body.flexbox #content{flex:1;display:flex;min-height:0}.flex-fill{display:flex;align-items:stretch;min-height:0;max-width:100%;position:relative}.flex-container-row{display:flex;flex-direction:row}.flex-container-row.v-center{align-items:center}.flex-container-column{display:flex;flex-direction:column}.flex-container-row.inline,.flex-container-column.inline{display:inline-flex !important}.flex-container-column.wrap,.flex-container-row.wrap{flex-wrap:wrap}.flex{min-height:0;flex:1;max-width:100%}.flex.fit-content{flex-basis:auto;flex-grow:0}.flex.fill-area{flex-grow:1;flex-shrink:0;min-width:fit-content}.flex-2{min-height:0;flex:2;max-width:100%}.flex-3{min-height:0;flex:3;max-width:100%}.flex-none{flex:none}.justify-flex-start{justify-content:flex-start}.justify-flex-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-space-between{justify-content:space-between}.items-center{align-items:center}.items-stretch{align-items:stretch}.min-width-xxxxs{min-width:60px}.min-width-xxxs{min-width:80px}.min-width-xxs{min-width:100px}.min-width-xs{min-width:120px}.min-width-s{min-width:160px}.min-width-m{min-width:200px}.min-width-l{min-width:240px}.min-width-xl{min-width:280px}.min-width-xxl{min-width:320px}.block{display:block !important;position:relative}.inline{display:inline !important}.block.inline{display:inline-block !important}.relative{position:relative}.fixed{position:fixed;z-index:20}.fixed.top-right{top:0;right:0}.hidden{display:none !important}.overflow-hidden{overflow:hidden}.height-fill{height:100%}.height-auto{height:auto !important}.float{float:left}.float.right{float:right}.sticky-top-m{position:sticky;top:16px}@media screen and (max-width: 360px){.hide-under-xxs{display:none !important}}@media screen and (min-width: 361px){.hide-over-xxs{display:none !important}}@media screen and (max-width: 400px){.hide-under-xs{display:none !important}}@media screen and (min-width: 401px){.hide-over-xs{display:none !important}}@media screen and (max-width: 600px){.hide-under-s{display:none !important}}@media screen and (min-width: 601px){.hide-over-s{display:none !important}}@media screen and (max-width: 880px){.hide-under-m{display:none !important}}@media screen and (min-width: 881px){.hide-over-m{display:none !important}}@media screen and (max-width: 1000px){.hide-under-l{display:none !important}}@media screen and (min-width: 1001px){.hide-over-l{display:none !important}}@media screen and (max-width: 1100px){.hide-under-xl{display:none !important}}@media screen and (min-width: 1101px){.hide-over-xl{display:none !important}}[hidden]{display:none !important}.screen-reader-only{position:absolute;inset-inline-start:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.rounded{border-radius:4px}.dual-column-content{columns:2}@media screen and (max-width: 880px){.dual-column-content{columns:1}}.clearfix::before,.clearfix::after{content:" ";display:table}.clearfix::after{clear:both}.tri-layout-container{display:grid;margin-inline-start:32px;margin-inline-end:32px;grid-template-columns:1fr 4fr 1fr;grid-template-areas:"a b c";grid-column-gap:32px;position:relative}.tri-layout-sides{grid-column-start:a;grid-column-end:c;grid-row:1;min-width:0;z-index:4}.tri-layout-sides-content{display:grid;grid-template-areas:"a b c";grid-template-columns:1fr 4fr 1fr;height:100%}.tri-layout-middle{grid-area:b;padding-top:16px;min-width:0;z-index:5}.tri-layout-right{grid-area:c;min-width:0;position:relative}.tri-layout-left{grid-area:a;min-width:0;position:relative}@media screen and (min-width: 1401px){.tri-layout-left-contents,.tri-layout-right-contents{padding:32px 16px;position:sticky;top:0;max-height:100vh;min-height:50vh;overflow-y:scroll;overflow-x:hidden;height:100%;scrollbar-width:none;-ms-overflow-style:none}.tri-layout-left-contents::-webkit-scrollbar,.tri-layout-right-contents::-webkit-scrollbar{display:none}.tri-layout-middle-contents{max-width:940px;margin:0 auto}}@media screen and (min-width: 1401px)and (max-width: 1700px){.tri-layout-sides-content,.tri-layout-container{grid-template-columns:1fr 972px 1fr}.tri-layout-container{grid-column-gap:12px;margin-inline-start:16px;margin-inline-end:16px}}@media screen and (max-width: 1400px){.tri-layout-container{grid-template-areas:"a b b";grid-template-columns:1fr 3fr;grid-template-rows:min-content min-content 1fr;margin-inline-start:19px;margin-inline-end:19px}.tri-layout-sides{grid-column-start:a;grid-column-end:a}.tri-layout-sides-content{display:block}}@media screen and (min-width: 1001px)and (max-width: 1400px){.tri-layout-sides-content{position:sticky;top:0;max-height:100vh;min-height:50vh;overflow-y:scroll;overflow-x:hidden;height:100%;scrollbar-width:none;-ms-overflow-style:none;padding-inline:16px;margin-inline:-16px}.tri-layout-sides-content::-webkit-scrollbar{display:none}}@media screen and (min-width: 1001px){.tri-layout-mobile-tabs{display:none}.tri-layout-left-contents>*,.tri-layout-right-contents>*{opacity:.6;transition:opacity ease-in-out 120ms}html.dark-mode .tri-layout-left-contents>*,html.dark-mode .tri-layout-right-contents>*{opacity:.75}.tri-layout-left-contents>*:hover,.tri-layout-left-contents>*:focus-within,.tri-layout-right-contents>*:hover,.tri-layout-right-contents>*:focus-within{opacity:1 !important}}@media screen and (min-width: 1001px)and (prefers-contrast: more){.tri-layout-left-contents>*,.tri-layout-right-contents>*{opacity:1 !important}}@media screen and (max-width: 1000px){.tri-layout-container{grid-template-areas:none;grid-template-columns:1fr;grid-column-gap:0;padding-inline-end:6px;padding-inline-start:6px}.tri-layout-container .tri-layout-sides{padding-inline-start:16px;padding-inline-end:16px;grid-column:1/1}.tri-layout-container .tri-layout-left>*,.tri-layout-container .tri-layout-right>*{display:none;pointer-events:none}.tri-layout-container .tri-layout-left,.tri-layout-container .tri-layout-right{padding-top:0 !important}.tri-layout-container .tri-layout-middle{grid-area:none;grid-row:3;grid-column:1/1;z-index:1;overflow:hidden;transition:transform ease-in-out 240ms}.tri-layout-container .tri-layout-left{grid-row:2}.tri-layout-container.show-info{overflow:hidden}.tri-layout-container.show-info .tri-layout-middle{display:none}.tri-layout-container.show-info .tri-layout-right>*,.tri-layout-container.show-info .tri-layout-left>*{display:block;pointer-events:auto}}@media screen and (max-width: 880px){.tri-layout-container{margin-inline-start:0;margin-inline-end:0}}.scroll-away-from-top:before,.scroll-away-from-bottom:after{content:"";display:block;position:absolute;color:#f2f2f2;left:0;top:0;width:100%;height:50px;background:linear-gradient(to bottom, currentColor, transparent);z-index:2}html.dark-mode .scroll-away-from-top:before,html.dark-mode .scroll-away-from-bottom:after{color:#111}.scroll-away-from-bottom:after{top:auto;bottom:0;background:linear-gradient(to top, currentColor, transparent)}.card{background-color:#fff;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);border-radius:3px;break-inside:avoid}html.dark-mode .card{background-color:#222}.card .body,.card p.empty-text{padding-block:16px}.card a,.card p{word-wrap:break-word;word-break:break-word}.card-title{padding:16px 16px 6px;margin:0;font-size:14px;color:#222;fill:#222;font-weight:400}.card-title a{line-height:1}.card-footer-link,button.card-footer-link{display:block;padding:12px 16px;line-height:1;border-top:1px solid;width:100%;text-align:left;border-color:#ddd;border-radius:0 0 3px 3px;font-size:.9em;margin-top:6px}html.dark-mode .card-footer-link,html.dark-mode button.card-footer-link{border-color:#555}.card-footer-link:hover,button.card-footer-link:hover{text-decoration:none;background-color:#f2f2f2}html.dark-mode .card-footer-link:hover,html.dark-mode button.card-footer-link:hover{background-color:#2d2d2d}.card-footer-link:focus,button.card-footer-link:focus{background-color:#eee;outline:1px dotted #666;outline-offset:-2px}html.dark-mode .card-footer-link:focus,html.dark-mode button.card-footer-link:focus{background-color:#222}.card.border-card{border:1px solid;border-color:#ddd}html.dark-mode .card.border-card{border-color:#000}.card.drag-card{border:1px solid #ddd;border-color:#ddd;background-color:#fff;border-radius:4px;display:flex;padding:0 0 0 40px;margin:12px 0;position:relative}html.dark-mode .card.drag-card{border-color:#000}html.dark-mode .card.drag-card{background-color:#333}.card.drag-card .drag-card-action{cursor:pointer}.card.drag-card .handle,.card.drag-card .drag-card-action{display:flex;align-items:center;text-align:center;justify-content:center;width:28px;flex-grow:0;padding:0 6px}.card.drag-card .handle:hover,.card.drag-card .drag-card-action:hover{background-color:#eee}html.dark-mode .card.drag-card .handle:hover,html.dark-mode .card.drag-card .drag-card-action:hover{background-color:#2d2d2d}.card.drag-card .handle .svg-icon,.card.drag-card .drag-card-action .svg-icon{margin-inline-end:0px}.card.drag-card .outline input{margin:12px 0;width:100%}.card.drag-card .outline{position:relative}.card.drag-card .handle{background-color:#eee;left:0;position:absolute;top:0;bottom:0}html.dark-mode .card.drag-card .handle{background-color:#2d2d2d}.card.drag-card>div{padding:0 12px;max-width:80%;flex:1}.grid-card{display:flex;flex-direction:column;border:1px solid #ddd;border-color:#ddd;margin-bottom:24px;border-radius:4px;overflow:hidden;min-width:100px;color:#444;transition:border-color ease-in-out 120ms,box-shadow ease-in-out 120ms}html.dark-mode .grid-card{border-color:#000}.grid-card:hover{color:#444;text-decoration:none;box-shadow:0 1px 6px -1px rgba(0,0,0,.1)}html.dark-mode .grid-card:hover{box-shadow:0 1px 6px -1px rgba(0,0,0,.5)}.grid-card h2{width:100%;font-size:1.5em;margin:0 0 10px}.grid-card p{font-size:.7rem;margin:0;line-height:1.6em}.grid-card .grid-card-content{flex:1;border-top:0;border-bottom-width:2px}.grid-card .grid-card-content,.grid-card .grid-card-footer{padding:24px}.grid-card .grid-card-content+.grid-card-footer{padding-top:0}.book-grid-item .grid-card-footer p.small{font-size:.8em;margin:0}.content-wrap.card{padding:16px 48px;margin-inline-start:auto;margin-inline-end:auto;margin-bottom:24px;overflow:initial;min-height:60vh;border-radius:8px}.content-wrap.card.auto-height{min-height:0}.content-wrap.card.fill-width{width:100%}@media screen and (max-width: 1400px){.content-wrap.card{padding:16px 32px}}@media screen and (max-width: 880px){.content-wrap.card{padding:16px 24px}}@media screen and (max-width: 600px){.content-wrap.card{padding:16px 16px}}.sub-card{box-shadow:0 1px 3px 0 rgba(0,0,0,.1);border:1.5px solid;border-color:#e2e2e2;border-radius:4px}html.dark-mode .sub-card{border-color:#444}.outline-hover{border:1px solid rgba(0,0,0,0) !important}.outline-hover:hover{border:1px solid rgba(0,0,0,.1) !important}.fade-in-when-active{opacity:.6;transition:opacity ease-in-out 120ms}html.dark-mode .fade-in-when-active{opacity:.7}.fade-in-when-active:hover,.fade-in-when-active:focus-within{opacity:1 !important}@media(prefers-contrast: more){.fade-in-when-active{opacity:1 !important}}.tag-item{display:inline-flex;margin-bottom:6px;margin-inline-end:6px;border-radius:4px;border:1px solid;overflow:hidden;font-size:.85em;border-color:#ccc}html.dark-mode .tag-item{border-color:#666}.tag-item a,.tag-item span,.tag-item a:hover,.tag-item a:active{padding:4px 8px;color:rgba(0,0,0,.7);transition:background-color ease-in-out 80ms;text-decoration:none}html.dark-mode .tag-item a,html.dark-mode .tag-item span,html.dark-mode .tag-item a:hover,html.dark-mode .tag-item a:active{color:hsla(0,0%,100%,.8)}.tag-item a:hover{background-color:hsla(0,0%,100%,.7)}html.dark-mode .tag-item a:hover{background-color:hsla(0,0%,100%,.3)}.tag-item svg{fill:rgba(0,0,0,.5)}html.dark-mode .tag-item svg{fill:hsla(0,0%,100%,.5)}.tag-item .tag-value{border-inline-start:1px solid;border-color:#ddd;background-color:hsla(0,0%,100%,.5)}html.dark-mode .tag-item .tag-value{border-color:#666}html.dark-mode .tag-item .tag-value{background-color:hsla(0,0%,100%,.2)}.tag-name.highlight,.tag-value.highlight{font-weight:bold}.tag-list div:last-child .tag-item{margin-bottom:0}.item-list-row .tag-item{margin-bottom:0}.api-method{font-size:.75rem;background-color:#888;padding:6px;line-height:1.3;opacity:.7;vertical-align:top;border-radius:3px;color:#fff;display:inline-block;min-width:60px;text-align:center;font-weight:bold}.api-method[data-method=GET]{background-color:#077b70}.api-method[data-method=POST]{background-color:#cf4d03}.api-method[data-method=PUT]{background-color:#0288d1}.api-method[data-method=DELETE]{background-color:#ab0f0e}.sticky-sidebar{position:sticky;top:0;padding-left:2px;max-height:100vh;overflow-y:auto}.sticky-sidebar .sticky-sidebar-header{position:sticky;top:0;background:#f2f2f2;background:linear-gradient(180deg, rgb(242, 242, 242) 66%, rgba(242, 242, 242, 0) 100%);z-index:4}.dark-mode .sticky-sidebar-header{background:#111;background:linear-gradient(180deg, rgb(17, 17, 17) 66%, rgba(17, 17, 17, 0) 100%)}button{background-color:rgba(0,0,0,0);border:0;font-size:100%}.button{text-decoration:none;font-size:.85rem;line-height:1.4em;padding:7.8px 16px;margin-top:6px;margin-bottom:6px;display:inline-block;font-weight:400;outline:0;border-radius:4px;cursor:pointer;transition:background-color ease-in-out 120ms,filter ease-in-out 120ms,box-shadow ease-in-out 120ms;box-shadow:none;background-color:var(--color-primary);color:#fff;border:1px solid var(--color-primary);vertical-align:top}.button:hover,.button:focus,.button:active{background-color:var(--color-primary);text-decoration:none;color:#fff}.button:hover{box-shadow:0 0 4px 1px #ccc;filter:brightness(110%)}html.dark-mode .button:hover{box-shadow:0 0 4px 1px rgba(0,0,0,.5)}.button:focus{outline:1px dotted currentColor;outline-offset:-6px;box-shadow:none;filter:brightness(90%)}.button:active{outline:0}.button.outline{background-color:rgba(0,0,0,0);color:#666;fill:currentColor;border:1px solid;border-color:#ccc}html.dark-mode .button.outline{color:#aaa}html.dark-mode .button.outline{border-color:#666}.button.outline:hover,.button.outline:focus,.button.outline:active{color:#444;border:1px solid #ccc;box-shadow:0 1px 4px 0 rgba(0,0,0,.1);background-color:#f2f2f2;background-color:#f8f8f8;filter:none}html.dark-mode .button.outline:hover,html.dark-mode .button.outline:focus,html.dark-mode .button.outline:active{color:#bbb}html.dark-mode .button.outline:hover,html.dark-mode .button.outline:focus,html.dark-mode .button.outline:active{background-color:#444}.button.outline:active{border-color:#bbb;background-color:#ddd;color:#666;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.button+.button{margin-inline-start:12px}.button.small{font-size:.75rem;padding:7.2px 12px}.text-button{cursor:pointer;background-color:rgba(0,0,0,0);padding:0;margin:0;border:none;user-select:none;font-size:.75rem;line-height:1.4em;color:var(--color-link)}.text-button:active{outline:0}.text-button:hover{text-decoration:none}.text-button:hover,.text-button:focus{color:var(--color-link);fill:var(--color-link)}.text-button.hover-underline:hover{text-decoration:underline}.button.block{width:100%;text-align:start;display:block}.button.icon .svg-icon,.icon-button .svg-icon,.text-button.icon .svg-icon{margin-inline-end:0}.icon-button{text-align:center;border:1px solid rgba(0,0,0,0)}.icon-button:hover{background-color:rgba(0,0,0,.05);border-radius:4px;border-color:#ddd;cursor:pointer}html.dark-mode .icon-button:hover{border-color:#444}.button.svg{display:flex;align-items:center;padding:12px 16px;padding-bottom:10px;width:100%}.button.svg svg{display:inline-block;width:24px;height:24px;bottom:auto;margin-inline-end:16px}.button[disabled]{background-color:#bbb;cursor:default;border-color:#ccc}.button[disabled]:hover{background-color:#bbb;cursor:default;box-shadow:none}table{min-width:100px;max-width:100%}table thead{background-color:#f8f8f8;font-weight:500}html.dark-mode table thead{background-color:#333}table td,table th{min-width:10px;padding:6px 8px;border:1px solid #ddd;overflow:auto;line-height:1.2;word-break:break-word;vertical-align:top}table td p,table th p{margin:0}table.table{width:100%}table.table tr td,table.table tr th{border-bottom:1px solid rgba(0,0,0,.05)}table.table th,table.table td{text-align:start;border:none;padding:12px 12px;vertical-align:middle;margin:0;overflow:visible}table.table th{font-weight:bold}table.table tr:hover{background-color:#f2f2f2}html.dark-mode table.table tr:hover{background-color:#333}table.table .text-right{text-align:end}table.table .text-center{text-align:center}table.table td.actions{overflow:visible}table.table a{display:inline-block}table.table.expand-to-padding{margin-left:-12px;margin-right:-12px;width:calc(100% + 2*12px);max-width:calc(100% + 2*12px)}table.no-style td{border:0;padding:0}table.list-table{margin:0 -6px}table.list-table td{border:0;vertical-align:middle;padding:6px}.input-base,input[type=text],input[type=number],input[type=email],input[type=date],input[type=search],input[type=url],input[type=color],input[type=password],select,textarea,.fake-input{border-radius:3px;border:1px solid #d4d4d4;background-color:#fff;border-color:#d4d4d4;color:#666;display:inline-block;font-size:14px;padding:10.8px;height:40px;width:250px;max-width:100%}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{background-color:#333}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{border-color:#111}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{color:#aaa}.input-base.neg,input.neg[type=text],input.neg[type=number],input.neg[type=email],input.neg[type=date],input.neg[type=search],input.neg[type=url],input.neg[type=color],input.neg[type=password],select.neg,textarea.neg,.neg.fake-input,.input-base.invalid,input.invalid[type=text],input.invalid[type=number],input.invalid[type=email],input.invalid[type=date],input.invalid[type=search],input.invalid[type=url],input.invalid[type=color],input.invalid[type=password],select.invalid,textarea.invalid,.invalid.fake-input{border:1px solid var(--color-negative)}.input-base.pos,input.pos[type=text],input.pos[type=number],input.pos[type=email],input.pos[type=date],input.pos[type=search],input.pos[type=url],input.pos[type=color],input.pos[type=password],select.pos,textarea.pos,.pos.fake-input,.input-base.valid,input.valid[type=text],input.valid[type=number],input.valid[type=email],input.valid[type=date],input.valid[type=search],input.valid[type=url],input.valid[type=color],input.valid[type=password],select.valid,textarea.valid,.valid.fake-input{border:1px solid var(--color-positive)}.input-base.disabled,input.disabled[type=text],input.disabled[type=number],input.disabled[type=email],input.disabled[type=date],input.disabled[type=search],input.disabled[type=url],input.disabled[type=color],input.disabled[type=password],select.disabled,textarea.disabled,.disabled.fake-input,.input-base[disabled],input[disabled][type=text],input[disabled][type=number],input[disabled][type=email],input[disabled][type=date],input[disabled][type=search],input[disabled][type=url],input[disabled][type=color],input[disabled][type=password],select[disabled],textarea[disabled],[disabled].fake-input{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAMUlEQVQIW2NkwAGuXbv2nxGbHEhCS0uLEUMSJgHShCKJLIEiiS4Bl8QmAZbEJQGSBAC62BuJ+tt7zgAAAABJRU5ErkJggg==)}.input-base[readonly],input[readonly][type=text],input[readonly][type=number],input[readonly][type=email],input[readonly][type=date],input[readonly][type=search],input[readonly][type=url],input[readonly][type=color],input[readonly][type=password],select[readonly],textarea[readonly],[readonly].fake-input{background-color:#f8f8f8}.input-base:focus,input[type=text]:focus,input[type=number]:focus,input[type=email]:focus,input[type=date]:focus,input[type=search]:focus,input[type=url]:focus,input[type=color]:focus,input[type=password]:focus,select:focus,textarea:focus,.fake-input:focus{border-color:var(--color-primary);outline:1px solid var(--color-primary)}.input-fill-width{width:100% !important}.fake-input{overflow:auto}#html-editor{display:none}#markdown-editor{position:relative;z-index:5}#markdown-editor #markdown-editor-input{font-style:normal;font-weight:400;padding:6px 16px;color:#444;background-color:#fff;border-radius:0;height:100%;font-size:14px;line-height:1.2;max-height:100%;flex:1;border:0;width:100%;margin:0}html.dark-mode #markdown-editor #markdown-editor-input{color:#aaa}html.dark-mode #markdown-editor #markdown-editor-input{background-color:#222}#markdown-editor #markdown-editor-input:focus{outline:0}#markdown-editor.fullscreen{position:fixed;top:0;left:0;height:100%;z-index:2}.markdown-editor-wrap{border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-color:#ddd;position:relative;flex:1;min-width:0}html.dark-mode .markdown-editor-wrap{border-color:#000}.markdown-editor-wrap+.markdown-editor-wrap{flex-basis:50%;flex-shrink:0;flex-grow:0}.markdown-editor-wrap .cm-editor{flex:1;max-width:100%;border:0;margin:0}.markdown-panel-divider{width:2px;background-color:#ddd;cursor:col-resize}html.dark-mode .markdown-panel-divider{background-color:#000}@media screen and (max-width: 880px){#markdown-editor{flex-direction:column}#markdown-editor .markdown-editor-wrap{width:100%;max-width:100%;flex-grow:1;flex-basis:auto !important;min-height:0}.editor-toolbar-label{float:none !important;border-color:#ddd;display:block}html.dark-mode .editor-toolbar-label{border-color:#555}.markdown-editor-wrap:not(.active) .editor-toolbar+div,.markdown-editor-wrap:not(.active) .editor-toolbar .buttons,.markdown-editor-wrap:not(.active) .markdown-display{display:none}#markdown-editor .markdown-editor-wrap:not(.active){flex-grow:0;flex:none}}.markdown-editor-display{background-color:#fff}.markdown-editor-display body{display:block;background-color:#fff;padding-inline-start:12px;padding-inline-end:12px;max-width:864px}.markdown-editor-display [drawio-diagram]:hover{outline:2px solid var(--color-primary)}html.markdown-editor-display.dark-mode{background-color:#222}html.markdown-editor-display.dark-mode body{background-color:#222}.editor-toolbar{height:32px;width:100%;font-size:11px;line-height:1.6;border-bottom:1px solid #ccc;background-color:#fff;border-color:#ccc;flex:none}html.dark-mode .editor-toolbar{background-color:#333}html.dark-mode .editor-toolbar{border-color:#000}html.dark-mode .editor-toolbar button{color:#aaa}.editor-toolbar .buttons{font-size:14px}.editor-toolbar .buttons .dropdown-menu{padding:0}.editor-toolbar .buttons .toggle-switch{margin:12px 0}.editor-toolbar .buttons button{font-size:.9rem;width:2rem;text-align:center;border-left:1px solid;border-color:#ddd}html.dark-mode .editor-toolbar .buttons button{border-color:#555}.editor-toolbar .buttons button svg{margin-inline-end:0}.editor-toolbar .buttons button:hover{background-color:#ddd}html.dark-mode .editor-toolbar .buttons button:hover{background-color:#222}label{color:#666;display:block;line-height:1.4em;font-size:.94em;font-weight:400;padding-bottom:2px;margin-bottom:.2em}html.dark-mode label{color:#ddd}label.inline{display:inline-block}label.radio,label.checkbox{font-weight:400;user-select:none}label.radio input[type=radio],label.radio input[type=checkbox],label.checkbox input[type=radio],label.checkbox input[type=checkbox]{margin-inline-end:6px}label.inline.checkbox{margin-inline-end:16px}label+p.small{margin-bottom:.8em}table.form-table{max-width:100%}table.form-table td{overflow:hidden;padding:1.5px 0}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:url("data:image/svg+xml;utf8,");background-size:10px 12px;background-position:calc(100% - 20px) 64%;background-repeat:no-repeat}html[dir=rtl] select{background-position:20px 70%}input[type=date]{width:190px}input[type=color]{height:60px}input[type=color].small{height:42px;width:60px;padding:2px}.toggle-switch{user-select:none;display:inline-grid;grid-template-columns:28px 1fr;align-items:center;margin:16px 0}.toggle-switch .custom-checkbox{width:16px;height:16px;border-radius:2px;display:inline-block;border:2px solid currentColor;overflow:hidden;fill:currentColor}.toggle-switch .custom-checkbox .svg-icon{width:100%;height:100%;margin:0;bottom:auto;top:-1.5px;left:0;transition:transform ease-in-out 120ms;transform:scale(0);transform-origin:center center}.toggle-switch input[type=checkbox]{display:none}.toggle-switch input[type=checkbox]:checked+.custom-checkbox .svg-icon{transform:scale(1)}.toggle-switch .custom-checkbox:hover{background-color:rgba(0,0,0,.05);opacity:.8}.toggle-switch input[type=checkbox][disabled]~*{opacity:.8;cursor:not-allowed}.toggle-switch input[type=checkbox][disabled]~.custom-checkbox{border-color:#999;color:#999 !important;background:#f2f2f2}.toggle-switch-list .toggle-switch{margin:6px 0}.toggle-switch-list.compact .toggle-switch{margin:1px 0}.form-group{margin-bottom:12px}.setting-list>div{border-bottom:1px solid #ddd;padding:32px 0}.setting-list>div:last-child{border-bottom:none}.setting-list-label{color:#222;color:#222;font-size:1rem}html.dark-mode .setting-list-label{color:#ddd}.setting-list-label+p.small{margin-bottom:0}.setting-list-label+.grid{margin-top:16px}.setting-list .grid input[type=text],.setting-list .grid input[type=email],.setting-list .grid input[type=password],.setting-list .grid select,.stretch-inputs input[type=text],.stretch-inputs input[type=email],.stretch-inputs input[type=password],.stretch-inputs select{width:100%}.simple-code-input{background-color:#f8f8f8;font-family:monospace;font-size:12px;min-height:100px;display:block;width:100%}.form-group div.text-pos,.form-group div.text-neg,.form-group p.text-post,.form-group p.text-neg{padding:6px 0}.form-group.collapsible{padding:0 16px;border:1px solid;border-color:#ddd;border-radius:4px}html.dark-mode .form-group.collapsible{border-color:#000}.form-group.collapsible .collapse-title{margin-inline-start:-16px;margin-inline-end:-16px;padding:12px 16px;display:block;width:calc(100% + 32px);text-align:start}.form-group.collapsible .collapse-title,.form-group.collapsible .collapse-title label{cursor:pointer}.form-group.collapsible .collapse-title label{padding-bottom:0;margin-bottom:0;color:inherit}.form-group.collapsible .collapse-title label:before{display:inline-block;content:"▸";margin-inline-end:16px;transition:all ease-in-out 400ms;transform:rotate(0)}.form-group.collapsible .collapse-content{display:none;padding-bottom:16px}.form-group.collapsible.open .collapse-title label:before{transform:rotate(90deg)}.form-group.ambrosia-container,.form-group.ambrosia-container *{position:absolute !important;height:1px !important;width:1px !important;margin:-1px !important;padding:0 !important;background:rgba(0,0,0,0) !important;color:rgba(0,0,0,0) !important;border:none !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important}.title-input input[type=text]{display:block;width:100%;padding:12px;margin-top:0;font-size:2em;height:auto}.description-input textarea{display:block;width:100%;padding:12px;font-size:14px;color:#666;height:auto}.description-input>.tox-tinymce{border:1px solid #ddd !important;border-color:#ddd !important;border-radius:3px}html.dark-mode .description-input>.tox-tinymce{border-color:#000 !important}.description-input>.tox-tinymce .tox-toolbar__primary{justify-content:end}.search-box{max-width:100%;position:relative}.search-box button[tabindex="-1"]{background-color:rgba(0,0,0,0);border:none;color:#666;padding:0;cursor:pointer;position:absolute;inset-inline-start:8px;top:10px}html.dark-mode .search-box button[tabindex="-1"]{color:#aaa}.search-box input{display:block;padding:9px;padding-inline-start:28px;width:300px;max-width:100%;height:auto}.search-box.flexible input{width:100%}.search-box button.search-box-cancel{left:auto;right:0}.contained-search-box{display:flex;height:38px;z-index:-1}.contained-search-box.floating{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);border-radius:4px;overflow:hidden}html.dark-mode .contained-search-box.floating{border:1px solid #000}.contained-search-box input,.contained-search-box button{height:100%;border-radius:0;border:1px solid #ddd;border-color:#ddd;margin-inline-start:-1px}html.dark-mode .contained-search-box input,html.dark-mode .contained-search-box button{border-color:#000}.contained-search-box input:last-child,.contained-search-box button:last-child{border-inline-end:0}.contained-search-box input{border:0;flex:5;padding:6px 12px}.contained-search-box input:focus,.contained-search-box input:active{outline:1px dotted var(--color-primary);outline-offset:-2px;border:0}.contained-search-box button{border:0;width:48px;border-inline-start:1px solid #ddd;background-color:#fff;background-color:#fff;color:#444}html.dark-mode .contained-search-box button{background-color:#333}html.dark-mode .contained-search-box button{color:#aaa}.contained-search-box button:focus{outline:1px dotted var(--color-primary);outline-offset:-2px}.contained-search-box svg{margin:0}@media screen and (max-width: 600px){.contained-search-box{width:180px}}.outline>input{border:0;border-bottom:2px solid #ddd;border-radius:0}.outline>input:focus,.outline>input:active{border:0;border-bottom:2px solid #aaa;outline:0}.image-picker img{background-color:#bbb;max-width:100%}.custom-file-input{overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;height:1px;border:0;clip:rect(0, 0, 0, 0)}.custom-file-input:focus+label{border-color:var(--color-primary);outline:1px solid var(--color-primary)}.custom-simple-file-input{max-width:100%;border:1px solid;border-color:#ddd;border-radius:4px;padding:12px 16px}html.dark-mode .custom-simple-file-input{border-color:#666}.custom-simple-file-input::file-selector-button{background-color:rgba(0,0,0,0);text-decoration:none;font-size:.8rem;line-height:1.4em;padding:6px 12px;border:1px solid;font-weight:400;outline:0;border-radius:4px;cursor:pointer;margin-right:16px;color:#666;border-color:#ccc}html.dark-mode .custom-simple-file-input::file-selector-button{color:#aaa}html.dark-mode .custom-simple-file-input::file-selector-button{border-color:#666}.custom-simple-file-input::file-selector-button:hover,.custom-simple-file-input::file-selector-button:focus,.custom-simple-file-input::file-selector-button:active{color:#444;border:1px solid #ccc;box-shadow:0 1px 4px 0 rgba(0,0,0,.1);background-color:#f2f2f2;background-color:#f8f8f8;filter:none}html.dark-mode .custom-simple-file-input::file-selector-button:hover,html.dark-mode .custom-simple-file-input::file-selector-button:focus,html.dark-mode .custom-simple-file-input::file-selector-button:active{color:#bbb}html.dark-mode .custom-simple-file-input::file-selector-button:hover,html.dark-mode .custom-simple-file-input::file-selector-button:focus,html.dark-mode .custom-simple-file-input::file-selector-button:active{background-color:#444}.custom-simple-file-input::file-selector-button:active{border-color:#bbb;background-color:#ddd;color:#666;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}input.shortcut-input{width:auto;max-width:120px;height:auto}.anim.fadeIn{opacity:0;animation-name:fadeIn;animation-duration:120ms;animation-timing-function:ease-in-out;animation-fill-mode:forwards}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.search-suggestions-animation{animation-name:searchSuggestions;animation-duration:120ms;animation-fill-mode:forwards;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99)}@keyframes searchSuggestions{0%{opacity:.5;transform:scale(0.9)}100%{opacity:1;transform:scale(1)}}@keyframes loadingBob{0%{transform:translate3d(0, 0, 0)}30%{transform:translate3d(0, 0, 0)}50%{transform:translate3d(0, -10px, 0)}70%{transform:translate3d(0, 0, 0)}100%{transform:translate3d(0, 0, 0)}}@keyframes pointer{0%{transform:translate3d(0, 20px, 0) scale3d(0, 0, 0)}100%{transform:translate3d(0, 0, 0) scale3d(1, 1, 1)}}.anim.pointer{transform-origin:50% 100%;animation-name:pointer;animation-duration:180ms;animation-delay:0s;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99)}@keyframes highlight{0%{background-color:var(--color-primary-light)}33%{background-color:rgba(0,0,0,0)}66%{background-color:var(--color-primary-light)}100%{background-color:rgba(0,0,0,0)}}.anim-highlight{animation-name:highlight;animation-duration:2s;animation-delay:0s;animation-timing-function:linear}.tox.tox-fullscreen{position:fixed;top:0;height:100%;width:100%;max-width:100%;z-index:100}.tox.tox-tinymce{border-inline:0;border-bottom:0}.page-content.mce-content-body{padding-block-start:1rem;padding-block-end:1rem;outline:0;display:block;max-width:870px}.wysiwyg-input.mce-content-body{padding-block-start:1rem;padding-block-end:1rem;outline:0;display:block}.wysiwyg-input.mce-content-body:before{padding:1rem;top:4px;font-style:italic;color:rgba(34,47,62,.5)}html.dark-mode .wysiwyg-input.mce-content-body:before{color:rgba(155,155,155,.5)}.page-content.mce-content-body doc-root{display:block}.page-content.mce-content-body code-block{display:block}body.page-content.mce-content-body{padding-bottom:5rem}.tox .tox-pop__dialog .tox-toolbar{background:rgba(0,0,0,0) !important}.tox-toolbar__primary{justify-content:center}.page-content.mce-content-body code-block>*{pointer-events:none}.page-content.mce-content-body code-block pre{display:none}.page-content.mce-content-body details summary{pointer-events:none}.page-content.mce-content-body details doc-root{padding:12px;margin-left:-10px;margin-right:-10px;margin-bottom:-10px;margin-top:-10px;overflow:hidden}.page-content.mce-content-body .mce-preview-object.align-right{float:right !important;margin:6px 0 6px 12px}.page-content.mce-content-body .mce-preview-object.align-left{float:left !important;margin:6px 16px 16px 0}.page-content.mce-content-body .mce-preview-object.align-center{display:block;margin-left:auto;margin-right:auto}.page-content.mce-content-body .mce-preview-object iframe,.page-content.mce-content-body .mce-preview-object video{display:block;margin:0 !important;float:none !important}.page-content.mce-content-body td[data-mce-selected]::after,.page-content.mce-content-body th[data-mce-selected]::after{top:1px;left:1px;bottom:1px;right:1px;outline:1px dashed #1a85ff;outline-offset:0}.dark-mode .tox .tox-toolbar__primary,.dark-mode .tox .tox-menu,.dark-mode .tox .tox-dialog__header,.dark-mode .tox .tox-dialog,.dark-mode .tox .tox-dialog__footer,.dark-mode .tox .tox-pop__dialog,.dark-mode .tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#333 !important}.dark-mode .tox .tox-tbtn svg,.dark-mode .tox .tox-tbtn,.dark-mode .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#dbdbdb;fill:#dbdbdb}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{width:6em !important}.tox-menu .tox-collection__item blockquote::before{content:none}.tox-menu .tox-collection__item blockquote{border-left:4px solid var(--color-primary) !important;padding:4px 6px !important}.tox-menu .tox-collection__item blockquote{border-left:4px solid var(--color-primary) !important;padding:4px 6px !important}.tox-menu .tox-collection__item p[style*=background-color]{padding:4px 6px !important;border-left:3px solid currentColor !important}.tox-menu .tox-collection__item[title^="<"]>div>div{font-family:var(--font-code) !important;border:1px solid #ddd !important;background-color:#eee !important;padding:4px 6px !important}.tox-menu .tox-collection__item-label{line-height:normal !important}.page-content.mce-content-body .task-list-item{margin-inline-start:0;position:relative}.page-content.mce-content-body .task-list-item>input[type=checkbox]{display:none}.page-content.mce-content-body .task-list-item:before{content:"";display:inline-block;border:2px solid #ccc;width:12px;height:12px;border-radius:2px;margin-inline-end:8px;vertical-align:text-top;cursor:pointer;position:absolute;inset-inline-start:-24px;top:4px}.page-content.mce-content-body .task-list-item[checked]:before{background-color:#ccc;background-image:url('data:image/svg+xml;utf8,');background-position:50% 50%;background-size:100% 100%}:root{--editor-color-primary: #206ea7}.editor-container{background-color:#fff;position:relative}html.dark-mode .editor-container{background-color:#222}.editor-container.fullscreen{z-index:500}.editor-toolbar-main{display:flex;flex-wrap:wrap;justify-content:center;border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-color:#ddd}html.dark-mode .editor-toolbar-main{border-color:#000}@media screen and (max-width: 1100px){.editor-toolbar-main{overflow-x:scroll;flex-wrap:nowrap;justify-content:start}}body.editor-is-fullscreen{overflow:hidden}body.editor-is-fullscreen .edit-area{z-index:20}.editor-content-area{min-height:100%;padding-block:1rem}.editor-content-area:focus{outline:0}.editor-content-wrap{position:relative;overflow-y:scroll;padding-inline:12px;flex:1}.comment-editor-container,.basic-editor-container{border-left:1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd;border-radius:3px;border-color:#ddd}html.dark-mode .comment-editor-container,html.dark-mode .basic-editor-container{border-color:#000}.comment-editor-container .editor-toolbar-main,.basic-editor-container .editor-toolbar-main{border-radius:3px 3px 0 0;justify-content:end}.basic-editor-container .editor-content-area{padding-bottom:0}.editor-button{font-size:12px;padding:4px;color:#444;color:#444;border-radius:4px;display:flex;align-items:center;justify-content:center;margin:2px}html.dark-mode .editor-button{color:#999}.editor-button:hover{background-color:#eee;background-color:#eee;cursor:pointer;color:#000}html.dark-mode .editor-button:hover{background-color:#333}.editor-button[disabled]{pointer-events:none;cursor:not-allowed;opacity:.6}.editor-button-active,.editor-button-active:hover{background-color:#ceebff;color:#000}html.dark-mode .editor-button-active,html.dark-mode .editor-button-active:hover{background-color:#444}.editor-button-long{display:flex !important;flex-direction:row;align-items:center;justify-content:start;gap:.5rem}.editor-button-text{font-weight:400;color:#000;font-size:14px;flex:1;padding-inline-end:4px}html.dark-mode .editor-button-text{color:#aaa}.editor-button-format-preview{padding:4px 6px;display:block}.editor-button-long .editor-button-icon{width:24px;height:24px}.editor-button-icon svg{width:24px;height:24px;color:inherit;fill:currentColor;display:block}.editor-menu-button-icon{width:24px;height:24px}.editor-menu-button-icon svg{fill:#888}.editor-container[dir=rtl] .editor-menu-button-icon{rotate:180deg}.editor-button-with-menu-container{display:flex;flex-direction:row;gap:0;align-items:stretch;border-radius:4px}.editor-button-with-menu-container .editor-dropdown-menu-container{display:flex}.editor-button-with-menu-container .editor-dropdown-menu-container>.editor-dropdown-menu{top:100%}.editor-button-with-menu-container .editor-dropdown-menu-container>.editor-button{padding-inline:4px;margin-inline-start:-3px}.editor-button-with-menu-container .editor-dropdown-menu-container>.editor-button svg{width:12px;height:12px}.editor-button-with-menu-container:hover{outline:1px solid;outline-color:#ddd;outline-offset:-3px}html.dark-mode .editor-button-with-menu-container:hover{outline-color:#111}.editor-dropdown-menu-container{position:relative}.editor-dropdown-menu{position:absolute;border:1px solid;background-color:#fff;border-color:#fff;box-shadow:0 0 6px 0 rgba(0,0,0,.15);z-index:99;display:flex;flex-direction:row;border-radius:3px}html.dark-mode .editor-dropdown-menu{background-color:#292929}html.dark-mode .editor-dropdown-menu{border-color:#333}html.dark-mode .editor-dropdown-menu{box-shadow:0 1px 4px 0 rgba(0,0,0,.4)}.editor-dropdown-menu-vertical{display:flex;flex-direction:column;align-items:stretch;min-width:160px}.editor-dropdown-menu-vertical .editor-button{border-bottom:0;text-align:start;display:block;width:100%}.editor-dropdown-menu-vertical>.editor-dropdown-menu-container .editor-dropdown-menu{inset-inline-start:100%;top:0}.editor-separator{display:block;height:1px;opacity:.8;background-color:#ddd}html.dark-mode .editor-separator{background-color:#000}.editor-format-menu-toggle{width:130px;height:32px;font-size:13px;overflow:hidden;padding-inline:12px;justify-content:start;background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-position:98% 50%;background-size:28px}.editor-container[dir=rtl] .editor-format-menu-toggle{background-position:2% 50%}.editor-format-menu .editor-dropdown-menu{min-width:300px}.editor-format-menu .editor-dropdown-menu .editor-dropdown-menu{min-width:220px}.editor-format-menu .editor-dropdown-menu .editor-button-icon{display:none}.editor-format-menu .editor-dropdown-menu .editor-dropdown-menu-container>.editor-button{padding:8px 10px}.editor-overflow-container{display:flex;border-inline:1px solid #ddd;padding-inline:4px;border-color:#ddd}html.dark-mode .editor-overflow-container{border-color:#000}.editor-overflow-container:first-child{border-inline-start:none}.editor-overflow-container:last-child{border-inline-end:none}.editor-overflow-container+.editor-overflow-container{border-inline-start:none}.editor-context-toolbar{position:fixed;border:1px solid #ddd;background-color:#fff;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.12);padding:.2rem;border-radius:4px;display:flex;flex-direction:row}html.dark-mode .editor-context-toolbar{background-color:#222}html.dark-mode .editor-context-toolbar{border-color:#333}html.dark-mode .editor-context-toolbar{box-shadow:0 1px 4px 0 rgba(0,0,0,.4)}.editor-context-toolbar:before{content:"";z-index:-1;display:block;width:8px;height:8px;position:absolute;background-color:#fff;border-top:1px solid #ddd;border-left:1px solid #ddd;border-color:#ddd;transform:rotate(45deg);left:50%;margin-left:-4px;top:-5px}html.dark-mode .editor-context-toolbar:before{background-color:#222}html.dark-mode .editor-context-toolbar:before{border-color:#333}.editor-context-toolbar.is-above:before{top:calc(100% - 5px);transform:rotate(225deg)}.editor-modal-wrapper{position:fixed;display:flex;align-items:center;justify-content:center;z-index:999;background-color:rgba(0,0,0,.5);width:100%;height:100%}.editor-modal{background-color:#fff;border-radius:4px;overflow:hidden;box-shadow:0 0 15px 0 rgba(0,0,0,.3);margin:6px;max-height:100%;overflow-y:auto}html.dark-mode .editor-modal{background-color:#222}.editor-modal-header{display:flex;justify-content:space-between;align-items:stretch;background-color:var(--color-primary);color:#fff}.editor-modal-title{padding:8px 16px}.editor-modal-close{color:#fff;padding:8px 16px;align-items:center;justify-content:center;cursor:pointer}.editor-modal-close:hover{background-color:hsla(0,0%,100%,.1)}.editor-modal-close svg{width:1rem;height:1rem;fill:currentColor;display:block}.editor-modal-body{padding:16px}.editor-color-select-row{display:flex}.editor-color-select-option{width:28px;height:28px;cursor:pointer;display:flex;align-items:center;justify-content:center}.editor-color-select-option:hover{border-radius:3px;box-sizing:border-box;z-index:3;box-shadow:0 0 4px 1px rgba(0,0,0,.25)}.editor-color-select-option[data-color=""] svg{width:20px;height:20px;fill:#888}.editor-table-creator-row{display:flex}.editor-table-creator-cell{border:1px solid;border-color:#ddd;width:15px;height:15px;cursor:pointer}html.dark-mode .editor-table-creator-cell{border-color:#000}.editor-table-creator-cell.active{background-color:var(--editor-color-primary)}.editor-table-creator-display{text-align:center;padding:.2em}.editor-external-content{min-width:500px;min-height:500px}.editor-external-content h4:first-child{margin-top:0}.editor-image-wrap{position:relative;display:inline-flex}.editor-node-resizer{position:absolute;left:0;right:auto;display:inline-block;outline:2px dashed var(--editor-color-primary);direction:ltr;pointer-events:none}.editor-node-resizer-handle{pointer-events:auto;position:absolute;display:block;width:10px;height:10px;border:2px solid var(--editor-color-primary);z-index:3;background-color:#fff;user-select:none}html.dark-mode .editor-node-resizer-handle{background-color:#000}.editor-node-resizer-handle.nw{inset-inline-start:-5px;inset-block-start:-5px;cursor:nw-resize}.editor-node-resizer-handle.ne{inset-inline-end:-5px;inset-block-start:-5px;cursor:ne-resize}.editor-node-resizer-handle.se{inset-inline-end:-5px;inset-block-end:-5px;cursor:se-resize}.editor-node-resizer-handle.sw{inset-inline-start:-5px;inset-block-end:-5px;cursor:sw-resize}.editor-node-resizer-ghost{opacity:.5;display:none;position:absolute;left:0;top:0;width:100%;height:100%;z-index:2;pointer-events:none;background-color:var(--editor-color-primary)}.editor-node-resizer.active .editor-node-resizer-ghost{display:block}.editor-content-area details[contenteditable=false],.editor-content-area summary[contenteditable=false]{user-select:none}.editor-content-area details[contenteditable=false]>details *{pointer-events:none}.editor-content-area details summary{caret-color:rgba(0,0,0,0)}.editor-content-area details.selected{outline:1px dashed var(--editor-color-primary);outline-offset:1px}.editor-table-marker{position:fixed;background-color:var(--editor-color-primary);z-index:3;user-select:none;opacity:0}.editor-table-marker:hover,.editor-table-marker.active{opacity:.4}.editor-table-marker-column{width:4px;cursor:col-resize}.editor-table-marker-row{height:4px;cursor:row-resize}.editor-code-block-wrap{user-select:none}.editor-code-block-wrap>*{pointer-events:none}.editor-code-block-wrap.selected .cm-editor{border:1px dashed var(--editor-color-primary)}.editor-diagram.selected{outline:2px dashed var(--editor-color-primary)}.editor-media-wrap{display:inline-block;cursor:not-allowed}.editor-media-wrap iframe,.editor-media-wrap video{pointer-events:none}.editor-media-wrap.align-left{float:left}.editor-media-wrap.align-right{float:right}.editor-media-wrap.align-center{display:block;margin-inline:auto}.editor-content-area .task-list-item{margin-left:0;position:relative}.editor-content-area .task-list-item>input[type=checkbox]{display:none}.editor-content-area .task-list-item:before{content:"";display:inline-block;border:2px solid #ccc;width:12px;height:12px;border-radius:2px;margin-right:8px;vertical-align:text-top;cursor:pointer;position:absolute;left:-24px;top:4px}.editor-content-area .task-list-item[checked]:before{background-color:#ccc;background-image:url('data:image/svg+xml;utf8,');background-position:50% 50%;background-size:100% 100%}.editor-form-field-wrapper{margin-bottom:.5rem}.editor-form-field-input{display:block;width:260px;min-width:100px;max-width:100%;border:1px solid;border-color:#ddd;padding:.5rem;border-radius:4px;color:#444}html.dark-mode .editor-form-field-input{border-color:#000}html.dark-mode .editor-form-field-input{color:#bbb}@media screen and (max-width: 400px){.editor-form-field-input{min-width:160px}}textarea.editor-form-field-input{font-family:var(--font-code);width:350px;height:250px;font-size:12px}.editor-form-field-label{color:#444;font-weight:700;font-size:12px}.editor-form-actions{display:flex;justify-content:end;gap:12px;margin-top:16px}.editor-form-actions>button{display:block;font-size:.85rem;line-height:1.4em;padding:7.8px 16px;font-weight:400;border-radius:4px;cursor:pointer;box-shadow:none}.editor-form-actions>button:focus{outline:1px dotted currentColor;outline-offset:-6px;box-shadow:none;filter:brightness(90%)}.editor-form-action-primary{background-color:var(--color-primary);color:#fff;border:1px solid var(--color-primary)}.editor-form-action-primary:hover{box-shadow:0 0 4px 1px #ccc;filter:brightness(110%)}html.dark-mode .editor-form-action-primary:hover{box-shadow:0 0 4px 1px rgba(0,0,0,.5)}.editor-form-action-secondary{border:1px solid;border-color:#ccc;color:#666}html.dark-mode .editor-form-action-secondary{border-color:#666}html.dark-mode .editor-form-action-secondary{color:#aaa}.editor-form-action-secondary:hover,.editor-form-action-secondary:focus,.editor-form-action-secondary:active{color:#444;border:1px solid #ccc;box-shadow:0 1px 4px 0 rgba(0,0,0,.1);background-color:#f2f2f2;background-color:#f8f8f8;filter:none}html.dark-mode .editor-form-action-secondary:hover,html.dark-mode .editor-form-action-secondary:focus,html.dark-mode .editor-form-action-secondary:active{color:#bbb}html.dark-mode .editor-form-action-secondary:hover,html.dark-mode .editor-form-action-secondary:focus,html.dark-mode .editor-form-action-secondary:active{background-color:#444}.editor-form-action-secondary:active{border-color:#bbb;background-color:#ddd;color:#666;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.editor-form-tab-container{display:flex;flex-direction:row;gap:2rem}.editor-form-tab-controls{display:flex;flex-direction:column;align-items:stretch;gap:.25rem}@media screen and (max-width: 880px){.editor-form-tab-container{flex-direction:column;gap:.5rem}.editor-form-tab-controls{flex-direction:row}}.editor-form-tab-control{font-weight:bold;font-size:14px;color:#444;border-bottom:2px solid rgba(0,0,0,0);position:relative;cursor:pointer;padding:.25rem .5rem;text-align:start}html.dark-mode .editor-form-tab-control{color:#666}.editor-form-tab-control[aria-selected=true]{border-color:var(--editor-color-primary);color:var(--editor-color-primary) !important}.editor-form-tab-control[aria-selected=true]:after,.editor-form-tab-control:hover:after{background-color:var(--editor-color-primary);opacity:.15;content:"";display:block;position:absolute;left:0;top:0;width:100%;height:100%}.editor-form-tab-contents{width:260px;max-width:100%}.editor-action-input-container{display:flex;flex-direction:row;align-items:end;justify-content:space-between;gap:.1rem}.editor-action-input-container .editor-button{margin-bottom:12px}.editor-action-input-container input{width:220px}.editor-color-field-container{position:relative}.editor-color-field-container input{padding-left:36px}.editor-color-field-container .editor-dropdown-menu-container{position:absolute;bottom:0}textarea.editor-form-field-input[name=source]{width:1000px;height:600px;max-height:60vh;max-width:80vw}.editor-theme-bold{font-weight:bold}.editor-theme-italic{font-style:italic}.editor-theme-strikethrough{text-decoration-line:line-through}.editor-theme-underline{text-decoration-line:underline}.editor-theme-underline-strikethrough{text-decoration:underline line-through}.cm-editor{font-size:12px;border:1px solid #ddd;line-height:1.4;margin-bottom:24px}.page-content .cm-editor,.CodeMirrorContainer .cm-editor{border-radius:4px}.cm-editor .cm-line{line-height:1.6}.cm-editor .cm-line,.cm-editor .cm-gutter{font-family:var(--font-code)}.dark-mode .cm-editor{border-color:#444}.cm-copy-button{position:absolute;display:flex;align-items:center;justify-content:center;top:-1px;inset-inline-end:-1px;background-color:#eee;border:1px solid #ddd;border-start-end-radius:4px;background-color:#eee;border-color:#ddd;color:#444;line-height:0;cursor:pointer;z-index:5;user-select:none;opacity:0;pointer-events:none;width:32px;height:32px;transition:background-color linear 60ms,color linear 60ms}html.dark-mode .cm-copy-button{background-color:#333}html.dark-mode .cm-copy-button{border-color:#444}html.dark-mode .cm-copy-button{color:#888}.cm-copy-button svg{fill:currentColor}.cm-copy-button.success{background:var(--color-positive);color:#fff}.cm-copy-button:focus{outline:0 !important}.cm-editor:hover .cm-copy-button{user-select:all;opacity:.6;pointer-events:all}.notification{position:fixed;top:0;right:0;margin:32px;padding:16px 24px;background-color:#fff;background-color:#fff;border-radius:4px;border-inline-start:6px solid currentColor;box-shadow:0 1px 6px 1px rgba(22,22,22,.2);z-index:999999;cursor:pointer;max-width:360px;transition:transform ease-in-out 280ms;transform:translateX(580px);display:grid;grid-template-columns:42px 1fr 12px;color:#444;font-weight:700}html.dark-mode .notification{background-color:#444}.notification span,.notification svg{vertical-align:middle;justify-self:center;align-self:center}.notification svg{width:2.8rem;height:2.8rem;padding-inline-end:12px;fill:currentColor}.notification .dismiss{margin-top:-8px}.notification .dismiss svg{height:1rem;color:#444}html.dark-mode .notification .dismiss svg{color:#888}.notification span{vertical-align:middle;line-height:1.3}html.dark-mode .notification span{color:#bbb}.notification.pos{color:var(--color-positive)}.notification.neg{color:var(--color-negative)}.notification.warning{color:var(--color-warning)}.notification.showing{transform:translateX(0)}.notification.showing:hover{transform:translate3d(0, -2px, 0)}.chapter-contents-toggle{cursor:pointer;margin:0;transition:all ease-in-out 180ms;user-select:none}.chapter-contents-toggle svg[data-icon=caret-right]{margin-inline-end:0;font-size:1rem;transition:all ease-in-out 180ms;transform:rotate(0deg);transform-origin:50% 50%}.chapter-contents-toggle.open svg[data-icon=caret-right]{transform:rotate(90deg)}.chapter-contents-toggle svg[data-icon=caret-right]+*{margin-inline-start:3px}[overlay],.popup-background{background-color:rgba(0,0,0,.333);position:fixed;z-index:95536;width:100%;height:100%;min-width:100%;min-height:100%;top:0;left:0;right:0;bottom:0;align-items:center;justify-content:center;display:none}html.dark-mode [overlay],html.dark-mode .popup-background{background-color:rgba(0,0,0,.6)}.popup-body-wrap{display:flex}.popup-body{background-color:#fff;max-height:90%;max-width:1200px;width:90%;height:auto;margin:2% auto;border-radius:4px;box-shadow:0 0 15px 0 rgba(0,0,0,.3);overflow:hidden;z-index:999;display:flex;flex-direction:column;position:relative}html.dark-mode .popup-body{background-color:#333}.popup-body.small{margin:2% auto;width:800px;max-width:90%}.popup-body.very-small{margin:2% auto;width:600px;max-width:90%}.popup-body:before{display:flex;align-self:flex-start}.popup-body .popup-content{overflow-y:auto}.popup-body:focus{outline:0}.popup-header button,.popup-footer button{margin:0;border-radius:0;box-shadow:none;color:#fff;padding:6px 16px;cursor:pointer}.popup-header button:not(.popup-header-close){font-size:.8rem}.popup-header button:hover{background-color:hsla(0,0%,100%,.1)}.popup-footer{justify-content:end;background-color:var(--color-primary-light);min-height:41px}.popup-footer button{padding:10px 16px}.popup-header-close{border:0;color:#fff;font-size:16px;cursor:pointer}.popup-header-close svg{margin-right:0}.popup-header,.popup-footer{display:flex;position:relative;height:40px;flex:0}.popup-header .popup-title,.popup-footer .popup-title{color:#fff;margin-inline-end:auto;padding:8px 16px}.popup-header.flex-container-row,.popup-footer.flex-container-row{display:flex !important}body.flexbox-support #entity-selector-wrap .popup-body .form-group{height:444px;min-height:444px}#entity-selector-wrap .popup-body .form-group{margin:0}.popup-body .entity-selector-container{flex:1}.dropzone-overlay{position:absolute;display:flex;justify-content:center;align-items:center;font-size:1.333rem;width:98%;height:98%;left:1%;top:1%;border-radius:4px;border:1px dashed var(--color-primary);font-style:italic;box-sizing:content-box;background-clip:padding-box;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23a9a9a9' fill-opacity='0.52' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");background-color:var(--color-primary);color:#fff;opacity:.8;z-index:9;pointer-events:none;animation:dzAnimIn 240ms ease-in-out}.dropzone-landing-area{background-color:var(--color-primary-light);padding:16px 24px;width:100%;border:1px dashed var(--color-primary);color:var(--color-primary);border-radius:4px}@keyframes dzAnimIn{0%{opacity:0;transform:scale(0.7)}60%{transform:scale(1.1)}100%{transform:scale(1);opacity:.8}}@keyframes dzFileItemIn{0%{opacity:.5;transform:translateY(28px)}100%{opacity:1;transform:translateY(0)}}@keyframes dzFileItemOut{0%{opacity:1;transform:translateY(0)}100%{opacity:.5;transform:translateY(28px)}}.dropzone-file-item{width:260px;height:80px;position:relative;display:flex;margin:1rem;flex-direction:row;background:#fff;box-shadow:0 1px 6px 1px rgba(22,22,22,.2);border-radius:4px;overflow:hidden;padding-bottom:3px;animation:dzFileItemIn ease-in-out 240ms;transition:transform ease-in-out 120ms,box-shadow ease-in-out 120ms;cursor:pointer}html.dark-mode .dropzone-file-item{background:#444}.dropzone-file-item:hover{transform:translateY(-3px);box-shadow:0 3px 8px 1px rgba(22,22,22,.2)}.dropzone-file-item.dismiss{animation:dzFileItemOut ease-in-out 240ms}.dropzone-file-item .loading-container{text-align:start !important;margin:0}.dropzone-file-item-image-wrap{width:80px;position:relative;background-color:var(--color-primary-light)}.dropzone-file-item-image-wrap img{object-fit:cover;width:100%;height:100%;opacity:.8}.dropzone-file-item-text-wrap{flex:1;display:block;padding:1rem;overflow:auto}.dropzone-file-item-progress{position:absolute;bottom:0;left:0;font-size:0;height:3px;background-color:var(--color-primary);transition:width ease-in-out 240ms}.dropzone-file-item-label{line-height:1.2;margin-bottom:.2rem}.dropzone-file-item-label,.dropzone-file-item-status{align-items:center;font-size:.8rem;font-weight:700}.dropzone-file-item-status[data-status]{display:flex;font-size:.6rem;font-weight:500;line-height:1.2}.dropzone-file-item-status[data-status=success]{color:var(--color-positive)}.dropzone-file-item-status[data-status=error]{color:var(--color-negative)}.dropzone-file-item-status[data-status]+.dropzone-file-item-label{display:none}.image-manager-body{min-height:70vh}.image-manager-filter-bar{position:sticky;top:0;z-index:5;background-color:hsla(0,0%,100%,.85)}html.dark-mode .image-manager-filter-bar{background-color:rgba(80,80,80,.85)}.image-manager-filter-bar-bg{position:absolute;left:0;top:0;width:100%;height:100%;opacity:.15;z-index:-1}.image-manager-filters{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);border-radius:4px;overflow:hidden;border-bottom:0 !important}html.dark-mode .image-manager-filters{border:1px solid #000 !important}.image-manager-filters button{line-height:0;background-color:#fff}html.dark-mode .image-manager-filters button{background-color:#333}.image-manager-filters svg{margin:0}.image-manager-list{padding:3px;display:grid;grid-template-columns:repeat(auto-fill, minmax(max(140px, 17%), 1fr));gap:3px;z-index:3}.image-manager-list>div{aspect-ratio:1}.image-manager-list .image{display:block;position:relative;border-radius:0;margin:0;width:100%;text-align:start;padding:0;cursor:pointer;aspect-ratio:1;border-color:#ddd;transition:all linear 80ms;overflow:hidden}html.dark-mode .image-manager-list .image{border-color:#000}.image-manager-list .image.selected{background-color:var(--color-primary-light);outline:currentColor 3px solid;border-radius:3px;transform:scale3d(0.95, 0.95, 0.95)}.image-manager-list .image img{width:100%;max-width:100%;display:block;object-fit:cover;height:auto}.image-manager-list .image .image-meta{opacity:0;position:absolute;width:100%;bottom:0;left:0;color:#eee;background-color:rgba(0,0,0,.7);font-size:10px;padding:3px 4px;pointer-events:none;transition:opacity ease-in-out 80ms}.image-manager-list .image .image-meta span{display:block}.image-manager-list .image.selected .image-meta,.image-manager-list .image:hover .image-meta,.image-manager-list .image:focus .image-meta{opacity:1}@media screen and (max-width: 880px){.image-manager-list .image .image-meta{display:none}}.image-manager .load-more{text-align:center;padding:12px 16px;clear:both}.image-manager .load-more .loading-container{margin:0}.image-manager .loading-container{text-align:center}.image-manager-list .image-manager-list-warning{grid-column:1/-1;aspect-ratio:auto}.image-manager-warning{background:#fff;color:var(--color-warning);font-weight:bold;border-inline:3px solid var(--color-warning)}html.dark-mode .image-manager-warning{background:#333}.image-manager-sidebar{width:300px;margin:0 auto;overflow-y:auto;overflow-x:hidden;border-inline-start:1px solid #ddd;border-color:#ddd}html.dark-mode .image-manager-sidebar{border-color:#000}.image-manager-sidebar .inner{min-height:auto;padding:16px}.image-manager-sidebar .image-manager-viewer img{max-width:100%;max-height:180px;display:block;margin:0 auto 16px auto;box-shadow:0 1px 21px 1px rgba(76,76,76,.3)}.image-manager-sidebar .image-manager-viewer{height:196px;display:flex;align-items:center;justify-content:center}.image-manager-sidebar .image-manager-viewer a{display:inline-block}@media screen and (max-width: 880px){.image-manager-sidebar{border-inline-start:0}}.image-manager-content{display:flex;flex-direction:column;flex:1;overflow-y:scroll}.image-manager-content .container{width:100%}.image-manager-content .full-tab{text-align:center}.tab-container.bordered [role=tablist] button[role=tab]{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd}html.dark-mode .tab-container.bordered [role=tablist] button[role=tab]{border-inline-end-color:#000}.tab-container.bordered [role=tablist] button[role=tab]:last-child{border-inline-end:none}.tab-container [role=tablist]{display:flex;align-items:end;justify-items:start;text-align:start;border-bottom:1px solid #ddd;border-color:#ddd;margin-bottom:16px}html.dark-mode .tab-container [role=tablist]{border-color:#444}.tab-container [role=tablist] button[role=tab]{display:inline-block;padding:12px;color:rgba(0,0,0,.5);cursor:pointer;border-bottom:2px solid rgba(0,0,0,0);margin-bottom:-1px}html.dark-mode .tab-container [role=tablist] button[role=tab]{color:hsla(0,0%,100%,.5)}.tab-container [role=tablist] button[role=tab][aria-selected=true]{color:var(--color-link) !important;border-bottom-color:var(--color-link) !important;outline:0 !important}.tab-container [role=tablist] button[role=tab]:hover,.tab-container [role=tablist] button[role=tab]:focus{color:rgba(0,0,0,.8);border-bottom-color:rgba(0,0,0,.2)}html.dark-mode .tab-container [role=tablist] button[role=tab]:hover,html.dark-mode .tab-container [role=tablist] button[role=tab]:focus{color:hsla(0,0%,100%,.8)}html.dark-mode .tab-container [role=tablist] button[role=tab]:hover,html.dark-mode .tab-container [role=tablist] button[role=tab]:focus{border-bottom-color:hsla(0,0%,100%,.2)}.tab-container [role=tablist] button[role=tab]:focus{outline:1px dotted var(--color-primary);outline-offset:-2px}.tab-container [role=tablist].controls-card{margin-bottom:0;border-bottom:0;padding:0 6px}.tab-container [role=tabpanel].no-outline:focus{outline:none}.image-picker .none{display:none}.code-editor .CodeMirror{height:auto;min-height:50vh;border-bottom:0}.code-editor .lang-options{overflow-y:scroll;flex-basis:200px;flex-grow:1}.code-editor .lang-options button{display:block;padding:6px 16px;border-bottom:1px solid;color:#333;border-bottom-color:#eee;cursor:pointer;width:100%;text-align:left;font-family:var(--font-code);font-size:.7rem;padding-left:30px}html.dark-mode .code-editor .lang-options button{color:#aaa}html.dark-mode .code-editor .lang-options button{border-bottom-color:#000}.code-editor .lang-options button:hover,.code-editor .lang-options button.active{background-color:var(--color-primary-light);color:var(--color-primary)}.code-editor button.lang-option-favorite-toggle{position:absolute;top:0;left:0;width:28px;font-size:1rem;border:0;line-height:1;padding:2px;z-index:2;height:100%;text-align:center;color:var(--color-primary)}.code-editor button.lang-option-favorite-toggle svg{margin:0}.code-editor button[data-favourite=true]~.action-favourite,.code-editor button[data-favourite=false]~.action-unfavourite{display:none}.code-editor .action-favourite{opacity:.5}.code-editor button:hover~.action-favourite{opacity:1}.code-editor label{background-color:var(--color-primary-light);width:100%;color:var(--color-primary);padding:3px 12px;margin-bottom:0}.code-editor-language-list{position:relative;width:160px;z-index:2;align-items:stretch}.code-editor-language-list input{border-radius:0;border:0;border-bottom:1px solid #ddd;padding:6px 12px;height:auto}.code-editor-main{flex:1;min-width:0}.code-editor-main .cm-editor{margin-bottom:0;z-index:1;max-width:100%;width:100%}.code-editor-body-wrap{height:80vh}@media screen and (max-width: 600px){.code-editor .lang-options{display:none}.code-editor-body-wrap{flex-direction:column}.code-editor-language-list,.code-editor-language-list input{width:100%}}.comments-container{padding-inline:32px}@media screen and (max-width: 880px){.comments-container{padding-inline:6px}}.comment-box{border-radius:4px;border:1px solid #ddd;border-color:#ddd;background-color:#fff}html.dark-mode .comment-box{border-color:#000}html.dark-mode .comment-box{background-color:#222}.comment-box .content{font-size:.666em;padding:6px 12px}.comment-box .content p,.comment-box .content ul,.comment-box .content ol{font-size:14px;margin:.5em 0}.comment-box .actions{opacity:0;transition:opacity ease-in-out 120ms}.comment-box:hover .actions,.comment-box:focus-within .actions{opacity:1}.comment-box .actions button:focus{outline:1px dotted var(--color-primary)}@media screen and (max-width: 880px){.comment-box .actions{opacity:1}}.comment-box .header{border-bottom:1px solid #ddd;padding:6px 12px;border-color:#ddd}html.dark-mode .comment-box .header{border-color:#000}.comment-box .header a{color:inherit}.comment-box .header .text-muted{color:#999}.comment-box .header .meta a,.comment-box .header .meta span{white-space:nowrap}.comment-box .header .right-meta .text-muted{opacity:.8}.comment-thread-indicator{border-inline-start:3px dotted #ddd;border-color:#ddd;margin-inline-start:6px;width:24px;height:calc(100% - 16px)}html.dark-mode .comment-thread-indicator{border-color:#444}.comment-reference-indicator-wrap a{float:left;margin-top:6px;font-size:12px;display:inline-block;font-weight:bold;position:relative;border-radius:4px;overflow:hidden;padding:2px 6px 2px 0;margin-inline-end:6px;color:var(--color-link)}.comment-reference-indicator-wrap a span{display:none}.comment-reference-indicator-wrap a.outdated span{display:inline}.comment-reference-indicator-wrap a.outdated.missing{color:var(--color-warning);pointer-events:none}.comment-reference-indicator-wrap a svg{width:24px;margin-inline-end:0}.comment-reference-indicator-wrap a:after{background-color:currentColor;content:"";width:100%;height:100%;position:absolute;left:0;top:0;opacity:.15}.comment-reference-indicator-wrap a[href="#"]{color:#444;pointer-events:none}.comment-branch .comment-box{margin-bottom:16px}.comment-branch .comment-branch .comment-branch .comment-branch .comment-thread-indicator{display:none}.comment-reply{display:none;margin:0 !important;margin-bottom:-3px !important}.comment-branch .comment-branch .comment-branch .comment-branch .comment-reply{display:block}.comment-container .empty-state{display:none}.comment-container:not(:has([component=page-comment])) .empty-state{display:block}.comment-container-compact .comment-box{margin-bottom:6px}.comment-container-compact .comment-box .meta{font-size:.8rem}.comment-container-compact .comment-box .header{padding:6px}.comment-container-compact .comment-box .right-meta{display:none}.comment-container-compact .comment-box .content{padding:6px 12px}.comment-container-compact .comment-thread-indicator{width:16px}.comment-container-super-compact .comment-box .meta{font-size:12px}.comment-container-super-compact .comment-box .avatar{width:22px;height:22px;margin-inline-end:2px !important}.comment-container-super-compact .comment-box .content{padding:3px 12px;line-height:1.2}.comment-container-super-compact .comment-box .content p{font-size:12px}.comment-container-super-compact .comment-thread-indicator{width:9px;margin-inline-start:3px}#tag-manager .drag-card{max-width:500px}.template-item{cursor:pointer;position:relative}.template-item:hover,.template-item .template-item-actions button:hover{background-color:#f2f2f2}.template-item .template-item-actions{position:absolute;top:0;inset-inline-end:0;width:50px;height:100%;display:flex;flex-direction:column;border-inline-start:1px solid;border-color:#ddd}html.dark-mode .template-item .template-item-actions{border-color:#000}.template-item .template-item-actions button{cursor:pointer;flex:1;background-color:#fff;border:0;border-top:1px solid;border-color:#ddd}html.dark-mode .template-item .template-item-actions button{background-color:#222}html.dark-mode .template-item .template-item-actions button{border-color:#000}.template-item .template-item-actions button svg{margin:0}.template-item .template-item-actions button:first-child{border-top:0}.dropdown-search{position:relative}.dropdown-search-toggle-breadcrumb{border:1px solid rgba(0,0,0,0);border-radius:4px;line-height:normal;padding:6px;opacity:.6;cursor:pointer}.dropdown-search-toggle-breadcrumb:hover{opacity:1;border-color:#ddd}html.dark-mode .dropdown-search-toggle-breadcrumb:hover{border-color:#444}.dropdown-search-toggle-breadcrumb .svg-icon{margin-inline-end:0}.dropdown-search-toggle-select{display:flex;gap:12px;line-height:normal}.dropdown-search-toggle-select .svg-icon{height:26px;width:26px;margin:0}.dropdown-search-toggle-select .avatar{height:22px;width:22px}.dropdown-search-toggle-select .avatar+span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-search-toggle-select .dropdown-search-toggle-caret{font-size:1.15rem}.dropdown-search-toggle-select-label{min-width:0;white-space:nowrap}.dropdown-search-toggle-select-caret{line-height:0;margin-left:auto;margin-top:-2px;display:flex;align-items:center}.dropdown-search-dropdown{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);overflow:hidden;min-height:100px;width:240px;display:none;position:absolute;z-index:80;right:0;top:0;margin-top:16px}html[dir=rtl] .dropdown-search-dropdown{right:auto;left:-16px}.dropdown-search-dropdown .dropdown-search-search .svg-icon{position:absolute;left:12px;top:11px;fill:#888;pointer-events:none}html[dir=rtl] .dropdown-search-dropdown .dropdown-search-search .svg-icon{right:12px;left:auto}.dropdown-search-dropdown .dropdown-search-list{max-height:400px;overflow-y:scroll;text-align:start}.dropdown-search-dropdown .dropdown-search-item{padding:12px 16px}.dropdown-search-dropdown .dropdown-search-item:hover,.dropdown-search-dropdown .dropdown-search-item:focus{background-color:#f2f2f2;text-decoration:none}.dropdown-search-dropdown input,.dropdown-search-dropdown input:focus{padding-inline-start:32px;border-radius:0;border:0;border-bottom:1px solid #ddd}.dropdown-search-dropdown input:focus{outline:0}@media screen and (max-width: 1000px){.dropdown-search-dropdown{inset-inline:16px auto}.dropdown-search-dropdown .dropdown-search-list{max-height:240px}}.item-list{box-shadow:0 1px 3px 0 rgba(0,0,0,.1)}.item-list-row{border:1.5px solid;border-color:#e2e2e2;border-bottom-width:0}html.dark-mode .item-list-row{border-color:#444}.item-list-row label{padding-bottom:0}.item-list-row:hover{background-color:#f6f6f6}html.dark-mode .item-list-row:hover{background-color:#333}.item-list-row:first-child{border-radius:4px 4px 0 0}.item-list-row:last-child{border-radius:0 0 4px 4px;border-bottom-width:1.5px}.item-list-row:first-child:last-child{border-radius:4px}.item-list-row-toggle-all{visibility:hidden}.item-list-row:hover .item-list-row-toggle-all{visibility:visible}.status-indicator-active,.status-indicator-inactive{width:8px;height:8px;border-radius:50%;display:inline-block}.status-indicator-active{background-color:var(--color-positive)}.status-indicator-inactive{background-color:var(--color-negative)}.shortcut-container{background-color:rgba(0,0,0,.25);pointer-events:none;position:fixed;left:0;top:0;width:100%;height:100%;z-index:99}.shortcut-linkage{position:fixed;box-shadow:0 0 4px 0 #fff;border-radius:3px}.shortcut-hint{position:fixed;padding:3px 3px;font-size:.85rem;font-weight:700;line-height:1;background-color:#eee;border-radius:3px;border:1px solid #b4b4b4;box-shadow:0 1px 1px rgba(0,0,0,.2),0 2px 0 0 hsla(0,0%,100%,.7) inset;color:#333}.back-to-top{background-color:var(--color-primary);position:fixed;bottom:16px;right:24px;padding:5px 7px;cursor:pointer;color:#fff;fill:#fff;width:40px;height:40px;border-radius:40px;transition:all ease-in-out 180ms;opacity:0;z-index:999;overflow:hidden}.back-to-top svg{width:26.6666666667px;height:26.6666666667px;margin-inline-end:4px}.back-to-top:hover{width:136px;opacity:1 !important}.back-to-top .inner{width:136px}.back-to-top span{position:relative;vertical-align:top;line-height:2}.scroll-box{list-style:none;padding:0;margin:0;max-height:280px;overflow-y:scroll;border:1px solid;border-color:#ddd;border-radius:3px;min-height:20px;background-color:#eee}html.dark-mode .scroll-box{border-color:#000}html.dark-mode .scroll-box{background-color:#000}.scroll-box-item{border-bottom:1px solid;border-top:1px solid;border-color:#ddd;margin-top:-1px;background-color:#fff;display:flex;align-items:flex-start;padding:1px}html.dark-mode .scroll-box-item{border-color:#000}html.dark-mode .scroll-box-item{background-color:#222}.scroll-box-item:last-child{border-bottom:0}.scroll-box-item:hover{cursor:pointer;background-color:#f8f8f8}html.dark-mode .scroll-box-item:hover{background-color:#333}.scroll-box-item.items-center{align-items:center}.scroll-box-item .handle{color:#aaa;cursor:grab}.scroll-box-item button{opacity:.6;line-height:1}.scroll-box-item .handle svg{margin:0}.scroll-box-item>*{padding:6px 16px}.scroll-box-item .handle+*{padding-left:0}.scroll-box-item:hover .handle{color:#444}html.dark-mode .scroll-box-item:hover .handle{color:#fff}.scroll-box-item:hover button{opacity:1}.scroll-box-item a:hover{text-decoration:none}input.scroll-box-search,.scroll-box-header-item{font-size:.8rem;border:1px solid;border-color:#ddd;background-color:#fff;margin-bottom:-1px;border-radius:3px 3px 0 0;width:100%;max-width:100%;height:auto;line-height:1.4;color:#666}html.dark-mode input.scroll-box-search,html.dark-mode .scroll-box-header-item{border-color:#000}html.dark-mode input.scroll-box-search,html.dark-mode .scroll-box-header-item{background-color:#222}.scroll-box-search+.scroll-box,.scroll-box-header-item+.scroll-box{border-radius:0 0 3px 3px}.scroll-box.configured-option-list [data-action=add]{display:none}.scroll-box.available-option-list [data-action=remove],.scroll-box.available-option-list [data-action=move_up],.scroll-box.available-option-list [data-action=move_down]{display:none}.scroll-box>li.empty-state{display:none}.scroll-box>li.empty-state:last-child{display:list-item}details.section-expander summary{border-top:1px solid #ddd;border-color:#ddd;font-weight:bold;font-size:12px;color:#888;cursor:pointer;padding-block:6px}html.dark-mode details.section-expander summary{border-color:#000}details.section-expander:open summary{margin-bottom:12px}details.section-expander{border-bottom:1px solid #ddd;border-color:#ddd}html.dark-mode details.section-expander{border-color:#000}header.grid{grid-template-columns:minmax(max-content, 2fr) 1fr minmax(max-content, 2fr)}@media screen and (max-width: 1000px){header.grid{grid-template-columns:1fr;grid-row-gap:0}}header{position:relative;display:block;z-index:11;top:0;color:#fafafa;border-bottom:1px solid #ddd;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);border-bottom-color:#ddd}html.dark-mode header{border-bottom-color:#000}header .header-links{display:flex;align-items:center;justify-content:end}header .links{display:inline-block;vertical-align:top}header .links a{display:inline-block;padding:10px 16px;color:#fff;border-radius:3px}header .links a:hover{text-decoration:none;background-color:hsla(0,0%,100%,.15)}header .dropdown-container{padding-inline-start:16px;padding-inline-end:0}header .avatar,header .user-name{display:inline-block}header .avatar{width:30px;height:30px}header .user-name{vertical-align:top;position:relative;display:inline-flex;align-items:center;cursor:pointer;padding:12px;margin:0 -12px;border-radius:3px;gap:6px;color:#fff}header .user-name>span{padding-inline-start:6px;display:inline-block;line-height:1}header .user-name>svg{font-size:18px;margin-top:-2px;margin-inline-end:0}header .user-name:hover{background-color:hsla(0,0%,100%,.15)}@media screen and (min-width: 1001px)and (max-width: 1100px){header .user-name{padding-inline-start:6px}header .user-name .name{display:none}}.header *,.primary-background *{outline-color:#fff}header .search-box{display:inline-block}header .search-box input{background-color:rgba(0,0,0,.2);border:1px solid hsla(0,0%,100%,.2);border-radius:40px;color:#eee;z-index:2;height:auto;padding:9px;padding-inline-start:40px}header .search-box input:focus{outline:none;border:1px solid hsla(0,0%,100%,.4)}header .search-box input::placeholder{color:#fff;opacity:.6}@media screen and (min-width: 1001px)and (max-width: 1100px){header .search-box{max-width:200px}}header .search-box:focus-within #header-search-box-button{opacity:1}#header-search-box-button{z-index:1;inset-inline-start:16px;top:10px;color:#fff;opacity:.6;color:hsla(0,0%,100%,.8)}html.dark-mode #header-search-box-button{color:#aaa}#header-search-box-button svg{margin-inline-end:0}.global-search-suggestions{display:none;position:absolute;top:-12px;left:0;right:0;z-index:-1;margin-left:-48px;margin-right:-48px;padding-top:56px;border-radius:3px;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);transform-origin:top center;opacity:.5;transform:scale(0.9)}.global-search-suggestions .entity-item-snippet p{display:none}.global-search-suggestions .entity-item-snippet{font-size:.8rem}.global-search-suggestions .entity-list-item-name{font-size:.9rem;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.global-search-suggestions .global-search-loading{position:absolute;width:100%}header .search-box.search-active:focus-within .global-search-suggestions{display:block}header .search-box.search-active:focus-within input{background-color:#eee;border-color:#ddd}html.dark-mode header .search-box.search-active:focus-within input{background-color:#333}html.dark-mode header .search-box.search-active:focus-within input{border-color:#111}header .search-box.search-active:focus-within #header-search-box-button,header .search-box.search-active:focus-within input{color:#444}html.dark-mode header .search-box.search-active:focus-within #header-search-box-button,html.dark-mode header .search-box.search-active:focus-within input{color:#aaa}.logo{display:inline-flex;padding:6px 12px;margin:6px -12px;gap:12px;align-items:center;border-radius:4px}.logo:hover{color:#fff;text-decoration:none;background-color:hsla(0,0%,100%,.15)}.logo-text{font-size:1.8em;color:#fff;font-weight:400;line-height:1}.logo-image{height:43px}.mobile-menu-toggle{color:#fff;fill:#fff;font-size:2em;border:2px solid hsla(0,0%,100%,.8);border-radius:4px;padding:0 6px;line-height:1;cursor:pointer;user-select:none}.mobile-menu-toggle svg{margin:0;bottom:-2px}@media screen and (max-width: 1000px){header .header-links{background-color:#fff;display:none;z-index:10;inset-inline-end:16px;border-radius:4px;overflow:hidden;position:absolute;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);margin-top:16px;padding:6px 0}html.dark-mode header .header-links{background-color:#333}header .header-links.show{display:block}header .links a,header .dropdown-container ul li a,header .dropdown-container ul li button{text-align:start;display:grid;align-items:center;padding:8px 16px;gap:16px;color:#444;grid-template-columns:16px auto;line-height:1.4;color:#444}html.dark-mode header .links a,html.dark-mode header .dropdown-container ul li a,html.dark-mode header .dropdown-container ul li button{color:#eee}header .links a svg,header .dropdown-container ul li a svg,header .dropdown-container ul li button svg{margin-inline-end:12px;width:16px}header .links a:hover,header .dropdown-container ul li a:hover,header .dropdown-container ul li button:hover{background-color:var(--color-primary-light);color:var(--color-primary);text-decoration:none}header .links a:focus,header .dropdown-container ul li a:focus,header .dropdown-container ul li button:focus{background-color:#eee;outline-color:var(--color-primary);color:var(--color-primary)}html.dark-mode header .links a:focus,html.dark-mode header .dropdown-container ul li a:focus,html.dark-mode header .dropdown-container ul li button:focus{background-color:#333}header .dropdown-container{display:block;padding-inline-start:0}header .links{display:block}header .dropdown-container ul{display:block !important;position:relative;background-color:rgba(0,0,0,0);border:0;padding:0;margin:0;box-shadow:none}}.tri-layout-mobile-tabs{position:sticky;top:0;z-index:5;background-color:#fff;border-bottom:1px solid #ddd;border-bottom-color:#ddd;box-shadow:0 1px 6px -1px rgba(0,0,0,.1)}html.dark-mode .tri-layout-mobile-tabs{border-bottom-color:#333}.tri-layout-mobile-tab{text-align:center;border-bottom:3px solid #bbb;cursor:pointer;margin:0;background-color:#fff;border-bottom-color:#bbb}html.dark-mode .tri-layout-mobile-tab{background-color:#222}html.dark-mode .tri-layout-mobile-tab{border-bottom-color:#333}.tri-layout-mobile-tab:first-child{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd}html.dark-mode .tri-layout-mobile-tab:first-child{border-inline-end-color:#000}.tri-layout-mobile-tab[aria-selected=true]{border-bottom-color:currentColor !important}.breadcrumbs{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;opacity:.7}.breadcrumbs .icon-list-item{width:auto;padding-top:6px;padding-bottom:6px}.breadcrumbs .separator{display:inline-block;fill:#aaa;font-size:1.6em;line-height:.8;margin:-2px 0 0}.breadcrumbs:hover,.breadcrumbs:focus-within{opacity:1}@media(prefers-contrast: more){.breadcrumbs{opacity:1}}@media screen and (max-width: 1000px){.breadcrumbs .icon-list-item{padding:6px}.breadcrumbs .icon-list-item>span+span{display:none}.breadcrumbs .icon-list-item>span:first-child{margin-inline-end:0}}.faded a,.faded button,.faded span,.faded span>div{color:#666;fill:#666}.faded .text-button{opacity:.5;transition:all ease-in-out 120ms}.faded .text-button:hover{opacity:1;text-decoration:none}.faded span.faded-text{display:inline-block;padding:12px}footer{flex-shrink:0;padding:1rem 1rem 2rem 1rem;text-align:center}footer a{margin:0 .5em}body.flexbox footer{display:none}.book-contents .entity-list-item .icon{width:4px;border-radius:1px;justify-self:stretch;align-self:stretch;height:auto;margin-inline-end:6px}.book-contents .entity-list-item .icon:after{opacity:.5}.book-contents .entity-list-item .icon svg{display:none}.book-contents .entity-list-item p{margin-bottom:0}.book-contents .entity-list-item .inner-page{padding-top:0;padding-bottom:0}.entity-list-item+.chapter-expansion{display:flex;padding:0 16px 16px 16px;align-items:center;border:0;width:100%;position:relative}.entity-list-item+.chapter-expansion>.icon{width:4px;height:auto;border-radius:0 0 1px 1px;align-self:stretch;flex-shrink:0}.entity-list-item+.chapter-expansion>.icon:before{position:absolute;top:0;left:0;width:100%;height:1px;background-color:currentColor;content:"";opacity:.5}.entity-list-item+.chapter-expansion>.icon:after{opacity:.5}.entity-list-item+.chapter-expansion .icon svg{display:none}.entity-list-item+.chapter-expansion>.content{flex:1}.entity-list-item+.chapter-expansion .chapter-contents-toggle{border-radius:0 4px 4px 0;padding:6px 19px;width:100%;text-align:start}.entity-list-item+.chapter-expansion .chapter-contents-toggle:hover{background-color:rgba(0,0,0,.06)}.entity-list-item.has-children{padding-bottom:0}.entity-list-item.has-children>.icon{border-radius:4px 4px 0 0}.inset-list{display:none}.inset-list .entity-list-item-name{font-size:1rem}.inset-list .entity-list-item-children{padding-top:0;padding-bottom:0}.sidebar-page-nav{list-style:none;margin-block-start:12px;margin-block-end:16px;margin-inline-start:6px;margin-inline-end:0;position:relative}.sidebar-page-nav:after{content:"";display:block;position:absolute;left:0;background-color:rgba(0,0,0,.2);width:2px;top:5px;bottom:5px;z-index:0}html[dir=rtl] .sidebar-page-nav:after{left:auto;right:0}html.dark-mode .sidebar-page-nav:after{background-color:hsla(0,0%,100%,.2)}.sidebar-page-nav li{margin-bottom:4px;font-size:.95em;position:relative}.sidebar-page-nav .h1{padding-inline-start:16px}.sidebar-page-nav .h2{padding-inline-start:24px}.sidebar-page-nav .h3{padding-inline-start:32px}.sidebar-page-nav .h4{padding-inline-start:40px}.sidebar-page-nav .h5{padding-inline-start:48px}.sidebar-page-nav .h6{padding-inline-start:56px}.sidebar-page-nav .current-heading{font-weight:bold}.sidebar-page-nav li:not(.current-heading) .sidebar-page-nav-bullet{background-color:#bbb !important}html.dark-mode .sidebar-page-nav li:not(.current-heading) .sidebar-page-nav-bullet{background-color:#666 !important}.sidebar-page-nav .sidebar-page-nav-bullet{width:6px;height:6px;position:absolute;left:-2px;top:30%;border-radius:50%;box-shadow:0 0 0 6px #f2f2f2;box-shadow:0 0 0 6px #f2f2f2;z-index:1}html.dark-mode .sidebar-page-nav .sidebar-page-nav-bullet{box-shadow:0 0 0 6px #111}html[dir=rtl] .sidebar-page-nav .sidebar-page-nav-bullet{left:auto;right:-2px}.book-tree .sidebar-page-list{list-style:none;margin-block-start:6px;margin-block-end:0;margin-inline-start:-12px;margin-inline-end:-12px;padding-inline-start:0;padding-inline-end:0}.book-tree .sidebar-page-list ul{list-style:none;padding-inline-start:1rem;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item{padding-top:2px;padding-bottom:2px;background-clip:content-box;border-radius:0 3px 3px 0;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item .content{width:100%;padding-top:6px;padding-bottom:6px;max-width:calc(100% - 20px)}.book-tree .sidebar-page-list .entity-list-item.selected{background-color:rgba(0,0,0,.06)}html.dark-mode .book-tree .sidebar-page-list .entity-list-item.selected{background-color:hsla(0,0%,100%,.06)}.book-tree .sidebar-page-list .entity-list-item.no-hover{margin-top:-6px;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item-name{font-size:1em;margin:0;margin-inline-end:16px}.book-tree .sidebar-page-list .chapter-child-menu{font-size:.8rem;margin-top:-0.2rem;margin-inline-start:-1rem}.book-tree .sidebar-page-list .chapter-contents-toggle{display:block;width:100%;text-align:start;padding:3px 12px 6px 12px;border-radius:0 3px 3px 0;line-height:1;margin-top:-3px;margin-bottom:-3px}.book-tree .sidebar-page-list .chapter-contents-toggle:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .book-tree .sidebar-page-list .chapter-contents-toggle:hover{background-color:hsla(0,0%,100%,.06)}.book-tree .sidebar-page-list .entity-list-item .icon{z-index:2;width:4px;height:auto;align-self:stretch;flex-shrink:0;border-radius:1px;opacity:.8}.book-tree .sidebar-page-list .entity-list-item .icon:after{opacity:1}.book-tree .sidebar-page-list .entity-list-item .icon svg{display:none}.chapter-child-menu ul.sub-menu{display:none;padding-inline-start:0;position:relative;margin-bottom:0}.sortable-page-list,.sortable-page-sublist{list-style:none}.sort-box{margin-bottom:16px;padding:16px 32px;position:relative}.sort-box summary:focus{outline:1px dashed var(--color-primary);outline-offset:5px}.sort-box::before{pointer-events:none;content:"";border-radius:4px;opacity:.5;border:2px solid var(--color-book);display:block;top:0;bottom:0;left:0;right:0;position:absolute}.sort-box-options{display:flex;flex-wrap:wrap;justify-content:space-between}.sort-box-options .button{margin-inline-start:0}.sortable-page-list{margin-inline-start:0;padding:0}.sortable-page-list .entity-list-item>span:first-child{align-self:flex-start}.sortable-page-list .sortable-selected,.sortable-page-list .sortable-selected:hover{outline:1px dotted var(--color-primary);background-color:var(--color-primary-light) !important}.sortable-page-list .entity-list-item>div{display:block;flex:1}.sortable-page-list>ul{margin-inline-start:0}.sortable-page-list .sortable-page-sublist{margin-bottom:16px;margin-top:0;padding-inline-start:16px}.sortable-page-list li{background-color:#fff;border:1px solid;border-color:#ddd;margin-top:-1px;min-height:38px}html.dark-mode .sortable-page-list li{background-color:#222}html.dark-mode .sortable-page-list li{border-color:#666}.sortable-page-list li.text-page,.sortable-page-list li.text-chapter{border-inline-start:2px solid currentColor}.sortable-page-list li:first-child{margin-top:6px}.sortable-page-list li.placeholder{position:relative}.sortable-page-list li.placeholder:before{position:absolute}.sort-box summary{list-style:none;font-size:.9rem;cursor:pointer}.sort-box summary::-webkit-details-marker{display:none}details.sort-box summary .caret-container svg{transition:transform ease-in-out 120ms}details.sort-box[open] summary .caret-container svg{transform:rotate(90deg)}.sort-box-actions .icon-button{opacity:.6}.sort-box .flex-container-row:hover .sort-box-actions .icon-button,.sort-box .flex-container-row:focus-within .sort-box-actions .icon-button{opacity:1}.sort-box-actions .icon-button[disabled]{visibility:hidden}.sort-box-actions .dropdown-menu button[disabled]{display:none}.sort-list-handle{cursor:grab}.activity-list-item{padding:12px 0;display:grid;grid-template-columns:min-content 1fr;grid-column-gap:16px;font-size:.9em}.card .activity-list-item{padding-block:12px}.user-list-item{display:inline-grid;padding:12px;grid-template-columns:min-content 1fr;grid-column-gap:16px;font-size:.9em;align-items:center}.user-list-item>div:first-child{line-height:0}ul.pagination{display:inline-flex;list-style:none;margin:16px 0;padding-inline-start:1px}ul.pagination li:first-child a,ul.pagination li:first-child span{border-radius:3px 0 0 3px}ul.pagination li:last-child a,ul.pagination li:last-child span{border-radius:0 3px 3px 0}ul.pagination a,ul.pagination span{display:block;padding:3px 12px;border:1px solid #ccc;margin-inline-start:-1px;user-select:none;color:#555;border-color:#ccc}html.dark-mode ul.pagination a,html.dark-mode ul.pagination span{color:#eee}html.dark-mode ul.pagination a,html.dark-mode ul.pagination span{border-color:#666}ul.pagination li.disabled{cursor:not-allowed}ul.pagination li.active span{color:#111;background-color:rgba(0,0,0,.05)}html.dark-mode ul.pagination li.active span{color:#eee}html.dark-mode ul.pagination li.active span{background-color:rgba(0,0,0,.5)}.compact ul.pagination{margin:0}.entity-list,.icon-list{margin:0 -16px}.entity-list h4,.icon-list h4{margin:0}.entity-list hr,.icon-list hr{margin:0}.entity-list .text-small.text-muted,.icon-list .text-small.text-muted{color:#aaa;font-size:.75em;margin-top:6px}.entity-list .text-muted p.text-muted,.icon-list .text-muted p.text-muted{margin-top:0}.entity-list .page.draft .text-page,.icon-list .page.draft .text-page{color:var(--color-page-draft);fill:var(--color-page-draft)}.entity-list>.dropdown-container,.icon-list>.dropdown-container{display:block}.icon-list hr{margin:12px 16px;max-width:140px;opacity:.25;height:1.1px}.icon-list hr+hr,.icon-list hr:first-child,.icon-list hr:last-child{display:none}.entity-list-item,.icon-list-item{padding:12px 16px;display:flex;align-items:center;gap:16px;background-color:rgba(0,0,0,0);border:0;width:100%;position:relative;word-break:break-word}.entity-list-item h4 a,.icon-list-item h4 a{color:#666}.entity-list-item>span:first-child,.icon-list-item>span:first-child{flex-basis:1.88em;flex:none}.entity-list-item>span:last-child,.icon-list-item>span:last-child{flex:1;text-align:start}.entity-list-item>.content,.icon-list-item>.content{min-width:0}.entity-list-item:not(.no-hover),.icon-list-item:not(.no-hover){cursor:pointer}.entity-list-item:not(.no-hover):hover,.icon-list-item:not(.no-hover):hover{background-color:rgba(0,0,0,.06);text-decoration:none;border-radius:4px}html.dark-mode .entity-list-item:not(.no-hover):hover,html.dark-mode .icon-list-item:not(.no-hover):hover{background-color:hsla(0,0%,100%,.06)}.entity-list-item.outline-hover:hover,.icon-list-item.outline-hover:hover{background-color:rgba(0,0,0,0)}.entity-list-item:focus,.icon-list-item:focus{background-color:#eee;outline:1px dotted #666;outline-offset:-2px}html.dark-mode .entity-list-item:focus,html.dark-mode .icon-list-item:focus{background-color:#222}.entity-list-item.disabled{pointer-events:none;cursor:not-allowed;opacity:.8;user-select:none;background:var(--bg-disabled)}.entity-list-item-path-sep{display:inline-block;vertical-align:top;position:relative;top:1px}.entity-list-item-path-sep svg{margin-inline-end:0}.split-icon-list-item{display:flex;align-items:center;gap:16px;background-color:rgba(0,0,0,0);border:0;width:100%;position:relative;word-break:break-word;border-radius:4px}.split-icon-list-item>a{padding:12px 16px;display:flex;align-items:center;gap:16px;flex:1}.split-icon-list-item>a:hover{text-decoration:none}.split-icon-list-item .icon{flex-basis:1.88em;flex:none}.split-icon-list-item:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .split-icon-list-item:hover{background-color:hsla(0,0%,100%,.06)}.icon-list-item-dropdown{margin-inline-start:auto;align-self:stretch;display:flex;align-items:stretch;border-inline-start:1px solid rgba(0,0,0,.1);visibility:hidden}.split-icon-list-item:hover .icon-list-item-dropdown,.split-icon-list-item:focus-within .icon-list-item-dropdown{visibility:visible}.icon-list-item-dropdown-toggle{padding:6px;display:flex;align-items:center;cursor:pointer;color:#888}html.dark-mode .icon-list-item-dropdown-toggle{color:#999}.icon-list-item-dropdown-toggle svg{margin:0}.icon-list-item-dropdown-toggle:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .icon-list-item-dropdown-toggle:hover{background-color:hsla(0,0%,100%,.06)}.card .entity-list-item:not(.no-hover,.book-contents .entity-list-item):hover{background-color:#f2f2f2;border-radius:0}html.dark-mode .card .entity-list-item:not(.no-hover,.book-contents .entity-list-item):hover{background-color:#2d2d2d}.card .entity-list-item .entity-list-item:hover{background-color:#eee}.entity-list-item-children{padding:16px 24px}.entity-list-item-children>div{overflow:hidden;padding:0 0 6px 0}.entity-list-item-children .entity-chip{text-overflow:ellipsis;height:2.5em;overflow:hidden;text-align:start;display:block;white-space:nowrap}.entity-list-item-children>.entity-list>.entity-list-item:last-child{margin-bottom:-6px}.entity-list-item-image{align-self:stretch;width:140px;flex:none;background-size:cover;background-position:50% 50%;border-radius:3px;position:relative;margin-inline-end:24px}.entity-list-item-image.entity-list-item-image-wide{width:220px}.entity-list-item-image .svg-icon{color:#fff;font-size:1.66rem;margin-inline-end:0;position:absolute;bottom:6px;left:6px}html.dark-mode .entity-list-item-image .svg-icon{color:hsla(0,0%,100%,.6)}@media screen and (max-width: 880px){.entity-list-item-image{width:80px}}.chapter>.entity-list-item-image{width:60px}.entity-list.compact{font-size:8.4px}.entity-list.compact h4,.entity-list.compact a{line-height:1.2}.entity-list.compact .entity-item-snippet{display:none}.entity-list.compact .entity-list-item p{font-size:11.2px;padding-top:6px}.entity-list.compact .entity-list-item p:empty{padding-top:0}.entity-list.compact p{margin:0}.entity-list.compact>p.empty-text{display:block;font-size:14px}.entity-list.compact hr{margin:0}@media screen and (max-width: 880px){.entity-list.compact h4{font-size:1.666em}}.entity-item-tags{font-size:.75rem;opacity:1}.entity-item-tags .primary-background-light{background:rgba(0,0,0,0)}.entity-item-tags .tag-name{background-color:rgba(0,0,0,.05)}.dropdown-container{display:inline-block;vertical-align:top;position:relative}.dropdown-menu{display:none;position:absolute;z-index:999;top:0;list-style:none;inset-inline-end:0;margin:16px 0;background-color:#fff;box-shadow:0 1px 6px 0 rgba(0,0,0,.18);border-radius:3px;min-width:180px;padding:6px 0;color:#555;fill:currentColor;text-align:start !important;max-height:500px;overflow-y:auto}html.dark-mode .dropdown-menu{background-color:#333}html.dark-mode .dropdown-menu{color:#eee}.dropdown-menu.anchor-left{inset-inline-end:auto;inset-inline-start:0}.dropdown-menu.wide{min-width:220px}.dropdown-menu.xl-limited{width:280px;max-width:100%}.dropdown-menu .text-muted{color:#999;fill:#999}.dropdown-menu li.active a{font-weight:600}.dropdown-menu button{width:100%;text-align:start}.dropdown-menu li.border-bottom{border-bottom:1px solid #ddd}.dropdown-menu li hr{margin:6px 0}.dropdown-menu .icon-item,.dropdown-menu .text-item,.dropdown-menu .label-item{padding:8px 16px;color:#555;fill:currentColor;white-space:nowrap;line-height:1.4;cursor:pointer}html.dark-mode .dropdown-menu .icon-item,html.dark-mode .dropdown-menu .text-item,html.dark-mode .dropdown-menu .label-item{color:#eee}.dropdown-menu .icon-item.break-text,.dropdown-menu .text-item.break-text,.dropdown-menu .label-item.break-text{white-space:normal;word-wrap:break-word;overflow-wrap:break-word}.dropdown-menu .icon-item:hover,.dropdown-menu .icon-item:focus,.dropdown-menu .text-item:hover,.dropdown-menu .text-item:focus,.dropdown-menu .label-item:hover,.dropdown-menu .label-item:focus{text-decoration:none;background-color:var(--color-primary-light);color:var(--color-primary)}.dropdown-menu .icon-item:focus,.dropdown-menu .text-item:focus,.dropdown-menu .label-item:focus{outline:1px solid var(--color-primary);outline-offset:-2px}.dropdown-menu .icon-item svg,.dropdown-menu .text-item svg,.dropdown-menu .label-item svg{margin-inline-end:12px;display:inline-block;width:16px}.dropdown-menu .text-item{display:block}.dropdown-menu .label-item{display:grid;align-items:center;grid-template-columns:auto min-content;gap:16px}.dropdown-menu .label-item>*:nth-child(2){opacity:.7}.dropdown-menu .label-item>*:nth-child(2):hover{opacity:1}.dropdown-menu .icon-item{display:grid;align-items:start;grid-template-columns:16px auto;gap:16px}.dropdown-menu .icon-item svg{margin-inline-end:0;margin-block-start:1px}.tri-layout-right .dropdown-menu,.tri-layout-left .dropdown-menu{inset-inline-end:6px}.featured-image-container{position:relative;overflow:hidden;min-height:140px;background-size:cover;background-position:50% 50%;transition:opacity ease-in-out 240ms}.featured-image-container a{display:block}.featured-image-container img{display:block;width:100%;max-width:100%;height:auto}.featured-image-container-wrap{position:relative}.featured-image-container-wrap .svg-icon{color:#fff;font-size:2rem;margin-inline-end:0;position:absolute;bottom:10px;left:6px}html.dark-mode .featured-image-container-wrap .svg-icon{color:hsla(0,0%,100%,.6)}.grid-card:hover .featured-image-container{opacity:.5}.action-link{background:rgba(0,0,0,0);border:none;color:currentColor;padding:16px 0}.active-link-list a{display:inline-block;padding:12px}.active-link-list a:not(.active){color:#444}html.dark-mode .active-link-list a:not(.active){color:#888}.active-link-list a:hover{background-color:rgba(0,0,0,.05);border-radius:4px;text-decoration:none}html.dark-mode .active-link-list a:hover{background-color:hsla(0,0%,100%,.05)}.active-link-list.in-sidebar a{display:block;margin-bottom:6px}.active-link-list.in-sidebar a.active{border-radius:4px;background-color:rgba(0,0,0,.05)}html.dark-mode .active-link-list.in-sidebar a.active{background-color:hsla(0,0%,100%,.05)}.entity-meta-item{display:flex;line-height:1.2;margin:.6em 0;align-content:start;gap:12px}.entity-meta-item a{line-height:1.2}.entity-meta-item svg{flex-shrink:0;width:1em;margin:0}.page-editor{display:flex;flex-direction:column;align-items:stretch}.page-editor .edit-area{flex:1;flex-direction:column;z-index:10;border-radius:0 0 8px 8px}.page-editor .mce-tinymce{box-shadow:none}.page-editor .mce-top-part::before{box-shadow:none}.page-editor-page-area{width:100%;border-radius:8px;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);min-width:300px;background-color:#fff}html.dark-mode .page-editor-page-area{background-color:#333}.page-edit-toolbar{width:100%;margin:0 auto;display:grid;grid-template-columns:minmax(max-content, 2fr) 1.5fr minmax(max-content, 2fr);align-items:center}@media screen and (min-width: 1401px){.page-editor-wysiwyg2024 .page-edit-toolbar,.page-editor-wysiwyg2024 .page-editor-page-area,.page-editor-wysiwyg .page-edit-toolbar,.page-editor-wysiwyg .page-editor-page-area{max-width:1140px}.page-editor-wysiwyg .floating-toolbox,.page-editor-wysiwyg2024 .floating-toolbox{position:absolute}}@media screen and (max-width: 880px){.page-edit-toolbar{display:flex;flex-direction:row;justify-content:space-between}}.title-input.page-title{font-size:.8em}.title-input.page-title .input{border:0;margin-bottom:-1px}.title-input.page-title input[type=text]{max-width:840px;margin:0 auto;border:none;height:auto;display:block;width:100%;font-size:20px;border-radius:8px}.title-input.page-title input[type=text]:focus{position:relative;outline-offset:-1px;outline:1px dashed var(--color-primary);box-shadow:0 1px 6px -1px rgba(0,0,0,.1);z-index:50}.page-editor-markdown .title-input.page-title input[type=text]{max-width:100%}body.tox-fullscreen .page-editor .edit-area,body.markdown-fullscreen .page-editor .edit-area{z-index:12}body.tox-fullscreen .page-editor,body.tox-fullscreen .flex-fill,body.markdown-fullscreen .page-editor,body.markdown-fullscreen .flex-fill{overflow:visible}@media screen and (max-width: 600px){.page-edit-toolbar{overflow-x:scroll;overflow-y:visible}.page-edit-toolbar{white-space:nowrap}.page-edit-toolbar>div{display:inline-block}}.page-save-mobile-button{position:fixed;z-index:30;border-radius:50%;width:52px;height:52px;font-size:26px;inset-inline-end:6px;bottom:12px;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);background-color:currentColor;text-align:center}.page-save-mobile-button svg{fill:#fff;margin-inline-end:0}.draft-notification{pointer-events:none;transform:scale(0);transition:transform ease-in-out 120ms;transform-origin:50% 50%}.draft-notification.visible{transform:scale(1)}.page-style.editor{padding:0 !important}.pointer-container{position:fixed;display:none;left:0;z-index:10}.pointer{border:1px solid #ccc;border-color:#ccc;border-radius:4px;box-shadow:0 0 12px 1px rgba(0,0,0,.1);background-color:#fff;width:328px}html.dark-mode .pointer{border-color:#000}html.dark-mode .pointer{background-color:#333}.pointer:before{position:absolute;left:50%;bottom:-9px;width:16px;height:16px;margin-inline-start:-8px;content:"";display:block;transform:rotate(45deg);transform-origin:50% 50%;border-right:1px solid #ccc;border-bottom:1px solid #ccc;z-index:56;background-color:#fff;border-color:#ccc}html.dark-mode .pointer:before{background-color:#333}html.dark-mode .pointer:before{border-color:#000}.pointer input,.pointer button,.pointer a{position:relative;height:28px;font-size:12px;vertical-align:top;padding:5px 16px}.pointer input{background-color:#fff;border:1px solid #ddd;border-color:#ddd;color:#666;width:auto;flex:1;z-index:58;padding:5px;border-radius:0}html.dark-mode .pointer input{border-color:#000}.pointer .text-button{color:#444}html.dark-mode .pointer .text-button{color:#aaa}.pointer .input-group .button{line-height:1;margin-inline-start:-1px;margin-block:0;box-shadow:none;border-radius:0}.pointer a.button{margin:0}.pointer .svg-icon{width:1.2em;height:1.2em}.pointer .button{border-color:#ddd}html.dark-mode .pointer .button{border-color:#000}.content-comment-highlight{position:absolute;left:0;top:0;width:0;height:0;user-select:none;pointer-events:none}.content-comment-highlight:after{content:"";position:absolute;left:0;top:0;width:100%;height:100%;background-color:var(--color-primary);opacity:.25}.content-comment-window{font-size:14px;line-height:1.4;position:absolute;top:calc(100% + 3px);left:0;z-index:92;pointer-events:all;min-width:min(340px,80vw);background-color:#fff;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);border-radius:4px;overflow:hidden}html.dark-mode .content-comment-window{background-color:#222}.content-comment-window-actions{background-color:var(--color-primary);color:#fff;display:flex;align-items:center;justify-content:end;gap:6px}.content-comment-window-actions button{color:#fff;font-size:12px;padding:6px;line-height:1;cursor:pointer}.content-comment-window-actions button[data-action=jump]{text-decoration:underline}.content-comment-window-actions svg{fill:currentColor;width:12px}.content-comment-window-content{padding:6px 12px 6px 6px;max-height:200px;overflow-y:scroll}.content-comment-window-content .comment-reference-indicator-wrap{display:none}.content-comment-marker{position:absolute;right:-16px;top:-16px;pointer-events:all;width:min(1.5em,32px);height:min(1.5em,32px);border-radius:min(.75em,32px);display:flex;align-items:center;justify-content:center;background-color:var(--color-primary);box-shadow:0 2px 2px 1px rgba(0,0,0,.13);color:#fff;cursor:pointer;z-index:90;transform:scale(1);transition:transform ease-in-out 120ms}.content-comment-marker svg{fill:#fff;width:80%}.page-content [id^=bkmrk-]:hover .content-comment-marker{transform:scale(1.15)}.floating-toolbox{background-color:#fff;overflow:hidden;align-items:stretch;flex-direction:row;display:flex;max-height:100%;border-radius:8px;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);margin-bottom:auto;margin-inline-start:24px;position:relative}html.dark-mode .floating-toolbox{background-color:#222}.floating-toolbox.open{position:relative;right:0;max-width:480px;margin-bottom:0}.floating-toolbox:not(.open) .toolbox-tab-content{display:none !important}.floating-toolbox .toolbox-toggle svg{transition:transform ease-in-out 180ms}.floating-toolbox .toolbox-toggle{transition:background-color ease-in-out 180ms}.floating-toolbox.open .toolbox-toggle{background-color:rgba(255,0,0,.2)}.floating-toolbox.open .toolbox-toggle svg{transform:rotate(180deg)}.floating-toolbox>div{flex:1;position:relative}.floating-toolbox .tabs{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd;width:40px;flex:0 1 auto;margin-inline-end:-1px}html.dark-mode .floating-toolbox .tabs{border-inline-end-color:#000}.floating-toolbox .tabs-inner{background-color:#fff}html.dark-mode .floating-toolbox .tabs-inner{background-color:#222}.floating-toolbox .tabs svg{padding:0;margin:0}.floating-toolbox .tabs-inner>button{color:rgba(0,0,0,.7);display:block;cursor:pointer;padding:10px 6px;font-size:18px;line-height:1.6}html.dark-mode .floating-toolbox .tabs-inner>button{color:hsla(0,0%,100%,.5)}.floating-toolbox .tabs-inner>button:hover,.floating-toolbox.open .tabs-inner>button.active{color:var(--color-link) !important;position:relative}.floating-toolbox .tabs-inner>button:hover:after,.floating-toolbox.open .tabs-inner>button.active:after{content:"";display:block;position:absolute;left:0;width:100%;top:0;height:100%;background-color:currentColor;opacity:.075}.floating-toolbox.open .tabs-inner>button.active{border-inline-end:1px solid var(--color-link);margin-inline-end:-1px}.floating-toolbox h4{font-size:24px;margin:16px 0 0 0;padding:0 24px 12px 24px}.floating-toolbox .tags input{max-width:100%;width:100%;min-width:50px}.floating-toolbox .tags td,.floating-toolbox .inline-start-table>div>div>div{padding-inline-end:12px;padding-top:12px;position:relative}.floating-toolbox .handle{user-select:none;cursor:move;fill:#999}.floating-toolbox form{display:flex;flex:1;flex-direction:column;overflow-y:scroll}.floating-toolbox table td,.floating-toolbox table th{overflow:visible}@media screen and (max-width: 1400px){.floating-toolbox{margin-inline-start:12px}}@media screen and (max-width: 600px){.page-editor-page-area-wrap{margin:4px !important}.floating-toolbox{margin-inline-start:4px}.floating-toolbox .tabs{width:32px}.floating-toolbox .tabs-inner>button{font-size:12px}.page-edit-toolbar{padding-block:0 !important}.page-editor.toolbox-open .page-editor-page-area{display:none}}.toolbox-tab-content{display:none;overflow-y:auto;padding-bottom:45px}.suggestion-box{top:auto;margin:-4px 0 0;right:auto;left:0;padding:0}.suggestion-box li{display:block;border-bottom:1px solid #ddd}.suggestion-box li:last-child{border-bottom:0}.comments-container h5{color:#888;font-weight:normal;margin-top:.5em}.comment-editor .CodeMirror,.comment-editor .CodeMirror-scroll{min-height:175px}.mce-floatpanel[aria-label="Insert/edit media"] .mce-open{display:none}.entity-list-item>span:first-child,.icon-list-item>span:first-child,.split-icon-list-item>a>.icon,.chapter-expansion>.icon{font-size:.8rem;width:1.88em;height:1.88em;flex-shrink:0;display:flex;align-items:center;justify-content:center;text-align:center;border-radius:1em;position:relative;overflow:hidden}.entity-list-item>span:first-child svg,.icon-list-item>span:first-child svg,.split-icon-list-item>a>.icon svg,.chapter-expansion>.icon svg{margin:0;bottom:0}.entity-list-item>span:first-child:after,.icon-list-item>span:first-child:after,.split-icon-list-item>a>.icon:after,.chapter-expansion>.icon:after{content:"";position:absolute;background-color:currentColor;opacity:.2;left:0;top:0;width:100%;height:100%}.entity-chip{display:inline-block;align-items:center;justify-content:center;text-align:center;font-size:.9em;border-radius:3px;position:relative;overflow:hidden;padding:6px 12px;fill:currentColor;opacity:.85;transition:opacity ease-in-out 120ms}.entity-chip:after{content:"";position:absolute;background-color:currentColor;opacity:.15;left:0;top:0;width:100%;height:100%}.entity-chip:hover{text-decoration:none;opacity:1}@media(prefers-contrast: more){.entity-chip{opacity:1}}.page-content{width:100%;max-width:840px;margin:0 auto;overflow-wrap:break-word;position:relative}.page-content .align-left{text-align:left}.page-content img.align-left,.page-content table.align-left,.page-content iframe.align-left,.page-content video.align-left{float:left !important;margin:6px 16px 16px 0}.page-content .align-right{text-align:right !important}.page-content img.align-right,.page-content table.align-right,.page-content iframe.align-right,.page-content video.align-right{float:right !important;margin:6px 0 6px 12px}.page-content .align-center{text-align:center}.page-content img.align-center,.page-content video.align-center,.page-content iframe.align-center{display:block}.page-content img.align-center,.page-content table.align-center,.page-content iframe.align-center,.page-content video.align-center{margin-left:auto;margin-right:auto}.page-content .align-justify{text-align:justify}.page-content h1,.page-content h2,.page-content h3,.page-content h4,.page-content h5,.page-content h6,.page-content pre{clear:left}.page-content hr{clear:both;margin:16px 0}.page-content table{hyphens:auto;table-layout:fixed;max-width:100%;height:auto !important}.page-content ins,.page-content del{text-decoration:none}.page-content ins{background:#dbffdb}.page-content del{background:#ffecec}.page-content details{border:1px solid;border-color:#ddd;margin-bottom:1em;padding:12px}html.dark-mode .page-content details{border-color:#555}.page-content details>summary{margin-top:-12px;margin-left:-12px;margin-right:-12px;margin-bottom:-12px;font-weight:bold;background-color:#eee;padding:6px 12px}html.dark-mode .page-content details>summary{background-color:#333}.page-content details[open]>summary{margin-bottom:12px;border-bottom:1px solid;border-color:#ddd}html.dark-mode .page-content details[open]>summary{border-color:#555}.page-content details>summary+*{margin-top:.2em}.page-content details:after{content:"";display:block;clear:both}.page-content li>input[type=checkbox]{vertical-align:top;margin-top:.3em}.page-content p:empty{min-height:1.6em}.page-content.page-revision pre code{white-space:pre-wrap}.page-content .cm-editor{margin-bottom:1.375em}.page-content video,.page-content iframe{max-width:100%}.page-content a{text-decoration:underline}body .page-content img,.page-content img:not([data-mce-object]){max-width:100%;height:auto}.callout{border-left:3px solid #bbb;border-inline-start:3px solid #bbb;border-inline-end:none;background-color:#eee;padding:12px;padding-left:32px;padding-inline-start:32px;padding-inline-end:12px;display:block;position:relative;overflow:auto}.callout:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMTUzODAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bTEgMTVoLTJ2LTZoMnY2em0wLThoLTJWN2gydjJ6Ii8+PC9zdmc+");background-repeat:no-repeat;content:"";width:1.2em;height:1.2em;left:8px;inset-inline-start:8px;inset-inline-end:unset;top:50%;margin-top:-9px;display:inline-block;position:absolute;line-height:1;opacity:.8}.callout.success{border-color:#0f7d15;background-color:#eafdeb;color:#063409}html.dark-mode .callout.success{border-color:#4aa850}html.dark-mode .callout.success{background-color:#122913}html.dark-mode .callout.success{color:#4aa850}.callout.success:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+")}.callout.danger{border-color:#ab0f0e;background-color:#fcdbdb;color:#4d0706}html.dark-mode .callout.danger{border-color:#e85c5b}html.dark-mode .callout.danger{background-color:#250505}html.dark-mode .callout.danger{color:#e85c5b}.callout.danger:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==")}.callout.info{border-color:#0288d1;background-color:#d3efff;color:#01466c}html.dark-mode .callout.info{border-color:#0288d1}html.dark-mode .callout.info{background-color:#001825}html.dark-mode .callout.info{color:#0288d1}.callout.warning{border-color:#cf4d03;background-color:#fee3d3;color:#6a2802}html.dark-mode .callout.warning{border-color:#de8a5a}html.dark-mode .callout.warning{background-color:#30170a}html.dark-mode .callout.warning{color:#de8a5a}.callout.warning:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiNjUzMWMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEgMjFoMjJMMTIgMiAxIDIxem0xMi0zaC0ydi0yaDJ2MnptMC00aC0ydi00aDJ2NHoiLz48L3N2Zz4=")}.callout a{color:inherit;text-decoration:underline}@media print{html,body{font-size:12px;background-color:#fff}.page-content{margin:0 auto}.print-hidden{display:none !important}.tri-layout-container{grid-template-columns:1fr;grid-template-areas:"b";margin-inline-start:0;margin-inline-end:0;display:block}.card{box-shadow:none}.content-wrap.card{padding-inline-start:0;padding-inline-end:0}}.dragged{position:absolute;opacity:.5;z-index:2000}body.dragging,body.dragging *{cursor:move !important}.avatar{border-radius:100%;background-color:#eee;width:30px;height:30px}html.dark-mode .avatar{background-color:#000}.avatar.med{width:40px;height:40px}.avatar.large{width:80px;height:80px}.avatar.huge{width:120px;height:120px}.avatar.square{border-radius:3px}html.dark-mode .avatar[src$="user_avatar.png"]{filter:invert(1)}.loading-container{position:relative;display:block;margin:32px auto}.loading-container>div{width:10px;height:10px;border-radius:10px;display:inline-block;vertical-align:top;transform:translate3d(-10px, 0, 0);margin-top:6px;animation-name:loadingBob;animation-duration:1.4s;animation-iteration-count:infinite;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99);margin-inline-end:4px;background-color:var(--color-page);animation-delay:-300ms}.loading-container>div:first-child{left:-16px;background-color:var(--color-book);animation-delay:-600ms}.loading-container>div:last-of-type{left:16px;background-color:var(--color-chapter);animation-delay:0ms}.loading-container>span{margin-inline-start:12px;font-style:italic;color:#888;vertical-align:top}.inline.block .loading-container{margin:6px 12px}.skip-to-content-link{position:fixed;top:-52px;left:0;background-color:#fff;z-index:15;border-radius:0 4px 4px 0;display:block;box-shadow:0 0 4px 1px rgba(0,0,0,.5);font-weight:bold}.skip-to-content-link:focus{top:32px;outline-offset:-10px;outline:2px dotted var(--color-link)}.entity-selector{border:1px solid #ddd;border-color:#ddd;border-radius:3px;overflow:hidden;font-size:.8em}html.dark-mode .entity-selector{border-color:#111}.entity-selector input[type=text]{width:100%;display:block;border-radius:0;border:0;border-bottom:1px solid #ddd;font-size:16px;padding:12px 16px}.entity-selector input[type=text]:focus{outline:1px solid var(--color-primary);border-radius:3px 3px 0 0;outline-offset:-1px}.entity-selector .entity-list{overflow-y:scroll;height:400px;background-color:#eee;margin-inline-end:0;margin-inline-start:0}html.dark-mode .entity-selector .entity-list{background-color:#222}.entity-selector .entity-list-item{background-color:#fff}html.dark-mode .entity-selector .entity-list-item{background-color:#222}.entity-selector .entity-list-item p{margin-bottom:0}.entity-selector .entity-list-item:focus{outline:2px dotted var(--color-primary);outline-offset:-4px}.entity-selector .entity-list-item.selected{background-color:rgba(0,0,0,.05)}html.dark-mode .entity-selector .entity-list-item.selected{background-color:hsla(0,0%,100%,.05)}.entity-selector .loading{height:400px;padding-top:24px}.entity-selector.compact{font-size:10px}.entity-selector.compact .entity-item-snippet{display:none}.entity-selector.compact h4{font-size:14px}.entity-selector.small .entity-list-item{padding:6px 16px}.entity-selector.small .entity-list,.entity-selector.small .loading{height:300px}.entity-selector.small input[type=text]{font-size:13px;padding:6px 16px;height:auto}.fullscreen{border:0;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;z-index:150}@media screen and (min-width: 601px)and (max-width: 880px){#home-default>.grid.third{display:block;columns:2;column-gap:24px !important}}.list-sort-container{display:inline-block}.list-sort-container form{display:inline-block}.list-sort-container .list-sort{display:inline-grid;margin-inline-start:12px;grid-template-columns:minmax(120px, max-content) 40px;font-size:.9rem;border:2px solid #ddd;border-color:#ddd;border-radius:4px}html.dark-mode .list-sort-container .list-sort{border-color:#444}.list-sort-container .list-sort-label{font-weight:bold;display:inline-block}.list-sort-container .list-sort-label,.list-sort-container .list-sort-toggle{color:#555}html.dark-mode .list-sort-container .list-sort-label,html.dark-mode .list-sort-container .list-sort-toggle{color:#888}.list-sort-container .list-sort-type{text-align:start}.list-sort-container .list-sort-toggle,.list-sort-container .list-sort-dir{padding:8px 12px;cursor:pointer}.list-sort-container .list-sort-dir{border-inline-start:2px solid #ddd;color:#888;border-color:#ddd}html.dark-mode .list-sort-container .list-sort-dir{border-color:#444}.list-sort-container .list-sort-dir .svg-icon{transition:transform ease-in-out 120ms}.list-sort-container .list-sort-dir:hover .svg-icon{transform:rotate(180deg)}.list-sort-container .list-sort-toggle{display:block;width:100%;text-align:start}.import-item{border-inline-start:2px solid currentColor;padding-inline-start:6px}/*# sourceMappingURL=styles.css.map */ diff --git a/public/dist/wysiwyg.js b/public/dist/wysiwyg.js index 3e00cb49d..5a8f9f233 100644 --- a/public/dist/wysiwyg.js +++ b/public/dist/wysiwyg.js @@ -4,17 +4,17 @@ var Mh=Object.defineProperty;var wh=(o,t,e)=>t in o?Mh(o,t,{enumerable:!0,config `,Dd=We?vd:Cn,Od="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Ad="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Rh=new RegExp("^[^"+Ad+"]*["+Od+"]"),kh=new RegExp("^[^"+Od+"]*["+Ad+"]"),Re={bold:dr,code:ur,highlight:pr,italic:cr,strikethrough:xn,subscript:fr,superscript:mr,underline:En},Rd={directionless:si,unmergeable:Tn},kd={normal:wd,segmented:ii,token:ri},Id={[wd]:"normal",[ii]:"segmented",[ri]:"token"};function T(o,t,...e){if(!o){for(let n of e)t=(t||"").replace("%s",n);throw new Error(t)}}function wt(...o){let t=[];for(let e of o)if(e&&typeof e=="string")for(let[n]of e.matchAll(/\S+/g))t.push(n);return t}var Ih=100,tl=!1,ol=0;function $d(){return tl}function $h(o){ol=o.timeStamp}function Ph(o){ol===0&&bn(o).addEventListener("textInput",$h,!0)}function el(o,t,e){return t.__lexicalLineBreak===o||o[`__lexicalKey_${e._key}`]!==void 0}function Bh(o){return o.getEditorState().read(()=>{let t=C();return t!==null?t.clone():null})}function Fh(o,t,e){let n=Le(e._window),r=null,i=null;n!==null&&n.anchorNode===o&&(r=n.anchorOffset,i=n.focusOffset);let s=o.nodeValue;s!==null&&gr(t,s,r,i,!1)}function Hh(o,t,e){return t.nodeType===qe&&e.isAttached()}function Pd(o,t,e){tl=!0;let n=performance.now()-ol>Ih;try{Te(o,()=>{let r=C()||Bh(o),i=new Map,s=o.getRootElement(),l=o._editorState,a=o._blockCursorElement,d=!1,u="";for(let c=0;c0){let v=0;for(let M=0;M0)for(let[c,f]of i)if(E(f)){let g=f.getChildrenKeys(),h=c.firstChild;for(let N=0;N0){for(let c=0;c{Pd(o,t,e)})}function Bd(o,t){let e=o.__mode,n=o.__format,r=o.__style,i=t.__mode,s=t.__format,l=t.__style;return(e===null||e===i)&&(n===null||n===s)&&(r===null||r===l)}function Fd(o,t){let e=o.mergeWithSibling(t),n=Q()._normalizedNodes;return n.add(o.__key),n.add(t.__key),e}function il(o){let t=o;if(t.__text===""&&t.isSimpleText()&&!t.isUnmergeable()){t.remove();return}let e;for(;(e=t.getPreviousSibling())!==null&&L(e)&&e.isSimpleText()&&!e.isUnmergeable();)if(e.__text==="")e.remove();else if(Bd(e,t)){t=Fd(e,t);break}else break;let n;for(;(n=t.getNextSibling())!==null&&L(n)&&n.isSimpleText()&&!n.isUnmergeable();)if(n.__text==="")n.remove();else if(Bd(t,n)){t=Fd(t,n);break}else break}function Bo(o){return Hd(o.anchor),Hd(o.focus),o}function Hd(o){for(;o.type==="element";){let t=o.getNode(),e=o.offset,n,r;if(e===t.getChildrenSize()?(n=t.getChildAtIndex(e-1),r=!0):(n=t.getChildAtIndex(e),r=!1),L(n)){o.set(n.__key,r?n.getTextContentSize():0,"text");break}else if(!E(n))break;o.set(n.__key,r?n.getChildrenSize():0,"element")}}var Kh=1;function Uh(){return""+Kh++}function zd(o,t){let e=o._nodes.get(t);return e===void 0&&T(!1,"registeredNode: Type %s not found",t),e}var dC=Array.isArray,Wd=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function qd(o){return F(G(o))}function Ln(o){let t=document.activeElement;if(t===null)return!1;let e=t.nodeName;return F(G(o))&&(e==="INPUT"||e==="TEXTAREA"||t.contentEditable==="true"&&Fo(t)==null)}function jt(o,t,e){let n=o.getRootElement();try{return n!==null&&n.contains(t)&&n.contains(e)&&t!==null&&!Ln(t)&&ci(t)===o}catch{return!1}}function Mn(o){return o instanceof eo}function ci(o){let t=o;for(;t!=null;){let e=Fo(t);if(Mn(e))return e;t=gi(t)}return null}function Fo(o){return o?o.__lexicalEditor:null}function Ye(o){return o.isToken()||o.isSegmented()}function zh(o){return o.nodeType===qe}function wn(o){let t=o;for(;t!=null;){if(zh(t))return t;t=t.firstChild}return null}function Nr(o,t,e){let n=Re[t];if(e!==null&&(o&n)===(e&n))return o;let r=o^n;return t==="subscript"?r&=~Re.superscript:t==="superscript"&&(r&=~Re.subscript),r}function xr(o){return L(o)||ke(o)||F(o)}function Yd(o,t){if(t!=null){__DEV__&&Wh(o,t),o.__key=t;return}ue(),gl();let e=Q(),n=tt(),r=Uh();n._nodeMap.set(r,o),E(o)?e._dirtyElements.set(r,!0):e._dirtyLeaves.add(r),e._cloneNotNeeded.add(r),e._dirtyType=Js,o.__key=r}function Wh(o,t){let e=Oc();if(!e)return;let n=e._nodeMap.get(t);n&&n.constructor!==o.constructor&&(o.constructor.name!==n.constructor.name?T(!1,"Lexical node with constructor %s attempted to re-use key from node in active editor state with constructor %s. Keys must not be re-used when the type is changed.",o.constructor.name,n.constructor.name):T(!1,"Lexical node with constructor %s attempted to re-use key from node in active editor state with different constructor with the same name (possibly due to invalid Hot Module Replacement). Keys must not be re-used when the type is changed.",o.constructor.name))}function qh(o,t,e){let n=o;for(;n!==null;){if(e.has(n))return;let r=t.get(n);if(r===void 0)break;e.set(n,!1),n=r.__parent}}function Gt(o){let t=o.getParent();if(t!==null){let e=o.getWritable(),n=t.getWritable(),r=o.getPreviousSibling(),i=o.getNextSibling();if(r===null)if(i!==null){let s=i.getWritable();n.__first=i.__key,s.__prev=null}else n.__first=null;else{let s=r.getWritable();if(i!==null){let l=i.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;e.__prev=null}if(i===null)if(r!==null){let s=r.getWritable();n.__last=r.__key,s.__next=null}else n.__last=null;else{let s=i.getWritable();if(r!==null){let l=r.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;e.__next=null}n.__size--,e.__parent=null}}function hr(o){gl();let t=o.getLatest(),e=t.__parent,n=tt(),r=Q(),i=n._nodeMap,s=r._dirtyElements;e!==null&&qh(e,i,s);let l=t.__key;r._dirtyType=Js,E(o)?s.set(l,!0):r._dirtyLeaves.add(l)}function Zd(o){let t=o.getPreviousSibling(),e=o.getNextSibling();t!==null&&hr(t),e!==null&&hr(e)}function le(o){ue();let t=Q(),e=t._compositionKey;if(o!==e){if(t._compositionKey=o,e!==null){let n=ee(e);n!==null&&n.getWritable()}if(o!==null){let n=ee(o);n!==null&&n.getWritable()}}}function et(){return ft()?null:Q()._compositionKey}function ee(o,t){let n=(t||tt())._nodeMap.get(o);return n===void 0?null:n}function nl(o,t){let e=Q(),n=o[`__lexicalKey_${e._key}`];return n!==void 0?ee(n,t):null}function G(o,t){let e=o;for(;e!=null;){let n=nl(e,t);if(n!==null)return n;e=gi(e)}return null}function ui(o){let t=o._decorators,e=Object.assign({},t);return o._pendingDecorators=e,e}function ll(o){return o.read(()=>H().getTextContent())}function Vd(o,t){Te(o,()=>{let e=tt();if(e.isEmpty())return;if(t==="root"){H().markDirty();return}let n=e._nodeMap;for(let[,r]of n)r.markDirty()},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function H(){return rl(tt())}function rl(o){return o._nodeMap.get("root")}function Y(o){ue();let t=tt();o!==null&&(__DEV__&&Object.isFrozen(o)&&T(!1,"$setSelection called on frozen selection object. Ensure selection is cloned before passing in."),o.dirty=!0,o.setCachedNodes(null)),t._selection=o}function Xd(){ue();let o=Q();li(o)}function Ho(o){let t=Q(),e=Yh(o,t);if(e===null){let n=t.getRootElement();return o===n?ee("root"):null}return ee(e)}function al(o,t){return t?o.getTextContentSize():0}function Yh(o,t){let e=o;for(;e!=null;){let n=e[`__lexicalKey_${t._key}`];if(n!==void 0)return n;e=gi(e)}return null}function fi(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function Er(o){let t=[],e=o;for(;e!==null;)t.push(e),e=e._parentEditor;return t}function dl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function cl(o){return o.nodeType===qe?o.nodeValue:null}function mi(o,t,e){let n=Le(t._window);if(n===null)return;let r=n.anchorNode,{anchorOffset:i,focusOffset:s}=n;if(r!==null){let l=cl(r),a=G(r);if(l!==null&&L(a)){if(l===Cn&&e){let d=e.length;l=e,i=d,s=d}l!==null&&gr(a,l,i,s,o)}}}function gr(o,t,e,n,r){let i=o;if(i.isAttached()&&(r||!i.isDirty())){let s=i.isComposing(),l=t;(s||r)&&t[t.length-1]===Cn&&(l=t.slice(0,-1));let a=i.getTextContent();if(r||l!==a){if(l===""){if(le(null),!Zt&&!Lt&&!Vt){let h=Q();setTimeout(()=>{h.update(()=>{i.isAttached()&&i.remove()})},20)}else i.remove();return}let d=i.getParent(),u=Ze(),m=i.getTextContentSize(),c=et(),f=i.getKey();if(i.isToken()||c!==null&&f===c&&!s||_(u)&&(d!==null&&!d.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===o.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===o.__key&&u.focus.offset===m&&!i.canInsertTextAfter()&&!s)){i.markDirty();return}let g=C();if(!_(g)||e===null||n===null){i.setTextContent(l);return}if(g.setTextNodeRange(i,e,i,n),i.isSegmented()){let h=i.getTextContent(),N=q(h);i.replace(N),i=N}i.setTextContent(l)}}}function Zh(o){let t=o.getPreviousSibling();return(L(t)||E(t)&&t.isInline())&&!t.canInsertTextAfter()}function jd(o,t){if(t.isSegmented())return!0;if(!o.isCollapsed())return!1;let e=o.anchor.offset,n=t.getParentOrThrow(),r=t.isToken();return e===0?!t.canInsertTextBefore()||!n.canInsertTextBefore()&&!t.isComposing()||r||Zh(t):e===t.getTextContentSize()?!t.canInsertTextAfter()||!n.canInsertTextAfter()&&!t.isComposing()||r:!1}function Gd(o,t,e,n){return o==="Tab"&&!t&&!e&&!n}function Jd(o,t,e,n){return o.toLowerCase()==="b"&&!t&&Tr(e,n)}function Qd(o,t,e,n){return o.toLowerCase()==="i"&&!t&&Tr(e,n)}function ec(o,t,e,n){return o.toLowerCase()==="u"&&!t&&Tr(e,n)}function tc(o,t){return yc(o)&&!t}function oc(o,t){return yc(o)&&t}function nc(o,t){return ze&&t&&o.toLowerCase()==="o"}function rc(o,t,e){return _n(o)&&(ze?t:e)}function ic(o,t,e){return yn(o)&&(ze?t:e)}function sc(o,t){return ze&&t&&_n(o)}function lc(o,t){return ze&&t&&yn(o)}function ac(o,t,e,n){return ze?t||e?!1:_n(o)||o.toLowerCase()==="h"&&n:n||t||e?!1:_n(o)}function dc(o,t,e,n,r){return ze?e||n||r?!1:yn(o)||o.toLowerCase()==="d"&&t:t||n||r?!1:yn(o)}function cc(o,t,e,n){return o.toLowerCase()==="z"&&!t&&Tr(e,n)}function uc(o,t,e,n){return ze?o.toLowerCase()==="z"&&e&&t:o.toLowerCase()==="y"&&n||o.toLowerCase()==="z"&&n&&t}function fc(o,t,e,n){return t?!1:o.toLowerCase()==="c"?ze?e:n:!1}function mc(o,t,e,n){return t?!1:o.toLowerCase()==="x"?ze?e:n:!1}function pc(o){return o==="ArrowLeft"}function gc(o){return o==="ArrowRight"}function Vh(o){return o==="ArrowUp"}function Xh(o){return o==="ArrowDown"}function hc(o,t,e,n){return pc(o)&&!t&&!n&&!e}function Nc(o,t,e,n,r){return pc(o)&&!n&&!e&&(t||r)}function xc(o,t,e,n){return gc(o)&&!t&&!n&&!e}function Ec(o,t,e,n,r){return gc(o)&&!n&&!e&&(t||r)}function Tc(o,t,e){return Vh(o)&&!t&&!e}function Cc(o,t,e){return Xh(o)&&!t&&!e}function bc(o,t,e,n){return o||t||e||n}function _c(o){return o===" "}function Tr(o,t){return ze?o:t}function yc(o){return o==="Enter"}function _n(o){return o==="Backspace"}function Sc(o){return o==="Escape"}function yn(o){return o==="Delete"}function ul(o,t,e){return o.toLowerCase()==="a"&&Tr(t,e)}function fl(){let o=H(),t=o.select(0,o.getChildrenSize());Y(Bo(t))}function xo(o,t){o.__lexicalClassNameCache===void 0&&(o.__lexicalClassNameCache={});let e=o.__lexicalClassNameCache,n=e[t];if(n!==void 0)return n;let r=o[t];if(typeof r=="string"){let i=wt(r);return e[t]=i,i}return r}function pi(o,t,e,n,r){if(e.size===0)return;let i=n.__type,s=n.__key,l=t.get(i);l===void 0&&T(!1,"Type %s not in registeredNodes",i);let a=l.klass,d=o.get(a);d===void 0&&(d=new Map,o.set(a,d));let u=d.get(s),m=u==="destroyed"&&r==="created";(u===void 0||m)&&d.set(s,m?"updated":r)}function Kd(o,t,e){let n=o.getParent(),r=e,i=o;return n!==null&&(t&&e===0?(r=i.getIndexWithinParent(),i=n):!t&&e===i.getChildrenSize()&&(r=i.getIndexWithinParent()+1,i=n)),i.getChildAtIndex(t?r-1:r)}function Jt(o,t){let e=o.offset;if(o.type==="element"){let n=o.getNode();return Kd(n,t,e)}else{let n=o.getNode();if(t&&e===0||!t&&e===n.getTextContentSize()){let r=t?n.getPreviousSibling():n.getNextSibling();return r===null?Kd(n.getParentOrThrow(),t,n.getIndexWithinParent()+(t?0:1)):r}}return null}function di(o){let t=bn(o).event,e=t&&t.inputType;return e==="insertFromPaste"||e==="insertFromPasteAsQuotation"}function O(o,t,e){return hl(o,t,e)}function Cr(o){return!ne(o)&&!o.isLastChild()&&!o.isInline()}function vn(o,t){let e=o._keyToDOMMap.get(t);return e===void 0&&T(!1,"Reconciliation: could not find DOM element for node key %s",t),e}function gi(o){let t=o.assignedSlot||o.parentElement;return t!==null&&t.nodeType===11?t.host:t}function Lc(o,t,e){let n=e.ownerDocument,r=n.defaultView;if(r===null)return;let{top:i,bottom:s}=t,l=0,a=0,d=e;for(;d!==null;){let u=d===n.body;if(u)l=0,a=bn(o).innerHeight;else{let c=d.getBoundingClientRect();l=c.top,a=c.bottom}let m=0;if(ia&&(m=s-a),m!==0)if(u)r.scrollBy(0,m);else{let c=d.scrollTop;d.scrollTop+=m;let f=d.scrollTop-c;i-=f,s-=f}if(u)break;d=gi(d)}}function Mc(o){let t=C();if(!_(t)||!E(o))return t;let{anchor:e,focus:n}=t,r=e.getNode(),i=n.getNode();return Sn(r,o)&&e.set(o.__key,0,"element"),Sn(i,o)&&n.set(o.__key,0,"element"),t}function Sn(o,t){let e=o.getParent();for(;e!==null;){if(e.is(t))return!0;e=e.getParent()}return!1}function wc(o){let t=o.ownerDocument;return t&&t.defaultView||null}function bn(o){let t=o._window;return t===null&&T(!1,"window object not found"),t}function ml(o){let t=o.getParentOrThrow();for(;t!==null;){if(ge(t))return t;t=t.getParentOrThrow()}return t}var cC=Symbol.for("@lexical/ShadowRootNodeBrand");function ge(o){return ne(o)||E(o)&&o.isShadowRoot()}function re(o){let t=Q(),e=o.constructor.getType(),n=t._nodes.get(e);n===void 0&&T(!1,'$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');let r=n.replace;if(r!==null){let i=r(o);return i instanceof o.constructor||T(!1,"$initializeNode failed. Ensure replacement node is a subclass of the original node."),i}return o}function hi(o,t){let e=o.getParent();ne(e)&&!E(t)&&!F(t)&&T(!1,"Only element or decorator nodes can be inserted in to the root node")}function jh(o){let t=o.theme,e=document.createElement("div");e.contentEditable="false",e.setAttribute("data-lexical-cursor","true");let n=t.blockCursor;if(n!==void 0){if(typeof n=="string"){let r=wt(n);n=t.blockCursor=r}n!==void 0&&e.classList.add(...n)}return e}function sl(o){return(F(o)||E(o)&&!o.canBeEmpty())&&!o.isInline()}function br(o,t,e){e.style.removeProperty("caret-color"),t._blockCursorElement=null;let n=o.parentElement;n!==null&&n.removeChild(o)}function vc(o,t,e){let n=o._blockCursorElement;if(_(e)&&e.isCollapsed()&&e.anchor.type==="element"&&t.contains(document.activeElement)){let r=e.anchor,i=r.getNode(),s=r.offset,l=i.getChildrenSize(),a=!1,d=null;if(s===l){let u=i.getChildAtIndex(s-1);sl(u)&&(a=!0)}else{let u=i.getChildAtIndex(s);if(sl(u)){let m=u.getPreviousSibling();(m===null||sl(m))&&(a=!0,d=o.getElementByKey(u.__key))}}if(a){let u=o.getElementByKey(i.__key);n===null&&(o._blockCursorElement=n=jh(o._config)),t.style.caretColor="transparent",d===null?u.appendChild(n):u.insertBefore(n,d);return}}n!==null&&br(n,o,t)}function Le(o){return pe?(o||window).getSelection():null}function Ni(o){return he(o)&&o.tagName==="A"}function he(o){return o.nodeType===1}function Ko(o){let t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return o.nodeName.match(t)!==null}function Eo(o){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return o.nodeName.match(t)!==null}function Uo(o){if(ne(o)||F(o)&&!o.isInline())return!0;if(!E(o)||ge(o))return!1;let t=o.getFirstChild(),e=t===null||ke(t)||L(t)||t.isInline();return!o.isInline()&&o.canBeEmpty()!==!1&&e}function xi(o,t){let e=o;for(;e!==null&&e.getParent()!==null&&!t(e);)e=e.getParentOrThrow();return t(e)?e:null}function pl(){return Q()}var Ud=new WeakMap,Gh=new Map;function Dc(o){if(!o._readOnly&&o.isEmpty())return Gh;T(o._readOnly,"getCachedTypeToNodeMap called with a writable EditorState");let t=Ud.get(o);if(!t){t=new Map,Ud.set(o,t);for(let[e,n]of o._nodeMap){let r=n.__type,i=t.get(r);i||(i=new Map,t.set(r,i)),i.set(e,n)}}return t}function Qt(o){let t=o.constructor,e=t.clone(o);return e.afterCloneFrom(o),__DEV__&&(T(e.__key===o.__key,"$cloneWithProperties: %s.clone(node) (with type '%s') did not return a node with the same key, make sure to specify node.__key as the last argument to the constructor",t.name,t.getType()),T(e.__parent===o.__parent&&e.__next===o.__next&&e.__prev===o.__prev,"$cloneWithProperties: %s.clone(node) (with type '%s') overrided afterCloneFrom but did not call super.afterCloneFrom(prevNode)",t.name,t.getType())),e}function Ac(o,t){let e=o._decorators,r=o._pendingDecorators||e,i=t._nodeMap,s;for(s in r)i.has(s)||(r===e&&(r=ui(o)),delete r[s])}function Rc(o,t,e,n,r,i){let s=o.getFirstChild();for(;s!==null;){let l=s.__key;s.__parent===t&&(E(s)&&Rc(s,l,e,n,r,i),e.has(l)||i.delete(l),r.push(l)),s=s.getNextSibling()}}function kc(o,t,e,n){let r=o._nodeMap,i=t._nodeMap,s=[];for(let[l]of n){let a=i.get(l);a!==void 0&&(a.isAttached()||(E(a)&&Rc(a,l,r,i,s,n),r.has(l)||n.delete(l),s.push(l)))}for(let l of s)i.delete(l);for(let l of e){let a=i.get(l);a!==void 0&&!a.isAttached()&&(r.has(l)||e.delete(l),i.delete(l))}}var fe="",To=null,mt="",to="",Dn,Me,yr,$c=!1,Ti=!1,Ci,xl,El,zo,pt,Tl,Sr;function bi(o,t){let e=zo.get(o);if(t!==null){let n=_l(o);n.parentNode===t&&t.removeChild(n)}if(pt.has(o)||Me._keyToDOMMap.delete(o),E(e)){let n=Ei(e,zo);Cl(n,0,n.length-1,null)}e!==void 0&&pi(Sr,yr,Ci,e,"destroyed")}function Cl(o,t,e,n){let r=t;for(;r<=e;++r){let i=o[r];i!==void 0&&bi(i,n)}}function _i(o,t,e){let n=pt.get(o);n===void 0&&T(!1,"createNode: node does not exist in nodeMap");let r=n.createDOM(Dn,Me);if(rN(o,r,Me),L(n)?r.setAttribute("data-lexical-text","true"):F(n)&&r.setAttribute("data-lexical-decorator","true"),E(n)){let i=n.__size;if(i!==0){let s=i-1,l=Ei(n,pt);bl(l,n,0,s,r,null)}n.isInline()||Pc(null,n,r),Cr(n)&&(fe+=Qe,to+=Qe)}else{let i=n.getTextContent();if(F(n)){let s=n.decorate(Me,Dn);s!==null&&Bc(o,s),r.contentEditable="false"}fe+=i,to+=i}if(t!==null&&!n?.insertDOMIntoParent(r,t))if(e!=null)t.insertBefore(r,e);else{let s=t.__lexicalLineBreak;s!=null?t.insertBefore(r,s):t.appendChild(r)}return __DEV__&&Object.freeze(n),pi(Sr,yr,Ci,n,"created"),r}function bl(o,t,e,n,r,i){let s=fe;fe="";let l=e;for(;l<=n;++l){_i(o[l],r,i);let a=pt.get(o[l]);a!==null&&L(a)&&(To===null&&(To=a.getFormat()),mt===""&&(mt=a.getStyle()))}Cr(t)&&(fe+=Qe),r.__lexicalTextContent=fe,fe=s+fe}function Ic(o,t){let e=t.get(o);return ke(e)||F(e)&&e.isInline()}function Pc(o,t,e){let n=o!==null&&(o.__size===0||Ic(o.__last,zo)),r=t.__size===0||Ic(t.__last,pt);if(n){if(!r){let i=e.__lexicalLineBreak;if(i!=null)try{e.removeChild(i)}catch(s){if(typeof s=="object"&&s!=null){let l=`${s.toString()} Parent: ${e.tagName}, child: ${i.tagName}.`;throw new Error(l)}else throw s}e.__lexicalLineBreak=null}}else if(r){let i=document.createElement("br");e.__lexicalLineBreak=i,e.appendChild(i)}}function Jh(o){Ve(o)&&To!=null&&!Ti&&o.setTextStyle(mt)}function Qh(o){Ve(o)&&mt!==""&&mt!==o.__textStyle&&!Ti&&o.setTextStyle(mt)}function eN(o,t,e){To=null,mt="",tN(o,t,e),Jh(t),Qh(t)}function Ei(o,t){let e=[],n=o.__first;for(;n!==null;){let r=t.get(n);r===void 0&&T(!1,"createChildrenArray: node does not exist in nodeMap"),e.push(n),n=r.__next}return e}function tN(o,t,e){let n=fe,r=o.__size,i=t.__size;if(fe="",r===1&&i===1){let s=o.__first,l=t.__first;if(s===l)_r(s,e);else{let d=_l(s),u=_i(l,null,null);try{e.replaceChild(u,d)}catch(m){if(typeof m=="object"&&m!=null){let c=`${m.toString()} Parent: ${e.tagName}, new child: {tag: ${u.tagName} key: ${l}}, old child: {tag: ${d.tagName}, key: ${s}}.`;throw new Error(c)}else throw m}bi(s,null)}let a=pt.get(l);L(a)&&(To===null&&(To=a.getFormat()),mt===""&&(mt=a.getStyle()))}else{let s=Ei(o,zo),l=Ei(t,pt);if(r===0)i!==0&&bl(l,t,0,i-1,e,null);else if(i===0){if(r!==0){let d=e.__lexicalLineBreak==null;Cl(s,0,r-1,d?null:e),d&&(e.textContent="")}}else nN(t,s,l,r,i,e)}Cr(t)&&(fe+=Qe),e.__lexicalTextContent=fe,fe=n+fe}function _r(o,t){let e=zo.get(o),n=pt.get(o);(e===void 0||n===void 0)&&T(!1,"reconcileNode: prevNode or nextNode does not exist in nodeMap");let r=$c||El.has(o)||xl.has(o),i=vn(Me,o);if(e===n&&!r){if(E(e)){let s=i.__lexicalTextContent;s!==void 0&&(fe+=s,to+=s)}else{let s=e.getTextContent();to+=s,fe+=s}return i}if(e!==n&&r&&pi(Sr,yr,Ci,n,"updated"),n.updateDOM(e,i,Dn)){let s=_i(o,null,null);return t===null&&T(!1,"reconcileNode: parentDOM is null"),t.replaceChild(s,i),bi(o,null),s}if(E(e)&&E(n))r&&(eN(e,n,i),!ne(n)&&!n.isInline()&&Pc(e,n,i)),Cr(n)&&(fe+=Qe,to+=Qe);else{let s=n.getTextContent();if(F(n)){let l=n.decorate(Me,Dn);l!==null&&Bc(o,l)}fe+=s,to+=s}if(!Ti&&ne(n)&&n.__cachedText!==to){let s=n.getWritable();s.__cachedText=to,n=s}return __DEV__&&Object.freeze(n),i}function Bc(o,t){let e=Me._pendingDecorators,n=Me._decorators;if(e===null){if(n[o]===t)return;e=ui(Me)}e[o]=t}function oN(o){return o.firstChild}function Nl(o){let t=o.nextSibling;return t!==null&&t===Me._blockCursorElement&&(t=t.nextSibling),t}function nN(o,t,e,n,r,i){let s=n-1,l=r-1,a,d,u=oN(i),m=0,c=0;for(;m<=s&&c<=l;){let h=t[m],N=e[c];if(h===N)u=Nl(_r(N,i)),m++,c++;else{a===void 0&&(a=new Set(t)),d===void 0&&(d=new Set(e));let x=d.has(h),S=a.has(N);if(!x)u=Nl(_l(h)),bi(h,i),m++;else if(!S)_i(N,i,u),c++;else{let v=vn(Me,N);v===u?u=Nl(_r(N,i)):(u!=null?i.insertBefore(v,u):i.appendChild(v),_r(N,i)),m++,c++}}let b=pt.get(N);b!==null&&L(b)&&(To===null&&(To=b.getFormat()),mt===""&&(mt=b.getStyle()))}let f=m>s,g=c>l;if(f&&!g){let h=e[l+1],N=h===void 0?null:Me.getElementByKey(h);bl(e,o,c,l,i,N)}else g&&!f&&Cl(t,m,s,i)}function Fc(o,t,e,n,r,i){fe="",to="",$c=n===Xt,Me=e,Dn=e._config,yr=e._nodes,Ci=Me._listeners.mutation,xl=r,El=i,zo=o._nodeMap,pt=t._nodeMap,Ti=t._readOnly,Tl=new Map(e._keyToDOMMap);let s=new Map;return Sr=s,_r("root",null),Me=void 0,yr=void 0,xl=void 0,El=void 0,zo=void 0,pt=void 0,Dn=void 0,Tl=void 0,Sr=void 0,s}function rN(o,t,e){let n=e._keyToDOMMap;t["__lexicalKey_"+e._key]=o,n.set(o,t)}function _l(o){let t=Tl.get(o);return t===void 0&&T(!1,"Reconciliation: could not find DOM element for node key %s",o),t}var oo=Object.freeze({}),wl=30,yl=[["keydown",mN],["pointerdown",sN],["compositionstart",uN],["compositionend",fN],["input",cN],["click",iN],["cut",oo],["copy",oo],["dragstart",oo],["dragover",oo],["dragend",oo],["paste",oo],["focus",oo],["blur",oo],["drop",oo]];ho&&yl.push(["beforeinput",(o,t)=>dN(o,t)]);var wr=0,Wc=null,qc=0,On=null,yi=new WeakMap,Sl=!1,Ll=!1,Mr=!1,Lr=!1,Yc=[0,"",0,"root",0];function Zc(o,t,e,n,r){let i=o.anchor,s=o.focus,l=i.getNode(),a=Q(),d=Le(a._window),u=d!==null?d.anchorNode:null,m=i.key,c=a.getElementByKey(m),f=e.length;return m!==s.key||!L(l)||(!r&&(!ho||qc1||(r||!ho)&&c!==null&&!l.isComposing()&&u!==wn(c)||d!==null&&t!==null&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||l.getFormat()!==o.format||l.getStyle()!==o.style||jd(o,l)}function Hc(o,t){return o!==null&&o.nodeValue!==null&&o.nodeType===qe&&t!==0&&t!==o.nodeValue.length}function Kc(o,t,e){let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=o;Sl&&(Sl=!1,Hc(n,r)&&Hc(i,s))||Te(t,()=>{if(!e){Y(null);return}if(!jt(t,n,i))return;let l=C();if(_(l)){let a=l.anchor,d=a.getNode();if(l.isCollapsed()){o.type==="Range"&&o.anchorNode===o.focusNode&&(l.dirty=!0);let u=bn(t).event,m=u?u.timeStamp:performance.now(),[c,f,g,h,N]=Yc,b=H(),x=t.isComposing()===!1&&b.getTextContent()==="";if(m{let e=C(),n=Le(t._window),r=Ze();if(n){if(_(e)){let i=e.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&e.isCollapsed()&&!ne(s)&&H().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&r!==null&&e.is(r))n.removeAllRanges(),e.dirty=!0;else if(o.detail===3&&!e.isCollapsed()){let a=e.focus.getNode();s!==a&&(E(s)?s.select(0):s.getParentOrThrow().select(0))}}else if(o.pointerType==="touch"){let i=n.anchorNode;if(i!==null){let s=i.nodeType;if(s===No||s===qe){let l=vr(r,n,t,o);Y(l)}}}}O(t,Ht,o)})}function sN(o,t){let e=o.target,n=o.pointerType;e instanceof Node&&n!=="touch"&&Te(t,()=>{qd(e)||(Ll=!0)})}function Vc(o){if(!o.getTargetRanges)return null;let t=o.getTargetRanges();return t.length===0?null:t[0]}function lN(o,t){return o!==t||E(o)||E(t)||!o.isToken()||!t.isToken()}function aN(o){return Wc==="MediaLast"&&o{let r=C();if(e==="deleteContentBackward"){if(r===null){let u=Ze();if(!_(u))return;Y(u.clone())}if(_(r)){let u=r.anchor.key===r.focus.key;if(aN(o.timeStamp)&&t.isComposing()&&u){if(le(null),wr=0,setTimeout(()=>{Te(t,()=>{le(null)})},wl),_(r)){let m=r.anchor.getNode();m.markDirty(),T(L(m),"Anchor node must be a TextNode"),r.style=m.getStyle()}}else{le(null),o.preventDefault();let m=r.anchor.getNode().getTextContent(),c=r.anchor.offset===0&&r.focus.offset===m.length;Gs&&u&&!c||O(t,Je,!0)}return}}if(!_(r))return;let i=o.data;On!==null&&mi(!1,t,On),(!r.dirty||On!==null)&&r.isCollapsed()&&!ne(r.anchor.getNode())&&n!==null&&r.applyDOMRange(n),On=null;let s=r.anchor,l=r.focus,a=s.getNode(),d=l.getNode();if(e==="insertText"||e==="insertTranspose"){if(i===` `)o.preventDefault(),O(t,Kt,!1);else if(i===Qe)o.preventDefault(),O(t,Ut,void 0);else if(i==null&&o.dataTransfer){let u=o.dataTransfer.getData("text/plain");o.preventDefault(),r.insertRawText(u)}else i!=null&&Zc(r,n,i,o.timeStamp,!0)?(o.preventDefault(),O(t,ct,i)):On=i;qc=o.timeStamp;return}switch(o.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{O(t,ct,o);break}case"insertFromComposition":{le(null),O(t,ct,o);break}case"insertLineBreak":{le(null),O(t,Kt,!1);break}case"insertParagraph":{le(null),Mr&&!Lt?(Mr=!1,O(t,Kt,!1)):O(t,Ut,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{O(t,ao,o);break}case"deleteByComposition":{lN(a,d)&&O(t,hn,o);break}case"deleteByDrag":case"deleteByCut":{O(t,hn,o);break}case"deleteContent":{O(t,Je,!1);break}case"deleteWordBackward":{O(t,St,!0);break}case"deleteWordForward":{O(t,St,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{O(t,ut,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{O(t,ut,!1);break}case"formatStrikeThrough":{O(t,Ee,"strikethrough");break}case"formatBold":{O(t,Ee,"bold");break}case"formatItalic":{O(t,Ee,"italic");break}case"formatUnderline":{O(t,Ee,"underline");break}case"historyUndo":{O(t,co,void 0);break}case"historyRedo":{O(t,uo,void 0);break}default:}})}function cN(o,t){o.stopPropagation(),Te(t,()=>{let e=C(),n=o.data,r=Vc(o);if(n!=null&&_(e)&&Zc(e,r,n,o.timeStamp,!1)){Lr&&(Ml(t,n),Lr=!1);let s=e.anchor.getNode(),l=Le(t._window);if(l===null)return;let a=e.isBackward(),d=a?e.anchor.offset:e.focus.offset,u=a?e.focus.offset:e.anchor.offset;(!ho||e.isCollapsed()||!L(s)||l.anchorNode===null||s.getTextContent().slice(0,d)+n+s.getTextContent().slice(d+u)!==cl(l.anchorNode))&&O(t,ct,n);let m=n.length;We&&m>1&&o.inputType==="insertCompositionText"&&!t.isComposing()&&(e.anchor.offset-=m),!Zt&&!Lt&&!Vt&&t.isComposing()&&(wr=0,le(null))}else mi(!1,t,n!==null?n:void 0),Lr&&(Ml(t,n||void 0),Lr=!1);Xd()}),On=null}function uN(o,t){Te(t,()=>{let e=C();if(_(e)&&!t.isComposing()){let n=e.anchor,r=e.anchor.getNode();le(n.key),(o.timeStamp{Ml(t,o.data)})}function mN(o,t){if(wr=o.timeStamp,Wc=o.key,t.isComposing())return;let{key:e,shiftKey:n,ctrlKey:r,metaKey:i,altKey:s}=o;if(!O(t,Ks,o)&&e!=null){if(xc(e,r,s,i))O(t,Ro,o);else if(Ec(e,r,n,s,i))O(t,Us,o);else if(hc(e,r,s,i))O(t,ko,o);else if(Nc(e,r,n,s,i))O(t,zs,o);else if(Tc(e,r,i))O(t,zt,o);else if(Cc(e,r,i))O(t,Wt,o);else if(oc(e,n))Mr=!0,O(t,Ue,o);else if(_c(e))O(t,ir,o);else if(nc(e,r))o.preventDefault(),Mr=!0,O(t,Kt,!0);else if(tc(e,n))Mr=!1,O(t,Ue,o);else if(ac(e,s,i,r))_n(e)?O(t,qt,o):(o.preventDefault(),O(t,Je,!0));else if(Sc(e))O(t,Io,o);else if(dc(e,r,n,s,i))yn(e)?O(t,Yt,o):(o.preventDefault(),O(t,Je,!1));else if(rc(e,s,r))o.preventDefault(),O(t,St,!0);else if(ic(e,s,r))o.preventDefault(),O(t,St,!1);else if(sc(e,i))o.preventDefault(),O(t,ut,!0);else if(lc(e,i))o.preventDefault(),O(t,ut,!1);else if(Jd(e,s,i,r))o.preventDefault(),O(t,Ee,"bold");else if(ec(e,s,i,r))o.preventDefault(),O(t,Ee,"underline");else if(Qd(e,s,i,r))o.preventDefault(),O(t,Ee,"italic");else if(Gd(e,s,r,i))O(t,$o,o);else if(cc(e,n,i,r))o.preventDefault(),O(t,co,void 0);else if(uc(e,n,i,r))o.preventDefault(),O(t,uo,void 0);else{let l=t._editorState._selection;we(l)?fc(e,n,i,r)?(o.preventDefault(),O(t,fo,o)):mc(e,n,i,r)?(o.preventDefault(),O(t,mo,o)):ul(e,i,r)&&(o.preventDefault(),O(t,Nn,o)):!We&&ul(e,i,r)&&(o.preventDefault(),O(t,Nn,o))}bc(r,n,s,i)&&O(t,Xs,o)}}function Xc(o){let t=o.__lexicalEventHandles;return t===void 0&&(t=[],o.__lexicalEventHandles=t),t}var An=new Map;function jc(o){let t=o.target,e=t==null?null:t.nodeType===9?t.defaultView:t.ownerDocument.defaultView,n=Le(e);if(n===null)return;let r=ci(n.anchorNode);if(r===null)return;Ll&&(Ll=!1,Te(r,()=>{let u=Ze(),m=n.anchorNode;if(m===null)return;let c=m.nodeType;if(c!==No&&c!==qe)return;let f=vr(u,n,r,o);Y(f)}));let i=Er(r),s=i[i.length-1],l=s._key,a=An.get(l),d=a||s;d!==r&&Kc(n,d,!1),Kc(n,r,!0),r!==s?An.set(l,r):a&&An.delete(l)}function Uc(o){o._lexicalHandled=!0}function zc(o){return o._lexicalHandled===!0}function Gc(o,t){let e=o.ownerDocument,n=yi.get(e);(n===void 0||n<1)&&e.addEventListener("selectionchange",jc),yi.set(e,(n||0)+1),o.__lexicalEditor=t;let r=Xc(o);for(let i=0;i{zc(d)||(Uc(d),(t.isEditable()||s==="click")&&l(d,t))}:d=>{if(zc(d))return;Uc(d);let u=t.isEditable();switch(s){case"cut":return u&&O(t,mo,d);case"copy":return O(t,fo,d);case"paste":return u&&O(t,ao,d);case"dragstart":return u&&O(t,sr,d);case"dragover":return u&&O(t,lr,d);case"dragend":return u&&O(t,qs,d);case"focus":return u&&O(t,ar,d);case"blur":return u&&O(t,Vs,d);case"drop":return u&&O(t,Po,d)}};o.addEventListener(s,a),r.push(()=>{o.removeEventListener(s,a)})}}function Jc(o){let t=o.ownerDocument,e=yi.get(t);T(e!==void 0,"Root element not registered");let n=e-1;T(n>=0,"Root element count less than 0"),yi.set(t,n),n===0&&t.removeEventListener("selectionchange",jc);let r=Fo(o);Mn(r)?(pN(r),o.__lexicalEditor=null):r&&T(!1,"Attempted to remove event handlers from a node that does not belong to this build of Lexical");let i=Xc(o);for(let s=0;si.__key===this.__key);if(L(this))return n;if(_(e)&&e.anchor.type==="element"&&e.focus.type==="element"){if(e.isCollapsed())return!1;let i=this.getParent();if(F(this)&&this.isInline()&&i){let s=e.isBackward()?e.focus:e.anchor,l=s.getNode();if(s.offset===l.getChildrenSize()&&l.is(i)&&l.getLastChildOrThrow().is(this))return!1}}return n}shouldSelectDirectly(){return!1}getKey(){return this.__key}getIndexWithinParent(){let t=this.getParent();if(t===null)return-1;let e=t.getFirstChild(),n=0;for(;e!==null;){if(this.is(e))return n;n++,e=e.getNextSibling()}return-1}getParent(){let t=this.getLatest().__parent;return t===null?null:ee(t)}getParentOrThrow(){let t=this.getParent();return t===null&&T(!1,"Expected node %s to have a parent.",this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){let e=t.getParent();if(ge(e))return T(E(t)||t===this&&F(t),"Children of root nodes must be elements or decorators"),t;t=e}return null}getTopLevelElementOrThrow(){let t=this.getTopLevelElement();return t===null&&T(!1,"Expected node %s to have a top parent element.",this.__key),t}getParents(){let t=[],e=this.getParent();for(;e!==null;)t.push(e),e=e.getParent();return t}getParentKeys(){let t=[],e=this.getParent();for(;e!==null;)t.push(e.__key),e=e.getParent();return t}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:ee(e)}getPreviousSiblings(){let t=[],e=this.getParent();if(e===null)return t;let n=e.getFirstChild();for(;n!==null&&!n.is(this);)t.push(n),n=n.getNextSibling();return t}getNextSibling(){let e=this.getLatest().__next;return e===null?null:ee(e)}getNextSiblings(){let t=[],e=this.getNextSibling();for(;e!==null;)t.push(e),e=e.getNextSibling();return t}getCommonAncestor(t){let e=this.getParents(),n=t.getParents();E(this)&&e.unshift(this),E(t)&&n.unshift(t);let r=e.length,i=n.length;if(r===0||i===0||e[r-1]!==n[i-1])return null;let s=new Set(n);for(let l=0;l{l.append(h)})),_(n)){Y(n);let h=n.anchor,N=n.focus;h.key===i&&Dl(h,l),N.key===i&&Dl(N,l)}return et()===i&&le(s),l}insertAfter(t,e=!0){ue(),hi(this,t);let n=this.getWritable(),r=t.getWritable(),i=r.getParent(),s=C(),l=!1,a=!1;if(i!==null){let f=t.getIndexWithinParent();if(Gt(r),_(s)){let g=i.__key,h=s.anchor,N=s.focus;l=h.type==="element"&&h.key===g&&h.offset===f+1,a=N.type==="element"&&N.key===g&&N.offset===f+1}}let d=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),m=r.__key,c=n.__next;if(d===null)u.__last=m;else{let f=d.getWritable();f.__prev=m}if(u.__size++,n.__next=m,r.__next=c,r.__prev=n.__key,r.__parent=n.__parent,e&&_(s)){let f=this.getIndexWithinParent();Rn(s,u,f+1);let g=u.__key;l&&s.anchor.set(g,f+2,"element"),a&&s.focus.set(g,f+2,"element")}return t}insertBefore(t,e=!0){ue(),hi(this,t);let n=this.getWritable(),r=t.getWritable(),i=r.__key;Gt(r);let s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=n.__prev,d=this.getIndexWithinParent();if(s===null)l.__first=i;else{let m=s.getWritable();m.__next=i}l.__size++,n.__prev=i,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;let u=C();if(e&&_(u)){let m=this.getParentOrThrow();Rn(u,m,d)}return t}isParentRequired(){return!1}createParentElementNode(){return I()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,e){ue();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(n===null)return r.select(0,0);if(E(n))return n.select();if(!L(n)){let i=n.getIndexWithinParent()+1;return r.select(i,i)}return n.select(t,e)}selectNext(t,e){ue();let n=this.getNextSibling(),r=this.getParentOrThrow();if(n===null)return r.select();if(E(n))return n.select(0,0);if(!L(n)){let i=n.getIndexWithinParent();return r.select(i,i)}return n.select(t,e)}markDirty(){this.getWritable()}insertDOMIntoParent(t,e){return!1}};p(gt,"importDOM");function gN(o,t){let e=Q()._nodes.get(o);e===void 0&&T(!1,"Create node: Attempted to create node %s that was not configured to be used on the editor.",t.name);let n=e.klass;n!==t&&T(!1,"Create node: Type %s in node %s does not match registered node %s with the same type",o,t.name,n.name)}function tu(o,t,e){let n=e||t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||T(!1,"insertRangeAfter: lastToInsert must be a later sibling of firstToInsert"),r=r.getNextSibling(),i.push(r);let s=o;for(let l of i)s=s.insertAfter(l)}var Wo=class o extends gt{static getType(){return"linebreak"}static clone(t){return new o(t.__key)}constructor(t){super(t)}getTextContent(){return` -`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:t=>NN(t)||xN(t)?null:{conversion:hN,priority:0}}}static importJSON(t){return ht()}exportJSON(){return{type:"linebreak",version:1}}};function hN(o){return{node:ht()}}function ht(){return re(new Wo)}function ke(o){return o instanceof Wo}function NN(o){let t=o.parentElement;if(t!==null&&Eo(t)){let e=t.firstChild;if(e===o||e.nextSibling===o&&Si(e)){let n=t.lastChild;if(n===o||n.previousSibling===o&&Si(n))return!0}}return!1}function xN(o){let t=o.parentElement;if(t!==null&&Eo(t)){let e=t.firstChild;if(e===o||e.nextSibling===o&&Si(e))return!1;let n=t.lastChild;if(n===o||n.previousSibling===o&&Si(n))return!0}return!1}function Si(o){return o.nodeType===qe&&/^( |\t|\r?\n)+$/.test(o.textContent||"")}function Ol(o,t){return t&ur?"code":t&pr?"mark":t&fr?"sub":t&mr?"sup":null}function Al(o,t){return t&dr?"strong":t&cr?"em":"span"}function iu(o,t,e,n,r){let i=n.classList,s=xo(r,"base");s!==void 0&&i.add(...s),s=xo(r,"underlineStrikethrough");let l=!1,a=t&En&&t&xn,d=e&En&&e&xn;s!==void 0&&(d?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(let u in Re){let c=Re[u];if(s=xo(r,u),s!==void 0)if(e&c){if(l&&(u==="underline"||u==="strikethrough")){t&c&&i.remove(...s);continue}((t&c)===0||a&&u==="underline"||u==="strikethrough")&&i.add(...s)}else t&c&&i.remove(...s)}}function EN(o,t){let e=o.length,n=t.length,r=0,i=0;for(;r({conversion:yN,priority:0}),b:()=>({conversion:CN,priority:0}),code:()=>({conversion:Co,priority:0}),em:()=>({conversion:Co,priority:0}),i:()=>({conversion:Co,priority:0}),s:()=>({conversion:Co,priority:0}),span:()=>({conversion:TN,priority:0}),strong:()=>({conversion:Co,priority:0}),sub:()=>({conversion:Co,priority:0}),sup:()=>({conversion:Co,priority:0}),u:()=>({conversion:Co,priority:0})}}static importJSON(e){let n=q(e.text);return n.setFormat(e.format),n.setDetail(e.detail),n.setMode(e.mode),n.setStyle(e.style),n}exportDOM(e){let{element:n}=super.exportDOM(e),r=(n?.nodeName||"").toLowerCase();T(n!==null&&he(n),"Expected TextNode createDOM to always return a HTMLElement");let i=this.getTextContent();/^\s|\s$/.test(i)&&(n.style.whiteSpace="pre-wrap");for(let s of Array.from(n.classList.values()))s.startsWith("editor-theme-")&&n.classList.remove(s);return n.classList.length===0&&n.removeAttribute("class"),n.nodeName==="SPAN"&&!n.getAttribute("style")&&(n=document.createTextNode(i)),this.hasFormat("bold")&&r!=="strong"&&(n=Li(n,"strong")),this.hasFormat("italic")&&(n=Li(n,"em")),this.hasFormat("strikethrough")&&(n=Li(n,"s")),this.hasFormat("underline")&&(n=Li(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,n){}setFormat(e){let n=this.getWritable();return n.__format=typeof e=="string"?Re[e]:e,n}setDetail(e){let n=this.getWritable();return n.__detail=typeof e=="string"?Rd[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){let n=this.getFormat(),r=Nr(n,e,null);return this.setFormat(r)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=si,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=Tn,e}setMode(e){let n=kd[e];if(this.__mode===n)return this;let r=this.getWritable();return r.__mode=n,r}setTextContent(e){if(this.__text===e)return this;let n=this.getWritable();return n.__text=e,n}select(e,n){ue();let r=e,i=n,s=C(),l=this.getTextContent(),a=this.__key;if(typeof l=="string"){let d=l.length;r===void 0&&(r=d),i===void 0&&(i=d)}else r=0,i=0;if(_(s)){let d=et();(d===s.anchor.key||d===s.focus.key)&&le(a),s.setTextNodeRange(this,r,this,i)}else return Mi(a,r,a,i,"text","text");return s}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,n,r,i){let s=this.getWritable(),l=s.__text,a=r.length,d=e;d<0&&(d=a+d,d<0&&(d=0));let u=C();if(i&&_(u)){let c=e+a;u.setTextNodeRange(s,c,s,c)}let m=l.slice(0,d)+r+l.slice(d+n);return s.__text=m,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ue();let n=this.getLatest(),r=n.getTextContent(),i=n.__key,s=et(),l=new Set(e),a=[],d=r.length,u="";for(let R=0;RM&&se.offset<=j&&(se.key=k,se.offset-=M,S.dirty=!0),He.key===i&&He.type==="text"&&He.offset>M&&He.offset<=j&&(He.key=k,He.offset-=M,S.dirty=!0)}s===i&&le(k),M=j,v.push(B)}if(f!==null){Zd(this);let R=f.getWritable(),A=this.getIndexWithinParent();x?(R.splice(A,0,v),this.remove()):R.splice(A,1,v),_(S)&&Rn(S,f,A,m-1)}return v}mergeWithSibling(e){let n=e===this.getPreviousSibling();!n&&e!==this.getNextSibling()&&T(!1,"mergeWithSibling: sibling must be a previous or next sibling");let r=this.__key,i=e.__key,s=this.__text,l=s.length;et()===i&&le(r);let d=C();if(_(d)){let f=d.anchor,g=d.focus;f!==null&&f.key===i&&(Rl(f,n,r,e,l),d.dirty=!0),g!==null&&g.key===i&&(Rl(g,n,r,e,l),d.dirty=!0)}let u=e.__text,m=n?u+s:s+u;this.setTextContent(m);let c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}};function TN(o){let e=o.style;return{forChild:kl(e),node:null}}function CN(o){let t=o,e=t.style.fontWeight==="normal";return{forChild:kl(t.style,e?void 0:"bold"),node:null}}var nu=new WeakMap;function bN(o){return o.nodeName==="PRE"||o.nodeType===No&&o.style!==void 0&&o.style.whiteSpace!==void 0&&o.style.whiteSpace.startsWith("pre")}function _N(o){let t,e=o.parentNode,n=[o];for(;e!==null&&(t=nu.get(e))===void 0&&!bN(e);)n.push(e),e=e.parentNode;let r=t===void 0?e:t;for(let i=0;iNN(t)||xN(t)?null:{conversion:hN,priority:0}}}static importJSON(t){return ht()}exportJSON(){return{type:"linebreak",version:1}}};function hN(o){return{node:ht()}}function ht(){return re(new Wo)}function ke(o){return o instanceof Wo}function NN(o){let t=o.parentElement;if(t!==null&&Eo(t)){let e=t.firstChild;if(e===o||e.nextSibling===o&&Si(e)){let n=t.lastChild;if(n===o||n.previousSibling===o&&Si(n))return!0}}return!1}function xN(o){let t=o.parentElement;if(t!==null&&Eo(t)){let e=t.firstChild;if(e===o||e.nextSibling===o&&Si(e))return!1;let n=t.lastChild;if(n===o||n.previousSibling===o&&Si(n))return!0}return!1}function Si(o){return o.nodeType===qe&&/^( |\t|\r?\n)+$/.test(o.textContent||"")}function Ol(o,t){return t&ur?"code":t&pr?"mark":t&fr?"sub":t&mr?"sup":null}function Al(o,t){return t&dr?"strong":t&cr?"em":"span"}function iu(o,t,e,n,r){let i=n.classList,s=xo(r,"base");s!==void 0&&i.add(...s),s=xo(r,"underlineStrikethrough");let l=!1,a=t&En&&t&xn,d=e&En&&e&xn;s!==void 0&&(d?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(let u in Re){let c=Re[u];if(s=xo(r,u),s!==void 0)if(e&c){if(l&&(u==="underline"||u==="strikethrough")){t&c&&i.remove(...s);continue}((t&c)===0||a&&u==="underline"||u==="strikethrough")&&i.add(...s)}else t&c&&i.remove(...s)}}function EN(o,t){let e=o.length,n=t.length,r=0,i=0;for(;r({conversion:yN,priority:0}),b:()=>({conversion:CN,priority:0}),code:()=>({conversion:Co,priority:0}),em:()=>({conversion:Co,priority:0}),i:()=>({conversion:Co,priority:0}),s:()=>({conversion:Co,priority:0}),span:()=>({conversion:TN,priority:0}),strong:()=>({conversion:Co,priority:0}),sub:()=>({conversion:Co,priority:0}),sup:()=>({conversion:Co,priority:0}),u:()=>({conversion:Co,priority:0})}}static importJSON(e){let n=q(e.text);return n.setFormat(e.format),n.setDetail(e.detail),n.setMode(e.mode),n.setStyle(e.style),n}exportDOM(e){let{element:n}=super.exportDOM(e),r=(n?.nodeName||"").toLowerCase();T(n!==null&&he(n),"Expected TextNode createDOM to always return a HTMLElement");let i=this.getTextContent();/^\s|\s$/.test(i)&&(n.style.whiteSpace="pre-wrap");for(let s of Array.from(n.classList.values()))s.startsWith("editor-theme-")&&n.classList.remove(s);return n.classList.length===0&&n.removeAttribute("class"),n.nodeName==="SPAN"&&!n.getAttribute("style")&&(n=document.createTextNode(i)),this.hasFormat("bold")&&r!=="strong"&&(n=Li(n,"strong")),this.hasFormat("italic")&&(n=Li(n,"em")),this.hasFormat("strikethrough")&&(n=Li(n,"s")),this.hasFormat("underline")&&(n=Li(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,n){}setFormat(e){let n=this.getWritable();return n.__format=typeof e=="string"?Re[e]:e,n}setDetail(e){let n=this.getWritable();return n.__detail=typeof e=="string"?Rd[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){let n=this.getFormat(),r=Nr(n,e,null);return this.setFormat(r)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=si,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=Tn,e}setMode(e){let n=kd[e];if(this.__mode===n)return this;let r=this.getWritable();return r.__mode=n,r}setTextContent(e){if(this.__text===e)return this;let n=this.getWritable();return n.__text=e,n}select(e,n){ue();let r=e,i=n,s=C(),l=this.getTextContent(),a=this.__key;if(typeof l=="string"){let d=l.length;r===void 0&&(r=d),i===void 0&&(i=d)}else r=0,i=0;if(_(s)){let d=et();(d===s.anchor.key||d===s.focus.key)&&le(a),s.setTextNodeRange(this,r,this,i)}else return Mi(a,r,a,i,"text","text");return s}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,n,r,i){let s=this.getWritable(),l=s.__text,a=r.length,d=e;d<0&&(d=a+d,d<0&&(d=0));let u=C();if(i&&_(u)){let c=e+a;u.setTextNodeRange(s,c,s,c)}let m=l.slice(0,d)+r+l.slice(d+n);return s.__text=m,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ue();let n=this.getLatest(),r=n.getTextContent(),i=n.__key,s=et(),l=new Set(e),a=[],d=r.length,u="";for(let R=0;RM&&se.offset<=Z&&(se.key=k,se.offset-=M,S.dirty=!0),He.key===i&&He.type==="text"&&He.offset>M&&He.offset<=Z&&(He.key=k,He.offset-=M,S.dirty=!0)}s===i&&le(k),M=Z,v.push(B)}if(f!==null){Zd(this);let R=f.getWritable(),A=this.getIndexWithinParent();x?(R.splice(A,0,v),this.remove()):R.splice(A,1,v),_(S)&&Rn(S,f,A,m-1)}return v}mergeWithSibling(e){let n=e===this.getPreviousSibling();!n&&e!==this.getNextSibling()&&T(!1,"mergeWithSibling: sibling must be a previous or next sibling");let r=this.__key,i=e.__key,s=this.__text,l=s.length;et()===i&&le(r);let d=C();if(_(d)){let f=d.anchor,g=d.focus;f!==null&&f.key===i&&(Rl(f,n,r,e,l),d.dirty=!0),g!==null&&g.key===i&&(Rl(g,n,r,e,l),d.dirty=!0)}let u=e.__text,m=n?u+s:s+u;this.setTextContent(m);let c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}};function TN(o){let e=o.style;return{forChild:kl(e),node:null}}function CN(o){let t=o,e=t.style.fontWeight==="normal";return{forChild:kl(t.style,e?void 0:"bold"),node:null}}var nu=new WeakMap;function bN(o){return o.nodeName==="PRE"||o.nodeType===No&&o.style!==void 0&&o.style.whiteSpace!==void 0&&o.style.whiteSpace.startsWith("pre")}function _N(o){let t,e=o.parentNode,n=[o];for(;e!==null&&(t=nu.get(e))===void 0&&!bN(e);)n.push(e),e=e.parentNode;let r=t===void 0?e:t;for(let i=0;i0){/[ \t\n]$/.test(s)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=t,i=!0;for(;r!==null&&(r=ru(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:q(n)}}function ru(o,t){let e=o;for(;;){let n;for(;(n=t?e.nextSibling:e.previousSibling)===null;){let i=e.parentElement;if(i===null)return null;e=i}if(e=n,e.nodeType===No){let i=e.style.display;if(i===""&&!Ko(e)||i!==""&&!i.startsWith("inline"))return null}let r=e;for(;(r=t?e.firstChild:e.lastChild)!==null;)e=r;if(e.nodeType===qe)return e;if(e.nodeName==="BR")return null}}var SN={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Co(o){let t=SN[o.nodeName.toLowerCase()];return t==="code"&&o.closest("pre")?{node:null}:t===void 0?{node:null}:{forChild:kl(o.style,t),node:null}}function q(o=""){return re(new nt(o))}function L(o){return o instanceof nt}function kl(o,t){let e=o.fontWeight,n=o.textDecoration.split(" "),r=e==="700"||e==="bold",i=n.includes("line-through"),s=o.fontStyle==="italic",l=n.includes("underline"),a=o.verticalAlign,d=o.color,u=o.backgroundColor;return m=>{if(!L(m))return m;r&&!m.hasFormat("bold")&&m.toggleFormat("bold"),i&&!m.hasFormat("strikethrough")&&m.toggleFormat("strikethrough"),s&&!m.hasFormat("italic")&&m.toggleFormat("italic"),l&&!m.hasFormat("underline")&&m.toggleFormat("underline"),a==="sub"&&!m.hasFormat("subscript")&&m.toggleFormat("subscript"),a==="super"&&!m.hasFormat("superscript")&&m.toggleFormat("superscript");let c=m.getStyle();return d&&(c+=`color: ${d};`),u&&u!=="transparent"&&(c+=`background-color: ${u};`),c&&m.setStyle(c),t&&!m.hasFormat(t)&&m.toggleFormat(t),m}}var qo=class o extends nt{static getType(){return"tab"}static clone(t){return new o(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text}constructor(t){super(" ",t),this.__detail=Tn}static importDOM(){return null}static importJSON(t){let e=vt();return e.setFormat(t.format),e.setStyle(t.style),e}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(t){T(!1,"TabNode does not support setTextContent")}setDetail(t){T(!1,"TabNode does not support setDetail")}setMode(t){T(!1,"TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function vt(){return re(new qo)}function Il(o){return o instanceof qo}function Dt(...o){return()=>{for(let t=o.length-1;t>=0;t--)o[t]();o.length=0}}var In=new Map;function $l(o){let t={},e=o.split(";");for(let n of e)if(n!==""){let[r,i]=n.split(/:([^]+)/);r&&i&&(t[r.trim()]=i.trim())}return t}function $n(o){let t=In.get(o);return t===void 0&&(t=$l(o),In.set(o,t)),__DEV__&&Object.freeze(t),t}function lu(o){let t="";for(let e in o)e&&(t+=`${e}: ${o[e]};`);return t}function Dr(o,t){let e=o.getStartEndPoints();if(t.isSelected(o)&&!t.isSegmented()&&!t.isToken()&&e!==null){let[n,r]=e,i=o.isBackward(),s=n.getNode(),l=r.getNode(),a=t.is(s),d=t.is(l);if(a||d){let[u,m]=Or(o),c=s.is(l),f=t.is(i?l:s),g=t.is(i?s:l),h=0,N;if(c)h=u>m?m:u,N=u>m?u:m;else if(f)h=i?m:u,N=void 0;else if(g){let b=i?u:m;h=0,N=b}return t.__text=t.__text.slice(h,N),t}}return t}function Pl(o){let t=o.getStyle(),e=$l(t);In.set(t,e)}function Pn(o,t){let e=$n("getStyle"in o?o.getStyle():o.style),n=Object.entries(t).reduce((i,[s,l])=>(typeof l=="function"?i[s]=l(e[s],o):l===null?delete i[s]:i[s]=l,i),{...e}),r=lu(n);o.setStyle(r),In.set(r,n)}function Bl(o,t){let e=o.getNodes(),n=e.length,r=o.getStartEndPoints();if(r===null)return;let[i,s]=r,l=n-1,a=e[0],d=e[l];if(o.isCollapsed()&&_(o)){Pn(o,t);return}let m=a.getTextContent().length,c=s.offset,f=i.offset,g=i.isBefore(s),h=g?f:c,N=g?c:f,b=g?i.type:s.type,x=g?s.type:i.type,S=g?s.key:i.key;if(L(a)&&h===m){let v=a.getNextSibling();L(v)&&(f=0,h=0,a=v)}if(e.length===1){if(L(a)&&a.canHaveFormat()){if(h=b==="element"?0:f>c?c:f,N=x==="element"?m:f>c?f:c,h===N)return;if(Ye(a)||h===0&&N===m)Pn(a,t),a.select(h,N);else{let v=a.splitText(h,N),M=h===0?v[0]:v[1];Pn(M,t),M.select(0,N-h)}}}else{if(L(a)&&h0&&o.classList.add(...e)}function Oi(o,...t){let e=wt(...t);e.length>0&&o.classList.remove(...e)}function fu(o,t){let e=o;for(;e!=null;){if(e instanceof t)return e;e=e.getParent()}return null}function mu(o){let t=U(o,e=>E(e)&&!e.isInline());return E(t)||T(!1,"Expected node %s to have closest block element node.",o.__key),t}var U=(o,t)=>{let e=o;for(;e!==H()&&e!=null;){if(t(e))return e;e=e.getParent()}return null};function Nt(o,t){return o!==null?Object.getPrototypeOf(o).constructor.name===t.name:!1}function Ai(o,t){let e=t.body?t.body.childNodes:[],n=[],r=[];for(let i=0;i"u"||typeof window>"u"&&typeof global.window>"u")throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let e=document.createElement("div"),r=H().getChildren();for(let s=0;s{let g=new bo;return e.push(g),g}):c=pu(o,c,I)),l==null?c.length>0?s=s.concat(c):Eo(o)&&RN(o)&&(s=s.concat(ht())):E(l)&&l.append(...c),s}function pu(o,t,e){let n=[],r=[];for(let i=0;i{if(L(t)){let e=I();return e.append(t),e}return t})}function _o(o,t){let e=xu(t),n=Ai(o,e);return kN(n)}function Ot(o,t){for(let e of o.getParents())if(t(e))return e;return null}function Kl(o,t){t||(t=H());let e=[];for(let n of t.getChildren())o(n)&&e.push(n),E(n)&&e.push(...Kl(o,n));return e}function Cu(o,t,e){let n=H().getChildren();for(let r of n){let i=o.getElementByKey(r.__key);if(!i)continue;let s=i.getBoundingClientRect();if(e<=s.bottom)return r}return null}function yo(o){let t=e=>(E(e)||F(e))&&!e.isInline()&&!ne(e);return t(o)?o:U(o,t)}function bu(o){let t=[],e=i=>{for(let s of i.getChildren())t.push(s.getKey()),E(s)&&e(s)},n=H();e(n);let r=Array.from(o);return r.sort((i,s)=>{let l=t.indexOf(i.getKey()),a=t.indexOf(s.getKey());return l-a}),r}function Ar(o,t){let e=yo(o)||o,n=t?e.getNextSibling():e.getPreviousSibling();return n||(n=I(),t?e.insertAfter(n):e.insertBefore(n)),t?n.selectStart():n.selectEnd()}function Rr(o){return"__alignment"in o}function _u(o){return"__inset"in o}var yu=new WeakMap;function ae(o){return yu.get(o)||null}function Su(o,t){yu.set(o,t)}function de(o,t){return Z(o,t)!==null}function Z(o,t){if(!o)return null;for(let e of o.getNodes()){if(t(e))return e;let n=Ot(e,t);if(n)return n}return null}function Lu(o){return Z(o,L)}function Mu(o,t){if(!o)return!1;let e=o.getNodes();for(let n of e)if(L(n)&&n.hasFormat(t))return!0;return!!(e.length===1&&Ve(e[0])&&e[0].hasTextFormat(t))}function Fn(o,t){let e=C(),n=e?mu(e.getNodes()[0]):null;e&&o(n)?wi(e,I):wi(e,t)}function Vo(o,t=!0){Ul([o],t)}function Ul(o,t=!0){let e=C()?.getNodes()||[],n=e.length>0?yo(e[0]):null;if(n)if(t)for(let r=o.length-1;r>=0;r--)n.insertAfter(o[r]);else for(let r of o)n.insertBefore(r);else H().append(...o)}function rt(o){let t=jo();t.add(o.getKey()),Y(t)}function wu(o){for(let t of o){if(L(t))return t;if(E(t)){let e=t.getChildren(),n=wu(e);if(n!==null)return n}}return null}function vu(o){let t=[...o].reverse();for(let e of t){if(L(e))return e;if(E(e)){let n=[...e.getChildren()].reverse(),r=vu(n);if(r!==null)return r}}return null}function Du(o){if(o.length===0)return;let t=Xo(),e=wu(o),n=vu(o);e&&n&&(t.setTextNodeRange(e,0,n,n.getTextContentSize()||0),Y(t))}function Ou(o){let t=ae(o);t&&window.requestAnimationFrame(()=>{o.update(()=>{Y(t.clone())})})}function ki(o,t){if(!o)return!1;let e=t.getKey();for(let n of o.getNodes())if(n.getKey()===e)return!0;return!1}function kr(o,t){let e=[...o?.getNodes()||[],...At(o)];for(let n of e)if(Rr(n)&&n.getAlignment()===t)return!0;return!1}function zl(o,t){let e=[...o?.getNodes()||[],...At(o)];for(let n of e)if(Yo(n)&&n.getDirection()===t)return!0;return!1}function At(o){if(!o)return[];let t=new Map;for(let e of o.getNodes()){let n=yo(e);E(n)&&t.set(n.getKey(),n)}return Array.from(t.values())}var Yl=class{constructor(t,e,n){p(this,"key");p(this,"offset");p(this,"type");p(this,"_selection");this._selection=null,this.key=t,this.offset=e,this.type=n}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){let e=this.getNode(),n=t.getNode(),r=this.offset,i=t.offset;if(E(e)){let s=e.getDescendantByIndex(r);e=s??e}if(E(n)){let s=n.getDescendantByIndex(i);n=s??n}return e===n?ri&&(n=i)}else if(!E(t)){let i=t.getNextSibling();if(L(i))e=i.__key,n=0,r="text";else{let s=t.getParent();s&&(e=s.__key,n=t.getIndexWithinParent()+1)}}o.set(e,n,r)}function Dl(o,t){if(E(t)){let e=t.getLastDescendant();E(e)||L(e)?Wl(o,e):Wl(o,t)}else Wl(o,t)}function IN(o,t,e,n){let r=o.getNode(),i=r.getChildAtIndex(o.offset),s=q(),l=ne(r)?I().append(s):s;s.setFormat(e),s.setStyle(n),i===null?r.append(l):i.insertBefore(l),o.is(t)&&t.set(s.__key,0,"text"),o.set(s.__key,0,"text")}function So(o,t,e,n){o.key=t,o.offset=e,o.type=n}var Ii=class o{constructor(t){p(this,"_nodes");p(this,"_cachedNodes");p(this,"dirty");this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!we(t))return!1;let e=this._nodes,n=t._nodes;return e.size===n.size&&Array.from(e).every(r=>n.has(r))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new o(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){let e=this.getNodes(),n=e.length,r=e[n-1],i;if(L(r))i=r.select();else{let s=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(s,s)}i.insertNodes(t);for(let s=0;s0&&!l.shouldSelectDirectly()?m=[]:m=[l]:m=l.getNodesBetween(a),ft()||(this._cachedNodes=m),m}setTextNodeRange(t,e,n,r){So(this.anchor,t.__key,e,"text"),So(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let t=this.getNodes();if(t.length===0)return"";let e=t[0],n=t[t.length-1],r=this.anchor,i=this.focus,s=r.isBefore(i),[l,a]=Or(this),d="",u=!0;for(let m=0;m{let g=new bo;return e.push(g),g}):c=pu(o,c,I)),l==null?c.length>0?s=s.concat(c):Eo(o)&&RN(o)&&(s=s.concat(ht())):E(l)&&l.append(...c),s}function pu(o,t,e){let n=[],r=[];for(let i=0;i{if(L(t)){let e=I();return e.append(t),e}return t})}function _o(o,t){let e=xu(t),n=Ai(o,e);return kN(n)}function Ot(o,t){for(let e of o.getParents())if(t(e))return e;return null}function Kl(o,t){t||(t=H());let e=[];for(let n of t.getChildren())o(n)&&e.push(n),E(n)&&e.push(...Kl(o,n));return e}function Cu(o,t,e){let n=H().getChildren();for(let r of n){let i=o.getElementByKey(r.__key);if(!i)continue;let s=i.getBoundingClientRect();if(e<=s.bottom)return r}return null}function yo(o){let t=e=>(E(e)||F(e))&&!e.isInline()&&!ne(e);return t(o)?o:U(o,t)}function bu(o){let t=[],e=i=>{for(let s of i.getChildren())t.push(s.getKey()),E(s)&&e(s)},n=H();e(n);let r=Array.from(o);return r.sort((i,s)=>{let l=t.indexOf(i.getKey()),a=t.indexOf(s.getKey());return l-a}),r}function Ar(o,t){let e=yo(o)||o,n=t?e.getNextSibling():e.getPreviousSibling();return n||(n=I(),t?e.insertAfter(n):e.insertBefore(n)),t?n.selectStart():n.selectEnd()}function Rr(o){return"__alignment"in o}function _u(o){return"__inset"in o}var yu=new WeakMap;function ae(o){return yu.get(o)||null}function Su(o,t){yu.set(o,t)}function de(o,t){return V(o,t)!==null}function V(o,t){if(!o)return null;for(let e of o.getNodes()){if(t(e))return e;let n=Ot(e,t);if(n)return n}return null}function Lu(o){return V(o,L)}function Mu(o,t){if(!o)return!1;let e=o.getNodes();for(let n of e)if(L(n)&&n.hasFormat(t))return!0;return!!(e.length===1&&Ve(e[0])&&e[0].hasTextFormat(t))}function Fn(o,t){let e=C(),n=e?mu(e.getNodes()[0]):null;e&&o(n)?wi(e,I):wi(e,t)}function Vo(o,t=!0){Ul([o],t)}function Ul(o,t=!0){let e=C()?.getNodes()||[],n=e.length>0?yo(e[0]):null;if(n)if(t)for(let r=o.length-1;r>=0;r--)n.insertAfter(o[r]);else for(let r of o)n.insertBefore(r);else H().append(...o)}function rt(o){let t=jo();t.add(o.getKey()),Y(t)}function wu(o){for(let t of o){if(L(t))return t;if(E(t)){let e=t.getChildren(),n=wu(e);if(n!==null)return n}}return null}function vu(o){let t=[...o].reverse();for(let e of t){if(L(e))return e;if(E(e)){let n=[...e.getChildren()].reverse(),r=vu(n);if(r!==null)return r}}return null}function Du(o){if(o.length===0)return;let t=Xo(),e=wu(o),n=vu(o);e&&n&&(t.setTextNodeRange(e,0,n,n.getTextContentSize()||0),Y(t))}function Ou(o){let t=ae(o);t&&window.requestAnimationFrame(()=>{o.update(()=>{Y(t.clone())})})}function ki(o,t){if(!o)return!1;let e=t.getKey();for(let n of o.getNodes())if(n.getKey()===e)return!0;return!1}function kr(o,t){let e=[...o?.getNodes()||[],...At(o)];for(let n of e)if(Rr(n)&&n.getAlignment()===t)return!0;return!1}function zl(o,t){let e=[...o?.getNodes()||[],...At(o)];for(let n of e)if(Yo(n)&&n.getDirection()===t)return!0;return!1}function At(o){if(!o)return[];let t=new Map;for(let e of o.getNodes()){let n=yo(e);E(n)&&t.set(n.getKey(),n)}return Array.from(t.values())}var Yl=class{constructor(t,e,n){p(this,"key");p(this,"offset");p(this,"type");p(this,"_selection");this._selection=null,this.key=t,this.offset=e,this.type=n}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){let e=this.getNode(),n=t.getNode(),r=this.offset,i=t.offset;if(E(e)){let s=e.getDescendantByIndex(r);e=s??e}if(E(n)){let s=n.getDescendantByIndex(i);n=s??n}return e===n?ri&&(n=i)}else if(!E(t)){let i=t.getNextSibling();if(L(i))e=i.__key,n=0,r="text";else{let s=t.getParent();s&&(e=s.__key,n=t.getIndexWithinParent()+1)}}o.set(e,n,r)}function Dl(o,t){if(E(t)){let e=t.getLastDescendant();E(e)||L(e)?Wl(o,e):Wl(o,t)}else Wl(o,t)}function IN(o,t,e,n){let r=o.getNode(),i=r.getChildAtIndex(o.offset),s=q(),l=ne(r)?I().append(s):s;s.setFormat(e),s.setStyle(n),i===null?r.append(l):i.insertBefore(l),o.is(t)&&t.set(s.__key,0,"text"),o.set(s.__key,0,"text")}function So(o,t,e,n){o.key=t,o.offset=e,o.type=n}var Ii=class o{constructor(t){p(this,"_nodes");p(this,"_cachedNodes");p(this,"dirty");this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!we(t))return!1;let e=this._nodes,n=t._nodes;return e.size===n.size&&Array.from(e).every(r=>n.has(r))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new o(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){let e=this.getNodes(),n=e.length,r=e[n-1],i;if(L(r))i=r.select();else{let s=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(s,s)}i.insertNodes(t);for(let s=0;s0&&!l.shouldSelectDirectly()?m=[]:m=[l]:m=l.getNodesBetween(a),ft()||(this._cachedNodes=m),m}setTextNodeRange(t,e,n,r){So(this.anchor,t.__key,e,"text"),So(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let t=this.getNodes();if(t.length===0)return"";let e=t[0],n=t[t.length-1],r=this.anchor,i=this.focus,s=r.isBefore(i),[l,a]=Or(this),d="",u=!0;for(let m=0;m=0;k--){let j=R[k];if(j.is(c)||E(j)&&j.isParentOf(c))break;j.isAttached()&&(!A.has(j)||j.is(M)?$||B.insertAfter(j,!1):j.remove())}if(!$){let k=v,j=null;for(;k!==null;){let se=k.getChildren(),He=se.length;(He===0||se[He-1].is(j))&&(x.delete(k.__key),j=k),k=k.getParent()}}if(!c.isToken())c=c.spliceText(a,g-a,t,!0),c.getTextContent()===""?c.remove():c.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);else if(a===g)c.select();else{let k=q(t);k.select(),c.replace(k)}for(let k=1;k0&&(N!==h.getTextContentSize()&&!Ye(h)&&([h]=h.splitText(N)),h.setFormat(b));for(let x=u+1;x(E(N)||F(N))&&!N.isInline();if(!t.some(i)){T(E(n),"Expected 'firstBlock' to be an ElementNode");let N=ql(this);n.splice(N,0,t),r.selectEnd();return}let s=KN(t),l=s.getLastDescendant(),a=s.getChildren(),d=N=>E(N)&&Uo(N)&&!N.isEmpty()&&E(n)&&(!n.isEmpty()||n.canMergeWhenEmpty()),m=!E(n)||!n.isEmpty()?this.insertParagraph():null,c=a[a.length-1],f=a[0];d(f)&&(T(E(n),"Expected 'firstBlock' to be an ElementNode"),n.append(...f.getChildren()),f=a[1]),f&&tu(n,f);let g=xi(l,Uo);m&&E(g)&&(m.canMergeWhenEmpty()||Uo(c))&&(g.append(...m.getChildren()),m.remove()),E(n)&&n.isEmpty()&&n.remove(),l.selectEnd();let h=E(n)?n.getLastChild():null;ke(h)&&g!==n&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){let s=I();return H().splice(this.anchor.offset,0,[s]),s.select(),s}let t=ql(this),e=xi(this.anchor.getNode(),Uo);T(E(e),"Expected ancestor to be an ElementNode");let n=e.getChildAtIndex(t),r=n?[n,...n.getNextSiblings()]:[],i=e.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(t){let e=ht();if(this.insertNodes([e]),t){let n=e.getParentOrThrow(),r=e.getIndexWithinParent();n.select(r,r)}}extract(){let t=this.getNodes(),e=t.length,n=e-1,r=this.anchor,i=this.focus,s=t[0],l=t[n],[a,d]=Or(this);if(e===0)return[];if(e===1){if(L(s)&&!this.isCollapsed()){let m=a>d?d:a,c=a>d?a:d,f=s.splitText(m,c),g=m===0?f[0]:f[1];return g!=null?[g]:[]}return[s]}let u=r.isBefore(i);if(L(s)){let m=u?a:d;m===s.getTextContentSize()?t.shift():m!==0&&([,s]=s.splitText(m),t[0]=s)}if(L(l)){let c=l.getTextContent().length,f=u?d:a;f===0?t.pop():f!==c&&([l]=l.splitText(f),t[n]=l)}return t}modify(t,e,n){let r=this.focus,i=this.anchor,s=t==="move",l=Jt(r,e);if(F(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){let f=jo();f.add(l.__key),Y(f);return}let c=e?l.getPreviousSibling():l.getNextSibling();if(L(c)){let f=c.__key,g=e?c.getTextContent().length:0;r.set(f,g,"text"),s&&i.set(f,g,"text");return}else{let f=l.getParentOrThrow(),g,h;E(c)?(h=c.__key,g=e?c.getChildrenSize():0):(g=l.getIndexWithinParent(),h=f.__key,e||g++),r.set(h,g,"element"),s&&i.set(h,g,"element");return}}let a=Q(),d=Le(a._window);if(!d)return;let u=a._blockCursorElement,m=a._rootElement;if(m!==null&&u!==null&&E(l)&&!l.isInline()&&!l.canBeEmpty()&&br(u,a,m),PN(d,t,e?"backward":"forward",n),d.rangeCount>0){let c=d.getRangeAt(0),f=this.anchor.getNode(),g=ne(f)?f:ml(f);if(this.applyDOMRange(c),this.dirty=!0,!s){let h=this.getNodes(),N=[],b=!1;for(let x=0;x0)if(e){let x=N[0];E(x)?x.selectStart():x.getParentOrThrow().selectStart()}else{let x=N[N.length-1];E(x)?x.selectEnd():x.getParentOrThrow().selectEnd()}(d.anchorNode!==c.startContainer||d.anchorOffset!==c.startOffset)&&$N(this)}}}forwardDeletion(t,e,n){if(!n&&(t.type==="element"&&E(e)&&t.offset===e.getChildrenSize()||t.type==="text"&&t.offset===e.getTextContentSize())){let r=e.getParent(),i=e.getNextSibling()||(r===null?null:r.getNextSibling());if(E(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){let e=this.isCollapsed();if(this.isCollapsed()){let n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;let i=this.focus,s=Jt(i,t);if(F(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&E(r)&&r.getChildrenSize()===0){r.remove();let l=jo();l.add(s.__key),Y(l)}else s.remove(),Q().dispatchCommand(be,void 0);return}else if(!t&&E(s)&&E(r)&&r.isEmpty()){r.remove(),s.selectStart();return}if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&n.offset===0&&(n.type==="element"?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{let l=i.type==="text"?i.getNode():null;if(r=n.type==="text"?n.getNode():null,l!==null&&l.isSegmented()){let a=i.offset,d=l.getTextContentSize();if(l.is(r)||t&&a!==d||!t&&a!==0){Ru(l,t,a);return}}else if(r!==null&&r.isSegmented()){let a=n.offset,d=r.getTextContentSize();if(r.is(l)||t&&a!==0||!t&&a!==d){Ru(r,t,a);return}}BN(this,t)}}if(this.removeText(),t&&!e&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let n=this.anchor.getNode();n.isEmpty()&&ne(n.getParent())&&n.getIndexWithinParent()===0&&n.collapseAtStart(this)}}deleteLine(t){if(this.isCollapsed()){let e=this.anchor.type==="element";if(e&&this.insertText(" "),this.modify("extend",t,"lineboundary"),(t?this.focus:this.anchor).offset===0&&this.modify("extend",t,"character"),e){let r=t?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(t){if(this.isCollapsed()){let e=this.anchor,n=e.getNode();if(this.forwardDeletion(e,n,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function we(o){return o instanceof Ii}function Au(o){let t=o.offset;if(o.type==="text")return t;let e=o.getNode();return t===e.getChildrenSize()?e.getTextContent().length:0}function Or(o){let t=o.getStartEndPoints();if(t===null)return[0,0];let[e,n]=t;return e.type==="element"&&n.type==="element"&&e.key===n.key&&e.offset===n.offset?[0,0]:[Au(e),Au(n)]}function $N(o){let t=o.focus,e=o.anchor,n=e.key,r=e.offset,i=e.type;So(e,t.key,t.offset,t.type),So(t,n,r,i),o._cachedNodes=null}function PN(o,t,e,n){o.modify(t,e,n)}function BN(o,t){let e=o.anchor,n=o.focus,r=e.getNode(),i=n.getNode();if(r===i&&e.type==="text"&&n.type==="text"){let s=e.offset,l=n.offset,a=se||c){i.splice(u,1),c&&(a=void 0);break}}let d=i.join("").trim();d===""?n.remove():(n.setTextContent(d),n.select(a,a))}function FN(o,t,e){let n=o.getParent();return e===null||n===null||!n.canBeEmpty()||n!==e.getNode()}function ku(o,t,e,n){let r=t,i;if(o.nodeType===No){let s=!1,l=o.childNodes,a=l.length,d=n._blockCursorElement;r===a&&(s=!0,r=a-1);let u=l[r],m=!1;if(u===d)u=l[r+1],m=!0;else if(d!==null){let c=d.parentNode;if(o===c){let f=Array.prototype.indexOf.call(c.children,d);t>f&&r--}}if(i=Ho(u),L(i))r=al(i,s);else{let c=Ho(o);if(c===null)return null;if(E(c)){r=Math.min(c.getChildrenSize(),r);let f=c.getChildAtIndex(r);if(E(f)&&FN(f,r,e)){let g=s?f.getLastDescendant():f.getFirstDescendant();g===null?c=f:(f=g,c=E(f)?f:f.getParentOrThrow()),r=0}L(f)?(i=f,c=null,r=al(f,s)):f!==c&&s&&!m&&r++}else{let f=c.getIndexWithinParent();t===0&&F(c)&&Ho(o)===c?r=f:r=f+1,c=c.getParentOrThrow()}if(E(c))return Ie(c.__key,r,"element")}}else i=Ho(o);return L(i)?Ie(i.__key,r,"text"):null}function Iu(o,t,e){let n=o.offset,r=o.getNode();if(n===0){let i=r.getPreviousSibling(),s=r.getParent();if(!t)E(i)&&!e&&i.isInline()?(o.key=i.__key,o.offset=i.getChildrenSize(),o.type="element"):L(i)&&(o.key=i.__key,o.offset=i.getTextContent().length);else if((e||!t)&&i===null&&E(s)&&s.isInline()){let l=s.getPreviousSibling();L(l)&&(o.key=l.__key,o.offset=l.getTextContent().length)}}else if(n===r.getTextContent().length){let i=r.getNextSibling(),s=r.getParent();if(t&&E(i)&&i.isInline())o.key=i.__key,o.offset=0,o.type="element";else if((e||t)&&i===null&&E(s)&&s.isInline()&&!s.canInsertTextAfter()){let l=s.getNextSibling();L(l)&&(o.key=l.__key,o.offset=0)}}}function Pu(o,t,e){if(o.type==="text"&&t.type==="text"){let n=o.isBefore(t),r=o.is(t);Iu(o,n,r),Iu(t,!n,r),r&&(t.key=o.key,t.offset=o.offset,t.type=o.type);let i=Q();if(i.isComposing()&&i._compositionKey!==o.key&&_(e)){let s=e.anchor,l=e.focus;So(o,s.key,s.offset,s.type),So(t,l.key,l.offset,l.type)}}}function Bu(o,t,e,n,r,i){if(o===null||e===null||!jt(r,o,e))return null;let s=ku(o,t,_(i)?i.anchor:null,r);if(s===null)return null;let l=ku(e,n,_(i)?i.focus:null,r);if(l===null)return null;if(s.type==="element"&&l.type==="element"){let a=Ho(o),d=Ho(e);if(F(a)&&F(d))return null}return Pu(s,l,i),[s,l]}function Yo(o){return E(o)&&!o.isInline()}function Mi(o,t,e,n,r,i){let s=tt(),l=new Lo(Ie(o,t,r),Ie(e,n,i),0,"");return l.dirty=!0,s._selection=l,l}function Xo(){let o=Ie("root",0,"element"),t=Ie("root",0,"element");return new Lo(o,t,0,"")}function jo(){return new Ii(new Set)}function Fu(o){let e=o.getEditorState()._selection,n=Le(o._window);return _(e)||e==null?vr(e,n,o,null):e.clone()}function Zl(o,t){return vr(null,o,t,null)}function vr(o,t,e,n){let r=e._window;if(r===null)return null;let i=n||r.event,s=i?i.type:void 0,l=s==="selectionchange",a=!$d()&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0),d,u,m,c;if(!_(o)||a){if(t===null)return null;if(d=t.anchorNode,u=t.focusNode,m=t.anchorOffset,c=t.focusOffset,l&&_(o)&&!jt(e,d,u))return o.clone()}else return o.clone();let f=Bu(d,m,u,c,e,o);if(f===null)return null;let[g,h]=f;return new Lo(g,h,_(o)?o.format:0,_(o)?o.style:"")}function C(){return tt()._selection}function Ze(){return Q()._editorState._selection}function Rn(o,t,e,n=1){let r=o.anchor,i=o.focus,s=r.getNode(),l=i.getNode();if(!t.is(s)&&!t.is(l))return;let a=t.__key;if(o.isCollapsed()){let d=r.offset;if(e<=d&&n>0||e0||e0||e=l,d=a?i.getChildAtIndex(l-1):i.getChildAtIndex(e);if(L(d)){let u=0;a&&(u=d.getTextContentSize()),t.set(d.__key,u,"text"),n.set(d.__key,u,"text")}return}if(E(i)){let l=i.getChildrenSize(),a=e>=l,d=a?i.getChildAtIndex(l-1):i.getChildAtIndex(e);if(L(d)){let u=0;a&&(u=d.getTextContentSize()),t.set(d.__key,u,"text")}}if(E(s)){let l=s.getChildrenSize(),a=r>=l,d=a?s.getChildAtIndex(l-1):s.getChildAtIndex(r);if(L(d)){let u=0;a&&(u=d.getTextContentSize()),n.set(d.__key,u,"text")}}}function Hu(o,t){let n=t.getEditorState()._selection,r=o._selection;if(_(r)){let i=r.anchor,s=r.focus,l;if(i.type==="text"&&(l=i.getNode(),l.selectionTransform(n,r)),s.type==="text"){let a=s.getNode();l!==a&&a.selectionTransform(n,r)}}}function kn(o,t,e,n,r){let i=null,s=0,l=null;n!==null?(i=n.__key,L(n)?(s=n.getTextContentSize(),l="text"):E(n)&&(s=n.getChildrenSize(),l="element")):r!==null&&(i=r.__key,L(r)?l="text":E(r)&&(l="element")),i!==null&&l!==null?o.set(i,s,l):(s=t.getIndexWithinParent(),s===-1&&(s=e.getChildrenSize()),o.set(e.__key,s,"element"))}function Rl(o,t,e,n,r){o.type==="text"?(o.key=e,t||(o.offset+=r)):o.offset>n.getIndexWithinParent()&&(o.offset-=1)}function Ku(o,t,e,n,r,i,s){let l=n.anchorNode,a=n.focusNode,d=n.anchorOffset,u=n.focusOffset,m=document.activeElement;if(r.has("collaboration")&&m!==i||m!==null&&Ln(m))return;if(!_(t)){if(m!==null&&n.isCollapsed&&a instanceof Node){let k=G(a);if(F(k)){n.removeAllRanges(),rt(k);return}}o!==null&&jt(e,l,a)&&n.removeAllRanges();return}let c=t.anchor,f=t.focus,g=c.key,h=f.key,N=vn(e,g),b=vn(e,h),x=c.offset,S=f.offset,v=t.format,M=t.style,R=t.isCollapsed(),A=N,$=b,B=!1;if(c.type==="text"){A=wn(N);let k=c.getNode();B=k.getFormat()!==v||k.getStyle()!==M}else _(o)&&o.anchor.type==="text"&&(B=!0);if(f.type==="text"&&($=wn(b)),!(A===null||$===null)&&(R&&(o===null||B||_(o)&&(o.format!==v||o.style!==M))&&eu(v,M,x,g,performance.now()),!(d===x&&u===S&&l===A&&a===$&&!(n.type==="Range"&&R)&&((m===null||!i.contains(m))&&i.focus({preventScroll:!0}),c.type!=="element")))){try{n.setBaseAndExtent(A,x,$,S)}catch(k){__DEV__&&console.warn(k)}if(!r.has("skip-scroll-into-view")&&t.isCollapsed()&&i!==null&&i===document.activeElement){let k=t instanceof Lo&&t.anchor.type==="element"?A.childNodes[x]||null:n.rangeCount>0?n.getRangeAt(0):null;if(k!==null){let j;if(k instanceof Text){let se=document.createRange();se.selectNode(k),j=se.getBoundingClientRect()}else j=k.getBoundingClientRect();Lc(e,j,i)}}Qc()}}function ve(o){let t=C()||Ze();t===null&&(t=H().selectEnd()),t.insertNodes(o)}function ql(o){let t=o;o.isCollapsed()||t.removeText();let e=C();_(e)&&(t=e),T(_(t),"Unexpected dirty selection to be null");let n=t.anchor,r=n.getNode(),i=n.offset;for(;!Uo(r);)[r,i]=HN(r,i);return i}function HN(o,t){let e=o.getParent();if(!e){let r=I();return H().append(r),r.select(),[H(),0]}if(L(o)){let r=o.splitText(t);if(r.length===0)return[e,o.getIndexWithinParent()];let i=t===0?0:1,s=r[0].getIndexWithinParent()+i;return[e,s]}if(!E(o)||t===0)return[e,o.getIndexWithinParent()];let n=o.getChildAtIndex(t);if(n){let r=new Lo(Ie(o.__key,t,"element"),Ie(o.__key,t,"element"),0,""),i=o.insertNewAfter(r);i&&i.append(n,...n.getNextSiblings())}return[e,o.getIndexWithinParent()+1]}function KN(o){let t=I(),e=null;for(let n=0;n99&&T(!1,"One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function tt(){return me===null&&T(!1,"Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update(), editor.read(), or editorState.read().%s",Yu()),me}function Q(){return Ne===null&&T(!1,"Unable to find an active editor. This method can only be used synchronously during the callback of editor.update() or editor.read().%s",Yu()),Ne}function Yu(){let o=0,t=new Set,e=eo.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let i=Fo(r);if(Mn(i))o++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===e&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let n=` Detected on the page: ${o} compatible editor(s) with version ${e}`;return t.size&&(n+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),n}function Zu(){return Ne}function Oc(){return me}function zu(o,t,e){let n=t.__type,r=zd(o,n),i=e.get(n);i===void 0&&(i=Array.from(r.transforms),e.set(n,i));let s=i.length;for(let l=0;l0||u>0;){if(a>0){t._dirtyLeaves=new Set;for(let m of l){let c=r.get(m);L(c)&&c.isAttached()&&c.isSimpleText()&&!c.isUnmergeable()&&il(c),c!==void 0&&Wu(c,i)&&zu(t,c,s),e.add(m)}if(l=t._dirtyLeaves,a=l.size,a>0){$i++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(let m of d){let c=m[0],f=m[1];if(c!=="root"&&!f)continue;let g=r.get(c);g!==void 0&&Wu(g,i)&&zu(t,g,s),n.set(c,f)}l=t._dirtyLeaves,a=l.size,d=t._dirtyElements,u=d.size,$i++}t._dirtyLeaves=e,t._dirtyElements=n}function Xl(o){return jl(o,Q()._nodes)}function jl(o,t){let e=o.type,n=t.get(e);n===void 0&&T(!1,'parseEditorState: type "%s" + not found',e);let r=n.klass;o.type!==r.getType()&&T(!1,"LexicalNode: Node %s does not implement .importJSON().",r.name);let i=r.importJSON(o),s=o.children;if(E(i)&&Array.isArray(s))for(let l=0;l{throw new Error("Cannot call set() on a frozen Lexical node map")},t.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},t.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function Rt(o,t){let e=o._pendingEditorState,n=o._rootElement,r=o._headless||n===null;if(e===null)return;let i=o._editorState,s=i._selection,l=e._selection,a=o._dirtyType!==Mt,d=me,u=$e,m=Ne,c=o._updating,f=o._observer,g=null;if(o._pendingEditorState=null,o._editorState=e,!r&&a&&f!==null){Ne=o,me=e,$e=!1,o._updating=!0;try{let A=o._dirtyType,$=o._dirtyElements,B=o._dirtyLeaves;f.disconnect(),g=Fc(i,e,o,A,$,B)}catch(A){if(A instanceof Error&&o._onError(A),!Vl)Jl(o,null,n,e),ai(o),o._dirtyType=Xt,Vl=!0,Rt(o,i),Vl=!1;else throw A;return}finally{f.observe(n,Uu),o._updating=c,me=d,$e=u,Ne=m}}e._readOnly||(e._readOnly=!0,__DEV__&&(Xu(e),_(l)&&(Object.freeze(l.anchor),Object.freeze(l.focus)),Object.freeze(l)));let h=o._dirtyLeaves,N=o._dirtyElements,b=o._normalizedNodes,x=o._updateTags,S=o._deferred,v=e._nodeMap.size;a&&(o._dirtyType=Mt,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set),Ac(o,e);let M=r?null:Le(o._window);if(o._editable&&M!==null&&(a||l===null||l.dirty)){Ne=o,me=e;try{if(f!==null&&f.disconnect(),a||l===null||l.dirty){let A=o._blockCursorElement;A!==null&&br(A,o,n),Ku(s,l,o,M,x,n,v)}vc(o,n,l),f!==null&&f.observe(n,Uu)}finally{Ne=m,me=d}}g!==null&&qN(o,g,x,h,i),!_(l)&&l!==null&&(s===null||!s.is(l))&&o.dispatchCommand(be,void 0);let R=o._pendingDecorators;R!==null&&(o._decorators=R,o._pendingDecorators=null,Hn("decorator",o,!0,R)),WN(o,t||i,e),Hn("update",o,!0,{dirtyElements:N,dirtyLeaves:h,editorState:e,normalizedNodes:b,prevEditorState:t||i,tags:x}),ZN(o,S),YN(o)}function WN(o,t,e){let n=ll(t),r=ll(e);n!==r&&Hn("textcontent",o,!0,r)}function qN(o,t,e,n,r){let i=Array.from(o._listeners.mutation),s=i.length;for(let l=0;l{r=hl(o,t,e)}),r}let n=Er(o);for(let r=4;r>=0;r--)for(let i=0;i{Rt(o)}):(d._flushSync=!1,u&&(n.clear(),o._deferred=[],o._pendingEditorState=null))}function Te(o,t,e){o._updating?o._updates.push([t,e]):ju(o,t,e)}var V=class extends gt{constructor(e){super(e);p(this,"__first");p(this,"__last");p(this,"__size");p(this,"__style");p(this,"__dir");this.__first=null,this.__last=null,this.__size=0,this.__style="",this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__style=e.__style,this.__dir=e.__dir}getStyle(){return this.getLatest().__style}getChildren(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let n=Q()._dirtyElements;return n!==null&&n.has(this.__key)}isLastChild(){let e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){let e=[],n=this.getFirstChild();for(;n!==null;){if(L(n)&&e.push(n),E(n)){let r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;E(e);){let n=e.getFirstChild();if(n===null)break;e=n}return e}getFirstSelectableDescendant(){if(this.shouldSelectDirectly())return null;let e=this.getFirstChild();for(;E(e)&&!e.shouldSelectDirectly();){let n=e.getFirstChild();if(n===null)break;e=n}return e}getLastDescendant(){let e=this.getLastChild();for(;E(e);){let n=e.getLastChild();if(n===null)break;e=n}return e}getLastSelectableDescendant(){if(this.shouldSelectDirectly())return null;let e=this.getLastChild();for(;E(e)&&!e.shouldSelectDirectly();){let n=e.getLastChild();if(n===null)break;e=n}return e}getDescendantByIndex(e){let n=this.getChildren(),r=n.length;if(e>=r){let s=n[r-1];return E(s)&&s.getLastDescendant()||s||null}let i=n[e];return E(i)&&i.getFirstDescendant()||i||null}getFirstChild(){let n=this.getLatest().__first;return n===null?null:ee(n)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&T(!1,"Expected node %s to have a first child.",this.__key),e}getLastChild(){let n=this.getLatest().__last;return n===null?null:ee(n)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&T(!1,"Expected node %s to have a last child.",this.__key),e}getChildAtIndex(e){let n=this.getChildrenSize(),r,i;if(e=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="",n=this.getChildren(),r=n.length;for(let i=0;ir.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let n=this.getWritable();return n.__dir=e,n}setStyle(e){let n=this.getWritable();return n.__style=e||"",this}splice(e,n,r){let i=r.length,s=this.getChildrenSize(),l=this.getWritable(),a=l.__key,d=[],u=[],m=this.getChildAtIndex(e+n),c=null,f=s-n+i;if(e!==0)if(e===s)c=this.getLastChild();else{let h=this.getChildAtIndex(e);h!==null&&(c=h.getPreviousSibling())}if(n>0){let h=c===null?this.getFirstChild():c.getNextSibling();for(let N=0;N({root:tf(H())}))}};var bo=class extends V{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}};var of=["left","right","center","justify"];function $r(o){let t=o.style.textAlign||"";return of.includes(t)?t:o.classList.contains("align-left")?"left":o.classList.contains("align-right")?"right":o.classList.contains("align-center")?"center":o.classList.contains("align-justify")?"justify":""}function VN(o){let t=o.style.paddingLeft||"0";return Zo(t)}function Pr(o){let t=(o.dir||"").toLowerCase();return t==="rtl"||t==="ltr"?t:null}function it(o,t){o.id&&t.setId(o.id),t.setAlignment($r(o)),t.setInset(VN(o)),t.setDirection(Pr(o))}function Mo(o,t){return o.__id!==t.__id||o.__alignment!==t.__alignment||o.__inset!==t.__inset||o.__dir!==t.__dir}function nf(o,t,e){if(o.__id!==t.__id&&e.setAttribute("id",t.__id),o.__alignment!==t.__alignment){for(let n of of)e.classList.remove("align-"+n);t.__alignment&&e.classList.add("align-"+t.__alignment)}o.__inset!==t.__inset&&(t.__inset?e.style.paddingLeft=`${t.__inset}px`:e.style.removeProperty("paddingLeft")),o.__dir!==t.__dir&&(t.__dir?e.dir=t.__dir:e.removeAttribute("dir"))}function st(o,t){t.__id&&o.setAttribute("id",t.__id),t.__alignment&&o.classList.add("align-"+t.__alignment),t.__inset&&(o.style.paddingLeft=`${t.__inset}px`),t.__dir&&(o.dir=t.__dir)}function lt(o,t){t.setId(o.id),t.setAlignment(o.alignment),t.setInset(o.inset),t.setDirection(o.direction)}var It=class extends V{constructor(){super(...arguments);p(this,"__id","");p(this,"__alignment","");p(this,"__inset",0)}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}setInset(e){let n=this.getWritable();n.__inset=e}getInset(){return this.getLatest().__inset}exportJSON(){return{...super.exportJSON(),id:this.__id,alignment:this.__alignment,inset:this.__inset}}};function wo(o,t){t.__alignment=o.__alignment,t.__inset=o.__inset}var ot=class o extends It{constructor(e){super(e);p(this,"__textFormat");p(this,"__textStyle");this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){let n=this.getWritable();return n.__textFormat=e,n}hasTextFormat(e){let n=Re[e];return(this.getTextFormat()&n)!==0}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){let n=this.getWritable();return n.__textStyle=e,n}static clone(e){return new o(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle,wo(e,this)}createDOM(e){let n=document.createElement("p"),r=xo(e.theme,"paragraph");return r!==void 0&&n.classList.add(...r),st(n,this),n}updateDOM(e,n,r){return Mo(e,this)}static importDOM(){return{p:e=>({conversion:XN,priority:0})}}exportDOM(e){let{element:n}=super.exportDOM(e);return n&&he(n)&&this.isEmpty()&&n.append(document.createElement("br")),{element:n}}static importJSON(e){let n=I();return lt(e,n),n.setTextFormat(e.textFormat),n}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,n){let r=I();r.setTextFormat(e.format),r.setTextStyle(e.style);let i=this.getDirection();return r.setDirection(i),r.setStyle(this.getTextStyle()),this.insertAfter(r,n),r}collapseAtStart(){let e=this.getChildren();if(e.length===0||L(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function XN(o){let t=I();return it(o,t),{node:t}}function I(){return re(new ot)}function Ve(o){return o instanceof ot}var jN=!0,J=0,De=1,Kn=2,Xe=3,Pe=4;function Jl(o,t,e,n){let r=o._keyToDOMMap;r.clear(),o._editorState=Ir(),o._pendingEditorState=n,o._compositionKey=null,o._dirtyType=Mt,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),o._normalizedNodes=new Set,o._updateTags=new Set,o._updates=[],o._blockCursorElement=null;let i=o._observer;i!==null&&(i.disconnect(),o._observer=null),t!==null&&(t.textContent=""),e!==null&&(e.textContent="",r.set("root",e))}function GN(o,t){let e=new Map,n=new Set,r=i=>{Object.keys(i).forEach(s=>{let l=e.get(s);l===void 0&&(l=[],e.set(s,l)),l.push(i[s])})};return o.forEach(i=>{let s=i.klass.importDOM;if(s==null||n.has(s))return;n.add(s);let l=s.call(i.klass);l!==null&&r(l)}),t&&r(t),e}function Bi(o){let t=o||{},e=Zu(),n=t.theme||{},r=o===void 0?e:t.parentEditor||null,i=t.disableEvents||!1,s=Ir(),l=t.namespace||(r!==null?r._config.namespace:dl()),a=t.editorState,d=[Go,nt,Wo,qo,ot,bo,...t.nodes||[]],{onError:u,html:m}=t,c=t.editable!==void 0?t.editable:!0,f;if(o===void 0&&e!==null)f=e._nodes;else{f=new Map;for(let h=0;h{N.hasOwnProperty(B)||console.warn(`${A} must implement static "${B}" method`)}),!N.hasOwnProperty("importDOM")&&N.hasOwnProperty("exportDOM")&&console.warn(`${A} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),$ instanceof kt&&($.hasOwnProperty("decorate")||console.warn(`${$.constructor.name} must implement "decorate" method`)),N.hasOwnProperty("importJSON")||console.warn(`${A} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),$.hasOwnProperty("exportJSON")||console.warn(`${A} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}let S=N.getType(),v=N.transform(),M=new Set;v!==null&&M.add(v),f.set(S,{exportDOM:m&&m.export?m.export.get(N):void 0,klass:N,replace:b,replaceWithKlass:x,transforms:M})}}let g=new eo(s,r,f,{disableEvents:i,namespace:l,theme:n},u||console.error,GN(f,m?m.import:void 0),c);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=Xt),g}var eo=class{constructor(t,e,n,r,i,s,l){p(this,"constructor");p(this,"_headless");p(this,"_parentEditor");p(this,"_rootElement");p(this,"_editorState");p(this,"_pendingEditorState");p(this,"_compositionKey");p(this,"_deferred");p(this,"_keyToDOMMap");p(this,"_updates");p(this,"_updating");p(this,"_listeners");p(this,"_commands");p(this,"_nodes");p(this,"_decorators");p(this,"_pendingDecorators");p(this,"_config");p(this,"_dirtyType");p(this,"_cloneNotNeeded");p(this,"_dirtyLeaves");p(this,"_dirtyElements");p(this,"_normalizedNodes");p(this,"_updateTags");p(this,"_observer");p(this,"_key");p(this,"_onError");p(this,"_htmlConversions");p(this,"_window");p(this,"_editable");p(this,"_blockCursorElement");this._parentEditor=e,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=Mt,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=dl(),this._onError=i,this._htmlConversions=s,this._editable=l,this._headless=e!==null&&e._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){let e=this._listeners.update;return e.add(t),()=>{e.delete(t)}}registerEditableListener(t){let e=this._listeners.editable;return e.add(t),()=>{e.delete(t)}}registerDecoratorListener(t){let e=this._listeners.decorator;return e.add(t),()=>{e.delete(t)}}registerTextContentListener(t){let e=this._listeners.textcontent;return e.add(t),()=>{e.delete(t)}}registerRootListener(t){let e=this._listeners.root;return t(this._rootElement,null),e.add(t),()=>{t(null,this._rootElement),e.delete(t)}}registerCommand(t,e,n){n===void 0&&T(!1,'Listener for type "command" requires a "priority".');let r=this._commands;r.has(t)||r.set(t,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(t);i===void 0&&T(!1,"registerCommand: Command %s not found in command map",String(t));let s=i[n];return s.add(e),()=>{s.delete(e),i.every(l=>l.size===0)&&r.delete(t)}}registerMutationListener(t,e,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;i.set(e,r);let s=n&&n.skipInitialization;return(s===void 0?jN:s)||this.initializeMutationListener(e,r),()=>{i.delete(e)}}getRegisteredNode(t){let e=this._nodes.get(t.getType());return e===void 0&&T(!1,"Node %s has not been registered. Ensure node has been passed to createEditor.",t.name),e}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,e){let n=this._editorState,r=Dc(n).get(e.getType());if(!r)return;let i=new Map;for(let s of r.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,e){let n=this.getRegisteredNode(t);return n.transforms.add(e),n}registerNodeTransform(t,e){let n=this.registerNodeTransformToKlass(t,e),r=[n],i=n.replaceWithKlass;if(i!=null){let s=this.registerNodeTransformToKlass(i,e);r.push(s)}return Vd(this,t.getType()),()=>{r.forEach(s=>s.transforms.delete(e))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,e){return O(this,t,e)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){let e=this._rootElement;if(t!==e){let n=xo(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,Jl(this,e,t,r),e!==null&&(this._config.disableEvents||Jc(e),n!=null&&e.classList.remove(...n)),t!==null){let i=wc(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=Xt,ai(this),this._updateTags.add("history-merge"),Rt(this),this._config.disableEvents||Gc(t,this),n!=null&&t.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;Hn("root",this,!1,t,e)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,e){t.isEmpty()&&T(!1,"setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty."),li(this);let n=this._pendingEditorState,r=this._updateTags,i=e!==void 0?e.tag:null;n!==null&&!n.isEmpty()&&(i!=null&&r.add(i),Rt(this)),this._pendingEditorState=t,this._dirtyType=Xt,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&r.add(i),Rt(this)}parseEditorState(t,e){let n=typeof t=="string"?JSON.parse(t):t;return Vu(n,this,e)}read(t){return Rt(this),this.getEditorState().read(t,{editor:this})}update(t,e){Te(this,t,e)}updateAndCommit(t,e){this.update(t,e),this.commitUpdates()}focus(t,e={}){let n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),Te(this,()=>{let r=C(),i=H();r!==null?r.dirty=!0:i.getChildrenSize()!==0&&(e.defaultSelection==="rootStart"?i.selectStart():i.selectEnd())},{onUpdate:()=>{n.removeAttribute("autocapitalize"),t&&t()},tag:"focus"}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}commitUpdates(){Rt(this)}blur(){let t=this._rootElement;t!==null&&t.blur();let e=Le(this._window);e!==null&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,Hn("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}};p(eo,"version");eo.version="0.17.1";var Fi=0,Ql=1,ea=2,Et=0,JN=1,rf=2,QN=3,ex=4;function tx(o,t,e){let n=o._nodeMap,r=[];for(let i of t){let s=n.get(i);s!==void 0&&r.push(s)}for(let[i,s]of e){if(!s)continue;let l=n.get(i);l!==void 0&&!ne(l)&&r.push(l)}return r}function ox(o,t,e,n,r){if(o===null||e.size===0&&n.size===0&&!r)return Et;let i=t._selection,s=o._selection;if(r)return JN;if(!_(i)||!_(s)||!s.isCollapsed()||!i.isCollapsed())return Et;let l=tx(t,e,n);if(l.length===0)return Et;if(l.length>1){let b=t._nodeMap,x=b.get(i.anchor.key),S=b.get(s.anchor.key);return x&&S&&!o._nodeMap.has(x.__key)&&L(x)&&x.__text.length===1&&i.anchor.offset===1?rf:Et}let a=l[0],d=o._nodeMap.get(a.__key);if(!L(d)||!L(a)||d.__mode!==a.__mode)return Et;let u=d.__text,m=a.__text;if(u===m)return Et;let c=i.anchor,f=s.anchor;if(c.key!==f.key||c.type!=="text")return Et;let g=c.offset,h=f.offset,N=m.length-u.length;return N===1&&h===g-1?rf:N===-1&&h===g+1?QN:N===-1&&h===g?ex:Et}function nx(o,t,e){let n=t._nodeMap.get(o),r=e._nodeMap.get(o),i=t._selection,s=e._selection;return!(_(i)&&_(s)&&i.anchor.type==="element"&&i.focus.type==="element"&&s.anchor.type==="text"&&s.focus.type==="text")&&L(n)&&L(r)&&n.__parent===r.__parent?JSON.stringify(t.read(()=>n.exportJSON()))===JSON.stringify(e.read(()=>r.exportJSON())):!1}function rx(o,t){let e=Date.now(),n=Et;return(r,i,s,l,a,d)=>{let u=Date.now();if(d.has("historic"))return n=Et,e=u,ea;let m=ox(r,i,l,a,o.isComposing()),c=(()=>{let f=s===null||s.editor===o,g=d.has("history-push");if(!g&&f&&d.has("history-merge"))return Fi;if(r===null)return Ql;let N=i._selection;if(!(l.size>0||a.size>0))return N!==null?Fi:ea;if(g===!1&&m!==Et&&m===n&&u{let m=t.current,c=t.redoStack,f=t.undoStack,g=m===null?null:m.editorState;if(m!==null&&s===g)return;let h=n(l,s,m,a,d,u);if(h===Ql)c.length!==0&&(t.redoStack=[],o.dispatchCommand(po,!1)),m!==null&&(f.push({...m}),o.dispatchCommand(go,!0));else if(h===ea)return;t.current={editor:o,editorState:s}};return Dt(o.registerCommand(co,()=>(sx(o,t),!0),J),o.registerCommand(uo,()=>(ix(o,t),!0),J),o.registerCommand(Ys,()=>(sf(t),!1),J),o.registerCommand(Zs,()=>(sf(t),o.dispatchCommand(po,!1),o.dispatchCommand(go,!1),!0),J),o.registerUpdateListener(r))}function oa(){return{current:null,redoStack:[],undoStack:[]}}var af=o=>pe?(o||window).getSelection():null;function df(o,t=C()){return t==null&&T(!1,"Expected valid LexicalSelection"),_(t)&&t.isCollapsed()||t.getNodes().length===0?"":Ri(o,t)}function cf(o,t=C()){return t==null&&T(!1,"Expected valid LexicalSelection"),_(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(ff(o,t))}function Hi(o,t,e){let n=o.getData("application/x-lexical-editor");if(n)try{let s=JSON.parse(n);if(s.namespace===e._config.namespace&&Array.isArray(s.nodes)){let l=mf(s.nodes);return na(e,l,t)}}catch{}let r=o.getData("text/html");if(r)try{let l=new DOMParser().parseFromString(r,"text/html"),a=Ai(e,l);return na(e,a,t)}catch{}let i=o.getData("text/plain")||o.getData("text/uri-list");if(i!=null)if(_(t)){let s=i.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l=0;k--){let Z=R[k];if(Z.is(c)||E(Z)&&Z.isParentOf(c))break;Z.isAttached()&&(!A.has(Z)||Z.is(M)?$||B.insertAfter(Z,!1):Z.remove())}if(!$){let k=v,Z=null;for(;k!==null;){let se=k.getChildren(),He=se.length;(He===0||se[He-1].is(Z))&&(x.delete(k.__key),Z=k),k=k.getParent()}}if(!c.isToken())c=c.spliceText(a,g-a,t,!0),c.getTextContent()===""?c.remove():c.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);else if(a===g)c.select();else{let k=q(t);k.select(),c.replace(k)}for(let k=1;k0&&(N!==h.getTextContentSize()&&!Ye(h)&&([h]=h.splitText(N)),h.setFormat(b));for(let x=u+1;x(E(N)||F(N))&&!N.isInline();if(!t.some(i)){T(E(n),"Expected 'firstBlock' to be an ElementNode");let N=ql(this);n.splice(N,0,t),r.selectEnd();return}let s=KN(t),l=s.getLastDescendant(),a=s.getChildren(),d=N=>E(N)&&Uo(N)&&!N.isEmpty()&&E(n)&&(!n.isEmpty()||n.canMergeWhenEmpty()),m=!E(n)||!n.isEmpty()?this.insertParagraph():null,c=a[a.length-1],f=a[0];d(f)&&(T(E(n),"Expected 'firstBlock' to be an ElementNode"),n.append(...f.getChildren()),f=a[1]),f&&tu(n,f);let g=xi(l,Uo);m&&E(g)&&(m.canMergeWhenEmpty()||Uo(c))&&(g.append(...m.getChildren()),m.remove()),E(n)&&n.isEmpty()&&n.remove(),l.selectEnd();let h=E(n)?n.getLastChild():null;ke(h)&&g!==n&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){let s=I();return H().splice(this.anchor.offset,0,[s]),s.select(),s}let t=ql(this),e=xi(this.anchor.getNode(),Uo);T(E(e),"Expected ancestor to be an ElementNode");let n=e.getChildAtIndex(t),r=n?[n,...n.getNextSiblings()]:[],i=e.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(t){let e=ht();if(this.insertNodes([e]),t){let n=e.getParentOrThrow(),r=e.getIndexWithinParent();n.select(r,r)}}extract(){let t=this.getNodes(),e=t.length,n=e-1,r=this.anchor,i=this.focus,s=t[0],l=t[n],[a,d]=Or(this);if(e===0)return[];if(e===1){if(L(s)&&!this.isCollapsed()){let m=a>d?d:a,c=a>d?a:d,f=s.splitText(m,c),g=m===0?f[0]:f[1];return g!=null?[g]:[]}return[s]}let u=r.isBefore(i);if(L(s)){let m=u?a:d;m===s.getTextContentSize()?t.shift():m!==0&&([,s]=s.splitText(m),t[0]=s)}if(L(l)){let c=l.getTextContent().length,f=u?d:a;f===0?t.pop():f!==c&&([l]=l.splitText(f),t[n]=l)}return t}modify(t,e,n){let r=this.focus,i=this.anchor,s=t==="move",l=Jt(r,e);if(F(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){let f=jo();f.add(l.__key),Y(f);return}let c=e?l.getPreviousSibling():l.getNextSibling();if(L(c)){let f=c.__key,g=e?c.getTextContent().length:0;r.set(f,g,"text"),s&&i.set(f,g,"text");return}else{let f=l.getParentOrThrow(),g,h;E(c)?(h=c.__key,g=e?c.getChildrenSize():0):(g=l.getIndexWithinParent(),h=f.__key,e||g++),r.set(h,g,"element"),s&&i.set(h,g,"element");return}}let a=Q(),d=Le(a._window);if(!d)return;let u=a._blockCursorElement,m=a._rootElement;if(m!==null&&u!==null&&E(l)&&!l.isInline()&&!l.canBeEmpty()&&br(u,a,m),PN(d,t,e?"backward":"forward",n),d.rangeCount>0){let c=d.getRangeAt(0),f=this.anchor.getNode(),g=ne(f)?f:ml(f);if(this.applyDOMRange(c),this.dirty=!0,!s){let h=this.getNodes(),N=[],b=!1;for(let x=0;x0)if(e){let x=N[0];E(x)?x.selectStart():x.getParentOrThrow().selectStart()}else{let x=N[N.length-1];E(x)?x.selectEnd():x.getParentOrThrow().selectEnd()}(d.anchorNode!==c.startContainer||d.anchorOffset!==c.startOffset)&&$N(this)}}}forwardDeletion(t,e,n){if(!n&&(t.type==="element"&&E(e)&&t.offset===e.getChildrenSize()||t.type==="text"&&t.offset===e.getTextContentSize())){let r=e.getParent(),i=e.getNextSibling()||(r===null?null:r.getNextSibling());if(E(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){let e=this.isCollapsed();if(this.isCollapsed()){let n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;let i=this.focus,s=Jt(i,t);if(F(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&E(r)&&r.getChildrenSize()===0){r.remove();let l=jo();l.add(s.__key),Y(l)}else s.remove(),Q().dispatchCommand(be,void 0);return}else if(!t&&E(s)&&E(r)&&r.isEmpty()){r.remove(),s.selectStart();return}if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&n.offset===0&&(n.type==="element"?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{let l=i.type==="text"?i.getNode():null;if(r=n.type==="text"?n.getNode():null,l!==null&&l.isSegmented()){let a=i.offset,d=l.getTextContentSize();if(l.is(r)||t&&a!==d||!t&&a!==0){Ru(l,t,a);return}}else if(r!==null&&r.isSegmented()){let a=n.offset,d=r.getTextContentSize();if(r.is(l)||t&&a!==0||!t&&a!==d){Ru(r,t,a);return}}BN(this,t)}}if(this.removeText(),t&&!e&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let n=this.anchor.getNode();n.isEmpty()&&ne(n.getParent())&&n.getIndexWithinParent()===0&&n.collapseAtStart(this)}}deleteLine(t){if(this.isCollapsed()){let e=this.anchor.type==="element";if(e&&this.insertText(" "),this.modify("extend",t,"lineboundary"),(t?this.focus:this.anchor).offset===0&&this.modify("extend",t,"character"),e){let r=t?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(t){if(this.isCollapsed()){let e=this.anchor,n=e.getNode();if(this.forwardDeletion(e,n,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function we(o){return o instanceof Ii}function Au(o){let t=o.offset;if(o.type==="text")return t;let e=o.getNode();return t===e.getChildrenSize()?e.getTextContent().length:0}function Or(o){let t=o.getStartEndPoints();if(t===null)return[0,0];let[e,n]=t;return e.type==="element"&&n.type==="element"&&e.key===n.key&&e.offset===n.offset?[0,0]:[Au(e),Au(n)]}function $N(o){let t=o.focus,e=o.anchor,n=e.key,r=e.offset,i=e.type;So(e,t.key,t.offset,t.type),So(t,n,r,i),o._cachedNodes=null}function PN(o,t,e,n){o.modify(t,e,n)}function BN(o,t){let e=o.anchor,n=o.focus,r=e.getNode(),i=n.getNode();if(r===i&&e.type==="text"&&n.type==="text"){let s=e.offset,l=n.offset,a=se||c){i.splice(u,1),c&&(a=void 0);break}}let d=i.join("").trim();d===""?n.remove():(n.setTextContent(d),n.select(a,a))}function FN(o,t,e){let n=o.getParent();return e===null||n===null||!n.canBeEmpty()||n!==e.getNode()}function ku(o,t,e,n){let r=t,i;if(o.nodeType===No){let s=!1,l=o.childNodes,a=l.length,d=n._blockCursorElement;r===a&&(s=!0,r=a-1);let u=l[r],m=!1;if(u===d)u=l[r+1],m=!0;else if(d!==null){let c=d.parentNode;if(o===c){let f=Array.prototype.indexOf.call(c.children,d);t>f&&r--}}if(i=Ho(u),L(i))r=al(i,s);else{let c=Ho(o);if(c===null)return null;if(E(c)){r=Math.min(c.getChildrenSize(),r);let f=c.getChildAtIndex(r);if(E(f)&&FN(f,r,e)){let g=s?f.getLastDescendant():f.getFirstDescendant();g===null?c=f:(f=g,c=E(f)?f:f.getParentOrThrow()),r=0}L(f)?(i=f,c=null,r=al(f,s)):f!==c&&s&&!m&&r++}else{let f=c.getIndexWithinParent();t===0&&F(c)&&Ho(o)===c?r=f:r=f+1,c=c.getParentOrThrow()}if(E(c))return Ie(c.__key,r,"element")}}else i=Ho(o);return L(i)?Ie(i.__key,r,"text"):null}function Iu(o,t,e){let n=o.offset,r=o.getNode();if(n===0){let i=r.getPreviousSibling(),s=r.getParent();if(!t)E(i)&&!e&&i.isInline()?(o.key=i.__key,o.offset=i.getChildrenSize(),o.type="element"):L(i)&&(o.key=i.__key,o.offset=i.getTextContent().length);else if((e||!t)&&i===null&&E(s)&&s.isInline()){let l=s.getPreviousSibling();L(l)&&(o.key=l.__key,o.offset=l.getTextContent().length)}}else if(n===r.getTextContent().length){let i=r.getNextSibling(),s=r.getParent();if(t&&E(i)&&i.isInline())o.key=i.__key,o.offset=0,o.type="element";else if((e||t)&&i===null&&E(s)&&s.isInline()&&!s.canInsertTextAfter()){let l=s.getNextSibling();L(l)&&(o.key=l.__key,o.offset=0)}}}function Pu(o,t,e){if(o.type==="text"&&t.type==="text"){let n=o.isBefore(t),r=o.is(t);Iu(o,n,r),Iu(t,!n,r),r&&(t.key=o.key,t.offset=o.offset,t.type=o.type);let i=Q();if(i.isComposing()&&i._compositionKey!==o.key&&_(e)){let s=e.anchor,l=e.focus;So(o,s.key,s.offset,s.type),So(t,l.key,l.offset,l.type)}}}function Bu(o,t,e,n,r,i){if(o===null||e===null||!jt(r,o,e))return null;let s=ku(o,t,_(i)?i.anchor:null,r);if(s===null)return null;let l=ku(e,n,_(i)?i.focus:null,r);if(l===null)return null;if(s.type==="element"&&l.type==="element"){let a=Ho(o),d=Ho(e);if(F(a)&&F(d))return null}return Pu(s,l,i),[s,l]}function Yo(o){return E(o)&&!o.isInline()}function Mi(o,t,e,n,r,i){let s=tt(),l=new Lo(Ie(o,t,r),Ie(e,n,i),0,"");return l.dirty=!0,s._selection=l,l}function Xo(){let o=Ie("root",0,"element"),t=Ie("root",0,"element");return new Lo(o,t,0,"")}function jo(){return new Ii(new Set)}function Fu(o){let e=o.getEditorState()._selection,n=Le(o._window);return _(e)||e==null?vr(e,n,o,null):e.clone()}function Zl(o,t){return vr(null,o,t,null)}function vr(o,t,e,n){let r=e._window;if(r===null)return null;let i=n||r.event,s=i?i.type:void 0,l=s==="selectionchange",a=!$d()&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0),d,u,m,c;if(!_(o)||a){if(t===null)return null;if(d=t.anchorNode,u=t.focusNode,m=t.anchorOffset,c=t.focusOffset,l&&_(o)&&!jt(e,d,u))return o.clone()}else return o.clone();let f=Bu(d,m,u,c,e,o);if(f===null)return null;let[g,h]=f;return new Lo(g,h,_(o)?o.format:0,_(o)?o.style:"")}function C(){return tt()._selection}function Ze(){return Q()._editorState._selection}function Rn(o,t,e,n=1){let r=o.anchor,i=o.focus,s=r.getNode(),l=i.getNode();if(!t.is(s)&&!t.is(l))return;let a=t.__key;if(o.isCollapsed()){let d=r.offset;if(e<=d&&n>0||e0||e0||e=l,d=a?i.getChildAtIndex(l-1):i.getChildAtIndex(e);if(L(d)){let u=0;a&&(u=d.getTextContentSize()),t.set(d.__key,u,"text"),n.set(d.__key,u,"text")}return}if(E(i)){let l=i.getChildrenSize(),a=e>=l,d=a?i.getChildAtIndex(l-1):i.getChildAtIndex(e);if(L(d)){let u=0;a&&(u=d.getTextContentSize()),t.set(d.__key,u,"text")}}if(E(s)){let l=s.getChildrenSize(),a=r>=l,d=a?s.getChildAtIndex(l-1):s.getChildAtIndex(r);if(L(d)){let u=0;a&&(u=d.getTextContentSize()),n.set(d.__key,u,"text")}}}function Hu(o,t){let n=t.getEditorState()._selection,r=o._selection;if(_(r)){let i=r.anchor,s=r.focus,l;if(i.type==="text"&&(l=i.getNode(),l.selectionTransform(n,r)),s.type==="text"){let a=s.getNode();l!==a&&a.selectionTransform(n,r)}}}function kn(o,t,e,n,r){let i=null,s=0,l=null;n!==null?(i=n.__key,L(n)?(s=n.getTextContentSize(),l="text"):E(n)&&(s=n.getChildrenSize(),l="element")):r!==null&&(i=r.__key,L(r)?l="text":E(r)&&(l="element")),i!==null&&l!==null?o.set(i,s,l):(s=t.getIndexWithinParent(),s===-1&&(s=e.getChildrenSize()),o.set(e.__key,s,"element"))}function Rl(o,t,e,n,r){o.type==="text"?(o.key=e,t||(o.offset+=r)):o.offset>n.getIndexWithinParent()&&(o.offset-=1)}function Ku(o,t,e,n,r,i,s){let l=n.anchorNode,a=n.focusNode,d=n.anchorOffset,u=n.focusOffset,m=document.activeElement;if(r.has("collaboration")&&m!==i||m!==null&&Ln(m))return;if(!_(t)){if(m!==null&&n.isCollapsed&&a instanceof Node){let k=G(a);if(F(k)){n.removeAllRanges(),rt(k);return}}o!==null&&jt(e,l,a)&&n.removeAllRanges();return}let c=t.anchor,f=t.focus,g=c.key,h=f.key,N=vn(e,g),b=vn(e,h),x=c.offset,S=f.offset,v=t.format,M=t.style,R=t.isCollapsed(),A=N,$=b,B=!1;if(c.type==="text"){A=wn(N);let k=c.getNode();B=k.getFormat()!==v||k.getStyle()!==M}else _(o)&&o.anchor.type==="text"&&(B=!0);if(f.type==="text"&&($=wn(b)),!(A===null||$===null)&&(R&&(o===null||B||_(o)&&(o.format!==v||o.style!==M))&&eu(v,M,x,g,performance.now()),!(d===x&&u===S&&l===A&&a===$&&!(n.type==="Range"&&R)&&((m===null||!i.contains(m))&&i.focus({preventScroll:!0}),c.type!=="element")))){try{n.setBaseAndExtent(A,x,$,S)}catch(k){__DEV__&&console.warn(k)}if(!r.has("skip-scroll-into-view")&&t.isCollapsed()&&i!==null&&i===document.activeElement){let k=t instanceof Lo&&t.anchor.type==="element"?A.childNodes[x]||null:n.rangeCount>0?n.getRangeAt(0):null;if(k!==null){let Z;if(k instanceof Text){let se=document.createRange();se.selectNode(k),Z=se.getBoundingClientRect()}else k instanceof Range,Z=k.getBoundingClientRect();Lc(e,Z,i)}}Qc()}}function ve(o){let t=C()||Ze();t===null&&(t=H().selectEnd()),t.insertNodes(o)}function ql(o){let t=o;o.isCollapsed()||t.removeText();let e=C();_(e)&&(t=e),T(_(t),"Unexpected dirty selection to be null");let n=t.anchor,r=n.getNode(),i=n.offset;for(;!Uo(r);)[r,i]=HN(r,i);return i}function HN(o,t){let e=o.getParent();if(!e){let r=I();return H().append(r),r.select(),[H(),0]}if(L(o)){let r=o.splitText(t);if(r.length===0)return[e,o.getIndexWithinParent()];let i=t===0?0:1,s=r[0].getIndexWithinParent()+i;return[e,s]}if(!E(o)||t===0)return[e,o.getIndexWithinParent()];let n=o.getChildAtIndex(t);if(n){let r=new Lo(Ie(o.__key,t,"element"),Ie(o.__key,t,"element"),0,""),i=o.insertNewAfter(r);i&&i.append(n,...n.getNextSiblings())}return[e,o.getIndexWithinParent()+1]}function KN(o){let t=I(),e=null;for(let n=0;n99&&T(!1,"One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function tt(){return me===null&&T(!1,"Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update(), editor.read(), or editorState.read().%s",Yu()),me}function Q(){return Ne===null&&T(!1,"Unable to find an active editor. This method can only be used synchronously during the callback of editor.update() or editor.read().%s",Yu()),Ne}function Yu(){let o=0,t=new Set,e=eo.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let i=Fo(r);if(Mn(i))o++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===e&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let n=` Detected on the page: ${o} compatible editor(s) with version ${e}`;return t.size&&(n+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),n}function Zu(){return Ne}function Oc(){return me}function zu(o,t,e){let n=t.__type,r=zd(o,n),i=e.get(n);i===void 0&&(i=Array.from(r.transforms),e.set(n,i));let s=i.length;for(let l=0;l0||u>0;){if(a>0){t._dirtyLeaves=new Set;for(let m of l){let c=r.get(m);L(c)&&c.isAttached()&&c.isSimpleText()&&!c.isUnmergeable()&&il(c),c!==void 0&&Wu(c,i)&&zu(t,c,s),e.add(m)}if(l=t._dirtyLeaves,a=l.size,a>0){$i++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(let m of d){let c=m[0],f=m[1];if(c!=="root"&&!f)continue;let g=r.get(c);g!==void 0&&Wu(g,i)&&zu(t,g,s),n.set(c,f)}l=t._dirtyLeaves,a=l.size,d=t._dirtyElements,u=d.size,$i++}t._dirtyLeaves=e,t._dirtyElements=n}function Xl(o){return jl(o,Q()._nodes)}function jl(o,t){let e=o.type,n=t.get(e);n===void 0&&T(!1,'parseEditorState: type "%s" + not found',e);let r=n.klass;o.type!==r.getType()&&T(!1,"LexicalNode: Node %s does not implement .importJSON().",r.name);let i=r.importJSON(o),s=o.children;if(E(i)&&Array.isArray(s))for(let l=0;l{throw new Error("Cannot call set() on a frozen Lexical node map")},t.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},t.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function Rt(o,t){let e=o._pendingEditorState,n=o._rootElement,r=o._headless||n===null;if(e===null)return;let i=o._editorState,s=i._selection,l=e._selection,a=o._dirtyType!==Mt,d=me,u=$e,m=Ne,c=o._updating,f=o._observer,g=null;if(o._pendingEditorState=null,o._editorState=e,!r&&a&&f!==null){Ne=o,me=e,$e=!1,o._updating=!0;try{let A=o._dirtyType,$=o._dirtyElements,B=o._dirtyLeaves;f.disconnect(),g=Fc(i,e,o,A,$,B)}catch(A){if(A instanceof Error&&o._onError(A),!Vl)Jl(o,null,n,e),ai(o),o._dirtyType=Xt,Vl=!0,Rt(o,i),Vl=!1;else throw A;return}finally{f.observe(n,Uu),o._updating=c,me=d,$e=u,Ne=m}}e._readOnly||(e._readOnly=!0,__DEV__&&(Xu(e),_(l)&&(Object.freeze(l.anchor),Object.freeze(l.focus)),Object.freeze(l)));let h=o._dirtyLeaves,N=o._dirtyElements,b=o._normalizedNodes,x=o._updateTags,S=o._deferred,v=e._nodeMap.size;a&&(o._dirtyType=Mt,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set),Ac(o,e);let M=r?null:Le(o._window);if(o._editable&&M!==null&&(a||l===null||l.dirty)){Ne=o,me=e;try{if(f!==null&&f.disconnect(),a||l===null||l.dirty){let A=o._blockCursorElement;A!==null&&br(A,o,n),Ku(s,l,o,M,x,n,v)}vc(o,n,l),f!==null&&f.observe(n,Uu)}finally{Ne=m,me=d}}g!==null&&qN(o,g,x,h,i),!_(l)&&l!==null&&(s===null||!s.is(l))&&o.dispatchCommand(be,void 0);let R=o._pendingDecorators;R!==null&&(o._decorators=R,o._pendingDecorators=null,Hn("decorator",o,!0,R)),WN(o,t||i,e),Hn("update",o,!0,{dirtyElements:N,dirtyLeaves:h,editorState:e,normalizedNodes:b,prevEditorState:t||i,tags:x}),ZN(o,S),YN(o)}function WN(o,t,e){let n=ll(t),r=ll(e);n!==r&&Hn("textcontent",o,!0,r)}function qN(o,t,e,n,r){let i=Array.from(o._listeners.mutation),s=i.length;for(let l=0;l{r=hl(o,t,e)}),r}let n=Er(o);for(let r=4;r>=0;r--)for(let i=0;i{Rt(o)}):(d._flushSync=!1,u&&(n.clear(),o._deferred=[],o._pendingEditorState=null))}function Te(o,t,e){o._updating?o._updates.push([t,e]):ju(o,t,e)}var X=class extends gt{constructor(e){super(e);p(this,"__first");p(this,"__last");p(this,"__size");p(this,"__style");p(this,"__dir");this.__first=null,this.__last=null,this.__size=0,this.__style="",this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__style=e.__style,this.__dir=e.__dir}getStyle(){return this.getLatest().__style}getChildren(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let n=Q()._dirtyElements;return n!==null&&n.has(this.__key)}isLastChild(){let e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){let e=[],n=this.getFirstChild();for(;n!==null;){if(L(n)&&e.push(n),E(n)){let r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;E(e);){let n=e.getFirstChild();if(n===null)break;e=n}return e}getFirstSelectableDescendant(){if(this.shouldSelectDirectly())return null;let e=this.getFirstChild();for(;E(e)&&!e.shouldSelectDirectly();){let n=e.getFirstChild();if(n===null)break;e=n}return e}getLastDescendant(){let e=this.getLastChild();for(;E(e);){let n=e.getLastChild();if(n===null)break;e=n}return e}getLastSelectableDescendant(){if(this.shouldSelectDirectly())return null;let e=this.getLastChild();for(;E(e)&&!e.shouldSelectDirectly();){let n=e.getLastChild();if(n===null)break;e=n}return e}getDescendantByIndex(e){let n=this.getChildren(),r=n.length;if(e>=r){let s=n[r-1];return E(s)&&s.getLastDescendant()||s||null}let i=n[e];return E(i)&&i.getFirstDescendant()||i||null}getFirstChild(){let n=this.getLatest().__first;return n===null?null:ee(n)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&T(!1,"Expected node %s to have a first child.",this.__key),e}getLastChild(){let n=this.getLatest().__last;return n===null?null:ee(n)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&T(!1,"Expected node %s to have a last child.",this.__key),e}getChildAtIndex(e){let n=this.getChildrenSize(),r,i;if(e=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="",n=this.getChildren(),r=n.length;for(let i=0;ir.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let n=this.getWritable();return n.__dir=e,n}setStyle(e){let n=this.getWritable();return n.__style=e||"",this}splice(e,n,r){let i=r.length,s=this.getChildrenSize(),l=this.getWritable(),a=l.__key,d=[],u=[],m=this.getChildAtIndex(e+n),c=null,f=s-n+i;if(e!==0)if(e===s)c=this.getLastChild();else{let h=this.getChildAtIndex(e);h!==null&&(c=h.getPreviousSibling())}if(n>0){let h=c===null?this.getFirstChild():c.getNextSibling();for(let N=0;N({root:tf(H())}))}};var bo=class extends X{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}};var of=["left","right","center","justify"];function $r(o){let t=o.style.textAlign||"";return of.includes(t)?t:o.classList.contains("align-left")?"left":o.classList.contains("align-right")?"right":o.classList.contains("align-center")?"center":o.classList.contains("align-justify")?"justify":""}function VN(o){let t=o.style.paddingLeft||"0";return Zo(t)}function Pr(o){let t=(o.dir||"").toLowerCase();return t==="rtl"||t==="ltr"?t:null}function it(o,t){o.id&&t.setId(o.id),t.setAlignment($r(o)),t.setInset(VN(o)),t.setDirection(Pr(o))}function Mo(o,t){return o.__id!==t.__id||o.__alignment!==t.__alignment||o.__inset!==t.__inset||o.__dir!==t.__dir}function nf(o,t,e){if(o.__id!==t.__id&&e.setAttribute("id",t.__id),o.__alignment!==t.__alignment){for(let n of of)e.classList.remove("align-"+n);t.__alignment&&e.classList.add("align-"+t.__alignment)}o.__inset!==t.__inset&&(t.__inset?e.style.paddingLeft=`${t.__inset}px`:e.style.removeProperty("paddingLeft")),o.__dir!==t.__dir&&(t.__dir?e.dir=t.__dir:e.removeAttribute("dir"))}function st(o,t){t.__id&&o.setAttribute("id",t.__id),t.__alignment&&o.classList.add("align-"+t.__alignment),t.__inset&&(o.style.paddingLeft=`${t.__inset}px`),t.__dir&&(o.dir=t.__dir)}function lt(o,t){t.setId(o.id),t.setAlignment(o.alignment),t.setInset(o.inset),t.setDirection(o.direction)}var It=class extends X{constructor(){super(...arguments);p(this,"__id","");p(this,"__alignment","");p(this,"__inset",0)}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}setInset(e){let n=this.getWritable();n.__inset=e}getInset(){return this.getLatest().__inset}exportJSON(){return{...super.exportJSON(),id:this.__id,alignment:this.__alignment,inset:this.__inset}}};function wo(o,t){t.__alignment=o.__alignment,t.__inset=o.__inset}var ot=class o extends It{constructor(e){super(e);p(this,"__textFormat");p(this,"__textStyle");this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){let n=this.getWritable();return n.__textFormat=e,n}hasTextFormat(e){let n=Re[e];return(this.getTextFormat()&n)!==0}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){let n=this.getWritable();return n.__textStyle=e,n}static clone(e){return new o(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle,wo(e,this)}createDOM(e){let n=document.createElement("p"),r=xo(e.theme,"paragraph");return r!==void 0&&n.classList.add(...r),st(n,this),n}updateDOM(e,n,r){return Mo(e,this)}static importDOM(){return{p:e=>({conversion:XN,priority:0})}}exportDOM(e){let{element:n}=super.exportDOM(e);return n&&he(n)&&this.isEmpty()&&n.append(document.createElement("br")),{element:n}}static importJSON(e){let n=I();return lt(e,n),n.setTextFormat(e.textFormat),n}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,n){let r=I();r.setTextFormat(e.format),r.setTextStyle(e.style);let i=this.getDirection();return r.setDirection(i),r.setStyle(this.getTextStyle()),this.insertAfter(r,n),r}collapseAtStart(){let e=this.getChildren();if(e.length===0||L(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function XN(o){let t=I();return it(o,t),{node:t}}function I(){return re(new ot)}function Ve(o){return o instanceof ot}var jN=!0,J=0,De=1,Kn=2,Xe=3,Pe=4;function Jl(o,t,e,n){let r=o._keyToDOMMap;r.clear(),o._editorState=Ir(),o._pendingEditorState=n,o._compositionKey=null,o._dirtyType=Mt,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),o._normalizedNodes=new Set,o._updateTags=new Set,o._updates=[],o._blockCursorElement=null;let i=o._observer;i!==null&&(i.disconnect(),o._observer=null),t!==null&&(t.textContent=""),e!==null&&(e.textContent="",r.set("root",e))}function GN(o,t){let e=new Map,n=new Set,r=i=>{Object.keys(i).forEach(s=>{let l=e.get(s);l===void 0&&(l=[],e.set(s,l)),l.push(i[s])})};return o.forEach(i=>{let s=i.klass.importDOM;if(s==null||n.has(s))return;n.add(s);let l=s.call(i.klass);l!==null&&r(l)}),t&&r(t),e}function Bi(o){let t=o||{},e=Zu(),n=t.theme||{},r=o===void 0?e:t.parentEditor||null,i=t.disableEvents||!1,s=Ir(),l=t.namespace||(r!==null?r._config.namespace:dl()),a=t.editorState,d=[Go,nt,Wo,qo,ot,bo,...t.nodes||[]],{onError:u,html:m}=t,c=t.editable!==void 0?t.editable:!0,f;if(o===void 0&&e!==null)f=e._nodes;else{f=new Map;for(let h=0;h{N.hasOwnProperty(B)||console.warn(`${A} must implement static "${B}" method`)}),!N.hasOwnProperty("importDOM")&&N.hasOwnProperty("exportDOM")&&console.warn(`${A} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),$ instanceof kt&&($.hasOwnProperty("decorate")||console.warn(`${$.constructor.name} must implement "decorate" method`)),N.hasOwnProperty("importJSON")||console.warn(`${A} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),$.hasOwnProperty("exportJSON")||console.warn(`${A} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}let S=N.getType(),v=N.transform(),M=new Set;v!==null&&M.add(v),f.set(S,{exportDOM:m&&m.export?m.export.get(N):void 0,klass:N,replace:b,replaceWithKlass:x,transforms:M})}}let g=new eo(s,r,f,{disableEvents:i,namespace:l,theme:n},u||console.error,GN(f,m?m.import:void 0),c);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=Xt),g}var eo=class{constructor(t,e,n,r,i,s,l){p(this,"constructor");p(this,"_headless");p(this,"_parentEditor");p(this,"_rootElement");p(this,"_editorState");p(this,"_pendingEditorState");p(this,"_compositionKey");p(this,"_deferred");p(this,"_keyToDOMMap");p(this,"_updates");p(this,"_updating");p(this,"_listeners");p(this,"_commands");p(this,"_nodes");p(this,"_decorators");p(this,"_pendingDecorators");p(this,"_config");p(this,"_dirtyType");p(this,"_cloneNotNeeded");p(this,"_dirtyLeaves");p(this,"_dirtyElements");p(this,"_normalizedNodes");p(this,"_updateTags");p(this,"_observer");p(this,"_key");p(this,"_onError");p(this,"_htmlConversions");p(this,"_window");p(this,"_editable");p(this,"_blockCursorElement");this._parentEditor=e,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=Mt,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=dl(),this._onError=i,this._htmlConversions=s,this._editable=l,this._headless=e!==null&&e._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){let e=this._listeners.update;return e.add(t),()=>{e.delete(t)}}registerEditableListener(t){let e=this._listeners.editable;return e.add(t),()=>{e.delete(t)}}registerDecoratorListener(t){let e=this._listeners.decorator;return e.add(t),()=>{e.delete(t)}}registerTextContentListener(t){let e=this._listeners.textcontent;return e.add(t),()=>{e.delete(t)}}registerRootListener(t){let e=this._listeners.root;return t(this._rootElement,null),e.add(t),()=>{t(null,this._rootElement),e.delete(t)}}registerCommand(t,e,n){n===void 0&&T(!1,'Listener for type "command" requires a "priority".');let r=this._commands;r.has(t)||r.set(t,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(t);i===void 0&&T(!1,"registerCommand: Command %s not found in command map",String(t));let s=i[n];return s.add(e),()=>{s.delete(e),i.every(l=>l.size===0)&&r.delete(t)}}registerMutationListener(t,e,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;i.set(e,r);let s=n&&n.skipInitialization;return(s===void 0?jN:s)||this.initializeMutationListener(e,r),()=>{i.delete(e)}}getRegisteredNode(t){let e=this._nodes.get(t.getType());return e===void 0&&T(!1,"Node %s has not been registered. Ensure node has been passed to createEditor.",t.name),e}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,e){let n=this._editorState,r=Dc(n).get(e.getType());if(!r)return;let i=new Map;for(let s of r.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,e){let n=this.getRegisteredNode(t);return n.transforms.add(e),n}registerNodeTransform(t,e){let n=this.registerNodeTransformToKlass(t,e),r=[n],i=n.replaceWithKlass;if(i!=null){let s=this.registerNodeTransformToKlass(i,e);r.push(s)}return Vd(this,t.getType()),()=>{r.forEach(s=>s.transforms.delete(e))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,e){return O(this,t,e)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){let e=this._rootElement;if(t!==e){let n=xo(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,Jl(this,e,t,r),e!==null&&(this._config.disableEvents||Jc(e),n!=null&&e.classList.remove(...n)),t!==null){let i=wc(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=Xt,ai(this),this._updateTags.add("history-merge"),Rt(this),this._config.disableEvents||Gc(t,this),n!=null&&t.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;Hn("root",this,!1,t,e)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,e){t.isEmpty()&&T(!1,"setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty."),li(this);let n=this._pendingEditorState,r=this._updateTags,i=e!==void 0?e.tag:null;n!==null&&!n.isEmpty()&&(i!=null&&r.add(i),Rt(this)),this._pendingEditorState=t,this._dirtyType=Xt,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&r.add(i),Rt(this)}parseEditorState(t,e){let n=typeof t=="string"?JSON.parse(t):t;return Vu(n,this,e)}read(t){return Rt(this),this.getEditorState().read(t,{editor:this})}update(t,e){Te(this,t,e)}updateAndCommit(t,e){this.update(t,e),this.commitUpdates()}focus(t,e={}){let n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),Te(this,()=>{let r=C(),i=H();r!==null?r.dirty=!0:i.getChildrenSize()!==0&&(e.defaultSelection==="rootStart"?i.selectStart():i.selectEnd())},{onUpdate:()=>{n.removeAttribute("autocapitalize"),t&&t()},tag:"focus"}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}commitUpdates(){Rt(this)}blur(){let t=this._rootElement;t!==null&&t.blur();let e=Le(this._window);e!==null&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,Hn("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}};p(eo,"version");eo.version="0.17.1";var Fi=0,Ql=1,ea=2,Et=0,JN=1,rf=2,QN=3,ex=4;function tx(o,t,e){let n=o._nodeMap,r=[];for(let i of t){let s=n.get(i);s!==void 0&&r.push(s)}for(let[i,s]of e){if(!s)continue;let l=n.get(i);l!==void 0&&!ne(l)&&r.push(l)}return r}function ox(o,t,e,n,r){if(o===null||e.size===0&&n.size===0&&!r)return Et;let i=t._selection,s=o._selection;if(r)return JN;if(!_(i)||!_(s)||!s.isCollapsed()||!i.isCollapsed())return Et;let l=tx(t,e,n);if(l.length===0)return Et;if(l.length>1){let b=t._nodeMap,x=b.get(i.anchor.key),S=b.get(s.anchor.key);return x&&S&&!o._nodeMap.has(x.__key)&&L(x)&&x.__text.length===1&&i.anchor.offset===1?rf:Et}let a=l[0],d=o._nodeMap.get(a.__key);if(!L(d)||!L(a)||d.__mode!==a.__mode)return Et;let u=d.__text,m=a.__text;if(u===m)return Et;let c=i.anchor,f=s.anchor;if(c.key!==f.key||c.type!=="text")return Et;let g=c.offset,h=f.offset,N=m.length-u.length;return N===1&&h===g-1?rf:N===-1&&h===g+1?QN:N===-1&&h===g?ex:Et}function nx(o,t,e){let n=t._nodeMap.get(o),r=e._nodeMap.get(o),i=t._selection,s=e._selection;return!(_(i)&&_(s)&&i.anchor.type==="element"&&i.focus.type==="element"&&s.anchor.type==="text"&&s.focus.type==="text")&&L(n)&&L(r)&&n.__parent===r.__parent?JSON.stringify(t.read(()=>n.exportJSON()))===JSON.stringify(e.read(()=>r.exportJSON())):!1}function rx(o,t){let e=Date.now(),n=Et;return(r,i,s,l,a,d)=>{let u=Date.now();if(d.has("historic"))return n=Et,e=u,ea;let m=ox(r,i,l,a,o.isComposing()),c=(()=>{let f=s===null||s.editor===o,g=d.has("history-push");if(!g&&f&&d.has("history-merge"))return Fi;if(r===null)return Ql;let N=i._selection;if(!(l.size>0||a.size>0))return N!==null?Fi:ea;if(g===!1&&m!==Et&&m===n&&u{let m=t.current,c=t.redoStack,f=t.undoStack,g=m===null?null:m.editorState;if(m!==null&&s===g)return;let h=n(l,s,m,a,d,u);if(h===Ql)c.length!==0&&(t.redoStack=[],o.dispatchCommand(po,!1)),m!==null&&(f.push({...m}),o.dispatchCommand(go,!0));else if(h===ea)return;t.current={editor:o,editorState:s}};return Dt(o.registerCommand(co,()=>(sx(o,t),!0),J),o.registerCommand(uo,()=>(ix(o,t),!0),J),o.registerCommand(Ys,()=>(sf(t),!1),J),o.registerCommand(Zs,()=>(sf(t),o.dispatchCommand(po,!1),o.dispatchCommand(go,!1),!0),J),o.registerUpdateListener(r))}function oa(){return{current:null,redoStack:[],undoStack:[]}}var af=o=>pe?(o||window).getSelection():null;function df(o,t=C()){return t==null&&T(!1,"Expected valid LexicalSelection"),_(t)&&t.isCollapsed()||t.getNodes().length===0?"":Ri(o,t)}function cf(o,t=C()){return t==null&&T(!1,"Expected valid LexicalSelection"),_(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(ff(o,t))}function Hi(o,t,e){let n=o.getData("application/x-lexical-editor");if(n)try{let s=JSON.parse(n);if(s.namespace===e._config.namespace&&Array.isArray(s.nodes)){let l=mf(s.nodes);return na(e,l,t)}}catch{}let r=o.getData("text/html");if(r)try{let l=new DOMParser().parseFromString(r,"text/html"),a=Ai(e,l);return na(e,a,t)}catch{}let i=o.getData("text/plain")||o.getData("text/uri-list");if(i!=null)if(_(t)){let s=i.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l0?a.text=d:r=!1}for(let d=0;d{o.update(()=>{a(lf(o,t,e))})});let n=o.getRootElement(),r=o._window==null?window.document:o._window.document,i=af(o._window);if(n===null||i===null)return!1;let s=r.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(r.createTextNode("#")),n.append(s);let l=new Range;return l.setStart(s,0),l.setEnd(s,1),i.removeAllRanges(),i.addRange(l),new Promise((a,d)=>{let u=o.registerCommand(fo,m=>(Nt(m,ClipboardEvent)&&(u(),Un!==null&&(window.clearTimeout(Un),Un=null),a(lf(o,m,e))),!0),Pe);Un=window.setTimeout(()=>{u(),Un=null,a(!1)},ax),r.execCommand("copy"),s.remove()})}function lf(o,t,e){if(e===void 0){let r=af(o._window);if(!r)return!1;let i=r.anchorNode,s=r.focusNode;if(i!==null&&s!==null&&!jt(o,i,s))return!1;let l=C();if(l===null)return!1;e=Ki(l)}t.preventDefault();let n=t.clipboardData;return n===null?!1:(pf(n,e),!0)}var dx=[["text/html",df],["application/x-lexical-editor",cf]];function Ki(o=C()){let t={"text/plain":o?o.getTextContent():""};if(o){let e=pl();for(let[n,r]of dx){let i=r(e,o);i!==null&&(t[n]=i)}}return t}function pf(o,t){for(let e in t){let n=t[e];n!==void 0&&o.setData(e,n)}}function Ui(o,t){if(typeof document.caretRangeFromPoint<"u"){let e=document.caretRangeFromPoint(o,t);return e===null?null:{node:e.startContainer,offset:e.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){let e=document.caretPositionFromPoint(o,t);return e===null?null:{node:e.offsetNode,offset:e.offset}}else return null}var gf=P("DRAG_DROP_PASTE_FILE");function cx(o,t){o.preventDefault(),t.update(()=>{let e=C(),n=Nt(o,InputEvent)||Nt(o,KeyboardEvent)?null:o.clipboardData;n!=null&&e!==null&&Hi(n,e,t)},{tag:"paste"})}async function ux(o,t){await zn(t,Nt(o,ClipboardEvent)?o:null),t.update(()=>{let e=C();_(e)?e.removeText():we(e)&&e.getNodes().forEach(n=>n.remove())})}function zi(o){let t=null;if(Nt(o,DragEvent)?t=o.dataTransfer:Nt(o,ClipboardEvent)&&(t=o.clipboardData),t===null)return[!1,[],!1];let e=t.types,n=e.includes("Files"),r=e.includes("text/html")||e.includes("text/plain");return[n,Array.from(t.files),r]}function Wi(o){let t=G(o);return F(t)}function fx(o){let t=o.focus;return t.key==="root"&&t.offset===H().getChildrenSize()}function ra(o){return Dt(o.registerCommand(Ht,e=>{let n=C();return we(n)?(n.clear(),!0):!1},0),o.registerCommand(Je,e=>{let n=C();return _(n)?(n.deleteCharacter(e),!0):!1},J),o.registerCommand(St,e=>{let n=C();return _(n)?(n.deleteWord(e),!0):!1},J),o.registerCommand(ut,e=>{let n=C();return _(n)?(n.deleteLine(e),!0):!1},J),o.registerCommand(ct,e=>{let n=C();if(typeof e=="string")n!==null&&n.insertText(e);else{if(n===null)return!1;let r=e.dataTransfer;if(r!=null)Hi(r,n,o);else if(_(n)){let i=e.data;return i&&n.insertText(i),!0}}return!0},J),o.registerCommand(hn,()=>{let e=C();return _(e)?(e.removeText(),!0):!1},J),o.registerCommand(Ee,e=>{let n=C();return _(n)?(n.formatText(e),!0):!1},J),o.registerCommand(Kt,e=>{let n=C();return _(n)?(n.insertLineBreak(e),!0):!1},J),o.registerCommand(Ut,()=>{let e=C();return _(e)?(e.insertParagraph(),!0):!1},J),o.registerCommand(Ws,()=>(ve([vt()]),!0),J),o.registerCommand(zt,e=>{let n=C();if(we(n)&&!Wi(e.target)){let r=n.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(_(n)){let r=Jt(n.focus,!0);if(!e.shiftKey&&F(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},J),o.registerCommand(Wt,e=>{let n=C();if(we(n)){let r=n.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(_(n)){if(fx(n))return e.preventDefault(),!0;let r=Jt(n.focus,!1);if(!e.shiftKey&&F(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},J),o.registerCommand(ko,e=>{let n=C();if(we(n)){let r=n.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!_(n))return!1;if(vi(n,!0)){let r=e.shiftKey;return e.preventDefault(),Di(n,r,!0),!0}return!1},J),o.registerCommand(Ro,e=>{let n=C();if(we(n)&&!Wi(e.target)){let i=n.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!_(n))return!1;let r=e.shiftKey;return vi(n,!1)?(e.preventDefault(),Di(n,r,!1),!0):!1},J),o.registerCommand(qt,e=>{if(Wi(e.target))return!1;let n=C();return _(n)?(e.preventDefault(),o.dispatchCommand(Je,!0)):!1},J),o.registerCommand(Yt,e=>{if(Wi(e.target))return!1;let n=C();return _(n)?(e.preventDefault(),o.dispatchCommand(Je,!1)):!1},J),o.registerCommand(Ue,e=>{let n=C();if(!_(n))return!1;if(e!==null){if((Lt||Zt||Vt)&&ho)return!1;if(e.preventDefault(),e.shiftKey)return o.dispatchCommand(Kt,!1)}return o.dispatchCommand(Ut,void 0)},J),o.registerCommand(Io,()=>{let e=C();return _(e)?(o.blur(),!0):!1},J),o.registerCommand(Po,e=>{let[,n]=zi(e);if(n.length>0){let i=e.clientX,s=e.clientY,l=Ui(i,s);if(l!==null){let{offset:a,node:d}=l,u=G(d);if(u!==null){let m=Xo();if(L(u))m.anchor.set(u.getKey(),a,"text"),m.focus.set(u.getKey(),a,"text");else{let f=u.getParentOrThrow().getKey(),g=u.getIndexWithinParent()+1;m.anchor.set(f,g,"element"),m.focus.set(f,g,"element")}let c=Bo(m);Y(c)}o.dispatchCommand(gf,n)}return e.preventDefault(),!0}let r=C();return!!_(r)},J),o.registerCommand(sr,e=>{let[n]=zi(e),r=C();return!(n&&!_(r))},J),o.registerCommand(lr,e=>{let[n]=zi(e),r=C();if(n&&!_(r))return!1;let i=e.clientX,s=e.clientY,l=Ui(i,s);if(l!==null){let a=G(l.node);F(a)&&e.preventDefault()}return!0},J),o.registerCommand(Nn,()=>(fl(),!0),J),o.registerCommand(fo,e=>(zn(o,Nt(e,ClipboardEvent)?e:null),!0),J),o.registerCommand(mo,e=>(ux(e,o),!0),J),o.registerCommand(ao,e=>{let[,n,r]=zi(e);return n.length>0&&!r?(o.dispatchCommand(gf,n),!0):Ln(e.target)?!1:C()!==null?(cx(e,o),!0):!1},J))}var Jo=class o extends V{constructor(e,n){super(n);p(this,"__id","");p(this,"__category","info");p(this,"__alignment","");p(this,"__inset",0);this.__category=e}static getType(){return"callout"}static clone(e){let n=new o(e.__category,e.__key);return n.__id=e.__id,n.__alignment=e.__alignment,n.__inset=e.__inset,n}setCategory(e){let n=this.getWritable();n.__category=e}getCategory(){return this.getLatest().__category}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}setInset(e){let n=this.getWritable();n.__inset=e}getInset(){return this.getLatest().__inset}createDOM(e,n){let r=document.createElement("p");return r.classList.add("callout",this.__category||""),st(r,this),r}updateDOM(e){return e.__category!==this.__category||Mo(e,this)}insertNewAfter(e,n){let r=e?e.anchor.offset:0,i=r===this.getTextContentSize()||!e?I():Wn(this.__category);if(i.setDirection(this.getDirection()),this.insertAfter(i,n),r===0&&!this.isEmpty()&&e){let s=I();s.select(),this.replace(s,!0)}return i}static importDOM(){return{p(e){return e.classList.contains("callout")?{conversion:n=>{let r="info",i=["info","success","warning","danger"];for(let l of i)if(n.classList.contains(l)){r=l;break}let s=new o(r);return it(n,s),{node:s}},priority:3}:null}}}exportJSON(){return{...super.exportJSON(),type:"callout",version:1,category:this.__category,id:this.__id,alignment:this.__alignment,inset:this.__inset}}static importJSON(e){let n=Wn(e.category);return lt(e,n),n}};function Wn(o="info"){return new Jo(o)}function ia(o){return o instanceof Jo}function sa(o,t="info"){return o instanceof Jo&&o.getCategory()===t}var Qo=class o extends V{constructor(e,n={},r){super(r);p(this,"__url");p(this,"__target");p(this,"__rel");p(this,"__title");let{target:i=null,rel:s=null,title:l=null}=n;this.__url=e,this.__target=i,this.__rel=s,this.__title=l}static getType(){return"link"}static clone(e){return new o(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}createDOM(e){let n=document.createElement("a");return n.href=this.__url,this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),_e(n,e.theme.link),n}updateDOM(e,n,r){if(n instanceof HTMLAnchorElement){let i=this.__url,s=this.__target,l=this.__rel,a=this.__title;i!==e.__url&&(n.href=i),s!==e.__target&&(s?n.target=s:n.removeAttribute("target")),l!==e.__rel&&(l?n.rel=l:n.removeAttribute("rel")),a!==e.__title&&(a?n.title=a:n.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:mx,priority:1})}}static importJSON(e){let n=Tt(e.url,{rel:e.rel,target:e.target,title:e.title});return n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){let n=this.getWritable();n.__url=e}getTarget(){return this.getLatest().__target}setTarget(e){let n=this.getWritable();n.__target=e}getRel(){return this.getLatest().__rel}setRel(e){let n=this.getWritable();n.__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){let n=this.getWritable();n.__title=e}insertNewAfter(e,n=!0){let r=Tt(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n,r){if(!_(n))return!1;let i=n.anchor.getNode(),s=n.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function mx(o){let t=null;if(Ni(o)){let e=o.textContent;(e!==null&&e!==""||o.children.length>0)&&(t=Tt(o.getAttribute("href")||"",{rel:o.getAttribute("rel"),target:o.getAttribute("target"),title:o.getAttribute("title")}))}return{node:t}}function Tt(o,t){return re(new Qo(o,t))}function $t(o){return o instanceof Qo}var P0=P("TOGGLE_LINK_COMMAND");var en=class o extends V{constructor(e,n,r){super(r);p(this,"__src","");p(this,"__alt","");p(this,"__width",0);p(this,"__height",0);p(this,"__alignment","");this.__src=e,n.alt&&(this.__alt=n.alt),n.width&&(this.__width=n.width),n.height&&(this.__height=n.height)}static getType(){return"image"}static clone(e){let n=new o(e.__src,{alt:e.__alt,width:e.__width,height:e.__height},e.__key);return n.__alignment=e.__alignment,n}setSrc(e){let n=this.getWritable();n.__src=e}getSrc(){return this.getLatest().__src}setAltText(e){let n=this.getWritable();n.__alt=e}getAltText(){return this.getLatest().__alt}setHeight(e){let n=this.getWritable();n.__height=e}getHeight(){return this.getLatest().__height}setWidth(e){let n=this.getWritable();n.__width=e}getWidth(){return this.getLatest().__width}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}isInline(){return!0}createDOM(e,n){let r=document.createElement("img");return r.setAttribute("src",this.__src),this.__width&&r.setAttribute("width",String(this.__width)),this.__height&&r.setAttribute("height",String(this.__height)),this.__alt&&r.setAttribute("alt",this.__alt),this.__alignment&&r.classList.add("align-"+this.__alignment),r.addEventListener("click",i=>{n.update(()=>{this.select()})}),r}updateDOM(e,n){return e.__src!==this.__src&&n.setAttribute("src",this.__src),e.__width!==this.__width&&(this.__width?n.setAttribute("width",String(this.__width)):n.removeAttribute("width")),e.__height!==this.__height&&(this.__height?n.setAttribute("height",String(this.__height)):n.removeAttribute("height")),e.__alt!==this.__alt&&(this.__alt?n.setAttribute("alt",String(this.__alt)):n.removeAttribute("alt")),e.__alignment!==this.__alignment&&(e.__alignment&&n.classList.remove("align-"+e.__alignment),this.__alignment&&n.classList.add("align-"+this.__alignment)),!1}static importDOM(){return{img(e){return{conversion:n=>{let r=n.getAttribute("src")||"",i={alt:n.getAttribute("alt")||"",height:Number.parseInt(n.getAttribute("height")||"0"),width:Number.parseInt(n.getAttribute("width")||"0")},s=new o(r,i);return s.setAlignment($r(n)),{node:s}},priority:3}}}}exportJSON(){return{...super.exportJSON(),type:"image",version:1,src:this.__src,alt:this.__alt,height:this.__height,width:this.__width,alignment:this.__alignment}}static importJSON(e){let n=tn(e.src,{alt:e.alt,width:e.width,height:e.height});return n.setAlignment(e.alignment),n}};function tn(o,t={}){return new en(o,t)}function je(o){return o instanceof en}var qn=class o extends V{constructor(){super(...arguments);p(this,"__id","");p(this,"__summary","");p(this,"__open",!1)}static getType(){return"details"}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setSummary(e){let n=this.getWritable();n.__summary=e}getSummary(){return this.getLatest().__summary}setOpen(e){let n=this.getWritable();n.__open=e}getOpen(){return this.getLatest().__open}static clone(e){let n=new o(e.__key);return n.__id=e.__id,n.__dir=e.__dir,n.__summary=e.__summary,n.__open=e.__open,n}createDOM(e,n){let r=document.createElement("details");this.__id&&r.setAttribute("id",this.__id),this.__dir&&r.setAttribute("dir",this.__dir),this.__open?(r.setAttribute("open","true"),r.removeAttribute("contenteditable")):r.setAttribute("contenteditable","false");let i=document.createElement("summary");return i.textContent=this.__summary,i.setAttribute("contenteditable","false"),i.addEventListener("click",s=>{s.preventDefault(),n.update(()=>{this.select()})}),r.append(i),r}updateDOM(e,n){return e.__open!==this.__open&&(n.toggleAttribute("open",this.__open),this.__open?n.removeAttribute("contenteditable"):n.setAttribute("contenteditable","false")),e.__id!==this.__id||e.__dir!==this.__dir||e.__summary!==this.__summary}static importDOM(){return{details(e){return{conversion:n=>{let r=new o;n.id&&r.setId(n.id),n.dir&&r.setDirection(Pr(n));let i=Array.from(n.children).find(s=>s.nodeName==="SUMMARY");return r.setSummary(i?.textContent||""),{node:r}},priority:3}},summary(e){return{conversion:n=>({node:"ignore"}),priority:3}}}}exportDOM(e){let n=this.createDOM(e._config,e),r=n.querySelectorAll("[contenteditable]");for(let i of r)i.removeAttribute("contenteditable");return n.removeAttribute("open"),n.removeAttribute("contenteditable"),{element:n}}exportJSON(){return{...super.exportJSON(),type:"details",version:1,id:this.__id,summary:this.__summary}}static importJSON(e){let n=la();return n.setId(e.id),n.setDirection(e.direction),n}shouldSelectDirectly(){return!0}canBeEmpty(){return!1}};function la(){return new qn}function ce(o){return o instanceof qn}function aa(o){let t=1,e=o.getParent();for(;e!=null;){if(X(e)){let n=e.getParent();if(z(n)){t++,e=n.getParent();continue}T(!1,"A ListItemNode must have a ListNode for a parent.")}return t}return t}function da(o){let t=o.getParent();z(t)||T(!1,"A ListItemNode must have a ListNode for a parent.");let e=t;for(;e!==null;)e=e.getParent(),z(e)&&(t=e);return t}function ca(o){let t=[],e=o.getChildren().filter(X);for(let n=0;n{let e=C();if(e!==null){let n=e.getNodes();if(_(e)){let i=e.getStartEndPoints();T(i!==null,"insertList: anchor should be defined");let[s]=i,l=s.getNode(),a=l.getParent();if(xf(l,n)){let d=ye(t);if(ge(a)){l.replace(d);let u=Be();d.append(u)}else if(X(l)){let u=l.getParentOrThrow();Br(d,u.getChildren()),u.replace(d)}return}}let r=new Set;for(let i=0;i0&&o.append(...r),t.remove()}function fa(o){o.update(()=>{let t=C();if(_(t)){let e=new Set,n=t.getNodes(),r=t.anchor.getNode();if(xf(r,n))e.add(da(r));else for(let i=0;i{if(T(X(e),"node is not a ListItemNode"),e.__checked==null)return;let n=e.getParent();z(n)&&n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:px,priority:0})}}static importJSON(e){let n=Be();return n.setChecked(e.checked),n.setValue(e.value),n.setDirection(e.direction),n}exportDOM(e){let n=this.createDOM(e._config);if(n.classList.contains("task-list-item")){let r=y("input",{type:"checkbox",disabled:"disabled"});n.hasAttribute("checked")&&(r.setAttribute("checked","checked"),n.removeAttribute("checked")),n.prepend(r)}return{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let n=0;n{e.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){let r=this.getParentOrThrow();if(z(r)||T(!1,"insertAfter: list node is not parent of list item node"),X(e))return super.insertAfter(e,n);let i=this.getNextSiblings();if(r.insertAfter(e,n),i.length!==0){let s=ye(r.getListType());i.forEach(l=>s.append(l)),e.insertAfter(s,n)}return e}remove(e){let n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&Yn(n)&&Yn(r)&&(qi(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,n=!0){if(this.getTextContent().trim()===""&&this.isLastChild()){let i=this.getParentOrThrow(),s=i.getParent();if(X(s))return s.insertAfter(this),this.selectStart(),null;{let l=I();return i.insertAfter(l,n),this.remove(),l}}let r=Be(this.__checked==null?void 0:!1);return this.insertAfter(r,n),r}collapseAtStart(e){let n=I();this.getChildren().forEach(a=>n.append(a));let i=this.getParentOrThrow(),s=i.getParentOrThrow(),l=X(s);if(i.getChildrenSize()===1)if(l)i.remove(),s.select();else{i.insertBefore(n),i.remove();let a=e.anchor,d=e.focus,u=n.getKey();a.type==="element"&&a.getNode().is(this)&&a.set(u,a.offset,"element"),d.type==="element"&&d.getNode().is(this)&&d.set(u,d.offset,"element")}else i.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let n=this.getWritable();n.__value=e}getChecked(){let e=this.getLatest(),n,r=this.getParent();return z(r)&&(n=r.getListType()),n==="check"?!!e.__checked:void 0}setChecked(e){let n=this.getWritable();n.__checked=e}toggleChecked(){this.setChecked(!this.__checked)}canInsertAfter(e){return X(e)}canReplaceWith(e){return X(e)}canMergeWith(e){return Ve(e)||X(e)}extractWithChild(e,n){if(!_(n))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return ye("bullet")}canMergeWhenEmpty(){return!0}};function Cf(o){let t=o.getChildren(),e=!1,n=!1;for(let r of t)z(r)?n=!0:r.getTextContent().trim().length>0&&(e=!0);return n&&!e}function bf(o,t){let e=!z(t.getFirstChild());o.classList.toggle("task-list-item",e),t.__checked?o.setAttribute("checked","checked"):o.removeAttribute("checked")}function px(o){if(o.classList.contains("task-list-item")){for(let r of o.children)if(r.tagName==="INPUT")return gx(r)}let e=o.getAttribute("aria-checked");return{node:Be(e==="true"?!0:e==="false"?!1:void 0)}}function gx(o){if(!(o.getAttribute("type")==="checkbox"))return{node:null};let e=o.hasAttribute("checked");return{node:Be(e)}}function Be(o){return re(new Pt(void 0,o))}function X(o){return o instanceof Pt}var vo=class o extends V{constructor(e,n,r){super(r);p(this,"__tag");p(this,"__start");p(this,"__listType");p(this,"__id","");let i=xx[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=n}static getType(){return"list"}static clone(e){let n=new o(e.__listType,e.__start,e.__key);return n.__id=e.__id,n.__dir=e.__dir,n}getTag(){return this.__tag}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setListType(e){let n=this.getWritable();n.__listType=e,n.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,n){let r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,_f(i,e.theme,this),this.__id&&i.setAttribute("id",this.__id),this.__dir&&i.setAttribute("dir",this.__dir),i}updateDOM(e,n,r){return e.__tag!==this.__tag||e.__dir!==this.__dir||e.__id!==this.__id?!0:(_f(n,r.theme,this),!1)}static transform(){return e=>{T(z(e),"node is not a ListNode"),Tf(e),Ef(e)}}static importDOM(){return{ol:()=>({conversion:yf,priority:0}),ul:()=>({conversion:yf,priority:0})}}static importJSON(e){let n=ye(e.listType,e.start);return n.setId(e.id),n.setDirection(e.direction),n}exportDOM(e){let{element:n}=super.exportDOM(e);return n&&he(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1,id:this.__id}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let n=0;n1?n.push(...g):r.push(...g)}}r.length>0&&Oi(o,...r),n.length>0&&_e(o,...n)}function hx(o){let t=[];for(let e of o)X(e)?t.push(e):t.push(hf(e));return t}function Nx(o){if(o.getAttribute("__lexicallisttype")==="check"||o.classList.contains("contains-task-list"))return!0;for(let t of o.childNodes)if(he(t)&&(t.hasAttribute("aria-checked")||t.classList.contains("task-list-item")||t.firstElementChild&&t.firstElementChild.matches('input[type="checkbox"]')))return!0;return!1}function yf(o){let t=o.nodeName.toLowerCase(),e=null;if(t==="ol"){let n=o.start;e=ye("number",n)}else t==="ul"&&(Nx(o)?e=ye("check"):e=ye("bullet"));return o.id&&e&&e.setId(o.id),o.dir&&e&&e.setDirection(Pr(o)),{after:hx,node:e}}var xx={ol:"number",ul:"bullet"};function ye(o,t=1){return re(new vo(o,t))}function z(o){return o instanceof vo}var fM=P("INSERT_UNORDERED_LIST_COMMAND"),mM=P("INSERT_ORDERED_LIST_COMMAND"),pM=P("INSERT_CHECK_LIST_COMMAND"),gM=P("REMOVE_LIST_COMMAND");var ie={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},no=class o extends V{constructor(e=ie.NO_STATUS,n=1,r,i){super(i);p(this,"__colSpan");p(this,"__rowSpan");p(this,"__headerState");p(this,"__width");p(this,"__backgroundColor");p(this,"__styles",new Map);p(this,"__alignment","");this.__colSpan=n,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null}static getType(){return"tablecell"}static clone(e){let n=new o(e.__headerState,e.__colSpan,e.__width,e.__key);return n.__rowSpan=e.__rowSpan,n.__backgroundColor=e.__backgroundColor,n.__styles=new Map(e.__styles),n.__alignment=e.__alignment,n}static importDOM(){return{td:e=>({conversion:Sf,priority:0}),th:e=>({conversion:Sf,priority:0})}}static importJSON(e){let n=Fe(e.headerState,e.colSpan,e.width);return e.rowSpan&&n.setRowSpan(e.rowSpan),n.setStyles(new Map(Object.entries(e.styles))),n.setAlignment(e.alignment),n}createDOM(e){let n=document.createElement(this.getTag());this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),_e(n,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader);for(let[r,i]of this.__styles.entries())n.style.setProperty(r,i);return this.__alignment&&n.classList.add("align-"+this.__alignment),n}exportDOM(e){let{element:n}=super.exportDOM(e);return{element:n}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth(),styles:Object.fromEntries(this.__styles),alignment:this.__alignment}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e){let n=this.getWritable();return n.__headerState=e,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let n=this.getWritable();return n.__width=e,this.__width}getWidth(){return this.getLatest().__width}clearWidth(){let e=this.getWritable();e.__width=void 0}getStyles(){let e=this.getLatest();return new Map(e.__styles)}setStyles(e){let n=this.getWritable();n.__styles=new Map(e)}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}updateTag(e){let r=e.toLowerCase()==="th"?ie.ROW:ie.NO_STATUS,i=this.getWritable();i.__headerState=r}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){this.getWritable().__backgroundColor=e}toggleHeaderStyle(e){let n=this.getWritable();return(n.__headerState&e)===e?n.__headerState-=e:n.__headerState+=e,n}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==ie.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__styles!==this.__styles||e.__alignment!==this.__alignment}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function Sf(o){let t=o,e=o.nodeName.toLowerCase(),n;/^(\d+(?:\.\d+)?)px$/.test(t.style.width)&&(n=parseFloat(t.style.width));let i=Fe(e==="th"?ie.ROW:ie.NO_STATUS,t.colSpan,n);i.__rowSpan=t.rowSpan;let s=t.style,l=s.textDecoration.split(" "),a=s.fontWeight==="700"||s.fontWeight==="bold",d=l.includes("line-through"),u=s.fontStyle==="italic",m=l.includes("underline");if(o instanceof HTMLElement){let f=Bn(o);f.delete("background-color"),i.setStyles(f),i.setAlignment($r(o))}let c=s.backgroundColor||null;return c&&i.setBackgroundColor(c),{after:f=>(f.length===0&&f.push(I()),f),forChild:(f,g)=>{if(D(g)&&!E(f)){let h=I();return ke(f)&&f.getTextContent()===` -`?null:(L(f)&&(a&&f.toggleFormat("bold"),d&&f.toggleFormat("strikethrough"),u&&f.toggleFormat("italic"),m&&f.toggleFormat("underline")),h.append(f),h)}return f},node:i}}function Fe(o=ie.NO_STATUS,t=1,e){return re(new no(o,t,e))}function D(o){return o instanceof no}var Ex=P("INSERT_TABLE_COMMAND");var ro=class o extends V{constructor(e){super(e);p(this,"__height");p(this,"__styles",new Map)}static getType(){return"tablerow"}static clone(e){let n=new o(e.__key);return n.__styles=new Map(e.__styles),n}static importDOM(){return{tr:e=>({conversion:Tx,priority:0})}}static importJSON(e){let n=on();return n.setStyles(new Map(Object.entries(e.styles))),n}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1,styles:Object.fromEntries(this.__styles),height:this.__height||0}}createDOM(e){let n=document.createElement("tr");this.__height&&(n.style.height=`${this.__height}px`);for(let[r,i]of this.__styles.entries())n.style.setProperty(r,i);return _e(n,e.theme.tableRow),n}isShadowRoot(){return!0}getStyles(){let e=this.getLatest();return new Map(e.__styles)}setStyles(e){let n=this.getWritable();n.__styles=new Map(e)}setHeight(e){let n=this.getWritable();return n.__height=e,this.__height}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height||e.__styles!==this.__styles}canBeEmpty(){return!1}canIndent(){return!1}};function Tx(o){let t=on(),n=Zo(o.style.height);return t.setHeight(n),o instanceof HTMLElement&&t.setStyles(Bn(o)),{node:t}}function on(){return re(new ro)}function te(o){return o instanceof ro}var Zn=class o extends V{static getType(){return"caption"}static clone(t){return new o(t.__key)}createDOM(t,e){return document.createElement("caption")}updateDOM(t,e,n){return!1}isParentRequired(){return!0}canBeEmpty(){return!1}exportJSON(){return{...super.exportJSON(),type:"caption",version:1}}insertDOMIntoParent(t,e){return e.insertBefore(t,e.firstChild),!0}static importJSON(t){return ma()}static importDOM(){return{caption:t=>({conversion(e){return{node:ma()}},priority:0})}}};function ma(){return new Zn}function Fr(o){return o instanceof Zn}function pa(o){for(let t of o.getChildren())if(Fr(t))return!0;return!1}function Lf(o,t=""){let e=ma(),n=q(t||" ");e.append(n),o.append(e)}function ha(o,t,e=!0){let n=Kr();for(let r=0;ro===ie.BOTH||o===t?t:ie.NO_STATUS;function Yi(o=!0){let t=C();T(_(t)||W(t),"Expected a RangeSelection or TableSelection");let e=t.focus.getNode(),[n,,r]=Oe(e),[i,s]=at(r,n,n),l=i[0].length,{startRow:a}=s;if(o){let d=a+n.__rowSpan-1,u=i[d],m=on();for(let f=0;f1;)if(k-=M.__colSpan,k>=0){let{cell:j,startRow:se}=x[k];$=j,B=se}else{N.append(h(v));continue e}$.insertAfter(h(v))}else M.setColSpan(M.__colSpan+1)}g!==null&&Hr(g)}function Na(){let o=C();T(_(o)||W(o),"Expected a RangeSelection or TableSelection");let t=o.anchor.getNode(),e=o.focus.getNode(),[n,,r]=Oe(t),[i]=Oe(e),[s,l,a]=at(r,n,i),{startRow:d}=l,{startRow:u}=a,m=u+i.__rowSpan-1;if(s.length===m-d+1){r.remove();return}let c=s[0].length,f=s[m+1],g=r.getChildAtIndex(m+1);for(let h=m;h>=d;h--){for(let b=c-1;b>=0;b--){let{cell:x,startRow:S,startColumn:v}=s[h][b];if(v===b&&(h===d&&S=d&&S+x.__rowSpan-1>m))if(x.setRowSpan(x.__rowSpan-(m-S+1)),T(g!==null,"Expected nextRowNode not to be null"),b===0)Ea(g,x);else{let{cell:M}=f[b-1];M.insertAfter(x)}}let N=r.getChildAtIndex(h);T(te(N),"Expected GridNode childAtIndex(%s) to be RowNode",String(h)),N.remove()}if(f!==void 0){let{cell:h}=f[0];Hr(h)}else{let h=s[d-1],{cell:N}=h[0];Hr(N)}}function xa(){let o=C();T(_(o)||W(o),"Expected a RangeSelection or TableSelection");let t=o.anchor.getNode(),e=o.focus.getNode(),[n,,r]=Oe(t),[i]=Oe(e),[s,l,a]=at(r,n,i),{startColumn:d}=l,{startRow:u,startColumn:m}=a,c=Math.min(d,m),f=Math.max(d+n.__colSpan-1,m+i.__colSpan-1),g=f-c+1;if(s[0].length===f-c+1){r.selectPrevious(),r.remove();return}let N=s.length;for(let S=0;Sf){if(v===f){let A=f-R+1;M.setColSpan(M.__colSpan-A)}}else M.remove()}let b=s[u],x=d>m?b[d+n.__colSpan]:b[m+i.__colSpan];if(x!==void 0){let{cell:S}=x;Hr(S)}else{let S=m1){for(let l=1;l1){let[l,a]=at(r,e,e),{startColumn:d,startRow:u}=a,m;for(let c=1;c1&&(N+=x.__colSpan-1)}if(h===null)for(let N=0;N!Fr(d));for(let d=0;dx||h>S;){if(cx){let A=S-b,$=x+1;for(let B=0;B<=A;B++)v(d[b+B][$]);x=$}if(h>S){let A=x-N,$=S+1;for(let B=0;B<=A;B++)v(d[$][N+B]);S=$}}let M=[l],R=null;for(let A=f;A<=h;A++)for(let $=c;$<=g;$++){let{cell:B}=d[A][$],k=B.getParent();T(te(k),"Expected TableCellNode parent to be a TableRowNode"),k!==R&&M.push(k),M.push(B,...Cx(B)),R=k}return ft()||(this._cachedNodes=M),M}getTextContent(){let t=this.getNodes().filter(n=>D(n)),e="";for(let n=0;n0;){let n=e.pop();T(n!==void 0,"Stack.length > 0; can't be undefined"),E(n)&&e.unshift(...n.getChildren()),n!==o&&t.push(n)}return t}var zr=class{constructor(t,e){p(this,"focusX");p(this,"focusY");p(this,"listenersToRemove");p(this,"table");p(this,"isHighlightingCells");p(this,"anchorX");p(this,"anchorY");p(this,"tableNodeKey");p(this,"anchorCell");p(this,"focusCell");p(this,"anchorCellNodeKey");p(this,"focusCellNodeKey");p(this,"editor");p(this,"tableSelection");p(this,"hasHijackedSelectionStyles");p(this,"isSelecting");this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=e,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable(),this.isSelecting=!1}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(t=>t())}trackTable(){let t=new MutationObserver(e=>{this.editor.update(()=>{let n=!1;for(let i=0;i{let e=this.editor.getElementByKey(this.tableNodeKey);if(!e)throw new Error("Expected to find TableElement in DOM");this.table=nn(e),t.observe(e,{attributes:!0,childList:!0,subtree:!0})})}clearHighlight(){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),t.update(()=>{let e=ee(this.tableNodeKey);if(!K(e))throw new Error("Expected TableNode.");let n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");let r=nn(n);Ur(t,r,null),Y(null),t.dispatchCommand(be,void 0)})}enableHighlightStyle(){let t=this.editor;t.update(()=>{let e=t.getElementByKey(this.tableNodeKey);if(!e)throw new Error("Expected to find TableElement in DOM");Oi(e,t._config.theme.tableSelection),e.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let t=this.editor;t.update(()=>{let e=t.getElementByKey(this.tableNodeKey);if(!e)throw new Error("Expected to find TableElement in DOM");_e(e,t._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(t){if(t!==null&&t.tableKey===this.tableNodeKey){let e=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.disableHighlightStyle(),Ur(e,this.table,this.tableSelection)}else t==null?this.clearHighlight():(this.tableNodeKey=t.tableKey,this.updateTableTableSelection(t))}setFocusCellForSelection(t,e=!1){let n=this.editor;n.update(()=>{let r=ee(this.tableNodeKey);if(!K(r))throw new Error("Expected TableNode.");if(!n.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");let s=t.x,l=t.y;if(this.focusCell=t,this.anchorCell!==null){let a=Ca(n._window);a&&a.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==s||this.anchorY!==l||e))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(s===this.focusX&&l===this.focusY)return;if(this.focusX=s,this.focusY=l,this.isHighlightingCells){let a=G(t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&D(a)&&r.is(Do(a))){let d=a.getKey();this.tableSelection=this.tableSelection.clone()||ji(),this.focusCellNodeKey=d,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),Y(this.tableSelection),n.dispatchCommand(be,void 0),Ur(n,this.table,this.tableSelection)}}})}setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y,this.editor.update(()=>{let e=G(t.elem);if(D(e)){let n=e.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():ji(),this.anchorCellNodeKey=n}})}formatCells(t){this.editor.update(()=>{let e=C();W(e)||T(!1,"Expected grid selection");let n=Xo(),r=n.anchor,i=n.focus;e.getNodes().forEach(s=>{D(s)&&s.getTextContentSize()!==0&&(r.set(s.getKey(),0,"element"),i.set(s.getKey(),s.getChildrenSize(),"element"),n.formatText(t))}),Y(e),this.editor.dispatchCommand(be,void 0)})}clearText(){let t=this.editor;t.update(()=>{let e=ee(this.tableNodeKey);if(!K(e))throw new Error("Expected TableNode.");let n=C();W(n)||T(!1,"Expected grid selection");let r=n.getNodes().filter(D);if(r.length===this.table.columns*this.table.rows){e.selectPrevious(),e.remove(),H().selectStart();return}r.forEach(i=>{if(E(i)){let s=I(),l=q();s.append(l),i.append(s),i.getChildren().forEach(a=>{a!==s&&a.remove()})}}),Ur(t,this.table,null),Y(null),t.dispatchCommand(be,void 0)})}};var bx="__lexicalTableSelection",Ca=o=>pe?(o||window).getSelection():null,_x=o=>(o.buttons&1)===1;function ya(o,t,e,n){let r=e.getRootElement();if(r===null)throw new Error("No root element.");let i=new zr(e,o.getKey()),s=e._window||window;yx(t,i);let l=()=>{let c=()=>{i.isSelecting=!1,s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f)},f=g=>{setTimeout(()=>{if(!_x(g)&&i.isSelecting){i.isSelecting=!1,s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);return}let h=_a(g.target);h!==null&&(i.anchorX!==h.x||i.anchorY!==h.y)&&(g.preventDefault(),i.setFocusCellForSelection(h))},0)};return{onMouseMove:f,onMouseUp:c}};t.addEventListener("mousedown",c=>{setTimeout(()=>{if(c.button!==0||!s)return;let f=_a(c.target);f!==null&&(sn(c),i.setAnchorCellForSelection(f));let{onMouseUp:g,onMouseMove:h}=l();i.isSelecting=!0,s.addEventListener("mouseup",g),s.addEventListener("mousemove",h)},0)});let a=c=>{c.button===0&&e.update(()=>{let f=C(),g=c.target;W(f)&&f.tableKey===i.tableNodeKey&&r.contains(g)&&i.clearHighlight()})};s.addEventListener("mousedown",a),i.listenersToRemove.add(()=>s.removeEventListener("mousedown",a)),i.listenersToRemove.add(e.registerCommand(Wt,c=>Wr(e,c,"down",o,i),Xe)),i.listenersToRemove.add(e.registerCommand(zt,c=>Wr(e,c,"up",o,i),Xe)),i.listenersToRemove.add(e.registerCommand(ko,c=>Wr(e,c,"backward",o,i),Xe)),i.listenersToRemove.add(e.registerCommand(Ro,c=>Wr(e,c,"forward",o,i),Xe)),i.listenersToRemove.add(e.registerCommand(Io,c=>{let f=C();if(W(f)){let g=U(f.focus.getNode(),D);if(D(g))return sn(c),g.selectEnd(),!0}return!1},Xe));let d=c=>()=>{let f=C();if(!rn(f,o))return!1;if(W(f))return i.clearText(),!0;if(_(f)){let g=U(f.anchor.getNode(),R=>D(R));if(!D(g))return!1;let h=f.anchor.getNode(),N=f.focus.getNode(),b=o.isParentOf(h),x=o.isParentOf(N);if(b&&!x||x&&!b)return i.clearText(),!0;let v=U(f.anchor.getNode(),R=>E(R)),M=v&&U(v,R=>E(R)&&D(R.getParent()));if(!E(M)||!E(v))return!1;if(c===ut&&M.getPreviousSibling()===null)return!0}return!1};[St,ut,Je].forEach(c=>{i.listenersToRemove.add(e.registerCommand(c,d(c),Pe))});let u=c=>{let f=C();if(!rn(f,o)){let g=f?f.getNodes():null;if(g){let h=g.find(N=>K(N)&&N.getKey()===i.tableNodeKey);if(K(h)){if(!h.getParent())return!1;h.remove()}}return!1}if(W(f))return c&&(c.preventDefault(),c.stopPropagation()),i.clearText(),!0;if(_(f)){let g=U(f.anchor.getNode(),h=>D(h));if(!D(g))return!1}return!1};i.listenersToRemove.add(e.registerCommand(qt,u,Pe)),i.listenersToRemove.add(e.registerCommand(Yt,u,Pe)),i.listenersToRemove.add(e.registerCommand(mo,c=>{let f=C();if(f){if(!(W(f)||_(f)))return!1;zn(e,Nt(c,ClipboardEvent)?c:null,Ki(f));let g=u(c);return _(f)&&f.removeText(),g}return!1},Pe)),i.listenersToRemove.add(e.registerCommand(Ee,c=>{let f=C();if(!rn(f,o))return!1;if(W(f))return i.formatCells(c),!0;if(_(f)){let g=U(f.anchor.getNode(),h=>D(h));if(!D(g))return!1}return!1},Pe)),i.listenersToRemove.add(e.registerCommand(ct,c=>{let f=C();if(!rn(f,o))return!1;if(W(f))return i.clearHighlight(),!1;if(_(f)){let g=U(f.anchor.getNode(),h=>D(h));if(!D(g))return!1;if(typeof c=="string"){let h=Df(e,f,o);if(h)return vf(h,o,[q(c)]),!0}}return!1},Pe)),n&&i.listenersToRemove.add(e.registerCommand($o,c=>{let f=C();if(!_(f)||!f.isCollapsed()||!rn(f,o))return!1;let g=Ji(f.anchor.getNode());if(g===null)return!1;sn(c);let h=o.getCordsFromCellNode(g,i.table);return Of(i,o,h.x,h.y,c.shiftKey?"backward":"forward"),!0},Pe)),i.listenersToRemove.add(e.registerCommand(ar,c=>o.isSelected(),Xe));function m(c){let f=o.getCordsFromCellNode(c,i.table);return o.getDOMCellFromCordsOrThrow(f.x,f.y,i.table)}return i.listenersToRemove.add(e.registerCommand(rr,c=>{let{nodes:f,selection:g}=c,h=g.getStartEndPoints(),N=W(g),x=_(g)&&U(g.anchor.getNode(),Ke=>D(Ke))!==null&&U(g.focus.getNode(),Ke=>D(Ke))!==null||N;if(f.length!==1||!K(f[0])||!x||h===null)return!1;let[S]=h,v=f[0],M=v.getChildren(),R=v.getFirstChildOrThrow().getChildrenSize(),A=v.getChildrenSize(),$=U(S.getNode(),Ke=>D(Ke)),B=$&&U($,Ke=>te(Ke)),k=B&&U(B,Ke=>K(Ke));if(!D($)||!te(B)||!K(k))return!1;let j=B.getIndexWithinParent(),se=Math.min(k.getChildrenSize()-1,j+A-1),He=$.getIndexWithinParent(),Cd=Math.min(B.getChildrenSize()-1,He+R-1),Eh=Math.min(He,Cd),Th=Math.min(j,se),Ch=Math.max(He,Cd),bh=Math.max(j,se),_h=k.getChildren(),bd=0;for(let Ke=Th;Ke<=bh;Ke++){let _d=_h[Ke];if(!te(_d))return!1;let yd=M[bd];if(!te(yd))return!1;let yh=_d.getChildren(),Sh=yd.getChildren(),Sd=0;for(let Hs=Eh;Hs<=Ch;Hs++){let ni=yh[Hs];if(!D(ni))return!1;let Ld=Sh[Sd];if(!D(Ld))return!1;let Lh=ni.getChildren();Ld.getChildren().forEach(gn=>{L(gn)&&I().append(gn),ni.append(gn)}),Lh.forEach(gn=>gn.remove()),Sd++}bd++}return!0},Pe)),i.listenersToRemove.add(e.registerCommand(be,()=>{let c=C(),f=Ze();if(_(c)){let{anchor:g,focus:h}=c,N=g.getNode(),b=h.getNode(),x=Ji(N),S=Ji(b),v=!!(x&&o.is(Do(x))),M=!!(S&&o.is(Do(S))),R=v!==M,A=v&&M,$=c.isBackward();if(R){let B=c.clone();if(M){let[k]=at(o,S,S),j=k[0][0].cell,se=k[k.length-1].at(-1).cell;B.focus.set($?j.getKey():se.getKey(),$?j.getChildrenSize():se.getChildrenSize(),"element")}Y(B),wf(e,i)}else A&&(x.is(S)||(i.setAnchorCellForSelection(m(x)),i.setFocusCellForSelection(m(S),!0),i.isSelecting||setTimeout(()=>{let{onMouseUp:B,onMouseMove:k}=l();i.isSelecting=!0,s.addEventListener("mouseup",B),s.addEventListener("mousemove",k)},0)))}else if(c&&W(c)&&c.is(f)&&c.tableKey===o.getKey()){let g=Ca(e._window);if(g&&g.anchorNode&&g.focusNode){let h=G(g.focusNode),N=h&&!o.is(Do(h)),b=G(g.anchorNode),x=b&&o.is(Do(b));if(N&&x&&g.rangeCount>0){let S=Zl(g,e);S&&(S.anchor.set(o.getKey(),c.isBackward()?o.getChildrenSize():0,"element"),g.removeAllRanges(),Y(S))}}}return c&&!c.is(f)&&(W(c)||W(f))&&i.tableSelection&&!i.tableSelection.is(f)?(W(c)&&c.tableKey===i.tableNodeKey?i.updateTableTableSelection(c):!W(c)&&W(f)&&f.tableKey===i.tableNodeKey&&i.updateTableTableSelection(null),!1):(i.hasHijackedSelectionStyles&&!o.isSelected()?Sx(e,i):!i.hasHijackedSelectionStyles&&o.isSelected()&&wf(e,i),!1)},Pe)),i.listenersToRemove.add(e.registerCommand(Ut,()=>{let c=C();if(!_(c)||!c.isCollapsed()||!rn(c,o))return!1;let f=Df(e,c,o);return f?(vf(f,o),!0):!1},Pe)),i}function yx(o,t){o[bx]=t}function _a(o){let t=o;for(;t!=null;){let e=t.nodeName;if(e==="TD"||e==="TH"){let n=t._cell;return n===void 0?null:n}t=t.parentNode}return null}function nn(o){let t=[],e={columns:0,domRows:t,rows:0},n=o.firstChild,r=0,i=0;for(t.length=0;n!=null;){let s=n.nodeName;if(s==="COLGROUP"||s==="CAPTION"){n=n.nextSibling;continue}if(s==="TD"||s==="TH"){let d=n,u={elem:d,hasBackgroundColor:d.style.backgroundColor!=="",highlighted:!1,x:r,y:i};n._cell=u;let m=t[i];m===void 0&&(m=t[i]=[]),m[r]=u}else{let d=n.firstChild;if(d!=null){n=d;continue}}let l=n.nextSibling;if(l!=null){r++,n=l;continue}let a=n.parentNode;if(a!=null){let d=a.nextSibling;if(d==null)break;i++,r=0,n=d}}return e.columns=r+1,e.rows=i+1,e}function Ur(o,t,e){let n=new Set(e?e.getNodes():[]);Sa(t,(r,i)=>{let s=r.elem;n.has(i)?(r.highlighted=!0,Af(o,r)):(r.highlighted=!1,Rf(o,r),s.getAttribute("style")||s.removeAttribute("style"))})}function Sa(o,t){let{domRows:e}=o;for(let n=0;n{e.highlighted=!0,Af(o,e)})}function Sx(o,t){t.enableHighlightStyle(),Sa(t.table,e=>{let n=e.elem;e.highlighted=!1,Rf(o,e),n.getAttribute("style")||n.removeAttribute("style")})}var Of=(o,t,e,n,r)=>{let i=r==="forward";switch(r){case"backward":case"forward":return e!==(i?o.table.columns-1:0)?Gi(t.getCellNodeFromCordsOrThrow(e+(i?1:-1),n,o.table),i):n!==(i?o.table.rows-1:0)?Gi(t.getCellNodeFromCordsOrThrow(i?0:o.table.columns-1,n+(i?1:-1),o.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return n!==0?Gi(t.getCellNodeFromCordsOrThrow(e,n-1,o.table),!1):Ar(t,!1),!0;case"down":return n!==o.table.rows-1?Gi(t.getCellNodeFromCordsOrThrow(e,n+1,o.table),!0):Ar(t,!0),!0;default:return!1}},Lx=(o,t,e,n,r)=>{let i=r==="forward";switch(r){case"backward":case"forward":return e!==(i?o.table.columns-1:0)&&o.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(e+(i?1:-1),n,o.table)),!0;case"up":return n!==0?(o.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(e,n-1,o.table)),!0):!1;case"down":return n!==o.table.rows-1?(o.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(e,n+1,o.table)),!0):!1;default:return!1}};function rn(o,t){if(_(o)||W(o)){let e=t.isParentOf(o.anchor.getNode()),n=t.isParentOf(o.focus.getNode());return e&&n}return!1}function Gi(o,t){t?o.selectStart():o.selectEnd()}var ba="172,206,247";function Af(o,t){let e=t.elem,n=G(e);T(D(n),"Expected to find LexicalNode from Table Cell DOMNode"),n.getBackgroundColor()===null?e.style.setProperty("background-color",`rgb(${ba})`):e.style.setProperty("background-image",`linear-gradient(to right, rgba(${ba},0.85), rgba(${ba},0.85))`),e.style.setProperty("caret-color","transparent")}function Rf(o,t){let e=t.elem,n=G(e);T(D(n),"Expected to find LexicalNode from Table Cell DOMNode"),n.getBackgroundColor()===null&&e.style.removeProperty("background-color"),e.style.removeProperty("background-image"),e.style.removeProperty("caret-color")}function Ji(o){let t=U(o,D);return D(t)?t:null}function Do(o){let t=U(o,K);return K(t)?t:null}function Wr(o,t,e,n,r){if((e==="up"||e==="down")&&Mx(o))return!1;let i=C();if(!rn(i,n)){if(_(i)){if(i.isCollapsed()&&e==="backward"){let s=i.anchor.type,l=i.anchor.offset;if(s!=="element"&&!(s==="text"&&l===0))return!1;let a=i.anchor.getNode();if(!a)return!1;let d=U(a,m=>E(m)&&!m.isInline());if(!d)return!1;let u=d.getPreviousSibling();return!u||!K(u)?!1:(sn(t),u.selectEnd(),!0)}else if(t.shiftKey&&(e==="up"||e==="down")){let s=i.focus.getNode();if(ge(s)){let l=i.getNodes()[0];if(l){let a=U(l,D);if(a&&n.isParentOf(a)){let d=n.getFirstDescendant(),u=n.getLastDescendant();if(!d||!u)return!1;let[m]=Oe(d),[c]=Oe(u),f=n.getCordsFromCellNode(m,r.table),g=n.getCordsFromCellNode(c,r.table),h=n.getDOMCellFromCordsOrThrow(f.x,f.y,r.table),N=n.getDOMCellFromCordsOrThrow(g.x,g.y,r.table);return r.setAnchorCellForSelection(h),r.setFocusCellForSelection(N,!0),!0}}return!1}else{let l=U(s,d=>E(d)&&!d.isInline());if(!l)return!1;let a=e==="down"?l.getNextSibling():l.getPreviousSibling();if(K(a)&&r.tableNodeKey===a.getKey()){let d=a.getFirstDescendant(),u=a.getLastDescendant();if(!d||!u)return!1;let[m]=Oe(d),[c]=Oe(u),f=i.clone();return f.focus.set((e==="up"?m:c).getKey(),e==="up"?0:c.getChildrenSize(),"element"),Y(f),!0}}}}return!1}if(_(i)&&i.isCollapsed()){let{anchor:s,focus:l}=i,a=U(s.getNode(),D),d=U(l.getNode(),D);if(!D(a)||!a.is(d))return!1;let u=Do(a);if(u!==n&&u!=null){let x=o.getElementByKey(u.getKey());if(x!=null)return r.table=nn(x),Wr(o,t,e,u,r)}if(e==="backward"||e==="forward"){let x=s.type,S=s.offset,v=s.getNode();if(!v)return!1;let M=i.getNodes();return M.length===1&&F(M[0])?!1:wx(x,S,v,e)?Ox(t,v,n,e):!1}let m=o.getElementByKey(a.__key),c=o.getElementByKey(s.key);if(c==null||m==null)return!1;let f;if(s.type==="element")f=c.getBoundingClientRect();else{let x=window.getSelection();if(x===null||x.rangeCount===0)return!1;f=x.getRangeAt(0).getBoundingClientRect()}let g=e==="up"?a.getFirstChild():a.getLastChild();if(g==null)return!1;let h=o.getElementByKey(g.__key);if(h==null)return!1;let N=h.getBoundingClientRect();if(e==="up"?N.top>f.top-f.height:f.bottom+f.height>N.bottom){sn(t);let x=n.getCordsFromCellNode(a,r.table);if(t.shiftKey){let S=n.getDOMCellFromCordsOrThrow(x.x,x.y,r.table);r.setAnchorCellForSelection(S),r.setFocusCellForSelection(S,!0)}else return Of(r,n,x.x,x.y,e);return!0}}else if(W(i)){let{anchor:s,focus:l}=i,a=U(s.getNode(),D),d=U(l.getNode(),D),[u]=i.getNodes(),m=o.getElementByKey(u.getKey());if(!D(a)||!D(d)||!K(u)||m==null)return!1;r.updateTableTableSelection(i);let c=nn(m),f=n.getCordsFromCellNode(a,c),g=n.getDOMCellFromCordsOrThrow(f.x,f.y,c);if(r.setAnchorCellForSelection(g),sn(t),t.shiftKey){let h=n.getCordsFromCellNode(d,c);return Lx(r,u,h.x,h.y,e)}else d.selectEnd();return!0}return!1}function sn(o){o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation()}function Mx(o){let t=o.getRootElement();return t?t.hasAttribute("aria-controls")&&t.getAttribute("aria-controls")==="typeahead-menu":!1}function wx(o,t,e,n){return vx(o,e,n)||Dx(o,t,e,n)}function vx(o,t,e){return o==="element"&&(e==="backward"?t.getPreviousSibling()===null:t.getNextSibling()===null)}function Dx(o,t,e,n){let r=U(e,s=>E(s)&&!s.isInline());if(!r)return!1;let i=n==="backward"?t===0:t===e.getTextContentSize();return o==="text"&&i&&(n==="backward"?r.getPreviousSibling()===null:r.getNextSibling()===null)}function Ox(o,t,e,n){let r=U(t,D);if(!D(r))return!1;let[i,s]=at(e,r,r);if(!Ax(i,s,n))return!1;let l=Rx(t,n,e);return!l||K(l)?!1:(sn(o),n==="backward"?l.selectEnd():l.selectStart(),!0)}function Ax(o,t,e){let n=o[0][0],r=o[o.length-1][o[0].length-1],{startColumn:i,startRow:s}=t;return e==="backward"?i===n.startColumn&&s===n.startRow:i===r.startColumn&&s===r.startRow}function Rx(o,t,e){let n=U(o,i=>E(i)&&!i.isInline());if(!n)return;let r=t==="backward"?n.getPreviousSibling():n.getNextSibling();return r&&K(r)?r:t==="backward"?e.getPreviousSibling():e.getNextSibling()}function vf(o,t,e){let n=I();o==="first"?t.insertBefore(n):t.insertAfter(n),n.append(...e||[]),n.selectEnd()}function Df(o,t,e){let n=e.getParent();if(!n)return;let r=o.getElementByKey(n.getKey());if(!r)return;let i=window.getSelection();if(!i||i.anchorNode!==r)return;let s=U(t.anchor.getNode(),N=>D(N));if(!s)return;let l=U(s,N=>K(N));if(!K(l)||!l.is(e))return;let[a,d]=at(e,s,s),u=a[0][0],m=a[a.length-1][a[0].length-1],{startRow:c,startColumn:f}=d,g=c===u.startRow&&f===u.startColumn,h=c===m.startRow&&f===m.startColumn;return g?"first":h?"last":void 0}var Bt=class{constructor(t){p(this,"rowCount",0);p(this,"columnCount",0);p(this,"cells",[]);this.buildCellMap(t)}buildCellMap(t){let e=[],n=(a,d,u)=>{typeof e[d]>"u"&&(e[d]=[]),e[d][a]=u},r=(a,d)=>!!(e[d]&&e[d][a]),i=t.getChildren().filter(a=>te(a));for(let a=0;aD(c)),m=0;for(let c=0;ca.length));let s=[],l=e[0][0];for(let a=0;a=this.cells.length)throw new Error(`TableMap Error: Attempted to get cell ${n+1} of ${this.cells.length}`);return this.cells[n]}getCellsInRange(t){let e=Math.max(Math.min(t.fromX,t.toX),0),n=Math.min(Math.max(t.fromX,t.toX),this.columnCount-1),r=Math.max(Math.min(t.fromY,t.toY),0),i=Math.min(Math.max(t.fromY,t.toY),this.rowCount-1),s=new Set;for(let l=r;l<=i;l++)for(let a=e;a<=n;a++)s.add(this.getCellAtPosition(a,l));return[...s.values()]}getCellsInColumn(t){return this.getCellsInRange({fromX:t,toX:t,fromY:0,toY:this.rowCount-1})}getRangeForCell(t){let e=null,n=t.getKey();for(let r=0;re&&(n=r,e=r.childElementCount);return n}function kf(o){return[...o.children].map(t=>kx(t))}function kx(o){let t=o.style.width||o.getAttribute("width");return t&&!Number.isNaN(Number(t))&&(t=t+"px"),t||""}function Ma(o,t,e){let n=o.getChildren(),r=0;for(let s of n){let l=s.getChildren().length;l>r&&(r=l)}let i=o.getColWidths();(i.length===0||i.lengthi.length&&console.error(`Attempted to set table column width for column [${t}] but only ${i.length} columns found`),i[t]=xt(e),o.setColWidths(i)}function Pf(o,t,e){let n=t.getColWidths();if(n.length>e&&n[e].endsWith("px"))return Number(n[e].replace("px",""));let r=o.getElementByKey(t.__key);if(r){let i=$f(r);if(i&&i.children.length>e)return i.children[e].clientWidth}return 0}function Bf(o){let t=o.getParent();if(!te(t))return-1;let e=0,n=t.getChildren();for(let r of n){let i=r.getColSpan()||1;if(e+=i,r.getKey()===o.getKey())break}return e-1}function Ff(o,t){let e=La(o),n=Bf(o);e&&n>=0&&Ma(e,n,t)}function Hf(o,t){let e=La(t),n=Bf(t);if(!e)return"";let r=e.getColWidths();return r.length>n?r[n]:""}function wa(o){if(o.length===0)return null;let t=y("colgroup");for(let e of o){let n=y("col");e&&(n.style.width=e),t.append(n)}return t}function ln(o){if(W(o))return o.getNodes().filter(n=>D(n));let t=Z(o,D);return t?[t]:[]}function Kf(o){let t=o.getShape(),e=ln(o);if(e.length===0)return;let n=La(e[0]);if(!n)return;let r=new Bt(n),i=r.getCellAtPosition(t.toX,t.toY);if(!i)return;let s=t.toX+((i.getColSpan()||1)-1),l=t.toY+((i.getRowSpan()||1)-1),a=r.getCellsInRange({fromX:t.fromX,fromY:t.fromY,toX:s,toY:l});if(a.length===0)return;let d=a[0],u=Math.abs(t.fromX-s)+1,m=Math.abs(t.fromY-l)+1;for(let c=1;cD(r));for(let r of n){let i=r.getStyles();i.delete("height"),i.delete("width"),r.setStyles(i),r.clearWidth()}}}function zf(o){o.setColWidths([]),o.setStyles(new Map);for(let t of o.getChildren()){if(!te(t))continue;t.setStyles(new Map);let e=t.getChildren().filter(n=>D(n));for(let n of e)n.setStyles(new Map),n.setBackgroundColor(null),n.clearWidth()}}function va(o,t){e:for(let e of o.getChildren()){if(!te(e))continue;let n=e.getChildren();for(let r of n){if(!D(r))return;if(t(r)===!1)break e}}}function Wf(o){let t=null;return va(o,e=>{let n=e.getStyles().get("padding")||"";if(t===null&&(t=n),n!==t)return t=null,!1}),t||""}var bt=class o extends It{constructor(e){super(e);p(this,"__colWidths",[]);p(this,"__styles",new Map)}static getType(){return"table"}static clone(e){let n=new o(e.__key);return wo(e,n),n.__colWidths=[...e.__colWidths],n.__styles=new Map(e.__styles),n}static importDOM(){return{table:e=>({conversion:Ix,priority:1})}}static importJSON(e){let n=Kr();return lt(e,n),n.setColWidths(e.colWidths),n.setStyles(new Map(Object.entries(e.styles))),n}exportJSON(){return{...super.exportJSON(),type:"table",version:1,colWidths:this.__colWidths,styles:Object.fromEntries(this.__styles)}}createDOM(e,n){let r=document.createElement("table");_e(r,e.theme.table),st(r,this);let i=this.getColWidths(),s=wa(i);s&&r.append(s);for(let[l,a]of this.__styles.entries())r.style.setProperty(l,a);return r}updateDOM(e,n){if(nf(e,this,n),this.__colWidths.join(":")!==e.__colWidths.join(":")){let r=Array.from(n.children).find(s=>s.nodeName==="COLGROUP"),i=wa(this.__colWidths);r&&r.remove(),i&&n.prepend(i)}if(Array.from(this.__styles.values()).join(":")!==Array.from(e.__styles.values()).join(":")){n.style.cssText="";for(let[r,i]of this.__styles.entries())n.style.setProperty(r,i)}return!1}exportDOM(e){return{...super.exportDOM(e),after:n=>{if(!n)return;let r=n.cloneNode(),i=document.createElement("tbody");if(he(n))for(let s of Array.from(n.children))s.nodeName==="TR"?i.append(s):s.nodeName==="CAPTION"?r.insertBefore(s,r.firstChild):r.append(s);return r.append(i),r}}}canBeEmpty(){return!1}isShadowRoot(){return!0}setColWidths(e){let n=this.getWritable();n.__colWidths=e}getColWidths(){return[...this.getLatest().__colWidths]}getStyles(){let e=this.getLatest();return new Map(e.__styles)}setStyles(e){let n=this.getWritable();n.__styles=new Map(e)}getCordsFromCellNode(e,n){let{rows:r,domRows:i}=n;for(let s=0;s{if(!d)return;let{elem:u}=d;return G(u)===e});if(a!==-1)return{x:a,y:s}}throw new Error("Cell not found in table.")}getDOMCellFromCords(e,n,r){let{domRows:i}=r,s=i[n];if(s==null)return null;let l=e{let r=new o;return n.id&&r.setId(n.id),{node:r}},priority:3}}}}exportJSON(){return{...super.exportJSON(),type:"horizontal-rule",version:1,id:this.__id}}static importJSON(e){let n=Da();return n.setId(e.id),n}};function Da(){return new Vn}function qf(o){return o instanceof Vn}var Yf=o=>(o.split(" ").filter(e=>e.startsWith("language-"))[0]||"").replace("language-",""),an=class o extends kt{constructor(e="",n="",r){super(r);p(this,"__id","");p(this,"__language","");p(this,"__code","");this.__language=e,this.__code=n}static getType(){return"code-block"}static clone(e){let n=new o(e.__language,e.__code,e.__key);return n.__id=e.__id,n}setLanguage(e){let n=this.getWritable();n.__language=e}getLanguage(){return this.getLatest().__language}setCode(e){let n=this.getWritable();n.__code=e}getCode(){return this.getLatest().__code}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}decorate(e,n){return{type:"code",getNode:()=>this}}isInline(){return!1}isIsolated(){return!0}createDOM(e,n){let r=y("pre",{id:this.__id||null},[y("code",{class:this.__language?`language-${this.__language}`:null},[this.__code])]);return y("div",{class:"editor-code-block-wrap"},[r])}updateDOM(e,n){let r=n.querySelector("code");return r&&(e.__language!==this.__language&&(r.className=this.__language?`language-${this.__language}`:""),e.__id!==this.__id&&n.setAttribute("id",this.__id),e.__code!==this.__code&&(r.textContent=this.__code)),!1}exportDOM(e){return{element:this.createDOM(e._config,e).querySelector("pre")}}static importDOM(){return{pre(e){return{conversion:n=>{let r=n.querySelector("code"),i=Yf(n.className)||r&&Yf(r.className)||"",s=r?(r.textContent||"").trim():(n.textContent||"").trim(),l=Qi(i,s);return n.id&&l.setId(n.id),{node:l,after(a){return[]}}},priority:3}}}}exportJSON(){return{type:"code-block",version:1,id:this.__id,language:this.__language,code:this.__code}}static importJSON(e){let n=Qi(e.language,e.code);return n.setId(e.id||""),n}};function Qi(o="",t=""){return new an(o,t)}function es(o){return o instanceof an}function qr(o,t){let e=t.getCode(),n=t.getLanguage();window.$components.first("code-editor").open(e,n,"ltr",(i,s)=>{o.update(()=>{t.setCode(i),t.setLanguage(s)})},()=>{})}var Oo=class o extends kt{constructor(e,n,r){super(r);p(this,"__id","");p(this,"__drawingId","");p(this,"__drawingUrl","");this.__drawingId=e,this.__drawingUrl=n}static getType(){return"diagram"}static clone(e){let n=new o(e.__drawingId,e.__drawingUrl);return n.__id=e.__id,n}setDrawingIdAndUrl(e,n){let r=this.getWritable();r.__drawingUrl=n,r.__drawingId=e}getDrawingIdAndUrl(){let e=this.getLatest();return{id:e.__drawingId,url:e.__drawingUrl}}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}decorate(e,n){return{type:"diagram",getNode:()=>this}}isInline(){return!1}isIsolated(){return!0}createDOM(e,n){return y("div",{id:this.__id||null,"drawio-diagram":this.__drawingId},[y("img",{src:this.__drawingUrl})])}updateDOM(e,n){let r=n.querySelector("img");return r&&(e.__id!==this.__id&&n.setAttribute("id",this.__id),e.__drawingUrl!==this.__drawingUrl&&r.setAttribute("src",this.__drawingUrl),e.__drawingId!==this.__drawingId&&n.setAttribute("drawio-diagram",this.__drawingId)),!1}static importDOM(){return{div(e){return e.hasAttribute("drawio-diagram")?{conversion:n=>{let i=n.querySelector("img")?.getAttribute("src")||"",s=n.getAttribute("drawio-diagram")||"",l=Xn(s,i);return n.id&&l.setId(n.id),{node:l}},priority:3}:null}}}exportJSON(){return{type:"diagram",version:1,id:this.__id,drawingId:this.__drawingId,drawingUrl:this.__drawingUrl}}static importJSON(e){let n=Xn(e.drawingId,e.drawingUrl);return n.setId(e.id||""),n}};function Xn(o="",t=""){return new Oo(o,t)}var $x=["width","height","style","title","name","src","allow","allowfullscreen","loading","sandbox","type","data","controls","autoplay","controlslist","loop","muted","playsinline","poster","preload"];function Px(o){let t={};for(let e of Object.keys(o))$x.includes(e)&&(t[e]=o[e]);return t}function ts(o,t){let e=Object.assign({},o);if(!o.style)return e;let n=Hl(o.style);return n.delete(t),e.style=Eu(n),e}function Zf(o,t){let e=Vf(o),n={};for(let i of t.attributes)n[i.name]=i.value;e.setAttributes(n);let r=[];if(o==="video"||o==="audio"){for(let i of t.children)if(i.tagName==="SOURCE"){let s=i.getAttribute("src"),l=i.getAttribute("type");s&&l&&r.push({src:s,type:l})}e.setSources(r)}return it(t,e),e}var Ao=class o extends V{constructor(e,n){super(n);p(this,"__id","");p(this,"__alignment","");p(this,"__tag");p(this,"__attributes",{});p(this,"__sources",[]);p(this,"__inset",0);this.__tag=e}static getType(){return"media"}static clone(e){let n=new o(e.__tag,e.__key);return n.__attributes=Object.assign({},e.__attributes),n.__sources=e.__sources.map(r=>Object.assign({},r)),n.__id=e.__id,n.__alignment=e.__alignment,n.__inset=e.__inset,n}setTag(e){let n=this.getWritable();n.__tag=e}getTag(){return this.getLatest().__tag}setAttributes(e){let n=this.getWritable();n.__attributes=Px(e)}getAttributes(){let e=this.getLatest();return Object.assign({},e.__attributes)}setSources(e){let n=this.getWritable();n.__sources=e}getSources(){return this.getLatest().__sources.map(n=>Object.assign({},n))}setSrc(e){let n=this.getAttributes(),r=this.getSources();this.__tag==="object"&&(n.data=e),this.__tag==="video"&&r.length>0?(r[0].src=e,delete n.src,r.length>1&&r.splice(1,r.length-1),this.setSources(r)):n.src=e,this.setAttributes(n)}setWidthAndHeight(e,n){let r=Object.assign(this.getAttributes(),{width:e,height:n});r=ts(r,"width"),r=ts(r,"height"),this.setAttributes(r)}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}setInset(e){let n=this.getWritable();n.__inset=e}getInset(){return this.getLatest().__inset}setHeight(e){if(!e)return;let n=Object.assign(this.getAttributes(),{height:e});this.setAttributes(ts(n,"height"))}getHeight(){let e=this.getLatest();return Zo(e.__attributes.height||"0")}setWidth(e){let n=this.getAttributes(),r=Object.assign(n,{width:e});this.setAttributes(ts(r,"width"))}getWidth(){let e=this.getLatest();return Zo(e.__attributes.width||"0")}isInline(){return!0}isParentRequired(){return!0}createInnerDOM(){let n=(this.__tag==="video"||this.__tag==="audio"?this.__sources:[]).map(i=>y("source",i)),r=y(this.__tag,this.__attributes,n);return st(r,this),r}createDOM(e,n){let r=this.createInnerDOM();return y("span",{class:r.className+" editor-media-wrap"},[r])}updateDOM(e,n){if(e.__tag!==this.__tag||JSON.stringify(e.__sources)!==JSON.stringify(this.__sources)||JSON.stringify(e.__attributes)!==JSON.stringify(this.__attributes))return!0;let r=n.firstElementChild;return e.__id!==this.__id&&Tu(r,"id",this.__id),e.__alignment!==this.__alignment&&(e.__alignment&&(n.classList.remove(`align-${e.__alignment}`),r.classList.remove(`align-${e.__alignment}`)),this.__alignment&&(n.classList.add(`align-${this.__alignment}`),r.classList.add(`align-${this.__alignment}`))),e.__inset!==this.__inset&&(n.style.paddingLeft=`${this.__inset}px`),!1}static importDOM(){let e=n=>r=>({conversion:i=>({node:Zf(n,i)}),priority:3});return{iframe:e("iframe"),embed:e("embed"),object:e("object"),video:e("video"),audio:e("audio")}}exportDOM(e){return{element:this.createInnerDOM()}}exportJSON(){return{...super.exportJSON(),type:"media",version:1,id:this.__id,alignment:this.__alignment,inset:this.__inset,tag:this.__tag,attributes:this.__attributes,sources:this.__sources}}static importJSON(e){let n=Vf(e.tag);return lt(e,n),n}};function Vf(o){return new Ao(o)}function Xf(o){let n=new DOMParser().parseFromString(`${o}`,"text/html").body.children[0];if(!(n instanceof HTMLElement))return null;let r=n.tagName.toLowerCase();return["embed","iframe","video","audio","object"].includes(r)?Zf(r,n):null}var Bx=[{regex:/.*?youtu\.be\/([\w\-_\?&=.]+)/i,w:560,h:314,url:"https://www.youtube.com/embed/$1"},{regex:/.*youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?.*/i,w:560,h:314,url:"https://www.youtube.com/embed/$2?$4"},{regex:/.*youtube.com\/embed\/([a-z0-9\?&=\-_]+).*/i,w:560,h:314,url:"https://www.youtube.com/embed/$1"}],Fx=["mp4","mpeg","m4v","m4p","mov"],Hx=["3gp","aac","flac","mp3","m4a","ogg","wav","webm"],Kx=["html","htm","php","asp","aspx",""];function jf(o){for(let s of Bx)if(o.match(s.regex)){let a=o.replace(s.regex,s.url),d=new Ao("iframe");return d.setSrc(a),d.setHeight(s.h),d.setWidth(s.w),d}let t="iframe",n=(o.split("?")[0].split("/").pop()||"").split("."),r=(n.length>1?n[n.length-1]:"").toLowerCase();Fx.includes(r)?t="video":Hx.includes(r)?t="audio":r&&!Kx.includes(r)&&(t="embed");let i=new Ao(t);return i.setSrc(o),i}function _t(o){return o instanceof Ao}var Jn=class o extends It{constructor(e,n){super(n);p(this,"__tag");this.__tag=e}static getType(){return"heading"}static clone(e){let n=new o(e.__tag,e.__key);return wo(e,n),n}getTag(){return this.__tag}createDOM(e){let n=this.__tag,r=document.createElement(n),s=e.theme.heading;if(s!==void 0){let l=s[n];_e(r,l)}return st(r,this),r}updateDOM(e,n){return Mo(e,this)}static importDOM(){return{h1:e=>({conversion:jn,priority:0}),h2:e=>({conversion:jn,priority:0}),h3:e=>({conversion:jn,priority:0}),h4:e=>({conversion:jn,priority:0}),h5:e=>({conversion:jn,priority:0}),h6:e=>({conversion:jn,priority:0})}}exportDOM(e){let{element:n}=super.exportDOM(e);return n&&he(n)&&this.isEmpty()&&n.append(document.createElement("br")),{element:n}}static importJSON(e){let n=Gn(e.tag);return lt(e,n),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,n=!0){let r=e?e.anchor.offset:0,i=this.getLastDescendant(),l=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?I():Gn(this.getTag()),a=this.getDirection();if(l.setDirection(a),this.insertAfter(l,n),r===0&&!this.isEmpty()&&e){let d=I();d.select(),this.replace(d,!0)}return l}collapseAtStart(){let e=this.isEmpty()?I():Gn(this.getTag());return this.getChildren().forEach(r=>e.append(r)),this.replace(e),!0}extractWithChild(){return!0}};function jn(o){let t=o.nodeName.toLowerCase(),e=null;return(t==="h1"||t==="h2"||t==="h3"||t==="h4"||t==="h5"||t==="h6")&&(e=Gn(t),it(o,e)),{node:e}}function Gn(o){return re(new Jn(o))}function Qn(o){return o instanceof Jn}var er=class o extends It{static getType(){return"quote"}static clone(t){let e=new o(t.__key);return wo(t,e),e}constructor(t){super(t)}createDOM(t){let e=document.createElement("blockquote");return _e(e,t.theme.quote),st(e,this),e}updateDOM(t,e){return Mo(t,this)}static importDOM(){return{blockquote:t=>({conversion:Ux,priority:0})}}exportDOM(t){let{element:e}=super.exportDOM(t);return e&&he(e)&&this.isEmpty()&&e.append(document.createElement("br")),{element:e}}static importJSON(t){let e=os();return lt(t,e),e}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,e){let n=I(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){let t=I();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function os(){return re(new er)}function ns(o){return o instanceof er}function Ux(o){let t=os();return it(o,t),{node:t}}function Gf(){return[Jo,Jn,er,vo,Pt,bt,ro,no,Zn,en,Vn,qn,an,Oo,Ao,ot,Qo]}function Jf(){return[vo,Pt,ot,Qo]}function Qf(o){let t=[en,an,Oo],e=n=>{for(let[r,i]of n)if(i==="destroyed"){let s=o.manager.getDecoratorByNodeKey(r);s&&s.teardown()}};for(let n of t)o.editor.registerMutationListener(n,r=>e(r))}function Oa(o){return"build"in o}var Ae=class{constructor(){p(this,"dom",null);p(this,"context",null);p(this,"abortController",new AbortController)}setContext(t){this.context=t}getContext(){if(this.context===null)throw new Error("Attempted to use EditorUIContext before it has been set");return this.context}getDOMElement(){return this.dom||(this.dom=this.buildDOM()),this.dom}rebuildDOM(){let t=this.buildDOM();return this.dom?.replaceWith(t),this.dom=t,this.dom}trans(t){return this.getContext().translate(t)}updateState(t){}emitEvent(t,e={}){this.dom&&this.dom.dispatchEvent(new CustomEvent("editor::"+t,{detail:e,bubbles:!0}))}onEvent(t,e,n=null){let r=n||this.dom;r&&r.addEventListener("editor::"+t,i=>{e(i.detail)},{signal:this.abortController.signal})}teardown(){this.dom&&this.dom.isConnected&&this.dom.remove(),this.abortController.abort("teardown")}},oe=class extends Ae{constructor(e){super();p(this,"children",[]);this.children.push(...e)}buildDOM(){return y("div",{},this.getChildren().map(e=>e.getDOMElement()))}getChildren(){return this.children}addChildren(...e){this.children.push(...e)}removeChildren(...e){for(let n of e)this.removeChild(n)}removeChild(e){let n=this.children.indexOf(e);n!==-1&&this.children.splice(n,1)}updateState(e){for(let n of this.children)n.updateState(e)}setContext(e){super.setContext(e);for(let n of this.getChildren())n.setContext(e)}teardown(){for(let e of this.children)e.teardown();super.teardown()}},Yr=class extends oe{constructor(e,n){super(n);p(this,"className");this.className=e}buildDOM(){return y("div",{class:this.className},this.getChildren().map(e=>e.getDOMElement()))}};function em(){let o=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${o()+o()}-${o()}-${o()}-${o()}-${o()}${o()}${o()}`}function rs(){return((1+Math.random())*65536|0).toString(16).substring(1)}var Ft=class extends Ae{constructor(e){super();p(this,"definition");this.definition=e}setValue(e){let n=this.getDOMElement().querySelector("input,select,textarea");this.definition.type==="checkbox"?n.checked=!!e:n.value=e,n.dispatchEvent(new Event("change"))}getName(){return this.definition.name}buildDOM(){let e=`editor-form-field-${this.definition.name}-${Date.now()}`,n;if(this.definition.type==="select"){let r=this.definition.valuesByLabel,s=Object.keys(r).map(l=>y("option",{value:r[l]},[this.trans(l)]));n=y("select",{id:e,name:this.definition.name,class:"editor-form-field-input"},s)}else if(this.definition.type==="textarea")n=y("textarea",{id:e,name:this.definition.name,class:"editor-form-field-input"});else if(this.definition.type==="checkbox")n=y("input",{id:e,name:this.definition.name,type:"checkbox",class:"editor-form-field-input-checkbox",value:"true"});else{if(this.definition.type==="hidden")return n=y("input",{id:e,name:this.definition.name,type:"hidden"}),y("div",{hidden:"true"},[n]);n=y("input",{id:e,name:this.definition.name,class:"editor-form-field-input"})}return y("div",{class:"editor-form-field-wrapper"},[y("label",{class:"editor-form-field-label",for:e},[this.trans(this.definition.label)]),n])}},is=class extends oe{constructor(e){let n=e.fields.map(r=>Oa(r)?r.build():new Ft(r));super(n);p(this,"definition");p(this,"onCancel",null);p(this,"onSuccessfulSubmit",null);this.definition=e}setValues(e){for(let n of Object.keys(e)){let r=this.getFieldByName(n);r&&r.setValue(e[n])}}setOnCancel(e){this.onCancel=e}setOnSuccessfulSubmit(e){this.onSuccessfulSubmit=e}getFieldByName(e){let n=r=>{for(let i of r){if(i instanceof Ft&&i.getName()===e)return i;if(i instanceof oe){let s=n(i.getChildren());if(s)return s}}return null};return n(this.getChildren())}buildDOM(){let e=y("button",{type:"button",class:"editor-form-action-secondary"},[this.trans("Cancel")]),n=y("form",{},[...this.children.map(r=>r.getDOMElement()),y("div",{class:"editor-form-actions"},[e,y("button",{type:"submit",class:"editor-form-action-primary"},[this.trans(this.definition.submitText)])])]);return n.addEventListener("submit",async r=>{r.preventDefault();let i=new FormData(n);await this.definition.action(i,this.getContext())&&this.onSuccessfulSubmit&&this.onSuccessfulSubmit()}),e.addEventListener("click",r=>{this.onCancel&&this.onCancel()}),n}},Aa=class extends oe{constructor(e){let n=e.contents.map(r=>Oa(r)?r.build():new Ft(r));super(n);p(this,"definition");p(this,"fields");p(this,"id");this.definition=e,this.fields=n,this.id=em()}getLabel(){return this.getContext().translate(this.definition.label)}getId(){return this.id}buildDOM(){return y("div",{class:"editor-form-tab-content",role:"tabpanel",id:`editor-tabpanel-${this.id}`,"aria-labelledby":`editor-tab-${this.id}`},this.fields.map(e=>e.getDOMElement()))}},dn=class extends oe{constructor(e){let n=e.map(r=>new Aa(r));super(n);p(this,"definitions",[]);p(this,"tabs",[]);this.definitions=e,this.tabs=n}buildDOM(){let e=[],n=[],r=i=>{for(let s=0;s{r(e.indexOf(s))})}return r(0),y("div",{class:"editor-form-tab-container"},[y("div",{class:"editor-form-tab-controls"},e),y("div",{class:"editor-form-tab-contents"},n)])}};var tm='';var ss=class extends oe{constructor(e,n){super([new is(e.form)]);p(this,"definition");p(this,"key");this.definition=e,this.key=n}show(e){let n=this.getDOMElement();document.body.append(n);let r=this.getForm();r.setValues(e),r.setOnCancel(this.hide.bind(this)),r.setOnSuccessfulSubmit(this.hide.bind(this)),this.getContext().manager.setModalActive(this.key,this)}hide(){this.getContext().manager.setModalInactive(this.key),this.teardown()}getForm(){return this.children[0]}buildDOM(){let e=y("button",{class:"editor-modal-close",type:"button",title:this.trans("Close")});e.innerHTML=tm,e.addEventListener("click",this.hide.bind(this));let n=y("div",{class:"editor-modal editor-form-modal"},[y("div",{class:"editor-modal-header"},[y("div",{class:"editor-modal-title"},[this.trans(this.definition.title)]),e]),y("div",{class:"editor-modal-body"},[this.getForm().getDOMElement()])]),r=y("div",{class:"editor-modal-wrapper"},[n]);return r.addEventListener("click",i=>{i.target&&!n.contains(i.target)&&this.hide()}),r}};var ls=class extends oe{constructor(e,n){super(n);p(this,"target");this.target=e}buildDOM(){return y("div",{class:"editor-context-toolbar"},this.getChildren().map(e=>e.getDOMElement()))}updatePosition(){let e=this.getContext().scrollDOM.getBoundingClientRect(),n=this.target.getBoundingClientRect(),r=this.getDOMElement(),i=r.getBoundingClientRect(),s=n.bottom>e.top&&n.tope.bottom;r.classList.toggle("is-above",l);let d=n.left+n.width/2-i.width/2;l?r.style.top=n.top-6-i.height+"px":r.style.top=n.bottom+6+"px",r.style.left=d+"px"}insert(e){this.addChildren(...e),this.getDOMElement().append(...e.map(r=>r.getDOMElement()))}};function Wx(o,t,e){let n=t.getBoundingClientRect(),r=o.getBoundingClientRect();if(o.style.position="fixed",e){let i=n.right;n.right+r.width>window.innerWidth&&(i=Math.max(n.left-r.width,0)),o.style.top=n.top+"px",o.style.left=i+"px"}else{let i=n.left+r.width>window.innerWidth,s=n.left;i&&(s=Math.max(n.right-r.width,0)),o.style.top=n.bottom+"px",o.style.left=s+"px"}}var as=class{constructor(){p(this,"dropdownOptions",new WeakMap);p(this,"openDropdowns",new Set);this.onMenuMouseOver=this.onMenuMouseOver.bind(this),this.onWindowClick=this.onWindowClick.bind(this),window.addEventListener("click",this.onWindowClick)}teardown(){window.removeEventListener("click",this.onWindowClick)}onWindowClick(t){let e=t.target;this.closeAllNotContainingElement(e)}closeAllNotContainingElement(t){for(let e of this.openDropdowns)e.parentElement?.contains(t)||this.closeDropdown(e)}onMenuMouseOver(t){let e=t.target;this.closeAllNotContainingElement(e)}closeAll(){for(let t of this.openDropdowns)this.closeDropdown(t)}closeDropdown(t){t.hidden=!0,t.style.removeProperty("position"),t.style.removeProperty("left"),t.style.removeProperty("top"),this.openDropdowns.delete(t),t.removeEventListener("mouseover",this.onMenuMouseOver);let e=this.getOptions(t).onClose;e&&e()}openDropdown(t){let{toggle:e,showAside:n,onOpen:r}=this.getOptions(t);t.hidden=!1,Wx(t,e,!!n),this.openDropdowns.add(t),t.addEventListener("mouseover",this.onMenuMouseOver),r&&r()}getOptions(t){let e=this.dropdownOptions.get(t);if(!e)throw new Error("Can't find options for dropdown menu");return e}handle(t){let{menu:e,toggle:n,showOnHover:r}=t;this.dropdownOptions.set(e,t);let i=s=>{e.hasAttribute("hidden")?this.openDropdown(e):this.closeDropdown(e)};n.addEventListener("click",i),r&&n.addEventListener("mouseenter",()=>{this.openDropdown(e)})}};var ds=class{constructor(){p(this,"dropdowns",new as);p(this,"modalDefinitionsByKey",{});p(this,"activeModalsByKey",{});p(this,"decoratorConstructorsByType",{});p(this,"decoratorInstancesByNodeKey",{});p(this,"context",null);p(this,"toolbar",null);p(this,"contextToolbarDefinitionsByKey",{});p(this,"activeContextToolbars",[]);p(this,"selectionChangeHandlers",new Set);p(this,"domEventAbortController",new AbortController);p(this,"teardownCallbacks",[])}setContext(t){this.context=t,this.setupEventListeners(),this.setupEditor(t.editor)}getContext(){if(this.context===null)throw new Error("Context attempted to be used without being set");return this.context}triggerStateUpdateForElement(t){t.updateState({selection:null,editor:this.getContext().editor})}registerModal(t,e){this.modalDefinitionsByKey[t]=e}createModal(t){let e=this.modalDefinitionsByKey[t];if(!e)throw new Error(`Attempted to show modal of key [${t}] but no modal registered for that key`);let n=new ss(e,t);return n.setContext(this.getContext()),n}setModalActive(t,e){this.activeModalsByKey[t]=e}setModalInactive(t){delete this.activeModalsByKey[t]}getActiveModal(t){return this.activeModalsByKey[t]}registerDecoratorType(t,e){this.decoratorConstructorsByType[t]=e}getDecorator(t,e){if(this.decoratorInstancesByNodeKey[e])return this.decoratorInstancesByNodeKey[e];let n=this.decoratorConstructorsByType[t];if(!n)throw new Error(`Attempted to use decorator of type [${t}] but not decorator registered for that type`);let r=new n(e);return this.decoratorInstancesByNodeKey[e]=r,r}getDecoratorByNodeKey(t){return this.decoratorInstancesByNodeKey[t]||null}setToolbar(t){this.toolbar&&this.toolbar.teardown(),this.toolbar=t,t.setContext(this.getContext()),this.getContext().containerDOM.prepend(t.getDOMElement())}registerContextToolbar(t,e){this.contextToolbarDefinitionsByKey[t]=e}triggerStateUpdate(t){Su(t.editor,t.selection),this.toolbar?.updateState(t),this.updateContextToolbars(t);for(let e of this.activeContextToolbars)e.updateState(t);this.triggerSelectionChange(t.selection)}triggerStateRefresh(){let t=this.getContext().editor,e={editor:t,selection:ae(t)};this.triggerStateUpdate(e),this.updateContextToolbars(e)}triggerFutureStateRefresh(){requestAnimationFrame(()=>{this.getContext().editor.getEditorState().read(()=>{this.triggerStateRefresh()})})}triggerSelectionChange(t){if(t)for(let e of this.selectionChangeHandlers)e(t)}onSelectionChange(t){this.selectionChangeHandlers.add(t)}offSelectionChange(t){this.selectionChangeHandlers.delete(t)}triggerLayoutUpdate(){window.requestAnimationFrame(()=>{for(let t of this.activeContextToolbars)t.updatePosition()})}getDefaultDirection(){return this.getContext().options.textDirection==="rtl"?"rtl":"ltr"}onTeardown(t){this.teardownCallbacks.push(t)}teardown(){this.domEventAbortController.abort("teardown");for(let[t,e]of Object.entries(this.activeModalsByKey))e.teardown();for(let[t,e]of Object.entries(this.decoratorInstancesByNodeKey))e.teardown();this.toolbar&&this.toolbar.teardown();for(let t of this.activeContextToolbars)t.teardown();this.dropdowns.teardown();for(let t of this.teardownCallbacks)t()}updateContextToolbars(t){for(let s=this.activeContextToolbars.length-1;s>=0;s--)this.activeContextToolbars[s].teardown(),this.activeContextToolbars.splice(s,1);let e=(t.selection?.getNodes()||[])[0]||null;if(!e)return;let n=t.editor.getElementByKey(e.getKey());if(!n)return;let r=Object.keys(this.contextToolbarDefinitionsByKey),i=new Map;for(let s of r){let l=this.contextToolbarDefinitionsByKey[s],a=n.closest(l.selector)||n.querySelector(l.selector);if(a){let d=l.displayTargetLocator?l.displayTargetLocator(a):a;i.has(d)||i.set(d,[]),i.get(d).push(...l.content())}}for(let[s,l]of i){let a=new ls(s,l);a.setContext(this.getContext()),this.activeContextToolbars.push(a),this.getContext().containerDOM.append(a.getDOMElement()),a.updatePosition()}}setupEditor(t){let e=n=>{t.getEditorState().read(()=>{let r=Object.keys(n);for(let i of r){let s=t.getElementByKey(i);if(!s)continue;let l=n[i],a=this.getDecorator(l.type,i);a.setNode(l.getNode());let d=a.render(this.getContext(),s);d&&s.append(d)}})};t.registerDecoratorListener(e),t.registerUpdateListener(({editorState:n,prevEditorState:r})=>{!r._selection?.is(n._selection)&&t.update(()=>{let s=C();this.triggerStateUpdate({editor:t,selection:s})})})}setupEventListeners(){let t=this.triggerLayoutUpdate.bind(this);window.addEventListener("scroll",t,{capture:!0,passive:!0,signal:this.domEventAbortController.signal}),window.addEventListener("resize",t,{passive:!0,signal:this.domEventAbortController.signal})}};function Ra(o,t,e){let n=y("div",{contenteditable:"true",class:`editor-content-area ${e.editorClass||""}`}),r=y("div",{class:"editor-content-wrap"},[n]);o.append(r),o.classList.add("editor-container"),o.setAttribute("dir",e.textDirection),e.darkMode&&o.classList.add("editor-dark");let i=new ds,s={editor:t,containerDOM:o,editorDOM:n,scrollDOM:r,manager:i,translate(l){return e.translations[l]||l},error(l){let a=l instanceof Error?l.message:l;window.$events.error(a)},options:e};return i.setContext(s),s}function cn(o,t){o.update(()=>{let e=H();for(let r of e.getChildren())r.remove(!0);let n=_o(o,t);e.append(...n)})}function om(o,t){o.update(()=>{let e=H(),n=_o(o,t);e.append(...n)})}function nm(o,t){o.update(()=>{let e=H(),n=_o(o,t),r=e.getChildren()[0];for(let i=n.length-1;i>=0;i--)r?r.insertBefore(n[i]):e.append(n[i]),r=n[i]})}function rm(o,t){o.update(()=>{let e=C(),n=_o(o,t),r=e?.getNodes()[0],i=r?.getParents()||[];if(i[i.length-1]&&r)for(let l=n.length-1;l>=0;l--)r.insertAfter(n[l])})}function cs(o){return new Promise((t,e)=>{o.getEditorState().read(()=>{let n=Ri(o);t(n)})})}function us(o){o.focus(()=>{},{defaultSelection:"rootStart"})}var tr=class{constructor(t,e,n){p(this,"container");p(this,"dragTargetSelector");p(this,"options");p(this,"startX",0);p(this,"startY",0);p(this,"target",null);this.container=t,this.dragTargetSelector=e,this.options=n,this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.container.addEventListener("mousedown",this.onMouseDown)}teardown(){this.container.removeEventListener("mousedown",this.onMouseDown),this.container.removeEventListener("mouseup",this.onMouseUp),this.container.removeEventListener("mousemove",this.onMouseMove)}onMouseDown(t){this.target=t.target.closest(this.dragTargetSelector),this.target&&(this.startX=t.screenX,this.startY=t.screenY,window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp),this.options.down&&this.options.down(t,this.target))}onMouseMove(t){this.options.move&&this.target&&this.options.move(t,this.target,{x:t.screenX-this.startX,y:t.screenY-this.startY})}onMouseUp(t){window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),this.options.up&&this.target&&this.options.up(t,this.target,{x:t.screenX-this.startX,y:t.screenY-this.startY})}};var ka=class{constructor(t,e){p(this,"editor");p(this,"editScrollContainer");p(this,"markerDom",null);p(this,"mouseTracker",null);p(this,"dragging",!1);p(this,"targetCell",null);p(this,"xMarkerAtStart",!1);p(this,"yMarkerAtStart",!1);p(this,"activeInTable",!1);this.editor=t,this.editScrollContainer=e,this.setupListeners()}teardown(){this.editScrollContainer.removeEventListener("mousemove",this.onCellMouseMove),window.removeEventListener("scroll",this.onScrollOrResize,{capture:!0}),window.removeEventListener("resize",this.onScrollOrResize),this.mouseTracker&&this.mouseTracker.teardown()}setupListeners(){this.onTableMouseOver=this.onTableMouseOver.bind(this),this.onCellMouseMove=this.onCellMouseMove.bind(this),this.onScrollOrResize=this.onScrollOrResize.bind(this),this.editScrollContainer.addEventListener("mouseover",this.onTableMouseOver,{passive:!0}),window.addEventListener("scroll",this.onScrollOrResize,{capture:!0,passive:!0}),window.addEventListener("resize",this.onScrollOrResize,{passive:!0})}onScrollOrResize(){this.updateCurrentMarkerTargetPosition()}onTableMouseOver(t){if(this.dragging)return;let e=t.target.closest("table");e&&!this.activeInTable?(this.editScrollContainer.addEventListener("mousemove",this.onCellMouseMove,{passive:!0}),this.onCellMouseMove(t),this.activeInTable=!0):!e&&this.activeInTable&&(this.editScrollContainer.removeEventListener("mousemove",this.onCellMouseMove),this.hideMarkers(),this.activeInTable=!1)}onCellMouseMove(t){let e=t.target.closest("td,th");if(!e||this.dragging)return;let n=e.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2;this.targetCell=e,this.xMarkerAtStart=t.clientX<=r,this.yMarkerAtStart=t.clientY<=i;let s=this.xMarkerAtStart?n.left:n.right,l=this.yMarkerAtStart?n.top:n.bottom;this.updateMarkersTo(e,s,l)}updateMarkersTo(t,e,n){let r=this.getMarkers(),i=t.closest("table"),s=i.querySelector("caption"),l=i.getBoundingClientRect(),a=this.editScrollContainer.getBoundingClientRect(),d=l.top;s&&(d=s.getBoundingClientRect().bottom);let u=Math.max(d,a.top),c=Math.min(l.bottom,a.bottom)-u;r.x.style.left=e+"px",r.x.style.top=u+"px",r.x.style.height=c+"px",r.y.style.top=n+"px",r.y.style.left=l.left+"px",r.y.style.width=l.width+"px",r.y.hidden=na.bottom,r.x.hidden=l.top>a.bottom||l.bottom0?d-=1:e.xMarkerAtStart&&d===0&&(u=-u),e.editor.update(()=>{let m=G(a);if(m instanceof bt){let c=Pf(e.editor,m,d),f=Math.max(c+u,10);Ma(m,d,f)}})}if(r==="top"&&e.targetCell){let d=e.targetCell;e.editor.update(()=>{let m=G(d)?.getParent(),c=m?.getIndexWithinParent()||0,f=l.y;e.yMarkerAtStart&&c>0?c-=1:e.yMarkerAtStart&&c===0&&(f=-f);let g=m?.getParent()?.getChildren()[c];if(g instanceof ro){let h=g.getHeight()||0,N=Math.max(h+f,10);g.setHeight(N)}})}}})}getTargetCellColumnIndex(){let t=this.targetCell;if(t===null)return-1;let e=0,n=t.parentElement;for(let r of n?.children||[]){let i=Number(r.getAttribute("colspan"));if((Number.isNaN(i)||i<1)&&(i=1),e+=i,r===t)return e-1}return-1}};function im(o,t){let e=new ka(o,t);return()=>{e.teardown()}}function fs(o){return o.html||""}function sm(o){window.$events.listen("editor::replace",e=>{let n=fs(e);cn(o,n)}),window.$events.listen("editor::append",e=>{let n=fs(e);om(o,n)}),window.$events.listen("editor::prepend",e=>{let n=fs(e);nm(o,n)}),window.$events.listen("editor::insert",e=>{let n=fs(e);rm(o,n)}),window.$events.listen("editor::focus",()=>{us(o)});let t=!0;o.registerUpdateListener(({dirtyElements:e,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{(e.size>0||n.size>0)&&(t?t=!1:window.$events.emit("editor-html-change",""))})}var ms=class{constructor(t){p(this,"data");this.data=t}hasItems(){return!!this.data&&!!this.data.types&&this.data.types.length>0}containsTabularData(){let t=this.data.getData("text/rtf");return!!t&&t.includes("\\trowd")}getImages(){return this.getFiles().filter(t=>t.type.includes("image"))}getFiles(){let{files:t}=this.data;return[...t]}};function ps(o){window.$components.first("image-manager").show(e=>{o(e)},"gallery")}function lm(o){let t=o.thumbs?.display||o.url,e=Tt(t,{target:"_blank"}),n=tn(t,{alt:o.name});return e.append(n),e}async function am(o,t){if(o===null||o.type.indexOf("image")!==0)throw new Error("Not an image file");let e=o.name||`image-${Date.now()}.png`,n=new FormData;return n.append("file",o,e),n.append("uploaded_to",t),(await window.$http.post("/images/gallery",n)).data}function qx(o,t){let e=o.clientX,n=o.clientY;return document.elementFromPoint(e,n)?Cu(t,o.clientX,o.clientY):null}function dm(o,t,e){let n=qx(t,e);n&&rt(n),Ul(o,!0),(!F(n)||!n?.getTextContent())&&n?.remove()}async function Yx(o,t,e){let i=((await window.$http.get(`/templates/${t}`)).data||{html:""}).html||"";o.update(()=>{let s=_o(o,i);dm(s,e,o)})}function cm(o,t){let e=new ms(o),n=!1;if(!e.hasItems()||e.containsTabularData())return n;let r=e.getImages();return r.length>0&&(n=!0),t.editor.update(async()=>{for(let i of r){let s=window.baseUrl("/loading.gif"),l=tn(s),a=I();a.append(l),ve([a]);try{let d=await am(i,t.options.pageId),u=d.name.replace(/"/g,"");t.editor.update(()=>{let m=tn(d.thumbs?.display||"",{alt:u}),c=Tt(d.url,{target:"_blank"});c.append(m),l.replace(c)})}catch(d){t.editor.update(()=>{l.remove(!1)}),window.$events.error(d?.data?.message||t.options.translations.imageUploadErrorText),console.error(d)}}}),n}function Zx(o,t){let e=/https?:\/\/([^?#]*?)\.(png|jpeg|jpg|gif|webp|bmp|avif)/i,n=o.getData("text/plain");return n&&e.test(n)?(t.editor.update(()=>{let r=tn(n);ve([r]),r.select()}),!0):!1}function Vx(o){let t=o.editor;return e=>{let n=e.dataTransfer?.getData("bookstack/template")||"";if(n)return Yx(t,n,e),e.preventDefault(),e.stopPropagation(),!0;let r=e.dataTransfer?.getData("text/html")||"";return r?(t.update(()=>{let i=_o(t,r);dm(i,e,t)}),e.preventDefault(),e.stopPropagation(),!0):e.dataTransfer&&cm(e.dataTransfer,o)?(e.preventDefault(),e.stopPropagation(),!0):!1}}function Xx(o){return t=>{if(!t.clipboardData)return!1;let e=Zx(t.clipboardData,o)||cm(t.clipboardData,o);return e&&t.preventDefault(),e}}function um(o){let t=Vx(o),e=Xx(o),n=o.editor.registerCommand(Po,t,Xe),r=o.editor.registerCommand(ao,e,Xe);return o.scrollDOM.addEventListener("drop",t),()=>{n(),r(),o.scrollDOM.removeEventListener("drop",t)}}var Ia=class{constructor(t,e){p(this,"editorContainer");p(this,"editor");this.editor=t,this.editorContainer=e,this.setupListeners()}setupListeners(){this.handleClick=this.handleClick.bind(this),this.editorContainer.addEventListener("click",this.handleClick)}handleClick(t){let e=t.target;e instanceof HTMLElement&&e.nodeName==="LI"&&e.classList.contains("task-list-item")&&(this.handleTaskListItemClick(e,t),t.preventDefault())}handleTaskListItemClick(t,e){let n=t.getBoundingClientRect();e.clientX<=n.right&&e.clientX>=n.left&&e.clientY>=n.top&&e.clientY<=n.bottom||this.editor.update(()=>{let i=G(t);X(i)&&i.setChecked(!i.getChecked())})}teardown(){this.editorContainer.removeEventListener("click",this.handleClick)}};function fm(o,t){let e=new Ia(o,t);return()=>{e.teardown()}}var $a=class{constructor(t){p(this,"editor");p(this,"tableSelections",new Map);p(this,"unregisterMutationListener",()=>{});this.editor=t,this.init()}init(){this.unregisterMutationListener=this.editor.registerMutationListener(bt,t=>{for(let[e,n]of t)if(n==="created")this.editor.getEditorState().read(()=>{let r=ee(e);K(r)&&this.initializeTableNode(r)});else if(n==="destroyed"){let r=this.tableSelections.get(e);r!==void 0&&(r.removeListeners(),this.tableSelections.delete(e))}})}initializeTableNode(t){let e=t.getKey(),n=this.editor.getElementByKey(e);if(n&&!this.tableSelections.has(e)){let r=ya(t,n,this.editor,!0);this.tableSelections.set(e,r)}}teardown(){this.unregisterMutationListener();for(let[,t]of this.tableSelections)t.removeListeners()}};function mm(o){let t=new $a(o);return()=>{t.teardown()}}var jx=(o,t)=>Qn(o)&&o.getTag()===t;function gs(o,t){o.update(()=>{Fn(e=>jx(e,t),()=>Gn(t))})}function Zr(o){o.update(()=>{Fn(Ve,I)})}function Vr(o){o.update(()=>{Fn(ns,os)})}function Xr(o,t){o.getEditorState().read(()=>{let e=C();de(e,r=>z(r)&&r.getListType()===t)?fa(o):ua(o,t)})}function jr(o){o.getEditorState().read(()=>{let t=C(),e=ae(o),n=Z(e,es);n===null?o.update(()=>{let r=Qi();r.setCode(t?.getTextContent()||"");let i=At(t),s=i[0],l=i.slice(1);s?(s.replace(r),l.forEach(a=>a.remove())):Vo(r,!0),qr(o,r),rt(r)}):qr(o,n)})}function pm(o){o.update(()=>{let t=C(),e=At(t),n=!1;for(let i of e)ia(i)||(i.replace(Wn("info"),!0),n=!0);if(n)return;let r=["info","warning","danger","success"];for(let i of e)if(ia(i)){let s=i.getCategory(),a=(r.indexOf(s)+1)%r.length,d=r[a];i.setCategory(d)}})}function hs(o,t){o.update(()=>{let e=C(),n=Z(e,$t);if($t(n)?(n.setURL(t.url),n.setTarget(t.target),n.setTitle(t.title)):(n=Tt(t.url,{title:t.title,target:t.target}),ve([n])),$t(n)){for(let r of n.getChildren())r.remove(!0);n.append(q(t.text))}})}var Gr=class extends oe{constructor(e,n){super([e,n]);p(this,"input");p(this,"action");this.input=e,this.action=n}buildDOM(){return y("div",{class:"editor-action-input-container"},[this.input.getDOMElement(),this.action.getDOMElement()])}};var w=class extends Ae{constructor(e){super();p(this,"definition");p(this,"active",!1);p(this,"completedSetup",!1);p(this,"disabled",!1);e.action!==void 0?this.definition=e:this.definition={...e,action(){return!1},isActive:()=>!1}}setContext(e){super.setContext(e),this.definition.setup&&!this.completedSetup&&(this.definition.setup(e,this),this.completedSetup=!0)}buildDOM(){let e=this.getLabel(),n=this.definition.format||"small",r=[];if(this.definition.icon||n==="long"){let s=y("div",{class:"editor-button-icon"});s.innerHTML=this.definition.icon||"",r.push(s)}if(!this.definition.icon||n==="long"){let s=y("div",{class:"editor-button-text"},[e]);r.push(s)}let i=y("button",{type:"button",class:`editor-button editor-button-${n}`,title:this.definition.icon?e:null,disabled:this.disabled?"true":null},r);return i.addEventListener("click",this.onClick.bind(this)),i}onClick(){let e=this.definition.action(this.getContext(),this);e instanceof Promise?e.then(n=>{n===!1&&this.emitEvent("button-action")}):e!==!1&&this.emitEvent("button-action")}updateActiveState(e){let n=this.definition.isActive(e,this.getContext());this.setActiveState(n)}updateDisabledState(e){if(this.definition.isDisabled){let n=this.definition.isDisabled(e,this.getContext());this.toggleDisabled(n)}}setActiveState(e){this.active=e,this.dom?.classList.toggle("editor-button-active",this.active)}updateState(e){this.updateActiveState(e.selection),this.updateDisabledState(e.selection)}isActive(){return this.active}getLabel(){return this.trans(this.definition.label)}toggleDisabled(e){this.disabled=e,e?this.dom?.setAttribute("disabled","true"):this.dom?.removeAttribute("disabled")}};var gm='';var hm='';function Ns(o,t){window.$components.first("entity-selector-popup").show(n=>o(n),{initialValue:t,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}var xs=class extends oe{constructor(e){super([e]);p(this,"input");p(this,"headerMap",new Map);this.input=e}buildDOM(){let e="editor-form-datalist-"+this.input.getName()+"-"+Date.now(),n=this.input.getDOMElement(),r=n.querySelector("input");r?.setAttribute("list",e),r?.setAttribute("autocomplete","off");let i=y("datalist",{id:e}),s=y("div",{class:"editor-link-field-container"},[n,i]);return r?.addEventListener("focusin",()=>{this.updateDataList(i)}),r?.addEventListener("input",()=>{let l=r.value,a=this.headerMap.get(l);a&&this.updateFormFromHeader(a)}),s}updateFormFromHeader(e){this.getHeaderIdAndText(e).then(({id:n,text:r})=>{let i=this.getContext().manager.getActiveModal("link");i&&i.getForm().setValues({url:`#${n}`,text:r,title:r})})}getHeaderIdAndText(e){return new Promise(n=>{this.getContext().editor.update(()=>{let r=e.getId();r||(r="header-"+rs(),e.setId(r));let i=e.getTextContent();n({id:r,text:i})})})}updateDataList(e){this.getContext().editor.getEditorState().read(()=>{let n=Kl(Qn);this.headerMap.clear();let r=[];for(let i of n){let s="header-"+i.getKey();this.headerMap.set(s,i),r.push(y("option",{value:s,label:i.getTextContent().substring(0,54)}))}e.innerHTML="",e.append(...r)})}};function Nm(o,t){let e=t.manager.createModal("image"),n=o.getHeight(),r=o.getWidth(),i={src:o.getSrc(),alt:o.getAltText(),height:n===0?"":String(n),width:r===0?"":String(r)};e.show(i)}var xm={submitText:"Apply",async action(o,t){return t.editor.update(()=>{let e=ae(t.editor),n=Z(e,je);je(n)&&(n.setSrc(o.get("src")?.toString()||""),n.setAltText(o.get("alt")?.toString()||""),n.setWidth(Number(o.get("width")?.toString()||"0")),n.setHeight(Number(o.get("height")?.toString()||"0")))}),!0},fields:[{build(){return new Gr(new Ft({label:"Source",name:"src",type:"text"}),new w({label:"Browse files",icon:gm,action(o){ps(t=>{let e=o.manager.getActiveModal("image");e&&e.getForm().setValues({src:t.thumbs?.display||t.url,alt:t.name})})}}))}},{label:"Alternative description",name:"alt",type:"text"},{label:"Width",name:"width",type:"text"},{label:"Height",name:"height",type:"text"}]};function Es(o,t){let e=t.manager.createModal("link");if(o){let n={url:o.getURL(),text:o.getTextContent(),title:o.getTitle()||"",target:o.getTarget()||""};t.editor.update(()=>{let r=jo();r.add(o.getKey()),Y(r)}),e.show(n)}else t.editor.getEditorState().read(()=>{let i={text:C()?.getTextContent()||""};e.show(i)})}var Em={submitText:"Apply",async action(o,t){return hs(t.editor,{url:o.get("url")?.toString()||"",title:o.get("title")?.toString()||"",target:o.get("target")?.toString()||"",text:o.get("text")?.toString()||""}),!0},fields:[{build(){return new Gr(new xs(new Ft({label:"URL",name:"url",type:"text"})),new w({label:"Browse links",icon:hm,action(o){Ns(t=>{let e=o.manager.getActiveModal("link");e&&e.getForm().setValues({url:t.link,text:t.name,title:t.name})})}}))}},{label:"Text to display",name:"text",type:"text"},{label:"Title",name:"title",type:"text"},{label:"Open link in...",name:"target",type:"select",valuesByLabel:{"Current window":"","New window":"_blank"}}]};function Tm(o,t){let e=t.manager.createModal("media"),n={};if(o){let r=o.getAttributes(),i=o.exportDOM(t.editor).element,s=i instanceof HTMLElement?i.outerHTML:"";n={src:r.src||r.data||o.getSources()[0]?.src||"",width:r.width,height:r.height,embed:s,embed_check:s}}e.show(n)}var Cm={submitText:"Save",async action(o,t){let e=await new Promise((i,s)=>{t.editor.getEditorState().read(()=>{let l=Z(C(),_t);i(l)})}),n=(o.get("embed")||"").toString().trim(),r=(o.get("embed_check")||"").toString().trim();return n&&n!==r?(t.editor.update(()=>{let i=Xf(n);e&&i?e.replace(i):i&&ve([i])}),!0):(t.editor.update(()=>{let i=(o.get("src")||"").toString().trim(),s=(o.get("height")||"").toString().trim(),l=(o.get("width")||"").toString().trim();if(e){e.setSrc(i),e.setWidthAndHeight(l,s),t.manager.triggerFutureStateRefresh();return}let a=jf(i);(l||s)&&a.setWidthAndHeight(l,s),ve([a])}),!0)},fields:[{build(){return new dn([{label:"General",contents:[{label:"Source",name:"src",type:"text"},{label:"Width",name:"width",type:"text"},{label:"Height",name:"height",type:"text"}]},{label:"Embed",contents:[{label:"Paste your embed code below:",name:"embed",type:"textarea"},{label:"",name:"embed_check",type:"hidden"}]}])}}]};function bm(o,t){let e=t.manager.createModal("details");o&&e.show({summary:o.getSummary()})}var _m={submitText:"Save",async action(o,t){return t.editor.update(()=>{let e=Z(C(),ce),n=(o.get("summary")||"").toString().trim();ce(e)&&e.setSummary(n)}),!0},fields:[{label:"Toggle label",name:"summary",type:"text"}]};function Ts(o,t){return gs(o.editor,t),o.manager.triggerFutureStateRefresh(),!0}function so(o){return(t,e)=>(o(t),e.manager.triggerFutureStateRefresh(),!0)}function ym(o){return o.dispatchCommand(Ee,"code"),!0}var Sm={"meta+s":()=>(window.$events.emit("editor-save-draft"),!0),"meta+enter":()=>(window.$events.emit("editor-save-page"),!0),"meta+1":(o,t)=>Ts(t,"h2"),"meta+2":(o,t)=>Ts(t,"h3"),"meta+3":(o,t)=>Ts(t,"h4"),"meta+4":(o,t)=>Ts(t,"h5"),"meta+5":so(Zr),"meta+d":so(Zr),"meta+6":so(Vr),"meta+q":so(Vr),"meta+7":so(jr),"meta+e":so(jr),"meta+8":ym,"meta+shift+e":ym,"meta+9":so(pm),"meta+o":so(o=>Xr(o,"number")),"meta+p":so(o=>Xr(o,"bullet")),"meta+k":(o,t)=>(o.getEditorState().read(()=>{let e=Z(C(),$t);Es(e,t)}),!0),"meta+shift+k":(o,t)=>(Ns(e=>{hs(o,{text:e.name,title:e.link,target:"",url:e.link})}),!0)};function Qx(o){return t=>{let e=eE(t);Sm[e]&&Sm[e](o.editor,o)&&(t.stopPropagation(),t.preventDefault())}}function eE(o){return[(Lm()?o.metaKey:o.ctrlKey)?"meta":"",o.shiftKey?"shift":"",o.key].filter(Boolean).join("+").toLowerCase()}function Lm(){return window.navigator.userAgent.includes("Mac OS X")}function tE(o){o.registerCommand(Ue,t=>Lm()?t?.metaKey||!1:t?.ctrlKey||!1,Xe)}function Pa(o){let t=Qx(o);return tE(o.editor),o.editor.registerRootListener((e,n)=>{e?.addEventListener("keydown",t),n?.removeEventListener("keydown",t)})}function oE(o){return je(o)||_t(o)}var Ba=class{constructor(t){p(this,"context");p(this,"resizerDOM",null);p(this,"targetNode",null);p(this,"scrollContainer");p(this,"mouseTracker",null);p(this,"activeSelection","");p(this,"loadAbortController",new AbortController);this.context=t,this.scrollContainer=t.scrollDOM,this.onSelectionChange=this.onSelectionChange.bind(this),this.onTargetDOMLoad=this.onTargetDOMLoad.bind(this),t.manager.onSelectionChange(this.onSelectionChange)}onSelectionChange(t){let e=t?.getNodes()||[];if(this.activeSelection&&this.hide(),e.length===1&&oE(e[0])){let n=e[0],r=this.getTargetDOM(n);r&&this.showForNode(n,r)}}getTargetDOM(t){if(t==null)return null;let e=this.context.editor.getElementByKey(t.__key);return e&&e.nodeName==="SPAN"&&(e=e.firstElementChild),e}onTargetDOMLoad(){this.updateResizerPosition()}teardown(){this.context.manager.offSelectionChange(this.onSelectionChange),this.hide()}showForNode(t,e){this.resizerDOM=this.buildDOM(),this.targetNode=t;let n=y("span",{class:"editor-node-resizer-ghost"});je(t)&&(n=y("img",{src:e.getAttribute("src"),class:"editor-node-resizer-ghost"})),this.resizerDOM.append(n),this.context.scrollDOM.append(this.resizerDOM),this.updateResizerPosition(),this.mouseTracker=this.setupTracker(this.resizerDOM,t,e),this.activeSelection=t.getKey(),e.matches("img, embed, iframe, object")&&(this.loadAbortController=new AbortController,e.addEventListener("load",this.onTargetDOMLoad,{signal:this.loadAbortController.signal}))}updateResizerPosition(){let t=this.getTargetDOM(this.targetNode);if(!this.resizerDOM||!t)return;let e=this.scrollContainer.getBoundingClientRect(),n=t.getBoundingClientRect(),r=n.top-(e.top-this.scrollContainer.scrollTop),i=n.left-e.left;this.resizerDOM.style.top=`${r}px`,this.resizerDOM.style.left=`${i}px`,this.resizerDOM.style.width=n.width+"px",this.resizerDOM.style.height=n.height+"px"}updateDOMSize(t,e){this.resizerDOM&&(this.resizerDOM.style.width=t+"px",this.resizerDOM.style.height=e+"px")}hide(){this.mouseTracker?.teardown(),this.resizerDOM?.remove(),this.targetNode=null,this.activeSelection="",this.loadAbortController.abort()}buildDOM(){let e=["nw","ne","se","sw"].map(n=>y("div",{class:`editor-node-resizer-handle ${n}`}));return y("div",{class:"editor-node-resizer"},e)}setupTracker(t,e,n){let r=0,i=0,s=0,l=!1,a=this,d=!1,u=!1,m=c=>{let f=c.x;d&&(f=0-f);let g=c.y;u&&(g=0-g);let h=Math.sqrt(Math.pow(Math.abs(f),2)+Math.pow(Math.abs(g),2)),b=f+g>0?h:0-h,x=Math.max(5,Math.round(r+b)),S=Math.round(x*s);return{width:x,height:S}};return new tr(t,".editor-node-resizer-handle",{down(c,f){a.resizerDOM?.classList.add("active"),a.context.editor.getEditorState().read(()=>{let g=n.getBoundingClientRect();r=e.getWidth()||g.width,i=e.getHeight()||g.height,e.getHeight()&&(l=!0),s=i/r}),d=f.classList.contains("nw")||f.classList.contains("sw"),u=f.classList.contains("nw")||f.classList.contains("ne")},move(c,f,g){let h=m(g);a.updateDOMSize(h.width,h.height)},up(c,f,g){let h=m(g);a.context.editor.update(()=>{e.setWidth(h.width),e.setHeight(l?h.height:0)},{onUpdate:()=>{requestAnimationFrame(()=>{a.context.manager.triggerLayoutUpdate(),a.updateResizerPosition()})}}),a.resizerDOM?.classList.remove("active")}})}};function Mm(o){let t=new Ba(o);return()=>{t.teardown()}}function nE(o){let t=o.getParent();if(!z(t))return o;let e=o.getChildren().filter(d=>z(d))[0]||null,n=e?.getChildren()||[],r=t.getChildren(),i=r.findIndex(d=>d.getKey()===o.getKey()),s=i===0,l=Be(),a=ye(t.getListType());if(a.append(l),l.append(...o.getChildren()),s?o.append(a):(r[i-1].append(a),o.remove()),e){for(let d of n)l.insertAfter(d);e.remove()}return l}function rE(o){let t=o.getParent(),e=t?.getParent(),n=e?.getParent();if(!z(t)||!z(n)||!X(e))return o;let r=o.getNextSiblings();if(e.insertAfter(o),t.getChildren().length===0&&t.remove(),r.length>0){let i=ye(t.getListType());i.append(...r),o.append(i)}return t.getChildrenSize()===0&&t.remove(),e.getChildren().length===0&&e.remove(),o}function iE(o){let t=o?.getNodes()||[],[e,n]=o?.getStartEndPoints()||[null,null],r=new Set;if(o&&e){o.isBackward()&&n&&([n,e]=[e,n]);let s=e.getNode().getParents(),l=!1;for(let a of s)X(a)&&(l?r.add(a.getKey()):l=!0)}let i=[];e:for(let s of t){if(X(s)){r.has(s.getKey())||i.push(s);continue}let l=s.getParents();for(let a of l)if(X(a)){r.has(a.getKey())||i.push(a);continue e}i.push(null)}return i}function sE(o){let t={};for(let n of o){if(n===null)continue;let r=n.getKey();typeof t[r]>"u"&&(t[r]=n)}let e=Object.values(t);return bu(e)}function Jr(o,t){let e=C(),n=e?.getStartEndPoints(),r=iE(e);if(r.length>0&&!r.includes(null)){let l=[],a=sE(r);if(t>0)for(let d of a)l.push(nE(d));else if(t<0){for(let d of[...a].reverse())l.push(rE(d));l.reverse()}if(l.length===1&&n){let d=l[0],u=d.getChildren()[0];u||(u=q(""),d.append(u)),u.select(n[0].offset,n[1].offset)}else Du(l);return}let s=At(e);for(let l of s)if(_u(l)){let a=l.getInset(),d=Math.min(Math.max(a+t,0),500);l.setInset(d)}Ou(o)}var or=class extends Error{constructor(e,n){super(e.statusText);p(this,"data");p(this,"headers");p(this,"original");p(this,"redirected");p(this,"status");p(this,"statusText");p(this,"url");this.data=n,this.headers=e.headers,this.redirected=e.redirected,this.status=e.status,this.statusText=e.statusText,this.url=e.url,this.original=e}};function Cs(o){return new Promise((t,e)=>{o.oncomplete=o.onsuccess=()=>t(o.result),o.onabort=o.onerror=()=>e(o.error)})}function lE(o,t){let e,n=()=>{if(e)return e;let r=indexedDB.open(o);return r.onupgradeneeded=()=>r.result.createObjectStore(t),e=Cs(r),e.then(i=>{i.onclose=()=>e=void 0},()=>{}),e};return(r,i)=>n().then(s=>i(s.transaction(t,r).objectStore(t)))}var Fa;function Ha(){return Fa||(Fa=lE("keyval-store","keyval")),Fa}function Ka(o,t=Ha()){return t("readonly",e=>Cs(e.get(o)))}function Ua(o,t,e=Ha()){return e("readwrite",n=>(n.put(t,o),Cs(n.transaction)))}function za(o,t=Ha()){return t("readwrite",e=>(e.delete(o),Cs(e.transaction)))}var yt=null,Ya,bs,Wa,qa="last-drawing-save";function Za(o){yt?.contentWindow?.postMessage(JSON.stringify(o),Ya)}function dE(o){Ua(qa,o.data),Wa&&Wa(o.data).then(()=>{za(qa)})}function cE(o){Za({action:"export",format:"xmlpng",xml:o.xml,spin:"Updating drawing"})}function uE(){bs&&bs().then(o=>{Za({action:"load",autosave:1,xml:o})})}function fE(){let o={};yt&&(window.$events.emitPublic(yt,"editor-drawio::configure",{config:o}),Za({action:"configure",config:o}))}function wm(){window.removeEventListener("message",vm),yt&&document.body.removeChild(yt)}function vm(o){if(!o.data||o.data.length<1||o.origin!==Ya)return;let t=JSON.parse(o.data);t.event==="init"?uE():t.event==="exit"?wm():t.event==="save"?cE(t):t.event==="export"?dE(t):t.event==="configure"&&fE()}async function mE(){let o=await Ka(qa),t=document.getElementById("unsaved-drawing-dialog");t||console.error("Missing expected unsaved-drawing dialog"),o&&t&&await window.$components.firstOnElement(t,"confirm-dialog").show()&&(bs=async()=>o)}async function Dm(o,t,e){bs=t,Wa=e,await mE(),yt=document.createElement("iframe"),yt.setAttribute("frameborder","0"),window.addEventListener("message",vm),yt.setAttribute("src",o),yt.setAttribute("class","fullscreen"),yt.style.backgroundColor="#FFFFFF",document.body.appendChild(yt),Ya=new URL(o).origin}async function Om(o,t){let e={image:o,uploaded_to:t};return(await window.$http.post(window.baseUrl("/images/drawio"),e)).data}function Va(){wm()}async function Am(o){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${o}`))).data.content}`}catch(t){throw t instanceof or&&window.$events.showResponseError(t),Va(),t}}function lo(o){return o instanceof Oo}function gE(o,t){o.status===413?window.$events.emit("error",t.options.translations.serverUploadLimitText||""):window.$events.emit("error",t.options.translations.imageUploadErrorText||""),console.error(o)}async function hE(o,t){return await new Promise((n,r)=>{o.getEditorState().read(()=>{let{id:i}=t.getDrawingIdAndUrl();n(i)})})||""}async function NE(o,t,e,n){if(Va(),n){let r=window.baseUrl("/loading.gif");o.editor.update(()=>{t.setDrawingIdAndUrl("",r)})}try{let r=await Om(e,o.options.pageId);o.editor.update(()=>{t.setDrawingIdAndUrl(String(r.id),r.url)})}catch(r){throw r instanceof or&&gE(r,o),n&&o.editor.update(()=>{t.remove()}),new Error(`Failed to save image with error: ${r}`)}}function Qr(o,t){let e=!1;Dm(o.options.drawioUrl,async()=>{let n=await hE(o.editor,t);return e=!n,e?"":Am(n)},async n=>NE(o,t,n,e))}function xE(o){window.$components.first("image-manager").show(e=>{o(e)},"drawio")}function Rm(o){let t=ae(o.editor);xE(e=>{o.editor.update(()=>{let n=Xn(e.id,e.url),r=Z(t,lo);lo(r)?r.replace(n):ve([n])})})}function _s(o){let t=o.getChildren();for(let e of t)o.insertBefore(e);o.remove()}function Xa(o){if(o.length===1){let t=o[0];if(F(t)||je(t)||_t(t)||lo(t))return!0}return!1}function km(o){let t=ae(o)?.getNodes()||[];Xa(t)&&o.update(()=>{t[0].remove()})}function EE(o,t){let e=ae(o)?.getNodes()||[];if(Xa(e)){let n=e[0],r=yo(n)||n,i=t?.shiftKey===!0;if(r)return requestAnimationFrame(()=>{o.update(()=>{let s=I();i?r.insertBefore(s):r.insertAfter(s),s.select()})}),t?.preventDefault(),!0}return!1}function Im(o,t,e=!0){let n=ae(o)?.getNodes()||[];if(!Xa(n))return!1;t?.preventDefault();let r=n[0];return o.update(()=>{Ar(r,e)}),!0}function TE(o,t){let e=$m(o);return e===null||e.detailsSibling?!1:(o.update(()=>{let n=I();e.parentDetails.insertAfter(n),n.select()}),t?.preventDefault(),!0)}function CE(o,t){let e=$m(o);if(e===null||e.parentBlock.getTextContent()!=="")return!1;t?.preventDefault();let n=e.parentDetails.getNextSibling();return o.update(()=>{if(n)n.selectStart();else{let r=I();e.parentDetails.insertAfter(r),r.select()}e.parentBlock.remove()}),!0}function $m(o){let e=ae(o)?.getNodes()[0];if(!e)return null;let n=yo(e),r=Ot(e,ce);if(!ce(r)||n===null||n.getKey()!==r.getLastChild()?.getKey())return null;let i=r.getNextSibling();return{parentDetails:r,parentBlock:n,detailsSibling:i}}function bE(o,t){let e=C(),n=e?.getNodes()||[];if(n.length!==1)return!1;let r=yo(n[0]);if(!r)return!1;let i=r.getParent(),s=e?.getStartEndPoints();return s&&ce(i)&&s[0].offset===0&&r.getIndexWithinParent()===0?(t.preventDefault(),o.editor.update(()=>{_s(i),r.selectStart(),o.manager.triggerLayoutUpdate()}),!0):!1}function _E(o){if(o.length!==1)return!1;let t=o[0];return X(t)||X(t.getParent())}function yE(o,t){let e=t?.shiftKey?-40:40,r=C()?.getNodes()||[];return r.length>1||_E(r)?(o.update(()=>{Jr(o,e)}),t?.preventDefault(),!0):!1}function Pm(o){let t=o.editor.registerCommand(qt,l=>(km(o.editor),bE(o,l)),De),e=o.editor.registerCommand(Yt,()=>(km(o.editor),!1),De),n=o.editor.registerCommand(Ue,l=>EE(o.editor,l)||CE(o.editor,l),De),r=o.editor.registerCommand($o,l=>yE(o.editor,l),De),i=o.editor.registerCommand(zt,l=>Im(o.editor,l,!1),De),s=o.editor.registerCommand(Wt,l=>TE(o.editor,l)||Im(o.editor,l,!0),De);return()=>{t(),e(),n(),r(),i(),s()}}function SE(o){return o.toLowerCase().startsWith("http")?/(http|https):\/\/(\S+)\.\S+$/.test(o):!1}function LE(o,t,e){let n=t.getStartEndPoints();if(!n)return;let r=n[0].offset,i=o.getTextContent(),a=i.slice(0,r).lastIndexOf(" ")+1,d=i.slice(a,r);SE(d)&&e.update(()=>{let u=Tt(d);u.append(new nt(d));let m=o.splitText(a,r),c=a>0?1:0,f=m[c];f&&f.replace(u)})}function ja(o){let t=r=>{let i=C(),s=Lu(i);return s&&i&&LE(s,i,o),!1},e=o.registerCommand(ir,t,Kn),n=o.registerCommand(Ue,t,Kn);return()=>{e(),n()}}var ys=class extends oe{buildDOM(){let t=this.getChildren().map(i=>i.getDOMElement()),e=y("div",{class:"editor-format-menu-dropdown editor-dropdown-menu editor-dropdown-menu-vertical",hidden:"true"},t),n=y("button",{class:"editor-format-menu-toggle editor-button",type:"button"},[this.trans("Formats")]),r=y("div",{class:"editor-format-menu editor-dropdown-menu-container"},[n,e]);return this.getContext().manager.dropdowns.handle({toggle:n,menu:e}),this.onEvent("button-action",()=>{this.getContext().manager.dropdowns.closeAll()},r),r}updateState(t){super.updateState(t);for(let e of this.children){if(e instanceof w&&e.isActive()){this.updateToggleLabel(e.getLabel());return}if(e instanceof oe){for(let n of e.getChildren())if(n instanceof w&&n.isActive()){this.updateToggleLabel(n.getLabel());return}}}this.updateToggleLabel(this.trans("Formats"))}updateToggleLabel(t){let e=this.getDOMElement().querySelector("button");e&&(e.innerText=t)}};var Ge=class extends w{constructor(e,n){super(n);p(this,"previewSampleElement");this.previewSampleElement=e}buildDOM(){let e=super.buildDOM();e.innerHTML="";let n=y("span",{class:"editor-button-format-preview"},[this.getLabel()]),r=this.getStylesFromPreview();for(let i of Object.keys(r))n.style.setProperty(i,r[i]);return e.append(n),e}getStylesFromPreview(){let e=y("div",{style:"display: none",hidden:"true",class:"page-content"}),n=this.previewSampleElement.cloneNode();n.textContent=this.getLabel(),e.append(n),document.body.append(e);let r=["color","font-size","background-color","border-inline-start"],i={},s=window.getComputedStyle(n);for(let l of r)i[l]=s.getPropertyValue(l);return e.remove(),i}};var Bm='';var Ss=class extends w{buildDOM(){let t=super.buildDOM(),e=y("div",{class:"editor-menu-button-icon"});return e.innerHTML=Bm,t.append(e),t}};var wE={showOnHover:!1,direction:"horizontal",showAside:void 0,hideOnAction:!0,button:{label:"Menu"}},Ce=class extends oe{constructor(e,n){super(n);p(this,"button");p(this,"childItems");p(this,"open",!1);p(this,"options");if(this.childItems=n,this.options=Object.assign({},wE,e),e.button instanceof w)this.button=e.button;else{let r=e.button.format==="long"?Ss:w;this.button=new r({...e.button,action(){return!1},isActive:()=>this.open})}this.addChildren(this.button)}insertItems(...e){this.addChildren(...e),this.childItems.push(...e)}buildDOM(){let e=this.button.getDOMElement(),n=this.childItems.map(s=>s.getDOMElement()),r=y("div",{class:`editor-dropdown-menu editor-dropdown-menu-${this.options.direction}`,hidden:"true"},n),i=y("div",{class:"editor-dropdown-menu-container"},[e,r]);return this.getContext().manager.dropdowns.handle({toggle:e,menu:r,showOnHover:this.options.showOnHover,showAside:typeof this.options.showAside=="boolean"?this.options.showAside:this.options.direction==="vertical",onOpen:()=>{this.open=!0,this.getContext().manager.triggerStateUpdateForElement(this.button)},onClose:()=>{this.open=!1,this.getContext().manager.triggerStateUpdateForElement(this.button)}}),this.options.hideOnAction&&this.onEvent("button-action",()=>{this.getContext().manager.dropdowns.closeAll()},i),i}};var Fm='';var Hm='';var Km=["#000000","#ffffff","#BFEDD2","#FBEEB8","#F8CAC6","#ECCAFA","#C2E0F4","#2DC26B","#F1C40F","#E03E2D","#B96AD9","#3598DB","#169179","#E67E23","#BA372A","#843FA1","#236FA1","#ECF0F1","#CED4D9","#95A5A6","#7E8C8D","#34495E"],Um="bs-lexical-custom-colors",un=class extends Ae{constructor(e){super();p(this,"callback");this.callback=e}buildDOM(){let e=rs(),r=[...Km,...this.getCustomColorChoices()].map(u=>y("div",{class:"editor-color-select-option",style:`background-color: ${u}`,"data-color":u,"aria-label":u})),i=y("div",{class:"editor-color-select-option","data-color":"",title:this.getContext().translate("Remove color")},[]);i.innerHTML=Fm,r.push(i);let s=y("label",{class:"editor-color-select-option",for:`color-select-${e}`,"data-color":"",title:this.getContext().translate("Custom color")},[]);s.innerHTML=Hm,r.push(s);let l=y("input",{type:"color",hidden:"true",id:`color-select-${e}`});r.push(l),l.addEventListener("change",u=>{l.value&&(this.storeCustomColorChoice(l.value),this.setColor(l.value),this.rebuildDOM())});let a=[];for(let u=0;u{let l=s.target.closest(".editor-table-creator-cell");if(l){let a=Number(l.dataset.rows||0),d=Number(l.dataset.columns||0);this.updateGridSelection(a,d,n,r)}}),i.addEventListener("click",s=>{let l=s.target.closest(".editor-table-creator-cell");l&&this.onCellClick(l)}),i.addEventListener("mouseleave",s=>{this.updateGridSelection(0,0,n,r)}),y("div",{class:"editor-table-creator"},[i,r])}updateGridSelection(t,e,n,r){for(let i of n){let s=Number(i.dataset.rows)<=t&&Number(i.dataset.columns)<=e;i.classList.toggle("active",s)}r.textContent=`${t} x ${e}`}onCellClick(t){let e=Number(t.dataset.rows||0),n=Number(t.dataset.columns||0);if(e<1||n<1)return;let r=Math.min(Math.round(840/n),240),i=Array(n).fill(r+"px");this.getContext().editor.update(()=>{let s=ha(e,n,!1);s.setColWidths(i),Vo(s)})}};var ei=class extends w{constructor(e,n){super(e);p(this,"style");this.style=n}getColorBar(){let e=this.getDOMElement().querySelector("svg .editor-icon-color-bar");if(!e)throw new Error(`Could not find expected color bar in the icon for this ${this.definition.label} button`);return e}updateState(e){if(super.updateState(e),_(e.selection)){let n=Fl(e.selection,this.style);this.getColorBar().setAttribute("fill",n)}}};var zm='';var dt=class extends oe{constructor(e,n){super(n);p(this,"size");p(this,"overflowButton");p(this,"content");this.size=e,this.content=n,this.overflowButton=new Ce({button:{label:"More",icon:zm},hideOnAction:!1},[]),this.addChildren(this.overflowButton)}buildDOM(){let e=this.content.length>this.size?this.size-1:this.size,n=this.content.slice(0,e),r=this.content.slice(e),i=n.map(s=>s.getDOMElement());return r.length>0&&(this.removeChildren(...r),this.overflowButton.insertItems(...r),i.push(this.overflowButton.getDOMElement())),y("div",{class:"editor-overflow-container"},i)}};var Ga='';var Ms='';var Wm='';var qm='';var Ym='';var Zm='';var Vm='';var Xm='';var jm=` +`?a.insertParagraph():d===" "?a.insertNodes([vt()]):a.insertText(d)}}}else t.insertRawText(i)}function na(o,t,e){o.dispatchCommand(rr,{nodes:t,selection:e})||e.insertNodes(t)}function lx(o){let t=o.exportJSON(),e=o.constructor;if(t.type!==e.getType()&&T(!1,"LexicalNode: Node %s does not implement .exportJSON().",e.name),E(o)){let n=t.children;Array.isArray(n)||T(!1,"LexicalNode: Node %s is an element but .exportJSON() does not have a children array.",e.name)}return t}function uf(o,t,e,n=[]){let r=t!==null?e.isSelected(t):!0,i=E(e)&&e.excludeFromCopy("html"),s=e;if(t!==null){let d=Qt(e);d=L(d)&&t!==null?Dr(t,d):d,s=d}let l=E(s)?s.getChildren():[],a=lx(s);if(L(s)){let d=s.__text;d.length>0?a.text=d:r=!1}for(let d=0;d{o.update(()=>{a(lf(o,t,e))})});let n=o.getRootElement(),r=o._window==null?window.document:o._window.document,i=af(o._window);if(n===null||i===null)return!1;let s=r.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(r.createTextNode("#")),n.append(s);let l=new Range;return l.setStart(s,0),l.setEnd(s,1),i.removeAllRanges(),i.addRange(l),new Promise((a,d)=>{let u=o.registerCommand(fo,m=>(Nt(m,ClipboardEvent)&&(u(),Un!==null&&(window.clearTimeout(Un),Un=null),a(lf(o,m,e))),!0),Pe);Un=window.setTimeout(()=>{u(),Un=null,a(!1)},ax),r.execCommand("copy"),s.remove()})}function lf(o,t,e){if(e===void 0){let r=af(o._window);if(!r)return!1;let i=r.anchorNode,s=r.focusNode;if(i!==null&&s!==null&&!jt(o,i,s))return!1;let l=C();if(l===null)return!1;e=Ki(l)}t.preventDefault();let n=t.clipboardData;return n===null?!1:(pf(n,e),!0)}var dx=[["text/html",df],["application/x-lexical-editor",cf]];function Ki(o=C()){let t={"text/plain":o?o.getTextContent():""};if(o){let e=pl();for(let[n,r]of dx){let i=r(e,o);i!==null&&(t[n]=i)}}return t}function pf(o,t){for(let e in t){let n=t[e];n!==void 0&&o.setData(e,n)}}function Ui(o,t){if(typeof document.caretRangeFromPoint<"u"){let e=document.caretRangeFromPoint(o,t);return e===null?null:{node:e.startContainer,offset:e.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){let e=document.caretPositionFromPoint(o,t);return e===null?null:{node:e.offsetNode,offset:e.offset}}else return null}var gf=P("DRAG_DROP_PASTE_FILE");function cx(o,t){o.preventDefault(),t.update(()=>{let e=C(),n=Nt(o,InputEvent)||Nt(o,KeyboardEvent)?null:o.clipboardData;n!=null&&e!==null&&Hi(n,e,t)},{tag:"paste"})}async function ux(o,t){await zn(t,Nt(o,ClipboardEvent)?o:null),t.update(()=>{let e=C();_(e)?e.removeText():we(e)&&e.getNodes().forEach(n=>n.remove())})}function zi(o){let t=null;if(Nt(o,DragEvent)?t=o.dataTransfer:Nt(o,ClipboardEvent)&&(t=o.clipboardData),t===null)return[!1,[],!1];let e=t.types,n=e.includes("Files"),r=e.includes("text/html")||e.includes("text/plain");return[n,Array.from(t.files),r]}function Wi(o){let t=G(o);return F(t)}function fx(o){let t=o.focus;return t.key==="root"&&t.offset===H().getChildrenSize()}function ra(o){return Dt(o.registerCommand(Ht,e=>{let n=C();return we(n)?(n.clear(),!0):!1},0),o.registerCommand(Je,e=>{let n=C();return _(n)?(n.deleteCharacter(e),!0):!1},J),o.registerCommand(St,e=>{let n=C();return _(n)?(n.deleteWord(e),!0):!1},J),o.registerCommand(ut,e=>{let n=C();return _(n)?(n.deleteLine(e),!0):!1},J),o.registerCommand(ct,e=>{let n=C();if(typeof e=="string")n!==null&&n.insertText(e);else{if(n===null)return!1;let r=e.dataTransfer;if(r!=null)Hi(r,n,o);else if(_(n)){let i=e.data;return i&&n.insertText(i),!0}}return!0},J),o.registerCommand(hn,()=>{let e=C();return _(e)?(e.removeText(),!0):!1},J),o.registerCommand(Ee,e=>{let n=C();return _(n)?(n.formatText(e),!0):!1},J),o.registerCommand(Kt,e=>{let n=C();return _(n)?(n.insertLineBreak(e),!0):!1},J),o.registerCommand(Ut,()=>{let e=C();return _(e)?(e.insertParagraph(),!0):!1},J),o.registerCommand(Ws,()=>(ve([vt()]),!0),J),o.registerCommand(zt,e=>{let n=C();if(we(n)&&!Wi(e.target)){let r=n.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(_(n)){let r=Jt(n.focus,!0);if(!e.shiftKey&&F(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},J),o.registerCommand(Wt,e=>{let n=C();if(we(n)){let r=n.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(_(n)){if(fx(n))return e.preventDefault(),!0;let r=Jt(n.focus,!1);if(!e.shiftKey&&F(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},J),o.registerCommand(ko,e=>{let n=C();if(we(n)){let r=n.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!_(n))return!1;if(vi(n,!0)){let r=e.shiftKey;return e.preventDefault(),Di(n,r,!0),!0}return!1},J),o.registerCommand(Ro,e=>{let n=C();if(we(n)&&!Wi(e.target)){let i=n.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!_(n))return!1;let r=e.shiftKey;return vi(n,!1)?(e.preventDefault(),Di(n,r,!1),!0):!1},J),o.registerCommand(qt,e=>{if(Wi(e.target))return!1;let n=C();return _(n)?(e.preventDefault(),o.dispatchCommand(Je,!0)):!1},J),o.registerCommand(Yt,e=>{if(Wi(e.target))return!1;let n=C();return _(n)?(e.preventDefault(),o.dispatchCommand(Je,!1)):!1},J),o.registerCommand(Ue,e=>{let n=C();if(!_(n))return!1;if(e!==null){if((Lt||Zt||Vt)&&ho)return!1;if(e.preventDefault(),e.shiftKey)return o.dispatchCommand(Kt,!1)}return o.dispatchCommand(Ut,void 0)},J),o.registerCommand(Io,()=>{let e=C();return _(e)?(o.blur(),!0):!1},J),o.registerCommand(Po,e=>{let[,n]=zi(e);if(n.length>0){let i=e.clientX,s=e.clientY,l=Ui(i,s);if(l!==null){let{offset:a,node:d}=l,u=G(d);if(u!==null){let m=Xo();if(L(u))m.anchor.set(u.getKey(),a,"text"),m.focus.set(u.getKey(),a,"text");else{let f=u.getParentOrThrow().getKey(),g=u.getIndexWithinParent()+1;m.anchor.set(f,g,"element"),m.focus.set(f,g,"element")}let c=Bo(m);Y(c)}o.dispatchCommand(gf,n)}return e.preventDefault(),!0}let r=C();return!!_(r)},J),o.registerCommand(sr,e=>{let[n]=zi(e),r=C();return!(n&&!_(r))},J),o.registerCommand(lr,e=>{let[n]=zi(e),r=C();if(n&&!_(r))return!1;let i=e.clientX,s=e.clientY,l=Ui(i,s);if(l!==null){let a=G(l.node);F(a)&&e.preventDefault()}return!0},J),o.registerCommand(Nn,()=>(fl(),!0),J),o.registerCommand(fo,e=>(zn(o,Nt(e,ClipboardEvent)?e:null),!0),J),o.registerCommand(mo,e=>(ux(e,o),!0),J),o.registerCommand(ao,e=>{let[,n,r]=zi(e);return n.length>0&&!r?(o.dispatchCommand(gf,n),!0):Ln(e.target)?!1:C()!==null?(cx(e,o),!0):!1},J))}var Jo=class o extends X{constructor(e,n){super(n);p(this,"__id","");p(this,"__category","info");p(this,"__alignment","");p(this,"__inset",0);this.__category=e}static getType(){return"callout"}static clone(e){let n=new o(e.__category,e.__key);return n.__id=e.__id,n.__alignment=e.__alignment,n.__inset=e.__inset,n}setCategory(e){let n=this.getWritable();n.__category=e}getCategory(){return this.getLatest().__category}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}setInset(e){let n=this.getWritable();n.__inset=e}getInset(){return this.getLatest().__inset}createDOM(e,n){let r=document.createElement("p");return r.classList.add("callout",this.__category||""),st(r,this),r}updateDOM(e){return e.__category!==this.__category||Mo(e,this)}insertNewAfter(e,n){let r=e?e.anchor.offset:0,i=r===this.getTextContentSize()||!e?I():Wn(this.__category);if(i.setDirection(this.getDirection()),this.insertAfter(i,n),r===0&&!this.isEmpty()&&e){let s=I();s.select(),this.replace(s,!0)}return i}static importDOM(){return{p(e){return e.classList.contains("callout")?{conversion:n=>{let r="info",i=["info","success","warning","danger"];for(let l of i)if(n.classList.contains(l)){r=l;break}let s=new o(r);return it(n,s),{node:s}},priority:3}:null}}}exportJSON(){return{...super.exportJSON(),type:"callout",version:1,category:this.__category,id:this.__id,alignment:this.__alignment,inset:this.__inset}}static importJSON(e){let n=Wn(e.category);return lt(e,n),n}};function Wn(o="info"){return new Jo(o)}function ia(o){return o instanceof Jo}function sa(o,t="info"){return o instanceof Jo&&o.getCategory()===t}var Qo=class o extends X{constructor(e,n={},r){super(r);p(this,"__url");p(this,"__target");p(this,"__rel");p(this,"__title");let{target:i=null,rel:s=null,title:l=null}=n;this.__url=e,this.__target=i,this.__rel=s,this.__title=l}static getType(){return"link"}static clone(e){return new o(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}createDOM(e){let n=document.createElement("a");return n.href=this.__url,this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),_e(n,e.theme.link),n}updateDOM(e,n,r){if(n instanceof HTMLAnchorElement){let i=this.__url,s=this.__target,l=this.__rel,a=this.__title;i!==e.__url&&(n.href=i),s!==e.__target&&(s?n.target=s:n.removeAttribute("target")),l!==e.__rel&&(l?n.rel=l:n.removeAttribute("rel")),a!==e.__title&&(a?n.title=a:n.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:mx,priority:1})}}static importJSON(e){let n=Tt(e.url,{rel:e.rel,target:e.target,title:e.title});return n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){let n=this.getWritable();n.__url=e}getTarget(){return this.getLatest().__target}setTarget(e){let n=this.getWritable();n.__target=e}getRel(){return this.getLatest().__rel}setRel(e){let n=this.getWritable();n.__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){let n=this.getWritable();n.__title=e}insertNewAfter(e,n=!0){let r=Tt(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n,r){if(!_(n))return!1;let i=n.anchor.getNode(),s=n.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function mx(o){let t=null;if(Ni(o)){let e=o.textContent;(e!==null&&e!==""||o.children.length>0)&&(t=Tt(o.getAttribute("href")||"",{rel:o.getAttribute("rel"),target:o.getAttribute("target"),title:o.getAttribute("title")}))}return{node:t}}function Tt(o,t){return re(new Qo(o,t))}function $t(o){return o instanceof Qo}var P0=P("TOGGLE_LINK_COMMAND");var en=class o extends X{constructor(e,n,r){super(r);p(this,"__src","");p(this,"__alt","");p(this,"__width",0);p(this,"__height",0);p(this,"__alignment","");this.__src=e,n.alt&&(this.__alt=n.alt),n.width&&(this.__width=n.width),n.height&&(this.__height=n.height)}static getType(){return"image"}static clone(e){let n=new o(e.__src,{alt:e.__alt,width:e.__width,height:e.__height},e.__key);return n.__alignment=e.__alignment,n}setSrc(e){let n=this.getWritable();n.__src=e}getSrc(){return this.getLatest().__src}setAltText(e){let n=this.getWritable();n.__alt=e}getAltText(){return this.getLatest().__alt}setHeight(e){let n=this.getWritable();n.__height=e}getHeight(){return this.getLatest().__height}setWidth(e){let n=this.getWritable();n.__width=e}getWidth(){return this.getLatest().__width}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}isInline(){return!0}createDOM(e,n){let r=document.createElement("img");return r.setAttribute("src",this.__src),this.__width&&r.setAttribute("width",String(this.__width)),this.__height&&r.setAttribute("height",String(this.__height)),this.__alt&&r.setAttribute("alt",this.__alt),this.__alignment&&r.classList.add("align-"+this.__alignment),r.addEventListener("click",i=>{n.update(()=>{this.select()})}),r}updateDOM(e,n){return e.__src!==this.__src&&n.setAttribute("src",this.__src),e.__width!==this.__width&&(this.__width?n.setAttribute("width",String(this.__width)):n.removeAttribute("width")),e.__height!==this.__height&&(this.__height?n.setAttribute("height",String(this.__height)):n.removeAttribute("height")),e.__alt!==this.__alt&&(this.__alt?n.setAttribute("alt",String(this.__alt)):n.removeAttribute("alt")),e.__alignment!==this.__alignment&&(e.__alignment&&n.classList.remove("align-"+e.__alignment),this.__alignment&&n.classList.add("align-"+this.__alignment)),!1}static importDOM(){return{img(e){return{conversion:n=>{let r=n.getAttribute("src")||"",i={alt:n.getAttribute("alt")||"",height:Number.parseInt(n.getAttribute("height")||"0"),width:Number.parseInt(n.getAttribute("width")||"0")},s=new o(r,i);return s.setAlignment($r(n)),{node:s}},priority:3}}}}exportJSON(){return{...super.exportJSON(),type:"image",version:1,src:this.__src,alt:this.__alt,height:this.__height,width:this.__width,alignment:this.__alignment}}static importJSON(e){let n=tn(e.src,{alt:e.alt,width:e.width,height:e.height});return n.setAlignment(e.alignment),n}};function tn(o,t={}){return new en(o,t)}function je(o){return o instanceof en}var qn=class o extends X{constructor(){super(...arguments);p(this,"__id","");p(this,"__summary","");p(this,"__open",!1)}static getType(){return"details"}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setSummary(e){let n=this.getWritable();n.__summary=e}getSummary(){return this.getLatest().__summary}setOpen(e){let n=this.getWritable();n.__open=e}getOpen(){return this.getLatest().__open}static clone(e){let n=new o(e.__key);return n.__id=e.__id,n.__dir=e.__dir,n.__summary=e.__summary,n.__open=e.__open,n}createDOM(e,n){let r=document.createElement("details");this.__id&&r.setAttribute("id",this.__id),this.__dir&&r.setAttribute("dir",this.__dir),this.__open?(r.setAttribute("open","true"),r.removeAttribute("contenteditable")):r.setAttribute("contenteditable","false");let i=document.createElement("summary");return i.textContent=this.__summary,i.setAttribute("contenteditable","false"),i.addEventListener("click",s=>{s.preventDefault(),n.update(()=>{this.select()})}),r.append(i),r}updateDOM(e,n){return e.__open!==this.__open&&(n.toggleAttribute("open",this.__open),this.__open?n.removeAttribute("contenteditable"):n.setAttribute("contenteditable","false")),e.__id!==this.__id||e.__dir!==this.__dir||e.__summary!==this.__summary}static importDOM(){return{details(e){return{conversion:n=>{let r=new o;n.id&&r.setId(n.id),n.dir&&r.setDirection(Pr(n));let i=Array.from(n.children).find(s=>s.nodeName==="SUMMARY");return r.setSummary(i?.textContent||""),{node:r}},priority:3}},summary(e){return{conversion:n=>({node:"ignore"}),priority:3}}}}exportDOM(e){let n=this.createDOM(e._config,e),r=n.querySelectorAll("[contenteditable]");for(let i of r)i.removeAttribute("contenteditable");return n.removeAttribute("open"),n.removeAttribute("contenteditable"),{element:n}}exportJSON(){return{...super.exportJSON(),type:"details",version:1,id:this.__id,summary:this.__summary}}static importJSON(e){let n=la();return n.setId(e.id),n.setDirection(e.direction),n}shouldSelectDirectly(){return!0}canBeEmpty(){return!1}};function la(){return new qn}function ce(o){return o instanceof qn}function aa(o){let t=1,e=o.getParent();for(;e!=null;){if(j(e)){let n=e.getParent();if(z(n)){t++,e=n.getParent();continue}T(!1,"A ListItemNode must have a ListNode for a parent.")}return t}return t}function da(o){let t=o.getParent();z(t)||T(!1,"A ListItemNode must have a ListNode for a parent.");let e=t;for(;e!==null;)e=e.getParent(),z(e)&&(t=e);return t}function ca(o){let t=[],e=o.getChildren().filter(j);for(let n=0;n{let e=C();if(e!==null){let n=e.getNodes();if(_(e)){let i=e.getStartEndPoints();T(i!==null,"insertList: anchor should be defined");let[s]=i,l=s.getNode(),a=l.getParent();if(xf(l,n)){let d=ye(t);if(ge(a)){l.replace(d);let u=Be();d.append(u)}else if(j(l)){let u=l.getParentOrThrow();Br(d,u.getChildren()),u.replace(d)}return}}let r=new Set;for(let i=0;i0&&o.append(...r),t.remove()}function fa(o){o.update(()=>{let t=C();if(_(t)){let e=new Set,n=t.getNodes(),r=t.anchor.getNode();if(xf(r,n))e.add(da(r));else for(let i=0;i{if(T(j(e),"node is not a ListItemNode"),e.__checked==null)return;let n=e.getParent();z(n)&&n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:px,priority:0})}}static importJSON(e){let n=Be();return n.setChecked(e.checked),n.setValue(e.value),n.setDirection(e.direction),n}exportDOM(e){let n=this.createDOM(e._config);if(n.classList.contains("task-list-item")){let r=y("input",{type:"checkbox",disabled:"disabled"});n.hasAttribute("checked")&&(r.setAttribute("checked","checked"),n.removeAttribute("checked")),n.prepend(r)}return{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let n=0;n{e.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){let r=this.getParentOrThrow();if(z(r)||T(!1,"insertAfter: list node is not parent of list item node"),j(e))return super.insertAfter(e,n);let i=this.getNextSiblings();if(r.insertAfter(e,n),i.length!==0){let s=ye(r.getListType());i.forEach(l=>s.append(l)),e.insertAfter(s,n)}return e}remove(e){let n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&Yn(n)&&Yn(r)&&(qi(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,n=!0){if(this.getTextContent().trim()===""&&this.isLastChild()){let i=this.getParentOrThrow(),s=i.getParent();if(j(s))return s.insertAfter(this),this.selectStart(),null;{let l=I();return i.insertAfter(l,n),this.remove(),l}}let r=Be(this.__checked==null?void 0:!1);return this.insertAfter(r,n),r}collapseAtStart(e){let n=I();this.getChildren().forEach(a=>n.append(a));let i=this.getParentOrThrow(),s=i.getParentOrThrow(),l=j(s);if(i.getChildrenSize()===1)if(l)i.remove(),s.select();else{i.insertBefore(n),i.remove();let a=e.anchor,d=e.focus,u=n.getKey();a.type==="element"&&a.getNode().is(this)&&a.set(u,a.offset,"element"),d.type==="element"&&d.getNode().is(this)&&d.set(u,d.offset,"element")}else i.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let n=this.getWritable();n.__value=e}getChecked(){let e=this.getLatest(),n,r=this.getParent();return z(r)&&(n=r.getListType()),n==="check"?!!e.__checked:void 0}setChecked(e){let n=this.getWritable();n.__checked=e}toggleChecked(){this.setChecked(!this.__checked)}canInsertAfter(e){return j(e)}canReplaceWith(e){return j(e)}canMergeWith(e){return Ve(e)||j(e)}extractWithChild(e,n){if(!_(n))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return ye("bullet")}canMergeWhenEmpty(){return!0}};function Cf(o){let t=o.getChildren(),e=!1,n=!1;for(let r of t)z(r)?n=!0:r.getTextContent().trim().length>0&&(e=!0);return n&&!e}function bf(o,t){let e=!z(t.getFirstChild());o.classList.toggle("task-list-item",e),t.__checked?o.setAttribute("checked","checked"):o.removeAttribute("checked")}function px(o){if(o.classList.contains("task-list-item")){for(let r of o.children)if(r.tagName==="INPUT")return gx(r)}let e=o.getAttribute("aria-checked");return{node:Be(e==="true"?!0:e==="false"?!1:void 0)}}function gx(o){if(!(o.getAttribute("type")==="checkbox"))return{node:null};let e=o.hasAttribute("checked");return{node:Be(e)}}function Be(o){return re(new Pt(void 0,o))}function j(o){return o instanceof Pt}var vo=class o extends X{constructor(e,n,r){super(r);p(this,"__tag");p(this,"__start");p(this,"__listType");p(this,"__id","");let i=xx[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=n}static getType(){return"list"}static clone(e){let n=new o(e.__listType,e.__start,e.__key);return n.__id=e.__id,n.__dir=e.__dir,n}getTag(){return this.__tag}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setListType(e){let n=this.getWritable();n.__listType=e,n.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,n){let r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,_f(i,e.theme,this),this.__id&&i.setAttribute("id",this.__id),this.__dir&&i.setAttribute("dir",this.__dir),i}updateDOM(e,n,r){return e.__tag!==this.__tag||e.__dir!==this.__dir||e.__id!==this.__id?!0:(_f(n,r.theme,this),!1)}static transform(){return e=>{T(z(e),"node is not a ListNode"),Tf(e),Ef(e)}}static importDOM(){return{ol:()=>({conversion:yf,priority:0}),ul:()=>({conversion:yf,priority:0})}}static importJSON(e){let n=ye(e.listType,e.start);return n.setId(e.id),n.setDirection(e.direction),n}exportDOM(e){let{element:n}=super.exportDOM(e);return n&&he(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1,id:this.__id}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let n=0;n1?n.push(...g):r.push(...g)}}r.length>0&&Oi(o,...r),n.length>0&&_e(o,...n)}function hx(o){let t=[];for(let e of o)j(e)?t.push(e):t.push(hf(e));return t}function Nx(o){if(o.getAttribute("__lexicallisttype")==="check"||o.classList.contains("contains-task-list"))return!0;for(let t of o.childNodes)if(he(t)&&(t.hasAttribute("aria-checked")||t.classList.contains("task-list-item")||t.firstElementChild&&t.firstElementChild.matches('input[type="checkbox"]')))return!0;return!1}function yf(o){let t=o.nodeName.toLowerCase(),e=null;if(t==="ol"){let n=o.start;e=ye("number",n)}else t==="ul"&&(Nx(o)?e=ye("check"):e=ye("bullet"));return o.id&&e&&e.setId(o.id),o.dir&&e&&e.setDirection(Pr(o)),{after:hx,node:e}}var xx={ol:"number",ul:"bullet"};function ye(o,t=1){return re(new vo(o,t))}function z(o){return o instanceof vo}var fM=P("INSERT_UNORDERED_LIST_COMMAND"),mM=P("INSERT_ORDERED_LIST_COMMAND"),pM=P("INSERT_CHECK_LIST_COMMAND"),gM=P("REMOVE_LIST_COMMAND");var ie={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},no=class o extends X{constructor(e=ie.NO_STATUS,n=1,r,i){super(i);p(this,"__colSpan");p(this,"__rowSpan");p(this,"__headerState");p(this,"__width");p(this,"__backgroundColor");p(this,"__styles",new Map);p(this,"__alignment","");this.__colSpan=n,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null}static getType(){return"tablecell"}static clone(e){let n=new o(e.__headerState,e.__colSpan,e.__width,e.__key);return n.__rowSpan=e.__rowSpan,n.__backgroundColor=e.__backgroundColor,n.__styles=new Map(e.__styles),n.__alignment=e.__alignment,n}static importDOM(){return{td:e=>({conversion:Sf,priority:0}),th:e=>({conversion:Sf,priority:0})}}static importJSON(e){let n=Fe(e.headerState,e.colSpan,e.width);return e.rowSpan&&n.setRowSpan(e.rowSpan),n.setStyles(new Map(Object.entries(e.styles))),n.setAlignment(e.alignment),n}createDOM(e){let n=document.createElement(this.getTag());this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),_e(n,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader);for(let[r,i]of this.__styles.entries())n.style.setProperty(r,i);return this.__alignment&&n.classList.add("align-"+this.__alignment),n}exportDOM(e){let{element:n}=super.exportDOM(e);return{element:n}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth(),styles:Object.fromEntries(this.__styles),alignment:this.__alignment}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e){let n=this.getWritable();return n.__headerState=e,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let n=this.getWritable();return n.__width=e,this.__width}getWidth(){return this.getLatest().__width}clearWidth(){let e=this.getWritable();e.__width=void 0}getStyles(){let e=this.getLatest();return new Map(e.__styles)}setStyles(e){let n=this.getWritable();n.__styles=new Map(e)}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}updateTag(e){let r=e.toLowerCase()==="th"?ie.ROW:ie.NO_STATUS,i=this.getWritable();i.__headerState=r}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){this.getWritable().__backgroundColor=e}toggleHeaderStyle(e){let n=this.getWritable();return(n.__headerState&e)===e?n.__headerState-=e:n.__headerState+=e,n}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==ie.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__styles!==this.__styles||e.__alignment!==this.__alignment}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function Sf(o){let t=o,e=o.nodeName.toLowerCase(),n;/^(\d+(?:\.\d+)?)px$/.test(t.style.width)&&(n=parseFloat(t.style.width));let i=Fe(e==="th"?ie.ROW:ie.NO_STATUS,t.colSpan,n);i.__rowSpan=t.rowSpan;let s=t.style,l=s.textDecoration.split(" "),a=s.fontWeight==="700"||s.fontWeight==="bold",d=l.includes("line-through"),u=s.fontStyle==="italic",m=l.includes("underline");if(o instanceof HTMLElement){let f=Bn(o);f.delete("background-color"),i.setStyles(f),i.setAlignment($r(o))}let c=s.backgroundColor||null;return c&&i.setBackgroundColor(c),{after:f=>(f.length===0&&f.push(I()),f),forChild:(f,g)=>{if(D(g)&&!E(f)){let h=I();return ke(f)&&f.getTextContent()===` +`?null:(L(f)&&(a&&f.toggleFormat("bold"),d&&f.toggleFormat("strikethrough"),u&&f.toggleFormat("italic"),m&&f.toggleFormat("underline")),h.append(f),h)}return f},node:i}}function Fe(o=ie.NO_STATUS,t=1,e){return re(new no(o,t,e))}function D(o){return o instanceof no}var Ex=P("INSERT_TABLE_COMMAND");var ro=class o extends X{constructor(e){super(e);p(this,"__height");p(this,"__styles",new Map)}static getType(){return"tablerow"}static clone(e){let n=new o(e.__key);return n.__styles=new Map(e.__styles),n}static importDOM(){return{tr:e=>({conversion:Tx,priority:0})}}static importJSON(e){let n=on();return n.setStyles(new Map(Object.entries(e.styles))),n}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1,styles:Object.fromEntries(this.__styles),height:this.__height||0}}createDOM(e){let n=document.createElement("tr");this.__height&&(n.style.height=`${this.__height}px`);for(let[r,i]of this.__styles.entries())n.style.setProperty(r,i);return _e(n,e.theme.tableRow),n}isShadowRoot(){return!0}getStyles(){let e=this.getLatest();return new Map(e.__styles)}setStyles(e){let n=this.getWritable();n.__styles=new Map(e)}setHeight(e){let n=this.getWritable();return n.__height=e,this.__height}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height||e.__styles!==this.__styles}canBeEmpty(){return!1}canIndent(){return!1}};function Tx(o){let t=on(),n=Zo(o.style.height);return t.setHeight(n),o instanceof HTMLElement&&t.setStyles(Bn(o)),{node:t}}function on(){return re(new ro)}function te(o){return o instanceof ro}var Zn=class o extends X{static getType(){return"caption"}static clone(t){return new o(t.__key)}createDOM(t,e){return document.createElement("caption")}updateDOM(t,e,n){return!1}isParentRequired(){return!0}canBeEmpty(){return!1}exportJSON(){return{...super.exportJSON(),type:"caption",version:1}}insertDOMIntoParent(t,e){return e.insertBefore(t,e.firstChild),!0}static importJSON(t){return ma()}static importDOM(){return{caption:t=>({conversion(e){return{node:ma()}},priority:0})}}};function ma(){return new Zn}function Fr(o){return o instanceof Zn}function pa(o){for(let t of o.getChildren())if(Fr(t))return!0;return!1}function Lf(o,t=""){let e=ma(),n=q(t||" ");e.append(n),o.append(e)}function ha(o,t,e=!0){let n=Kr();for(let r=0;ro===ie.BOTH||o===t?t:ie.NO_STATUS;function Yi(o=!0){let t=C();T(_(t)||W(t),"Expected a RangeSelection or TableSelection");let e=t.focus.getNode(),[n,,r]=Oe(e),[i,s]=at(r,n,n),l=i[0].length,{startRow:a}=s;if(o){let d=a+n.__rowSpan-1,u=i[d],m=on();for(let f=0;f1;)if(k-=M.__colSpan,k>=0){let{cell:Z,startRow:se}=x[k];$=Z,B=se}else{N.append(h(v));continue e}$.insertAfter(h(v))}else M.setColSpan(M.__colSpan+1)}g!==null&&Hr(g)}function Na(){let o=C();T(_(o)||W(o),"Expected a RangeSelection or TableSelection");let t=o.anchor.getNode(),e=o.focus.getNode(),[n,,r]=Oe(t),[i]=Oe(e),[s,l,a]=at(r,n,i),{startRow:d}=l,{startRow:u}=a,m=u+i.__rowSpan-1;if(s.length===m-d+1){r.remove();return}let c=s[0].length,f=s[m+1],g=r.getChildAtIndex(m+1);for(let h=m;h>=d;h--){for(let b=c-1;b>=0;b--){let{cell:x,startRow:S,startColumn:v}=s[h][b];if(v===b&&(h===d&&S=d&&S+x.__rowSpan-1>m))if(x.setRowSpan(x.__rowSpan-(m-S+1)),T(g!==null,"Expected nextRowNode not to be null"),b===0)Ea(g,x);else{let{cell:M}=f[b-1];M.insertAfter(x)}}let N=r.getChildAtIndex(h);T(te(N),"Expected GridNode childAtIndex(%s) to be RowNode",String(h)),N.remove()}if(f!==void 0){let{cell:h}=f[0];Hr(h)}else{let h=s[d-1],{cell:N}=h[0];Hr(N)}}function xa(){let o=C();T(_(o)||W(o),"Expected a RangeSelection or TableSelection");let t=o.anchor.getNode(),e=o.focus.getNode(),[n,,r]=Oe(t),[i]=Oe(e),[s,l,a]=at(r,n,i),{startColumn:d}=l,{startRow:u,startColumn:m}=a,c=Math.min(d,m),f=Math.max(d+n.__colSpan-1,m+i.__colSpan-1),g=f-c+1;if(s[0].length===f-c+1){r.selectPrevious(),r.remove();return}let N=s.length;for(let S=0;Sf){if(v===f){let A=f-R+1;M.setColSpan(M.__colSpan-A)}}else M.remove()}let b=s[u],x=d>m?b[d+n.__colSpan]:b[m+i.__colSpan];if(x!==void 0){let{cell:S}=x;Hr(S)}else{let S=m1){for(let l=1;l1){let[l,a]=at(r,e,e),{startColumn:d,startRow:u}=a,m;for(let c=1;c1&&(N+=x.__colSpan-1)}if(h===null)for(let N=0;N!Fr(d));for(let d=0;dx||h>S;){if(cx){let A=S-b,$=x+1;for(let B=0;B<=A;B++)v(d[b+B][$]);x=$}if(h>S){let A=x-N,$=S+1;for(let B=0;B<=A;B++)v(d[$][N+B]);S=$}}let M=[l],R=null;for(let A=f;A<=h;A++)for(let $=c;$<=g;$++){let{cell:B}=d[A][$],k=B.getParent();T(te(k),"Expected TableCellNode parent to be a TableRowNode"),k!==R&&M.push(k),M.push(B,...Cx(B)),R=k}return ft()||(this._cachedNodes=M),M}getTextContent(){let t=this.getNodes().filter(n=>D(n)),e="";for(let n=0;n0;){let n=e.pop();T(n!==void 0,"Stack.length > 0; can't be undefined"),E(n)&&e.unshift(...n.getChildren()),n!==o&&t.push(n)}return t}var zr=class{constructor(t,e){p(this,"focusX");p(this,"focusY");p(this,"listenersToRemove");p(this,"table");p(this,"isHighlightingCells");p(this,"anchorX");p(this,"anchorY");p(this,"tableNodeKey");p(this,"anchorCell");p(this,"focusCell");p(this,"anchorCellNodeKey");p(this,"focusCellNodeKey");p(this,"editor");p(this,"tableSelection");p(this,"hasHijackedSelectionStyles");p(this,"isSelecting");this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=e,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable(),this.isSelecting=!1}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(t=>t())}trackTable(){let t=new MutationObserver(e=>{this.editor.update(()=>{let n=!1;for(let i=0;i{let e=this.editor.getElementByKey(this.tableNodeKey);if(!e)throw new Error("Expected to find TableElement in DOM");this.table=nn(e),t.observe(e,{attributes:!0,childList:!0,subtree:!0})})}clearHighlight(){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),t.update(()=>{let e=ee(this.tableNodeKey);if(!K(e))throw new Error("Expected TableNode.");let n=t.getElementByKey(this.tableNodeKey);if(!n)throw new Error("Expected to find TableElement in DOM");let r=nn(n);Ur(t,r,null),Y(null),t.dispatchCommand(be,void 0)})}enableHighlightStyle(){let t=this.editor;t.update(()=>{let e=t.getElementByKey(this.tableNodeKey);if(!e)throw new Error("Expected to find TableElement in DOM");Oi(e,t._config.theme.tableSelection),e.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let t=this.editor;t.update(()=>{let e=t.getElementByKey(this.tableNodeKey);if(!e)throw new Error("Expected to find TableElement in DOM");_e(e,t._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(t){if(t!==null&&t.tableKey===this.tableNodeKey){let e=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.disableHighlightStyle(),Ur(e,this.table,this.tableSelection)}else t==null?this.clearHighlight():(this.tableNodeKey=t.tableKey,this.updateTableTableSelection(t))}setFocusCellForSelection(t,e=!1){let n=this.editor;n.update(()=>{let r=ee(this.tableNodeKey);if(!K(r))throw new Error("Expected TableNode.");if(!n.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");let s=t.x,l=t.y;if(this.focusCell=t,this.anchorCell!==null){let a=Ca(n._window);a&&a.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==s||this.anchorY!==l||e))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(s===this.focusX&&l===this.focusY)return;if(this.focusX=s,this.focusY=l,this.isHighlightingCells){let a=G(t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&D(a)&&r.is(Do(a))){let d=a.getKey();this.tableSelection=this.tableSelection.clone()||ji(),this.focusCellNodeKey=d,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),Y(this.tableSelection),n.dispatchCommand(be,void 0),Ur(n,this.table,this.tableSelection)}}})}setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y,this.editor.update(()=>{let e=G(t.elem);if(D(e)){let n=e.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():ji(),this.anchorCellNodeKey=n}})}formatCells(t){this.editor.update(()=>{let e=C();W(e)||T(!1,"Expected grid selection");let n=Xo(),r=n.anchor,i=n.focus;e.getNodes().forEach(s=>{D(s)&&s.getTextContentSize()!==0&&(r.set(s.getKey(),0,"element"),i.set(s.getKey(),s.getChildrenSize(),"element"),n.formatText(t))}),Y(e),this.editor.dispatchCommand(be,void 0)})}clearText(){let t=this.editor;t.update(()=>{let e=ee(this.tableNodeKey);if(!K(e))throw new Error("Expected TableNode.");let n=C();W(n)||T(!1,"Expected grid selection");let r=n.getNodes().filter(D);if(r.length===this.table.columns*this.table.rows){e.selectPrevious(),e.remove(),H().selectStart();return}r.forEach(i=>{if(E(i)){let s=I(),l=q();s.append(l),i.append(s),i.getChildren().forEach(a=>{a!==s&&a.remove()})}}),Ur(t,this.table,null),Y(null),t.dispatchCommand(be,void 0)})}};var bx="__lexicalTableSelection",Ca=o=>pe?(o||window).getSelection():null,_x=o=>(o.buttons&1)===1;function ya(o,t,e,n){let r=e.getRootElement();if(r===null)throw new Error("No root element.");let i=new zr(e,o.getKey()),s=e._window||window;yx(t,i);let l=()=>{let c=()=>{i.isSelecting=!1,s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f)},f=g=>{setTimeout(()=>{if(!_x(g)&&i.isSelecting){i.isSelecting=!1,s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);return}let h=_a(g.target);h!==null&&(i.anchorX!==h.x||i.anchorY!==h.y)&&(g.preventDefault(),i.setFocusCellForSelection(h))},0)};return{onMouseMove:f,onMouseUp:c}};t.addEventListener("mousedown",c=>{setTimeout(()=>{if(c.button!==0||!s)return;let f=_a(c.target);f!==null&&(sn(c),i.setAnchorCellForSelection(f));let{onMouseUp:g,onMouseMove:h}=l();i.isSelecting=!0,s.addEventListener("mouseup",g),s.addEventListener("mousemove",h)},0)});let a=c=>{c.button===0&&e.update(()=>{let f=C(),g=c.target;W(f)&&f.tableKey===i.tableNodeKey&&r.contains(g)&&i.clearHighlight()})};s.addEventListener("mousedown",a),i.listenersToRemove.add(()=>s.removeEventListener("mousedown",a)),i.listenersToRemove.add(e.registerCommand(Wt,c=>Wr(e,c,"down",o,i),Xe)),i.listenersToRemove.add(e.registerCommand(zt,c=>Wr(e,c,"up",o,i),Xe)),i.listenersToRemove.add(e.registerCommand(ko,c=>Wr(e,c,"backward",o,i),Xe)),i.listenersToRemove.add(e.registerCommand(Ro,c=>Wr(e,c,"forward",o,i),Xe)),i.listenersToRemove.add(e.registerCommand(Io,c=>{let f=C();if(W(f)){let g=U(f.focus.getNode(),D);if(D(g))return sn(c),g.selectEnd(),!0}return!1},Xe));let d=c=>()=>{let f=C();if(!rn(f,o))return!1;if(W(f))return i.clearText(),!0;if(_(f)){let g=U(f.anchor.getNode(),R=>D(R));if(!D(g))return!1;let h=f.anchor.getNode(),N=f.focus.getNode(),b=o.isParentOf(h),x=o.isParentOf(N);if(b&&!x||x&&!b)return i.clearText(),!0;let v=U(f.anchor.getNode(),R=>E(R)),M=v&&U(v,R=>E(R)&&D(R.getParent()));if(!E(M)||!E(v))return!1;if(c===ut&&M.getPreviousSibling()===null)return!0}return!1};[St,ut,Je].forEach(c=>{i.listenersToRemove.add(e.registerCommand(c,d(c),Pe))});let u=c=>{let f=C();if(!rn(f,o)){let g=f?f.getNodes():null;if(g){let h=g.find(N=>K(N)&&N.getKey()===i.tableNodeKey);if(K(h)){if(!h.getParent())return!1;h.remove()}}return!1}if(W(f))return c&&(c.preventDefault(),c.stopPropagation()),i.clearText(),!0;if(_(f)){let g=U(f.anchor.getNode(),h=>D(h));if(!D(g))return!1}return!1};i.listenersToRemove.add(e.registerCommand(qt,u,Pe)),i.listenersToRemove.add(e.registerCommand(Yt,u,Pe)),i.listenersToRemove.add(e.registerCommand(mo,c=>{let f=C();if(f){if(!(W(f)||_(f)))return!1;zn(e,Nt(c,ClipboardEvent)?c:null,Ki(f));let g=u(c);return _(f)&&f.removeText(),g}return!1},Pe)),i.listenersToRemove.add(e.registerCommand(Ee,c=>{let f=C();if(!rn(f,o))return!1;if(W(f))return i.formatCells(c),!0;if(_(f)){let g=U(f.anchor.getNode(),h=>D(h));if(!D(g))return!1}return!1},Pe)),i.listenersToRemove.add(e.registerCommand(ct,c=>{let f=C();if(!rn(f,o))return!1;if(W(f))return i.clearHighlight(),!1;if(_(f)){let g=U(f.anchor.getNode(),h=>D(h));if(!D(g))return!1;if(typeof c=="string"){let h=Df(e,f,o);if(h)return vf(h,o,[q(c)]),!0}}return!1},Pe)),n&&i.listenersToRemove.add(e.registerCommand($o,c=>{let f=C();if(!_(f)||!f.isCollapsed()||!rn(f,o))return!1;let g=Ji(f.anchor.getNode());if(g===null)return!1;sn(c);let h=o.getCordsFromCellNode(g,i.table);return Of(i,o,h.x,h.y,c.shiftKey?"backward":"forward"),!0},Pe)),i.listenersToRemove.add(e.registerCommand(ar,c=>o.isSelected(),Xe));function m(c){let f=o.getCordsFromCellNode(c,i.table);return o.getDOMCellFromCordsOrThrow(f.x,f.y,i.table)}return i.listenersToRemove.add(e.registerCommand(rr,c=>{let{nodes:f,selection:g}=c,h=g.getStartEndPoints(),N=W(g),x=_(g)&&U(g.anchor.getNode(),Ke=>D(Ke))!==null&&U(g.focus.getNode(),Ke=>D(Ke))!==null||N;if(f.length!==1||!K(f[0])||!x||h===null)return!1;let[S]=h,v=f[0],M=v.getChildren(),R=v.getFirstChildOrThrow().getChildrenSize(),A=v.getChildrenSize(),$=U(S.getNode(),Ke=>D(Ke)),B=$&&U($,Ke=>te(Ke)),k=B&&U(B,Ke=>K(Ke));if(!D($)||!te(B)||!K(k))return!1;let Z=B.getIndexWithinParent(),se=Math.min(k.getChildrenSize()-1,Z+A-1),He=$.getIndexWithinParent(),Cd=Math.min(B.getChildrenSize()-1,He+R-1),Eh=Math.min(He,Cd),Th=Math.min(Z,se),Ch=Math.max(He,Cd),bh=Math.max(Z,se),_h=k.getChildren(),bd=0;for(let Ke=Th;Ke<=bh;Ke++){let _d=_h[Ke];if(!te(_d))return!1;let yd=M[bd];if(!te(yd))return!1;let yh=_d.getChildren(),Sh=yd.getChildren(),Sd=0;for(let Hs=Eh;Hs<=Ch;Hs++){let ni=yh[Hs];if(!D(ni))return!1;let Ld=Sh[Sd];if(!D(Ld))return!1;let Lh=ni.getChildren();Ld.getChildren().forEach(gn=>{L(gn)&&I().append(gn),ni.append(gn)}),Lh.forEach(gn=>gn.remove()),Sd++}bd++}return!0},Pe)),i.listenersToRemove.add(e.registerCommand(be,()=>{let c=C(),f=Ze();if(_(c)){let{anchor:g,focus:h}=c,N=g.getNode(),b=h.getNode(),x=Ji(N),S=Ji(b),v=!!(x&&o.is(Do(x))),M=!!(S&&o.is(Do(S))),R=v!==M,A=v&&M,$=c.isBackward();if(R){let B=c.clone();if(M){let[k]=at(o,S,S),Z=k[0][0].cell,se=k[k.length-1].at(-1).cell;B.focus.set($?Z.getKey():se.getKey(),$?Z.getChildrenSize():se.getChildrenSize(),"element")}Y(B),wf(e,i)}else A&&(x.is(S)||(i.setAnchorCellForSelection(m(x)),i.setFocusCellForSelection(m(S),!0),i.isSelecting||setTimeout(()=>{let{onMouseUp:B,onMouseMove:k}=l();i.isSelecting=!0,s.addEventListener("mouseup",B),s.addEventListener("mousemove",k)},0)))}else if(c&&W(c)&&c.is(f)&&c.tableKey===o.getKey()){let g=Ca(e._window);if(g&&g.anchorNode&&g.focusNode){let h=G(g.focusNode),N=h&&!o.is(Do(h)),b=G(g.anchorNode),x=b&&o.is(Do(b));if(N&&x&&g.rangeCount>0){let S=Zl(g,e);S&&(S.anchor.set(o.getKey(),c.isBackward()?o.getChildrenSize():0,"element"),g.removeAllRanges(),Y(S))}}}return c&&!c.is(f)&&(W(c)||W(f))&&i.tableSelection&&!i.tableSelection.is(f)?(W(c)&&c.tableKey===i.tableNodeKey?i.updateTableTableSelection(c):!W(c)&&W(f)&&f.tableKey===i.tableNodeKey&&i.updateTableTableSelection(null),!1):(i.hasHijackedSelectionStyles&&!o.isSelected()?Sx(e,i):!i.hasHijackedSelectionStyles&&o.isSelected()&&wf(e,i),!1)},Pe)),i.listenersToRemove.add(e.registerCommand(Ut,()=>{let c=C();if(!_(c)||!c.isCollapsed()||!rn(c,o))return!1;let f=Df(e,c,o);return f?(vf(f,o),!0):!1},Pe)),i}function yx(o,t){o[bx]=t}function _a(o){let t=o;for(;t!=null;){let e=t.nodeName;if(e==="TD"||e==="TH"){let n=t._cell;return n===void 0?null:n}t=t.parentNode}return null}function nn(o){let t=[],e={columns:0,domRows:t,rows:0},n=o.firstChild,r=0,i=0;for(t.length=0;n!=null;){let s=n.nodeName;if(s==="COLGROUP"||s==="CAPTION"){n=n.nextSibling;continue}if(s==="TD"||s==="TH"){let d=n,u={elem:d,hasBackgroundColor:d.style.backgroundColor!=="",highlighted:!1,x:r,y:i};n._cell=u;let m=t[i];m===void 0&&(m=t[i]=[]),m[r]=u}else{let d=n.firstChild;if(d!=null){n=d;continue}}let l=n.nextSibling;if(l!=null){r++,n=l;continue}let a=n.parentNode;if(a!=null){let d=a.nextSibling;if(d==null)break;i++,r=0,n=d}}return e.columns=r+1,e.rows=i+1,e}function Ur(o,t,e){let n=new Set(e?e.getNodes():[]);Sa(t,(r,i)=>{let s=r.elem;n.has(i)?(r.highlighted=!0,Af(o,r)):(r.highlighted=!1,Rf(o,r),s.getAttribute("style")||s.removeAttribute("style"))})}function Sa(o,t){let{domRows:e}=o;for(let n=0;n{e.highlighted=!0,Af(o,e)})}function Sx(o,t){t.enableHighlightStyle(),Sa(t.table,e=>{let n=e.elem;e.highlighted=!1,Rf(o,e),n.getAttribute("style")||n.removeAttribute("style")})}var Of=(o,t,e,n,r)=>{let i=r==="forward";switch(r){case"backward":case"forward":return e!==(i?o.table.columns-1:0)?Gi(t.getCellNodeFromCordsOrThrow(e+(i?1:-1),n,o.table),i):n!==(i?o.table.rows-1:0)?Gi(t.getCellNodeFromCordsOrThrow(i?0:o.table.columns-1,n+(i?1:-1),o.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return n!==0?Gi(t.getCellNodeFromCordsOrThrow(e,n-1,o.table),!1):Ar(t,!1),!0;case"down":return n!==o.table.rows-1?Gi(t.getCellNodeFromCordsOrThrow(e,n+1,o.table),!0):Ar(t,!0),!0;default:return!1}},Lx=(o,t,e,n,r)=>{let i=r==="forward";switch(r){case"backward":case"forward":return e!==(i?o.table.columns-1:0)&&o.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(e+(i?1:-1),n,o.table)),!0;case"up":return n!==0?(o.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(e,n-1,o.table)),!0):!1;case"down":return n!==o.table.rows-1?(o.setFocusCellForSelection(t.getDOMCellFromCordsOrThrow(e,n+1,o.table)),!0):!1;default:return!1}};function rn(o,t){if(_(o)||W(o)){let e=t.isParentOf(o.anchor.getNode()),n=t.isParentOf(o.focus.getNode());return e&&n}return!1}function Gi(o,t){t?o.selectStart():o.selectEnd()}var ba="172,206,247";function Af(o,t){let e=t.elem,n=G(e);T(D(n),"Expected to find LexicalNode from Table Cell DOMNode"),n.getBackgroundColor()===null?e.style.setProperty("background-color",`rgb(${ba})`):e.style.setProperty("background-image",`linear-gradient(to right, rgba(${ba},0.85), rgba(${ba},0.85))`),e.style.setProperty("caret-color","transparent")}function Rf(o,t){let e=t.elem,n=G(e);T(D(n),"Expected to find LexicalNode from Table Cell DOMNode"),n.getBackgroundColor()===null&&e.style.removeProperty("background-color"),e.style.removeProperty("background-image"),e.style.removeProperty("caret-color")}function Ji(o){let t=U(o,D);return D(t)?t:null}function Do(o){let t=U(o,K);return K(t)?t:null}function Wr(o,t,e,n,r){if((e==="up"||e==="down")&&Mx(o))return!1;let i=C();if(!rn(i,n)){if(_(i)){if(i.isCollapsed()&&e==="backward"){let s=i.anchor.type,l=i.anchor.offset;if(s!=="element"&&!(s==="text"&&l===0))return!1;let a=i.anchor.getNode();if(!a)return!1;let d=U(a,m=>E(m)&&!m.isInline());if(!d)return!1;let u=d.getPreviousSibling();return!u||!K(u)?!1:(sn(t),u.selectEnd(),!0)}else if(t.shiftKey&&(e==="up"||e==="down")){let s=i.focus.getNode();if(ge(s)){let l=i.getNodes()[0];if(l){let a=U(l,D);if(a&&n.isParentOf(a)){let d=n.getFirstDescendant(),u=n.getLastDescendant();if(!d||!u)return!1;let[m]=Oe(d),[c]=Oe(u),f=n.getCordsFromCellNode(m,r.table),g=n.getCordsFromCellNode(c,r.table),h=n.getDOMCellFromCordsOrThrow(f.x,f.y,r.table),N=n.getDOMCellFromCordsOrThrow(g.x,g.y,r.table);return r.setAnchorCellForSelection(h),r.setFocusCellForSelection(N,!0),!0}}return!1}else{let l=U(s,d=>E(d)&&!d.isInline());if(!l)return!1;let a=e==="down"?l.getNextSibling():l.getPreviousSibling();if(K(a)&&r.tableNodeKey===a.getKey()){let d=a.getFirstDescendant(),u=a.getLastDescendant();if(!d||!u)return!1;let[m]=Oe(d),[c]=Oe(u),f=i.clone();return f.focus.set((e==="up"?m:c).getKey(),e==="up"?0:c.getChildrenSize(),"element"),Y(f),!0}}}}return!1}if(_(i)&&i.isCollapsed()){let{anchor:s,focus:l}=i,a=U(s.getNode(),D),d=U(l.getNode(),D);if(!D(a)||!a.is(d))return!1;let u=Do(a);if(u!==n&&u!=null){let x=o.getElementByKey(u.getKey());if(x!=null)return r.table=nn(x),Wr(o,t,e,u,r)}if(e==="backward"||e==="forward"){let x=s.type,S=s.offset,v=s.getNode();if(!v)return!1;let M=i.getNodes();return M.length===1&&F(M[0])?!1:wx(x,S,v,e)?Ox(t,v,n,e):!1}let m=o.getElementByKey(a.__key),c=o.getElementByKey(s.key);if(c==null||m==null)return!1;let f;if(s.type==="element")f=c.getBoundingClientRect();else{let x=window.getSelection();if(x===null||x.rangeCount===0)return!1;f=x.getRangeAt(0).getBoundingClientRect()}let g=e==="up"?a.getFirstChild():a.getLastChild();if(g==null)return!1;let h=o.getElementByKey(g.__key);if(h==null)return!1;let N=h.getBoundingClientRect();if(e==="up"?N.top>f.top-f.height:f.bottom+f.height>N.bottom){sn(t);let x=n.getCordsFromCellNode(a,r.table);if(t.shiftKey){let S=n.getDOMCellFromCordsOrThrow(x.x,x.y,r.table);r.setAnchorCellForSelection(S),r.setFocusCellForSelection(S,!0)}else return Of(r,n,x.x,x.y,e);return!0}}else if(W(i)){let{anchor:s,focus:l}=i,a=U(s.getNode(),D),d=U(l.getNode(),D),[u]=i.getNodes(),m=o.getElementByKey(u.getKey());if(!D(a)||!D(d)||!K(u)||m==null)return!1;r.updateTableTableSelection(i);let c=nn(m),f=n.getCordsFromCellNode(a,c),g=n.getDOMCellFromCordsOrThrow(f.x,f.y,c);if(r.setAnchorCellForSelection(g),sn(t),t.shiftKey){let h=n.getCordsFromCellNode(d,c);return Lx(r,u,h.x,h.y,e)}else d.selectEnd();return!0}return!1}function sn(o){o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation()}function Mx(o){let t=o.getRootElement();return t?t.hasAttribute("aria-controls")&&t.getAttribute("aria-controls")==="typeahead-menu":!1}function wx(o,t,e,n){return vx(o,e,n)||Dx(o,t,e,n)}function vx(o,t,e){return o==="element"&&(e==="backward"?t.getPreviousSibling()===null:t.getNextSibling()===null)}function Dx(o,t,e,n){let r=U(e,s=>E(s)&&!s.isInline());if(!r)return!1;let i=n==="backward"?t===0:t===e.getTextContentSize();return o==="text"&&i&&(n==="backward"?r.getPreviousSibling()===null:r.getNextSibling()===null)}function Ox(o,t,e,n){let r=U(t,D);if(!D(r))return!1;let[i,s]=at(e,r,r);if(!Ax(i,s,n))return!1;let l=Rx(t,n,e);return!l||K(l)?!1:(sn(o),n==="backward"?l.selectEnd():l.selectStart(),!0)}function Ax(o,t,e){let n=o[0][0],r=o[o.length-1][o[0].length-1],{startColumn:i,startRow:s}=t;return e==="backward"?i===n.startColumn&&s===n.startRow:i===r.startColumn&&s===r.startRow}function Rx(o,t,e){let n=U(o,i=>E(i)&&!i.isInline());if(!n)return;let r=t==="backward"?n.getPreviousSibling():n.getNextSibling();return r&&K(r)?r:t==="backward"?e.getPreviousSibling():e.getNextSibling()}function vf(o,t,e){let n=I();o==="first"?t.insertBefore(n):t.insertAfter(n),n.append(...e||[]),n.selectEnd()}function Df(o,t,e){let n=e.getParent();if(!n)return;let r=o.getElementByKey(n.getKey());if(!r)return;let i=window.getSelection();if(!i||i.anchorNode!==r)return;let s=U(t.anchor.getNode(),N=>D(N));if(!s)return;let l=U(s,N=>K(N));if(!K(l)||!l.is(e))return;let[a,d]=at(e,s,s),u=a[0][0],m=a[a.length-1][a[0].length-1],{startRow:c,startColumn:f}=d,g=c===u.startRow&&f===u.startColumn,h=c===m.startRow&&f===m.startColumn;return g?"first":h?"last":void 0}var Bt=class{constructor(t){p(this,"rowCount",0);p(this,"columnCount",0);p(this,"cells",[]);this.buildCellMap(t)}buildCellMap(t){let e=[],n=(a,d,u)=>{typeof e[d]>"u"&&(e[d]=[]),e[d][a]=u},r=(a,d)=>!!(e[d]&&e[d][a]),i=t.getChildren().filter(a=>te(a));for(let a=0;aD(c)),m=0;for(let c=0;ca.length));let s=[],l=e[0][0];for(let a=0;a=this.cells.length)throw new Error(`TableMap Error: Attempted to get cell ${n+1} of ${this.cells.length}`);return this.cells[n]}getCellsInRange(t){let e=Math.max(Math.min(t.fromX,t.toX),0),n=Math.min(Math.max(t.fromX,t.toX),this.columnCount-1),r=Math.max(Math.min(t.fromY,t.toY),0),i=Math.min(Math.max(t.fromY,t.toY),this.rowCount-1),s=new Set;for(let l=r;l<=i;l++)for(let a=e;a<=n;a++)s.add(this.getCellAtPosition(a,l));return[...s.values()]}getCellsInColumn(t){return this.getCellsInRange({fromX:t,toX:t,fromY:0,toY:this.rowCount-1})}getRangeForCell(t){let e=null,n=t.getKey();for(let r=0;re&&(n=r,e=r.childElementCount);return n}function kf(o){return[...o.children].map(t=>kx(t))}function kx(o){let t=o.style.width||o.getAttribute("width");return t&&!Number.isNaN(Number(t))&&(t=t+"px"),t||""}function Ma(o,t,e){let n=o.getChildren(),r=0;for(let s of n){let l=s.getChildren().length;l>r&&(r=l)}let i=o.getColWidths();(i.length===0||i.lengthi.length&&console.error(`Attempted to set table column width for column [${t}] but only ${i.length} columns found`),i[t]=xt(e),o.setColWidths(i)}function Pf(o,t,e){let n=t.getColWidths();if(n.length>e&&n[e].endsWith("px"))return Number(n[e].replace("px",""));let r=o.getElementByKey(t.__key);if(r){let i=$f(r);if(i&&i.children.length>e)return i.children[e].clientWidth}return 0}function Bf(o){let t=o.getParent();if(!te(t))return-1;let e=0,n=t.getChildren();for(let r of n){let i=r.getColSpan()||1;if(e+=i,r.getKey()===o.getKey())break}return e-1}function Ff(o,t){let e=La(o),n=Bf(o);e&&n>=0&&Ma(e,n,t)}function Hf(o,t){let e=La(t),n=Bf(t);if(!e)return"";let r=e.getColWidths();return r.length>n?r[n]:""}function wa(o){if(o.length===0)return null;let t=y("colgroup");for(let e of o){let n=y("col");e&&(n.style.width=e),t.append(n)}return t}function ln(o){if(W(o))return o.getNodes().filter(n=>D(n));let t=V(o,D);return t?[t]:[]}function Kf(o){let t=o.getShape(),e=ln(o);if(e.length===0)return;let n=La(e[0]);if(!n)return;let r=new Bt(n),i=r.getCellAtPosition(t.toX,t.toY);if(!i)return;let s=t.toX+((i.getColSpan()||1)-1),l=t.toY+((i.getRowSpan()||1)-1),a=r.getCellsInRange({fromX:t.fromX,fromY:t.fromY,toX:s,toY:l});if(a.length===0)return;let d=a[0],u=Math.abs(t.fromX-s)+1,m=Math.abs(t.fromY-l)+1;for(let c=1;cD(r));for(let r of n){let i=r.getStyles();i.delete("height"),i.delete("width"),r.setStyles(i),r.clearWidth()}}}function zf(o){o.setColWidths([]),o.setStyles(new Map);for(let t of o.getChildren()){if(!te(t))continue;t.setStyles(new Map);let e=t.getChildren().filter(n=>D(n));for(let n of e)n.setStyles(new Map),n.setBackgroundColor(null),n.clearWidth()}}function va(o,t){e:for(let e of o.getChildren()){if(!te(e))continue;let n=e.getChildren();for(let r of n){if(!D(r))return;if(t(r)===!1)break e}}}function Wf(o){let t=null;return va(o,e=>{let n=e.getStyles().get("padding")||"";if(t===null&&(t=n),n!==t)return t=null,!1}),t||""}var bt=class o extends It{constructor(e){super(e);p(this,"__colWidths",[]);p(this,"__styles",new Map)}static getType(){return"table"}static clone(e){let n=new o(e.__key);return wo(e,n),n.__colWidths=[...e.__colWidths],n.__styles=new Map(e.__styles),n}static importDOM(){return{table:e=>({conversion:Ix,priority:1})}}static importJSON(e){let n=Kr();return lt(e,n),n.setColWidths(e.colWidths),n.setStyles(new Map(Object.entries(e.styles))),n}exportJSON(){return{...super.exportJSON(),type:"table",version:1,colWidths:this.__colWidths,styles:Object.fromEntries(this.__styles)}}createDOM(e,n){let r=document.createElement("table");_e(r,e.theme.table),st(r,this);let i=this.getColWidths(),s=wa(i);s&&r.append(s);for(let[l,a]of this.__styles.entries())r.style.setProperty(l,a);return r}updateDOM(e,n){if(nf(e,this,n),this.__colWidths.join(":")!==e.__colWidths.join(":")){let r=Array.from(n.children).find(s=>s.nodeName==="COLGROUP"),i=wa(this.__colWidths);r&&r.remove(),i&&n.prepend(i)}if(Array.from(this.__styles.values()).join(":")!==Array.from(e.__styles.values()).join(":")){n.style.cssText="";for(let[r,i]of this.__styles.entries())n.style.setProperty(r,i)}return!1}exportDOM(e){return{...super.exportDOM(e),after:n=>{if(!n)return;let r=n.cloneNode(),i=document.createElement("tbody");if(he(n))for(let s of Array.from(n.children))s.nodeName==="TR"?i.append(s):s.nodeName==="CAPTION"?r.insertBefore(s,r.firstChild):r.append(s);return r.append(i),r}}}canBeEmpty(){return!1}isShadowRoot(){return!0}setColWidths(e){let n=this.getWritable();n.__colWidths=e}getColWidths(){return[...this.getLatest().__colWidths]}getStyles(){let e=this.getLatest();return new Map(e.__styles)}setStyles(e){let n=this.getWritable();n.__styles=new Map(e)}getCordsFromCellNode(e,n){let{rows:r,domRows:i}=n;for(let s=0;s{if(!d)return;let{elem:u}=d;return G(u)===e});if(a!==-1)return{x:a,y:s}}throw new Error("Cell not found in table.")}getDOMCellFromCords(e,n,r){let{domRows:i}=r,s=i[n];if(s==null)return null;let l=e{let r=new o;return n.id&&r.setId(n.id),{node:r}},priority:3}}}}exportJSON(){return{...super.exportJSON(),type:"horizontal-rule",version:1,id:this.__id}}static importJSON(e){let n=Da();return n.setId(e.id),n}};function Da(){return new Vn}function qf(o){return o instanceof Vn}var Yf=o=>(o.split(" ").filter(e=>e.startsWith("language-"))[0]||"").replace("language-",""),an=class o extends kt{constructor(e="",n="",r){super(r);p(this,"__id","");p(this,"__language","");p(this,"__code","");this.__language=e,this.__code=n}static getType(){return"code-block"}static clone(e){let n=new o(e.__language,e.__code,e.__key);return n.__id=e.__id,n}setLanguage(e){let n=this.getWritable();n.__language=e}getLanguage(){return this.getLatest().__language}setCode(e){let n=this.getWritable();n.__code=e}getCode(){return this.getLatest().__code}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}decorate(e,n){return{type:"code",getNode:()=>this}}isInline(){return!1}isIsolated(){return!0}createDOM(e,n){let r=y("pre",{id:this.__id||null},[y("code",{class:this.__language?`language-${this.__language}`:null},[this.__code])]);return y("div",{class:"editor-code-block-wrap"},[r])}updateDOM(e,n){let r=n.querySelector("code");return r&&(e.__language!==this.__language&&(r.className=this.__language?`language-${this.__language}`:""),e.__id!==this.__id&&n.setAttribute("id",this.__id),e.__code!==this.__code&&(r.textContent=this.__code)),!1}exportDOM(e){return{element:this.createDOM(e._config,e).querySelector("pre")}}static importDOM(){return{pre(e){return{conversion:n=>{let r=n.querySelector("code"),i=Yf(n.className)||r&&Yf(r.className)||"",s=r?(r.textContent||"").trim():(n.textContent||"").trim(),l=Qi(i,s);return n.id&&l.setId(n.id),{node:l,after(a){return[]}}},priority:3}}}}exportJSON(){return{type:"code-block",version:1,id:this.__id,language:this.__language,code:this.__code}}static importJSON(e){let n=Qi(e.language,e.code);return n.setId(e.id||""),n}};function Qi(o="",t=""){return new an(o,t)}function es(o){return o instanceof an}function qr(o,t){let e=t.getCode(),n=t.getLanguage();window.$components.first("code-editor").open(e,n,"ltr",(i,s)=>{o.update(()=>{t.setCode(i),t.setLanguage(s)})},()=>{})}var Oo=class o extends kt{constructor(e,n,r){super(r);p(this,"__id","");p(this,"__drawingId","");p(this,"__drawingUrl","");this.__drawingId=e,this.__drawingUrl=n}static getType(){return"diagram"}static clone(e){let n=new o(e.__drawingId,e.__drawingUrl);return n.__id=e.__id,n}setDrawingIdAndUrl(e,n){let r=this.getWritable();r.__drawingUrl=n,r.__drawingId=e}getDrawingIdAndUrl(){let e=this.getLatest();return{id:e.__drawingId,url:e.__drawingUrl}}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}decorate(e,n){return{type:"diagram",getNode:()=>this}}isInline(){return!1}isIsolated(){return!0}createDOM(e,n){return y("div",{id:this.__id||null,"drawio-diagram":this.__drawingId},[y("img",{src:this.__drawingUrl})])}updateDOM(e,n){let r=n.querySelector("img");return r&&(e.__id!==this.__id&&n.setAttribute("id",this.__id),e.__drawingUrl!==this.__drawingUrl&&r.setAttribute("src",this.__drawingUrl),e.__drawingId!==this.__drawingId&&n.setAttribute("drawio-diagram",this.__drawingId)),!1}static importDOM(){return{div(e){return e.hasAttribute("drawio-diagram")?{conversion:n=>{let i=n.querySelector("img")?.getAttribute("src")||"",s=n.getAttribute("drawio-diagram")||"",l=Xn(s,i);return n.id&&l.setId(n.id),{node:l}},priority:3}:null}}}exportJSON(){return{type:"diagram",version:1,id:this.__id,drawingId:this.__drawingId,drawingUrl:this.__drawingUrl}}static importJSON(e){let n=Xn(e.drawingId,e.drawingUrl);return n.setId(e.id||""),n}};function Xn(o="",t=""){return new Oo(o,t)}var $x=["width","height","style","title","name","src","allow","allowfullscreen","loading","sandbox","type","data","controls","autoplay","controlslist","loop","muted","playsinline","poster","preload"];function Px(o){let t={};for(let e of Object.keys(o))$x.includes(e)&&(t[e]=o[e]);return t}function ts(o,t){let e=Object.assign({},o);if(!o.style)return e;let n=Hl(o.style);return n.delete(t),e.style=Eu(n),e}function Zf(o,t){let e=Vf(o),n={};for(let i of t.attributes)n[i.name]=i.value;e.setAttributes(n);let r=[];if(o==="video"||o==="audio"){for(let i of t.children)if(i.tagName==="SOURCE"){let s=i.getAttribute("src"),l=i.getAttribute("type");s&&l&&r.push({src:s,type:l})}e.setSources(r)}return it(t,e),e}var Ao=class o extends X{constructor(e,n){super(n);p(this,"__id","");p(this,"__alignment","");p(this,"__tag");p(this,"__attributes",{});p(this,"__sources",[]);p(this,"__inset",0);this.__tag=e}static getType(){return"media"}static clone(e){let n=new o(e.__tag,e.__key);return n.__attributes=Object.assign({},e.__attributes),n.__sources=e.__sources.map(r=>Object.assign({},r)),n.__id=e.__id,n.__alignment=e.__alignment,n.__inset=e.__inset,n}setTag(e){let n=this.getWritable();n.__tag=e}getTag(){return this.getLatest().__tag}setAttributes(e){let n=this.getWritable();n.__attributes=Px(e)}getAttributes(){let e=this.getLatest();return Object.assign({},e.__attributes)}setSources(e){let n=this.getWritable();n.__sources=e}getSources(){return this.getLatest().__sources.map(n=>Object.assign({},n))}setSrc(e){let n=this.getAttributes(),r=this.getSources();this.__tag==="object"&&(n.data=e),this.__tag==="video"&&r.length>0?(r[0].src=e,delete n.src,r.length>1&&r.splice(1,r.length-1),this.setSources(r)):n.src=e,this.setAttributes(n)}setWidthAndHeight(e,n){let r=Object.assign(this.getAttributes(),{width:e,height:n});r=ts(r,"width"),r=ts(r,"height"),this.setAttributes(r)}setId(e){let n=this.getWritable();n.__id=e}getId(){return this.getLatest().__id}setAlignment(e){let n=this.getWritable();n.__alignment=e}getAlignment(){return this.getLatest().__alignment}setInset(e){let n=this.getWritable();n.__inset=e}getInset(){return this.getLatest().__inset}setHeight(e){if(!e)return;let n=Object.assign(this.getAttributes(),{height:e});this.setAttributes(ts(n,"height"))}getHeight(){let e=this.getLatest();return Zo(e.__attributes.height||"0")}setWidth(e){let n=this.getAttributes(),r=Object.assign(n,{width:e});this.setAttributes(ts(r,"width"))}getWidth(){let e=this.getLatest();return Zo(e.__attributes.width||"0")}isInline(){return!0}isParentRequired(){return!0}createInnerDOM(){let n=(this.__tag==="video"||this.__tag==="audio"?this.__sources:[]).map(i=>y("source",i)),r=y(this.__tag,this.__attributes,n);return st(r,this),r}createDOM(e,n){let r=this.createInnerDOM();return y("span",{class:r.className+" editor-media-wrap"},[r])}updateDOM(e,n){if(e.__tag!==this.__tag||JSON.stringify(e.__sources)!==JSON.stringify(this.__sources)||JSON.stringify(e.__attributes)!==JSON.stringify(this.__attributes))return!0;let r=n.firstElementChild;return e.__id!==this.__id&&Tu(r,"id",this.__id),e.__alignment!==this.__alignment&&(e.__alignment&&(n.classList.remove(`align-${e.__alignment}`),r.classList.remove(`align-${e.__alignment}`)),this.__alignment&&(n.classList.add(`align-${this.__alignment}`),r.classList.add(`align-${this.__alignment}`))),e.__inset!==this.__inset&&(n.style.paddingLeft=`${this.__inset}px`),!1}static importDOM(){let e=n=>r=>({conversion:i=>({node:Zf(n,i)}),priority:3});return{iframe:e("iframe"),embed:e("embed"),object:e("object"),video:e("video"),audio:e("audio")}}exportDOM(e){return{element:this.createInnerDOM()}}exportJSON(){return{...super.exportJSON(),type:"media",version:1,id:this.__id,alignment:this.__alignment,inset:this.__inset,tag:this.__tag,attributes:this.__attributes,sources:this.__sources}}static importJSON(e){let n=Vf(e.tag);return lt(e,n),n}};function Vf(o){return new Ao(o)}function Xf(o){let n=new DOMParser().parseFromString(`${o}`,"text/html").body.children[0];if(!(n instanceof HTMLElement))return null;let r=n.tagName.toLowerCase();return["embed","iframe","video","audio","object"].includes(r)?Zf(r,n):null}var Bx=[{regex:/.*?youtu\.be\/([\w\-_\?&=.]+)/i,w:560,h:314,url:"https://www.youtube.com/embed/$1"},{regex:/.*youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?.*/i,w:560,h:314,url:"https://www.youtube.com/embed/$2?$4"},{regex:/.*youtube.com\/embed\/([a-z0-9\?&=\-_]+).*/i,w:560,h:314,url:"https://www.youtube.com/embed/$1"}],Fx=["mp4","mpeg","m4v","m4p","mov"],Hx=["3gp","aac","flac","mp3","m4a","ogg","wav","webm"],Kx=["html","htm","php","asp","aspx",""];function jf(o){for(let s of Bx)if(o.match(s.regex)){let a=o.replace(s.regex,s.url),d=new Ao("iframe");return d.setSrc(a),d.setHeight(s.h),d.setWidth(s.w),d}let t="iframe",n=(o.split("?")[0].split("/").pop()||"").split("."),r=(n.length>1?n[n.length-1]:"").toLowerCase();Fx.includes(r)?t="video":Hx.includes(r)?t="audio":r&&!Kx.includes(r)&&(t="embed");let i=new Ao(t);return i.setSrc(o),i}function _t(o){return o instanceof Ao}var Jn=class o extends It{constructor(e,n){super(n);p(this,"__tag");this.__tag=e}static getType(){return"heading"}static clone(e){let n=new o(e.__tag,e.__key);return wo(e,n),n}getTag(){return this.__tag}createDOM(e){let n=this.__tag,r=document.createElement(n),s=e.theme.heading;if(s!==void 0){let l=s[n];_e(r,l)}return st(r,this),r}updateDOM(e,n){return Mo(e,this)}static importDOM(){return{h1:e=>({conversion:jn,priority:0}),h2:e=>({conversion:jn,priority:0}),h3:e=>({conversion:jn,priority:0}),h4:e=>({conversion:jn,priority:0}),h5:e=>({conversion:jn,priority:0}),h6:e=>({conversion:jn,priority:0})}}exportDOM(e){let{element:n}=super.exportDOM(e);return n&&he(n)&&this.isEmpty()&&n.append(document.createElement("br")),{element:n}}static importJSON(e){let n=Gn(e.tag);return lt(e,n),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,n=!0){let r=e?e.anchor.offset:0,i=this.getLastDescendant(),l=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?I():Gn(this.getTag()),a=this.getDirection();if(l.setDirection(a),this.insertAfter(l,n),r===0&&!this.isEmpty()&&e){let d=I();d.select(),this.replace(d,!0)}return l}collapseAtStart(){let e=this.isEmpty()?I():Gn(this.getTag());return this.getChildren().forEach(r=>e.append(r)),this.replace(e),!0}extractWithChild(){return!0}};function jn(o){let t=o.nodeName.toLowerCase(),e=null;return(t==="h1"||t==="h2"||t==="h3"||t==="h4"||t==="h5"||t==="h6")&&(e=Gn(t),it(o,e)),{node:e}}function Gn(o){return re(new Jn(o))}function Qn(o){return o instanceof Jn}var er=class o extends It{static getType(){return"quote"}static clone(t){let e=new o(t.__key);return wo(t,e),e}constructor(t){super(t)}createDOM(t){let e=document.createElement("blockquote");return _e(e,t.theme.quote),st(e,this),e}updateDOM(t,e){return Mo(t,this)}static importDOM(){return{blockquote:t=>({conversion:Ux,priority:0})}}exportDOM(t){let{element:e}=super.exportDOM(t);return e&&he(e)&&this.isEmpty()&&e.append(document.createElement("br")),{element:e}}static importJSON(t){let e=os();return lt(t,e),e}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,e){let n=I(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){let t=I();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function os(){return re(new er)}function ns(o){return o instanceof er}function Ux(o){let t=os();return it(o,t),{node:t}}function Gf(){return[Jo,Jn,er,vo,Pt,bt,ro,no,Zn,en,Vn,qn,an,Oo,Ao,ot,Qo]}function Jf(){return[vo,Pt,ot,Qo]}function Qf(o){let t=[en,an,Oo],e=n=>{for(let[r,i]of n)if(i==="destroyed"){let s=o.manager.getDecoratorByNodeKey(r);s&&s.teardown()}};for(let n of t)o.editor.registerMutationListener(n,r=>e(r))}function Oa(o){return"build"in o}var Ae=class{constructor(){p(this,"dom",null);p(this,"context",null);p(this,"abortController",new AbortController)}setContext(t){this.context=t}getContext(){if(this.context===null)throw new Error("Attempted to use EditorUIContext before it has been set");return this.context}getDOMElement(){return this.dom||(this.dom=this.buildDOM()),this.dom}rebuildDOM(){let t=this.buildDOM();return this.dom?.replaceWith(t),this.dom=t,this.dom}trans(t){return this.getContext().translate(t)}updateState(t){}emitEvent(t,e={}){this.dom&&this.dom.dispatchEvent(new CustomEvent("editor::"+t,{detail:e,bubbles:!0}))}onEvent(t,e,n=null){let r=n||this.dom;r&&r.addEventListener("editor::"+t,i=>{e(i.detail)},{signal:this.abortController.signal})}teardown(){this.dom&&this.dom.isConnected&&this.dom.remove(),this.abortController.abort("teardown")}},oe=class extends Ae{constructor(e){super();p(this,"children",[]);this.children.push(...e)}buildDOM(){return y("div",{},this.getChildren().map(e=>e.getDOMElement()))}getChildren(){return this.children}addChildren(...e){this.children.push(...e)}removeChildren(...e){for(let n of e)this.removeChild(n)}removeChild(e){let n=this.children.indexOf(e);n!==-1&&this.children.splice(n,1)}updateState(e){for(let n of this.children)n.updateState(e)}setContext(e){super.setContext(e);for(let n of this.getChildren())n.setContext(e)}teardown(){for(let e of this.children)e.teardown();super.teardown()}},Yr=class extends oe{constructor(e,n){super(n);p(this,"className");this.className=e}buildDOM(){return y("div",{class:this.className},this.getChildren().map(e=>e.getDOMElement()))}};function em(){let o=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${o()+o()}-${o()}-${o()}-${o()}-${o()}${o()}${o()}`}function rs(){return((1+Math.random())*65536|0).toString(16).substring(1)}var Ft=class extends Ae{constructor(e){super();p(this,"definition");this.definition=e}setValue(e){let n=this.getDOMElement().querySelector("input,select,textarea");this.definition.type==="checkbox"?n.checked=!!e:n.value=e,n.dispatchEvent(new Event("change"))}getName(){return this.definition.name}buildDOM(){let e=`editor-form-field-${this.definition.name}-${Date.now()}`,n;if(this.definition.type==="select"){let r=this.definition.valuesByLabel,s=Object.keys(r).map(l=>y("option",{value:r[l]},[this.trans(l)]));n=y("select",{id:e,name:this.definition.name,class:"editor-form-field-input"},s)}else if(this.definition.type==="textarea")n=y("textarea",{id:e,name:this.definition.name,class:"editor-form-field-input"});else if(this.definition.type==="checkbox")n=y("input",{id:e,name:this.definition.name,type:"checkbox",class:"editor-form-field-input-checkbox",value:"true"});else{if(this.definition.type==="hidden")return n=y("input",{id:e,name:this.definition.name,type:"hidden"}),y("div",{hidden:"true"},[n]);n=y("input",{id:e,name:this.definition.name,class:"editor-form-field-input"})}return y("div",{class:"editor-form-field-wrapper"},[y("label",{class:"editor-form-field-label",for:e},[this.trans(this.definition.label)]),n])}},is=class extends oe{constructor(e){let n=e.fields.map(r=>Oa(r)?r.build():new Ft(r));super(n);p(this,"definition");p(this,"onCancel",null);p(this,"onSuccessfulSubmit",null);this.definition=e}setValues(e){for(let n of Object.keys(e)){let r=this.getFieldByName(n);r&&r.setValue(e[n])}}setOnCancel(e){this.onCancel=e}setOnSuccessfulSubmit(e){this.onSuccessfulSubmit=e}getFieldByName(e){let n=r=>{for(let i of r){if(i instanceof Ft&&i.getName()===e)return i;if(i instanceof oe){let s=n(i.getChildren());if(s)return s}}return null};return n(this.getChildren())}buildDOM(){let e=y("button",{type:"button",class:"editor-form-action-secondary"},[this.trans("Cancel")]),n=y("form",{},[...this.children.map(r=>r.getDOMElement()),y("div",{class:"editor-form-actions"},[e,y("button",{type:"submit",class:"editor-form-action-primary"},[this.trans(this.definition.submitText)])])]);return n.addEventListener("submit",async r=>{r.preventDefault();let i=new FormData(n);await this.definition.action(i,this.getContext())&&this.onSuccessfulSubmit&&this.onSuccessfulSubmit()}),e.addEventListener("click",r=>{this.onCancel&&this.onCancel()}),n}},Aa=class extends oe{constructor(e){let n=e.contents.map(r=>Oa(r)?r.build():new Ft(r));super(n);p(this,"definition");p(this,"fields");p(this,"id");this.definition=e,this.fields=n,this.id=em()}getLabel(){return this.getContext().translate(this.definition.label)}getId(){return this.id}buildDOM(){return y("div",{class:"editor-form-tab-content",role:"tabpanel",id:`editor-tabpanel-${this.id}`,"aria-labelledby":`editor-tab-${this.id}`},this.fields.map(e=>e.getDOMElement()))}},dn=class extends oe{constructor(e){let n=e.map(r=>new Aa(r));super(n);p(this,"definitions",[]);p(this,"tabs",[]);this.definitions=e,this.tabs=n}buildDOM(){let e=[],n=[],r=i=>{for(let s=0;s{r(e.indexOf(s))})}return r(0),y("div",{class:"editor-form-tab-container"},[y("div",{class:"editor-form-tab-controls"},e),y("div",{class:"editor-form-tab-contents"},n)])}};var tm='';var ss=class extends oe{constructor(e,n){super([new is(e.form)]);p(this,"definition");p(this,"key");this.definition=e,this.key=n}show(e){let n=this.getDOMElement();document.body.append(n);let r=this.getForm();r.setValues(e),r.setOnCancel(this.hide.bind(this)),r.setOnSuccessfulSubmit(this.hide.bind(this)),this.getContext().manager.setModalActive(this.key,this)}hide(){this.getContext().manager.setModalInactive(this.key),this.teardown()}getForm(){return this.children[0]}buildDOM(){let e=y("button",{class:"editor-modal-close",type:"button",title:this.trans("Close")});e.innerHTML=tm,e.addEventListener("click",this.hide.bind(this));let n=y("div",{class:"editor-modal editor-form-modal"},[y("div",{class:"editor-modal-header"},[y("div",{class:"editor-modal-title"},[this.trans(this.definition.title)]),e]),y("div",{class:"editor-modal-body"},[this.getForm().getDOMElement()])]),r=y("div",{class:"editor-modal-wrapper"},[n]);return r.addEventListener("click",i=>{i.target&&!n.contains(i.target)&&this.hide()}),r}};var ls=class extends oe{constructor(e,n){super(n);p(this,"target");this.target=e}buildDOM(){return y("div",{class:"editor-context-toolbar"},this.getChildren().map(e=>e.getDOMElement()))}updatePosition(){let e=this.getContext().scrollDOM.getBoundingClientRect(),n=this.target.getBoundingClientRect(),r=this.getDOMElement(),i=r.getBoundingClientRect(),s=n.bottom>e.top&&n.tope.bottom;r.classList.toggle("is-above",l);let d=n.left+n.width/2-i.width/2;l?r.style.top=n.top-6-i.height+"px":r.style.top=n.bottom+6+"px",r.style.left=d+"px"}insert(e){this.addChildren(...e),this.getDOMElement().append(...e.map(r=>r.getDOMElement()))}};function Wx(o,t,e){let n=t.getBoundingClientRect(),r=o.getBoundingClientRect();if(o.style.position="fixed",e){let i=n.right;n.right+r.width>window.innerWidth&&(i=Math.max(n.left-r.width,0)),o.style.top=n.top+"px",o.style.left=i+"px"}else{let i=n.left+r.width>window.innerWidth,s=n.left;i&&(s=Math.max(n.right-r.width,0)),o.style.top=n.bottom+"px",o.style.left=s+"px"}}var as=class{constructor(){p(this,"dropdownOptions",new WeakMap);p(this,"openDropdowns",new Set);this.onMenuMouseOver=this.onMenuMouseOver.bind(this),this.onWindowClick=this.onWindowClick.bind(this),window.addEventListener("click",this.onWindowClick)}teardown(){window.removeEventListener("click",this.onWindowClick)}onWindowClick(t){let e=t.target;this.closeAllNotContainingElement(e)}closeAllNotContainingElement(t){for(let e of this.openDropdowns)e.parentElement?.contains(t)||this.closeDropdown(e)}onMenuMouseOver(t){let e=t.target;this.closeAllNotContainingElement(e)}closeAll(){for(let t of this.openDropdowns)this.closeDropdown(t)}closeDropdown(t){t.hidden=!0,t.style.removeProperty("position"),t.style.removeProperty("left"),t.style.removeProperty("top"),this.openDropdowns.delete(t),t.removeEventListener("mouseover",this.onMenuMouseOver);let e=this.getOptions(t).onClose;e&&e()}openDropdown(t){let{toggle:e,showAside:n,onOpen:r}=this.getOptions(t);t.hidden=!1,Wx(t,e,!!n),this.openDropdowns.add(t),t.addEventListener("mouseover",this.onMenuMouseOver),r&&r()}getOptions(t){let e=this.dropdownOptions.get(t);if(!e)throw new Error("Can't find options for dropdown menu");return e}handle(t){let{menu:e,toggle:n,showOnHover:r}=t;this.dropdownOptions.set(e,t);let i=s=>{e.hasAttribute("hidden")?this.openDropdown(e):this.closeDropdown(e)};n.addEventListener("click",i),r&&n.addEventListener("mouseenter",()=>{this.openDropdown(e)})}};var ds=class{constructor(){p(this,"dropdowns",new as);p(this,"modalDefinitionsByKey",{});p(this,"activeModalsByKey",{});p(this,"decoratorConstructorsByType",{});p(this,"decoratorInstancesByNodeKey",{});p(this,"context",null);p(this,"toolbar",null);p(this,"contextToolbarDefinitionsByKey",{});p(this,"activeContextToolbars",[]);p(this,"selectionChangeHandlers",new Set);p(this,"domEventAbortController",new AbortController);p(this,"teardownCallbacks",[])}setContext(t){this.context=t,this.setupEventListeners(),this.setupEditor(t.editor)}getContext(){if(this.context===null)throw new Error("Context attempted to be used without being set");return this.context}triggerStateUpdateForElement(t){t.updateState({selection:null,editor:this.getContext().editor})}registerModal(t,e){this.modalDefinitionsByKey[t]=e}createModal(t){let e=this.modalDefinitionsByKey[t];if(!e)throw new Error(`Attempted to show modal of key [${t}] but no modal registered for that key`);let n=new ss(e,t);return n.setContext(this.getContext()),n}setModalActive(t,e){this.activeModalsByKey[t]=e}setModalInactive(t){delete this.activeModalsByKey[t]}getActiveModal(t){return this.activeModalsByKey[t]}registerDecoratorType(t,e){this.decoratorConstructorsByType[t]=e}getDecorator(t,e){if(this.decoratorInstancesByNodeKey[e])return this.decoratorInstancesByNodeKey[e];let n=this.decoratorConstructorsByType[t];if(!n)throw new Error(`Attempted to use decorator of type [${t}] but not decorator registered for that type`);let r=new n(e);return this.decoratorInstancesByNodeKey[e]=r,r}getDecoratorByNodeKey(t){return this.decoratorInstancesByNodeKey[t]||null}setToolbar(t){this.toolbar&&this.toolbar.teardown(),this.toolbar=t,t.setContext(this.getContext()),this.getContext().containerDOM.prepend(t.getDOMElement())}registerContextToolbar(t,e){this.contextToolbarDefinitionsByKey[t]=e}triggerStateUpdate(t){Su(t.editor,t.selection),this.toolbar?.updateState(t),this.updateContextToolbars(t);for(let e of this.activeContextToolbars)e.updateState(t);this.triggerSelectionChange(t.selection)}triggerStateRefresh(){let t=this.getContext().editor,e={editor:t,selection:ae(t)};this.triggerStateUpdate(e),this.updateContextToolbars(e)}triggerFutureStateRefresh(){requestAnimationFrame(()=>{this.getContext().editor.getEditorState().read(()=>{this.triggerStateRefresh()})})}triggerSelectionChange(t){if(t)for(let e of this.selectionChangeHandlers)e(t)}onSelectionChange(t){this.selectionChangeHandlers.add(t)}offSelectionChange(t){this.selectionChangeHandlers.delete(t)}triggerLayoutUpdate(){window.requestAnimationFrame(()=>{for(let t of this.activeContextToolbars)t.updatePosition()})}getDefaultDirection(){return this.getContext().options.textDirection==="rtl"?"rtl":"ltr"}onTeardown(t){this.teardownCallbacks.push(t)}teardown(){this.domEventAbortController.abort("teardown");for(let[t,e]of Object.entries(this.activeModalsByKey))e.teardown();for(let[t,e]of Object.entries(this.decoratorInstancesByNodeKey))e.teardown();this.toolbar&&this.toolbar.teardown();for(let t of this.activeContextToolbars)t.teardown();this.dropdowns.teardown();for(let t of this.teardownCallbacks)t()}updateContextToolbars(t){for(let s=this.activeContextToolbars.length-1;s>=0;s--)this.activeContextToolbars[s].teardown(),this.activeContextToolbars.splice(s,1);let e=(t.selection?.getNodes()||[])[0]||null;if(!e)return;let n=t.editor.getElementByKey(e.getKey());if(!n)return;let r=Object.keys(this.contextToolbarDefinitionsByKey),i=new Map;for(let s of r){let l=this.contextToolbarDefinitionsByKey[s],a=n.closest(l.selector)||n.querySelector(l.selector);if(a){let d=l.displayTargetLocator?l.displayTargetLocator(a):a;i.has(d)||i.set(d,[]),i.get(d).push(...l.content())}}for(let[s,l]of i){let a=new ls(s,l);a.setContext(this.getContext()),this.activeContextToolbars.push(a),this.getContext().containerDOM.append(a.getDOMElement()),a.updatePosition()}}setupEditor(t){let e=n=>{t.getEditorState().read(()=>{let r=Object.keys(n);for(let i of r){let s=t.getElementByKey(i);if(!s)continue;let l=n[i],a=this.getDecorator(l.type,i);a.setNode(l.getNode());let d=a.render(this.getContext(),s);d&&s.append(d)}})};t.registerDecoratorListener(e),t.registerUpdateListener(({editorState:n,prevEditorState:r})=>{!r._selection?.is(n._selection)&&t.update(()=>{let s=C();this.triggerStateUpdate({editor:t,selection:s})})})}setupEventListeners(){let t=this.triggerLayoutUpdate.bind(this);window.addEventListener("scroll",t,{capture:!0,passive:!0,signal:this.domEventAbortController.signal}),window.addEventListener("resize",t,{passive:!0,signal:this.domEventAbortController.signal})}};function Ra(o,t,e){let n=y("div",{contenteditable:"true",class:`editor-content-area ${e.editorClass||""}`}),r=y("div",{class:"editor-content-wrap"},[n]);o.append(r),o.classList.add("editor-container"),o.setAttribute("dir",e.textDirection),e.darkMode&&o.classList.add("editor-dark");let i=new ds,s={editor:t,containerDOM:o,editorDOM:n,scrollDOM:r,manager:i,translate(l){return e.translations[l]||l},error(l){let a=l instanceof Error?l.message:l;window.$events.error(a)},options:e};return i.setContext(s),s}function cn(o,t){o.update(()=>{let e=H();for(let r of e.getChildren())r.remove(!0);let n=_o(o,t);e.append(...n)})}function om(o,t){o.update(()=>{let e=H(),n=_o(o,t);e.append(...n)})}function nm(o,t){o.update(()=>{let e=H(),n=_o(o,t),r=e.getChildren()[0];for(let i=n.length-1;i>=0;i--)r?r.insertBefore(n[i]):e.append(n[i]),r=n[i]})}function rm(o,t){o.update(()=>{let e=C(),n=_o(o,t),r=e?.getNodes()[0],i=r?.getParents()||[];if(i[i.length-1]&&r)for(let l=n.length-1;l>=0;l--)r.insertAfter(n[l])})}function cs(o){return new Promise((t,e)=>{o.getEditorState().read(()=>{let n=Ri(o);t(n)})})}function us(o){o.focus(()=>{},{defaultSelection:"rootStart"})}var tr=class{constructor(t,e,n){p(this,"container");p(this,"dragTargetSelector");p(this,"options");p(this,"startX",0);p(this,"startY",0);p(this,"target",null);this.container=t,this.dragTargetSelector=e,this.options=n,this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.container.addEventListener("mousedown",this.onMouseDown)}teardown(){this.container.removeEventListener("mousedown",this.onMouseDown),this.container.removeEventListener("mouseup",this.onMouseUp),this.container.removeEventListener("mousemove",this.onMouseMove)}onMouseDown(t){this.target=t.target.closest(this.dragTargetSelector),this.target&&(this.startX=t.screenX,this.startY=t.screenY,window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp),this.options.down&&this.options.down(t,this.target))}onMouseMove(t){this.options.move&&this.target&&this.options.move(t,this.target,{x:t.screenX-this.startX,y:t.screenY-this.startY})}onMouseUp(t){window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),this.options.up&&this.target&&this.options.up(t,this.target,{x:t.screenX-this.startX,y:t.screenY-this.startY})}};var ka=class{constructor(t,e){p(this,"editor");p(this,"editScrollContainer");p(this,"markerDom",null);p(this,"mouseTracker",null);p(this,"dragging",!1);p(this,"targetCell",null);p(this,"xMarkerAtStart",!1);p(this,"yMarkerAtStart",!1);p(this,"activeInTable",!1);this.editor=t,this.editScrollContainer=e,this.setupListeners()}teardown(){this.editScrollContainer.removeEventListener("mousemove",this.onCellMouseMove),window.removeEventListener("scroll",this.onScrollOrResize,{capture:!0}),window.removeEventListener("resize",this.onScrollOrResize),this.mouseTracker&&this.mouseTracker.teardown()}setupListeners(){this.onTableMouseOver=this.onTableMouseOver.bind(this),this.onCellMouseMove=this.onCellMouseMove.bind(this),this.onScrollOrResize=this.onScrollOrResize.bind(this),this.editScrollContainer.addEventListener("mouseover",this.onTableMouseOver,{passive:!0}),window.addEventListener("scroll",this.onScrollOrResize,{capture:!0,passive:!0}),window.addEventListener("resize",this.onScrollOrResize,{passive:!0})}onScrollOrResize(){this.updateCurrentMarkerTargetPosition()}onTableMouseOver(t){if(this.dragging)return;let e=t.target.closest("table");e&&!this.activeInTable?(this.editScrollContainer.addEventListener("mousemove",this.onCellMouseMove,{passive:!0}),this.onCellMouseMove(t),this.activeInTable=!0):!e&&this.activeInTable&&(this.editScrollContainer.removeEventListener("mousemove",this.onCellMouseMove),this.hideMarkers(),this.activeInTable=!1)}onCellMouseMove(t){let e=t.target.closest("td,th");if(!e||this.dragging)return;let n=e.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2;this.targetCell=e,this.xMarkerAtStart=t.clientX<=r,this.yMarkerAtStart=t.clientY<=i;let s=this.xMarkerAtStart?n.left:n.right,l=this.yMarkerAtStart?n.top:n.bottom;this.updateMarkersTo(e,s,l)}updateMarkersTo(t,e,n){let r=this.getMarkers(),i=t.closest("table"),s=i.querySelector("caption"),l=i.getBoundingClientRect(),a=this.editScrollContainer.getBoundingClientRect(),d=l.top;s&&(d=s.getBoundingClientRect().bottom);let u=Math.max(d,a.top),c=Math.min(l.bottom,a.bottom)-u;r.x.style.left=e+"px",r.x.style.top=u+"px",r.x.style.height=c+"px",r.y.style.top=n+"px",r.y.style.left=l.left+"px",r.y.style.width=l.width+"px",r.y.hidden=na.bottom,r.x.hidden=l.top>a.bottom||l.bottom0?d-=1:e.xMarkerAtStart&&d===0&&(u=-u),e.editor.update(()=>{let m=G(a);if(m instanceof bt){let c=Pf(e.editor,m,d),f=Math.max(c+u,10);Ma(m,d,f)}})}if(r==="top"&&e.targetCell){let d=e.targetCell;e.editor.update(()=>{let m=G(d)?.getParent(),c=m?.getIndexWithinParent()||0,f=l.y;e.yMarkerAtStart&&c>0?c-=1:e.yMarkerAtStart&&c===0&&(f=-f);let g=m?.getParent()?.getChildren()[c];if(g instanceof ro){let h=g.getHeight()||0,N=Math.max(h+f,10);g.setHeight(N)}})}}})}getTargetCellColumnIndex(){let t=this.targetCell;if(t===null)return-1;let e=0,n=t.parentElement;for(let r of n?.children||[]){let i=Number(r.getAttribute("colspan"));if((Number.isNaN(i)||i<1)&&(i=1),e+=i,r===t)return e-1}return-1}};function im(o,t){let e=new ka(o,t);return()=>{e.teardown()}}function fs(o){return o.html||""}function sm(o){window.$events.listen("editor::replace",e=>{let n=fs(e);cn(o,n)}),window.$events.listen("editor::append",e=>{let n=fs(e);om(o,n)}),window.$events.listen("editor::prepend",e=>{let n=fs(e);nm(o,n)}),window.$events.listen("editor::insert",e=>{let n=fs(e);rm(o,n)}),window.$events.listen("editor::focus",()=>{us(o)});let t=!0;o.registerUpdateListener(({dirtyElements:e,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{(e.size>0||n.size>0)&&(t?t=!1:window.$events.emit("editor-html-change",""))})}var ms=class{constructor(t){p(this,"data");this.data=t}hasItems(){return!!this.data&&!!this.data.types&&this.data.types.length>0}containsTabularData(){let t=this.data.getData("text/rtf");return!!t&&t.includes("\\trowd")}getImages(){return this.getFiles().filter(t=>t.type.includes("image"))}getFiles(){let{files:t}=this.data;return[...t]}};function ps(o){window.$components.first("image-manager").show(e=>{o(e)},"gallery")}function lm(o){let t=o.thumbs?.display||o.url,e=Tt(t,{target:"_blank"}),n=tn(t,{alt:o.name});return e.append(n),e}async function am(o,t){if(o===null||o.type.indexOf("image")!==0)throw new Error("Not an image file");let e=o.name||`image-${Date.now()}.png`,n=new FormData;return n.append("file",o,e),n.append("uploaded_to",t),(await window.$http.post("/images/gallery",n)).data}function qx(o,t){let e=o.clientX,n=o.clientY;return document.elementFromPoint(e,n)?Cu(t,o.clientX,o.clientY):null}function dm(o,t,e){let n=qx(t,e);n&&rt(n),Ul(o,!0),(!F(n)||!n?.getTextContent())&&n?.remove()}async function Yx(o,t,e){let i=((await window.$http.get(`/templates/${t}`)).data||{html:""}).html||"";o.update(()=>{let s=_o(o,i);dm(s,e,o)})}function cm(o,t){let e=new ms(o),n=!1;if(!e.hasItems()||e.containsTabularData())return n;let r=e.getImages();return r.length>0&&(n=!0),t.editor.update(async()=>{for(let i of r){let s=window.baseUrl("/loading.gif"),l=tn(s),a=I();a.append(l),ve([a]);try{let d=await am(i,t.options.pageId),u=d.name.replace(/"/g,"");t.editor.update(()=>{let m=tn(d.thumbs?.display||"",{alt:u}),c=Tt(d.url,{target:"_blank"});c.append(m),l.replace(c)})}catch(d){t.editor.update(()=>{l.remove(!1)}),window.$events.error(d?.data?.message||t.options.translations.imageUploadErrorText),console.error(d)}}}),n}function Zx(o,t){let e=/https?:\/\/([^?#]*?)\.(png|jpeg|jpg|gif|webp|bmp|avif)/i,n=o.getData("text/plain");return n&&e.test(n)?(t.editor.update(()=>{let r=tn(n);ve([r]),r.select()}),!0):!1}function Vx(o){let t=o.editor;return e=>{let n=e.dataTransfer?.getData("bookstack/template")||"";if(n)return Yx(t,n,e),e.preventDefault(),e.stopPropagation(),!0;let r=e.dataTransfer?.getData("text/html")||"";return r?(t.update(()=>{let i=_o(t,r);dm(i,e,t)}),e.preventDefault(),e.stopPropagation(),!0):e.dataTransfer&&cm(e.dataTransfer,o)?(e.preventDefault(),e.stopPropagation(),!0):!1}}function Xx(o){return t=>{if(!t.clipboardData)return!1;let e=Zx(t.clipboardData,o)||cm(t.clipboardData,o);return e&&t.preventDefault(),e}}function um(o){let t=Vx(o),e=Xx(o),n=o.editor.registerCommand(Po,t,Xe),r=o.editor.registerCommand(ao,e,Xe);return o.scrollDOM.addEventListener("drop",t),()=>{n(),r(),o.scrollDOM.removeEventListener("drop",t)}}var Ia=class{constructor(t,e){p(this,"editorContainer");p(this,"editor");this.editor=t,this.editorContainer=e,this.setupListeners()}setupListeners(){this.handleClick=this.handleClick.bind(this),this.editorContainer.addEventListener("click",this.handleClick)}handleClick(t){let e=t.target;e instanceof HTMLElement&&e.nodeName==="LI"&&e.classList.contains("task-list-item")&&(this.handleTaskListItemClick(e,t),t.preventDefault())}handleTaskListItemClick(t,e){let n=t.getBoundingClientRect();e.clientX<=n.right&&e.clientX>=n.left&&e.clientY>=n.top&&e.clientY<=n.bottom||this.editor.update(()=>{let i=G(t);j(i)&&i.setChecked(!i.getChecked())})}teardown(){this.editorContainer.removeEventListener("click",this.handleClick)}};function fm(o,t){let e=new Ia(o,t);return()=>{e.teardown()}}var $a=class{constructor(t){p(this,"editor");p(this,"tableSelections",new Map);p(this,"unregisterMutationListener",()=>{});this.editor=t,this.init()}init(){this.unregisterMutationListener=this.editor.registerMutationListener(bt,t=>{for(let[e,n]of t)if(n==="created")this.editor.getEditorState().read(()=>{let r=ee(e);K(r)&&this.initializeTableNode(r)});else if(n==="destroyed"){let r=this.tableSelections.get(e);r!==void 0&&(r.removeListeners(),this.tableSelections.delete(e))}})}initializeTableNode(t){let e=t.getKey(),n=this.editor.getElementByKey(e);if(n&&!this.tableSelections.has(e)){let r=ya(t,n,this.editor,!0);this.tableSelections.set(e,r)}}teardown(){this.unregisterMutationListener();for(let[,t]of this.tableSelections)t.removeListeners()}};function mm(o){let t=new $a(o);return()=>{t.teardown()}}var jx=(o,t)=>Qn(o)&&o.getTag()===t;function gs(o,t){o.update(()=>{Fn(e=>jx(e,t),()=>Gn(t))})}function Zr(o){o.update(()=>{Fn(Ve,I)})}function Vr(o){o.update(()=>{Fn(ns,os)})}function Xr(o,t){o.getEditorState().read(()=>{let e=C();de(e,r=>z(r)&&r.getListType()===t)?fa(o):ua(o,t)})}function jr(o){o.getEditorState().read(()=>{let t=C(),e=ae(o),n=V(e,es);n===null?o.update(()=>{let r=Qi();r.setCode(t?.getTextContent()||"");let i=At(t),s=i[0],l=i.slice(1);s?(s.replace(r),l.forEach(a=>a.remove())):Vo(r,!0),qr(o,r),rt(r)}):qr(o,n)})}function pm(o){o.update(()=>{let t=C(),e=At(t),n=!1;for(let i of e)ia(i)||(i.replace(Wn("info"),!0),n=!0);if(n)return;let r=["info","warning","danger","success"];for(let i of e)if(ia(i)){let s=i.getCategory(),a=(r.indexOf(s)+1)%r.length,d=r[a];i.setCategory(d)}})}function hs(o,t){o.update(()=>{let e=C(),n=V(e,$t);if($t(n)?(n.setURL(t.url),n.setTarget(t.target),n.setTitle(t.title)):(n=Tt(t.url,{title:t.title,target:t.target}),ve([n])),$t(n)){for(let r of n.getChildren())r.remove(!0);n.append(q(t.text))}})}var Gr=class extends oe{constructor(e,n){super([e,n]);p(this,"input");p(this,"action");this.input=e,this.action=n}buildDOM(){return y("div",{class:"editor-action-input-container"},[this.input.getDOMElement(),this.action.getDOMElement()])}};var w=class extends Ae{constructor(e){super();p(this,"definition");p(this,"active",!1);p(this,"completedSetup",!1);p(this,"disabled",!1);e.action!==void 0?this.definition=e:this.definition={...e,action(){return!1},isActive:()=>!1}}setContext(e){super.setContext(e),this.definition.setup&&!this.completedSetup&&(this.definition.setup(e,this),this.completedSetup=!0)}buildDOM(){let e=this.getLabel(),n=this.definition.format||"small",r=[];if(this.definition.icon||n==="long"){let s=y("div",{class:"editor-button-icon"});s.innerHTML=this.definition.icon||"",r.push(s)}if(!this.definition.icon||n==="long"){let s=y("div",{class:"editor-button-text"},[e]);r.push(s)}let i=y("button",{type:"button",class:`editor-button editor-button-${n}`,title:this.definition.icon?e:null,disabled:this.disabled?"true":null},r);return i.addEventListener("click",this.onClick.bind(this)),i}onClick(){let e=this.definition.action(this.getContext(),this);e instanceof Promise?e.then(n=>{n===!1&&this.emitEvent("button-action")}):e!==!1&&this.emitEvent("button-action")}updateActiveState(e){let n=this.definition.isActive(e,this.getContext());this.setActiveState(n)}updateDisabledState(e){if(this.definition.isDisabled){let n=this.definition.isDisabled(e,this.getContext());this.toggleDisabled(n)}}setActiveState(e){this.active=e,this.dom?.classList.toggle("editor-button-active",this.active)}updateState(e){this.updateActiveState(e.selection),this.updateDisabledState(e.selection)}isActive(){return this.active}getLabel(){return this.trans(this.definition.label)}toggleDisabled(e){this.disabled=e,e?this.dom?.setAttribute("disabled","true"):this.dom?.removeAttribute("disabled")}};var gm='';var hm='';function Ns(o,t){window.$components.first("entity-selector-popup").show(n=>o(n),{initialValue:t,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}var xs=class extends oe{constructor(e){super([e]);p(this,"input");p(this,"headerMap",new Map);this.input=e}buildDOM(){let e="editor-form-datalist-"+this.input.getName()+"-"+Date.now(),n=this.input.getDOMElement(),r=n.querySelector("input");r?.setAttribute("list",e),r?.setAttribute("autocomplete","off");let i=y("datalist",{id:e}),s=y("div",{class:"editor-link-field-container"},[n,i]);return r?.addEventListener("focusin",()=>{this.updateDataList(i)}),r?.addEventListener("input",()=>{let l=r.value,a=this.headerMap.get(l);a&&this.updateFormFromHeader(a)}),s}updateFormFromHeader(e){this.getHeaderIdAndText(e).then(({id:n,text:r})=>{let i=this.getContext().manager.getActiveModal("link");i&&i.getForm().setValues({url:`#${n}`,text:r,title:r})})}getHeaderIdAndText(e){return new Promise(n=>{this.getContext().editor.update(()=>{let r=e.getId();r||(r="header-"+rs(),e.setId(r));let i=e.getTextContent();n({id:r,text:i})})})}updateDataList(e){this.getContext().editor.getEditorState().read(()=>{let n=Kl(Qn);this.headerMap.clear();let r=[];for(let i of n){let s="header-"+i.getKey();this.headerMap.set(s,i),r.push(y("option",{value:s,label:i.getTextContent().substring(0,54)}))}e.innerHTML="",e.append(...r)})}};function Nm(o,t){let e=t.manager.createModal("image"),n=o.getHeight(),r=o.getWidth(),i={src:o.getSrc(),alt:o.getAltText(),height:n===0?"":String(n),width:r===0?"":String(r)};e.show(i)}var xm={submitText:"Apply",async action(o,t){return t.editor.update(()=>{let e=ae(t.editor),n=V(e,je);je(n)&&(n.setSrc(o.get("src")?.toString()||""),n.setAltText(o.get("alt")?.toString()||""),n.setWidth(Number(o.get("width")?.toString()||"0")),n.setHeight(Number(o.get("height")?.toString()||"0")))}),!0},fields:[{build(){return new Gr(new Ft({label:"Source",name:"src",type:"text"}),new w({label:"Browse files",icon:gm,action(o){ps(t=>{let e=o.manager.getActiveModal("image");e&&e.getForm().setValues({src:t.thumbs?.display||t.url,alt:t.name})})}}))}},{label:"Alternative description",name:"alt",type:"text"},{label:"Width",name:"width",type:"text"},{label:"Height",name:"height",type:"text"}]};function Es(o,t){let e=t.manager.createModal("link");if(o){let n={url:o.getURL(),text:o.getTextContent(),title:o.getTitle()||"",target:o.getTarget()||""};t.editor.update(()=>{let r=jo();r.add(o.getKey()),Y(r)}),e.show(n)}else t.editor.getEditorState().read(()=>{let i={text:C()?.getTextContent()||""};e.show(i)})}var Em={submitText:"Apply",async action(o,t){return hs(t.editor,{url:o.get("url")?.toString()||"",title:o.get("title")?.toString()||"",target:o.get("target")?.toString()||"",text:o.get("text")?.toString()||""}),!0},fields:[{build(){return new Gr(new xs(new Ft({label:"URL",name:"url",type:"text"})),new w({label:"Browse links",icon:hm,action(o){Ns(t=>{let e=o.manager.getActiveModal("link");e&&e.getForm().setValues({url:t.link,text:t.name,title:t.name})})}}))}},{label:"Text to display",name:"text",type:"text"},{label:"Title",name:"title",type:"text"},{label:"Open link in...",name:"target",type:"select",valuesByLabel:{"Current window":"","New window":"_blank"}}]};function Tm(o,t){let e=t.manager.createModal("media"),n={};if(o){let r=o.getAttributes(),i=o.exportDOM(t.editor).element,s=i instanceof HTMLElement?i.outerHTML:"";n={src:r.src||r.data||o.getSources()[0]?.src||"",width:r.width,height:r.height,embed:s,embed_check:s}}e.show(n)}var Cm={submitText:"Save",async action(o,t){let e=await new Promise((i,s)=>{t.editor.getEditorState().read(()=>{let l=V(C(),_t);i(l)})}),n=(o.get("embed")||"").toString().trim(),r=(o.get("embed_check")||"").toString().trim();return n&&n!==r?(t.editor.update(()=>{let i=Xf(n);e&&i?e.replace(i):i&&ve([i])}),!0):(t.editor.update(()=>{let i=(o.get("src")||"").toString().trim(),s=(o.get("height")||"").toString().trim(),l=(o.get("width")||"").toString().trim();if(e){e.setSrc(i),e.setWidthAndHeight(l,s),t.manager.triggerFutureStateRefresh();return}let a=jf(i);(l||s)&&a.setWidthAndHeight(l,s),ve([a])}),!0)},fields:[{build(){return new dn([{label:"General",contents:[{label:"Source",name:"src",type:"text"},{label:"Width",name:"width",type:"text"},{label:"Height",name:"height",type:"text"}]},{label:"Embed",contents:[{label:"Paste your embed code below:",name:"embed",type:"textarea"},{label:"",name:"embed_check",type:"hidden"}]}])}}]};function bm(o,t){let e=t.manager.createModal("details");o&&e.show({summary:o.getSummary()})}var _m={submitText:"Save",async action(o,t){return t.editor.update(()=>{let e=V(C(),ce),n=(o.get("summary")||"").toString().trim();ce(e)&&e.setSummary(n)}),!0},fields:[{label:"Toggle label",name:"summary",type:"text"}]};function Ts(o,t){return gs(o.editor,t),o.manager.triggerFutureStateRefresh(),!0}function so(o){return(t,e)=>(o(t),e.manager.triggerFutureStateRefresh(),!0)}function ym(o){return o.dispatchCommand(Ee,"code"),!0}var Sm={"meta+s":()=>(window.$events.emit("editor-save-draft"),!0),"meta+enter":()=>(window.$events.emit("editor-save-page"),!0),"meta+1":(o,t)=>Ts(t,"h2"),"meta+2":(o,t)=>Ts(t,"h3"),"meta+3":(o,t)=>Ts(t,"h4"),"meta+4":(o,t)=>Ts(t,"h5"),"meta+5":so(Zr),"meta+d":so(Zr),"meta+6":so(Vr),"meta+q":so(Vr),"meta+7":so(jr),"meta+e":so(jr),"meta+8":ym,"meta+shift+e":ym,"meta+9":so(pm),"meta+o":so(o=>Xr(o,"number")),"meta+p":so(o=>Xr(o,"bullet")),"meta+k":(o,t)=>(o.getEditorState().read(()=>{let e=V(C(),$t);Es(e,t)}),!0),"meta+shift+k":(o,t)=>(Ns(e=>{hs(o,{text:e.name,title:e.link,target:"",url:e.link})}),!0)};function Qx(o){return t=>{let e=eE(t);Sm[e]&&Sm[e](o.editor,o)&&(t.stopPropagation(),t.preventDefault())}}function eE(o){return[(Lm()?o.metaKey:o.ctrlKey)?"meta":"",o.shiftKey?"shift":"",o.key].filter(Boolean).join("+").toLowerCase()}function Lm(){return window.navigator.userAgent.includes("Mac OS X")}function tE(o){o.registerCommand(Ue,t=>Lm()?t?.metaKey||!1:t?.ctrlKey||!1,Xe)}function Pa(o){let t=Qx(o);return tE(o.editor),o.editor.registerRootListener((e,n)=>{e?.addEventListener("keydown",t),n?.removeEventListener("keydown",t)})}function oE(o){return je(o)||_t(o)}var Ba=class{constructor(t){p(this,"context");p(this,"resizerDOM",null);p(this,"targetNode",null);p(this,"scrollContainer");p(this,"mouseTracker",null);p(this,"activeSelection","");p(this,"loadAbortController",new AbortController);this.context=t,this.scrollContainer=t.scrollDOM,this.onSelectionChange=this.onSelectionChange.bind(this),this.onTargetDOMLoad=this.onTargetDOMLoad.bind(this),t.manager.onSelectionChange(this.onSelectionChange)}onSelectionChange(t){let e=t?.getNodes()||[];if(this.activeSelection&&this.hide(),e.length===1&&oE(e[0])){let n=e[0],r=this.getTargetDOM(n);r&&this.showForNode(n,r)}}getTargetDOM(t){if(t==null)return null;let e=this.context.editor.getElementByKey(t.__key);return e&&e.nodeName==="SPAN"&&(e=e.firstElementChild),e}onTargetDOMLoad(){this.updateResizerPosition()}teardown(){this.context.manager.offSelectionChange(this.onSelectionChange),this.hide()}showForNode(t,e){this.resizerDOM=this.buildDOM(),this.targetNode=t;let n=y("span",{class:"editor-node-resizer-ghost"});je(t)&&(n=y("img",{src:e.getAttribute("src"),class:"editor-node-resizer-ghost"})),this.resizerDOM.append(n),this.context.scrollDOM.append(this.resizerDOM),this.updateResizerPosition(),this.mouseTracker=this.setupTracker(this.resizerDOM,t,e),this.activeSelection=t.getKey(),e.matches("img, embed, iframe, object")&&(this.loadAbortController=new AbortController,e.addEventListener("load",this.onTargetDOMLoad,{signal:this.loadAbortController.signal}))}updateResizerPosition(){let t=this.getTargetDOM(this.targetNode);if(!this.resizerDOM||!t)return;let e=this.scrollContainer.getBoundingClientRect(),n=t.getBoundingClientRect(),r=n.top-(e.top-this.scrollContainer.scrollTop),i=n.left-e.left;this.resizerDOM.style.top=`${r}px`,this.resizerDOM.style.left=`${i}px`,this.resizerDOM.style.width=n.width+"px",this.resizerDOM.style.height=n.height+"px"}updateDOMSize(t,e){this.resizerDOM&&(this.resizerDOM.style.width=t+"px",this.resizerDOM.style.height=e+"px")}hide(){this.mouseTracker?.teardown(),this.resizerDOM?.remove(),this.targetNode=null,this.activeSelection="",this.loadAbortController.abort()}buildDOM(){let e=["nw","ne","se","sw"].map(n=>y("div",{class:`editor-node-resizer-handle ${n}`}));return y("div",{class:"editor-node-resizer"},e)}setupTracker(t,e,n){let r=0,i=0,s=0,l=!1,a=this,d=!1,u=!1,m=c=>{let f=c.x;d&&(f=0-f);let g=c.y;u&&(g=0-g);let h=Math.sqrt(Math.pow(Math.abs(f),2)+Math.pow(Math.abs(g),2)),b=f+g>0?h:0-h,x=Math.max(5,Math.round(r+b)),S=Math.round(x*s);return{width:x,height:S}};return new tr(t,".editor-node-resizer-handle",{down(c,f){a.resizerDOM?.classList.add("active"),a.context.editor.getEditorState().read(()=>{let g=n.getBoundingClientRect();r=e.getWidth()||g.width,i=e.getHeight()||g.height,e.getHeight()&&(l=!0),s=i/r}),d=f.classList.contains("nw")||f.classList.contains("sw"),u=f.classList.contains("nw")||f.classList.contains("ne")},move(c,f,g){let h=m(g);a.updateDOMSize(h.width,h.height)},up(c,f,g){let h=m(g);a.context.editor.update(()=>{e.setWidth(h.width),e.setHeight(l?h.height:0)},{onUpdate:()=>{requestAnimationFrame(()=>{a.context.manager.triggerLayoutUpdate(),a.updateResizerPosition()})}}),a.resizerDOM?.classList.remove("active")}})}};function Mm(o){let t=new Ba(o);return()=>{t.teardown()}}function nE(o){let t=o.getParent();if(!z(t))return o;let e=o.getChildren().filter(d=>z(d))[0]||null,n=e?.getChildren()||[],r=t.getChildren(),i=r.findIndex(d=>d.getKey()===o.getKey()),s=i===0,l=Be(),a=ye(t.getListType());if(a.append(l),l.append(...o.getChildren()),s?o.append(a):(r[i-1].append(a),o.remove()),e){for(let d of n)l.insertAfter(d);e.remove()}return l}function rE(o){let t=o.getParent(),e=t?.getParent(),n=e?.getParent();if(!z(t)||!z(n)||!j(e))return o;let r=o.getNextSiblings();if(e.insertAfter(o),t.getChildren().length===0&&t.remove(),r.length>0){let i=ye(t.getListType());i.append(...r),o.append(i)}return t.getChildrenSize()===0&&t.remove(),e.getChildren().length===0&&e.remove(),o}function iE(o){let t=o?.getNodes()||[],[e,n]=o?.getStartEndPoints()||[null,null],r=new Set;if(o&&e){o.isBackward()&&n&&([n,e]=[e,n]);let s=e.getNode().getParents(),l=!1;for(let a of s)j(a)&&(l?r.add(a.getKey()):l=!0)}let i=[];e:for(let s of t){if(j(s)){r.has(s.getKey())||i.push(s);continue}let l=s.getParents();for(let a of l)if(j(a)){r.has(a.getKey())||i.push(a);continue e}i.push(null)}return i}function sE(o){let t={};for(let n of o){if(n===null)continue;let r=n.getKey();typeof t[r]>"u"&&(t[r]=n)}let e=Object.values(t);return bu(e)}function Jr(o,t){let e=C(),n=e?.getStartEndPoints(),r=iE(e);if(r.length>0&&!r.includes(null)){let l=[],a=sE(r);if(t>0)for(let d of a)l.push(nE(d));else if(t<0){for(let d of[...a].reverse())l.push(rE(d));l.reverse()}if(l.length===1&&n){let d=l[0],u=d.getChildren()[0];u||(u=q(""),d.append(u)),u.select(n[0].offset,n[1].offset)}else Du(l);return}let s=At(e);for(let l of s)if(_u(l)){let a=l.getInset(),d=Math.min(Math.max(a+t,0),500);l.setInset(d)}Ou(o)}var or=class extends Error{constructor(e,n){super(e.statusText);p(this,"data");p(this,"headers");p(this,"original");p(this,"redirected");p(this,"status");p(this,"statusText");p(this,"url");this.data=n,this.headers=e.headers,this.redirected=e.redirected,this.status=e.status,this.statusText=e.statusText,this.url=e.url,this.original=e}};function Cs(o){return new Promise((t,e)=>{o.oncomplete=o.onsuccess=()=>t(o.result),o.onabort=o.onerror=()=>e(o.error)})}function lE(o,t){let e,n=()=>{if(e)return e;let r=indexedDB.open(o);return r.onupgradeneeded=()=>r.result.createObjectStore(t),e=Cs(r),e.then(i=>{i.onclose=()=>e=void 0},()=>{}),e};return(r,i)=>n().then(s=>i(s.transaction(t,r).objectStore(t)))}var Fa;function Ha(){return Fa||(Fa=lE("keyval-store","keyval")),Fa}function Ka(o,t=Ha()){return t("readonly",e=>Cs(e.get(o)))}function Ua(o,t,e=Ha()){return e("readwrite",n=>(n.put(t,o),Cs(n.transaction)))}function za(o,t=Ha()){return t("readwrite",e=>(e.delete(o),Cs(e.transaction)))}var yt=null,Ya,bs,Wa,qa="last-drawing-save";function Za(o){yt?.contentWindow?.postMessage(JSON.stringify(o),Ya)}function dE(o){Ua(qa,o.data),Wa&&Wa(o.data).then(()=>{za(qa)})}function cE(o){Za({action:"export",format:"xmlpng",xml:o.xml,spin:"Updating drawing"})}function uE(){bs&&bs().then(o=>{Za({action:"load",autosave:1,xml:o})})}function fE(){let o={};yt&&(window.$events.emitPublic(yt,"editor-drawio::configure",{config:o}),Za({action:"configure",config:o}))}function wm(){window.removeEventListener("message",vm),yt&&document.body.removeChild(yt)}function vm(o){if(!o.data||o.data.length<1||o.origin!==Ya)return;let t=JSON.parse(o.data);t.event==="init"?uE():t.event==="exit"?wm():t.event==="save"?cE(t):t.event==="export"?dE(t):t.event==="configure"&&fE()}async function mE(){let o=await Ka(qa),t=document.getElementById("unsaved-drawing-dialog");t||console.error("Missing expected unsaved-drawing dialog"),o&&t&&await window.$components.firstOnElement(t,"confirm-dialog").show()&&(bs=async()=>o)}async function Dm(o,t,e){bs=t,Wa=e,await mE(),yt=document.createElement("iframe"),yt.setAttribute("frameborder","0"),window.addEventListener("message",vm),yt.setAttribute("src",o),yt.setAttribute("class","fullscreen"),yt.style.backgroundColor="#FFFFFF",document.body.appendChild(yt),Ya=new URL(o).origin}async function Om(o,t){let e={image:o,uploaded_to:t};return(await window.$http.post(window.baseUrl("/images/drawio"),e)).data}function Va(){wm()}async function Am(o){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${o}`))).data.content}`}catch(t){throw t instanceof or&&window.$events.showResponseError(t),Va(),t}}function lo(o){return o instanceof Oo}function gE(o,t){o.status===413?window.$events.emit("error",t.options.translations.serverUploadLimitText||""):window.$events.emit("error",t.options.translations.imageUploadErrorText||""),console.error(o)}async function hE(o,t){return await new Promise((n,r)=>{o.getEditorState().read(()=>{let{id:i}=t.getDrawingIdAndUrl();n(i)})})||""}async function NE(o,t,e,n){if(Va(),n){let r=window.baseUrl("/loading.gif");o.editor.update(()=>{t.setDrawingIdAndUrl("",r)})}try{let r=await Om(e,o.options.pageId);o.editor.update(()=>{t.setDrawingIdAndUrl(String(r.id),r.url)})}catch(r){throw r instanceof or&&gE(r,o),n&&o.editor.update(()=>{t.remove()}),new Error(`Failed to save image with error: ${r}`)}}function Qr(o,t){let e=!1;Dm(o.options.drawioUrl,async()=>{let n=await hE(o.editor,t);return e=!n,e?"":Am(n)},async n=>NE(o,t,n,e))}function xE(o){window.$components.first("image-manager").show(e=>{o(e)},"drawio")}function Rm(o){let t=ae(o.editor);xE(e=>{o.editor.update(()=>{let n=Xn(e.id,e.url),r=V(t,lo);lo(r)?r.replace(n):ve([n])})})}function _s(o){let t=o.getChildren();for(let e of t)o.insertBefore(e);o.remove()}function Xa(o){if(o.length===1){let t=o[0];if(F(t)||je(t)||_t(t)||lo(t))return!0}return!1}function km(o){let t=ae(o)?.getNodes()||[];Xa(t)&&o.update(()=>{t[0].remove()})}function EE(o,t){let e=ae(o)?.getNodes()||[];if(Xa(e)){let n=e[0],r=yo(n)||n,i=t?.shiftKey===!0;if(r)return requestAnimationFrame(()=>{o.update(()=>{let s=I();i?r.insertBefore(s):r.insertAfter(s),s.select()})}),t?.preventDefault(),!0}return!1}function Im(o,t,e=!0){let n=ae(o)?.getNodes()||[];if(!Xa(n))return!1;t?.preventDefault();let r=n[0];return o.update(()=>{Ar(r,e)}),!0}function TE(o,t){let e=$m(o);return e===null||e.detailsSibling?!1:(o.update(()=>{let n=I();e.parentDetails.insertAfter(n),n.select()}),t?.preventDefault(),!0)}function CE(o,t){let e=$m(o);if(e===null||e.parentBlock.getTextContent()!=="")return!1;t?.preventDefault();let n=e.parentDetails.getNextSibling();return o.update(()=>{if(n)n.selectStart();else{let r=I();e.parentDetails.insertAfter(r),r.select()}e.parentBlock.remove()}),!0}function $m(o){let e=ae(o)?.getNodes()[0];if(!e)return null;let n=yo(e),r=Ot(e,ce);if(!ce(r)||n===null||n.getKey()!==r.getLastChild()?.getKey())return null;let i=r.getNextSibling();return{parentDetails:r,parentBlock:n,detailsSibling:i}}function bE(o,t){let e=C(),n=e?.getNodes()||[];if(n.length!==1)return!1;let r=yo(n[0]);if(!r)return!1;let i=r.getParent(),s=e?.getStartEndPoints();return s&&ce(i)&&s[0].offset===0&&r.getIndexWithinParent()===0?(t.preventDefault(),o.editor.update(()=>{_s(i),r.selectStart(),o.manager.triggerLayoutUpdate()}),!0):!1}function _E(o){if(o.length!==1)return!1;let t=o[0];return j(t)||j(t.getParent())}function yE(o,t){let e=t?.shiftKey?-40:40,r=C()?.getNodes()||[];return r.length>1||_E(r)?(o.update(()=>{Jr(o,e)}),t?.preventDefault(),!0):!1}function Pm(o){let t=o.editor.registerCommand(qt,l=>(km(o.editor),bE(o,l)),De),e=o.editor.registerCommand(Yt,()=>(km(o.editor),!1),De),n=o.editor.registerCommand(Ue,l=>EE(o.editor,l)||CE(o.editor,l),De),r=o.editor.registerCommand($o,l=>yE(o.editor,l),De),i=o.editor.registerCommand(zt,l=>Im(o.editor,l,!1),De),s=o.editor.registerCommand(Wt,l=>TE(o.editor,l)||Im(o.editor,l,!0),De);return()=>{t(),e(),n(),r(),i(),s()}}function SE(o){return o.toLowerCase().startsWith("http")?/(http|https):\/\/(\S+)\.\S+$/.test(o):!1}function LE(o,t,e){let n=t.getStartEndPoints();if(!n)return;let r=n[0].offset,i=o.getTextContent(),a=i.slice(0,r).lastIndexOf(" ")+1,d=i.slice(a,r);SE(d)&&e.update(()=>{let u=Tt(d);u.append(new nt(d));let m=o.splitText(a,r),c=a>0?1:0,f=m[c];f&&f.replace(u)})}function ja(o){let t=r=>{let i=C(),s=Lu(i);return s&&i&&LE(s,i,o),!1},e=o.registerCommand(ir,t,Kn),n=o.registerCommand(Ue,t,Kn);return()=>{e(),n()}}var ys=class extends oe{buildDOM(){let t=this.getChildren().map(i=>i.getDOMElement()),e=y("div",{class:"editor-format-menu-dropdown editor-dropdown-menu editor-dropdown-menu-vertical",hidden:"true"},t),n=y("button",{class:"editor-format-menu-toggle editor-button",type:"button"},[this.trans("Formats")]),r=y("div",{class:"editor-format-menu editor-dropdown-menu-container"},[n,e]);return this.getContext().manager.dropdowns.handle({toggle:n,menu:e}),this.onEvent("button-action",()=>{this.getContext().manager.dropdowns.closeAll()},r),r}updateState(t){super.updateState(t);for(let e of this.children){if(e instanceof w&&e.isActive()){this.updateToggleLabel(e.getLabel());return}if(e instanceof oe){for(let n of e.getChildren())if(n instanceof w&&n.isActive()){this.updateToggleLabel(n.getLabel());return}}}this.updateToggleLabel(this.trans("Formats"))}updateToggleLabel(t){let e=this.getDOMElement().querySelector("button");e&&(e.innerText=t)}};var Ge=class extends w{constructor(e,n){super(n);p(this,"previewSampleElement");this.previewSampleElement=e}buildDOM(){let e=super.buildDOM();e.innerHTML="";let n=y("span",{class:"editor-button-format-preview"},[this.getLabel()]),r=this.getStylesFromPreview();for(let i of Object.keys(r))n.style.setProperty(i,r[i]);return e.append(n),e}getStylesFromPreview(){let e=y("div",{style:"display: none",hidden:"true",class:"page-content"}),n=this.previewSampleElement.cloneNode();n.textContent=this.getLabel(),e.append(n),document.body.append(e);let r=["color","font-size","background-color","border-inline-start"],i={},s=window.getComputedStyle(n);for(let l of r)i[l]=s.getPropertyValue(l);return e.remove(),i}};var Bm='';var Ss=class extends w{buildDOM(){let t=super.buildDOM(),e=y("div",{class:"editor-menu-button-icon"});return e.innerHTML=Bm,t.append(e),t}};var wE={showOnHover:!1,direction:"horizontal",showAside:void 0,hideOnAction:!0,button:{label:"Menu"}},Ce=class extends oe{constructor(e,n){super(n);p(this,"button");p(this,"childItems");p(this,"open",!1);p(this,"options");if(this.childItems=n,this.options=Object.assign({},wE,e),e.button instanceof w)this.button=e.button;else{let r=e.button.format==="long"?Ss:w;this.button=new r({...e.button,action(){return!1},isActive:()=>this.open})}this.addChildren(this.button)}insertItems(...e){this.addChildren(...e),this.childItems.push(...e)}buildDOM(){let e=this.button.getDOMElement(),n=this.childItems.map(s=>s.getDOMElement()),r=y("div",{class:`editor-dropdown-menu editor-dropdown-menu-${this.options.direction}`,hidden:"true"},n),i=y("div",{class:"editor-dropdown-menu-container"},[e,r]);return this.getContext().manager.dropdowns.handle({toggle:e,menu:r,showOnHover:this.options.showOnHover,showAside:typeof this.options.showAside=="boolean"?this.options.showAside:this.options.direction==="vertical",onOpen:()=>{this.open=!0,this.getContext().manager.triggerStateUpdateForElement(this.button)},onClose:()=>{this.open=!1,this.getContext().manager.triggerStateUpdateForElement(this.button)}}),this.options.hideOnAction&&this.onEvent("button-action",()=>{this.getContext().manager.dropdowns.closeAll()},i),i}};var Fm='';var Hm='';var Km=["#000000","#ffffff","#BFEDD2","#FBEEB8","#F8CAC6","#ECCAFA","#C2E0F4","#2DC26B","#F1C40F","#E03E2D","#B96AD9","#3598DB","#169179","#E67E23","#BA372A","#843FA1","#236FA1","#ECF0F1","#CED4D9","#95A5A6","#7E8C8D","#34495E"],Um="bs-lexical-custom-colors",un=class extends Ae{constructor(e){super();p(this,"callback");this.callback=e}buildDOM(){let e=rs(),r=[...Km,...this.getCustomColorChoices()].map(u=>y("div",{class:"editor-color-select-option",style:`background-color: ${u}`,"data-color":u,"aria-label":u})),i=y("div",{class:"editor-color-select-option","data-color":"",title:this.getContext().translate("Remove color")},[]);i.innerHTML=Fm,r.push(i);let s=y("label",{class:"editor-color-select-option",for:`color-select-${e}`,"data-color":"",title:this.getContext().translate("Custom color")},[]);s.innerHTML=Hm,r.push(s);let l=y("input",{type:"color",hidden:"true",id:`color-select-${e}`});r.push(l),l.addEventListener("change",u=>{l.value&&(this.storeCustomColorChoice(l.value),this.setColor(l.value),this.rebuildDOM())});let a=[];for(let u=0;u{let l=s.target.closest(".editor-table-creator-cell");if(l){let a=Number(l.dataset.rows||0),d=Number(l.dataset.columns||0);this.updateGridSelection(a,d,n,r)}}),i.addEventListener("click",s=>{let l=s.target.closest(".editor-table-creator-cell");l&&this.onCellClick(l)}),i.addEventListener("mouseleave",s=>{this.updateGridSelection(0,0,n,r)}),y("div",{class:"editor-table-creator"},[i,r])}updateGridSelection(t,e,n,r){for(let i of n){let s=Number(i.dataset.rows)<=t&&Number(i.dataset.columns)<=e;i.classList.toggle("active",s)}r.textContent=`${t} x ${e}`}onCellClick(t){let e=Number(t.dataset.rows||0),n=Number(t.dataset.columns||0);if(e<1||n<1)return;let r=Math.min(Math.round(840/n),240),i=Array(n).fill(r+"px");this.getContext().editor.update(()=>{let s=ha(e,n,!1);s.setColWidths(i),Vo(s)})}};var ei=class extends w{constructor(e,n){super(e);p(this,"style");this.style=n}getColorBar(){let e=this.getDOMElement().querySelector("svg .editor-icon-color-bar");if(!e)throw new Error(`Could not find expected color bar in the icon for this ${this.definition.label} button`);return e}updateState(e){if(super.updateState(e),_(e.selection)){let n=Fl(e.selection,this.style);this.getColorBar().setAttribute("fill",n)}}};var zm='';var dt=class extends oe{constructor(e,n){super(n);p(this,"size");p(this,"overflowButton");p(this,"content");this.size=e,this.content=n,this.overflowButton=new Ce({button:{label:"More",icon:zm},hideOnAction:!1},[]),this.addChildren(this.overflowButton)}buildDOM(){let e=this.content.length>this.size?this.size-1:this.size,n=this.content.slice(0,e),r=this.content.slice(e),i=n.map(s=>s.getDOMElement());return r.length>0&&(this.removeChildren(...r),this.overflowButton.insertItems(...r),i.push(this.overflowButton.getDOMElement())),y("div",{class:"editor-overflow-container"},i)}};var Ga='';var Ms='';var Wm='';var qm='';var Ym='';var Zm='';var Vm='';var Xm='';var jm=` @@ -24,9 +24,9 @@ var Mh=Object.defineProperty;var wh=(o,t,e)=>t in o?Mh(o,t,{enumerable:!0,config -`;var Ja=class extends oe{constructor(e){super([]);p(this,"input");p(this,"pickerButton");this.input=e,this.pickerButton=new Ce({button:{icon:jm,label:"Select color"}},[new un(this.onColorSelect.bind(this))]),this.addChildren(this.pickerButton,this.input)}buildDOM(){let e=this.input.getDOMElement();e.append(this.pickerButton.getDOMElement()),e.classList.add("editor-color-field-container");let n=e.querySelector("input");return n.addEventListener("change",()=>{this.setIconColor(n.value)}),e}onColorSelect(e,n){this.input.setValue(e)}setIconColor(e){let n=this.getDOMElement().querySelector("svg .editor-icon-color-display");n&&n.setAttribute("fill",e||"url(#pattern2)")}};function fn(o){return{build(){return new Ja(new Ft(o))}}}var Qa={label:"Border style",name:"border_style",type:"select",valuesByLabel:{"Select...":"",Solid:"solid",Dotted:"dotted",Dashed:"dashed",Double:"double",Groove:"groove",Ridge:"ridge",Inset:"inset",Outset:"outset",None:"none",Hidden:"hidden"}},ed={label:"Border color",name:"border_color",type:"text"},td={label:"Background color",name:"background_color",type:"text"},Gm={label:"Alignment",name:"align",type:"select",valuesByLabel:{None:"",Left:"left",Center:"center",Right:"right"}};function Jm(o,t){let e=o.getStyles(),n=t.manager.createModal("cell_properties");return n.show({width:Hf(t.editor,o),height:e.get("height")||"",type:o.getTag(),h_align:o.getAlignment(),v_align:e.get("vertical-align")||"",border_width:e.get("border-width")||"",border_style:e.get("border-style")||"",border_color:e.get("border-color")||"",background_color:o.getBackgroundColor()||e.get("background-color")||""}),n}var Qm={submitText:"Save",async action(o,t){return t.editor.update(()=>{let e=ln(C());for(let n of e){let r=o.get("width")?.toString()||"";Ff(n,r),n.updateTag(o.get("type")?.toString()||""),n.setAlignment(o.get("h_align")?.toString()||""),n.setBackgroundColor(o.get("background_color")?.toString()||"");let i=n.getStyles();i.set("height",xt(o.get("height")?.toString()||"")),i.set("vertical-align",o.get("v_align")?.toString()||""),i.set("border-width",xt(o.get("border_width")?.toString()||"")),i.set("border-style",o.get("border_style")?.toString()||""),i.set("border-color",o.get("border_color")?.toString()||""),n.setStyles(i)}}),!0},fields:[{build(){let o=[{label:"Width",name:"width",type:"text"},{label:"Height",name:"height",type:"text"},{label:"Cell type",name:"type",type:"select",valuesByLabel:{Cell:"td","Header cell":"th"}},{...Gm,label:"Horizontal align",name:"h_align"},{label:"Vertical align",name:"v_align",type:"select",valuesByLabel:{None:"",Top:"top",Middle:"middle",Bottom:"bottom"}}],t=[{label:"Border width",name:"border_width",type:"text"},Qa,fn(ed),fn(td)];return new dn([{label:"General",contents:o},{label:"Advanced",contents:t}])}}]};function ep(o,t){let e=o.getStyles(),n=t.manager.createModal("row_properties");return n.show({height:e.get("height")||"",border_style:e.get("border-style")||"",border_color:e.get("border-color")||"",background_color:e.get("background-color")||""}),n}var tp={submitText:"Save",async action(o,t){return t.editor.update(()=>{let e=io(C());for(let n of e){let r=n.getStyles();r.set("height",xt(o.get("height")?.toString()||"")),r.set("border-style",o.get("border_style")?.toString()||""),r.set("border-color",o.get("border_color")?.toString()||""),r.set("background-color",o.get("background_color")?.toString()||""),n.setStyles(r)}}),!0},fields:[{label:"Height",name:"height",type:"text"},Qa,fn(ed),fn(td)]};function op(o,t){let e=o.getStyles(),n=t.manager.createModal("table_properties");return n.show({width:e.get("width")||"",height:e.get("height")||"",cell_spacing:e.get("cell-spacing")||"",cell_padding:Wf(o),border_width:e.get("border-width")||"",border_style:e.get("border-style")||"",border_color:e.get("border-color")||"",background_color:e.get("background-color")||"",caption:pa(o)?"true":"",align:o.getAlignment()}),n}var np={submitText:"Save",async action(o,t){return t.editor.update(()=>{let e=Ct(C());if(!e)return;let n=e.getStyles();n.set("width",xt(o.get("width")?.toString()||"")),n.set("height",xt(o.get("height")?.toString()||"")),n.set("cell-spacing",xt(o.get("cell_spacing")?.toString()||"")),n.set("border-width",xt(o.get("border_width")?.toString()||"")),n.set("border-style",o.get("border_style")?.toString()||""),n.set("border-color",o.get("border_color")?.toString()||""),n.set("background-color",o.get("background_color")?.toString()||""),e.setStyles(n),e.setAlignment(o.get("align"));let r=o.get("cell_padding")?.toString()||"";if(r){let l=xt(r);va(e,a=>{let d=a.getStyles();d.set("padding",l),a.setStyles(d)})}let i=!!o.get("caption")?.toString(),s=pa(e);if(i&&!s)Lf(e,t.translate("Caption"));else if(!i&&s)for(let l of e.getChildren())Fr(l)&&l.remove()}),!0},fields:[{build(){let o=[{label:"Width",name:"width",type:"text"},{label:"Height",name:"height",type:"text"},{label:"Cell spacing",name:"cell_spacing",type:"text"},{label:"Cell padding",name:"cell_padding",type:"text"},{label:"Border width",name:"border_width",type:"text"},{label:"Show caption",name:"caption",type:"checkbox"},Gm],t=[Qa,fn(ed),fn(td)];return new dn([{label:"General",contents:o},{label:"Advanced",contents:t}])}}]};function rp(o){let t=E(o)?o.getChildren():[];return{node:o.exportJSON(),children:t.map(e=>rp(e))}}function ip(o,{node:t,children:e}){let n=o._nodes.get(t.type)?.klass.importJSON(t);if(!n)return null;let r=e.map(i=>ip(o,i));for(let i of r)i&&E(n)&&n.append(i);return n}var ti=class{constructor(){p(this,"store",[])}set(...t){this.store.splice(0,this.store.length);for(let e of t)this.store.push(rp(e))}get(t){return this.store.map(e=>ip(t,e)).filter(e=>e!==null)}size(){return this.store.length}};var oi=new ti;function od(){return oi.size()===0}function sp(o){let t=null;for(let e of o){let n=e.getChildren().filter(i=>D(i)),r=0;for(let i of n)if(r+=i.getColSpan()||1,i.getRowSpan()>1)throw Error("Cannot copy rows with merged cells");if(t===null)t=r;else if(t!==r)throw Error("Cannot copy rows with inconsistent sizes")}}function lp(o,t){let e=new Bt(t).columnCount;for(let n of o){let r=n.getChildren().filter(s=>D(s)),i=0;for(let s of r)i+=s.getColSpan()||1;if(i>e)throw Error("Cannot paste rows that are wider than target table");for(;i{let n=new ti;return n.set(...e),n});ws.splice(0,ws.length,...t)}function nd(){return ws.length===0}function mp(o){if(W(o)){let i=o.getShape();return{from:i.fromX,to:i.toX}}let t=Z(o,D),e=Ct(o);if(!D(t)||!e)return null;let r=new Bt(e).getRangeForCell(t);return r?{from:r.fromX,to:r.toX}:null}function pp(o,t){let e=new Bt(t),n=[];for(let r=o.from;r<=o.to;r++){let i=e.getCellsInColumn(r);n.push(i)}return n}function gp(o){let t=null;for(let e of o){let n=0;for(let r of e)if(n+=r.getRowSpan()||1,r.getColSpan()>1)throw Error("Cannot copy columns with merged cells");if(t===null)t=n;else if(t!==n)throw Error("Cannot copy columns with inconsistent sizes")}}function hp(){let o=C(),t=mp(o),e=Ct(o);if(!t||!e)return;let n=e.getColWidths(),r=pp(t,e);gp(r),fp(r);for(let s of r)for(let l of s)l.remove();let i=[...n].splice(t.from,t.to-t.from+1);e.setColWidths(i)}function Np(){let o=C(),t=mp(o),e=Ct(o);if(!t||!e)return;let n=pp(t,e);gp(n),fp(n)}function KE(o,t){let e=new Bt(t).rowCount;for(let n of o){let r=0;for(let i of n)r+=i.getRowSpan()||1;if(r>e)throw Error("Cannot paste columns that are taller than target table");for(;rf.get(o));t||s.reverse(),KE(s,n);let l=new Bt(n),a=l.getRangeForCell(i);if(!a)return;let d=t?a.fromX:a.toX,u=n.getColWidths();for(let f=0;fm);u.splice(t?d:d+1,0,...c)}function Ep(o){xp(o,!0)}function Tp(o){xp(o,!1)}var xe=()=>!1,Se=o=>!de(o,D),Cp={label:"Table",icon:Ga},rd={label:"Table properties",icon:Ga,action(o){o.editor.getEditorState().read(()=>{let t=Ct(C());K(t)&&op(t,o)})},isActive:xe,isDisabled:Se},bp={label:"Clear table formatting",format:"long",action(o){o.editor.update(()=>{let t=Z(C(),D);if(!D(t))return;let e=Ot(t,K);K(e)&&zf(e)})},isActive:xe,isDisabled:Se},_p={label:"Resize to contents",format:"long",action(o){o.editor.update(()=>{let t=Z(C(),D);if(!D(t))return;let e=Ot(t,K);K(e)&&Uf(e)})},isActive:xe,isDisabled:Se},id={label:"Delete table",icon:Ms,action(o){o.editor.update(()=>{let t=Z(C(),K);t&&t.remove()})},isActive(){return!1}},yp={...id,format:"long",isDisabled(o){return!de(o,K)}},sd={label:"Insert row before",icon:Vm,action(o){o.editor.update(()=>{Yi(!1)})},isActive:xe,isDisabled:Se},ld={label:"Insert row after",icon:Xm,action(o){o.editor.update(()=>{Yi(!0)})},isActive:xe,isDisabled:Se},ad={label:"Delete row",icon:qm,action(o){o.editor.update(()=>{Na()})},isActive:xe,isDisabled:Se},Sp={label:"Row properties",format:"long",action(o){o.editor.getEditorState().read(()=>{let t=io(C());te(t[0])&&ep(t[0],o)})},isActive:xe,isDisabled:Se},Lp={label:"Cut row",format:"long",action(o){o.editor.update(()=>{try{ap()}catch(t){o.error(t)}})},isActive:xe,isDisabled:Se},Mp={label:"Copy row",format:"long",action(o){o.editor.getEditorState().read(()=>{try{dp()}catch(t){o.error(t)}})},isActive:xe,isDisabled:Se},wp={label:"Paste row before",format:"long",action(o){o.editor.update(()=>{try{cp(o.editor)}catch(t){o.error(t)}})},isActive:xe,isDisabled:o=>Se(o)||od()},vp={label:"Paste row after",format:"long",action(o){o.editor.update(()=>{try{up(o.editor)}catch(t){o.error(t)}})},isActive:xe,isDisabled:o=>Se(o)||od()},Dp={label:"Cut column",format:"long",action(o){o.editor.update(()=>{try{hp()}catch(t){o.error(t)}})},isActive:xe,isDisabled:Se},Op={label:"Copy column",format:"long",action(o){o.editor.getEditorState().read(()=>{try{Np()}catch(t){o.error(t)}})},isActive:xe,isDisabled:Se},Ap={label:"Paste column before",format:"long",action(o){o.editor.update(()=>{try{Ep(o.editor)}catch(t){o.error(t)}})},isActive:xe,isDisabled:o=>Se(o)||nd()},Rp={label:"Paste column after",format:"long",action(o){o.editor.update(()=>{try{Tp(o.editor)}catch(t){o.error(t)}})},isActive:xe,isDisabled:o=>Se(o)||nd()},dd={label:"Insert column before",icon:Zm,action(o){o.editor.update(()=>{Zi(!1)})},isActive(){return!1}},cd={label:"Insert column after",icon:Ym,action(o){o.editor.update(()=>{Zi(!0)})},isActive(){return!1}},ud={label:"Delete column",icon:Wm,action(o){o.editor.update(()=>{xa()})},isActive(){return!1}},kp={label:"Cell properties",format:"long",action(o){o.editor.getEditorState().read(()=>{let t=Z(C(),D);D(t)&&Jm(t,o)})},isActive:xe,isDisabled:Se},Ip={label:"Merge cells",format:"long",action(o){o.editor.update(()=>{let t=C();W(t)&&Kf(t)})},isActive:xe,isDisabled(o){return!W(o)}},$p={label:"Split cell",format:"long",action(o){o.editor.update(()=>{Ta()})},isActive:xe,isDisabled(o){let t=Z(o,D);return t?!(t.getRowSpan()>1||t.getColSpan()>1):!0}};var Pp='';var Bp='';var Fp='';var Hp='';var Kp='';var Up={label:"Undo",icon:Pp,action(o){o.editor.dispatchCommand(co,void 0),o.manager.triggerFutureStateRefresh()},isActive(o){return!1},setup(o,t){t.toggleDisabled(!0),o.editor.registerCommand(go,e=>(t.toggleDisabled(!e),!1),De)}},zp={label:"Redo",icon:Bp,action(o){o.editor.dispatchCommand(uo,void 0),o.manager.triggerFutureStateRefresh()},isActive(o){return!1},setup(o,t){t.toggleDisabled(!0),o.editor.registerCommand(po,e=>(t.toggleDisabled(!e),!1),De)}},Wp={label:"Source code",icon:Fp,async action(o){let t=o.manager.createModal("source"),e=await cs(o.editor);t.show({source:e})},isActive(){return!1}},qp={label:"Fullscreen",icon:Hp,async action(o,t){let e=o.containerDOM.classList.contains("fullscreen");o.containerDOM.classList.toggle("fullscreen",!e),o.containerDOM.closest("body").classList.toggle("editor-is-fullscreen",!e),t.setActiveState(!e)},isActive(o,t){return t.containerDOM.classList.contains("fullscreen")}},Yp={label:"About the editor",icon:Kp,async action(o,t){o.manager.createModal("about").show({})},isActive(o,t){return!1}};function vs(o,t){return{label:t,action(e){e.editor.update(()=>{Fn(n=>sa(n,o),()=>Wn(o))})},isActive(e){return de(e,n=>sa(n,o))}}}var Zp=vs("info","Info"),Vp=vs("danger","Danger"),Xp=vs("warning","Warning"),jp=vs("success","Success"),ZE=(o,t)=>Qn(o)&&o.getTag()===t;function Ds(o,t){return{label:t,action(e){gs(e.editor,o)},isActive(e){return de(e,n=>ZE(n,o))}}}var Gp=Ds("h2","Large Header"),Jp=Ds("h3","Medium Header"),Qp=Ds("h4","Small Header"),eg=Ds("h5","Tiny Header"),tg={label:"Blockquote",action(o){Vr(o.editor)},isActive(o){return de(o,ns)}},og={label:"Paragraph",action(o){Zr(o.editor)},isActive(o){return de(o,Ve)}};var ng='';var rg='';var ig='';var sg=` +`;var Ja=class extends oe{constructor(e){super([]);p(this,"input");p(this,"pickerButton");this.input=e,this.pickerButton=new Ce({button:{icon:jm,label:"Select color"}},[new un(this.onColorSelect.bind(this))]),this.addChildren(this.pickerButton,this.input)}buildDOM(){let e=this.input.getDOMElement();e.append(this.pickerButton.getDOMElement()),e.classList.add("editor-color-field-container");let n=e.querySelector("input");return n.addEventListener("change",()=>{this.setIconColor(n.value)}),e}onColorSelect(e,n){this.input.setValue(e)}setIconColor(e){let n=this.getDOMElement().querySelector("svg .editor-icon-color-display");n&&n.setAttribute("fill",e||"url(#pattern2)")}};function fn(o){return{build(){return new Ja(new Ft(o))}}}var Qa={label:"Border style",name:"border_style",type:"select",valuesByLabel:{"Select...":"",Solid:"solid",Dotted:"dotted",Dashed:"dashed",Double:"double",Groove:"groove",Ridge:"ridge",Inset:"inset",Outset:"outset",None:"none",Hidden:"hidden"}},ed={label:"Border color",name:"border_color",type:"text"},td={label:"Background color",name:"background_color",type:"text"},Gm={label:"Alignment",name:"align",type:"select",valuesByLabel:{None:"",Left:"left",Center:"center",Right:"right"}};function Jm(o,t){let e=o.getStyles(),n=t.manager.createModal("cell_properties");return n.show({width:Hf(t.editor,o),height:e.get("height")||"",type:o.getTag(),h_align:o.getAlignment(),v_align:e.get("vertical-align")||"",border_width:e.get("border-width")||"",border_style:e.get("border-style")||"",border_color:e.get("border-color")||"",background_color:o.getBackgroundColor()||e.get("background-color")||""}),n}var Qm={submitText:"Save",async action(o,t){return t.editor.update(()=>{let e=ln(C());for(let n of e){let r=o.get("width")?.toString()||"";Ff(n,r),n.updateTag(o.get("type")?.toString()||""),n.setAlignment(o.get("h_align")?.toString()||""),n.setBackgroundColor(o.get("background_color")?.toString()||"");let i=n.getStyles();i.set("height",xt(o.get("height")?.toString()||"")),i.set("vertical-align",o.get("v_align")?.toString()||""),i.set("border-width",xt(o.get("border_width")?.toString()||"")),i.set("border-style",o.get("border_style")?.toString()||""),i.set("border-color",o.get("border_color")?.toString()||""),n.setStyles(i)}}),!0},fields:[{build(){let o=[{label:"Width",name:"width",type:"text"},{label:"Height",name:"height",type:"text"},{label:"Cell type",name:"type",type:"select",valuesByLabel:{Cell:"td","Header cell":"th"}},{...Gm,label:"Horizontal align",name:"h_align"},{label:"Vertical align",name:"v_align",type:"select",valuesByLabel:{None:"",Top:"top",Middle:"middle",Bottom:"bottom"}}],t=[{label:"Border width",name:"border_width",type:"text"},Qa,fn(ed),fn(td)];return new dn([{label:"General",contents:o},{label:"Advanced",contents:t}])}}]};function ep(o,t){let e=o.getStyles(),n=t.manager.createModal("row_properties");return n.show({height:e.get("height")||"",border_style:e.get("border-style")||"",border_color:e.get("border-color")||"",background_color:e.get("background-color")||""}),n}var tp={submitText:"Save",async action(o,t){return t.editor.update(()=>{let e=io(C());for(let n of e){let r=n.getStyles();r.set("height",xt(o.get("height")?.toString()||"")),r.set("border-style",o.get("border_style")?.toString()||""),r.set("border-color",o.get("border_color")?.toString()||""),r.set("background-color",o.get("background_color")?.toString()||""),n.setStyles(r)}}),!0},fields:[{label:"Height",name:"height",type:"text"},Qa,fn(ed),fn(td)]};function op(o,t){let e=o.getStyles(),n=t.manager.createModal("table_properties");return n.show({width:e.get("width")||"",height:e.get("height")||"",cell_spacing:e.get("cell-spacing")||"",cell_padding:Wf(o),border_width:e.get("border-width")||"",border_style:e.get("border-style")||"",border_color:e.get("border-color")||"",background_color:e.get("background-color")||"",caption:pa(o)?"true":"",align:o.getAlignment()}),n}var np={submitText:"Save",async action(o,t){return t.editor.update(()=>{let e=Ct(C());if(!e)return;let n=e.getStyles();n.set("width",xt(o.get("width")?.toString()||"")),n.set("height",xt(o.get("height")?.toString()||"")),n.set("cell-spacing",xt(o.get("cell_spacing")?.toString()||"")),n.set("border-width",xt(o.get("border_width")?.toString()||"")),n.set("border-style",o.get("border_style")?.toString()||""),n.set("border-color",o.get("border_color")?.toString()||""),n.set("background-color",o.get("background_color")?.toString()||""),e.setStyles(n),e.setAlignment(o.get("align"));let r=o.get("cell_padding")?.toString()||"";if(r){let l=xt(r);va(e,a=>{let d=a.getStyles();d.set("padding",l),a.setStyles(d)})}let i=!!o.get("caption")?.toString(),s=pa(e);if(i&&!s)Lf(e,t.translate("Caption"));else if(!i&&s)for(let l of e.getChildren())Fr(l)&&l.remove()}),!0},fields:[{build(){let o=[{label:"Width",name:"width",type:"text"},{label:"Height",name:"height",type:"text"},{label:"Cell spacing",name:"cell_spacing",type:"text"},{label:"Cell padding",name:"cell_padding",type:"text"},{label:"Border width",name:"border_width",type:"text"},{label:"Show caption",name:"caption",type:"checkbox"},Gm],t=[Qa,fn(ed),fn(td)];return new dn([{label:"General",contents:o},{label:"Advanced",contents:t}])}}]};function rp(o){let t=E(o)?o.getChildren():[];return{node:o.exportJSON(),children:t.map(e=>rp(e))}}function ip(o,{node:t,children:e}){let n=o._nodes.get(t.type)?.klass.importJSON(t);if(!n)return null;let r=e.map(i=>ip(o,i));for(let i of r)i&&E(n)&&n.append(i);return n}var ti=class{constructor(){p(this,"store",[])}set(...t){this.store.splice(0,this.store.length);for(let e of t)this.store.push(rp(e))}get(t){return this.store.map(e=>ip(t,e)).filter(e=>e!==null)}size(){return this.store.length}};var oi=new ti;function od(){return oi.size()===0}function sp(o){let t=null;for(let e of o){let n=e.getChildren().filter(i=>D(i)),r=0;for(let i of n)if(r+=i.getColSpan()||1,i.getRowSpan()>1)throw Error("Cannot copy rows with merged cells");if(t===null)t=r;else if(t!==r)throw Error("Cannot copy rows with inconsistent sizes")}}function lp(o,t){let e=new Bt(t).columnCount;for(let n of o){let r=n.getChildren().filter(s=>D(s)),i=0;for(let s of r)i+=s.getColSpan()||1;if(i>e)throw Error("Cannot paste rows that are wider than target table");for(;i{let n=new ti;return n.set(...e),n});ws.splice(0,ws.length,...t)}function nd(){return ws.length===0}function mp(o){if(W(o)){let i=o.getShape();return{from:i.fromX,to:i.toX}}let t=V(o,D),e=Ct(o);if(!D(t)||!e)return null;let r=new Bt(e).getRangeForCell(t);return r?{from:r.fromX,to:r.toX}:null}function pp(o,t){let e=new Bt(t),n=[];for(let r=o.from;r<=o.to;r++){let i=e.getCellsInColumn(r);n.push(i)}return n}function gp(o){let t=null;for(let e of o){let n=0;for(let r of e)if(n+=r.getRowSpan()||1,r.getColSpan()>1)throw Error("Cannot copy columns with merged cells");if(t===null)t=n;else if(t!==n)throw Error("Cannot copy columns with inconsistent sizes")}}function hp(){let o=C(),t=mp(o),e=Ct(o);if(!t||!e)return;let n=e.getColWidths(),r=pp(t,e);gp(r),fp(r);for(let s of r)for(let l of s)l.remove();let i=[...n].splice(t.from,t.to-t.from+1);e.setColWidths(i)}function Np(){let o=C(),t=mp(o),e=Ct(o);if(!t||!e)return;let n=pp(t,e);gp(n),fp(n)}function KE(o,t){let e=new Bt(t).rowCount;for(let n of o){let r=0;for(let i of n)r+=i.getRowSpan()||1;if(r>e)throw Error("Cannot paste columns that are taller than target table");for(;rf.get(o));t||s.reverse(),KE(s,n);let l=new Bt(n),a=l.getRangeForCell(i);if(!a)return;let d=t?a.fromX:a.toX,u=n.getColWidths();for(let f=0;fm);u.splice(t?d:d+1,0,...c)}function Ep(o){xp(o,!0)}function Tp(o){xp(o,!1)}var xe=()=>!1,Se=o=>!de(o,D),Cp={label:"Table",icon:Ga},rd={label:"Table properties",icon:Ga,action(o){o.editor.getEditorState().read(()=>{let t=Ct(C());K(t)&&op(t,o)})},isActive:xe,isDisabled:Se},bp={label:"Clear table formatting",format:"long",action(o){o.editor.update(()=>{let t=V(C(),D);if(!D(t))return;let e=Ot(t,K);K(e)&&zf(e)})},isActive:xe,isDisabled:Se},_p={label:"Resize to contents",format:"long",action(o){o.editor.update(()=>{let t=V(C(),D);if(!D(t))return;let e=Ot(t,K);K(e)&&Uf(e)})},isActive:xe,isDisabled:Se},id={label:"Delete table",icon:Ms,action(o){o.editor.update(()=>{let t=V(C(),K);t&&t.remove()})},isActive(){return!1}},yp={...id,format:"long",isDisabled(o){return!de(o,K)}},sd={label:"Insert row before",icon:Vm,action(o){o.editor.update(()=>{Yi(!1)})},isActive:xe,isDisabled:Se},ld={label:"Insert row after",icon:Xm,action(o){o.editor.update(()=>{Yi(!0)})},isActive:xe,isDisabled:Se},ad={label:"Delete row",icon:qm,action(o){o.editor.update(()=>{Na()})},isActive:xe,isDisabled:Se},Sp={label:"Row properties",format:"long",action(o){o.editor.getEditorState().read(()=>{let t=io(C());te(t[0])&&ep(t[0],o)})},isActive:xe,isDisabled:Se},Lp={label:"Cut row",format:"long",action(o){o.editor.update(()=>{try{ap()}catch(t){o.error(t)}})},isActive:xe,isDisabled:Se},Mp={label:"Copy row",format:"long",action(o){o.editor.getEditorState().read(()=>{try{dp()}catch(t){o.error(t)}})},isActive:xe,isDisabled:Se},wp={label:"Paste row before",format:"long",action(o){o.editor.update(()=>{try{cp(o.editor)}catch(t){o.error(t)}})},isActive:xe,isDisabled:o=>Se(o)||od()},vp={label:"Paste row after",format:"long",action(o){o.editor.update(()=>{try{up(o.editor)}catch(t){o.error(t)}})},isActive:xe,isDisabled:o=>Se(o)||od()},Dp={label:"Cut column",format:"long",action(o){o.editor.update(()=>{try{hp()}catch(t){o.error(t)}})},isActive:xe,isDisabled:Se},Op={label:"Copy column",format:"long",action(o){o.editor.getEditorState().read(()=>{try{Np()}catch(t){o.error(t)}})},isActive:xe,isDisabled:Se},Ap={label:"Paste column before",format:"long",action(o){o.editor.update(()=>{try{Ep(o.editor)}catch(t){o.error(t)}})},isActive:xe,isDisabled:o=>Se(o)||nd()},Rp={label:"Paste column after",format:"long",action(o){o.editor.update(()=>{try{Tp(o.editor)}catch(t){o.error(t)}})},isActive:xe,isDisabled:o=>Se(o)||nd()},dd={label:"Insert column before",icon:Zm,action(o){o.editor.update(()=>{Zi(!1)})},isActive(){return!1}},cd={label:"Insert column after",icon:Ym,action(o){o.editor.update(()=>{Zi(!0)})},isActive(){return!1}},ud={label:"Delete column",icon:Wm,action(o){o.editor.update(()=>{xa()})},isActive(){return!1}},kp={label:"Cell properties",format:"long",action(o){o.editor.getEditorState().read(()=>{let t=V(C(),D);D(t)&&Jm(t,o)})},isActive:xe,isDisabled:Se},Ip={label:"Merge cells",format:"long",action(o){o.editor.update(()=>{let t=C();W(t)&&Kf(t)})},isActive:xe,isDisabled(o){return!W(o)}},$p={label:"Split cell",format:"long",action(o){o.editor.update(()=>{Ta()})},isActive:xe,isDisabled(o){let t=V(o,D);return t?!(t.getRowSpan()>1||t.getColSpan()>1):!0}};var Pp='';var Bp='';var Fp='';var Hp='';var Kp='';var Up={label:"Undo",icon:Pp,action(o){o.editor.dispatchCommand(co,void 0),o.manager.triggerFutureStateRefresh()},isActive(o){return!1},setup(o,t){t.toggleDisabled(!0),o.editor.registerCommand(go,e=>(t.toggleDisabled(!e),!1),De)}},zp={label:"Redo",icon:Bp,action(o){o.editor.dispatchCommand(uo,void 0),o.manager.triggerFutureStateRefresh()},isActive(o){return!1},setup(o,t){t.toggleDisabled(!0),o.editor.registerCommand(po,e=>(t.toggleDisabled(!e),!1),De)}},Wp={label:"Source code",icon:Fp,async action(o){let t=o.manager.createModal("source"),e=await cs(o.editor);t.show({source:e})},isActive(){return!1}},qp={label:"Fullscreen",icon:Hp,async action(o,t){let e=o.containerDOM.classList.contains("fullscreen");o.containerDOM.classList.toggle("fullscreen",!e),o.containerDOM.closest("body").classList.toggle("editor-is-fullscreen",!e),t.setActiveState(!e)},isActive(o,t){return t.containerDOM.classList.contains("fullscreen")}},Yp={label:"About the editor",icon:Kp,async action(o,t){o.manager.createModal("about").show({})},isActive(o,t){return!1}};function vs(o,t){return{label:t,action(e){e.editor.update(()=>{Fn(n=>sa(n,o),()=>Wn(o))})},isActive(e){return de(e,n=>sa(n,o))}}}var Zp=vs("info","Info"),Vp=vs("danger","Danger"),Xp=vs("warning","Warning"),jp=vs("success","Success"),ZE=(o,t)=>Qn(o)&&o.getTag()===t;function Ds(o,t){return{label:t,action(e){gs(e.editor,o)},isActive(e){return de(e,n=>ZE(n,o))}}}var Gp=Ds("h2","Large Header"),Jp=Ds("h3","Medium Header"),Qp=Ds("h4","Small Header"),eg=Ds("h5","Tiny Header"),tg={label:"Blockquote",action(o){Vr(o.editor)},isActive(o){return de(o,ns)}},og={label:"Paragraph",action(o){Zr(o.editor)},isActive(o){return de(o,Ve)}};var ng='';var rg='';var ig='';var sg=` `;var lg='';var ag='';var dg='';var cg='';var ug='';var fg='';function mn(o,t,e){return{label:o,icon:e,action(n){n.editor.dispatchCommand(Ee,t)},isActive(n){return Mu(n,t)}}}var fd=mn("Bold","bold",ng),md=mn("Italic","italic",rg),mg=mn("Underline","underline",ig),pg={label:"Text color",icon:sg},gg={label:"Highlight color",icon:lg};function hg(o,t,e){o.editor.update(()=>{let n=C();n&&Bl(n,{[t]:e||null})})}var Ng=(o,t)=>hg(t,"color",o),xg=(o,t)=>hg(t,"background-color",o),Eg=mn("Strikethrough","strikethrough",ag),Tg=mn("Superscript","superscript",dg),Cg=mn("Subscript","subscript",cg),bg=mn("Inline code","code",ug),_g={label:"Clear formatting",icon:fg,action(o){o.editor.update(()=>{let t=C();for(let e of t?.getNodes()||[])L(e)&&(e.setFormat(0),e.setStyle(""))})},isActive(){return!1}};var yg='';var Sg='';var Lg='';var Mg='';var wg='';var vg='';function Os(o,t){let e=ae(o.editor),n=e?.getNodes()||[];if(n.length===1&&E(n[0])&&n[0].isInline()&&Rr(n[0])){n[0].setAlignment(t),rt(n[0]),o.manager.triggerFutureStateRefresh();return}let i=At(e).filter(a=>Rr(a)),l=i.every(a=>a.getAlignment()===t)?"":t;for(let a of i)a.setAlignment(l);o.manager.triggerFutureStateRefresh()}function Dg(o,t){let e=ae(o.editor),n=At(e);for(let r of n)r.setDirection(t);o.manager.triggerFutureStateRefresh()}var Og={label:"Align left",icon:yg,action(o){o.editor.update(()=>Os(o,"left"))},isActive(o){return kr(o,"left")}},Ag={label:"Align center",icon:Sg,action(o){o.editor.update(()=>Os(o,"center"))},isActive(o){return kr(o,"center")}},Rg={label:"Align right",icon:Lg,action(o){o.editor.update(()=>Os(o,"right"))},isActive(o){return kr(o,"right")}},kg={label:"Justify",icon:Mg,action(o){o.editor.update(()=>Os(o,"justify"))},isActive(o){return kr(o,"justify")}},Ig={label:"Left to right",icon:wg,action(o){o.editor.update(()=>Dg(o,"ltr"))},isActive(o){return zl(o,"ltr")}},$g={label:"Right to left",icon:vg,action(o){o.editor.update(()=>Dg(o,"rtl"))},isActive(o){return zl(o,"rtl")}};var Pg='';var Bg='';var Fg='';var Hg='';var Kg='';function pd(o,t,e){return{label:o,icon:e,action(n){Xr(n.editor,t)},isActive(n){return de(n,r=>z(r)&&r.getListType()===t)}}}var gd=pd("Bullet list","bullet",Pg),hd=pd("Numbered list","number",Bg),Ug=pd("Task list","check",Fg),zg={label:"Increase indent",icon:Hg,action(o){o.editor.update(()=>{Jr(o.editor,40)})},isActive(){return!1}},Wg={label:"Decrease indent",icon:Kg,action(o){o.editor.update(()=>{Jr(o.editor,-40)})},isActive(){return!1}};var qg='';var Yg='';var Zg='';var Vg='';var Xg='';var jg='';var Gg='';var Jg='';var Qg=` -`;var eh='';var th='';var As={label:"Insert/edit link",icon:qg,action(o){o.editor.getEditorState().read(()=>{let t=Z(C(),$t);Es(t,o)})},isActive(o){return de(o,$t)}},oh={label:"Remove link",icon:Yg,action(o){o.editor.update(()=>{let t=ae(o.editor),e=Z(t,$t);if(e){let n=e.getChildren().reverse();for(let r of n)e.insertAfter(r);e.remove(),n[n.length-1].selectStart(),o.manager.triggerFutureStateRefresh()}})},isActive(o){return!1}},Nd={label:"Insert/Edit Image",icon:Zg,action(o){o.editor.getEditorState().read(()=>{let t=ae(o.editor),e=Z(t,je);if(e){Nm(e,o);return}ps(n=>{o.editor.update(()=>{let r=lm(n);ve([r]),r.select()})})})},isActive(o){return de(o,je)}},nh={label:"Insert horizontal line",icon:Vg,action(o){o.editor.update(()=>{Vo(Da(),!1)})},isActive(o){return de(o,qf)}},xd={label:"Insert code block",icon:Xg,action(o){jr(o.editor)},isActive(o){return de(o,es)}},rh=Object.assign({},xd,{label:"Edit code block",icon:jg}),ih={label:"Insert/edit drawing",icon:Gg,action(o){o.editor.getEditorState().read(()=>{let t=ae(o.editor),e=Z(t,lo);e===null?o.editor.update(()=>{let n=Xn();Vo(n,!0),Qr(o,n),n.selectStart()}):Qr(o,e)})},isActive(o){return de(o,lo)}},sh={label:"Drawing manager",action(o){Rm(o)},isActive(){return!1}},Ed={label:"Insert/edit media",icon:th,action(o){o.editor.getEditorState().read(()=>{let t=C(),e=Z(t,_t);Tm(e,o)})},isActive(o){return de(o,_t)}},lh={label:"Insert collapsible block",icon:Jg,action(o){o.editor.update(()=>{let t=C(),e=la(),r=(t?.getNodes()||[]).map(s=>s.getTopLevelElement()).filter(s=>s!==null),i=[...new Set(r)];e.setOpen(!0),i.length>0?i[0].insertAfter(e):H().append(e);for(let s of i)e.append(s)})},isActive(o){return de(o,ce)}},ah={label:"Edit label",icon:eh,action(o){o.editor.getEditorState().read(()=>{let t=Z(C(),ce);ce(t)&&bm(t,o)})},isActive(o){return!1}},dh={label:"Toggle open/closed",icon:Qg,action(o){o.editor.update(()=>{let t=Z(C(),ce);ce(t)&&(t.setOpen(!t.getOpen()),o.manager.triggerLayoutUpdate())})},isActive(o){return!1}},ch={label:"Unwrap",icon:Ms,action(o){o.editor.update(()=>{let t=Z(C(),ce);ce(t)&&(_s(t),o.manager.triggerLayoutUpdate())})},isActive(o){return!1}};var uh=` +`;var eh='';var th='';var As={label:"Insert/edit link",icon:qg,action(o){o.editor.getEditorState().read(()=>{let t=V(C(),$t);Es(t,o)})},isActive(o){return de(o,$t)}},oh={label:"Remove link",icon:Yg,action(o){o.editor.update(()=>{let t=ae(o.editor),e=V(t,$t);if(e){let n=e.getChildren().reverse();for(let r of n)e.insertAfter(r);e.remove(),n[n.length-1].selectStart(),o.manager.triggerFutureStateRefresh()}})},isActive(o){return!1}},Nd={label:"Insert/Edit Image",icon:Zg,action(o){o.editor.getEditorState().read(()=>{let t=ae(o.editor),e=V(t,je);if(e){Nm(e,o);return}ps(n=>{o.editor.update(()=>{let r=lm(n);ve([r]),r.select()})})})},isActive(o){return de(o,je)}},nh={label:"Insert horizontal line",icon:Vg,action(o){o.editor.update(()=>{Vo(Da(),!1)})},isActive(o){return de(o,qf)}},xd={label:"Insert code block",icon:Xg,action(o){jr(o.editor)},isActive(o){return de(o,es)}},rh=Object.assign({},xd,{label:"Edit code block",icon:jg}),ih={label:"Insert/edit drawing",icon:Gg,action(o){o.editor.getEditorState().read(()=>{let t=ae(o.editor),e=V(t,lo);e===null?o.editor.update(()=>{let n=Xn();Vo(n,!0),Qr(o,n),n.selectStart()}):Qr(o,e)})},isActive(o){return de(o,lo)}},sh={label:"Drawing manager",action(o){Rm(o)},isActive(){return!1}},Ed={label:"Insert/edit media",icon:th,action(o){o.editor.getEditorState().read(()=>{let t=C(),e=V(t,_t);Tm(e,o)})},isActive(o){return de(o,_t)}},lh={label:"Insert collapsible block",icon:Jg,action(o){o.editor.update(()=>{let t=C(),e=la(),r=(t?.getNodes()||[]).map(s=>s.getTopLevelElement()).filter(s=>s!==null),i=[...new Set(r)];e.setOpen(!0),i.length>0?i[0].insertAfter(e):H().append(e);for(let s of i)e.append(s)})},isActive(o){return de(o,ce)}},ah={label:"Edit label",icon:eh,action(o){o.editor.getEditorState().read(()=>{let t=V(C(),ce);ce(t)&&bm(t,o)})},isActive(o){return!1}},dh={label:"Toggle open/closed",icon:Qg,action(o){o.editor.update(()=>{let t=V(C(),ce);ce(t)&&(t.setOpen(!t.getOpen()),o.manager.triggerLayoutUpdate())})},isActive(o){return!1}},ch={label:"Unwrap",icon:Ms,action(o){o.editor.update(()=>{let t=V(C(),ce);ce(t)&&(_s(t),o.manager.triggerLayoutUpdate())})},isActive(o){return!1}};var uh=` `;var Rs=class extends oe{constructor(e,n){super([e]);p(this,"button");p(this,"dropdownButton");this.button=e,this.dropdownButton=new Ce({button:{label:"Menu",icon:uh},showOnHover:!1,direction:"vertical",showAside:!1},n),this.addChildren(this.dropdownButton)}buildDOM(){return y("div",{class:"editor-button-with-menu-container"},[this.button.getDOMElement(),this.dropdownButton.getDOMElement()])}};var pn=class extends Ae{buildDOM(){return y("div",{class:"editor-separator"})}};function fh(o){let t=o.manager.getDefaultDirection()==="rtl";return new Yr("editor-toolbar-main",[new dt(2,[new w(Up),new w(zp)]),new ys([new Ge(y("h2"),Gp),new Ge(y("h3"),Jp),new Ge(y("h4"),Qp),new Ge(y("h5"),eg),new Ge(y("blockquote"),tg),new Ge(y("p"),og),new Ce({button:{label:"Callouts",format:"long"},showOnHover:!0,direction:"vertical"},[new Ge(y("p",{class:"callout info"}),Zp),new Ge(y("p",{class:"callout success"}),jp),new Ge(y("p",{class:"callout warning"}),Xp),new Ge(y("p",{class:"callout danger"}),Vp)])]),new dt(6,[new w(fd),new w(md),new w(mg),new Ce({button:new ei(pg,"color")},[new un(Ng)]),new Ce({button:new ei(gg,"background-color")},[new un(xg)]),new w(Eg),new w(Tg),new w(Cg),new w(bg),new w(_g)]),new dt(6,[new w(Og),new w(Ag),new w(Rg),new w(kg),t?new w(Ig):null,t?new w($g):null].filter(e=>e!==null)),new dt(3,[new w(gd),new w(hd),new w(Ug),new w(Wg),new w(zg)]),new dt(4,[new w(As),new Ce({button:Cp,direction:"vertical",showAside:!1},[new Ce({button:{label:"Insert",format:"long"},showOnHover:!0,showAside:!0},[new Ls]),new pn,new Ce({button:{label:"Cell",format:"long"},direction:"vertical",showOnHover:!0},[new w(kp),new w(Ip),new w($p)]),new Ce({button:{label:"Row",format:"long"},direction:"vertical",showOnHover:!0},[new w({...sd,format:"long"}),new w({...ld,format:"long"}),new w({...ad,format:"long"}),new w(Sp),new pn,new w(Lp),new w(Mp),new w(wp),new w(vp)]),new Ce({button:{label:"Column",format:"long"},direction:"vertical",showOnHover:!0},[new w({...dd,format:"long"}),new w({...cd,format:"long"}),new w({...ud,format:"long"}),new pn,new w(Dp),new w(Op),new w(Ap),new w(Rp)]),new pn,new w({...rd,format:"long"}),new w(bp),new w(_p),new w(yp)]),new w(Nd),new w(nh),new w(xd),new Rs(new w(ih),[new w(sh)]),new w(Ed),new w(lh)]),new dt(3,[new w(Wp),new w(Yp),new w(qp)])])}function mh(o){return new Yr("editor-toolbar-main",[new w(fd),new w(md),new w(As),new w(gd),new w(hd)])}var ks={image:{selector:"img:not([drawio-diagram] img)",content:()=>[new w(Nd)]},media:{selector:".editor-media-wrap",content:()=>[new w(Ed)]},link:{selector:"a",content(){return[new w(As),new w(oh)]},displayTargetLocator(o){return o.querySelector("img")||o}},code:{selector:".editor-code-block-wrap",content:()=>[new w(rh)]},table:{selector:"td,th",content(){return[new dt(2,[new w(rd),new w(id)]),new dt(3,[new w(sd),new w(ld),new w(ad)]),new dt(3,[new w(dd),new w(cd),new w(ud)])]},displayTargetLocator(o){return o.closest("table")}},details:{selector:"details",content(){return[new w(ah),new w(dh),new w(ch)]}}};var Is=class extends Ae{constructor(e){super();p(this,"url","");this.url=e}buildDOM(){let e=y("div",{class:"editor-external-content"});return window.$http.get(this.url).then(n=>{typeof n.data=="string"&&(e.innerHTML=n.data)}),e}};var ph={submitText:"Save",async action(o,t){return cn(t.editor,o.get("source")?.toString()||""),!0},fields:[{label:"Source",name:"source",type:"textarea"}]},gh={submitText:"Close",async action(){return!0},fields:[{build(){return new Is("/help/wysiwyg")}}]};var $s={link:{title:"Insert/Edit Link",form:Em},image:{title:"Insert/Edit Image",form:xm},media:{title:"Insert/Edit Media",form:Cm},source:{title:"Source code",form:ph},cell_properties:{title:"Cell Properties",form:Qm},row_properties:{title:"Row Properties",form:tp},table_properties:{title:"Table Properties",form:np},details:{title:"Edit collapsible block",form:_m},about:{title:"About the WYSIWYG Editor",form:gh}};var nr=class{constructor(t){p(this,"node",null);p(this,"context");p(this,"onDestroyCallbacks",[]);this.context=t}getNode(){if(!this.node)throw new Error("Attempted to get use node without it being set");return this.node}setNode(t){this.node=t}onDestroy(t){this.onDestroyCallbacks.push(t)}teardown(){for(let t of this.onDestroyCallbacks)t()}};var Ps=class extends nr{constructor(){super(...arguments);p(this,"completedSetup",!1);p(this,"latestCode","");p(this,"latestLanguage","");p(this,"editor",null)}setup(e,n){let r=this.getNode(),i=n.querySelector("pre");if(!i)return;i&&(i.hidden=!0),this.latestCode=r.__code,this.latestLanguage=r.__language;let l=this.latestCode.split(` `).length*19.2+18+24;n.style.height=`${l}px`;let a=Date.now();n.addEventListener("click",m=>{requestAnimationFrame(()=>{e.editor.update(()=>{rt(this.getNode())})})}),n.addEventListener("dblclick",m=>{e.editor.getEditorState().read(()=>{qr(e.editor,this.getNode())})});let d=m=>{n.classList.toggle("selected",ki(m,r))};e.manager.onSelectionChange(d),this.onDestroy(()=>{e.manager.offSelectionChange(d)});let u=m=>{this.editor=m.wysiwygView(n,document,this.latestCode,this.latestLanguage),setTimeout(()=>{n.style.height=""},12)};window.importVersioned("code").then(m=>{let c=Date.now()-a<20?20:0;setTimeout(()=>u(m),c)}),this.completedSetup=!0}update(){let e=this.getNode(),n=e.getCode(),r=e.getLanguage();this.latestCode===n&&this.latestLanguage===r||(this.latestLanguage=r,this.latestCode=n,this.editor&&(this.editor.setContent(n),this.editor.setMode(r,n)))}render(e,n){this.completedSetup?this.update():this.setup(e,n)}};var Bs=class extends nr{constructor(){super(...arguments);p(this,"completedSetup",!1)}setup(e,n){let r=this.getNode();n.classList.add("editor-diagram"),e.editor.registerCommand(Ht,s=>n.contains(s.target)?(e.editor.update(()=>{rt(this.getNode())}),!0):!1,Kn),n.addEventListener("dblclick",s=>{e.editor.getEditorState().read(()=>{Qr(e,this.getNode())})});let i=s=>{n.classList.toggle("selected",ki(s,r))};e.manager.onSelectionChange(i),this.onDestroy(()=>{e.manager.offSelectionChange(i)}),this.completedSetup=!0}update(){}render(e,n){this.completedSetup?this.update():this.setup(e,n)}};function MT(o){return F(o)||je(o)||_t(o)||lo(o)||K(o)||ce(o)}function wT(o){if(o.target instanceof HTMLElement){let t=o.target.closest("details");if(t){let e=G(t);if(ce(e))return e}}return H()}function vT(o,t){let e=wT(t),n=e.getLastChild();if(!n||!MT(n))return!1;let r=o.editor.getElementByKey(n.getKey());if(!r)return!1;let i=r.getBoundingClientRect();return t.clientY>i.bottom?(o.editor.update(()=>{let l=I();e.append(l),l.select()}),!0):!1}function hh(o){let t=o.editor.registerCommand(Ht,e=>(vT(o,e),!1),De);return()=>{t()}}var Td=new Set;function DT(o){for(let n of Td)n.classList.remove("selected"),Td.delete(n);let e=C()?.getNodes()||[];if(e.length===1&&ce(e[0])){let n=o.editor.getElementByKey(e[0].getKey());n&&(n.classList.add("selected"),Td.add(n))}return!1}function Nh(o){let t=o.editor.registerCommand(be,()=>(DT(o),!1),De);return()=>{t()}}var xh={text:{bold:"editor-theme-bold",code:"editor-theme-code",italic:"editor-theme-italic",strikethrough:"editor-theme-strikethrough",subscript:"editor-theme-subscript",superscript:"editor-theme-superscript",underline:"editor-theme-underline",underlineStrikethrough:"editor-theme-underline-strikethrough"}};function hF(o,t,e={}){let n=Bi({namespace:"BookStackPageEditor",nodes:Gf(),onError:console.error,theme:xh}),r=Ra(o,n,{...e,editorClass:"page-content"});n.setRootElement(r.editorDOM),Dt(ra(n),ta(n,oa(),300),Pa(r),Pm(r),hh(r),Nh(r),im(n,r.scrollDOM),mm(n),fm(n,r.editorDOM),um(r),Mm(r),ja(n)),r.manager.setToolbar(fh(r));for(let s of Object.keys(ks))r.manager.registerContextToolbar(s,ks[s]);for(let s of Object.keys($s))r.manager.registerModal(s,$s[s]);r.manager.registerDecoratorType("code",Ps),r.manager.registerDecoratorType("diagram",Bs),sm(n),cn(n,t);let i=document.getElementById("lexical-debug");return i&&(i.hidden=!0,n.registerUpdateListener(({dirtyElements:s,dirtyLeaves:l,editorState:a,prevEditorState:d})=>{i.textContent=JSON.stringify(a.toJSON(),null,2)})),window.debugEditorState=()=>n.getEditorState().toJSON(),Qf(r),new Fs(r)}function NF(o,t,e={}){let n=Bi({namespace:"BookStackBasicEditor",nodes:Jf(),onError:console.error,theme:xh}),r=Ra(o,n,e);n.setRootElement(r.editorDOM);let i=Dt(ra(n),ta(n,oa(),300),Pa(r),ja(n));return r.manager.setToolbar(mh(r)),r.manager.registerContextToolbar("link",ks.link),r.manager.registerModal("link",$s.link),r.manager.onTeardown(i),cn(n,t),new Fs(r)}var Fs=class{constructor(t){p(this,"context");p(this,"onChangeListeners",[]);p(this,"editorListenerTeardown",null);this.context=t}async getContentAsHtml(){return await cs(this.context.editor)}onChange(t){this.onChangeListeners.push(t),this.startListeningToChanges()}focus(){us(this.context.editor)}remove(){this.context.manager.teardown(),this.context.containerDOM.remove(),this.editorListenerTeardown&&this.editorListenerTeardown()}startListeningToChanges(){this.editorListenerTeardown||(this.editorListenerTeardown=this.context.editor.registerUpdateListener(()=>{for(let t of this.onChangeListeners)t()}))}};export{Fs as SimpleWysiwygEditorInterface,NF as createBasicEditorInstance,hF as createPageEditorInstance}; //# sourceMappingURL=wysiwyg.js.map diff --git a/version b/version index 43e834995..2c3e3f1e5 100644 --- a/version +++ b/version @@ -1 +1 @@ -v25.07.3 +v25.11