From d1bde2fc783d2ede37204712fef71c1d219cb25a Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Thu, 30 Apr 2026 11:38:43 +0100 Subject: [PATCH] Updated version and assets for release v26.03.4 --- dev/checksums/vendor | 2 +- public/dist/app.js | 14 +++++++------- public/dist/code.js | 42 ++++++++++++++++++++--------------------- public/dist/markdown.js | 20 ++++++++++---------- public/dist/wysiwyg.js | 6 +++--- version | 2 +- 6 files changed, 43 insertions(+), 43 deletions(-) diff --git a/dev/checksums/vendor b/dev/checksums/vendor index f5eb63524..a248ac905 100644 --- a/dev/checksums/vendor +++ b/dev/checksums/vendor @@ -1 +1 @@ -81469eb1251aaba324ba3c82d67474e2d9197d29b2b0566429e83d4bfe6291f0 \ No newline at end of file +f694c5952272a88d753a9eda40141e227ba7c9a60faf6d0de6952439a3ad8450 \ No newline at end of file diff --git a/public/dist/app.js b/public/dist/app.js index b25d712b7..676b015b5 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 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.createCommentEditorInstance(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.createCommentEditorInstance(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(` +`);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:()=>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 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 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 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 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 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,ci,di,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,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={},$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(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=>`
  • ${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 Ci(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=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?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=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=Hs(n,zs);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: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,Oe,A,bt,Ft,Y,le,wt,Ae,N,Nt=!1,Ve=!1,We=[],St,tt,fi,gi,go,vo,ie,Rt,ce,de=!1,Ie=!1,Ne,_,vi=[],xi=!1,Ue=[],ze=typeof document<"u",He=$i,wo=he||dt?"cssFloat":"float",Ks=ze&&!Eo&&!$i&&"draggable"in document.createElement("div"),$o=(function(){if(ze){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"},Xs=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},Gs=function(t,e){var n;return We.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||Li(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","")};ze&&!Eo&&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=Gs(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)}}},Ys=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:Ks,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,Ws())}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(or(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)&&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: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,Oe=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(),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)),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&&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",Ys);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]-vi[0]:0)/(a||1),p=(s.clientY-St.clientY+o.y)/(l||1)+(d?d[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=Ae=w.dragged=w.ghost=w.clone=w.active=null;var t=this.el;Ue.forEach(function(e){t.contains(e)&&(e.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),Js(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 er(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&&Neu+d*s/2:lp-Ne)return-ce}else if(l>u+d*(1-o)/2&&lp-d*s/2)?l>u+d/2?1:-1:0}function nr(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,rr(!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){pi(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:Ps(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 rr(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 sr);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)}}},Ke=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),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 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 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);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 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=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 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=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 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);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 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);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 hn=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 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);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 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);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.createCommentEditorInstance(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,Tn=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 Sn=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.createCommentEditorInstance(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 cr(i,t){ri(`#page-navigation a[href="#${i}"]`,e=>{e.closest("li").classList.toggle("current-heading",t)})}function dr(i){for(let t of i){let e=t.intersectionRatio===1;cr(t.target.id,e)}}function hr(i){let t={rootMargin:"0px 0px 0px 0px",threshold:1},e=new IntersectionObserver(dr,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=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&&hr(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 $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);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=ai(this.targetSelectionRange.startContainer,this.targetSelectionRange.startOffset,this.targetElement),d=ai(this.targetSelectionRange.endContainer,this.targetSelectionRange.endOffset,this.targetElement);o=`${l}-${d}`}}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){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 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 ur(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=ur(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 pr=["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(pr.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);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=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);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 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 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 mr(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&&mr(i,e)}var Dt,Zn;function fr(i){return i&&!!(i.textContent||i.innerText)}async function gr(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(`

    `),gr(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 vr(i){let t=i.selection.getNode();t.nodeName==="IMG"&&(Dt=i.dom.getParent(t,".mceTemp"),!Dt&&t.parentNode.nodeName==="A"&&!fr(t.parentNode)&&(Dt=t.parentNode)),t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="false"&&(Zn=t)}function wr(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()||zo(i,t,e),Dt=null}function br(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=>br(i,e)),i.on("dragstart",()=>vr(i)),i.on("drop",e=>wr(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 yr(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 Er(i){i.ui.registry.addContextToolbar("linkcontexttoolbar",{predicate(t){return t.closest("a")!==null},position:"node",scope:"node",items:"link unlink openlink"})}function Cr(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 Lr(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){yr(i),Er(i),Cr(i),Lr(i)}var xr={"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(xr))i.ui.registry.addIcon(t,e)}function Tr(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 Sr(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){Tr(i),Sr(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 kr(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}`,{cause: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}`,{cause: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}),i.selection.select(e))}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=>{let e=t?.target?.ownerDocument?.defaultView?.HTMLDetailsElement;e&&t.target instanceof e&&ii(i)&&(us(i),t.preventDefault(),t.stopPropagation())}),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(` +`).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 $r(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",()=>{kr(i)})}function es(){return $r}function Qn(i){return new Promise((t,e)=>{i.oncomplete=i.onsuccess=()=>t(i.result),i.onabort=i.onerror=()=>e(i.error)})}function Mr(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 Bi;function Pi(){return Bi||(Bi=Mr("keyval-store","keyval")),Bi}function Ri(i,t=Pi()){return t("readonly",e=>Qn(e.get(i)))}function Oi(i,t,e=Pi()){return e("readwrite",n=>(n.put(t,i),Qn(n.transaction)))}function Ni(i,t=Pi()){return t("readwrite",e=>(e.delete(i),Qn(e.transaction)))}var it=null,qi,ti,Fi,_i="last-drawing-save";function Vi(i){it?.contentWindow?.postMessage(JSON.stringify(i),qi)}function Ar(i){Oi(_i,i.data),Fi&&Fi(i.data).then(()=>{Ni(_i)})}function Ir(i){Vi({action:"export",format:"xmlpng",xml:i.xml,spin:"Updating drawing"})}function Hr(){ti&&ti().then(i=>{Vi({action:"load",autosave:1,xml:i})})}function Br(){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"?Hr():t.event==="exit"?ns():t.event==="save"?Ir(t):t.event==="export"?Ar(t):t.event==="configure"&&Br()}async function Pr(){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()&&(ti=async()=>i)}async function os(i,t,e){ti=t,Fi=e,await Pr(),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 ei(){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),ei(),t}}var K=null,It=null,At={};function Ui(i){return i.hasAttribute("drawio-diagram")}function Or(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 Nr(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 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}`,{cause: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(`
    `),ei();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}`,{cause:s})}}function Fr(){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,Fr,Nr)}function _r(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();Or(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,_r}function qr(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 qr}function Vr(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 Vr}function Wr(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 Wr}var hs=["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 Ur(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}),i.selection.select(e))}function jr(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();Ur(i,e),t.close()}}}function zr(i){let t=i.querySelector("summary");return t?t.textContent:""}function us(i){let t=ni(i);i.windowManager.open(jr(i)).setData({summary:zr(t)})}function Kr(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 Xr(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 Gr(i){i.parser.addNodeFilter("details",t=>{for(let e of t)Xr(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 Yr(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(){Kr(i)}}),i.ui.registry.addButton("editdetials",{icon:"togglelabel",tooltip:"Edit label",onAction(){us(i)}}),i.on("dblclick",t=>{let e=t?.target?.ownerDocument?.defaultView?.HTMLDetailsElement;e&&t.target instanceof e&&ni(i)&&(us(i),t.preventDefault(),t.stopPropagation())}),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",()=>{Gr(i)})}function ps(){return Yr}function Jr(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 Jr}function Zr(i){let t=i.closest("li");return t&&t.parentNode.nodeName==="UL"&&t.classList.contains("task-list-item")}function Qr(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 ta(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 ea(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 na(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(){Zr(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"&&ta(o)}),i.serializer.addNodeFilter("li",n=>{for(let o of n)o.attributes.map.class==="task-list-item"&&ea(o)})}),i.on("click",n=>{let o=n.target;o.nodeName==="LI"&&o.classList.contains("task-list-item")&&(Qr(n,o,i),n.preventDefault())})}function fs(){return na}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 ia=[{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"}]}],oa={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"}}},sa=["#BFEDD2","","#FBEEB8","","#F8CAC6","","#ECCAFA","","#C2E0F4","","#2DC26B","","#F1C40F","","#E03E2D","","#B96AD9","","#3598DB","","#169179","","#E67E23","","#BA372A","","#843FA1","","#236FA1","","#ECF0F1","","#CED4D9","","#95A5A6","","#7E8C8D","","#34495E","","#000000","","#ffffff",""];function ra(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 aa(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 la(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 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` +`),s=i.createElement("div");s.innerHTML=o,i.head.append(...s.children)}function ca(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 da(i){return` html, body, html.dark-mode { background: ${i.darkMode?"#222":"#fff"}; } @@ -19,12 +19,12 @@ body { margin-right: auto !important; overflow-y: hidden !important; }`.trim().replace(` -`,"")}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(); +`,"")}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:aa(i),contextmenu:!1,toolbar:Xo(i),content_style:da(i),style_formats:ia,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:oa,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:sa,file_picker_callback:ra,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);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 ha(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 ua(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 si=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=ha(t,e);o.$refs=r.refs,o.$manyRefs=r.manyRefs,o.$opts=ua(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 si;window.$components.register(Ki);window.$components.init(); /*! Bundled license information: sortablejs/modular/sortable.esm.js: (**! - * Sortable 1.15.6 + * Sortable 1.15.7 * @author RubaXa * @author owenm * @license MIT diff --git a/public/dist/code.js b/public/dist/code.js index 479af3df1..1d1392cd1 100644 --- a/public/dist/code.js +++ b/public/dist/code.js @@ -1,32 +1,32 @@ // See the "/licenses" URI for full package license details -var hs=[],_O=[];(()=>{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,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=_O[n])e=n+1;else return!0;if(e==t)return!1}}function ZO(i){return i>=127462&&i<=127487}var VO=8205;function zO(i,e,t=!0,n=!0){return(t?CO:Hd)(i,e,n)}function CO(i,e,t){if(e==i.length)return e;e&&qO(i.charCodeAt(e))&&AO(i.charCodeAt(e-1))&&e--;let n=ls(i,e);for(e+=YO(n);e=0&&ZO(ls(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function Hd(i,e,t){for(;e>0;){let n=CO(i,e-2,t);if(n=56320&&i<57344}function AO(i){return i>=55296&&i<56320}function YO(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]=gi(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),pi.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]=gi(this,e,t);let n=[];return this.decompose(e,t,n,0),pi.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 Gn(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 Ln(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):pi.from(Ze.split(e,[]))}},Ze=class i extends q{constructor(e,t=Kd(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 fs(r,a,n,o);r=a+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new i(WO(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),a=En(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]=gi(this,e,t);let r=En(this.text,En(n.text,WO(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new i(r,s):pi.from(i.split(r,[]),s)}sliceString(e,t=this.length,n=` -`){[e,t]=gi(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}},pi=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]=gi(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]=gi(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 Kd(i){let e=-1;for(let t of i)e+=t.length+1;return e}function En(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)}},Gn=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!=""}},Ln=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]=Gn.prototype[Symbol.iterator]=Ln.prototype[Symbol.iterator]=function(){return this});var fs=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 gi(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 zO(i,e,t,n)}function Jd(i){return i>=56320&&i<57344}function e$(i){return i>=55296&&i<56320}function xs(i,e){let t=i.charCodeAt(e);if(!e$(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return Jd(n)?(t-55296<<10)+(n-56320)+65536:t}function ks(i){return i<65536?1:2}var us=/\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 ds(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return $s(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||us)):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 $s(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)}},$i=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=>$i.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 jO(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var ws=0,Z=class i{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=ws++,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:Xs),!!e.static,e.enables)}of(e){return new mi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new mi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new mi(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}};function Xs(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}var mi=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=ws++}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)||ps(c,h)){let d=n(c);if(a?!UO(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=Bn(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?UO(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 UO(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(Wn).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(Wn),o=r.facet(Wn),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,Wn.of({field:this,create:e})]}get extension(){return this}},Bt={lowest:4,low:3,default:2,high:1,highest:0};function Ui(i){return e=>new jn(e,i)}var rt={highest:Ui(Bt.highest),high:Ui(Bt.high),default:Ui(Bt.default),low:Ui(Bt.low),lowest:Ui(Bt.lowest)},jn=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}},Dn=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 i$(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,Xs(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=>t$(m,$,d))}}let c=l.map(f=>f(a));return new i(e,o,c,a,O,s)}};function i$(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 jn)s(o.inner,o.prec);else if(o instanceof ge)n[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof mi)n[a].push(o),o.facet.extensions&&s(o.facet.extensions,Bt.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,Bt.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 Bn(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var DO=Z.define(),ms=Z.define({combine:i=>i.some(e=>e),static:!0}),BO=Z.define({combine:i=>i.length?i[0]:void 0,static:!0}),IO=Z.define(),NO=Z.define(),FO=Z.define(),HO=Z.define({combine:i=>i.length?i[0]:!1}),xe=class{constructor(e,t){this.type=e,this.value=t}static define(){return new Qs}},Qs=class{of(e){return new xe(this,e)}},gs=class{constructor(e){this.map=e}of(e){return new D(this,e)}},D=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 gs(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}};D.reconfigure=D.define();D.appendConfig=D.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&&jO(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=xe.define();ne.userEvent=xe.define();ne.addToHistory=xe.define();ne.remote=xe.define();function n$(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=JO(e,Qi(s),!1)}return i}function s$(i){let e=i.startState,t=e.facet(FO),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=KO(n,Ss(e,s,i.changes.newLength),!0))}return n==i?i:ne.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}var o$=[];function Qi(i){return i==null?o$: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={})),a$=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ps;try{Ps=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function O$(i){if(Ps)return Ps.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||a$.test(t)))return!0}return!1}function l$(i){return e=>{if(!/\S/.test(e))return We.Space;if(O$(e))return We.Word;for(let t=0;t-1)return We.Word;return We.Other}}var B=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(D.reconfigure)?(t=null,n=a.value):a.is(D.appendConfig)&&(t=null,n=Qi(n).concat(a.value));let s;t?s=e.startState.values.slice():(t=Dn.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(ms)?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=Qi(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=Dn.resolve(e.extensions||[],new Map),n=e.doc instanceof q?e.doc:q.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||us)),r=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return jO(r,n.length),t.staticFacet(ms)||(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(HO)}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(DO))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return l$(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});B.lineSeparator=BO;B.readOnly=HO;B.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])}});B.languageData=DO;B.changeFilter=IO;B.transactionFilter=NO;B.transactionExtender=FO;mt.reconfigure=D.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 ys(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var bs=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}}},K=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(ys)),this.isEmpty)return t.length?i.of(t):this;let a=new In(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=MO(o,a,n),l=new It(o,O,s),h=new It(a,O,s);n.iterGaps((c,f,d)=>EO(l,c,h,f,d,r)),n.empty&&n.length==0&&EO(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=MO(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?h$(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}};K.empty=new K([],[],null,-1);function h$(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(ys);e=n}return i}K.empty.nextLayer=K.empty;var Ht=class i{finishChunk(e){this.chunks.push(new bs(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(K.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function MO(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 In(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--)cs(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--)cs(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(),cs(this.heap,0)}}};function cs(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){Un(this.active,e),Un(this.activeTo,e),Un(this.activeRank,e),this.minActive=GO(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t0;)t++;Mn(this.active,t,n),Mn(this.activeTo,t,r),Mn(this.activeRank,t,s),e&&Mn(e,t,this.cursor.from),this.minActive=GO(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&&Un(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 EO(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 GO(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 el=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),vs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),tl=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=tl[el]||1;return tl[el]=e+1,"\u037C"+e.toString(36)}static mount(e,t,n){let r=e[vs],s=n&&n.nonce;r?s&&r.setNonce(s):r=new Rs(e,s),r.mount(Array.isArray(t)?t:[t],e)}},il=new Map,Rs=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=il.get(n);if(s)return e[vs]=s;this.sheet=new r.CSSStyleSheet,il.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[vs]=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:'"'},c$=typeof navigator<"u"&&/Mac/.test(navigator.platform),f$=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),Si[re]=String.fromCharCode(re);var re;for(Fn in Qt)Si.hasOwnProperty(Fn)||(Si[Fn]=Qt[Fn]);var Fn;function nl(i){var e=c$&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||f$&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Si: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}var Se=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Cs=typeof document<"u"?document:{documentElement:{style:{}}},qs=/Edge\/(\d+)/.exec(Se.userAgent),Ul=/MSIE \d/.test(Se.userAgent),As=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Se.userAgent),br=!!(Ul||As||qs),rl=!br&&/gecko\/(\d+)/i.test(Se.userAgent),Zs=!br&&/Chrome\/(\d+)/.exec(Se.userAgent),sl="webkitFontSmoothing"in Cs.documentElement.style,Ws=!br&&/Apple Computer/.test(Se.vendor),ol=Ws&&(/Mobile\/\w+/.test(Se.userAgent)||Se.maxTouchPoints>2),X={mac:ol||/Mac/.test(Se.platform),windows:/Win/.test(Se.platform),linux:/Linux|X11/.test(Se.platform),ie:br,ie_version:Ul?Cs.documentMode||6:As?+As[1]:qs?+qs[1]:0,gecko:rl,gecko_version:rl?+(/Firefox\/(\d+)/.exec(Se.userAgent)||[0,0])[1]:0,chrome:!!Zs,chrome_version:Zs?+Zs[1]:0,ios:ol,android:/Android\b/.test(Se.userAgent),webkit:sl,webkit_version:sl?+(/\bAppleWebKit\/(\d+)/.exec(Se.userAgent)||[0,0])[1]:0,safari:Ws,safari_version:Ws?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Se.userAgent)||[0,0])[1]:0,tabSize:Cs.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function nn(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function Us(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function sr(i,e){if(!e.anchorNode)return!1;try{return Us(i,e.anchorNode)}catch{return!1}}function rn(i){return i.nodeType==3?ti(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function Ni(i,e,t,n){return t?al(i,e,t,n,-1)||al(i,e,t,n,1):!1}function ei(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function cr(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function al(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:lt(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=ei(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?lt(i):0}else return!1}}function lt(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function Tr(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function u$(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 Ml(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 d$(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=u$(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}=Ml(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 $$(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 Ms=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?lt(t):0),n,Math.min(e.focusOffset,n?lt(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},Kt=null;X.safari&&X.safari_version>=26&&(Kt=!1);function El(i){if(i.setActive)return i.setActive();if(Kt)return i.focus(Kt);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(Kt==null?{get preventScroll(){return Kt={preventScroll:!0},!0}}:void 0),!Kt){Kt=!1;for(let t=0;tMath.max(1,i.scrollHeight-i.clientHeight-4)}function jl(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=lt(t)}else if(t.parentNode&&!cr(t))n=ei(t),t=t.parentNode;else return null}}function Dl(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=So){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 Bl(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:(tQ$||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 Pe(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 g$(this.dom,e,t)}},Zt=class i extends F{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(Gl(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 g$(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?X.chrome||X.gecko||(e?(r--,o=1):s=0)?0:a.length-1];return X.safari&&!o&&O.width==0&&(O=Array.prototype.find.call(a,l=>l.width)||O),o?Tr(O,o<0):O||null}var sn=class i extends F{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)?Pe.before(this.dom):Pe.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?Pe.before(this.dom):Pe.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return q.empty}get isHidden(){return!0}};ht.prototype.children=sn.prototype.children=on.prototype.children=So;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||P$(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 Gs(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 y$(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 K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};U.none=K.empty;var an=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))&&ur(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)}};an.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&&ur(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?ye.WidgetRange:this.startSide<=0?ye.WidgetBefore:ye.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&b$(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 b$(i,e){return i==e||!!(i&&e&&i.compare(e))}function or(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 F{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),Il(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){ur(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=Es(t,this.attrs||{})),n&&(this.attrs=Es({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&&(Gl(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&&(Gs(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&&F.get(r)instanceof Zt;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=F.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!X.ios||!this.children.some(s=>s instanceof ht))){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 ht)||/[^ -~]/.test(n.text))return null;let r=rn(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}},Jt=class i extends F{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}},ln=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 Jt&&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(Hn(new on(-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 Jt)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:a,done:O}=this.cursor.next(this.skip);if(this.skip=0,O)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e),s=Math.min(r,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(Hn(new ht(this.text.slice(this.textOff,this.textOff+s)),t),n),this.atCursorPos=!0,this.textOff+=s,e-=s,n=r<=s?0:t.length}}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 Jt(n.widget||_t.block,a,n));else{let O=sn.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(Hn(new on(1),r),s),s=r.length+Math.max(0,s-r.length)),c.append(Hn(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=K.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function Hn(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={})),ii=te.LTR,Po=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(st[p+1]==-d){let m=st[p+2],Q=m&2?r:m&4?m&1?s:r:0;Q&&(N[c]=N[st[p]]=Q),a=p;break}}else{if(st.length==189)break;st[a++]=c,st[a++]=f,st[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=st[m+2];if(Q&2)break;if(p)st[m+2]|=2;else{if(Q&4)break;st[m+2]|=4}}}}}function v$(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 js(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 at(O,p.from,d));let m=p.direction==ii!=!(d%2);Ds(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?js(i,O,$,n+1,r,f,o):O<$&&o.push(new at(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==ii?0:1;return Ds(i,r,r,t,0,i.length,n),n}function ih(i){return[new at(0,i,0)]}var nh="";function Z$(i,e,t,n,r){var s;let o=n.head-i.from,a=at.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)}},Kn=D.define({map:(i,e)=>i.map(e)}),uh=D.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}),Y$=0,Pi=Z.define({combine(i){return i.filter((e,t)=>{for(let n=0;n{let O=[];return o&&O.push(hn.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(),To=Z.define(),hn=Z.define(),$h=Z.define(),un=Z.define(),ph=Z.define();function cl(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 K.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(),Ot=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}}},dr=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 Ot(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}},$r=class extends F{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 Ot(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:!U$(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?z$(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:l,to:h}=this.hasComposition;n=new Ot(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,(X.ie||X.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),O=A$(o,a,e.changes);return n=Ot.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=X.chrome||X.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 k=Fi.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),y=Fi.build(this.view.state.doc,n.range.toB,c,this.decorations,this.dynamicDecorationMap);d=k.breakAtStart,$=k.openStart,p=y.openEnd;let x=this.compositionView(n);y.breakAtStart?x.breakAfter=1:y.content.length&&x.merge(x.length,x.length,y.content[0],!1,y.openStart,0)&&(x.breakAfter=y.content[0].breakAfter,y.content.shift()),k.content.length&&x.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),f=k.content.concat(x).concat(y.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:P}=s.findPos(O,-1);Bl(this,g,P,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 ht(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=F.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)&&sr(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(X.gecko&&a.empty&&!this.hasComposition&&_$(O)){let c=document.createTextNode("");this.view.observer.ignore(()=>O.node.insertBefore(c,O.node.childNodes[O.offset]||null)),O=l=new Pe(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(()=>{X.android&&X.chrome&&this.dom.contains(h.focusNode)&&W$(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let c=nn(this.view.root);if(c)if(a.empty){if(X.gecko){let f=C$(O.node,O.offset);if(f&&f!=3){let d=(f==1?jl:Dl)(O.node,O.offset);d&&(O=new Pe(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 Pe(h.anchorNode,h.anchorOffset),this.impreciseHead=l.precise?null:new Pe(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=nn(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=F.get(t.childNodes[r]);s instanceof he&&(n=s.domAtPos(s.length))}return n?new Pe(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=F.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 Jt&&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 ht))return null;let s=le(r.text,n);if(s==n)return null;let o=ti(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=$?rn($):[];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=rn(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 fr(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 ln(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(hn).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(K.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;d$(this.view.scrollDOM,o,t.headr instanceof sn||r.children.some(n);return n(this.children[t])}};function _$(i){return i.node.nodeType==1&&i.node.firstChild&&(i.offset==0||i.node.childNodes[i.offset-1].contentEditable=="false")&&(i.offset==i.node.childNodes.length||i.node.childNodes[i.offset].contentEditable=="false")}function gh(i,e){let t=i.observer.selectionRange;if(!t.focusNode)return null;let n=jl(t.focusNode,t.focusOffset),r=Dl(t.focusNode,t.focusOffset),s=n||r;if(r&&n&&r.node!=n.node){let a=F.get(r.node);if(!a||a instanceof ht&&a.text!=r.node.nodeValue)s=r;else if(i.docView.lastCompositionAfterCursor){let O=F.get(n.node);!O||O instanceof ht&&O.text!=n.node.nodeValue||(s=r)}}if(i.docView.lastCompositionAfterCursor=s!=n,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function z$(i,e,t){let n=gh(i,t);if(!n)return null;let{node:r,from:s,to:o}=n,a=r.nodeValue;if(/[\n\r]/.test(a)||i.state.doc.sliceString(n.from,n.to)!=a)return null;let O=e.invertedDesc,l=new Ot(O.mapPos(s),O.mapPos(o),s,o),h=[];for(let c=r.parentNode;;c=c.parentNode){let f=F.get(c);if(f instanceof Zt)h.push({node:c,deco:f.mark});else{if(f instanceof he||c.nodeName=="DIV"&&c.parentNode==i.contentDOM)return{range:l,text:r,marks:h,line:c};if(c!=i.contentDOM)h.push({node:c,deco:new an({inclusive:!0,attributes:y$(c),tagName:c.tagName.toLowerCase()})});else return null}}}function C$(i,e){return i.nodeType!=1?0:(e&&i.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(t=!0)}),t}function M$(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 G$(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function Vs(i,e){return i.tope.top+1}function fl(i,e){return ei.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function Is(i,e,t){let n,r,s,o,a=!1,O,l,h,c;for(let $=i.firstChild;$;$=$.nextSibling){let p=rn($);for(let m=0;mP||o==P&&s>g)&&(n=$,r=Q,s=g,o=P,a=g?e0:mQ.bottom&&(!h||h.bottomQ.top)&&(l=$,c=Q):h&&Vs(h,Q)?h=ul(h,Q.bottom):c&&Vs(c,Q)&&(c=fl(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 dl(n,f,t);if(a&&n.contentEditable!="false")return Is(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 dl(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(X.chrome||X.gecko){let $=ti(i,a).getBoundingClientRect();Math.abs($.left-h.right)<.1&&(d=!f)}if(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 k=i.viewState.heightOracle.textHeight/2,y=!1;O=i.elementAtHeight(f),O.type!=ye.Text;)for(;f=n>0?O.bottom+k:O.top-k,!(f>=0&&f<=l);){if(y)return t?null:0;y=!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:$l(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 k=$.caretPositionFromPoint(h,c);k&&({offsetNode:Q,offset:g}=k)}else if($.caretRangeFromPoint){let k=$.caretRangeFromPoint(h,c);k&&({startContainer:Q,startOffset:g}=k)}Q&&(!i.contentDOM.contains(Q)||X.safari&&L$(Q,g,h)||X.chrome&&j$(Q,g,h))&&(Q=void 0),Q&&(g=Math.min(lt(Q),g))}if(!Q||!i.docView.dom.contains(Q)){let k=he.find(i.docView,d);if(!k)return f>O.top+O.height/2?O.to:O.from;({node:Q,offset:g}=Is(k.dom,h,c))}let P=i.docView.nearest(Q);if(!P)return null;if(P.isWidget&&((s=P.dom)===null||s===void 0?void 0:s.nodeType)==1){let k=P.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+Nn(o,s,i.state.tabSize)}function Ph(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 ti(i,n-1,n).getBoundingClientRect().right>t}function L$(i,e,t){return Ph(i,e,t)}function j$(i,e,t){if(e!=0)return Ph(i,e,t);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():ti(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Ns(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==ye.Text&&(r.type!=s.type||(t<0?s.frome)))&&(r=s)}}return r||n}return n}function D$(i,e,t,n){let r=Ns(i,e.head,e.assoc||-1),s=!n||r.type!=ye.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 pl(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=Z$(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 B$(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 I$(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)&&!F$(o,t)&&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=F.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+(N$(e,n.node,n.offset)?t:0))}};function N$(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?[]:K$(e),O=new Fs(a,e.state);O.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=O.text,this.newSel=J$(a,this.bounds.from)}else{let a=e.observer.selectionRange,O=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Us(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||!Us(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),h=e.viewport;if((X.ios||X.chrome)&&e.state.selection.main.empty&&O!=l&&(h.from>0||h.to-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(S.range(l,O)):this.newSel=S.single(l,O)}}};function bh(i,e){let t,{newSel:n}=e,r=i.state.selection.main,s=i.inputState.lastKeyTime>Date.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,O=r.from,l=null;(s===8||X.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))}:i.state.doc.lineAt(r.from).toDate.now()-50?t={from:r.from,to:r.to,insert:i.state.toText(i.inputState.insertingText)}:X.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 xo(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,a=="select.pointer"&&(n=yh(i.state.facet(un).map(O=>O(i)),n))),i.dispatch({selection:n,scrollIntoView:o,userEvent:a}),!0}else return!1}function xo(i,e,t,n=-1){if(X.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(X.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=H$(i,e,t));return i.state.facet(Oh).some(O=>O(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function H$(i,e,t){let n,r=i.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let O=e.fromc(i)),l,O);e.from==h&&(o=h)}if(o>-1)n={changes:e,selection:S.cursor(e.from+e.insert.length,-1)};else 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 O=s.frome.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(O+e.insert.sliceString(0,void 0,i.state.lineBreak)+l))}else{let O=r.changes(e),l=t&&t.main.to<=O.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let h=i.state.sliceDoc(e.from,e.to),c,f=t&&gh(i,t.main.head);if(f){let $=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-$}}else c=i.state.doc.lineAt(s.head);let d=s.to-e.to;n=r.changeByRange($=>{if($.from==s.from&&$.to==s.to)return{changes:O,range:l||$.map(O)};let p=$.to-d,m=p-h.length;if(i.state.sliceDoc(m,p)!=h||p>=c.from&&m<=c.to)return{range:$};let Q=r.changes({from:m,to:p,insert:e.insert}),g=$.to-s.to;return{changes:Q,range:l?S.range(Math.max(0,l.anchor+g),Math.max(0,l.head+g)):$.map(Q)}})}else n={changes:O,selection:l&&r.selection.replaceRange(l)}}let a="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,a+=".compose",i.inputState.compositionFirstChange&&(a+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:a,scrollIntoView:!0})}function Th(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 K$(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 pr(t,n)),(r!=t||s!=n)&&e.push(new pr(r,s))),e}function J$(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 Ks=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.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,X.safari&&e.contentDOM.addEventListener("input",()=>null),X.gecko&&dp(e.contentDOM.ownerDocument)}handleEvent(e){!op(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=ep(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&&kh.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),X.android&&X.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return X.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=xh.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||tp.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:X.safari&&!X.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!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 ml(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){Ee(t.state,r)}}}function ep(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(ml(n.value,O))}if(o)for(let a in o){let O=o[a];O&&t(a).observers.push(ml(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 xh=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],tp="dthko",kh=[16,17,18,20,91,92,224,225],Jn=6;function er(i){return Math.max(0,i)*.7+8}function ip(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var Js=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=$$(e.contentDOM),this.atoms=e.state.facet(un).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(B.allowMultipleSelections)&&np(e,t),this.dragging=sp(e,t)&&vh(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&&ip(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+Jn?t=-er(r-e.clientX):e.clientX+O.right>=o-Jn&&(t=er(e.clientX-o)),e.clientY-O.top<=s+Jn?n=-er(s-e.clientY):e.clientY+O.bottom>=a-Jn&&(n=er(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)}select(e){let{view:t}=this,n=yh(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function np(i,e){let t=i.state.facet(rh);return t.length?t[0](e):X.mac?e.metaKey:e.ctrlKey}function rp(i,e){let t=i.state.facet(sh);return t.length?t[0](e):X.mac?!e.altKey:!e.ctrlKey}function sp(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=nn(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 op(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=F.get(t))&&n.ignoreEvent(e))return!1;return!0}var Ne=Object.create(null),Le=Object.create(null),wh=X.ie&&X.ie_version<15||X.ios&&X.webkit_version<604;function ap(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 xr(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function Xh(i,e){e=xr(i.state,yo,e);let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(eo!=null&&t.selection.ranges.every(O=>O.empty)&&eo==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=hp(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new Js(i,e,t,n)),n&&i.observer.ignore(()=>{El(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}else i.inputState.setSelectionOrigin("select.pointer");return!1};function Ql(i,e,t,n){if(n==1)return S.cursor(e,t);if(n==2)return M$(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 Op(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&&gl(t,n,o))return-1;let a=r.coordsAt(s,1);return a&&gl(t,n,a)?1:o&&o.bottom>=n?-1:1}function Sl(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Op(i,t,e.clientX,e.clientY)}}var lp=X.ie&&X.ie_version<=11,Pl=null,yl=0,bl=0;function vh(i){if(!lp)return i.detail;let e=Pl,t=bl;return Pl=i,bl=Date.now(),yl=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(yl+1)%3:1}function hp(i,e){let t=Sl(i,e),n=vh(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=Sl(i,s),l,h=Ql(i,O.pos,O.bias,n);if(t.pos!=O.pos&&!o){let c=Ql(i,t.pos,t.bias,n),f=Math.min(c.from,h.from),d=Math.max(c.to,h.to);h=f1&&(l=cp(r,O.pos))?l:a?r.addRange(h):S.create([h])}}}function cp(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",xr(i.state,bo,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=xr(i.state,yo,t),!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&rp(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=wh?null:e.clipboardData;return t?(Xh(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(ap(i),!1)};function fp(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 up(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:xr(i,bo,e.join(i.lineBreak)),ranges:t,linewise:n}}var eo=null;Ne.copy=Ne.cut=(i,e)=>{let{text:t,ranges:n,linewise:r}=up(i.state);if(!t&&!r)return!1;eo=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=wh?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(fp(i,t),!1)};var Rh=xe.define();function Zh(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:Rh.of(!0)}):null}function Vh(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=Zh(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,X.chrome&&X.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=="insertText"||e.inputType=="insertCompositionText")&&(i.inputState.insertingText=e.data,i.inputState.insertingTextAt=Date.now()),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 xo(i,{from:O,to:l,insert:i.state.toText(s)},null),!0}}let r;if(X.chrome&&X.android&&(r=xh.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 X.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),X.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Le.compositionend(i,e),20),!1};var xl=new Set;function dp(i){xl.has(i)||(xl.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var kl=["pre-wrap","normal","pre-line","break-spaces"],xi=!1;function wl(){xi=!1}var to=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 kl.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)>ar&&(xi=!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 Qr{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new ot(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)>=ar&&(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)>=ar||Math.abs(O-this.heightMetrics(e,t).perLine)>=ar)&&(xi=!0),mr(this,l)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},no=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&&Xl(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=mr(this.left,e),this.right=mr(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 Xl(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 $p=5,ro=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=$p)&&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 Qp(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function gp(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var en=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 to(t),this.stateDeco=e.facet(hn).filter(n=>typeof n!="function"),this.heightMap=Ve.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle.setDoc(e.doc),[new Ot(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 yi(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?vl:new ao(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(Bi(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(hn).filter(h=>typeof h!="function");let r=e.changedRanges,s=Ot.extendWithRanges(r,pp(n,this.stateDeco,e?e.changes:Qe.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);wl(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||xi)&&(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:k,scaleY:y}=Ml(t,a);(k>.005&&Math.abs(this.scaleX-k)>.005||y>.005&&Math.abs(this.scaleY-y)>.005)&&(this.scaleX=k,this.scaleY=y,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=Ll(e.scrollDOM);let $=(this.printing?gp:mp)(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&&!Qp(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 k=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(g-this.contentDOMWidth)>r.charWidth){let{lineHeight:y,charWidth:x,textHeight:w}=e.docView.measureTextSize();o=y>0&&r.refresh(s,y,x,w,Math.max(5,g/x),k),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)),wl();for(let y of this.viewports){let x=y.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(y);this.heightMap=(o?Ve.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle,[new Ot(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new io(y.from,x))}xi&&(l|=2)}let P=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return P&&(l&2&&(l|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),l|=this.updateForViewport()),(l&2||P)&&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 yi(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(cP.from<=c&&P.to>=c)){let P=t.moveToLineBoundary(S.cursor(c),!1,!0).head;P>h&&(c=P)}let Q=this.gapSize(f,h,c,d),g=n||Q<2e6?Q:2e6;m=new en(h,c,Q,g)}a.push(m)},l=h=>{if(h.length2e6)for(let x of e)x.from>=h.from&&x.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=[];K.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)||Bi(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)||Bi(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 Bi(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}},yi=class{constructor(e,t){this.from=e,this.to=t}};function Sp(i,e,t){let n=[],r=i,s=0;return K.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 ir(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 Pp(i,e){for(let t of i)if(e(t))return t}var vl={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}},ao=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 Bi(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new ot(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>Bi(r,e)):i._content)}var nr=Z.define({combine:i=>i.join(" ")}),Oo=Z.define({combine:i=>i.indexOf(!0)>-1}),lo=Ue.newName(),Yh=Ue.newName(),_h=Ue.newName(),zh={"&light":"."+Yh,"&dark":"."+_h};function ho(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 yp=ho("."+lo,{"&":{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"}},zh),bp={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},_s=X.ie&&X.ie_version<=11,co=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Ms,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);(X.ie&&X.ie_version<=11||X.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&&X.android&&e.constructor.EDIT_CONTEXT!==!1&&!(X.chrome&&X.chrome_version<126)&&(this.editContext=new fo(e),e.state.facet(gt)&&(e.contentDOM.editContext=this.editContext.editContext)),_s&&(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:!sr(this.dom,r))return;let s=r.anchorNode&&n.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(X.ie&&X.ie_version<=11||X.android&&X.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=nn(e.root);if(!t)return!1;let n=X.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Tp(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=sr(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&&sr(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 Hs(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=bh(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=Rl(t,e.previousSibling||e.target.previousSibling,-1),r=Rl(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 Rl(i,e,t){for(;e;){let n=F.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 Zl(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 Tp(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return Zl(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?Zl(i,t):null}var fo=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=O-a>n.text.length;a==this.from&&sthis.to&&(O=s);let h=Th(e.state.sliceDoc(a,O),n.text,(l?r.from:r.to)-a,l?"end":null);if(!h){let f=S.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));f.main.eq(r)||e.dispatch({selection:f,userEvent:"select"});return}let c={from:h.from+a,to:h.toA+a,insert:q.of(n.text.slice(h.from,h.toB).split(` -`))};if((X.mac||X.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:a,to:O,insert:q.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let f=this.to-this.from+(c.to-c.from+c.insert.length);xo(e,c,S.single(this.toEditorPos(n.selectionStart,f),this.toEditorPos(n.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},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(!/none/i.test(o)&&!/none/i.test(a)){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=nn(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])}},v=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||p$(e.parent)||document,this.viewState=new gr(e.state||B.create(e)),e.scrollTo&&e.scrollTo.is(Kn)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Pi).map(r=>new Ki(r));for(let r of this.plugins)r.update(this);this.observer=new co(this),this.inputState=new Ks(this),this.inputState.ensureHandlers(this.plugins),this.docView=new $r(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(Rh))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,O=Zh(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(B.phrases)!=this.state.facet(B.phrases))return this.setState(s);r=dr.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(Kn)&&(c=d.value.clip(this.state))}this.viewState.update(r,c),this.bidiCache=Sr.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(nr)!=r.state.facet(nr)&&(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(Bs))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&&!bh(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 gr(e),this.plugins=e.facet(Pi).map(n=>new Ki(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new $r(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(Pi),n=e.state.facet(Pi);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(Ll(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,$),Vl}}),c=dr.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(Bs))a(t)}get themeClasses(){return lo+" "+(this.state.facet(Oo)?_h:Yh)+" "+this.state.facet(nr)}updateAttrs(){let e=Yl(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:`${X.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Yl(this,To,t);let n=this.observer.ignore(()=>{let r=Gs(this.contentDOM,this.contentAttrs,t),s=Gs(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(yp).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 Ys(this,e,pl(this,e,t,n))}moveByGroup(e,t){return Ys(this,e,pl(this,e,t,n=>B$(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 D$(this,e,t,n)}moveVertically(e,t,n){return Ys(this,e,I$(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[at.find(s,e-r.from,-1,t)];return Tr(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>xp)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=cl(this,e))))return s.order;n||(n=cl(this,e));let r=R$(e.text,t,n);return this.bidiCache.push(new Sr(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||X.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{El(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 Kn.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 Kn.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=[nr.of(n),ji.of(ho(`.${n}`,e))];return t&&t.dark&&r.push(Oo.of(!0)),r}static baseTheme(e){return rt.lowest(ji.of(ho("."+lo,e,zh)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&F.get(n)||F.get(e);return((t=r?.rootView)===null||t===void 0?void 0:t.view)||null}};v.styleModule=ji;v.inputHandler=Oh;v.clipboardInputFilter=yo;v.clipboardOutputFilter=bo;v.scrollHandler=fh;v.focusChangeEffect=lh;v.perLineTextDirection=hh;v.exceptionSink=ah;v.updateListener=Bs;v.editable=gt;v.mouseSelectionStyle=oh;v.dragMovesSelection=sh;v.clickAddsSelectionRange=rh;v.decorations=hn;v.outerDecorations=$h;v.atomicRanges=un;v.bidiIsolatedRanges=ph;v.scrollMargins=mh;v.darkTheme=Oo;v.cspNonce=Z.define({combine:i=>i.length?i[0]:""});v.contentAttributes=To;v.editorAttributes=dh;v.lineWrapping=v.contentAttributes.of({class:"cm-lineWrapping"});v.announce=D.define();var xp=4096,Vl={},Sr=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&&Es(o,t)}return t}var kp=X.mac?"mac":X.windows?"win":X.linux?"linux":"key";function wp(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,Rp=4e3;function Zp(i,e=kp){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=>wp(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:[P=>{let k=vt={view:P,prefix:g,scope:o};return setTimeout(()=>{vt==k&&(vt=null)},Rp),!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,uo))}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 uo=null;function Vp(i,e,t,n){uo=e;let r=nl(e),s=xs(r,0),o=ks(s)==r.length&&r!=" ",a="",O=!1,l=!1,h=!1;vt&&vt.view==t&&vt.scope==n&&(a=vt.prefix+" ",kh.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+rr(r,e,!o)])?O=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(X.windows&&e.ctrlKey&&e.altKey)&&!(X.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&($=Qt[e.keyCode])&&$!=r?(f(d[a+rr($,e,!0)])||e.shiftKey&&(p=Si[e.keyCode])!=r&&p!=$&&f(d[a+rr(p,e,!1)]))&&(O=!0):o&&e.shiftKey&&f(d[a+rr(r,e,!0)])&&(O=!0),!O&&f(d._any)&&(O=!0)),l&&(O=!0),O&&h&&e.stopPropagation(),uo=null,O}var cn=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=Ch(e);return[new i(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return Yp(e,t,n)}};function Ch(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 zl(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 Yp(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=Ch(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=Ns(i,n,1),$=Ns(i,r,-1),p=d.type==ye.Text?d:null,m=$.type==ye.Text?$:null;if(p&&(i.lineWrapping||d.widgetLineBreaks)&&(p=zl(i,n,1,p)),m&&(i.lineWrapping||$.widgetLineBreaks)&&(m=zl(i,r,-1,m)),p&&m&&p.from==m.from&&p.to==m.to)return g(P(t.from,t.to,p));{let y=p?P(t.from,null,p):k(d,!1),x=m?P(null,t.to,m):k($,!0),w=[];return(p||d).to<(m||$).from-(p&&m?1:0)||d.widgetLineBreaks>1&&y.bottom+i.defaultLineHeight/2_&&E.from=me)break;qe>H&&C(Math.max(ae,H),y==null&&ae<=_,Math.min(qe,me),x==null&&qe>=j,it.dir)}if(H=Re.to+1,H>=me)break}return I.length==0&&C(_,y==null,j,x==null,i.textDirection),{top:M,bottom:A,horizontal:I}}function k(y,x){let w=a.top+(x?y.top:y.bottom);return{top:w,bottom:w,horizontal:[]}}}function _p(i,e){return i.constructor==e.constructor&&i.eq(e)}var $o=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!_p(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,X.safari&&X.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},Or=Z.define();function qh(i){return[Ge.define(e=>new $o(e,i)),Or.of(i)]}var fn=Z.define({combine(i){return Xt(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Ah(i={}){return[fn.of(i),zp,Cp,qp,ch.of(!0)]}function Wh(i){return i.startState.facet(fn)!=i.state.facet(fn)}var zp=qh({above:!0,markers(i){let{state:e}=i,t=e.facet(fn),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 cn.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=Wh(i);return t&&Cl(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){Cl(e.state,i)},class:"cm-cursorLayer"});function Cl(i,e){e.style.animationDuration=i.facet(fn).cursorBlinkRate+"ms"}var Cp=qh({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:cn.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||Wh(i)},class:"cm-selectionLayer"}),qp=rt.highest(v.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"}}}})),Uh=D.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(Uh)?n.value:t,i)}}),Ap=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:Uh.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 Mh(){return[Ii,Ap]}var cy=/x/.unicode!=null?"gu":"g";function ko(){return Up}var Wp=U.line({class:"cm-activeLine"}),Up=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(Wp.range(r.from)),e=r.from)}return U.set(t)}},{decorations:i=>i.decorations});var po=2e3;function Mp(i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>po||t.off>po||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=Nn(l.text,o,i.tabSize,!0);if(h<0)s.push(S.cursor(l.to));else{let c=Nn(l.text,a,i.tabSize);s.push(S.range(l.from+h,l.from+c))}}}return s}function Ep(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function ql(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>po?-1:r==n.length?Ep(i,e.clientX):ke(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:s,off:r}}function Gp(i,e){let t=ql(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=ql(i,r);if(!a)return n;let O=Mp(i.state,t,a);return O.length?o?S.create(O.concat(n.ranges)):S.create(O):n}}:null}function Eh(i){let e=i?.eventFilter||(t=>t.altKey&&t.button==0);return v.mouseSelectionStyle.of((t,n)=>e(n)?Gp(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 lr=Z.define(),Lp=Z.define();var hr=Z.define();var mo=Z.define({combine:i=>i.some(e=>e)});function jp(i){let e=[Dp];return i&&i.fixed===!1&&e.push(mo.of(!0)),e}var Dp=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(hr).map(e=>new Pr(i,e)),this.fixed=!i.state.facet(mo);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(mo)!=!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=K.iter(this.view.state.facet(lr),this.view.viewport.from),n=[],r=this.gutters.map(s=>new go(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==ye.Text&&o){Qo(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==ye.Text){Qo(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(hr),t=i.state.facet(hr),n=i.docChanged||i.heightChanged||i.viewportChanged||!K.eq(i.startState.facet(lr),i.state.facet(lr),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 Pr(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=>v.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 Al(i){return Array.isArray(i)?i:[i]}function Qo(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var go=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=K.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 yr(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=[];Qo(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(Lp)){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()}}},Pr=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=Al(t.markers(e)),t.initialSpacer&&(this.spacer=new yr(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=Al(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!K.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()}},yr=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":""),Bp(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}})}}),tn=class extends Fe{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function zs(i,e){return i.state.facet(bi).formatNumber(e,i.state)}var Fp=hr.compute([bi],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Ip)},lineMarker(e,t,n){return n.some(r=>r.toDOM)?null:new tn(zs(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(Np)){let s=r(e,t,n);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(bi)!=e.state.facet(bi),initialSpacer(e){return new tn(zs(e,Wl(e.state.doc.lines)))},updateSpacer(e,t){let n=zs(t.view,Wl(t.view.state.doc.lines));return n==e.number?e:new tn(n)},domEventHandlers:i.facet(bi).domEventHandlers,side:"before"}));function Gh(i={}){return[bi.of(i),jp(),Fp]}function Wl(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(Hp.range(r)))}return K.of(e)});function wo(){return Kp}async function Lh(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 Jp=0,we=class{constructor(e,t){this.from=e,this.to=t}},Y=class{constructor(e={}){this.id=Jp++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}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 ni=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]}},em=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):em,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|L.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:Ao(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 im(e)}};z.empty=new z(ie.none,[],[],0);var Xo=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 dn(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(Kh(r,n,c,c+h.length)){if(h instanceof zt){if(s&L.ExcludeBuffers)continue;let f=h.findChild(0,h.buffer.length,t,n-c,r);if(f>-1)return new ri(new Ro(o,h,e,c),null,f)}else if(s&L.IncludeAnonymous||!h.type.isAnonymous||qo(h)){let f;if(!(s&L.IgnoreMounts)&&(f=ni.get(h))&&!f.overlay)return new i(f.tree,c,e,o);let d=new i(h,c,e,o);return s&L.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?h.children.length-1:0,t,n,r)}}}if(s&L.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)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&L.IgnoreOverlays)&&(r=ni.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 Dh(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 vo(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 Ro=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},ri=class i extends Xr{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)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&L.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 Jh(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(dn(a,e,t,!1))}}return r?Jh(r):n}var ki=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&L.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&L.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&L.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&L.IncludeAnonymous||a instanceof zt||!a.type.isAnonymous||qo(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 vo(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 qo(i){return i.children.some(e=>e instanceof zt||!e.type.isAnonymous||qo(e))}function im(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=n.types.length}=i,a=Array.isArray(t)?new Xo(t,t.length):t,O=n.types,l=0,h=0;function c(y,x,w,M,A,I){let{id:C,start:_,end:j,size:E}=a,H=h,me=l;if(E<0)if(a.next(),E==-1){let $t=s[C];w.push($t),M.push(_-y);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],it,ae,qe=_-y;if(j-_<=r&&(ae=m(a.pos-x,A))){let $t=new Uint16Array(ae.size-ae.skip),Ae=a.pos-ae.size,nt=$t.length;for(;a.pos>Ae;)nt=Q(ae.start,$t,nt);it=new zt($t,j-ae.start,n),qe=ae.start-y}else{let $t=a.pos-E;a.next();let Ae=[],nt=[],Dt=C>=o?C:-1,di=0,An=j;for(;a.pos>$t;)Dt>=0&&a.id==Dt&&a.size>=0?(a.end<=An-r&&($(Ae,nt,_,di,a.end,An,Dt,H,me),di=Ae.length,An=a.end),a.next()):I>2500?f(_,$t,Ae,nt):c(_,$t,Ae,nt,Dt,I+1);if(Dt>=0&&di>0&&di-1&&di>0){let RO=d(Re,me);it=Ao(Re,Ae,nt,0,Ae.length,0,j-_,RO,RO)}else it=p(Re,Ae,nt,j-_,H-j,me)}w.push(it),M.push(qe)}function f(y,x,w,M){let A=[],I=0,C=-1;for(;a.pos>x;){let{id:_,start:j,end:E,size:H}=a;if(H>4)a.next();else{if(C>-1&&j=0;E-=3)_[H++]=A[E],_[H++]=A[E+1]-j,_[H++]=A[E+2]-j,_[H++]=H;w.push(new zt(_,A[2]-j,n)),M.push(j-y)}}function d(y,x){return(w,M,A)=>{let I=0,C=w.length-1,_,j;if(C>=0&&(_=w[C])instanceof z){if(!C&&_.type==y&&_.length==A)return _;(j=_.prop(Y.lookAhead))&&(I=M[C]+_.length+j)}return p(y,w,M,A,I,x)}}function $(y,x,w,M,A,I,C,_,j){let E=[],H=[];for(;y.length>M;)E.push(y.pop()),H.push(x.pop()+w-A);y.push(p(n.types[C],E,H,I-A,_-I,j)),x.push(A-w)}function p(y,x,w,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(y,x,w,M,C)}function m(y,x){let w=a.fork(),M=0,A=0,I=0,C=w.end-r,_={size:0,start:0,skip:0};e:for(let j=w.pos-y;w.pos>j;){let E=w.size;if(w.id==x&&E>=0){_.size=M,_.start=A,_.skip=I,I+=4,M+=4,w.next();continue}let H=w.pos-E;if(E<0||H=o?4:0,Re=w.start;for(w.next();w.pos>H;){if(w.size<0)if(w.size==-3||w.size==-4)me+=4;else break e;else w.id>=o&&(me+=4);w.next()}A=Re,M+=E,I+=me}return(x<0||M==y)&&(_.size=M,_.start=A,_.skip=I),_.size>4?_:void 0}function Q(y,x,w){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;)w=Q(y,x,w)}x[--w]=_,x[--w]=I-y,x[--w]=A-y,x[--w]=M}else C==-3?l=M:C==-4&&(h=M);return w}let g=[],P=[];for(;a.pos>0;)c(i.start||0,i.bufferStart||0,g,P,-1,0);let k=(e=i.length)!==null&&e!==void 0?e:g.length?P[0]+g[0].length:0;return new z(O[i.topID],g.reverse(),P.reverse(),k)}var Bh=new WeakMap;function wr(i,e){if(!i.isAnonymous||e instanceof zt||e.type!=i)return 1;let t=Bh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof z)){t=1;break}t+=wr(i,n)}Bh.set(e,t)}return t}function Ao(i,e,t,n,r,s,o,a,O){let l=0;for(let $=n;$=h)break;x+=w}if(P==k+1){if(x>h){let w=$[k];d(w.children,w.positions,0,w.children.length,p[k]+g);continue}c.push($[k])}else{let w=p[P-1]+$[P-1].length-y;c.push(Ao(i,$,p,k,P,y,w,null,O))}f.push(y+g-s)}}return d(e,t,n,r,0),(a||O)(c,f,o)}var wi=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 ri?this.setBuffer(e.context.buffer,e.index,t):e instanceof Xe&&this.map.set(e.tree,t)}get(e){return e instanceof ri?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}}},Vo=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 Xi(i){return(e,t,n,r)=>new zo(e,i,t,n,r)}var vr=class{constructor(e,t,n,r,s){this.parser=e,this.parse=t,this.overlay=n,this.target=r,this.from=s}};function Ih(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}var Yo=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=[]}},_o=new Y({perNode:!0}),zo=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([[_o,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 ni(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=nm(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=Fh(this.ranges,t.ranges);l.length&&(Ih(l),this.inner.splice(t.index,0,new vr(t.parser,t.parser.startParse(this.input,Hh(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 nm(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 Nh(i,e,t,n,r,s){if(e=e&&t.enter(n,1,L.IgnoreOverlays|L.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}},Co=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(_o))!==null&&t!==void 0?t:n.to,this.inner=new Rr(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(_o))!==null&&e!==void 0?e:t.to,this.inner=new Rr(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 Fh(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 sm(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=sm(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 om=0,Ye=class i{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=om++}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 _r(e);return n=>n.modified.indexOf(t)>-1?n:_r.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},am=0,_r=class i{constructor(e){this.name=e,this.instances=[],this.id=am++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(a=>a.base==e&&Om(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=lm(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 Om(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function lm(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 oi(n,o,O>0?s.slice(0,O):null);e[l]=h.sort(e[l])}}return ic.add(e)}var ic=new Y({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new oi(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}}),oi=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 hm(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function nc(i,e,t,n=0,r=i.length){let s=new Uo(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}var Uo=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=cm(e)||oi.empty,c=hm(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=P||!e.nextSibling())););if(!g||P>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 cm(i){let e=i.type.prop(ic);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var T=Ye.define,Zr=T(),Ct=T(),ec=T(Ct),tc=T(Ct),qt=T(),Vr=T(qt),Wo=T(qt),dt=T(),si=T(dt),ft=T(),ut=T(),Mo=T(),$n=T(Mo),Yr=T(),u={comment:Zr,lineComment:T(Zr),blockComment:T(Zr),docComment:T(Zr),name:Ct,variableName:T(Ct),typeName:ec,tagName:T(ec),propertyName:tc,attributeName:T(tc),className:T(Ct),labelName:T(Ct),namespace:T(Ct),macroName:T(Ct),literal:qt,string:Vr,docString:T(Vr),character:T(Vr),attributeValue:T(Vr),number:Wo,integer:T(Wo),float:T(Wo),bool:T(qt),regexp:T(qt),escape:T(qt),color:T(qt),url:T(qt),keyword:ft,self:T(ft),null:T(ft),atom:T(ft),unit:T(ft),modifier:T(ft),operatorKeyword:T(ft),controlKeyword:T(ft),definitionKeyword:T(ft),moduleKeyword:T(ft),operator:ut,derefOperator:T(ut),arithmeticOperator:T(ut),logicOperator:T(ut),bitwiseOperator:T(ut),compareOperator:T(ut),updateOperator:T(ut),definitionOperator:T(ut),typeOperator:T(ut),controlOperator:T(ut),punctuation:Mo,separator:T(Mo),bracket:$n,angleBracket:T($n),squareBracket:T($n),paren:T($n),brace:T($n),content:dt,heading:si,heading1:T(si),heading2:T(si),heading3:T(si),heading4:T(si),heading5:T(si),heading6:T(si),contentSeparator:T(dt),list:T(dt),quote:T(dt),emphasis:T(dt),strong:T(dt),link:T(dt),monospace:T(dt),strikethrough:T(dt),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:Yr,documentMeta:T(Yr),annotation:T(Yr),processingInstruction:T(Yr),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 yy=Eo([{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 Go,bt=new Y;function Ri(i){return Z.define({combine:i?e=>e.concat(i):void 0})}var Ar=new Y,fe=class{constructor(e,t,n=[],r=""){this.data=e,this.name=r,B.prototype.hasOwnProperty("tree")||Object.defineProperty(B.prototype,"tree",{get(){return G(this)}}),this.parser=t,this.extension=[vi.of(this),B.languageData.of((s,o,a)=>{let O=rc(s,o,a),l=O.type.prop(bt);if(!l)return[];let h=s.facet(l),c=O.type.prop(Ar);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 rc(e,t,n).type.prop(bt)==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(bt)==this.data){n.push({from:o,to:o+s.length});return}let a=s.prop(Y.mounted);if(a){if(a.tree.prop(bt)==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 G(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)}},pn=null,ai=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=pn;pn=this;try{return e()}finally{pn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=sc(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=sc(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=pn;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 pn}};function sc(i,e,t){return Pt.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var mn=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=ai.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:mn.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)?mn.init(e.state):i.apply(e)}});var hc=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(hc=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var Lo=typeof navigator<"u"&&(!((Go=navigator.scheduling)===null||Go===void 0)&&Go.isInputPending)?()=>navigator.scheduling.isInputPending():null,fm=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=hc(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,O=s.context.work(()=>Lo&&Lo()||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 mn(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,fm,v.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]}},Qn=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}},um=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 Sn(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?dm(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 ke(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 dm(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 cc(n,i,t)}function cc(i,e,t){for(let n=i;n;n=n.next){let r=pm(n.node);if(r)return r(Io.create(e,t,n))}return 0}function $m(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function pm(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=>fc(o,!0,1,void 0,s&&!$m(o)?r.from:void 0)}return i.parent==null?mm:null}function mm(){return 0}var Io=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(Qm(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return cc(this.context.next,this.base,this.pos)}};function Qm(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function gm(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 Wr({closing:i,align:e=!0,units:t=1}){return n=>fc(n,e,t,i)}function fc(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?gm(i):null;return O?a?i.column(O.from):i.column(O.to):i.baseIndent+(a?0:i.unit*t)}var uc=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 dc=Z.define(),be=new Y;function Ut(i){let e=i.firstChild,t=i.lastChild;return e&&e.toa.prop(bt)==o.data:o?a=>a==o:void 0,this.style=Eo(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||{})}},No=Z.define(),$c=Z.define({combine(i){return i.length?[i[0]]:null}});function jo(i){let e=i.facet(No);return e.length?e:i.facet($c)}function ta(i,e){let t=[Sm],n;return i instanceof Tt&&(i.module&&t.push(v.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push($c.of(i)):n?t.push(No.computeN([v.darkTheme],r=>r.facet(v.darkTheme)==(n=="dark")?[i]:[])):t.push(No.of(i)),t}var Fo=class{constructor(e){this.markCache=Object.create(null),this.tree=G(e.state),this.decorations=this.buildDeco(e,jo(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=G(e.state),n=jo(e.state),r=n!=jo(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)nc(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()}},Sm=rt.high(Ge.fromClass(Fo,{decorations:i=>i.decorations})),Zy=Tt.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"}]),Pm=v.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),pc=1e4,mc="()[]{}",Qc=Z.define({combine(i){return Xt(i,{afterCursor:!0,brackets:mc,maxScanDistance:pc,renderMatch:Tm})}}),ym=U.mark({class:"cm-matchingBracket"}),bm=U.mark({class:"cm-nonmatchingBracket"});function Tm(i){let e=[],t=i.matched?ym:bm;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 xm=ge.define({create(){return U.none},update(i,e){if(!e.docChanged&&!e.selection)return i;let t=[],n=e.state.facet(Qc);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.headv.decorations.from(i)}),km=[xm,Pm];function gc(i={}){return[Qc.of(i),km]}var Pn=new Y;function Ho(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 Ko(i){let e=i.type.prop(Pn);return e?e(i.node):i}function He(i,e,t,n={}){let r=n.maxScanDistance||pc,s=n.brackets||mc,o=G(i),a=o.resolveInner(e,t);for(let O=a;O;O=O.parent){let l=Ho(O.type,t,s);if(l&&O.from0?e>=h.from&&eh.from&&e<=h.to))return wm(i,e,t,O,h,l,s)}}return Xm(i,e,t,o,a.type,r,s)}function wm(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 oc(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 vm(i){return{name:i.name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||Rm,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||na,mergeTokens:i.mergeTokens!==!1}}function Rm(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 ac=new WeakMap,Cr=class i extends fe{constructor(e){let t=Ri(e.languageData),n=vm(e),r,s=new class extends yt{createParse(o,a,O){return new Jo(r,o,a,O)}};super(t,s,[],e.name),this.topNode=_m(t,this),r=this,this.streamParser=n,this.stateAfter=new Y({perNode:!0}),this.tokenTable=e.tokenTable?new qr(n.tokenTable):Ym}static define(e){return new i(e)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=ac.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&&ia(i,s.tree,0-s.offset,t,a),l;if(O&&O.pos<=n&&(l=Sc(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 Jo=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=ai.get(),o=r[0].from,{state:a,tree:O}=Zm(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=ai.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);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 zr(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=Pc(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 na=Object.create(null),gn=[ie.none],Vm=new St(gn),Oc=[],lc=Object.create(null),yc=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"]])yc[i]=bc(na,e);var qr=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),yc)}resolve(e){return e?this.table[e]||(this.table[e]=bc(this.extra,e)):0}},Ym=new qr(na);function Do(i,e){Oc.indexOf(i)>-1||(Oc.push(i),console.warn(e))}function bc(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):Do(l,`Modifier ${l} used at start of tag`):O.length?Do(l,`Tag ${l} used as modifier`):O=Array.isArray(h)?h:[h]:Do(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=lc[r];if(s)return s.id;let o=lc[r]=ie.define({id:gn.length,name:n,props:[se({[n]:t})]});return gn.push(o),o.id}function _m(i,e){let t=ie.define({id:gn.length,name:"Document",props:[bt.add(()=>i),de.add(()=>n=>e.getIndent(n))],top:!0});return gn.push(t),t}var Vy={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 zm=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=ha(i.state,t.from);return n.line?Cm(i):n.block?Am(i):!1};function la(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 Cm=la(Mm,0);var qm=la(Vc,0);var Am=la((i,e)=>Vc(i,e,Um(e)),0);function ha(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var yn=50;function Wm(i,{open:e,close:t},n,r){let s=i.sliceDoc(n-yn,n),o=i.sliceDoc(r,r+yn),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*yn?h=c=i.sliceDoc(n,r):(h=i.sliceDoc(n,n+yn),c=i.sliceDoc(r-yn,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 Um(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=>ha(e,s.from).block);if(!n.every(s=>s))return null;let r=t.map((s,o)=>Wm(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 sa=xe.define(),Em=xe.define(),Gm=Z.define(),Yc=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)})}}),_c=ge.define({create(){return li.empty},update(i,e){let t=e.state.facet(Yc),n=e.annotation(sa);if(n){let O=Ke.fromTransaction(e,n.selection),l=n.side,h=l==0?i.undone:i.done;return O?h=Mr(h,h.length,t.minDepth,O):h=Ac(h,e.startState.selection),new li(l==0?n.rest:h,l==0?h:n.rest)}let r=e.annotation(Em);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 li(i.done.map(Ke.fromJSON),i.undone.map(Ke.fromJSON))}});function zc(i={}){return[_c,Yc.of(i),v.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?Cc:e.inputType=="historyRedo"?oa:null;return n?(e.preventDefault(),n(t)):!1}})]}function Er(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let r=t.field(_c,!1);if(!r)return!1;let s=r.pop(i,t,e);return s?(n(s),!0):!1}}var Cc=Er(0,!1),oa=Er(1,!1),Lm=Er(0,!0),jm=Er(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(Gm)){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 Mr(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 Dm(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 Bm(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function qc(i,e){return i.length?e.length?i.concat(e):i:e}var je=[],Im=200;function Ac(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Im));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Mr(i,i.length-1,1e9,t.setSelAfter(n)))}else return[Ke.selection([e])]}function Nm(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 ra(i,e){if(!i.length)return i;let t=i.length,n=je;for(;t;){let r=Fm(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 Fm(i,e,t){let n=qc(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,D.mapEffects(i.effects,e),o,i.startSelection.map(s),n)}var Hm=/^(input\.type|delete)($|\.)/,li=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||Hm.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):Gr(t,e))}function $e(i){return i.textDirectionAt(i.state.selection.main.head)==te.LTR}var Mc=i=>Uc(i,!$e(i)),Ec=i=>Uc(i,$e(i));function Gc(i,e){return et(i,t=>t.empty?i.moveByGroup(t,e):Gr(t,e))}var Km=i=>Gc(i,!$e(i)),Jm=i=>Gc(i,$e(i));var Uy=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function eQ(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 Lr(i,e,t){let n=G(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;eQ(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 tQ=i=>et(i,e=>Lr(i.state,e,!$e(i))),iQ=i=>et(i,e=>Lr(i.state,e,$e(i)));function Lc(i,e){return et(i,t=>{if(!t.empty)return Gr(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}var jc=i=>Lc(i,!1),Dc=i=>Lc(i,!0);function Bc(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):Gr(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.bottomIc(i,!1),aa=i=>Ic(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 nQ=i=>et(i,e=>Mt(i,e,!0)),rQ=i=>et(i,e=>Mt(i,e,!1)),sQ=i=>et(i,e=>Mt(i,e,!$e(i))),oQ=i=>et(i,e=>Mt(i,e,$e(i))),aQ=i=>et(i,e=>S.cursor(i.lineBlockAt(e.head).from,1)),OQ=i=>et(i,e=>S.cursor(i.lineBlockAt(e.head).to,-1));function lQ(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.headlQ(i,e,!1);function De(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(Je(i.state,t)),!0)}function Nc(i,e){return De(i,t=>i.moveByChar(t,e))}var Fc=i=>Nc(i,!$e(i)),Hc=i=>Nc(i,$e(i));function Kc(i,e){return De(i,t=>i.moveByGroup(t,e))}var cQ=i=>Kc(i,!$e(i)),fQ=i=>Kc(i,$e(i));var uQ=i=>De(i,e=>Lr(i.state,e,!$e(i))),dQ=i=>De(i,e=>Lr(i.state,e,$e(i)));function Jc(i,e){return De(i,t=>i.moveVertically(t,e))}var ef=i=>Jc(i,!1),tf=i=>Jc(i,!0);function nf(i,e){return De(i,t=>i.moveVertically(t,e,Bc(i).height))}var xc=i=>nf(i,!1),kc=i=>nf(i,!0),$Q=i=>De(i,e=>Mt(i,e,!0)),pQ=i=>De(i,e=>Mt(i,e,!1)),mQ=i=>De(i,e=>Mt(i,e,!$e(i))),QQ=i=>De(i,e=>Mt(i,e,$e(i))),gQ=i=>De(i,e=>S.cursor(i.lineBlockAt(e.head).from)),SQ=i=>De(i,e=>S.cursor(i.lineBlockAt(e.head).to)),wc=({state:i,dispatch:e})=>(e(Je(i,{anchor:0})),!0),Xc=({state:i,dispatch:e})=>(e(Je(i,{anchor:i.doc.length})),!0),vc=({state:i,dispatch:e})=>(e(Je(i,{anchor:i.selection.main.anchor,head:0})),!0),Rc=({state:i,dispatch:e})=>(e(Je(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),PQ=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),yQ=({state:i,dispatch:e})=>{let t=jr(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},bQ=({state:i,dispatch:e})=>{let t=Zi(i.selection,n=>{let r=G(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(Je(i,t)),!0)};function rf(i,e){let{state:t}=i,n=t.selection,r=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to0)for(let a=s;;){let O=i.moveVertically(a,e);if(O.heado.to){r.some(l=>l.head==O.head)||r.push(O);break}else{if(O.head==a.head)break;a=O}}}return r.length==n.ranges.length?!1:(i.dispatch(Je(t,S.create(r,r.length-1))),!0)}var TQ=i=>rf(i,!1),xQ=i=>rf(i,!0),kQ=({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(Je(i,n)),!0):!1};function bn(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=Ur(i,O,!0)),o=Math.min(o,O),a=Math.max(a,O)}else o=Ur(i,o,!1),a=Ur(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 sf=(i,e,t)=>bn(i,n=>{let r=n.from,{state:s}=i,o=s.doc.lineAt(r),a,O;if(t&&!e&&r>o.from&&rsf(i,!1,!0);var of=i=>sf(i,!0,!1),af=(i,e)=>bn(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}),Of=i=>af(i,!1),wQ=i=>af(i,!0);var XQ=i=>bn(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headbn(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),RQ=i=>bn(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},VQ=({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 jr(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 lf(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let s of jr(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 YQ=({state:i,dispatch:e})=>lf(i,e,!1),_Q=({state:i,dispatch:e})=>lf(i,e,!0);function hf(i,e,t){if(i.readOnly)return!1;let n=[];for(let r of jr(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 zQ=({state:i,dispatch:e})=>hf(i,e,!1),CQ=({state:i,dispatch:e})=>hf(i,e,!0),qQ=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(jr(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 AQ(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=G(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 Zc=cf(!1),WQ=cf(!0);function cf(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&&AQ(e,s);i&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let l=new Oi(e,{simulateBreak:s,simulateDoubleBreak:!!O}),h=ea(l,s);for(h==null&&(h=ke(/^\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 UQ=({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=ca(i,(s,o,a)=>{let O=ea(n,s.from);if(O==null)return;/\S/.test(s.text)||(O=0);let l=/^\s*/.exec(s.text)[0],h=Sn(i,O);(l!=h||a.fromi.readOnly?!1:(e(i.update(ca(i,(t,n)=>{n.push({from:t.from,insert:i.facet(Wt)})}),{userEvent:"input.indent"})),!0),uf=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(ca(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=ke(r,i.tabSize),o=0,a=Sn(i,Math.max(0,s-At(i)));for(;o(i.setTabFocusMode(),!0);var EQ=[{key:"Ctrl-b",run:Mc,shift:Fc,preventDefault:!0},{key:"Ctrl-f",run:Ec,shift:Hc},{key:"Ctrl-p",run:jc,shift:ef},{key:"Ctrl-n",run:Dc,shift:tf},{key:"Ctrl-a",run:aQ,shift:gQ},{key:"Ctrl-e",run:OQ,shift:SQ},{key:"Ctrl-d",run:of},{key:"Ctrl-h",run:Oa},{key:"Ctrl-k",run:XQ},{key:"Ctrl-Alt-h",run:Of},{key:"Ctrl-o",run:ZQ},{key:"Ctrl-t",run:VQ},{key:"Ctrl-v",run:aa}],GQ=[{key:"ArrowLeft",run:Mc,shift:Fc,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Km,shift:cQ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:sQ,shift:mQ,preventDefault:!0},{key:"ArrowRight",run:Ec,shift:Hc,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Jm,shift:fQ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:oQ,shift:QQ,preventDefault:!0},{key:"ArrowUp",run:jc,shift:ef,preventDefault:!0},{mac:"Cmd-ArrowUp",run:wc,shift:vc},{mac:"Ctrl-ArrowUp",run:Tc,shift:xc},{key:"ArrowDown",run:Dc,shift:tf,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Xc,shift:Rc},{mac:"Ctrl-ArrowDown",run:aa,shift:kc},{key:"PageUp",run:Tc,shift:xc},{key:"PageDown",run:aa,shift:kc},{key:"Home",run:rQ,shift:pQ,preventDefault:!0},{key:"Mod-Home",run:wc,shift:vc},{key:"End",run:nQ,shift:$Q,preventDefault:!0},{key:"Mod-End",run:Xc,shift:Rc},{key:"Enter",run:Zc,shift:Zc},{key:"Mod-a",run:PQ},{key:"Backspace",run:Oa,shift:Oa,preventDefault:!0},{key:"Delete",run:of,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Of,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:wQ,preventDefault:!0},{mac:"Mod-Backspace",run:vQ,preventDefault:!0},{mac:"Mod-Delete",run:RQ,preventDefault:!0}].concat(EQ.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),fa=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:tQ,shift:uQ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:iQ,shift:dQ},{key:"Alt-ArrowUp",run:YQ},{key:"Shift-Alt-ArrowUp",run:zQ},{key:"Alt-ArrowDown",run:_Q},{key:"Shift-Alt-ArrowDown",run:CQ},{key:"Mod-Alt-ArrowUp",run:TQ},{key:"Mod-Alt-ArrowDown",run:xQ},{key:"Escape",run:kQ},{key:"Mod-Enter",run:WQ},{key:"Alt-l",mac:"Ctrl-l",run:yQ},{key:"Mod-i",run:bQ,preventDefault:!0},{key:"Mod-[",run:uf},{key:"Mod-]",run:ff},{key:"Mod-Alt-\\",run:UQ},{key:"Shift-Mod-k",run:qQ},{key:"Shift-Mod-\\",run:hQ},{key:"Mod-/",run:zm},{key:"Alt-A",run:qm},{key:"Ctrl-m",mac:"Shift-Alt-m",run:MQ}].concat(GQ),df={key:"Tab",run:ff,shift:uf};var LQ="#e5c07b",$f="#e06c75",jQ="#56b6c2",DQ="#ffffff",Dr="#abb2bf",da="#7d8799",BQ="#61afef",IQ="#98c379",pf="#d19a66",NQ="#c678dd",FQ="#21252b",mf="#2c313a",Qf="#282c34",ua="#353a42",HQ="#3E4451",gf="#528bff";var Sf=v.theme({"&":{color:Dr,backgroundColor:Qf},".cm-content":{caretColor:gf},".cm-cursor, .cm-dropCursor":{borderLeftColor:gf},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:HQ},".cm-panels":{backgroundColor:FQ,color:Dr},".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:Qf,color:da,border:"none"},".cm-activeLineGutter":{backgroundColor:mf},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ua},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ua,borderBottomColor:ua},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:mf,color:Dr}}},{dark:!0}),Pf=Tt.define([{tag:u.keyword,color:NQ},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:$f},{tag:[u.function(u.variableName),u.labelName],color:BQ},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:pf},{tag:[u.definition(u.name),u.separator],color:Dr},{tag:[u.typeName,u.className,u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:LQ},{tag:[u.operator,u.operatorKeyword,u.url,u.escape,u.regexp,u.link,u.special(u.string)],color:jQ},{tag:[u.meta,u.comment],color:da},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.link,color:da,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:$f},{tag:[u.atom,u.bool,u.special(u.variableName)],color:pf},{tag:[u.processingInstruction,u.string,u.inserted],color:IQ},{tag:u.invalid,color:DQ}]);var KQ=Tt.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"}]),JQ={"&":{backgroundColor:"#FFF",color:"#000"},"&.cm-focused":{outline:"none"},".cm-line":{lineHeight:"1.6"}};function yf(i){let e=document.documentElement.classList.contains("dark-mode"),t=e?Sf:v.theme(JQ),n=e?Pf:KQ,r={darkModeActive:e,registerViewTheme(s){let o=s();o&&(t=v.theme(o))},registerHighlightStyle(s){let o=s(u)||[];o.length&&(n=Tt.define(o))}};return window.$events.emitPublic(i,"library-cm6::configure-theme",r),[t,ta(n)]}function bf(i){return[yf(i),Gh(),Ah(),Mh(),gc(),Eh()]}function eg(){let i=new mt,e={focus(t,n){n.dispatch({effects:i.reconfigure([wo(),ko()])})},blur(t,n){n.dispatch({effects:i.reconfigure([])})}};return[i.of([]),v.domEventHandlers(e)]}function $a(i){return[...bf(i),eg(),ct.of([...fa]),B.readOnly.of(!0)]}function Br(i){return[...bf(i),wo(),ko(),zc(),ct.of([...fa,...Wc,df]),v.lineWrapping]}var Qa=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 Ir(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 ga(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()}},Ir=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},ga=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}},Sa=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 Tn(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}},Tf=new Vi,Pa=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=Tf,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=Tf,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;vf(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"?Tn(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(vf(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 vf(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==$||ig($,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 xf(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function ig(i,e,t,n){let r=xf(t,n,e);return r<0||xf(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 ya=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?kf(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?kf(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}}},ba=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 ya(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&&ng(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 wf(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)})`),wf(a,n)):(!r||r.scorei,Lt=class{constructor(e){this.start=e.start,this.shift=e.shift||ma,this.reduce=e.reduce||ma,this.reuse=e.reuse||ma,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=Tn(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]=Xf(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 rg=122,Rf=1,sg=123,og=124,Vf=2,ag=125,Og=3,lg=4,Yf=[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],hg=58,cg=40,_f=95,fg=91,Nr=45,ug=46,dg=35,$g=37,pg=38,mg=92,Qg=10,gg=42;function xn(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function ka(i){return i>=48&&i<=57}function Zf(i){return ka(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(xn(O)||O==Nr||O==_f||s&&ka(O))!s&&(O!=Nr||a>0)&&(s=!0),o===a&&O==Nr&&o++,n.advance();else if(O==mg&&n.peek(1)!=Qg){if(n.advance(),Zf(n.next)){do n.advance();while(Zf(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();s=!0}else{s&&n.acceptToken(o==2&&r.canShift(Vf)?e:O==cg?t:i);break}}},Sg=new J(zf(sg,Vf,og)),Pg=new J(zf(ag,Og,lg)),yg=new J(i=>{if(Yf.includes(i.peek(-1))){let{next:e}=i;(xn(e)||e==_f||e==dg||e==ug||e==gg||e==fg||e==hg&&xn(i.peek(1))||e==Nr||e==pg)&&i.acceptToken(rg)}}),bg=new J(i=>{if(!Yf.includes(i.peek(-1))){let{next:e}=i;if(e==$g&&(i.advance(),i.acceptToken(Rf)),xn(e)){do i.advance();while(xn(i.next)||ka(i.next));i.acceptToken(Rf)}}}),Tg=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}),xg={__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},kg={__proto__:null,or:98,and:98,not:106,only:106,layer:170},wg={__proto__:null,selector:112,layer:166},Xg={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},vg={__proto__:null,to:207},Cf=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:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5: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%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!hxg[i]||-1},{term:125,get:i=>kg[i]||-1},{term:4,get:i=>wg[i]||-1},{term:25,get:i=>Xg[i]||-1},{term:123,get:i=>vg[i]||-1}],tokenPrec:1963});var wa=null;function Xa(){if(!wa&&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)));wa=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return wa||[]}var qf=["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})),Af=["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}))),Rg=["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})),Zg=["@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-]*|)$/,Vg=/^-(-[\w-]*)?$/;function Yg(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 Wf=new wi,_g=["Declaration"];function zg(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function Uf(i,e,t){if(e.to-e.from>4096){let n=Wf.get(e);if(n)return n;let r=[],s=new Set,o=e.cursor(L.IncludeAnonymous);if(o.firstChild())do for(let a of Uf(i,o.node,t))s.has(a.label)||(s.add(a.label),r.push(a));while(o.nextSibling());return Wf.set(e,r),r}else{let n=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(_g)&&((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 Cg=i=>e=>{let{state:t,pos:n}=e,r=G(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:Xa(),validFor:kt};if(r.name=="ValueName")return{from:r.from,options:Af,validFor:kt};if(r.name=="PseudoClassName")return{from:r.from,options:qf,validFor:kt};if(i(r)||(e.explicit||s)&&Yg(r,t.doc))return{from:i(r)||s?r.from:n,options:Uf(t.doc,zg(r),i),validFor:Vg};if(r.name=="TagName"){for(let{parent:O}=r;O;O=O.parent)if(O.name=="Block")return{from:r.from,options:Xa(),validFor:kt};return{from:r.from,options:Rg,validFor:kt}}if(r.name=="AtKeyword")return{from:r.from,options:Zg,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:qf,validFor:kt}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:Af,validFor:kt}:o.name=="Block"||o.name=="Styles"?{from:n,options:Xa(),validFor:kt}:null},qg=Cg(i=>i.name=="VariableName"),kn=ue.define({name:"css",parser:Cf.configure({props:[de.add({Declaration:_e()}),be.add({"Block KeyframeList":Ut})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Fr(){return new oe(kn,kn.data.of({autocomplete:qg}))}var Ag=se({String:u.string,Number:u.number,"True False":u.bool,PropertyName:u.propertyName,Null:u.null,", :":u.separator,"[ ]":u.squareBracket,"{ }":u.brace}),Mf=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:[Ag],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 Wg=ue.define({name:"json",parser:Mf.configure({props:[de.add({Object:_e({except:/^\s*\}/}),Array:_e({except:/^\s*\]/})}),be.add({"Object Array":Ut})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Ef(){return new oe(Wg)}var Ug=315,Mg=316,Gf=1,Eg=2,Gg=3,Lg=4,jg=317,Dg=319,Bg=320,Ig=5,Ng=6,Fg=0,Ra=[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],Lf=125,Hg=59,Za=47,Kg=42,Jg=43,eS=45,tS=60,iS=44,nS=63,rS=46,sS=91,oS=new Lt({start:!1,shift(i,e){return e==Ig||e==Ng||e==Dg?i:e==Bg},strict:!1}),aS=new J((i,e)=>{let{next:t}=i;(t==Lf||t==-1||e.context)&&i.acceptToken(jg)},{contextual:!0,fallback:!0}),OS=new J((i,e)=>{let{next:t}=i,n;Ra.indexOf(t)>-1||t==Za&&((n=i.peek(1))==Za||n==Kg)||t!=Lf&&t!=Hg&&t!=-1&&!e.context&&i.acceptToken(Ug)},{contextual:!0}),lS=new J((i,e)=>{i.next==sS&&!e.context&&i.acceptToken(Mg)},{contextual:!0}),hS=new J((i,e)=>{let{next:t}=i;if(t==Jg||t==eS){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(Gf);i.acceptToken(n?Gf:Eg)}}else t==nS&&i.peek(1)==rS&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(Gg))},{contextual:!0});function va(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}var cS=new J((i,e)=>{if(i.next!=tS||!e.dialectEnabled(Fg)||(i.advance(),i.next==Za))return;let t=0;for(;Ra.indexOf(i.next)>-1;)i.advance(),t++;if(va(i.next,!0)){for(i.advance(),t++;va(i.next,!1);)i.advance(),t++;for(;Ra.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==iS)return;for(let n=0;;n++){if(n==7){if(!va(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Lg,-t)}),fS=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)}),uS={__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},dS={__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},$S={__proto__:null,"<":193},jf=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!0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PPP#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:oS,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:[fS],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!^!_#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,7,8,9,10,11,12,13,14,aS,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=>uS[i]||-1},{term:342,get:i=>dS[i]||-1},{term:95,get:i=>$S[i]||-1}],tokenPrec:15124});var Hr=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=G(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(mS(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 Df(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 pS(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+$/]:pS(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function Nf(i,e){return t=>{for(let n=G(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 mS(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 QS=xe.define();var wb=typeof navigator=="object"&&/Win/.test(navigator.platform);var gS=v.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"}}}),Va=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},Ya=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)}},_a=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 Ya(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 Va(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)}},SS=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?SS: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=D.define({map(i,e){return i&&i.map(e)}}),yS=D.define(),wn=ge.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(Xn))return t.value;if(t.is(yS)&&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=>v.decorations.from(i,e=>e?e.deco:U.none)});function za(i,e){return S.create(i.filter(t=>t.field==e).map(t=>S.range(t.from,t.to)))}function bS(i){let e=_a.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?[QS.of(n),ne.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=za(a,0)),a.some(h=>h.field>0)){let h=new Yi(a,0),c=l.effects=[Xn.of(h)];t.state.field(wn,!1)===void 0&&c.push(D.appendConfig.of([wn,XS,vS,gS]))}t.dispatch(t.state.update(l))}}function Ff(i){return({state:e,dispatch:t})=>{let n=e.field(wn,!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:za(n.ranges,r),effects:Xn.of(s?null:new Yi(n.ranges,r)),scrollIntoView:!0})),!0}}var TS=({state:i,dispatch:e})=>i.field(wn,!1)?(e(i.update({effects:Xn.of(null)})),!0):!1,xS=Ff(1),kS=Ff(-1);var wS=[{key:"Tab",run:xS,shift:kS},{key:"Escape",run:TS}],Bf=Z.define({combine(i){return i.length?i[0]:wS}}),XS=rt.highest(ct.compute([Bf],i=>i.facet(Bf)));function Te(i,e){return Object.assign(Object.assign({},e),{apply:bS(i)})}var vS=v.domEventHandlers({mousedown(i,e){let t=e.state.field(wn,!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:za(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 Hf=new class extends Ie{};Hf.startSide=1;Hf.endSide=-1;var Xb=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent);var tu=[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:"ke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,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i<$s[r])t=r;else if(i>=DO[r])e=r+1;else return!0;if(e==t)return!1}}function jO(i){return i>=127462&&i<=127487}var IO=8205;function NO(i,e,t=!0,r=!0){return(t?FO:r$)(i,e,r)}function FO(i,e,t){if(e==i.length)return e;e&&HO(i.charCodeAt(e))&&KO(i.charCodeAt(e-1))&&e--;let r=ds(i,e);for(e+=BO(r);e=0&&jO(ds(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function r$(i,e,t){for(;e>0;){let r=FO(i,e-2,t);if(r=56320&&i<57344}function KO(i){return i>=55296&&i<56320}function BO(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,r){[e,t]=Si(this,e,t);let n=[];return this.decompose(0,e,n,2),r.length&&r.decompose(0,r.length,n,3),this.decompose(t,this.length,n,1),mi.from(n,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Si(this,e,t);let r=[];return this.decompose(e,t,r,0),mi.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),n=new Ht(this),s=new Ht(e);for(let o=t,a=t;;){if(n.next(o),s.next(o),o=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(a+=n.value.length,n.done||a>=r)return!0}}iter(e=1){return new Ht(this,e)}iterRange(e,t=this.length){return new jr(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;r=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ir(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?i.empty:e.length<=32?new Ze(e):mi.from(Ze.split(e,[]))}},Ze=class i extends q{constructor(e,t=n$(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.text[s],a=n+o.length;if((t?r:a)>=e)return new ms(n,a,r,o);n=a+1,r++}}decompose(e,t,r,n){let s=e<=0&&t>=this.length?this:new i(JO(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let o=r.pop(),a=Gr(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new i(a,o.length+s.length));else{let O=a.length>>1;r.push(new i(a.slice(0,O)),new i(a.slice(O)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof i))return super.replace(e,t,r);[e,t]=Si(this,e,t);let n=Gr(this.text,Gr(r.text,JO(this.text,0,e)),t),s=this.length+r.length-(t-e);return n.length<=32?new i(n,s):mi.from(i.split(n,[]),s)}sliceString(e,t=this.length,r=` +`){[e,t]=Si(this,e,t);let n="";for(let s=0,o=0;s<=t&&oe&&o&&(n+=r),es&&(n+=a.slice(Math.max(0,e-s),t-s)),s=O+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],n=-1;for(let s of e)r.push(s),n+=s.length+1,r.length==32&&(t.push(new i(r,n)),r=[],n=-1);return n>-1&&t.push(new i(r,n)),t}},mi=class i extends q{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.children[s],a=n+o.length,O=r+o.lines-1;if((t?O:a)>=e)return o.lineInner(e,t,r,n);n=a+1,r=O+1}}decompose(e,t,r,n){for(let s=0,o=0;o<=t&&s=o){let l=n&((o<=e?1:0)|(O>=t?2:0));o>=e&&O<=t&&!l?r.push(a):a.decompose(e-o,t-o,r,l)}o=O+1}}replace(e,t,r){if([e,t]=Si(this,e,t),r.lines=s&&t<=a){let O=o.replace(e-s,t-s,r),l=this.lines-o.lines+O.lines;if(O.lines>4&&O.lines>l>>6){let c=this.children.slice();return c[n]=O,new i(c,this.length-(t-e)+r.length)}return super.replace(s,a,O)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=` +`){[e,t]=Si(this,e,t);let n="";for(let s=0,o=0;se&&s&&(n+=r),eo&&(n+=a.sliceString(e-o,t-o,r)),o=O+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let r=0,[n,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==o||s==a)return r;let O=this.children[n],l=e.children[s];if(O!=l)return r+O.scanIdentical(l,t);r+=O.length+1}}static from(e,t=e.reduce((r,n)=>r+n.length+1,-1)){let r=0;for(let d of e)r+=d.lines;if(r<32){let d=[];for(let $ of e)$.flatten(d);return new Ze(d,t)}let n=Math.max(32,r>>5),s=n<<1,o=n>>1,a=[],O=0,l=-1,c=[];function h(d){let $;if(d.lines>s&&d instanceof i)for(let p of d.children)h(p);else d.lines>o&&(O>o||!O)?(f(),a.push(d)):d instanceof Ze&&O&&($=c[c.length-1])instanceof Ze&&d.lines+$.lines<=32?(O+=d.lines,l+=d.length+1,c[c.length-1]=new Ze($.text.concat(d.text),$.length+1+d.length)):(O+d.lines>n&&f(),O+=d.lines,l+=d.length+1,c.push(d))}function f(){O!=0&&(a.push(c.length==1?c[0]:i.from(c,l)),l=-1,O=c.length=0)}for(let d of e)h(d);return f(),a.length==1?a[0]:new i(a,t)}};q.empty=new Ze([""],0);function n$(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Gr(i,e,t=0,r=1e9){for(let n=0,s=0,o=!0;s=t&&(O>r&&(a=a.slice(0,r-n)),n0?1:(e instanceof Ze?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,n=this.nodes[r],s=this.offsets[r],o=s>>1,a=n instanceof Ze?n.text.length:n.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(n instanceof Ze){let O=n.text[o+(t<0?-1:0)];if(this.offsets[r]+=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=n.children[o+(t<0?-1:0)];e>O.length?(e-=O.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,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)}},jr=class{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Ht(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=r?n:t<0?n.slice(n.length-r):n.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Ir=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(q.prototype[Symbol.iterator]=function(){return this.iter()},Ht.prototype[Symbol.iterator]=jr.prototype[Symbol.iterator]=Ir.prototype[Symbol.iterator]=function(){return this});var ms=class{constructor(e,t,r,n){this.from=e,this.to=t,this.number=r,this.text=n}get length(){return this.to-this.from}};function Si(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function ae(i,e,t=!0,r=!0){return NO(i,e,t,r)}function s$(i){return i>=56320&&i<57344}function o$(i){return i>=55296&&i<56320}function Rs(i,e){let t=i.charCodeAt(e);if(!o$(t)||e+1==i.length)return t;let r=i.charCodeAt(e+1);return s$(r)?(t-55296<<10)+(r-56320)+65536:t}function Zs(i){return i<65536?1:2}var gs=/\r\n?|\n/,le=(function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i})(le||(le={})),$t=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-n);s+=a}else{if(r!=le.Simple&&l>=e&&(r==le.TrackDel&&ne||r==le.TrackBefore&&ne))return null;if(l>e||l==e&&t<0&&!a)return e==n||t<0?s:s+O;s+=O}n=l}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let r=0,n=0;r=0&&n<=t&&a>=e)return nt?"cover":!0;n=a}return!1}toString(){let e="";for(let t=0;t=0?":"+n:"")}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)}},ge=class i extends $t{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 Qs(this,(t,r,n,s,o)=>e=e.replace(n,n+(r-t),o),!1),e}mapDesc(e,t=!1){return Ss(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let n=0,s=0;n=0){t[n]=a,t[n+1]=o;let O=n>>1;for(;r.length0&&vt(r,t,s.text),s.forward(c),a+=c}let l=e[o++];for(;a>1].toJSON()))}return e}static of(e,t,r){let n=[],s=[],o=0,a=null;function O(c=!1){if(!c&&!n.length)return;of||h<0||f>t)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${t})`);let $=d?typeof d=="string"?q.of(d.split(r||gs)):d:q.empty,p=$.length;if(h==f&&p==0)return;ho&&he(n,h-o,-1),he(n,f-h,p),vt(s,n,$),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=[],r=[];for(let n=0;na&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length=0&&t<=0&&t==i[n+1]?i[n]+=e:n>=0&&e==0&&i[n]==0?i[n+1]+=t:r?(i[n]+=e,i[n+1]+=t):i.push(e,t)}function vt(i,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)a=i.sections[o++],O=i.sections[o++];e(n,l,s,c,h),n=l,s=c}}}function Ss(i,e,t,r=!1){let n=[],s=r?[]:null,o=new Kt(i),a=new Kt(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);he(n,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,c=o.len;for(;c;)if(a.ins==-1){let h=Math.min(c,a.len);l+=h,c-=h,a.forward(h)}else if(a.ins==0&&a.lenO||o.ins>=0&&o.len>O)&&(a||r.length>l),s.forward2(O),o.forward(O)}}}}var Kt=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,r=this.i-2>>1;return r>=t.length&&!e?q.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},pi=class i{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,n;return this.empty?r=n=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),r==this.from&&n==this.to?this:new i(r,n,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Q.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Q.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!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 Q.range(e.anchor,e.head)}static create(e,t,r){return new i(e,t,r)}},Q=class i{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:i.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new i(e.ranges.map(t=>pi.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 r=0,n=0;ne?8:0)|s)}static normalized(e,t=0){let r=e[t];e.sort((n,s)=>n.from-s.from),t=e.indexOf(r);for(let n=1;ns.head?i.range(O,a):i.range(a,O))}}return new i(e,t)}};function sl(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var Vs=0,v=class i{constructor(e,t,r,n,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=n,this.id=Vs++,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,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:zs),!!e.static,e.enables)}of(e){return new gi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new gi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new gi(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}};function zs(i,e){return i==e||i.length==e.length&&i.every((t,r)=>t===e[r])}var gi=class{constructor(e,t,r,n){this.dependencies=e,this.facet=t,this.type=r,this.value=n,this.id=Vs++}dynamicSlot(e){var t;let r=this.value,n=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,O=!1,l=!1,c=[];for(let h of this.dependencies)h=="doc"?O=!0:h=="selection"?l=!0:(((t=e[h.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[h.id]);return{create(h){return h.values[o]=r(h),1},update(h,f){if(O&&f.docChanged||l&&(f.docChanged||f.selection)||Ps(h,c)){let d=r(h);if(a?!el(d,h.values[o],n):!n(d,h.values[o]))return h.values[o]=d,1}return 0},reconfigure:(h,f)=>{let d,$=f.config.address[s];if($!=null){let p=Nr(f,$);if(this.dependencies.every(m=>m instanceof v?f.facet(m)===h.facet(m):m instanceof be?f.field(m,!1)==h.field(m,!1):!0)||(a?el(d=r(h),p,n):n(d=r(h),p)))return h.values[o]=p,0}else d=r(h);return h.values[o]=d,1}}}};function el(i,e,t){if(i.length!=e.length)return!1;for(let r=0;ri[O.id]),n=t.map(O=>O.type),s=r.filter(O=>!(O&1)),o=i[e.id]>>1;function a(O){let l=[];for(let c=0;cr===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Mr).find(r=>r.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,n)=>{let s=r.values[t],o=this.updateF(s,n);return this.compareF(s,o)?0:(r.values[t]=o,1)},reconfigure:(r,n)=>{let s=r.facet(Mr),o=n.facet(Mr),a;return(a=s.find(O=>O.field==this))&&a!=o.find(O=>O.field==this)?(r.values[t]=a.create(r),1):n.config.address[this.id]!=null?(r.values[t]=n.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,Mr.of({field:this,create:e})]}get extension(){return this}},Nt={lowest:4,low:3,default:2,high:1,highest:0};function Ii(i){return e=>new Br(e,i)}var at={highest:Ii(Nt.highest),high:Ii(Nt.high),default:Ii(Nt.default),low:Ii(Nt.low),lowest:Ii(Nt.lowest)},Br=class{constructor(e,t){this.inner=e,this.prec=t}},pt=class i{of(e){return new Di(this,e)}reconfigure(e){return i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},Di=class{constructor(e,t){this.compartment=e,this.inner=t}},Dr=class i{constructor(e,t,r,n,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=n,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,r){let n=[],s=Object.create(null),o=new Map;for(let f of O$(e,t,o))f instanceof be?n.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let a=Object.create(null),O=[],l=[];for(let f of n)a[f.id]=l.length<<1,l.push(d=>f.slot(d));let c=r?.config.facets;for(let f in s){let d=s[f],$=d[0].facet,p=c&&c[f]||[];if(d.every(m=>m.type==0))if(a[$.id]=O.length<<1|1,zs(p,d))O.push(r.facet($));else{let m=$.combine(d.map(g=>g.value));O.push(r&&$.compare(m,r.facet($))?r.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(g=>m.dynamicSlot(g)));a[$.id]=l.length<<1,l.push(m=>a$(m,$,d))}}let h=l.map(f=>f(a));return new i(e,o,h,a,O,s)}};function O$(i,e,t){let r=[[],[],[],[],[]],n=new Map;function s(o,a){let O=n.get(o);if(O!=null){if(O<=a)return;let l=r[O].indexOf(o);l>-1&&r[O].splice(l,1),o instanceof Di&&t.delete(o.compartment)}if(n.set(o,a),Array.isArray(o))for(let l of o)s(l,a);else if(o instanceof Di){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 Br)s(o.inner,o.prec);else if(o instanceof be)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof gi)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,Nt.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,Nt.default),r.reduce((o,a)=>o.concat(a))}function Bi(i,e){if(e&1)return 2;let t=e>>1,r=i.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;i.status[t]=4;let n=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|n}function Nr(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var ol=v.define(),Ts=v.define({combine:i=>i.some(e=>e),static:!0}),al=v.define({combine:i=>i.length?i[0]:void 0,static:!0}),Ol=v.define(),ll=v.define(),cl=v.define(),hl=v.define({combine:i=>i.length?i[0]:!1}),ye=class{constructor(e,t){this.type=e,this.value=t}static define(){return new bs}},bs=class{of(e){return new ye(this,e)}},ys=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 ys(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let n of e){let s=n.map(t);s&&r.push(s)}return r}};B.reconfigure=B.define();B.appendConfig=B.define();var re=class i{constructor(e,t,r,n,s,o){this.startState=e,this.changes=t,this.selection=r,this.effects=n,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&sl(r,t.newLength),s.some(a=>a.type==i.time)||(this.annotations=s.concat(i.time.of(Date.now())))}static create(e,t,r,n,s,o){return new i(e,t,r,n,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]=="."))}};re.time=ye.define();re.userEvent=ye.define();re.addToHistory=ye.define();re.remote=ye.define();function l$(i,e){let t=[];for(let r=0,n=0;;){let s,o;if(r=i[r]))s=i[r++],o=i[r++];else if(n=0;n--){let s=r[n](i);s instanceof re?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof re?i=s[0]:i=ul(e,Qi(s),!1)}return i}function h$(i){let e=i.startState,t=e.facet(cl),r=i;for(let n=t.length-1;n>=0;n--){let s=t[n](i);s&&Object.keys(s).length&&(r=fl(r,ws(e,s,i.changes.newLength),!0))}return r==i?i:re.create(e,i.changes,i.selection,r.effects,r.annotations,r.scrollIntoView)}var f$=[];function Qi(i){return i==null?f$:Array.isArray(i)?i:[i]}var Ue=(function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i})(Ue||(Ue={})),u$=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,xs;try{xs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function d$(i){if(xs)return xs.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||u$.test(t)))return!0}return!1}function $$(i){return e=>{if(!/\S/.test(e))return Ue.Space;if(d$(e))return Ue.Word;for(let t=0;t-1)return Ue.Word;return Ue.Other}}var D=class i{constructor(e,t,r,n,s,o){this.config=e,this.doc=t,this.selection=r,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;an.set(l,O)),t=null),n.set(a.value.compartment,a.value.extension)):a.is(B.reconfigure)?(t=null,r=a.value):a.is(B.appendConfig)&&(t=null,r=Qi(r).concat(a.value));let s;t?s=e.startState.values.slice():(t=Dr.resolve(r,n,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(Ts)?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:Q.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),n=this.changes(r.changes),s=[r.range],o=Qi(r.effects);for(let a=1;ao.spec.fromJSON(a,O)))}}return i.create({doc:e.doc,selection:Q.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=Dr.resolve(e.extensions||[],new Map),r=e.doc instanceof q?e.doc:q.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||gs)),n=e.selection?e.selection instanceof Q?e.selection:Q.single(e.selection.anchor,e.selection.head):Q.single(0);return sl(n,r.length),t.staticFacet(Ts)||(n=n.asSingle()),new i(t,r,n,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(hl)}phrase(e,...t){for(let r of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,n)=>{if(n=="$")return"$";let s=+(n||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let n=[];for(let s of this.facet(ol))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return $$(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let O=ae(t,o,!1);if(s(t.slice(O,o))!=Ue.Word)break;o=O}for(;ai.length?i[0]:4});D.lineSeparator=al;D.readOnly=hl;D.phrases=v.define({compare(i,e){let t=Object.keys(i),r=Object.keys(e);return t.length==r.length&&t.every(n=>i[n]==e[n])}});D.languageData=ol;D.changeFilter=Ol;D.transactionFilter=ll;D.transactionExtender=cl;pt.reconfigure=B.define();function Rt(i,e,t={}){let r={};for(let n of i)for(let s of Object.keys(n)){let o=n[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let n in e)r[n]===void 0&&(r[n]=e[n]);return r}var Me=class{eq(e){return this==e}range(e,t=e){return Ni.create(e,t,this)}};Me.prototype.startSide=Me.prototype.endSide=0;Me.prototype.point=!1;Me.prototype.mapMode=le.TrackDel;function _s(i,e){return i==e||i.constructor==e.constructor&&i.eq(e)}var Ni=class i{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new i(e,t,r)}};function ks(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var Xs=class i{constructor(e,t,r,n){this.from=e,this.to=t,this.value=r,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,n=0){let s=r?this.to:this.from;for(let o=n,a=s.length;;){if(o==a)return o;let O=o+a>>1,l=s[O]-e||(r?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,r,n){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,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)),r.push(l),n.push(f-o),s.push(d-o))}return{mapped:r.length?new i(n,s,r,a):null,pos:o}}},j=class i{constructor(e,t,r,n){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=n}static create(e,t,r,n){return new i(e,t,r,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:n=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(ks)),this.isEmpty)return t.length?i.of(t):this;let a=new Fr(this,null,-1).goto(0),O=0,l=[],c=new Jt;for(;a.value||O=0){let h=t[O++];c.addInner(h.from,h.to,h.value)||l.push(h)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return Fi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Fi.from(e).goto(t)}static compare(e,t,r,n,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),O=tl(o,a,r),l=new Ft(o,O,s),c=new Ft(a,O,s);r.iterGaps((h,f,d)=>il(l,h,c,f,d,n)),r.empty&&r.length==0&&il(l,0,c,0,0,n)}static eq(e,t,r=0,n){n==null&&(n=999999999);let s=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=tl(s,o),O=new Ft(s,a,0).goto(r),l=new Ft(o,a,0).goto(r);for(;;){if(O.to!=l.to||!vs(O.active,l.active)||O.point&&(!l.point||!_s(O.point,l.point)))return!1;if(O.to>n)return!0;O.next(),l.next()}}static spans(e,t,r,n,s=-1){let o=new Ft(e,null,s).goto(t),a=t,O=o.openStart;for(;;){let l=Math.min(o.to,r);if(o.point){let c=o.activeForPoint(o.to),h=o.pointFroma&&(n.span(a,l,o.active,O),O=o.openEnd(l));if(o.to>r)return O+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,t=!1){let r=new Jt;for(let n of e instanceof Ni?[e]:t?p$(e):e)r.add(n.from,n.to,n.value);return r.finish()}static join(e){if(!e.length)return i.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let n=e[r];n!=i.empty;n=n.nextLayer)t=new i(n.chunkPos,n.chunk,t,Math.max(n.maxPoint,t.maxPoint));return t}};j.empty=new j([],[],null,-1);function p$(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(ks);e=r}return i}j.empty.nextLayer=j.empty;var Jt=class i{finishChunk(e){this.chunks.push(new Xs(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new i)).add(e,t,r)}addInner(e,t,r){let n=e-this.lastTo||r.startSide-this.last.endSide;if(n<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return n<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(j.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=j.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function tl(i,e,t){let r=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=r&&n.push(new Fr(o,t,r,s));return n.length==1?n[0]:new i(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)ps(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)ps(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),ps(this.heap,0)}}};function ps(i,e){for(let t=i[e];;){let r=(e<<1)+1;if(r>=i.length)break;let n=i[r];if(r+1=0&&(n=i[r+1],r++),t.compare(n)<0)break;i[r]=t,i[e]=n,e=r}}var Ft=class{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Fi.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Er(this.active,e),Er(this.activeTo,e),Er(this.activeRank,e),this.minActive=rl(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:n,rank:s}=this.cursor;for(;t0;)t++;Lr(this.active,t,r),Lr(this.activeTo,t,n),Lr(this.activeRank,t,s),e&&Lr(e,t,this.cursor.from),this.minActive=rl(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>e){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),r&&Er(r,n)}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(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&r[n]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}};function il(i,e,t,r,n,s){i.goto(e),t.goto(r);let o=r+n,a=r,O=r-e,l=!!s.boundChange;for(let c=!1;;){let h=i.to+O-t.to,f=h||i.endSide-t.endSide,d=f<0?i.to+O:t.to,$=Math.min(d,o);if(i.point||t.point?(i.point&&t.point&&_s(i.point,t.point)&&vs(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(a,$,i.point,t.point),c=!1):(c&&s.boundChange(a),$>a&&!vs(i.active,t.active)&&s.compareRange(a,$,i.active,t.active),l&&$o)break;a=d,f<=0&&i.next(),f>=0&&t.next()}}function vs(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;r--)i[r+1]=i[r];i[e]=t}function rl(i,e){let t=-1,r=1e9;for(let n=0;n=e)return n;if(n==i.length)break;s+=i.charCodeAt(n)==9?t-s%t:1,n=ae(i,n)}return r===!0?-1:i.length}var dl=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),Ys=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),$l=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Ee=class{constructor(e,t){this.rules=[];let{finish:r}=t||{};function n(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,O,l){let c=[],h=/^@(\w+)\b/.exec(o[0]),f=h&&h[1]=="keyframes";if(h&&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(!h)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(n(d),$,c,f)}else $!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+$+";")}(c.length||f)&&O.push((r&&!h&&!l?o.map(r):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(n(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=$l[dl]||1;return $l[dl]=e+1,"\u037C"+e.toString(36)}static mount(e,t,r){let n=e[Ys],s=r&&r.nonce;n?s&&n.setNonce(s):n=new Cs(e,s),n.mount(Array.isArray(t)?t:[t],e)}},pl=new Map,Cs=class{constructor(e,t){let r=e.ownerDocument||e,n=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=pl.get(r);if(s)return e[Ys]=s;this.sheet=new n.CSSStyleSheet,pl.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Ys]=this}mount(e,t){let r=this.sheet,n=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),r)for(let l=0;l",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},m$=typeof navigator<"u"&&/Mac/.test(navigator.platform),g$=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(ne=0;ne<10;ne++)mt[48+ne]=mt[96+ne]=String(ne);var ne;for(ne=1;ne<=24;ne++)mt[ne+111]="F"+ne;var ne;for(ne=65;ne<=90;ne++)mt[ne]=String.fromCharCode(ne+32),Pi[ne]=String.fromCharCode(ne);var ne;for(Kr in mt)Pi.hasOwnProperty(Kr)||(Pi[Kr]=mt[Kr]);var Kr;function ml(i){var e=m$&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||g$&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Pi:mt)[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}var Qe=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ls=typeof document<"u"?document:{documentElement:{style:{}}},Gs=/Edge\/(\d+)/.exec(Qe.userAgent),Fl=/MSIE \d/.test(Qe.userAgent),js=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qe.userAgent),kn=!!(Fl||js||Gs),gl=!kn&&/gecko\/(\d+)/i.test(Qe.userAgent),qs=!kn&&/Chrome\/(\d+)/.exec(Qe.userAgent),Ql="webkitFontSmoothing"in Ls.documentElement.style,Is=!kn&&/Apple Computer/.test(Qe.vendor),Sl=Is&&(/Mobile\/\w+/.test(Qe.userAgent)||Qe.maxTouchPoints>2),X={mac:Sl||/Mac/.test(Qe.platform),windows:/Win/.test(Qe.platform),linux:/Linux|X11/.test(Qe.platform),ie:kn,ie_version:Fl?Ls.documentMode||6:js?+js[1]:Gs?+Gs[1]:0,gecko:gl,gecko_version:gl?+(/Firefox\/(\d+)/.exec(Qe.userAgent)||[0,0])[1]:0,chrome:!!qs,chrome_version:qs?+qs[1]:0,ios:Sl,android:/Android\b/.test(Qe.userAgent),webkit:Ql,webkit_version:Ql?+(/\bAppleWebKit\/(\d+)/.exec(Qe.userAgent)||[0,0])[1]:0,safari:Is,safari_version:Is?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Qe.userAgent)||[0,0])[1]:0,tabSize:Ls.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function _o(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}var fn=Object.create(null);function Yo(i,e,t){if(i==e)return!0;i||(i=fn),e||(e=fn);let r=Object.keys(i),n=Object.keys(e);if(r.length-(t&&r.indexOf(t)>-1?1:0)!=n.length-(t&&n.indexOf(t)>-1?1:0))return!1;for(let s of r)if(s!=t&&(n.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function Q$(i,e){for(let t=i.attributes.length-1;t>=0;t--){let r=i.attributes[t].name;e[r]==null&&i.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?i.style.cssText=r:i.getAttribute(t)!=r&&i.setAttribute(t,r)}}function Pl(i,e,t){let r=!1;if(e)for(let n in e)t&&n in t||(r=!0,n=="style"?i.style.cssText="":i.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(r=!0,n=="style"?i.style.cssText=t[n]:i.setAttribute(n,t[n]));return r}function S$(i){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new ii(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,n;if(e.isBlockGap)r=-5e8,n=4e8;else{let{start:s,end:o}=Hl(e,t);r=(s?t?-3e8:-1:5e8)-1,n=(o?t?2e8:1:-6e8)+1}return new ii(e,r,n,t,e.widget||null,!0)}static line(e){return new lr(e)}static set(e,t=!1){return j.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};E.none=j.empty;var Or=class i extends E{constructor(e){let{start:t,end:r}=Hl(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?_o(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||fn}eq(e){return this==e||e instanceof i&&this.tagName==e.tagName&&Yo(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}};Or.prototype.point=!1;var lr=class i extends E{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof i&&this.spec.class==e.spec.class&&Yo(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)}};lr.prototype.mapMode=le.TrackBefore;lr.prototype.point=!0;var ii=class i extends E{constructor(e,t,r,n,s,o){super(t,r,s,e),this.block=n,this.isReplace=o,this.mapMode=n?t<=0?le.TrackBefore:le.TrackAfter:le.TrackDel}get type(){return this.startSide!=this.endSide?ce.WidgetRange:this.startSide<=0?ce.WidgetBefore:ce.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&P$(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)}};ii.prototype.point=!0;function Hl(i,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=i;return t==null&&(t=i.inclusive),r==null&&(r=i.inclusive),{start:t??e,end:r??e}}function P$(i,e){return i==e||!!(i&&e&&i.compare(e))}function xi(i,e,t,r=0){let n=t.length-1;n>=0&&t[n]+r>=i?t[n]=Math.max(t[n],e):t.push(i,e)}var un=class i extends Me{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof i&&this.tagName==e.tagName&&Yo(this.attributes,e.attributes)}static create(e){return new i(e.tagName,e.attributes||fn)}static set(e,t=!1){return j.of(e,t)}};un.prototype.startSide=un.prototype.endSide=-1;function cr(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function Bs(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function er(i,e){if(!e.anchorNode)return!1;try{return Bs(i,e.anchorNode)}catch{return!1}}function an(i){return i.nodeType==3?hr(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function tr(i,e,t,r){return t?Tl(i,e,t,r,-1)||Tl(i,e,t,r,1):!1}function zt(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function dn(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function Tl(i,e,t,r,n){for(;;){if(i==t&&e==r)return!0;if(e==(n<0?0:Pt(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=zt(i)+(n<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(n<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=n<0?Pt(i):0}else return!1}}function Pt(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function $n(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function T$(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 Kl(i,e){let t=e.width/i.offsetWidth,r=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-i.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function b$(i,e,t,r,n,s,o,a){let O=i.ownerDocument,l=O.defaultView||window;for(let c=i,h=!1;c&&!h;)if(c.nodeType==1){let f,d=c==O.body,$=1,p=1;if(d)f=T$(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let S=c.getBoundingClientRect();({scaleX:$,scaleY:p}=Kl(c,S)),f={left:S.left,right:S.left+c.clientWidth*$,top:S.top,bottom:S.top+c.clientHeight*p}}let m=0,g=0;if(n=="nearest")e.top0&&e.bottom>f.bottom+g&&(g=e.bottom-f.bottom+o)):e.bottom>f.bottom&&(g=e.bottom-f.bottom+o,t<0&&e.top-g0&&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)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function Jl(i,e=!0){let t=i.ownerDocument,r=null,n=null;for(let s=i.parentNode;s&&!(s==t.body||(!e||r)&&n);)if(s.nodeType==1)!n&&s.scrollHeight>s.clientHeight&&(n=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:n}}var Ds=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:r}=e;this.set(t,Math.min(e.anchorOffset,t?Pt(t):0),r,Math.min(e.focusOffset,r?Pt(r):0))}set(e,t,r,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=n}},ei=null;X.safari&&X.safari_version>=26&&(ei=!1);function ec(i){if(i.setActive)return i.setActive();if(ei)return i.focus(ei);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(ei==null?{get preventScroll(){return ei={preventScroll:!0},!0}}:void 0),!ei){ei=!1;for(let t=0;tMath.max(0,i.document.documentElement.scrollHeight-i.innerHeight-4):i.scrollTop>Math.max(1,i.scrollHeight-i.clientHeight-4)}function ic(i,e){for(let t=i,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=Pt(t)}else if(t.parentNode&&!dn(t))r=zt(t),t=t.parentNode;else return null}}function rc(i,e){for(let t=i,r=e;;){if(t.nodeType==3&&r=t){if(a.level==r)return o;(s<0||(n!=0?n<0?a.fromt:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function oc(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;p-=3)if(Ot[p+1]==-d){let m=Ot[p+2],g=m&2?n:m&4?m&1?s:n:0;g&&(F[h]=F[Ot[p]]=g),a=p;break}}else{if(Ot.length==189)break;Ot[a++]=h,Ot[a++]=f,Ot[a++]=O}else if(($=F[h])==2||$==1){let p=$==n;O=p?0:1;for(let m=a-3;m>=0;m-=3){let g=Ot[m+2];if(g&2)break;if(p)Ot[m+2]|=2;else{if(g&4)break;Ot[m+2]|=4}}}}}function Z$(i,e,t,r){for(let n=0,s=r;n<=t.length;n++){let o=n?t[n-1].to:i,a=nO;)$==m&&($=t[--p].from,m=p?t[p-1].to:i),F[--$]=d;O=c}else s=l,O++}}}function Fs(i,e,t,r,n,s,o){let a=r%2?2:1;if(r%2==n%2)for(let O=e,l=0;OO&&o.push(new je(O,p.from,d));let m=p.direction==ri!=!(d%2);Hs(i,m?r+1:r,n,p.inner,p.from,p.to,o),O=p.to}$=p.to}else{if($==t||(c?F[$]!=a:F[$]==a))break;$++}f?Fs(i,O,$,r+1,n,f,o):O<$&&o.push(new je(O,$,d)),O=$}else for(let O=t,l=s.length;O>e;){let c=!0,h=!1;if(!l||O>s[l-1].to){let p=F[O-1];p!=a&&(c=!1,h=p==16)}let f=!c&&a==1?[]:null,d=c?r:r+1,$=O;e:for(;;)if(l&&$==s[l-1].to){if(h)break e;let p=s[--l];if(!c)for(let m=p.from,g=l;;){if(m==e)break e;if(g&&s[g-1].to==m)m=s[--g].from;else{if(F[m-1]==a)break e;break}}if(f)f.push(p);else{p.toF.length;)F[F.length]=256;let r=[],n=e==ri?0:1;return Hs(i,n,n,t,0,i.length,r),r}function ac(i){return[new je(0,i,0)]}var Oc="";function z$(i,e,t,r,n){var s;let o=r.head-i.from,a=je.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),O=e[a],l=O.side(n,t);if(o==l){let f=a+=n?1:-1;if(f<0||f>=e.length)return null;O=e[a=f],o=O.side(!n,t),l=O.side(n,t)}let c=ae(i.text,o,O.forward(n,t));(cO.to)&&(c=l),Oc=i.text.slice(Math.min(o,c),Math.max(o,c));let h=a==(n?e.length-1:0)?null:e[a+(n?1:-1)];return h&&c==l&&h.level+(n?0:1)i.some(e=>e)}),pc=v.define({combine:i=>i.some(e=>e)}),mc=v.define(),ir=class i{constructor(e,t="nearest",r="nearest",n=5,s=5,o=!1){this.range=e,this.y=t,this.x=r,this.yMargin=n,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(Q.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Jr=B.define({map:(i,e)=>i.map(e)}),gc=B.define();function Ie(i,e,t){let r=i.facet(fc);r.length?r[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}var gt=v.define({combine:i=>i.length?i[0]:!0}),Y$=0,bi=v.define({combine(i){return i.filter((e,t)=>{for(let r=0;r{let O=[];return o&&O.push(Xn.of(l=>{let c=l.plugin(a);return c?o(c):E.none})),s&&O.push(s(a)),O})}static fromClass(e,t){return i.define((r,n)=>new e(r,n),t)}},rr=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(r){if(Ie(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Ie(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){Ie(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},Qc=v.define(),Ao=v.define(),Xn=v.define(),Sc=v.define(),Uo=v.define(),dr=v.define(),Pc=v.define();function yl(i,e){let t=i.state.facet(Pc);if(!t.length)return t;let r=t.map(s=>s instanceof Function?s(i):s),n=[];return j.spans(r,e.from,e.to,{point(){},span(s,o,a,O){let l=s-e.from,c=o-e.from,h=n;for(let f=a.length-1;f>=0;f--,O--){let d=a[f].spec.bidiIsolate,$;if(d==null&&(d=_$(e.text,l,c)),O>0&&h.length&&($=h[h.length-1]).to==l&&$.direction==d)$.to=c,h=$.inner;else{let p={from:l,to:c,direction:d,inner:[]};h.push(p),h=p.inner}}}}),n}var Tc=v.define();function bc(i){let e=0,t=0,r=0,n=0;for(let s of i.state.facet(Tc)){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&&(r=Math.max(r,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:e,right:t,top:r,bottom:n}}var Hi=v.define(),He=class i{constructor(e,t,r,n){this.fromA=e,this.toA=t,this.fromB=r,this.toB=n}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,r=this;for(;t>0;t--){let n=e[t-1];if(!(n.fromA>r.toA)){if(n.toAn.push(new He(s,o,a,O))),this.changedRanges=n}static create(e,t,r){return new i(e,t,r)}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}},C$=[],te=class{constructor(e,t,r=0){this.dom=e,this.length=t,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return C$}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&Q$(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let r=t;for(let n of this.children){if(n==e)return r;r+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let r=zt(this.dom),n=this.length?e>0:t>0;return new lt(this.parent.dom,r+(n?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof vi)return e;return null}static get(e){return e.cmTile}},Xi=class extends te{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,r=null,n,s=e?.node==t?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,n=r?r.nextSibling:t.firstChild,s&&n!=a.dom&&(s.written=!0),a.dom.parentNode==t)for(;n&&n!=a.dom;)n=wl(n);else t.insertBefore(a.dom,n);r=a.dom}for(n=r?r.nextSibling:t.firstChild,s&&n&&(s.written=!0);n;)n=wl(n);this.length=o}};function wl(i){let e=i.nextSibling;return i.parentNode.removeChild(i),e}var vi=class extends Xi{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=te.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],r=this,n=0,s=0;;)if(n==r.children.length){if(!t.length)return;r=r.parent,r.breakAfter&&s++,n=t.pop()}else{let o=r.children[n++];if(o instanceof Qt)t.push(n),r=o,n=0;else{let a=s+o.length,O=e(o,s);if(O!==void 0)return O;s=a+o.breakAfter}}}resolveBlock(e,t){let r,n=-1,s,o=-1;if(this.blockTiles((a,O)=>{let l=O+a.length;if(e>=O&&e<=l){if(a.isWidget()&&t>=-1&&t<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(Oe||e==O&&(t>1?a.length:a.covers(-1)))&&(!s||!a.isWidget()&&s.isWidget())&&(s=a,o=e-O)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&t<0||!s?{tile:r,offset:n}:{tile:s,offset:o}}},Qt=class i extends Xi{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let r=new i(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}},Ri=class i extends Xi{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,r){let n=new i(t||document.createElement("div"),e);return(!t||!r)&&(n.flags|=4),n}get domAttrs(){return this.attrs}resolveInline(e,t,r){let n=null,s=-1,o=null,a=-1;function O(c,h){for(let f=0,d=0;f=h&&($.isComposite()?O($,h-d):(!o||o.isHidden&&(t>0||r&&W$(o,$)))&&(p>h||$.flags&32)?(o=$,a=h-d):(dr&&(e=r);let n=e,s=e,o=0;e==0&&t<0||e==r&&t>=0?X.chrome||X.gecko||(e?(n--,o=1):s=0)?0:a.length-1];return X.safari&&!o&&O.width==0&&(O=Array.prototype.find.call(a,l=>l.width)||O),o?$n(O,o<0):O||null}static of(e,t){let r=new i(t||document.createTextNode(e),e);return t||(r.flags|=2),r}},ni=class i extends te{constructor(e,t,r,n){super(e,t,n),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,r){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;if(r)return $n(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let O=a?s.length-1:0;o=s[O],!(e>0?O==0:O==s.length-1||o.top0;)if(n.isComposite())if(o){if(!e)break;r&&r.break(),e--,o=!1}else if(s==n.children.length){if(!e&&!a.length)break;r&&r.leave(n),o=!!n.breakAfter,{tile:n,index:s}=a.pop(),s++}else{let O=n.children[s],l=O.breakAfter;(t>0?O.length<=e:O.length=0;a--){let O=t.marks[a],l=n.lastChild;if(l instanceof xe&&l.mark.eq(O.mark))l.dom!=O.dom&&l.setDOM(Ws(O.dom)),n=l;else{if(this.cache.reused.get(O)){let h=te.get(O.dom);h&&h.setDOM(Ws(O.dom))}let c=xe.of(O.mark,O.dom);n.append(c),n=c}this.cache.reused.set(O,2)}let s=te.get(e.text);s&&this.cache.reused.set(s,2);let o=new ti(e.text,e.text.nodeValue);o.flags|=8,n.append(o)}addInlineWidget(e,t,r){let n=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);n||this.flushBuffer();let s=this.ensureMarks(t,r);!n&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,r){this.flushBuffer(),this.ensureMarks(t,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var r;e||(e=yc);let n=Ri.start(e,t||((r=this.cache.find(Ri))===null||r===void 0?void 0:r.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var r;let n=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],a;if(t>0&&(a=n.lastChild)&&a instanceof xe&&a.mark.eq(o))n=a,t--;else{let O=xe.of(o,(r=this.cache.find(xe,l=>l.mark.eq(o)))===null||r===void 0?void 0:r.dom);n.append(O),n=O,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!xl(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(X.ios&&xl(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(As,0,32)||new ni(As.toDOM(),0,As,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let t=new eo(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-t.rank||this.wrappers[r-1].to-t.to)<0;)r--;this.wrappers.splice(r,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let r of this.wrappers){let n=t.lastChild;if(r.fromo.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),r=this.cache.find(Zi,void 0,1);return r&&(r.flags=t),r||new Zi(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},io=class{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:n,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=n;let a=this.textOff=Math.min(e,n.length);return s?null:n.slice(0,a)}let t=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,t);return this.textOff=t,r}},mn=[ni,Ri,ti,xe,Zi,Qt,vi];for(let i=0;i[]),this.index=mn.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,r=this.buckets[t];r.length<6?r.push(e):r[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,r=2){let n=e.bucket,s=this.buckets[n],o=this.index[n];for(let a=s.length-1;a>=0;a--){let O=(a+o)%s.length,l=s[O];if((!t||t(l))&&!this.reused.has(l))return s.splice(O,1),O{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let r=t&&this.getCompositionContext(t.text);for(let n=0,s=0,o=0;;){let a=on){let l=O-n;this.preserve(l,!o,!a),n=O,s+=l}if(!a)break;t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.forward(a.fromA,t.range.fromA,t.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(O-a);else{let l=O>0||a{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof xe&&n.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?n.length&&(n.length=s=0):o instanceof xe&&(n.shift(),s=Math.min(s,n.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let r=null,n=this.builder,s=0,o=j.spans(this.decorations,e,t,{point:(a,O,l,c,h,f)=>{if(l instanceof ii){if(this.disallowBlockEffectsFor[f]){if(l.block)throw new RangeError("Block decorations may not be specified via plugins");if(O>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=c.length,h>c.length)n.continueWidget(O-a);else{let d=l.widget||(l.block?_t.block:_t.inline),$=A$(l),p=this.cache.findWidget(d,O-a,$)||ni.of(d,this.view,O-a,$);l.block?(l.startSide>0&&n.addLineStartIfNotCovered(r),n.addBlockWidget(p)):(n.ensureLine(r),n.addInlineWidget(p,c,h))}r=null}else r=U$(r,l);O>a&&this.text.skip(O-a)},span:(a,O,l,c)=>{for(let h=a;hs,this.openMarks=o}forward(e,t,r=1){t-e<=10?this.old.advance(t-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let t=[],r=null;for(let n=e.parentNode;;n=n.parentNode){let s=te.get(n);if(n==this.view.contentDOM)break;s instanceof xe?t.push(s):s?.isLine()?r=s:s instanceof Qt||(n.nodeName=="DIV"&&!r&&n!=this.view.contentDOM?r=new Ri(n,yc):r||t.push(xe.of(new Or({tagName:n.nodeName.toLowerCase(),attributes:S$(n)}),n)))}return{line:r,marks:t}}};function xl(i,e){let t=r=>{for(let n of r.children)if((e?n.isText():n.length)||t(n))return!0;return!1};return t(i)}function A$(i){let e=i.isReplace?(i.startSide<0?64:0)|(i.endSide>0?128:0):i.startSide>0?32:16;return i.block&&(e|=256),e}var yc={class:"cm-line"};function U$(i,e){let t=e.spec.attributes,r=e.spec.class;return!t&&!r||(i||(i={class:"cm-line"}),t&&_o(t,i),r&&(i.class+=" "+r)),i}function M$(i){let e=[];for(let t=i.parents.length;t>1;t--){let r=t==i.parents.length?i.tile:i.parents[t].tile;r instanceof xe&&e.push(r.mark)}return e}function Ws(i){let e=te.get(i);return e&&e.setDOM(i.cloneNode()),i}var _t=class extends St{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 As=new class extends St{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}},gn=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=E.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.updateDeco(),this.tile=new vi(e,e.contentDOM),this.updateInner([new He(0,0,0,e.state.doc.length)],null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,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 n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?n=this.domChanged.newSel.head:!N$(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let s=n>-1?L$(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:h}=this.hasComposition;r=new He(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(X.ie||X.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let O=I$(o,this.decorations,e.changes);O.length&&(r=He.extendWithRanges(r,O));let l=B$(a,this.blockWrappers,e.changes);return l.length&&(r=He.extendWithRanges(r,l)),s&&!r.some(c=>c.fromA<=s.range.fromA&&c.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(t||e.length){let o=this.tile,a=new no(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&te.get(t.text)&&a.cache.reused.set(te.get(t.text),2),this.tile=a.run(e,t),so(o,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=X.chrome||X.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let n=[];if(this.view.viewport.from||this.view.viewport.to-1)&&er(r,this.view.observer.selectionRange)&&!(n&&r.contains(n));if(!(s||t||o))return;let a=this.forceSelection;this.forceSelection=!1;let O=this.view.state.selection.main,l,c;if(O.empty?c=l=this.inlineDOMNearPos(O.anchor,O.assoc||1):(c=this.inlineDOMNearPos(O.head,O.head==O.from?1:-1),l=this.inlineDOMNearPos(O.anchor,O.anchor==O.from?1:-1)),X.gecko&&O.empty&&!this.hasComposition&&E$(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new lt(f,0),a=!0}let h=this.view.observer.selectionRange;(a||!h.focusNode||(!tr(l.node,l.offset,h.anchorNode,h.anchorOffset)||!tr(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,O))&&(this.view.observer.ignore(()=>{X.android&&X.chrome&&r.contains(h.focusNode)&&D$(h.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let f=cr(this.view.root);if(f)if(O.empty){if(X.gecko){let d=G$(l.node,l.offset);if(d&&d!=3){let $=(d==1?ic:rc)(l.node,l.offset);$&&(l=new lt($.node,$.offset))}}f.collapse(l.node,l.offset),O.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=O.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();O.anchor>O.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==r&&(r.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new lt(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new lt(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&tr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=cr(e.root),{anchorNode:n,anchorOffset:s}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let o=this.lineAt(t.head,t.assoc);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 c=this.domAtPos(t.head+t.assoc,t.assoc);r.collapse(c.node,c.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&r.collapse(n,s)}posFromDOM(e,t){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let n=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[t];else{let o=Pt(e)==0?0:t==0?-1:1;for(;;){let a=e.parentNode;if(a==r.dom)break;o==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?o=-1:o=1),e=a}o<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return n;for(;s&&!te.get(s);)s=s.nextSibling;if(!s)return n+r.length;for(let o=0,a=n;;o++){let O=r.children[o];if(O.dom==s)return a;a+=O.length+O.breakAfter}}else return r.isText()?e==r.dom?n+t:n+(t?r.length:0):n}domAtPos(e,t){let{tile:r,offset:n}=this.tile.resolveBlock(e,t);return r.isWidget()?r.domPosFor(e,t):r.domIn(n,t)}inlineDOMNearPos(e,t){let r,n=-1,s=!1,o,a=-1,O=!1;return this.tile.blockTiles((l,c)=>{if(l.isWidget()){if(l.flags&32&&c>=e)return!0;l.flags&16&&(s=!0)}else{let h=c+l.length;if(c<=e&&(r=l,n=e-c,s=h=e&&!o&&(o=l,a=e-c,O=c>e),c>e&&o)return!0}}),!r&&!o?this.domAtPos(e,t):(s&&o?r=null:O&&r&&(o=null),r&&t<0||!o?r.domIn(n,t):o.domIn(a,t))}coordsAt(e,t){let{tile:r,offset:n}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof nr?null:r.coordsInWidget(n,t,!0):r.coordsIn(n,t)}lineAt(e,t){let{tile:r}=this.tile.resolveBlock(e,t);return r.isLine()?r:null}coordsForChar(e){let{tile:t,offset:r}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function n(s,o){if(s.isComposite())for(let a of s.children){if(a.length>=o){let O=n(a,o);if(O)return O}if(o-=a.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,O=this.view.textDirection==H.LTR,l=0,c=(h,f,d)=>{for(let $=0;$n);$++){let p=h.children[$],m=f+p.length,g=p.dom.getBoundingClientRect(),{height:S}=g;if(d&&!$&&(l+=g.top-d.top),p instanceof Qt)m>r&&c(p,f,g);else if(f>=r&&(l>0&&t.push(-l),t.push(S+l),l=0,o)){let T=p.dom.lastChild,z=T?an(T):[];if(z.length){let y=z[z.length-1],x=O?y.right-g.left:g.right-y.left;x>a&&(a=x,this.minWidth=s,this.minWidthFrom=f,this.minWidthTo=m)}}d&&$==h.children.length-1&&(l+=d.bottom-g.bottom),f=m+p.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?H.RTL:H.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let a=0,O;for(let l of o.children){if(!l.isText()||/[^ -~]/.test(l.text))return;let c=an(l.dom);if(c.length!=1)return;a+=c[0].width,O=c[0].height}if(a)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:a/o.length,textHeight:O}}});if(e)return e;let t=document.createElement("div"),r,n,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let o=an(t.firstChild)[0];r=t.getBoundingClientRect().height,n=o&&o.width?o.width/27:7,s=o&&o.height?o.height:r,t.remove()}),{lineHeight:r,charWidth:n,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,n=0;;n++){let s=n==t.viewports.length?null:t.viewports[n],o=s?s.from-1:this.view.state.doc.length;if(o>r){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(E.replace({widget:new nr(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return E.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Xn).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,n=this.view.state.facet(Uo).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(n.length&&(this.dynamicDecorationMap[e++]=r,t.push(j.join(n))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let l=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=l.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let l of this.view.state.facet(mc))try{if(l(this.view,e.range,e))return!0}catch(c){Ie(this.view.state,c,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),n;if(!r)return;!t.empty&&(n=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,n.left),top:Math.min(r.top,n.top),right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)});let s=bc(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:O}=this.view.scrollDOM;if(b$(this.view.scrollDOM,o,t.head1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottomr.isWidget()||r.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){so(this.tile)}};function so(i,e){let t=e?.get(i);if(t!=1){t==null&&i.destroy();for(let r of i.children)so(r,e)}}function E$(i){return i.node.nodeType==1&&i.node.firstChild&&(i.offset==0||i.node.childNodes[i.offset-1].contentEditable=="false")&&(i.offset==i.node.childNodes.length||i.node.childNodes[i.offset].contentEditable=="false")}function wc(i,e){let t=i.observer.selectionRange;if(!t.focusNode)return null;let r=ic(t.focusNode,t.focusOffset),n=rc(t.focusNode,t.focusOffset),s=r||n;if(n&&r&&n.node!=r.node){let a=te.get(n.node);if(!a||a.isText()&&a.text!=n.node.nodeValue)s=n;else if(i.docView.lastCompositionAfterCursor){let O=te.get(r.node);!O||O.isText()&&O.text!=r.node.nodeValue||(s=n)}}if(i.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function L$(i,e,t){let r=wc(i,t);if(!r)return null;let{node:n,from:s,to:o}=r,a=n.nodeValue;if(/[\n\r]/.test(a)||i.state.doc.sliceString(r.from,r.to)!=a)return null;let O=e.invertedDesc;return{range:new He(O.mapPos(s),O.mapPos(o),s,o),text:n}}function G$(i,e){return i.nodeType!=1?0:(e&&i.childNodes[e-1].contentEditable=="false"?1:0)|(e{re.from&&(t=!0)}),t}var nr=class extends St{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}};function F$(i,e,t=1){let r=i.charCategorizer(e),n=i.doc.lineAt(e),s=e-n.from;if(n.length==0)return Q.cursor(e);s==0?t=1:s==n.length&&(t=-1);let o=s,a=s;t<0?o=ae(n.text,s,!1):a=ae(n.text,s);let O=r(n.text.slice(o,a));for(;o>0;){let l=ae(n.text,o,!1);if(r(n.text.slice(l,o))!=O)break;o=l}for(;ai.defaultLineHeight*1.5){let a=i.viewState.heightOracle.textHeight,O=Math.floor((n-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+Hr(o,s,i.state.tabSize)}function ao(i,e,t){let r=i.lineBlockAt(e);if(Array.isArray(r.type)){let n;for(let s of r.type){if(s.from>e)break;if(!(s.toe)return s;(!n||s.type==ce.Text&&(n.type!=s.type||(t<0?s.frome)))&&(n=s)}}return n||r}return r}function K$(i,e,t,r){let n=ao(i,e.head,e.assoc||-1),s=!r||n.type!=ce.Text||!(i.lineWrapping||n.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),a=i.textDirectionAt(n.from),O=i.posAtCoords({x:t==(a==H.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(O!=null)return Q.cursor(O,t?-1:1)}return Q.cursor(t?n.to:n.from,t?-1:1)}function kl(i,e,t,r){let n=i.state.doc.lineAt(e.head),s=i.bidiSpans(n),o=i.textDirectionAt(n.from);for(let a=e,O=null;;){let l=z$(n,s,o,a,t),c=Oc;if(!l){if(n.number==(t?i.state.doc.lines:1))return a;c=` +`,n=i.state.doc.line(n.number+(t?1:-1)),s=i.bidiSpans(n),l=i.visualLineSide(n,!t)}if(O){if(!O(c))return a}else{if(!r)return l;O=r(c)}a=l}}function J$(i,e,t){let r=i.state.charCategorizer(e),n=r(t);return s=>{let o=r(s);return n==Ue.Space&&(n=o),n==o}}function ep(i,e,t,r){let n=e.head,s=t?1:-1;if(n==(t?i.state.doc.length:0))return Q.cursor(n,e.assoc);let o=e.goalColumn,a,O=i.contentDOM.getBoundingClientRect(),l=i.coordsAtPos(n,(e.empty?e.assoc:0)||(t?1:-1)),c=i.documentTop;if(l)o==null&&(o=l.left-O.left),a=s<0?l.top:l.bottom;else{let $=i.viewState.lineBlockAt(n);o==null&&(o=Math.min(O.right-O.left,i.defaultCharacterWidth*(n-$.from))),a=(s<0?$.top:$.bottom)+c}let h=O.left+o,f=r??i.viewState.heightOracle.textHeight>>1,d=Oo(i,{x:h,y:a+f*s},!1,s);return Q.cursor(d.pos,d.assoc,void 0,o)}function sr(i,e,t){for(;;){let r=0;for(let n of i)n.between(e-1,e+1,(s,o,a)=>{if(e>s&&en(i)),t.from,e.head>t.from?-1:1);return r==t.from?t:Q.cursor(r,ri.viewState.docHeight)return new Ge(i.state.doc.length,-1);if(l=i.elementAtHeight(O),r==null)break;if(l.type==ce.Text){if(r<0?l.toi.viewport.to)break;let f=i.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(f&&(r<0?f.top<=O+s:f.bottom>=O+s))break}let h=i.viewState.heightOracle.textHeight/2;O=r>0?l.bottom+h:l.top-h}if(i.viewport.from>=l.to||i.viewport.to<=l.from){if(t)return null;if(l.type==ce.Text){let h=H$(i,n,l,o,a);return new Ge(h,h==l.from?1:-1)}}if(l.type!=ce.Text)return O<(l.top+l.bottom)/2?new Ge(l.from,1):new Ge(l.to,-1);let c=i.docView.lineAt(l.from,2);return(!c||c.length!=l.length)&&(c=i.docView.lineAt(l.from,-2)),new lo(i,o,a,i.textDirectionAt(l.from)).scanTile(c,l.from)}var lo=class{constructor(e,t,r,n){this.view=e,this.x=t,this.y=r,this.baseDir=n,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||r.length&&(r[0].level!=this.baseDir||r[0].to+n.from>1;t:if(s.has($)){let m=r+Math.floor(Math.random()*d);for(let g=0;gthis.y)(!O||O.top>g.top)&&(O=g),S=-1;else{let T=g.left>this.x?this.x-g.left:g.right(h.left+h.right)/2==f}}scanText(e,t){let r=[];for(let s=0;s{let o=r[s]-t,a=r[s+1]-t;return hr(e.dom,o,a).getClientRects()});return n.after?new Ge(r[n.i+1],-1):new Ge(r[n.i],1)}scanTile(e,t){if(!e.length)return new Ge(t,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,t);if(a.isComposite())return this.scanTile(a,t)}let r=[t];for(let a=0,O=t;a{let O=e.children[a];return O.flags&48?null:(O.dom.nodeType==1?O.dom:hr(O.dom,0,O.length)).getClientRects()}),s=e.children[n.i],o=r[n.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):n.after?new Ge(r[n.i+1],-1):new Ge(o,1)}},Ti="\uFFFF",co=class{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(D.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ti}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let n=e;;){this.findPointBefore(r,n);let s=this.text.length;this.readNode(n);let o=te.get(n),a=n.nextSibling;if(a==t){o?.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let O=te.get(a);(o&&O?o.breakAfter:(o?o.breakAfter:dn(n))||dn(a)&&(n.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!ip(a,t)&&this.lineBreak(),n=a}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=n.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(r,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);r=s+o}}readNode(e){let t=te.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let n=r.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(tp(e,r.node,r.offset)?t:0))}};function tp(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=kc(e.docView.tile,t,r,0))){let a=s||o?[]:np(e),O=new co(a,e);O.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=O.text,this.newSel=sp(a,this.bounds.from)}else{let a=e.observer.selectionRange,O=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Bs(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||!Bs(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((X.ios||X.chrome)&&e.state.selection.main.empty&&O!=l&&(c.from>0||c.to-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Q.range(l,O)):this.newSel=Q.single(l,O)}}};function kc(i,e,t,r){if(i.isComposite()){let n=-1,s=-1,o=-1,a=-1;for(let O=0,l=r,c=r;Ot)return kc(h,e,t,l);if(f>=e&&n==-1&&(n=O,s=l),l>t&&h.dom.parentNode==i.dom){o=O,a=c;break}c=f,l=f+h.breakAfter}return{from:s,to:a<0?r+i.length:a,startDOM:(n?i.children[n-1].dom.nextSibling:null)||i.dom.firstChild,endDOM:o=0?i.children[o].dom:null}}else return i.isText()?{from:r,to:r+i.length,startDOM:i.dom,endDOM:i.dom.nextSibling}:null}function Xc(i,e){let t,{newSel:r}=e,{state:n}=i,s=n.selection.main,o=i.inputState.lastKeyTime>Date.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:O}=e.bounds,l=s.from,c=null;(o===8||X.android&&e.text.length=a&&s.to<=O&&(e.typeOver||h!=e.text)&&h.slice(0,s.from-a)==e.text.slice(0,s.from-a)&&h.slice(s.to-a)==e.text.slice(f=e.text.length-(h.length-(s.to-a)))?t={from:s.from,to:s.to,insert:q.of(e.text.slice(s.from-a,f).split(Ti))}:(d=vc(h,e.text,l-a,c))&&(X.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Ti+Ti&&d.toB--,t={from:a+d.from,to:a+d.toA,insert:q.of(e.text.slice(d.from,d.toB).split(Ti))})}else r&&(!i.hasFocus&&n.facet(gt)||Sn(r,s))&&(r=null);if(!t&&!r)return!1;if((X.mac||X.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=Q.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:q.of([t.insert.toString().replace("."," ")])}):n.doc.lineAt(s.from).toDate.now()-50?t={from:s.from,to:s.to,insert:n.toText(i.inputState.insertingText)}:X.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&i.lineWrapping&&(r&&(r=Q.single(r.main.anchor-1,r.main.head-1)),t={from:s.from,to:s.to,insert:q.of([" "])}),t)return Mo(i,t,r,o);if(r&&!Sn(r,s)){let a=!1,O="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(a=!0),O=i.inputState.lastSelectionOrigin,O=="select.pointer"&&(r=xc(n.facet(dr).map(l=>l(i)),r))),i.dispatch({selection:r,scrollIntoView:a,userEvent:O}),!0}else return!1}function Mo(i,e,t,r=-1){if(X.ios&&i.inputState.flushIOSKey(e))return!0;let n=i.state.selection.main;if(X.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&i.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ki(i.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||r==8&&e.insert.lengthn.head)&&ki(i.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&ki(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=rp(i,e,t));return i.state.facet(uc).some(O=>O(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function rp(i,e,t){let r,n=i.state,s=n.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let O=e.fromh(i)),l,O);e.from==c&&(o=c)}if(o>-1)r={changes:e,selection:Q.cursor(e.from+e.insert.length,-1)};else 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 O=s.frome.to?n.sliceDoc(e.to,s.to):"";r=n.replaceSelection(i.state.toText(O+e.insert.sliceString(0,void 0,i.state.lineBreak)+l))}else{let O=n.changes(e),l=t&&t.main.to<=O.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),h,f=t&&wc(i,t.main.head);if(f){let $=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-$}}else h=i.state.doc.lineAt(s.head);let d=s.to-e.to;r=n.changeByRange($=>{if($.from==s.from&&$.to==s.to)return{changes:O,range:l||$.map(O)};let p=$.to-d,m=p-c.length;if(i.state.sliceDoc(m,p)!=c||p>=h.from&&m<=h.to)return{range:$};let g=n.changes({from:m,to:p,insert:e.insert}),S=$.to-s.to;return{changes:g,range:l?Q.range(Math.max(0,l.anchor+S),Math.max(0,l.head+S)):$.map(g)}})}else r={changes:O,selection:l&&n.selection.replaceRange(l)}}let a="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,a+=".compose",i.inputState.compositionFirstChange&&(a+=".start",i.inputState.compositionFirstChange=!1)),n.update(r,{userEvent:a,scrollIntoView:!0})}function vc(i,e,t,r){let n=Math.min(i.length,e.length),s=0;for(;s0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="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 np(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:n,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new Qn(t,r)),(n!=t||s!=r)&&e.push(new Qn(n,s))),e}function sp(i,e){if(i.length==0)return null;let t=i[0].pos,r=i.length==2?i[1].pos:t;return t>-1&&r>-1?Q.single(t+e,r+e):null}function Sn(i,e){return e.head==i.main.head&&e.anchor==i.main.anchor}var fo=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.lastWheelEvent=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.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,X.safari&&e.contentDOM.addEventListener("input",()=>null),X.gecko&&Qp(e.contentDOM.ownerDocument)}handleEvent(e){!fp(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 r=this.handlers[e];if(r){for(let n of r.observers)n(this.view,t);for(let n of r.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=op(e),r=this.handlers,n=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(n.removeEventListener(s,this.handleEvent),a=null),a||n.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!t[s]&&n.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&&Zc.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),X.android&&X.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return X.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Rc.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||ap.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:X.safari&&!X.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!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 Xl(i,e){return(t,r)=>{try{return e.call(i,r,t)}catch(n){Ie(t.state,n)}}}function op(i){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of i){let n=r.spec,s=n&&n.plugin.domEventHandlers,o=n&&n.plugin.domEventObservers;if(s)for(let a in s){let O=s[a];O&&t(a).handlers.push(Xl(r.value,O))}if(o)for(let a in o){let O=o[a];O&&t(a).observers.push(Xl(r.value,O))}}for(let r in Ke)t(r).handlers.push(Ke[r]);for(let r in ke)t(r).observers.push(ke[r]);return e}var Rc=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ap="dthko",Zc=[16,17,18,20,91,92,224,225],en=6;function tn(i){return Math.max(0,i)*.7+8}function Op(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var uo=class{constructor(e,t,r,n){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Jl(e.contentDOM),this.atoms=e.state.facet(dr).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)&&lp(e,t),this.dragging=hp(e,t)&&_c(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&&Op(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,n=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let O=bc(this.view);e.clientX-O.left<=n+en?t=-tn(n-e.clientX):e.clientX+O.right>=o-en&&(t=tn(e.clientX-o)),e.clientY-O.top<=s+en?r=-tn(s-e.clientY):e.clientY+O.bottom>=a-en&&(r=tn(e.clientY-a)),this.setScrollSpeed(t,r)}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)}select(e){let{view:t}=this,r=xc(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function lp(i,e){let t=i.state.facet(lc);return t.length?t[0](e):X.mac?e.metaKey:e.ctrlKey}function cp(i,e){let t=i.state.facet(cc);return t.length?t[0](e):X.mac?!e.altKey:!e.ctrlKey}function hp(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let r=cr(i.root);if(!r||r.rangeCount==0)return!0;let n=r.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function fp(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=te.get(t))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}var Ke=Object.create(null),ke=Object.create(null),Vc=X.ie&&X.ie_version<15||X.ios&&X.webkit_version<604;function up(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(),zc(i,t.value)},50)}function vn(i,e,t){for(let r of i.facet(e))t=r(t,i);return t}function zc(i,e){e=vn(i.state,qo,e);let{state:t}=i,r,n=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if($o!=null&&t.selection.ranges.every(O=>O.empty)&&$o==s.toString()){let O=-1;r=t.changeByRange(l=>{let c=t.doc.lineAt(l.from);if(c.from==O)return{range:l};O=c.from;let h=t.toText((o?s.line(n++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:h},range:Q.cursor(l.from+h.length)}})}else o?r=t.changeByRange(O=>{let l=s.line(n++);return{changes:{from:O.from,to:O.to,insert:l.text},range:Q.cursor(O.from+l.length)}}):r=t.replaceSelection(s);i.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}ke.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};ke.wheel=ke.mousewheel=i=>{i.inputState.lastWheelEvent=Date.now()};Ke.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);ke.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};ke.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};Ke.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of i.state.facet(hc))if(t=r(i,e),t)break;if(!t&&e.button==0&&(t=$p(i,e)),t){let r=!i.hasFocus;i.inputState.startMouseSelection(new uo(i,e,t,r)),r&&i.observer.ignore(()=>{ec(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let n=i.inputState.mouseSelection;if(n)return n.start(e),n.dragging===!1}else i.inputState.setSelectionOrigin("select.pointer");return!1};function vl(i,e,t,r){if(r==1)return Q.cursor(e,t);if(r==2)return F$(i.state,e,t);{let n=i.docView.lineAt(e,t),s=i.state.doc.lineAt(n?n.posAtEnd:e),o=n?n.posAtStart:s.from,a=n?n.posAtEnd:s.to;return aDate.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(Zl+1)%3:1}function $p(i,e){let t=i.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=_c(e),n=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),n=n.map(s.changes))},get(s,o,a){let O=i.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),l,c=vl(i,O.pos,O.assoc,r);if(t.pos!=O.pos&&!o){let h=vl(i,t.pos,t.assoc,r),f=Math.min(h.from,c.from),d=Math.max(h.to,c.to);c=f1&&(l=pp(n,O.pos))?l:a?n.addRange(c):Q.create([c])}}}function pp(i,e){for(let t=0;t=e)return Q.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}Ke.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let n=i.docView.tile.nearest(e.target);if(n&&n.isWidget()){let s=n.posAtStart,o=s+n.length;(s>=t.to||o<=t.from)&&(t=Q.range(s,o))}}let{inputState:r}=i;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",vn(i.state,Wo,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ke.dragend=i=>(i.inputState.draggedContent=null,!1);function zl(i,e,t,r){if(t=vn(i.state,qo,t),!t)return;let n=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=r&&s&&cp(i,e)?{from:s.from,to:s.to}:null,a={from:n,insert:t},O=i.state.changes(o?[o,a]:a);i.focus(),i.dispatch({changes:O,selection:{anchor:O.mapPos(n,-1),head:O.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}Ke.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),n=0,s=()=>{++n==t.length&&zl(i,e,r.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return zl(i,e,r,!0),!0}return!1};Ke.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=Vc?null:e.clipboardData;return t?(zc(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(up(i),!1)};function mp(i,e){let t=i.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),i.focus()},50)}function gp(i){let e=[],t=[],r=!1;for(let n of i.selection.ranges)n.empty||(e.push(i.sliceDoc(n.from,n.to)),t.push(n));if(!e.length){let n=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>n&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),n=o.number}r=!0}return{text:vn(i,Wo,e.join(i.lineBreak)),ranges:t,linewise:r}}var $o=null;Ke.copy=Ke.cut=(i,e)=>{if(!er(i.contentDOM,i.observer.selectionRange))return!1;let{text:t,ranges:r,linewise:n}=gp(i.state);if(!t&&!n)return!1;$o=n?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=Vc?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(mp(i,t),!1)};var Yc=ye.define();function Cc(i,e){let t=[];for(let r of i.facet(dc)){let n=r(i,e);n&&t.push(n)}return t.length?i.update({effects:t,annotations:Yc.of(!0)}):null}function qc(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=Cc(i.state,e);t?i.dispatch(t):i.update([])}},10)}ke.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),qc(i)};ke.blur=i=>{i.observer.clearSelectionRange(),qc(i)};ke.compositionstart=ke.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};ke.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,X.chrome&&X.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};ke.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};Ke.beforeinput=(i,e)=>{var t,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(i.inputState.insertingText=e.data,i.inputState.insertingTextAt=Date.now()),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 Mo(i,{from:O,to:l,insert:i.state.toText(s)},null),!0}}let n;if(X.chrome&&X.android&&(n=Rc.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.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 X.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),X.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>ke.compositionend(i,e),20),!1};var _l=new Set;function Qp(i){_l.has(i)||(_l.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var Yl=["pre-wrap","normal","pre-line","break-spaces"],Vi=!1;function Cl(){Vi=!1}var po=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 r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Yl.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r-1,O=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=n,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)>On&&(Vi=!0),this.height=e)}replace(e,t,r){return i.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,n){let s=this,o=r.doc;for(let a=n.length-1;a>=0;a--){let{fromA:O,toA:l,fromB:c,toB:h}=n[a],f=s.lineAt(O,J.ByPosNoHeight,r.setDoc(t),0,0),d=f.to>=l?f:s.lineAt(l,J.ByPosNoHeight,r,0,0);for(h+=d.to-l,l=d.to;a>0&&f.from<=n[a-1].toA;)O=n[a-1].fromA,c=n[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),r+=1+a.break,n-=a.size}else if(s>n*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(n=s&&o(this.lineAt(0,J.ByPos,r,n,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,r=!1,n){return n&&n.from<=t&&n.more&&this.setMeasuredHeight(n),this.outdated=!1,this}toString(){return`block(${this.length})`}},Le=class i extends Tn{constructor(e,t,r){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,t){return new Fe(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,r){let n=r[0];return r.length==1&&(n instanceof i||n instanceof Vt&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof Vt?n=new i(n.length,this.height,this.spaceAbove):n.height=this.height,this.outdated||(n.outdated=!1),n):Ve.of(r)}updateHeight(e,t=0,r=!1,n){return n&&n.from<=t&&n.more?this.setMeasuredHeight(n):(r||this.outdated)&&(this.spaceAbove=0,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:""})`}},Vt=class i extends Ve{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,n=e.doc.lineAt(t+this.length).number,s=n-r+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:r,lastLine:n,perLine:o,perChar:a}}blockAt(e,t,r,n){let{firstLine:s,lastLine:o,perLine:a,perChar:O}=this.heightMetrics(t,n);if(t.lineWrapping){let l=n+(e0){let s=r[r.length-1];s instanceof i?r[r.length-1]=new i(s.length+n):r.push(null,new i(n-1))}if(e>0){let s=r[0];s instanceof i?r[0]=new i(e+s.length):r.unshift(new i(e-1),null)}return Ve.of(r)}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,r=!1,n){let s=t+this.length;if(n&&n.from<=t+this.length&&n.more){let o=[],a=Math.max(t,n.from),O=-1;for(n.from>t&&o.push(new i(n.from-t-1).updateHeight(e,t));a<=s&&n.more;){let c=e.doc.lineAt(a).length;o.length&&o.push(null);let h=n.heights[n.index++],f=0;h<0&&(f=-h,h=n.heights[n.index++]),O==-1?O=h:Math.abs(h-O)>=On&&(O=-2);let d=new Le(c,h,f);d.outdated=!1,o.push(d),a+=c+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)>=On||Math.abs(O-this.heightMetrics(e,t).perLine)>=On)&&(Vi=!0),Pn(this,l)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},go=class extends Ve{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,n){let s=r+this.left.height;return ea))return l;let c=t==J.ByPosNoHeight?J.ByPosNoHeight:J.ByPos;return O?l.join(this.right.lineAt(a,c,r,o,a)):this.left.lineAt(a,c,r,n,s).join(l)}forEachLine(e,t,r,n,s,o){let a=n+this.left.height,O=s+this.left.length+this.break;if(this.break)e=O&&this.right.forEachLine(e,t,r,a,O,o);else{let l=this.lineAt(O,J.ByPos,r,n,s);e=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,r,a,O,o)}}replace(e,t,r){let n=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&ql(s,o-1),t=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,n=r+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e2*t.size||t.size>2*e.size?Ve.of(this.break?[e,null,t]:[e,t]):(this.left=Pn(this.left,e),this.right=Pn(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,r=!1,n){let{left:s,right:o}=this,a=t+s.length+this.break,O=null;return n&&n.from<=t+s.length&&n.more?O=s=s.updateHeight(e,t,r,n):s.updateHeight(e,t,r),n&&n.from<=a+o.length&&n.more?O=o=o.updateHeight(e,a,r,n):o.updateHeight(e,a,r),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 ql(i,e){let t,r;i[e]==null&&(t=i[e-1])instanceof Vt&&(r=i[e+1])instanceof Vt&&i.splice(e-1,3,new Vt(t.length+1+r.length))}var Pp=5,Qo=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 r=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Le?n.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Le(r-this.pos,-1,0)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e=Pp)&&this.addLineDeco(n,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 Le(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let r=new Vt(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Le)return e;let t=new Le(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let n=this.ensureLine();n.length+=r,n.collapsed+=r,n.widgetHeight=Math.max(n.widgetHeight,e),n.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Le)&&!this.isCovered?this.nodes.push(new Le(0,-1,0)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&h.overflow!="visible"){let f=c.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?n.innerHeight:O,f.bottom)}l=h.position=="absolute"||h.position=="fixed"?c.offsetParent:c.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 yp(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function wp(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var or=class{constructor(e,t,r,n){this.from=e,this.to=t,this.size=r,this.displaySize=n}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;rtypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new po(r),this.stateDeco=Al(t),this.heightMap=Ve.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle.setDoc(t.doc),[new He(0,0,0,t.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=E.set(this.lineGaps.map(n=>n.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let n=r?t.head:t.anchor;if(!e.some(({from:s,to:o})=>n>=s&&n<=o)){let{from:s,to:o}=this.lineBlockAt(n);e.push(new yi(s,o))}}return this.viewports=e.sort((r,n)=>r.from-n.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Wl:new To(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(Ki(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=Al(this.state);let n=e.changedRanges,s=He.extendWithRanges(n,Tp(r,this.stateDeco,e?e.changes:ge.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Cl(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Vi)&&(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.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(pc)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,r=window.getComputedStyle(t),n=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?H.RTL:H.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",a=t.getBoundingClientRect(),O=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let l=0,c=0;if(a.width&&a.height){let{scaleX:y,scaleY:x}=Kl(t,a);(y>.005&&Math.abs(this.scaleX-y)>.005||x>.005&&Math.abs(this.scaleY-x)>.005)&&(this.scaleX=y,this.scaleY=x,l|=16,o=O=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,l|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(O=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=16);let d=Jl(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let $=this.getScrollOffset();this.scrollOffset!=$&&(this.scrollAnchorHeight=-1,this.scrollOffset=$),this.scrolledToBottom=tc(this.scrollParent||e.win);let p=(this.printing?wp:bp)(t,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let S=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(S!=this.inView&&(this.inView=S,S&&(O=!0)),!this.inView&&!this.scrollTarget&&!yp(e.dom))return 0;let T=a.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,l|=16),O){let y=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(y)&&(o=!0),o||n.lineWrapping&&Math.abs(T-this.contentDOMWidth)>n.charWidth){let{lineHeight:x,charWidth:w,textHeight:M}=e.docView.measureTextSize();o=x>0&&n.refresh(s,x,w,M,Math.max(5,T/w),y),o&&(e.docView.minWidth=0,l|=16)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),Cl();for(let x of this.viewports){let w=x.from==this.viewport.from?y:e.docView.measureVisibleLineHeights(x);this.heightMap=(o?Ve.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle,[new He(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new mo(x.from,w))}Vi&&(l|=2)}let z=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return z&&(l&2&&(l|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),l|=this.updateForViewport()),(l&2||z)&&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 r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,O=new yi(n.lineAt(o-r*1e3,J.ByHeight,s,0,0).from,n.lineAt(a+(1-r)*1e3,J.ByHeight,s,0,0).to);if(t){let{head:l}=t.range;if(lO.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=n.lineAt(l,J.ByPos,s,0,0),f;t.y=="center"?f=(h.top+h.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&l=a+Math.max(10,Math.min(r,250)))&&n>o-2*1e3&&s>1,o=n<<1;if(this.defaultTextDirection!=H.LTR&&!r)return[];let a=[],O=(c,h,f,d)=>{if(h-cc&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-c)g.fromS));if(!m){if(hT.from<=h&&T.to>=h)){let T=t.moveToLineBoundary(Q.cursor(h),!1,!0).head;T>c&&(h=T)}let g=this.gapSize(f,c,h,d),S=r||g<2e6?g:2e6;m=new or(c,h,g,S)}a.push(m)},l=c=>{if(c.length2e6)for(let x of e)x.from>=c.from&&x.fromc.from&&O(c.from,d,c,h),$t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];j.spans(t,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let n=0;if(r.length!=this.visibleRanges.length)n=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ki(this.heightMap.lineAt(e,J.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)||Ki(this.heightMap.lineAt(this.scaler.fromDOM(e),J.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}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 Ki(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}},yi=class{constructor(e,t){this.from=e,this.to=t}};function xp(i,e,t){let r=[],n=i,s=0;return j.spans(t,i,e,{span(){},point(o,a){o>n&&(r.push({from:n,to:o}),s+=o-n),n=a}},20),n=1)return e[e.length-1].to;let r=Math.floor(i*t);for(let n=0;;n++){let{from:s,to:o}=e[n],a=o-s;if(r<=a)return s+r;r-=a}}function nn(i,e){let t=0;for(let{from:r,to:n}of i.ranges){if(e<=n){t+=e-r;break}t+=n-r}return t/i.total}function kp(i,e){for(let t of i)if(e(t))return t}var Wl={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};function Al(i){let e=i.facet(Xn).filter(r=>typeof r!="function"),t=i.facet(Uo).filter(r=>typeof r!="function");return t.length&&e.push(j.join(t)),e}var To=class i{constructor(e,t,r){let n=0,s=0,o=0;this.viewports=r.map(({from:a,to:O})=>{let l=t.lineAt(a,J.ByPos,e,0,0).top,c=t.lineAt(O,J.ByPos,e,0,0).bottom;return n+=c-l,{from:a,to:O,top:l,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(t.height-n);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,r=0,n=0;;t++){let s=tt.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}};function Ki(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),r=e.toDOM(i.bottom);return new Fe(i.from,i.length,t,r-t,Array.isArray(i._content)?i._content.map(n=>Ki(n,e)):i._content)}var sn=v.define({combine:i=>i.join(" ")}),bo=v.define({combine:i=>i.indexOf(!0)>-1}),yo=Ee.newName(),Wc=Ee.newName(),Ac=Ee.newName(),Uc={"&light":"."+Wc,"&dark":"."+Ac};function wo(i,e,t){return new Ee(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,n=>{if(n=="&")return i;if(!t||!t[n])throw new RangeError(`Unsupported selector: ${n}`);return t[n]}):i+" "+r}})}var Xp=wo("."+yo,{"&":{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"}},Uc),vp={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Ms=X.ie&&X.ie_version<=11,xo=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Ds,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(X.ie&&X.ie_version<=11||X.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&X.android&&e.constructor.EDIT_CONTEXT!==!1&&!(X.chrome&&X.chrome_version<126)&&(this.editContext=new ko(e),e.state.facet(gt)&&(e.contentDOM.editContext=this.editContext.editContext)),Ms&&(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,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,n=this.selectionRange;if(r.state.facet(gt)?r.root.activeElement!=this.dom:!er(this.dom,n))return;let s=n.anchorNode&&r.docView.tile.nearest(n.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(X.ie&&X.ie_version<=11||X.android&&X.chrome)&&!r.state.selection.main.empty&&n.focusNode&&tr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=cr(e.root);if(!t)return!1;let r=X.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Rp(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let n=er(this.dom,r);return n&&!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&&ki(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,n=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(n=!0),t==-1?{from:t,to:r}=o:(t=Math.min(o.from,t),r=Math.max(o.to,r)))}return{from:t,to:r,typeOver:n}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),n=this.selectionChanged&&er(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new ho(this.view,e,t,r);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 r=this.view.state,n=Xc(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!Sn(this.view.state.selection,t.newSel.main))&&this.view.update([]),n}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let r=Ul(t,e.previousSibling||e.target.previousSibling,-1),n=Ul(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:n?t.posBefore(n):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,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let n of this.scrollTargets)n.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 Ul(i,e,t){for(;e;){let r=te.get(e);if(r&&r.parent==i)return r;let n=e.parentNode;e=n!=i.dom?n:t>0?e.nextSibling:e.previousSibling}return null}function Ml(i,e){let t=e.startContainer,r=e.startOffset,n=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor,1);return tr(o.node,o.offset,n,s)&&([t,r,n,s]=[n,s,t,r]),{anchorNode:t,anchorOffset:r,focusNode:n,focusOffset:s}}function Rp(i,e){if(e.getComposedRanges){let n=e.getComposedRanges(i.root)[0];if(n)return Ml(i,n)}let t=null;function r(n){n.preventDefault(),n.stopImmediatePropagation(),t=n.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",r,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",r,!0),t?Ml(i,t):null}var ko=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=r=>{let n=e.state.selection.main,{anchor:s,head:o}=n,a=this.toEditorPos(r.updateRangeStart),O=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let l=O-a>r.text.length;a==this.from&&sthis.to&&(O=s);let c=vc(e.state.sliceDoc(a,O),r.text,(l?n.from:n.to)-a,l?"end":null);if(!c){let f=Q.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Sn(f,n)||e.dispatch({selection:f,userEvent:"select"});return}let h={from:c.from+a,to:c.toA+a,insert:q.of(r.text.slice(c.from,c.toB).split(` +`))};if((X.mac||X.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:O,insert:q.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);Mo(e,h,Q.single(this.toEditorPos(r.selectionStart,f),this.toEditorPos(r.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let n=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o{let n=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){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:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let n=cr(r.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,o,a,O,l)=>{if(r)return;let c=l.length-(o-s);if(n&&o>=n.to)if(n.from==s&&n.to==o&&n.insert.eq(l)){n=this.pendingContextChange=null,t+=c,this.to+=c;return}else n=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(sthis.to||this.to-this.from+l.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),l.toString()),this.to+=c}t+=c}),n&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(n=>!n.isUserEvent("input.type")&&n.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,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(r,n)}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 r=this.composing;return r&&r.drifted?r.editorBase+(e-r.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])}},k=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:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(n=>n.forEach(s=>r(s,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||y$(e.parent)||document,this.viewState=new bn(this,e.state||D.create(e)),e.scrollTo&&e.scrollTo.is(Jr)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(bi).map(n=>new rr(n));for(let n of this.plugins)n.update(this);this.observer=new xo(this),this.inputState=new fo(this),this.inputState.ensureHandlers(this.plugins),this.docView=new gn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof re?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,n,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(Yc))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,O=Cc(s,o),O||(a=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(D.phrases)!=this.state.facet(D.phrases))return this.setState(s);n=pn.create(this,s,e),n.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection;h=new ir(d.empty?d:Q.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of f.effects)d.is(Jr)&&(h=d.value.clip(this.state))}this.viewState.update(n,h),this.bidiCache=yn.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),t=this.docView.update(n),this.state.facet(Hi)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(sn)!=n.state.facet(sn)&&(this.viewState.mustMeasureContent=!0),(t||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!n.empty)for(let f of this.state.facet(Ks))try{f(n)}catch(d){Ie(this.state,d,"update listener")}(O||c)&&Promise.resolve().then(()=>{O&&this.state==O.startState&&this.dispatch(O),c&&!Xc(this,c)&&l.force&&ki(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 r of this.plugins)r.destroy(this);this.viewState=new bn(this,e),this.plugins=e.facet(bi).map(r=>new rr(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new gn(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(bi),r=e.state.facet(bi);if(t!=r){let n=[];for(let s of r){let o=t.indexOf(s);if(o<0)n.push(new rr(s));else{let a=this.plugins[o];a.mustUpdate=e,n.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=e;for(let n=0;n-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.viewState.scrollParent,n=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(tc(r||this.win))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(n);s=d.from,o=d.top}this.updateState=1;let O=this.viewState.measure();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 c=l.map(d=>{try{return d.read(this)}catch($){return Ie(this.state,$),El}}),h=pn.create(this,this.state,[]),f=!1;h.flags|=O,t?t.flags|=O:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let d=0;d1||$<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){n=n+$,r?r.scrollTop+=$:this.win.scrollBy(0,$),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Ks))a(t)}get themeClasses(){return yo+" "+(this.state.facet(bo)?Ac:Wc)+" "+this.state.facet(sn)}updateAttrs(){let e=Ll(this,Qc,{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:`${X.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Ll(this,Ao,t);let r=this.observer.ignore(()=>{let n=Pl(this.contentDOM,this.contentAttrs,t),s=Pl(this.dom,this.editorAttrs,e);return n||s});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let n of r.effects)if(n.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(Hi);let e=this.state.facet(i.cspNonce);Ee.mount(this.root,this.styleModules.concat(Xp).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tr.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,r){return Us(this,e,kl(this,e,t,r))}moveByGroup(e,t){return Us(this,e,kl(this,e,t,r=>J$(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),n=this.textDirectionAt(e.from),s=r[t?r.length-1:0];return Q.cursor(s.side(t,n)+e.from,s.forward(!t,n)?1:-1)}moveToLineBoundary(e,t,r=!0){return K$(this,e,t,r)}moveVertically(e,t,r){return Us(this,e,ep(this,e,t,r))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let r=Oo(this,e,t);return r&&r.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Oo(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let n=this.state.doc.lineAt(e),s=this.bidiSpans(n),o=s[je.find(s,e-n.from,-1,t)];return $n(r,o.dir==H.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($c)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Zp)return ac(e.length);let t=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||oc(s.isolates,r=yl(this,e))))return s.order;r||(r=yl(this,e));let n=V$(e.text,t,r);return this.bidiCache.push(new yn(e.from,e.to,t,r,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||X.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ec(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 Jr.of(new ir(typeof e=="number"?Q.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Jr.of(new ir(Q.cursor(r.from),"start","start",r.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 ze.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ze.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=Ee.newName(),n=[sn.of(r),Hi.of(wo(`.${r}`,e))];return t&&t.dark&&n.push(bo.of(!0)),n}static baseTheme(e){return at.lowest(Hi.of(wo("."+yo,e,Uc)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),n=r&&te.get(r)||te.get(e);return((t=n?.root)===null||t===void 0?void 0:t.view)||null}};k.styleModule=Hi;k.inputHandler=uc;k.clipboardInputFilter=qo;k.clipboardOutputFilter=Wo;k.scrollHandler=mc;k.focusChangeEffect=dc;k.perLineTextDirection=$c;k.exceptionSink=fc;k.updateListener=Ks;k.editable=gt;k.mouseSelectionStyle=hc;k.dragMovesSelection=cc;k.clickAddsSelectionRange=lc;k.decorations=Xn;k.blockWrappers=Sc;k.outerDecorations=Uo;k.atomicRanges=dr;k.bidiIsolatedRanges=Pc;k.scrollMargins=Tc;k.darkTheme=bo;k.cspNonce=v.define({combine:i=>i.length?i[0]:""});k.contentAttributes=Ao;k.editorAttributes=Qc;k.lineWrapping=k.contentAttributes.of({class:"cm-lineWrapping"});k.announce=B.define();var Zp=4096,El={},yn=class i{constructor(e,t,r,n,s,o){this.from=e,this.to=t,this.dir=r,this.isolates=n,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let r=[],n=e.length?e[e.length-1].dir:H.LTR;for(let s=Math.max(0,e.length-10);s=0;n--){let s=r[n],o=typeof s=="function"?s(i):s;o&&_o(o,t)}return t}var Vp=X.mac?"mac":X.windows?"win":X.linux?"linux":"key";function zp(i,e){let t=i.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,s,o,a;for(let O=0;Or.concat(n),[]))),t}var Zt=null,Cp=4e3;function qp(i,e=Vp){let t=Object.create(null),r=Object.create(null),n=(o,a)=>{let O=r[o];if(O==null)r[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,c)=>{var h,f;let d=t[o]||(t[o]=Object.create(null)),$=a.split(/ (?!$)/).map(g=>zp(g,e));for(let g=1;g<$.length;g++){let S=$.slice(0,g).join(" ");n(S,!0),d[S]||(d[S]={preventDefault:!0,stopPropagation:!1,run:[T=>{let z=Zt={view:T,prefix:S,scope:o};return setTimeout(()=>{Zt==z&&(Zt=null)},Cp),!0}]})}let p=$.join(" ");n(p,!1);let m=d[p]||(d[p]={preventDefault:!1,stopPropagation:!1,run:((f=(h=d._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});O&&m.run.push(O),l&&(m.preventDefault=!0),c&&(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 c=t[l]||(t[l]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in c)c[f].run.push(d=>h(d,Xo))}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 Xo=null;function Wp(i,e,t,r){Xo=e;let n=ml(e),s=Rs(n,0),o=Zs(s)==n.length&&n!=" ",a="",O=!1,l=!1,c=!1;Zt&&Zt.view==t&&Zt.scope==r&&(a=Zt.prefix+" ",Zc.indexOf(e.keyCode)<0&&(l=!0,Zt=null));let h=new Set,f=m=>{if(m){for(let g of m.run)if(!h.has(g)&&(h.add(g),g(t)))return m.stopPropagation&&(c=!0),!0;m.preventDefault&&(m.stopPropagation&&(c=!0),l=!0)}return!1},d=i[r],$,p;return d&&(f(d[a+on(n,e,!o)])?O=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(X.windows&&e.ctrlKey&&e.altKey)&&!(X.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&($=mt[e.keyCode])&&$!=n?(f(d[a+on($,e,!0)])||e.shiftKey&&(p=Pi[e.keyCode])!=n&&p!=$&&f(d[a+on(p,e,!1)]))&&(O=!0):o&&e.shiftKey&&f(d[a+on(n,e,!0)])&&(O=!0),!O&&f(d._any)&&(O=!0)),l&&(O=!0),O&&c&&e.stopPropagation(),Xo=null,O}var fr=class i{constructor(e,t,r,n,s){this.className=e,this.left=t,this.top=r,this.width=n,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,r){if(r.empty){let n=e.coordsAtPos(r.head,r.assoc||1);if(!n)return[];let s=Mc(e);return[new i(t,n.left-s.left,n.top-s.top,null,n.bottom-n.top)]}else return Ap(e,t,r)}};function Mc(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==H.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function jl(i,e,t,r){let n=i.coordsAtPos(e,t*2);if(!n)return r;let s=i.dom.getBoundingClientRect(),o=(n.top+n.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?r:{from:Math.max(r.from,Math.min(a,O)),to:Math.min(r.to,Math.max(a,O))}}function Ap(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let r=Math.max(t.from,i.viewport.from),n=Math.min(t.to,i.viewport.to),s=i.textDirection==H.LTR,o=i.contentDOM,a=o.getBoundingClientRect(),O=Mc(i),l=o.querySelector(".cm-line"),c=l&&window.getComputedStyle(l),h=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),f=a.right-(c?parseInt(c.paddingRight):0),d=ao(i,r,1),$=ao(i,n,-1),p=d.type==ce.Text?d:null,m=$.type==ce.Text?$:null;if(p&&(i.lineWrapping||d.widgetLineBreaks)&&(p=jl(i,r,1,p)),m&&(i.lineWrapping||$.widgetLineBreaks)&&(m=jl(i,n,-1,m)),p&&m&&p.from==m.from&&p.to==m.to)return S(T(t.from,t.to,p));{let y=p?T(t.from,null,p):z(d,!1),x=m?T(null,t.to,m):z($,!0),w=[];return(p||d).to<(m||$).from-(p&&m?1:0)||d.widgetLineBreaks>1&&y.bottom+i.defaultLineHeight/2_&&L.from=me)break;We>K&&C(Math.max(Oe,K),y==null&&Oe<=_,Math.min(We,me),x==null&&We>=I,st.dir)}if(K=Re.to+1,K>=me)break}return N.length==0&&C(_,y==null,I,x==null,i.textDirection),{top:M,bottom:W,horizontal:N}}function z(y,x){let w=a.top+(x?y.top:y.bottom);return{top:w,bottom:w,horizontal:[]}}}function Up(i,e){return i.constructor==e.constructor&&i.eq(e)}var vo=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(ln)!=e.state.facet(ln)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(ln);for(;t!Up(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let n of e)n.update&&t&&n.constructor&&this.drawn[r].constructor&&n.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(n.draw(),t);for(;t;){let n=t.nextSibling;t.remove(),t=n}this.drawn=e,X.safari&&X.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},ln=v.define();function Ec(i){return[ze.define(e=>new vo(e,i)),ln.of(i)]}var ur=v.define({combine(i){return Rt(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Lc(i={}){return[ur.of(i),Mp,Ep,Lp,pc.of(!0)]}function Gc(i){return i.startState.facet(ur)!=i.state.facet(ur)}var Mp=Ec({above:!0,markers(i){let{state:e}=i,t=e.facet(ur),r=[];for(let n of e.selection.ranges){let s=n==e.selection.main;if(n.empty||t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=n.empty?n:Q.cursor(n.head,n.head>n.anchor?-1:1);for(let O of fr.forRange(i,o,a))r.push(O)}}return r},update(i,e){i.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Gc(i);return t&&Il(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){Il(e.state,i)},class:"cm-cursorLayer"});function Il(i,e){e.style.animationDuration=i.facet(ur).cursorBlinkRate+"ms"}var Ep=Ec({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:fr.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||Gc(i)},class:"cm-selectionLayer"}),Lp=at.highest(k.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"}}}})),jc=B.define({map(i,e){return i==null?null:e.mapPos(i)}}),Ji=be.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,r)=>r.is(jc)?r.value:t,i)}}),Gp=ze.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(Ji);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(Ji)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Ji),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let r=i.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-r.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(Ji)!=i&&this.view.dispatch({effects:jc.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 Ic(){return[Ji,Gp]}var mT=/x/.unicode!=null?"gu":"g";function Eo(){return Ip}var jp=E.line({class:"cm-activeLine"}),Ip=ze.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 r of i.state.selection.ranges){let n=i.lineBlockAt(r.head);n.from>e&&(t.push(jp.range(n.from)),e=n.from)}return E.set(t)}},{decorations:i=>i.decorations});var Ro=2e3;function Bp(i,e,t){let r=Math.min(e.line,t.line),n=Math.max(e.line,t.line),s=[];if(e.off>Ro||t.off>Ro||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let O=r;O<=n;O++){let l=i.doc.line(O);l.length<=a&&s.push(Q.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=r;O<=n;O++){let l=i.doc.line(O),c=Hr(l.text,o,i.tabSize,!0);if(c<0)s.push(Q.cursor(l.to));else{let h=Hr(l.text,a,i.tabSize);s.push(Q.range(l.from+c,l.from+h))}}}return s}function Dp(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function Bl(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),r=i.state.doc.lineAt(t),n=t-r.from,s=n>Ro?-1:n==r.length?Dp(i,e.clientX):we(r.text,i.state.tabSize,t-r.from);return{line:r.number,col:s,off:n}}function Np(i,e){let t=Bl(i,e),r=i.state.selection;return t?{update(n){if(n.docChanged){let s=n.changes.mapPos(n.startState.doc.line(t.line).from),o=n.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},r=r.map(n.changes)}},get(n,s,o){let a=Bl(i,n);if(!a)return r;let O=Bp(i.state,t,a);return O.length?o?Q.create(O.concat(r.ranges)):Q.create(O):r}}:null}function Bc(i){let e=i?.eventFilter||(t=>t.altKey&&t.button==0);return k.mouseSelectionStyle.of((t,r)=>e(r)?Np(t,r):null)}var Je=class extends Me{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Je.prototype.elementClass="";Je.prototype.toDOM=void 0;Je.prototype.mapMode=le.TrackBefore;Je.prototype.startSide=Je.prototype.endSide=-1;Je.prototype.point=!0;var cn=v.define(),Fp=v.define();var hn=v.define();var Zo=v.define({combine:i=>i.some(e=>e)});function Hp(i){let e=[Kp];return i&&i.fixed===!1&&e.push(Zo.of(!0)),e}var Kp=ze.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(hn).map(e=>new wn(i,e)),this.fixed=!i.state.facet(Zo);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,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(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(Zo)!=!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=j.iter(this.view.state.facet(cn),this.view.viewport.from),r=[],n=this.gutters.map(s=>new zo(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==ce.Text&&o){Vo(t,r,a.from);for(let O of n)O.line(this.view,a,r);o=!1}else if(a.widget)for(let O of n)O.widget(this.view,a)}else if(s.type==ce.Text){Vo(t,r,s.from);for(let o of n)o.line(this.view,s,r)}else if(s.widget)for(let o of n)o.widget(this.view,s);for(let s of n)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(hn),t=i.state.facet(hn),r=i.docChanged||i.heightChanged||i.viewportChanged||!j.eq(i.startState.facet(cn),i.state.facet(cn),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let n of this.gutters)n.update(i)&&(r=!0);else{r=!0;let n=[];for(let s of t){let o=e.indexOf(s);o<0?n.push(new wn(this.view,s)):(this.gutters[o].update(i),n.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),n.indexOf(s)<0&&s.destroy();for(let s of n)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=n}return r}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:i=>k.scrollMargins.of(e=>{let t=e.plugin(i);if(!t||t.gutters.length==0||!t.fixed)return null;let r=t.dom.offsetWidth*e.scaleX,n=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==H.LTR?{left:r,right:n}:{right:r,left:n}})});function Dl(i){return Array.isArray(i)?i:[i]}function Vo(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var zo=class{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=j.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:n}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==n.elements.length){let a=new xn(e,o,s,r);n.elements.push(a),n.dom.appendChild(a.dom)}else n.elements[this.i].update(e,o,s,r);this.height=t.bottom,this.i++}line(e,t,r){let n=[];Vo(this.cursor,n,t.from),r.length&&(n=n.concat(r));let s=this.gutter.config.lineMarker(e,t,n);s&&n.unshift(s);let o=this.gutter;n.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,n)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),n=r?[r]:null;for(let s of e.state.facet(Fp)){let o=s(e,t.widget,t);o&&(n||(n=[])).push(o)}n&&this.addElement(e,t,n)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},wn=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 r in t.domEventHandlers)this.dom.addEventListener(r,n=>{let s=n.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=n.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[r](e,a,n)&&n.preventDefault()});this.markers=Dl(t.markers(e)),t.initialSpacer&&(this.spacer=new xn(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=Dl(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}let r=e.view.viewport;return!j.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},xn=class{constructor(e,t,r,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,n)}update(e,t,r,n){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),Jp(this.markers,n)||this.setMarkers(e,n)}setMarkers(e,t){let r="cm-gutterElement",n=this.dom.firstChild;for(let s=0,o=0;;){let a=o,O=ss(a,O,l)||o(a,O,l):o}return r}})}}),ar=class extends Je{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Es(i,e){return i.state.facet(wi).formatNumber(e,i.state)}var im=hn.compute([wi],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(em)},lineMarker(e,t,r){return r.some(n=>n.toDOM)?null:new ar(Es(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let n of e.state.facet(tm)){let s=n(e,t,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(wi)!=e.state.facet(wi),initialSpacer(e){return new ar(Es(e,Nl(e.state.doc.lines)))},updateSpacer(e,t){let r=Es(t.view,Nl(t.view.state.doc.lines));return r==e.number?e:new ar(r)},domEventHandlers:i.facet(wi).domEventHandlers,side:"before"}));function Dc(i={}){return[wi.of(i),Hp(),im]}function Nl(i){let e=9;for(;e{let e=[],t=-1;for(let r of i.selection.ranges){let n=i.doc.lineAt(r.head).from;n>t&&(t=n,e.push(rm.range(n)))}return j.of(e)});function Lo(){return nm}async function Nc(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 sm=0,Xe=class{constructor(e,t){this.from=e,this.to=t}},V=class{constructor(e={}){this.id=sm++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}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 r=e(t);return r===void 0?null:[this,r]}}};V.closedBy=new V({deserialize:i=>i.split(" ")});V.openedBy=new V({deserialize:i=>i.split(" ")});V.group=new V({deserialize:i=>i.split(" ")});V.isolate=new V({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});V.contextHash=new V({perNode:!0});V.lookAhead=new V({perNode:!0});V.mounted=new V({perNode:!0});var Yt=class{constructor(e,t,r,n=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=n}static get(e){return e&&e.props&&e.props[V.mounted.id]}},om=Object.create(null),ie=class i{constructor(e,t,r,n=0){this.name=e,this.props=t,this.id=r,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):om,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new i(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(n)),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 n}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(V.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let n of r.split(" "))t[n]=e[r];return r=>{for(let n=r.prop(V.group),s=-1;s<(n?n.length:0);s++){let o=t[s<0?r.name:n[s]];if(o)return o}}}};ie.none=new ie("",Object.create(null),0,8);var Tt=class i{constructor(e){this.types=e;for(let t=0;t0;for(let O=this.cursor(o|A.IncludeAnonymous);;){let l=!1;if(O.from<=s&&O.to>=n&&(!a&&O.type.isAnonymous||t(O)!==!1)){if(O.firstChild())continue;l=!0}for(;l&&r&&(a||!O.type.isAnonymous)&&r(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:ea(ie.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,n)=>new i(this.type,t,r,n,this.propValues),e.makeTree||((t,r,n)=>new i(ie.none,t,r,n)))}static build(e){return Om(e)}};Y.empty=new Y(ie.none,[],[],0);var Go=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)}},Ct=class i{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return ie.none}toString(){let e=[];for(let t=0;t0));O=o[O+3]);return a}slice(e,t,r){let n=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,O=0;a=e&&te;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function $r(i,e,t,r){for(var n;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 c=a[e],h=O[e]+o.from,f;if(!(!(s&A.EnterBracketed&&c instanceof Y&&(f=Yt.get(c))&&!f.overlay&&f.bracketed&&r>=h&&r<=h+c.length)&&!rh(n,r,h,h+c.length))){if(c instanceof Ct){if(s&A.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,r-h,n);if(d>-1)return new si(new Io(o,c,e,h),null,d)}else if(s&A.IncludeAnonymous||!c.type.isAnonymous||Jo(c)){let d;if(!(s&A.IgnoreMounts)&&(d=Yt.get(c))&&!d.overlay)return new i(d.tree,h,e,o);let $=new i(c,h,e,o);return s&A.IncludeAnonymous||!$.type.isAnonymous?$:$.nextChild(t<0?c.children.length-1:0,t,r,n,s)}}}if(s&A.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)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let n;if(!(r&A.IgnoreOverlays)&&(n=Yt.get(this._tree))&&n.overlay){let s=e-this.from,o=r&A.EnterBracketed&&n.bracketed;for(let{from:a,to:O}of n.overlay)if((t>0||o?a<=s:a=s:O>s))return new i(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Hc(i,e,t,r){let n=i.cursor(),s=[];if(!n.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=n.type.is(t),!n.nextSibling())return s}for(;;){if(r!=null&&n.type.is(r))return s;if(n.type.is(e)&&s.push(n.node),!n.nextSibling())return r==null?s:[]}}function jo(i,e,t=e.length-1){for(let r=i;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}var Io=class{constructor(e,t,r,n){this.parent=e,this.buffer=t,this.index=r,this.start=n}},si=class i extends Vn{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,r);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)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&A.ExcludeBuffers)return null;let{buffer:n}=this.context,s=n.findChild(this.index+4,n.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:r}=this.context,n=this.index+4,s=r.buffer[this.index+3];if(s>n){let o=r.buffer[this.index+1];e.push(r.slice(n,s,o)),t.push(0)}return new Y(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function nh(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let a=new ve(o.tree,o.overlay[0].from+s.from,-1,s);(n||(n=[r])).push($r(a,e,t,!1))}}return n?nh(n):r}var zi=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~A.EnterBracketed,e instanceof ve)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=r+n.buffer[e+1],this.to=r+n.buffer[e+2],!0}yield(e){return e?e instanceof ve?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:n}=this.buffer,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,r);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,r=this.mode){return this.buffer?r&A.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&A.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&A.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let n=r<0?0:this.stack[r]+4;if(this.index!=n)return this.yieldBuf(t.findChild(n,this.index,-1,0,4))}else{let n=t.buffer[this.index+3];if(n<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(n)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:n}=this;if(n){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&A.IncludeAnonymous||a instanceof Ct||!a.type.isAnonymous||Jo(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==n){if(n==this.index)return o;t=o,r=s+1;break e}n=this.stack[--s]}for(let n=r;n=0;s--){if(s<0)return jo(this._tree,e,n);let o=r[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[n]&&e[n]!=o.name)return!1;n--}}return!0}};function Jo(i){return i.children.some(e=>e instanceof Ct||!e.type.isAnonymous||Jo(e))}function Om(i){var e;let{buffer:t,nodeSet:r,maxBufferLength:n=1024,reused:s=[],minRepeatType:o=r.types.length}=i,a=Array.isArray(t)?new Go(t,t.length):t,O=r.types,l=0,c=0;function h(y,x,w,M,W,N){let{id:C,start:_,end:I,size:L}=a,K=c,me=l;if(L<0)if(a.next(),L==-1){let dt=s[C];w.push(dt),M.push(_-y);return}else if(L==-3){l=C;return}else if(L==-4){c=C;return}else throw new RangeError(`Unrecognized record size: ${L}`);let Re=O[C],st,Oe,We=_-y;if(I-_<=n&&(Oe=m(a.pos-x,W))){let dt=new Uint16Array(Oe.size-Oe.skip),Ae=a.pos-Oe.size,ot=dt.length;for(;a.pos>Ae;)ot=g(Oe.start,dt,ot);st=new Ct(dt,I-Oe.start,r),We=Oe.start-y}else{let dt=a.pos-L;a.next();let Ae=[],ot=[],Dt=C>=o?C:-1,$i=0,Ur=I;for(;a.pos>dt;)Dt>=0&&a.id==Dt&&a.size>=0?(a.end<=Ur-n&&($(Ae,ot,_,$i,a.end,Ur,Dt,K,me),$i=Ae.length,Ur=a.end),a.next()):N>2500?f(_,dt,Ae,ot):h(_,dt,Ae,ot,Dt,N+1);if(Dt>=0&&$i>0&&$i-1&&$i>0){let GO=d(Re,me);st=ea(Re,Ae,ot,0,Ae.length,0,I-_,GO,GO)}else st=p(Re,Ae,ot,I-_,K-I,me)}w.push(st),M.push(We)}function f(y,x,w,M){let W=[],N=0,C=-1;for(;a.pos>x;){let{id:_,start:I,end:L,size:K}=a;if(K>4)a.next();else{if(C>-1&&I=0;L-=3)_[K++]=W[L],_[K++]=W[L+1]-I,_[K++]=W[L+2]-I,_[K++]=K;w.push(new Ct(_,W[2]-I,r)),M.push(I-y)}}function d(y,x){return(w,M,W)=>{let N=0,C=w.length-1,_,I;if(C>=0&&(_=w[C])instanceof Y){if(!C&&_.type==y&&_.length==W)return _;(I=_.prop(V.lookAhead))&&(N=M[C]+_.length+I)}return p(y,w,M,W,N,x)}}function $(y,x,w,M,W,N,C,_,I){let L=[],K=[];for(;y.length>M;)L.push(y.pop()),K.push(x.pop()+w-W);y.push(p(r.types[C],L,K,N-W,_-N,I)),x.push(W-w)}function p(y,x,w,M,W,N,C){if(N){let _=[V.contextHash,N];C=C?[_].concat(C):[_]}if(W>25){let _=[V.lookAhead,W];C=C?[_].concat(C):[_]}return new Y(y,x,w,M,C)}function m(y,x){let w=a.fork(),M=0,W=0,N=0,C=w.end-n,_={size:0,start:0,skip:0};e:for(let I=w.pos-y;w.pos>I;){let L=w.size;if(w.id==x&&L>=0){_.size=M,_.start=W,_.skip=N,N+=4,M+=4,w.next();continue}let K=w.pos-L;if(L<0||K=o?4:0,Re=w.start;for(w.next();w.pos>K;){if(w.size<0)if(w.size==-3||w.size==-4)me+=4;else break e;else w.id>=o&&(me+=4);w.next()}W=Re,M+=L,N+=me}return(x<0||M==y)&&(_.size=M,_.start=W,_.skip=N),_.size>4?_:void 0}function g(y,x,w){let{id:M,start:W,end:N,size:C}=a;if(a.next(),C>=0&&M4){let I=a.pos-(C-4);for(;a.pos>I;)w=g(y,x,w)}x[--w]=_,x[--w]=N-y,x[--w]=W-y,x[--w]=M}else C==-3?l=M:C==-4&&(c=M);return w}let S=[],T=[];for(;a.pos>0;)h(i.start||0,i.bufferStart||0,S,T,-1,0);let z=(e=i.length)!==null&&e!==void 0?e:S.length?T[0]+S[0].length:0;return new Y(O[i.topID],S.reverse(),T.reverse(),z)}var Kc=new WeakMap;function Zn(i,e){if(!i.isAnonymous||e instanceof Ct||e.type!=i)return 1;let t=Kc.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=i||!(r instanceof Y)){t=1;break}t+=Zn(i,r)}Kc.set(e,t)}return t}function ea(i,e,t,r,n,s,o,a,O){let l=0;for(let $=r;$=c)break;x+=w}if(T==z+1){if(x>c){let w=$[z];d(w.children,w.positions,0,w.children.length,p[z]+S);continue}h.push($[z])}else{let w=p[T-1]+$[T-1].length-y;h.push(ea(i,$,p,z,T,y,w,null,O))}f.push(y+S-s)}}return d(e,t,r,n,0),(a||O)(h,f,o)}var _i=class{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let n=this.map.get(e);n||this.map.set(e,n=new Map),n.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof si?this.setBuffer(e.context.buffer,e.index,t):e instanceof ve&&this.map.set(e.tree,t)}get(e){return e instanceof si?this.getBuffer(e.context.buffer,e.index):e instanceof ve?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)}},bt=class i{constructor(e,t,r,n,s=!1,o=!1){this.from=e,this.to=t,this.tree=r,this.offset=n,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=[],r=!1){let n=[new i(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&n.push(s);return n}static applyChanges(e,t,r=128){if(!t.length)return e;let n=[],s=1,o=e.length?e[0]:null;for(let a=0,O=0,l=0;;a++){let c=a=r)for(;o&&o.from=f.from||h<=f.to||l){let d=Math.max(f.from,O)-l,$=Math.min(f.to,h)-l;f=d>=$?null:new i(d,$,f.tree,f.offset+l,a>0,!!c)}if(f&&n.push(f),o.to>h)break;o=snew Xe(n.from,n.to)):[new Xe(0,0)]:[new Xe(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let n=this.startParse(e,t,r);for(;;){let s=n.advance();if(s)return s}}},Do=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 Yi(i){return(e,t,r,n)=>new Ho(e,i,t,r,n)}var zn=class{constructor(e,t,r,n,s,o){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=n,this.target=s,this.from=o}};function Jc(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}var No=class{constructor(e,t,r,n,s,o,a,O){this.parser=e,this.predicate=t,this.mounts=r,this.index=n,this.start=s,this.bracketed=o,this.target=a,this.prev=O,this.depth=0,this.ranges=[]}},Fo=new V({perNode:!0}),Ho=class{constructor(e,t,r,n,s){this.nest=t,this.input=r,this.fragments=n,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Y(r.type,r.children,r.positions,r.length,r.propValues.concat([[Fo,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[V.mounted.id]=new Yt(t,e.overlay,e.parser,e.bracketed),e.target.props=r}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(n)){if(t){let l=t.mounts.find(c=>c.frag.from<=n.from&&c.frag.to>=n.to&&c.mount.overlay);if(l)for(let c of l.mount.overlay){let h=c.from+l.pos,f=c.to+l.pos;h>=n.from&&f<=n.to&&!t.ranges.some(d=>d.fromh)&&t.ranges.push({from:h,to:f})}}a=!1}else if(r&&(o=lm(r.ranges,n.from,n.to)))a=o!=2;else if(!n.type.isAnonymous&&(s=this.nest(n,this.input))&&(n.fromnew Xe(h.from-n.from,h.to-n.from)):null,!!s.bracketed,n.tree,c.length?c[0].from:n.from)),s.overlay?c.length&&(r={ranges:c,depth:0,prev:r}):a=!1}}else if(t&&(O=t.predicate(n))&&(O===!0&&(O=new Xe(n.from,n.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&&n.firstChild())t&&t.depth++,r&&r.depth++;else for(;!n.nextSibling();){if(!n.parent())break e;if(t&&!--t.depth){let l=th(this.ranges,t.ranges);l.length&&(Jc(l),this.inner.splice(t.index,0,new zn(t.parser,t.parser.startParse(this.input,ih(t.mounts,l),l),t.ranges.map(c=>new Xe(c.from-t.start,c.to-t.start)),t.bracketed,t.target,l[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}};function lm(i,e,t){for(let r of i){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function eh(i,e,t,r,n,s){if(e=e&&t.enter(r,1,A.IgnoreOverlays|A.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 Y)t=t.children[0];else break}return!1}},Ko=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(Fo))!==null&&t!==void 0?t:r.to,this.inner=new _n(r.tree,-r.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(Fo))!==null&&e!==void 0?e:t.to,this.inner=new _n(t.tree,-t.offset)}}findMounts(e,t){var r;let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(r=s.tree)===null||r===void 0?void 0:r.prop(V.mounted);if(o&&o.parser==t)for(let a=this.fragI;a=s.to)break;O.tree==this.curFrag.tree&&n.push({frag:O,pos:s.from-O.offset,mount:o})}}}return n}};function th(i,e){let t=null,r=e;for(let n=1,s=0;n=a)break;O.to<=o||(t||(r=t=e.slice()),O.froma&&t.splice(s+1,0,new Xe(a,O.to))):O.to>a?t[s--]=new Xe(a,O.to):t.splice(s--,1))}}return r}function hm(i,e,t,r){let n=0,s=0,o=!1,a=!1,O=-1e9,l=[];for(;;){let c=n==i.length?1e9:o?i[n].to:i[n].from,h=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let f=Math.max(O,t),d=Math.min(c,h,r);fnew Xe(f.from+r,f.to+r)),h=hm(e,c,O,l);for(let f=0,d=O;;f++){let $=f==h.length,p=$?l:h[f].from;if(p>d&&t.push(new bt(d,p,n.tree,-o,s.from>=d||s.openStart,s.to<=p||s.openEnd)),$)break;d=h[f].to}}else t.push(new bt(O,l,n.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}var fm=0,_e=class i{constructor(e,t,r,n){this.name=e,this.set=t,this.base=r,this.modified=n,this.id=fm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof i&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let n=new i(r,[],null,[]);if(n.set.push(n),t)for(let s of t.set)n.set.push(s);return n}static defineModifier(e){let t=new Wn(e);return r=>r.modified.indexOf(t)>-1?r:Wn.get(r.base||r,r.modified.concat(t).sort((n,s)=>n.id-s.id))}},um=0,Wn=class i{constructor(e){this.name=e,this.instances=[],this.id=um++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&dm(t,a.modified));if(r)return r;let n=[],s=new _e(e.name,n,e,t);for(let a of t)a.instances.push(s);let o=$m(t);for(let a of e.set)if(!a.modified.length)for(let O of o)n.push(i.get(a,O));return s}};function dm(i,e){return i.length==e.length&&i.every((t,r)=>t==e[r])}function $m(i){let e=[[]];for(let t=0;tr.length-t.length)}function se(i){let e=Object.create(null);for(let t in i){let r=i[t];Array.isArray(r)||(r=[r]);for(let n of t.split(" "))if(n){let s=[],o=2,a=n;for(let h=0;;){if(a=="..."&&h>0&&h+3==n.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+n);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==n.length)break;let d=n[h++];if(h==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);a=n.slice(h)}let O=s.length-1,l=s[O];if(!l)throw new RangeError("Invalid path: "+n);let c=new ai(r,o,O>0?s.slice(0,O):null);e[l]=c.sort(e[l])}}return ah.add(e)}var ah=new V({combine(i,e){let t,r,n;for(;i||e;){if(!i||e&&i.depth>=e.depth?(n=e,e=e.next):(n=i,i=i.next),t&&t.mode==n.mode&&!n.context&&!t.context)continue;let s=new ai(n.tags,n.mode,n.context);t?t.next=s:r=s,t=s}return r}}),ai=class{constructor(e,t,r,n){this.tags=e,this.mode=t,this.context=r,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=n;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:r}}function pm(i,e){let t=null;for(let r of i){let n=r.style(e);n&&(t=t?t+" "+n:n)}return t}function Oh(i,e,t,r=0,n=i.length){let s=new ia(r,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),r,n,"",s.highlighters),s.flush(n)}var ia=class{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,n,s){let{type:o,from:a,to:O}=e;if(a>=r||O<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let l=n,c=mm(e)||ai.empty,h=pm(s,c.tags);if(h&&(l&&(l+=" "),l+=h,c.mode==1&&(n+=(n?" ":"")+h)),this.startSpan(Math.max(t,a),l),c.opaque)return;let f=e.tree&&e.tree.prop(V.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,g=a;;m++){let S=m=T||!e.nextSibling())););if(!S||T>r)break;g=S.to+a,g>t&&(this.highlightRange(d.cursor(),Math.max(t,S.from+a),Math.min(r,g),"",$),this.startSpan(Math.min(r,g),l))}p&&e.parent()}else if(e.firstChild()){f&&(n="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,n,s),this.startSpan(Math.min(r,e.to),l)}while(e.nextSibling());e.parent()}}};function mm(i){let e=i.type.prop(ah);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var b=_e.define,Yn=b(),qt=b(),sh=b(qt),oh=b(qt),Wt=b(),Cn=b(Wt),ta=b(Wt),ut=b(),oi=b(ut),ht=b(),ft=b(),ra=b(),pr=b(ra),qn=b(),u={comment:Yn,lineComment:b(Yn),blockComment:b(Yn),docComment:b(Yn),name:qt,variableName:b(qt),typeName:sh,tagName:b(sh),propertyName:oh,attributeName:b(oh),className:b(qt),labelName:b(qt),namespace:b(qt),macroName:b(qt),literal:Wt,string:Cn,docString:b(Cn),character:b(Cn),attributeValue:b(Cn),number:ta,integer:b(ta),float:b(ta),bool:b(Wt),regexp:b(Wt),escape:b(Wt),color:b(Wt),url:b(Wt),keyword:ht,self:b(ht),null:b(ht),atom:b(ht),unit:b(ht),modifier:b(ht),operatorKeyword:b(ht),controlKeyword:b(ht),definitionKeyword:b(ht),moduleKeyword:b(ht),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:ra,separator:b(ra),bracket:pr,angleBracket:b(pr),squareBracket:b(pr),paren:b(pr),brace:b(pr),content:ut,heading:oi,heading1:b(oi),heading2:b(oi),heading3:b(oi),heading4:b(oi),heading5:b(oi),heading6:b(oi),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:qn,documentMeta:b(qn),annotation:b(qn),processingInstruction:b(qn),definition:_e.defineModifier("definition"),constant:_e.defineModifier("constant"),function:_e.defineModifier("function"),standard:_e.defineModifier("standard"),local:_e.defineModifier("local"),special:_e.defineModifier("special")};for(let i in u){let e=u[i];e instanceof _e&&(e.name=i)}var vT=na([{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 sa,wt=new V;function qi(i){return v.define({combine:i?e=>e.concat(i):void 0})}var En=new V,fe=class{constructor(e,t,r=[],n=""){this.data=e,this.name=n,D.prototype.hasOwnProperty("tree")||Object.defineProperty(D.prototype,"tree",{get(){return G(this)}}),this.parser=t,this.extension=[Ci.of(this),D.languageData.of((s,o,a)=>{let O=lh(s,o,a),l=O.type.prop(wt);if(!l)return[];let c=s.facet(l),h=O.type.prop(En);if(h){let f=O.resolve(o-O.from,a);for(let d of h)if(d.test(f,s)){let $=s.facet(d.facet);return d.type=="replace"?$:$.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return lh(e,t,r).type.prop(wt)==this.data}findRegions(e){let t=e.facet(Ci);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],n=(s,o)=>{if(s.prop(wt)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(V.mounted);if(a){if(a.tree.prop(wt)==this.data){if(a.overlay)for(let O of a.overlay)r.push({from:O.from+o,to:O.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let O=r.length;if(n(a.tree,a.overlay[0].from+o),r.length>O)return}}for(let O=0;Or.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 G(i){let e=i.field(fe.state,!1);return e?e.tree:Y.empty}var la=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 r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}},mr=null,Oi=class i{constructor(e,t,r=[],n,s,o,a,O){this.parser=e,this.state=t,this.fragments=r,this.tree=n,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=O,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new i(e,t,[],Y.empty,0,r,[],null)}startParse(){return this.parser.startParse(new la(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Y.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let n=Date.now()+e;e=()=>Date.now()>n}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(bt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=mr;mr=this;try{return e()}finally{mr=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ch(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:n,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let O=[];if(e.iterChangedRanges((l,c,h,f)=>O.push({fromA:l,toA:c,fromB:h,toB:f})),r=bt.applyChanges(r,O),n=Y.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 c=e.mapPos(l.from,1),h=e.mapPos(l.to,-1);ce.from&&(this.fragments=ch(this.fragments,n,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends yt{createParse(t,r,n){let s=n[0].from,o=n[n.length-1].to;return{parsedPos:s,advance(){let O=mr;if(O){for(let l of n)O.tempSkipped.push(l);e&&(O.scheduleOn=O.scheduleOn?Promise.all([O.scheduleOn,e]):e)}return this.parsedPos=o,new Y(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 mr}};function ch(i,e,t){return bt.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var gr=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),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new i(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Oi.create(e.facet(Ci).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new i(r)}};fe.state=be.define({create:gr.init,update(i,e){for(let t of e.effects)if(t.is(fe.setState))return t.value;return e.startState.facet(Ci)!=e.state.facet(Ci)?gr.init(e.state):i.apply(e)}});var ph=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ph=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var oa=typeof navigator<"u"&&(!((sa=navigator.scheduling)===null||sa===void 0)&&sa.isInputPending)?()=>navigator.scheduling.isInputPending():null,gm=ze.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=ph(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndn+1e3,O=s.context.work(()=>oa&&oa()||Date.now()>o,n+(a?0:1e5));this.chunkBudget-=Date.now()-t,(O||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:fe.setState.of(new gr(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=>Ie(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()}}}),Ci=v.define({combine(i){return i.length?i[0]:null},enables:i=>[fe.state,gm,k.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]}},Qr=class i{constructor(e,t,r,n,s,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=n,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:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new i(e.name,(e.alias||[]).concat(e.name).map(n=>n.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let r=/\.([^.]+)$/.exec(t);if(r){for(let n of e)if(n.extensions.indexOf(r[1])>-1)return n}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(s=>s==t))return n;if(r)for(let n of e)for(let s of n.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return n}return null}},Qm=v.define(),Ut=v.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(Ut);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function Pr(i,e){let t="",r=i.tabSize,n=i.facet(Ut)[0];if(n==" "){for(;e>=r;)t+=" ",e-=r;n=" "}for(let s=0;s=e?Sm(i,t,e):null}var li=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=At(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:s}=this.options;return n!=null&&n>=r.from&&n<=r.to?s&&n==e?{text:"",from:e}:(t<0?n-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return we(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:n}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(n);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},de=new V;function Sm(i,e,t){let r=e.resolveStack(t),n=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(n!=r.node){let s=[];for(let o=n;o&&!(o.fromr.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return mh(r,i,t)}function mh(i,e,t){for(let r=i;r;r=r.next){let n=Tm(r.node);if(n)return n(ca.create(e,t,r))}return 0}function Pm(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function Tm(i){let e=i.type.prop(de);if(e)return e;let t=i.firstChild,r;if(t&&(r=t.type.prop(V.closedBy))){let n=i.lastChild,s=n&&r.indexOf(n.name)>-1;return o=>gh(o,!0,1,void 0,s&&!Pm(o)?n.from:void 0)}return i.parent==null?bm:null}function bm(){return 0}var ca=class i extends li{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new i(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(ym(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return mh(this.context.next,this.base,this.pos)}};function ym(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function wm(i){let e=i.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let n=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=n==null||n<=s.from?s.to:Math.min(s.to,n);for(let a=t.to;;){let O=e.childAfter(a);if(!O||O==r)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 Ln({closing:i,align:e=!0,units:t=1}){return r=>gh(r,e,t,i)}function gh(i,e,t,r,n){let s=i.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||n==i.pos+o,O=e?wm(i):null;return O?a?i.column(O.from):i.column(O.to):i.baseIndent+(a?0:i.unit*t)}var Qh=i=>i.baseIndent;function Ye({except:i,units:e=1}={}){return t=>{let r=i&&i.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}var Sh=v.define(),Se=new V;function Mt(i){let e=i.firstChild,t=i.lastChild;return e&&e.toa.prop(wt)==o.data:o?a=>a==o:void 0,this.style=na(e.map(a=>({tag:a.tag,class:a.class||n(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new Ee(r):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},ha=v.define(),Ph=v.define({combine(i){return i.length?[i[0]]:null}});function aa(i){let e=i.facet(ha);return e.length?e:i.facet(Ph)}function ma(i,e){let t=[xm],r;return i instanceof xt&&(i.module&&t.push(k.styleModule.of(i.module)),r=i.themeType),e?.fallback?t.push(Ph.of(i)):r?t.push(ha.computeN([k.darkTheme],n=>n.facet(k.darkTheme)==(r=="dark")?[i]:[])):t.push(ha.of(i)),t}var fa=class{constructor(e){this.markCache=Object.create(null),this.tree=G(e.state),this.decorations=this.buildDeco(e,aa(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=G(e.state),r=aa(e.state),n=r!=aa(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||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return E.none;let r=new Jt;for(let{from:n,to:s}of e.visibleRanges)Oh(this.tree,t,(o,a,O)=>{r.add(o,a,this.markCache[O]||(this.markCache[O]=E.mark({class:O})))},n,s);return r.finish()}},xm=at.high(ze.fromClass(fa,{decorations:i=>i.decorations})),WT=xt.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"}]),km=k.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Th=1e4,bh="()[]{}",yh=v.define({combine(i){return Rt(i,{afterCursor:!0,brackets:bh,maxScanDistance:Th,renderMatch:Rm})}}),Xm=E.mark({class:"cm-matchingBracket"}),vm=E.mark({class:"cm-nonmatchingBracket"});function Rm(i){let e=[],t=i.matched?Xm:vm;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}function hh(i){let e=[],t=i.facet(yh);for(let r of i.selection.ranges){if(!r.empty)continue;let n=et(i,r.head,-1,t)||r.head>0&&et(i,r.head-1,1,t)||t.afterCursor&&(et(i,r.head,1,t)||r.headi.decorations}),Vm=[Zm,km];function wh(i={}){return[yh.of(i),Vm]}var Tr=new V;function ua(i,e,t){let r=i.prop(e<0?V.openedBy:V.closedBy);if(r)return r;if(i.name.length==1){let n=t.indexOf(i.name);if(n>-1&&n%2==(e<0?1:0))return[t[n+e]]}return null}function da(i){let e=i.type.prop(Tr);return e?e(i.node):i}function et(i,e,t,r={}){let n=r.maxScanDistance||Th,s=r.brackets||bh,o=G(i),a=o.resolveInner(e,t);for(let O=a;O;O=O.parent){let l=ua(O.type,t,s);if(l&&O.from0?e>=c.from&&ec.from&&e<=c.to))return zm(i,e,t,O,c,l,s)}}return _m(i,e,t,o,a.type,n,s)}function zm(i,e,t,r,n,s,o){let a=r.parent,O={from:n.from,to:n.to},l=0,c=a?.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(l==0&&s.indexOf(c.type.name)>-1&&c.from0)return null;let l={from:t<0?e-1:e,to:t>0?e+1:e},c=i.doc.iterRange(e,t>0?i.doc.length:0),h=0;for(let f=0;!c.next().done&&f<=s;){let d=c.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 g=o.indexOf(d[p]);if(!(g<0||r.resolveInner($+p,1).type!=n))if(g%2==0==t>0)h++;else{if(h==1)return{start:l,end:{from:$+p,to:$+p+1},matched:g>>1==O>>1};h--}}t>0&&(f+=d.length)}return c.done?{start:l,matched:!1}:null}function fh(i,e,t,r=0,n=0){e==null&&(e=i.search(/[^\s\u00a0]/),e==-1&&(e=i.length));let s=n;for(let o=r;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.lastColumnPosr?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return n(s)==n(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}};function Ym(i){return{name:i.name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||Cm,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||Qa,mergeTokens:i.mergeTokens!==!1}}function Cm(i){if(typeof i!="object")return i;let e={};for(let t in i){let r=i[t];e[t]=r instanceof Array?r.slice():r}return e}var uh=new WeakMap,Un=class i extends fe{constructor(e){let t=qi(e.languageData),r=Ym(e),n,s=new class extends yt{createParse(o,a,O){return new $a(n,o,a,O)}};super(t,s,[],e.name),this.topNode=Um(t,this),n=this,this.streamParser=r,this.stateAfter=new V({perNode:!0}),this.tokenTable=e.tokenTable?new Mn(r.tokenTable):Am}static define(e){return new i(e)}getIndent(e){let t,{overrideIndentation:r}=e.options;r&&(t=uh.get(e.state),t!=null&&t1e4)return null;for(;s=r&&t+e.length<=n&&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 Y&&O=e.length)return e;!n&&t==0&&e.type==i.topNode&&(n=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],O;if(ot&&ga(i,s.tree,0-s.offset,t,a),l;if(O&&O.pos<=r&&(l=xh(i,s.tree,t+s.offset,O.pos+s.offset,!1)))return{state:O.state,tree:l}}return{state:i.streamParser.startState(n?At(n):4),tree:Y.empty}}var $a=class{constructor(e,t,r,n){this.lang=e,this.input=t,this.fragments=r,this.ranges=n,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=n[n.length-1].to;let s=Oi.get(),o=n[0].from,{state:a,tree:O}=qm(e,r,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=Oi.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(t,this.chunkStart+512);for(e&&(r=Math.min(r,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 r=t.indexOf(` +`);r>-1&&(t=t.slice(0,r))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),r=e+t.length;for(let n=this.rangeIndex;;){let s=this.ranges[n].to;if(s>=r||(t=t.slice(0,s-(r-t.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,a=this.lineAfter(o);t+=a,r=o+a.length}return{line:t,end:r}}skipGapsTo(e,t,r){for(;;){let n=this.ranges[this.rangeIndex].to,s=e+t;if(r>0?n>s:n>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-n}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){n=this.skipGapsTo(t,n,1),t+=n;let a=this.chunk.length;n=this.skipGapsTo(r,n,-1),r+=n,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]=r:this.chunk.push(e,t,r,s),n}parseLine(e){let{line:t,end:r}=this.nextLine(),n=0,{streamParser:s}=this.lang,o=new An(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=kh(s.token,o,this.state);if(a&&(n=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPose.start)return n}throw new Error("Stream parser failed to advance stream.")}var Qa=Object.create(null),Sr=[ie.none],Wm=new Tt(Sr),dh=[],$h=Object.create(null),Xh=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"]])Xh[i]=vh(Qa,e);var Mn=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Xh)}resolve(e){return e?this.table[e]||(this.table[e]=vh(this.extra,e)):0}},Am=new Mn(Qa);function Oa(i,e){dh.indexOf(i)>-1||(dh.push(i),console.warn(e))}function vh(i,e){let t=[];for(let a of e.split(" ")){let O=[];for(let l of a.split(".")){let c=i[l]||u[l];c?typeof c=="function"?O.length?O=O.map(c):Oa(l,`Modifier ${l} used at start of tag`):O.length?Oa(l,`Tag ${l} used as modifier`):O=Array.isArray(c)?c:[c]:Oa(l,`Unknown highlighting tag ${l}`)}for(let l of O)t.push(l)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),n=r+" "+t.map(a=>a.id),s=$h[n];if(s)return s.id;let o=$h[n]=ie.define({id:Sr.length,name:r,props:[se({[r]:t})]});return Sr.push(o),o.id}function Um(i,e){let t=ie.define({id:Sr.length,name:"Document",props:[wt.add(()=>i),de.add(()=>r=>e.getIndent(r))],top:!0});return Sr.push(t),t}var AT={rtl:E.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:H.RTL}),ltr:E.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:H.LTR}),auto:E.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Mm=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),r=xa(i.state,t.from);return r.line?Em(i):r.block?Gm(i):!1};function wa(i,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=i(e,t);return n?(r(t.update(n)),!0):!1}}var Em=wa(Bm,0);var Lm=wa(Wh,0);var Gm=wa((i,e)=>Wh(i,e,Im(e)),0);function xa(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var br=50;function jm(i,{open:e,close:t},r,n){let s=i.sliceDoc(r-br,r),o=i.sliceDoc(n,n+br),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:r-a,margin:a&&1},close:{pos:n+O,margin:O&&1}};let c,h;n-r<=2*br?c=h=i.sliceDoc(r,n):(c=i.sliceDoc(r,r+br),h=i.sliceDoc(n-br,n));let f=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(h)[0].length,$=h.length-d-t.length;return c.slice(f,f+e.length)==e&&h.slice($,$+t.length)==t?{open:{pos:r+f+e.length,margin:/\s/.test(c.charAt(f+e.length))?1:0},close:{pos:n-d-t.length,margin:/\s/.test(h.charAt($-1))?1:0}}:null}function Im(i){let e=[];for(let t of i.selection.ranges){let r=i.doc.lineAt(t.from),n=t.to<=r.to?r:i.doc.lineAt(t.to);n.from>r.from&&n.from==t.to&&(n=t.to==r.to+1?r:i.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=n.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:n.to})}return e}function Wh(i,e,t=e.selection.ranges){let r=t.map(s=>xa(e,s.from).block);if(!r.every(s=>s))return null;let n=t.map((s,o)=>jm(e,r[o],s.from,s.to));if(i!=2&&!n.every(s=>s))return{changes:e.changes(t.map((s,o)=>n[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(i!=1&&n.some(s=>s)){let s=[];for(let o=0,a;on&&(s==o||o>h.from)){n=h.from;let f=/^\s*/.exec(h.text)[0].length,d=f==h.length,$=h.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:c,single:h}of r)(h||!c)&&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&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:O}of r)if(a>=0){let l=o.from+a,c=l+O.length;o.text[c-o.from]==" "&&c++,s.push({from:l,to:c})}return{changes:s}}return null}var Pa=ye.define(),Dm=ye.define(),Nm=v.define(),Ah=v.define({combine(i){return Rt(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,n)=>e(r,n)||t(r,n)})}}),Uh=be.define({create(){return ci.empty},update(i,e){let t=e.state.facet(Ah),r=e.annotation(Pa);if(r){let O=tt.fromTransaction(e,r.selection),l=r.side,c=l==0?i.undone:i.done;return O?c=jn(c,c.length,t.minDepth,O):c=Gh(c,e.startState.selection),new ci(l==0?r.rest:c,l==0?c:r.rest)}let n=e.annotation(Dm);if((n=="full"||n=="before")&&(i=i.isolate()),e.annotation(re.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let s=tt.fromTransaction(e),o=e.annotation(re.time),a=e.annotation(re.userEvent);return s?i=i.addChanges(s,o,a,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(n=="full"||n=="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 ci(i.done.map(tt.fromJSON),i.undone.map(tt.fromJSON))}});function Mh(i={}){return[Uh,Ah.of(i),k.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?Eh:e.inputType=="historyRedo"?Ta:null;return r?(e.preventDefault(),r(t)):!1}})]}function In(i,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let n=t.field(Uh,!1);if(!n)return!1;let s=n.pop(i,t,e);return s?(r(s),!0):!1}}var Eh=In(0,!1),Ta=In(1,!1),Fm=In(0,!0),Hm=In(1,!0);var tt=class i{constructor(e,t,r,n,s){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=n,this.selectionsAfter=s}setSelAfter(e){return new i(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(e){return new i(e.changes&&ge.fromJSON(e.changes),[],e.mapped&&$t.fromJSON(e.mapped),e.startSelection&&Q.fromJSON(e.startSelection),e.selectionsAfter.map(Q.fromJSON))}static fromTransaction(e,t){let r=Be;for(let n of e.startState.facet(Nm)){let s=n(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new i(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Be)}static selection(e){return new i(void 0,Be,void 0,void 0,e)}};function jn(i,e,t,r){let n=e+1>t+20?e-t-1:0,s=i.slice(n,e);return s.push(r),s}function Km(i,e){let t=[],r=!1;return i.iterChangedRanges((n,s)=>t.push(n,s)),e.iterChangedRanges((n,s,o,a)=>{for(let O=0;O=l&&o<=c&&(r=!0)}}),r}function Jm(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function Lh(i,e){return i.length?e.length?i.concat(e):i:e}var Be=[],eg=200;function Gh(i,e){if(i.length){let t=i[i.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-eg));return r.length&&r[r.length-1].eq(e)?i:(r.push(e),jn(i,i.length-1,1e9,t.setSelAfter(r)))}else return[tt.selection([e])]}function tg(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 Sa(i,e){if(!i.length)return i;let t=i.length,r=Be;for(;t;){let n=ig(i[t-1],e,r);if(n.changes&&!n.changes.empty||n.effects.length){let s=i.slice(0,t);return s[t-1]=n,s}else e=n.mapped,t--,r=n.selectionsAfter}return r.length?[tt.selection(r)]:Be}function ig(i,e,t){let r=Lh(i.selectionsAfter.length?i.selectionsAfter.map(a=>a.map(e)):Be,t);if(!i.changes)return tt.selection(r);let n=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new tt(n,B.mapEffects(i.effects,e),o,i.startSelection.map(s),r)}var rg=/^(input\.type|delete)($|\.)/,ci=class i{constructor(e,t,r=0,n=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=n}isolate(){return this.prevTime?new i(this.done,this.undone):this}addChanges(e,t,r,n,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||rg.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):Bn(t,e))}function $e(i){return i.textDirectionAt(i.state.selection.main.head)==H.LTR}var Bh=i=>Ih(i,!$e(i)),Dh=i=>Ih(i,$e(i));function Nh(i,e){return rt(i,t=>t.empty?i.moveByGroup(t,e):Bn(t,e))}var ng=i=>Nh(i,!$e(i)),sg=i=>Nh(i,$e(i));var DT=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function og(i,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function Dn(i,e,t){let r=G(i).resolveInner(e.head),n=t?V.closedBy:V.openedBy;for(let O=e.head;;){let l=t?r.childAfter(O):r.childBefore(O);if(!l)break;og(i,l,n)?r=l:O=t?l.to:l.from}let s=r.type.prop(n),o,a;return s&&(o=t?et(i,r.from,1):et(i,r.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?r.to:r.from,Q.cursor(a,t?-1:1)}var ag=i=>rt(i,e=>Dn(i.state,e,!$e(i))),Og=i=>rt(i,e=>Dn(i.state,e,$e(i)));function Fh(i,e){return rt(i,t=>{if(!t.empty)return Bn(t,e);let r=i.moveVertically(t,e);return r.head!=t.head?r:i.moveToLineBoundary(t,e)})}var Hh=i=>Fh(i,!1),Kh=i=>Fh(i,!0);function Jh(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):Bn(o,e));if(n.eq(r.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(r.selection.main.head),a=i.scrollDOM.getBoundingClientRect(),O=a.top+t.marginTop,l=a.bottom-t.marginBottom;o&&o.top>O&&o.bottomef(i,!1),ba=i=>ef(i,!0);function Et(i,e,t){let r=i.lineBlockAt(e.head),n=i.moveToLineBoundary(e,t);if(n.head==e.head&&n.head!=(t?r.to:r.from)&&(n=i.moveToLineBoundary(e,t,!1)),!t&&n.head==r.from&&r.length){let s=/^\s*/.exec(i.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(n=Q.cursor(r.from+s))}return n}var lg=i=>rt(i,e=>Et(i,e,!0)),cg=i=>rt(i,e=>Et(i,e,!1)),hg=i=>rt(i,e=>Et(i,e,!$e(i))),fg=i=>rt(i,e=>Et(i,e,$e(i))),ug=i=>rt(i,e=>Q.cursor(i.lineBlockAt(e.head).from,1)),dg=i=>rt(i,e=>Q.cursor(i.lineBlockAt(e.head).to,-1));function $g(i,e,t){let r=!1,n=Wi(i.selection,s=>{let o=et(i,s.head,-1)||et(i,s.head,1)||s.head>0&&et(i,s.head-1,1)||s.head$g(i,e,!1);function De(i,e){let t=Wi(i.state.selection,r=>{let n=e(r);return Q.range(r.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(it(i.state,t)),!0)}function tf(i,e){return De(i,t=>i.moveByChar(t,e))}var rf=i=>tf(i,!$e(i)),nf=i=>tf(i,$e(i));function sf(i,e){return De(i,t=>i.moveByGroup(t,e))}var mg=i=>sf(i,!$e(i)),gg=i=>sf(i,$e(i));var Qg=i=>De(i,e=>Dn(i.state,e,!$e(i))),Sg=i=>De(i,e=>Dn(i.state,e,$e(i)));function of(i,e){return De(i,t=>i.moveVertically(t,e))}var af=i=>of(i,!1),Of=i=>of(i,!0);function lf(i,e){return De(i,t=>i.moveVertically(t,e,Jh(i).height))}var Zh=i=>lf(i,!1),Vh=i=>lf(i,!0),Pg=i=>De(i,e=>Et(i,e,!0)),Tg=i=>De(i,e=>Et(i,e,!1)),bg=i=>De(i,e=>Et(i,e,!$e(i))),yg=i=>De(i,e=>Et(i,e,$e(i))),wg=i=>De(i,e=>Q.cursor(i.lineBlockAt(e.head).from)),xg=i=>De(i,e=>Q.cursor(i.lineBlockAt(e.head).to)),zh=({state:i,dispatch:e})=>(e(it(i,{anchor:0})),!0),_h=({state:i,dispatch:e})=>(e(it(i,{anchor:i.doc.length})),!0),Yh=({state:i,dispatch:e})=>(e(it(i,{anchor:i.selection.main.anchor,head:0})),!0),Ch=({state:i,dispatch:e})=>(e(it(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),kg=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),Xg=({state:i,dispatch:e})=>{let t=Nn(i).map(({from:r,to:n})=>Q.range(r,Math.min(n+1,i.doc.length)));return e(i.update({selection:Q.create(t),userEvent:"select"})),!0},vg=({state:i,dispatch:e})=>{let t=Wi(i.selection,r=>{let n=G(i),s=n.resolveStack(r.from,1);if(r.empty){let o=n.resolveStack(r.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=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return Q.range(a.to,a.from)}return r});return t.eq(i.selection)?!1:(e(it(i,t)),!0)};function cf(i,e){let{state:t}=i,r=t.selection,n=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to0)for(let a=s;;){let O=i.moveVertically(a,e);if(O.heado.to){n.some(l=>l.head==O.head)||n.push(O);break}else{if(O.head==a.head)break;a=O}}}return n.length==r.ranges.length?!1:(i.dispatch(it(t,Q.create(n,n.length-1))),!0)}var Rg=i=>cf(i,!1),Zg=i=>cf(i,!0),Vg=({state:i,dispatch:e})=>{let t=i.selection,r=null;return t.ranges.length>1?r=Q.create([t.main]):t.main.empty||(r=Q.create([Q.cursor(t.main.head)])),r?(e(it(i,r)),!0):!1};function yr(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:r}=i,n=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let O=e(s);Oo&&(t="delete.forward",O=Gn(i,O,!0)),o=Math.min(o,O),a=Math.max(a,O)}else o=Gn(i,o,!1),a=Gn(i,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:Q.cursor(o,on(i)))r.between(e,e,(n,s)=>{ne&&(e=t?s:n)});return e}var hf=(i,e,t)=>yr(i,r=>{let n=r.from,{state:s}=i,o=s.doc.lineAt(n),a,O;if(t&&!e&&n>o.from&&nhf(i,!1,!0);var ff=i=>hf(i,!0,!1),uf=(i,e)=>yr(i,t=>{let r=t.head,{state:n}=i,s=n.doc.lineAt(r),o=n.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==t.head&&s.number!=(e?n.doc.lines:1)&&(r+=e?1:-1);break}let O=ae(s.text,r-s.from,e)+s.from,l=s.text.slice(Math.min(r,O)-s.from,Math.max(r,O)-s.from),c=o(l);if(a!=null&&c!=a)break;(l!=" "||r!=t.head)&&(a=c),r=O}return r}),df=i=>uf(i,!1),zg=i=>uf(i,!0);var _g=i=>yr(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headyr(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),Cg=i=>yr(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:q.of(["",""])},range:Q.cursor(r.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},Wg=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(r=>{if(!r.empty||r.from==0||r.from==i.doc.length)return{range:r};let n=r.from,s=i.doc.lineAt(n),o=n==s.from?n-1:ae(s.text,n-s.from,!1)+s.from,a=n==s.to?n+1:ae(s.text,n-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:i.doc.slice(n,a).append(i.doc.slice(o,n))},range:Q.cursor(a)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Nn(i){let e=[],t=-1;for(let r of i.selection.ranges){let n=i.doc.lineAt(r.from),s=i.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=i.doc.lineAt(r.to-1)),t>=n.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:n.from,to:s.to,ranges:[r]});t=s.number+1}return e}function $f(i,e,t){if(i.readOnly)return!1;let r=[],n=[];for(let s of Nn(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){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+i.lineBreak});for(let O of s.ranges)n.push(Q.range(Math.min(i.doc.length,O.anchor+a),Math.min(i.doc.length,O.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let O of s.ranges)n.push(Q.range(O.anchor-a,O.head-a))}}return r.length?(e(i.update({changes:r,scrollIntoView:!0,selection:Q.create(n,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var Ag=({state:i,dispatch:e})=>$f(i,e,!1),Ug=({state:i,dispatch:e})=>$f(i,e,!0);function pf(i,e,t){if(i.readOnly)return!1;let r=[];for(let s of Nn(i))t?r.push({from:s.from,insert:i.doc.slice(s.from,s.to)+i.lineBreak}):r.push({from:s.to,insert:i.lineBreak+i.doc.slice(s.from,s.to)});let n=i.changes(r);return e(i.update({changes:n,selection:i.selection.map(n,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var Mg=({state:i,dispatch:e})=>pf(i,e,!1),Eg=({state:i,dispatch:e})=>pf(i,e,!0),Lg=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(Nn(e).map(({from:n,to:s})=>(n>0?n--:s{let s;if(i.lineWrapping){let o=i.lineBlockAt(n.head),a=i.coordsAtPos(n.head,n.assoc||1);a&&(s=o.bottom+i.documentTop-a.bottom+i.defaultLineHeight/2)}return i.moveVertically(n,!0,s)}).map(t);return i.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Gg(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=G(i).resolveInner(e),r=t.childBefore(e),n=t.childAfter(e),s;return r&&n&&r.to<=e&&n.from>=e&&(s=r.type.prop(V.closedBy))&&s.indexOf(n.name)>-1&&i.doc.lineAt(r.to).from==i.doc.lineAt(n.from).from&&!/\S/.test(i.sliceDoc(r.to,n.from))?{from:r.to,to:n.from}:null}var qh=mf(!1),jg=mf(!0);function mf(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{let{from:s,to:o}=n,a=e.doc.lineAt(s),O=!i&&s==o&&Gg(e,s);i&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let l=new li(e,{simulateBreak:s,simulateDoubleBreak:!!O}),c=pa(l,s);for(c==null&&(c=we(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let n=[];for(let o=r.from;o<=r.to;){let a=i.doc.lineAt(o);a.number>t&&(r.empty||r.to>a.from)&&(e(a,n,r),t=a.number),o=a.to+1}let s=i.changes(n);return{changes:n,range:Q.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}var Ig=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),r=new li(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),n=ka(i,(s,o,a)=>{let O=pa(r,s.from);if(O==null)return;/\S/.test(s.text)||(O=0);let l=/^\s*/.exec(s.text)[0],c=Pr(i,O);(l!=c||a.fromi.readOnly?!1:(e(i.update(ka(i,(t,r)=>{r.push({from:t.from,insert:i.facet(Ut)})}),{userEvent:"input.indent"})),!0),Qf=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(ka(i,(t,r)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let s=we(n,i.tabSize),o=0,a=Pr(i,Math.max(0,s-At(i)));for(;o(i.setTabFocusMode(),!0);var Dg=[{key:"Ctrl-b",run:Bh,shift:rf,preventDefault:!0},{key:"Ctrl-f",run:Dh,shift:nf},{key:"Ctrl-p",run:Hh,shift:af},{key:"Ctrl-n",run:Kh,shift:Of},{key:"Ctrl-a",run:ug,shift:wg},{key:"Ctrl-e",run:dg,shift:xg},{key:"Ctrl-d",run:ff},{key:"Ctrl-h",run:ya},{key:"Ctrl-k",run:_g},{key:"Ctrl-Alt-h",run:df},{key:"Ctrl-o",run:qg},{key:"Ctrl-t",run:Wg},{key:"Ctrl-v",run:ba}],Ng=[{key:"ArrowLeft",run:Bh,shift:rf,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ng,shift:mg,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:hg,shift:bg,preventDefault:!0},{key:"ArrowRight",run:Dh,shift:nf,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:sg,shift:gg,preventDefault:!0},{mac:"Cmd-ArrowRight",run:fg,shift:yg,preventDefault:!0},{key:"ArrowUp",run:Hh,shift:af,preventDefault:!0},{mac:"Cmd-ArrowUp",run:zh,shift:Yh},{mac:"Ctrl-ArrowUp",run:Rh,shift:Zh},{key:"ArrowDown",run:Kh,shift:Of,preventDefault:!0},{mac:"Cmd-ArrowDown",run:_h,shift:Ch},{mac:"Ctrl-ArrowDown",run:ba,shift:Vh},{key:"PageUp",run:Rh,shift:Zh},{key:"PageDown",run:ba,shift:Vh},{key:"Home",run:cg,shift:Tg,preventDefault:!0},{key:"Mod-Home",run:zh,shift:Yh},{key:"End",run:lg,shift:Pg,preventDefault:!0},{key:"Mod-End",run:_h,shift:Ch},{key:"Enter",run:qh,shift:qh},{key:"Mod-a",run:kg},{key:"Backspace",run:ya,shift:ya,preventDefault:!0},{key:"Delete",run:ff,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:df,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:zg,preventDefault:!0},{mac:"Mod-Backspace",run:Yg,preventDefault:!0},{mac:"Mod-Delete",run:Cg,preventDefault:!0}].concat(Dg.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),Xa=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ag,shift:Qg},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Og,shift:Sg},{key:"Alt-ArrowUp",run:Ag},{key:"Shift-Alt-ArrowUp",run:Mg},{key:"Alt-ArrowDown",run:Ug},{key:"Shift-Alt-ArrowDown",run:Eg},{key:"Mod-Alt-ArrowUp",run:Rg},{key:"Mod-Alt-ArrowDown",run:Zg},{key:"Escape",run:Vg},{key:"Mod-Enter",run:jg},{key:"Alt-l",mac:"Ctrl-l",run:Xg},{key:"Mod-i",run:vg,preventDefault:!0},{key:"Mod-[",run:Qf},{key:"Mod-]",run:gf},{key:"Mod-Alt-\\",run:Ig},{key:"Shift-Mod-k",run:Lg},{key:"Shift-Mod-\\",run:pg},{key:"Mod-/",run:Mm},{key:"Alt-A",run:Lm},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Bg}].concat(Ng),Sf={key:"Tab",run:gf,shift:Qf};var Fg="#e5c07b",Pf="#e06c75",Hg="#56b6c2",Kg="#ffffff",Fn="#abb2bf",Ra="#7d8799",Jg="#61afef",eQ="#98c379",Tf="#d19a66",tQ="#c678dd",iQ="#21252b",bf="#2c313a",yf="#282c34",va="#353a42",rQ="#3E4451",wf="#528bff";var xf=k.theme({"&":{color:Fn,backgroundColor:yf},".cm-content":{caretColor:wf},".cm-cursor, .cm-dropCursor":{borderLeftColor:wf},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:rQ},".cm-panels":{backgroundColor:iQ,color:Fn},".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:yf,color:Ra,border:"none"},".cm-activeLineGutter":{backgroundColor:bf},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:va},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:va,borderBottomColor:va},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:bf,color:Fn}}},{dark:!0}),kf=xt.define([{tag:u.keyword,color:tQ},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:Pf},{tag:[u.function(u.variableName),u.labelName],color:Jg},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Tf},{tag:[u.definition(u.name),u.separator],color:Fn},{tag:[u.typeName,u.className,u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:Fg},{tag:[u.operator,u.operatorKeyword,u.url,u.escape,u.regexp,u.link,u.special(u.string)],color:Hg},{tag:[u.meta,u.comment],color:Ra},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.link,color:Ra,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Pf},{tag:[u.atom,u.bool,u.special(u.variableName)],color:Tf},{tag:[u.processingInstruction,u.string,u.inserted],color:eQ},{tag:u.invalid,color:Kg}]);var nQ=xt.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"}]),sQ={"&":{backgroundColor:"#FFF",color:"#000"},"&.cm-focused":{outline:"none"},".cm-line":{lineHeight:"1.6"}};function Xf(i){let e=document.documentElement.classList.contains("dark-mode"),t=e?xf:k.theme(sQ),r=e?kf:nQ,n={darkModeActive:e,registerViewTheme(s){let o=s();o&&(t=k.theme(o))},registerHighlightStyle(s){let o=s(u)||[];o.length&&(r=xt.define(o))}};return window.$events.emitPublic(i,"library-cm6::configure-theme",n),[t,ma(r)]}function vf(i){return[Xf(i),Dc(),Lc(),Ic(),wh(),Bc()]}function oQ(){let i=new pt,e={focus(t,r){r.dispatch({effects:i.reconfigure([Lo(),Eo()])})},blur(t,r){r.dispatch({effects:i.reconfigure([])})}};return[i.of([]),k.domEventHandlers(e)]}function Za(i){return[...vf(i),oQ(),ct.of([...Xa]),D.readOnly.of(!0)]}function Hn(i){return[...vf(i),Lo(),Eo(),Mh(),ct.of([...Xa,...jh,Sf]),k.lineWrapping]}var _a=class i{constructor(e,t,r,n,s,o,a,O,l,c=0,h){this.p=e,this.stack=t,this.state=r,this.reducePos=n,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=O,this.curContext=l,this.lookAhead=c,this.parent=h}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let n=e.parser.context;return new i(e,[],t,r,r,0,[],0,n?new Kn(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,n=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[n])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizeO;)this.stack.pop();this.reduceContext(n,l)}storeNode(e,t,r,n=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==r)return;if(o.buffer[a-2]>=t){o.buffer[a-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,t,r,n);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let O=o;O>0&&this.buffer[O-2]>r;O-=4)if(this.buffer[O-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)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,n>4&&(n-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=r,this.buffer[o+3]=n}}shift(e,t,r,n){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=n;let a=o.stateFlag(s,1);!a&&(n>r||t<=o.maxNode)&&(this.reducePos=n),this.pushState(s,a?r:Math.min(r,this.reducePos)),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,n,4)}else this.pos=n,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,n,4)}apply(e,t,r,n){e&65536?this.reduce(e):this.shift(e,t,r,n)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(r,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Ya(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let s=0,o;sO&1&&a==o)||n.push(t[s],o)}t=n}let r=[];for(let n=0;n>19,n=t&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],n,!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=[],r=(n,s)=>{if(!t.includes(n))return t.push(n),e.allActions(n,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=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}},Kn=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Ya=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,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}},Ca=class i{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new 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 wr(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let r=0,n=0;r=92&&o--,o>=34&&o--;let O=o-32;if(O>=46&&(O-=46,a=!0),s+=O,a)break;s*=46}t?t[n++]=s:t=new e(s)}return t}var Ai=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Rf=new Ai,qa=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=Rf,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,n=this.rangeIndex,s=this.pos+e;for(;sr.to:s>=r.to;){if(n==this.ranges.length-1)return null;let o=this.ranges[++n];s+=o.from-r.to,r=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,r,n;if(t>=0&&t=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),n=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),n}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Rf,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(r+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return r}},Lt=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;Yf(this.data,e,t,this.id,r.data,r.tokenPrecTable)}};Lt.prototype.contextual=Lt.prototype.fallback=Lt.prototype.extend=!1;var Gt=class{constructor(e,t,r){this.precTable=t,this.elseToken=r,this.data=typeof e=="string"?wr(e):e}token(e,t){let r=e.pos,n=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(Yf(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||n++,o==null)break;e.reset(o,e.token)}n&&(e.reset(r,e.token),e.acceptToken(this.elseToken,n))}};Gt.prototype.contextual=Lt.prototype.fallback=Lt.prototype.extend=!1;var ee=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function Yf(i,e,t,r,n,s){let o=0,a=1<0){let $=i[d];if(O.allows($)&&(e.token.value==-1||e.token.value==$||OQ($,e.token.value,n,s))){e.acceptToken($);break}}let c=e.next,h=0,f=i[o+2];if(e.next<0&&f>h&&i[l+f*3-3]==65535){o=i[l+f*3-1];continue e}for(;h>1,$=l+d+(d<<1),p=i[$],m=i[$+1]||65536;if(c=m)h=d+1;else{o=i[$+2],e.advance();continue e}}break}}function Zf(i,e,t){for(let r=e,n;(n=i[r])!=65535;r++)if(n==t)return r-e;return-1}function OQ(i,e,t,r){let n=Zf(t,r,e);return n<0||Zf(t,r,i)e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(i.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:i.length}}var Wa=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?Vf(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Vf(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 Y){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}}},Aa=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Ai)}getActions(e){let t=0,r=null,{parser:n}=e.p,{tokenizers:s}=n,o=n.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,O=0;for(let l=0;lh.end+25&&(O=Math.max(h.lookAhead,O)),h.value!=0)){let f=t;if(h.extended>-1&&(t=this.addActions(e,h.extended,h.end,t)),t=this.addActions(e,h.value,h.end,t),!c.extend&&(r=h,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return O&&e.setLookAhead(O),!r&&e.pos==this.stream.end&&(r=new Ai,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ai,{pos:r,p:n}=e;return t.start=r,t.end=Math.min(r+1,n.stream.end),t.value=r==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,r){let n=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(n,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(n+1)}putAction(e,t,r,n){for(let s=0;se.bufferLength*4?new Wa(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],n,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)r.push(a);else{if(this.advanceStack(a,r,e))continue;{n||(n=[],s=[]),n.push(a);let O=this.tokens.getMainToken(a);s.push(O.value,O.end)}}break}}if(!r.length){let o=n&&lQ(n);if(o)return Ce&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ce&&n&&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&&n){let o=this.stoppedAt!=null&&n[0].pos>this.stoppedAt?n[0]:this.runRecovery(n,s,r);if(o)return Ce&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,O)=>O.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let o=0;o500&&l.buffer.length>500)if((a.score-l.score||a.buffer.length-l.buffer.length)>0)r.splice(O--,1);else{r.splice(o--,1);continue e}}}r.length>12&&(r.sort((o,a)=>a.score-o.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let l=e.curContext&&e.curContext.tracker.strict,c=l?e.curContext.hash:0;for(let h=this.fragments.nodeAt(n);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?s.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!l||(h.prop(V.contextHash)||0)==c))return e.useNode(h,f),Ce&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(h.type.id)})`),!0;if(!(h instanceof Y)||h.children.length==0||h.positions[0]>0)break;let d=h.children[0];if(d instanceof Y&&h.positions[0]==0)h=d;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ce&&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;ln?t.push($):r.push($)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return zf(e,t),!0}}runRecovery(e,t,r){let n=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),Ce&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let h=a.split(),f=c;for(let d=0;d<10&&h.forceReduce()&&(Ce&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));d++)Ce&&(f=this.stackID(h)+" -> ");for(let d of a.recoverByInsert(O))Ce&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,r);this.stream.end>a.pos?(l==a.pos&&(l++,O=0),a.recoverByDelete(O,l),Ce&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(O)})`),zf(a,r)):(!n||n.scorei,jt=class{constructor(e){this.start=e.start,this.shift=e.shift||za,this.reduce=e.reduce||za,this.reuse=e.reuse||za,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]),n=[];for(let a=0;a=0)s(c,O,a[l++]);else{let h=a[l+-c];for(let f=-c;f>0;f--)s(a[l++],O,h);l++}}}this.nodeSet=new Tt(t.map((a,O)=>ie.define({name:O>=this.minRepeatTerm?void 0:a,id:O,props:n[O],top:r.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=wr(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 Lt(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,r){let n=new Ua(this,e,t,r);for(let s of this.wrappers)n=s(n,e,t,r);return n}getGoto(e,t,r=!1){let n=this.goto;if(t>=n[0])return-1;for(let s=n[t+1];;){let o=n[s++],a=o&1,O=n[s++];if(a&&r)return O;for(let l=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),n=r?t(r):void 0;for(let s=this.stateSlot(e,1);n==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=kt(this.data,s+2);else break;n=t(kt(this.data,s+1))}return n}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=kt(this.data,r+2);else break;if((this.data[r+2]&1)==0){let n=this.data[r+1];t.some((s,o)=>o&1&&s==n)||t.push(this.data[r],n)}}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 r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let n=e.tokenizers.find(s=>s.from==r);return n?n.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,n)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return t.specializers[n]=_f(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),r=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(r[o]=!0)}let n=null;for(let s=0;sr)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,r)<<1|e}return i.get}var cQ=122,Cf=1,hQ=123,fQ=124,Wf=2,uQ=125,dQ=3,$Q=4,Af=[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],pQ=58,mQ=40,Uf=95,gQ=91,Jn=45,QQ=46,SQ=35,PQ=37,TQ=38,bQ=92,yQ=10,wQ=42;function xr(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function Ea(i){return i>=48&&i<=57}function qf(i){return Ea(i)||i>=97&&i<=102||i>=65&&i<=70}var Mf=(i,e,t)=>(r,n)=>{for(let s=!1,o=0,a=0;;a++){let{next:O}=r;if(xr(O)||O==Jn||O==Uf||s&&Ea(O))!s&&(O!=Jn||a>0)&&(s=!0),o===a&&O==Jn&&o++,r.advance();else if(O==bQ&&r.peek(1)!=yQ){if(r.advance(),qf(r.next)){do r.advance();while(qf(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(o==2&&n.canShift(Wf)?e:O==mQ?t:i);break}}},xQ=new ee(Mf(hQ,Wf,fQ)),kQ=new ee(Mf(uQ,dQ,$Q)),XQ=new ee(i=>{if(Af.includes(i.peek(-1))){let{next:e}=i;(xr(e)||e==Uf||e==SQ||e==QQ||e==wQ||e==gQ||e==pQ&&xr(i.peek(1))||e==Jn||e==TQ)&&i.acceptToken(cQ)}}),vQ=new ee(i=>{if(!Af.includes(i.peek(-1))){let{next:e}=i;if(e==PQ&&(i.advance(),i.acceptToken(Cf)),xr(e)){do i.advance();while(xr(i.next)||Ea(i.next));i.acceptToken(Cf)}}}),RQ=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}),ZQ={__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},VQ={__proto__:null,or:98,and:98,not:106,only:106,layer:170},zQ={__proto__:null,selector:112,layer:166},_Q={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},YQ={__proto__:null,to:207},Ef=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:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5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<%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!hZQ[i]||-1},{term:125,get:i=>VQ[i]||-1},{term:4,get:i=>zQ[i]||-1},{term:25,get:i=>_Q[i]||-1},{term:123,get:i=>YQ[i]||-1}],tokenPrec:1963});var La=null;function Ga(){if(!La&&typeof document=="object"&&document.body){let{style:i}=document.body,e=[],t=new Set;for(let r in i)r!="cssText"&&r!="cssFloat"&&typeof i[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())),t.has(r)||(e.push(r),t.add(r)));La=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return La||[]}var Lf=["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})),Gf=["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}))),CQ=["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})),qQ=["@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})),Xt=/^(\w[\w-]*|-\w[\w-]*|)$/,WQ=/^-(-[\w-]*)?$/;function AQ(i,e){var t;if((i.name=="("||i.type.isError)&&(i=i.parent||i),i.name!="ArgList")return!1;let r=(t=i.parent)===null||t===void 0?void 0:t.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}var jf=new _i,UQ=["Declaration"];function MQ(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function If(i,e,t){if(e.to-e.from>4096){let r=jf.get(e);if(r)return r;let n=[],s=new Set,o=e.cursor(A.IncludeAnonymous);if(o.firstChild())do for(let a of If(i,o.node,t))s.has(a.label)||(s.add(a.label),n.push(a));while(o.nextSibling());return jf.set(e,n),n}else{let r=[],n=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(UQ)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=i.sliceString(s.from,s.to);n.has(a)||(n.add(a),r.push({label:a,type:"variable"}))}}),r}}var EQ=i=>e=>{let{state:t,pos:r}=e,n=G(t).resolveInner(r,-1),s=n.type.isError&&n.from==n.to-1&&t.doc.sliceString(n.from,n.to)=="-";if(n.name=="PropertyName"||(s||n.name=="TagName")&&/^(Block|Styles)$/.test(n.resolve(n.to).name))return{from:n.from,options:Ga(),validFor:Xt};if(n.name=="ValueName")return{from:n.from,options:Gf,validFor:Xt};if(n.name=="PseudoClassName")return{from:n.from,options:Lf,validFor:Xt};if(i(n)||(e.explicit||s)&&AQ(n,t.doc))return{from:i(n)||s?n.from:r,options:If(t.doc,MQ(n),i),validFor:WQ};if(n.name=="TagName"){for(let{parent:O}=n;O;O=O.parent)if(O.name=="Block")return{from:n.from,options:Ga(),validFor:Xt};return{from:n.from,options:CQ,validFor:Xt}}if(n.name=="AtKeyword")return{from:n.from,options:qQ,validFor:Xt};if(!e.explicit)return null;let o=n.resolve(r),a=o.childBefore(r);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:r,options:Lf,validFor:Xt}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:r,options:Gf,validFor:Xt}:o.name=="Block"||o.name=="Styles"?{from:r,options:Ga(),validFor:Xt}:null},LQ=EQ(i=>i.name=="VariableName"),kr=ue.define({name:"css",parser:Ef.configure({props:[de.add({Declaration:Ye()}),Se.add({"Block KeyframeList":Mt})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function es(){return new oe(kr,kr.data.of({autocomplete:LQ}))}var GQ=se({String:u.string,Number:u.number,"True False":u.bool,PropertyName:u.propertyName,Null:u.null,", :":u.separator,"[ ]":u.squareBracket,"{ }":u.brace}),Bf=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:[GQ],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 jQ=ue.define({name:"json",parser:Bf.configure({props:[de.add({Object:Ye({except:/^\s*\}/}),Array:Ye({except:/^\s*\]/})}),Se.add({"Object Array":Mt})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Df(){return new oe(jQ)}var IQ=316,BQ=317,Nf=1,DQ=2,NQ=3,FQ=4,HQ=318,KQ=320,JQ=321,eS=5,tS=6,iS=0,Ia=[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],Ff=125,rS=59,Ba=47,nS=42,sS=43,oS=45,aS=60,OS=44,lS=63,cS=46,hS=91,fS=new jt({start:!1,shift(i,e){return e==eS||e==tS||e==KQ?i:e==JQ},strict:!1}),uS=new ee((i,e)=>{let{next:t}=i;(t==Ff||t==-1||e.context)&&i.acceptToken(HQ)},{contextual:!0,fallback:!0}),dS=new ee((i,e)=>{let{next:t}=i,r;Ia.indexOf(t)>-1||t==Ba&&((r=i.peek(1))==Ba||r==nS)||t!=Ff&&t!=rS&&t!=-1&&!e.context&&i.acceptToken(IQ)},{contextual:!0}),$S=new ee((i,e)=>{i.next==hS&&!e.context&&i.acceptToken(BQ)},{contextual:!0}),pS=new ee((i,e)=>{let{next:t}=i;if(t==sS||t==oS){if(i.advance(),t==i.next){i.advance();let r=!e.context&&e.canShift(Nf);i.acceptToken(r?Nf:DQ)}}else t==lS&&i.peek(1)==cS&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(NQ))},{contextual:!0});function ja(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}var mS=new ee((i,e)=>{if(i.next!=aS||!e.dialectEnabled(iS)||(i.advance(),i.next==Ba))return;let t=0;for(;Ia.indexOf(i.next)>-1;)i.advance(),t++;if(ja(i.next,!0)){for(i.advance(),t++;ja(i.next,!1);)i.advance(),t++;for(;Ia.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==OS)return;for(let r=0;;r++){if(r==7){if(!ja(i.next,!0))return;break}if(i.next!="extends".charCodeAt(r))break;i.advance(),t++}}i.acceptToken(FQ,-t)}),gS=se({"get set async static":u.modifier,"for while do if else switch try catch finally return throw break continue default case defer":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)}),QS={__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,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},SS={__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},PS={__proto__:null,"<":193},Hf=pe.deserialize({version:14,states:"$F|Q%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'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#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8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < 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 defer 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:380,context:fS,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,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"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:[gS],skippedNodes:[0,5,6,278],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}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o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okenPrec:15201});var ts=class{constructor(e,t,r,n){this.state=e,this.pos=t,this.explicit=r,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=G(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),n=t.text.slice(r-t.from,this.pos-t.from),s=n.search(bS(e,!1));return s<0?null:{from:r+s,to:this.pos,text:n.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}};function Kf(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 TS(i){let e=Object.create(null),t=Object.create(null);for(let{label:n}of i){e[n[0]]=!0;for(let s=1;stypeof n=="string"?{label:n}:n),[t,r]=e.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:TS(e);return n=>{let s=n.matchBefore(r);return s||n.explicit?{from:s?s.from:n.pos,options:e,validFor:t}:null}}function tu(i,e){return t=>{for(let r=G(t.state).resolveInner(t.pos,-1);r;r=r.parent){if(i.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(t)}}function bS(i,e){var t;let{source:r}=i,n=e&&r[0]!="^",s=r[r.length-1]!="$";return!n&&!s?i:new RegExp(`${n?"^":""}(?:${r})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}var yS=ye.define();var Yb=typeof navigator=="object"&&/Win/.test(navigator.platform);var wS=k.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"}}}),Da=class{constructor(e,t,r,n){this.field=e,this.line=t,this.from=r,this.to=n}},Na=class i{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,le.TrackDel),r=e.mapPos(this.to,1,le.TrackDel);return t==null||r==null?null:new i(this.field,t,r)}},Fa=class i{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],n=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let O of this.lines){if(r.length){let l=o,c=/^\t*/.exec(O)[0].length;for(let h=0;hnew Na(O.field,n[O.line]+O.from,n[O.line]+O.to));return{text:r,ranges:a}}static parse(e){let t=[],r=[],n=[],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,c=O.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h=l&&f.field++}for(let h of n)if(h.line==r.length&&h.from>s.index){let f=s[2]?3+(s[1]||"").length:2;h.from-=f,h.to-=f}n.push(new Da(l,r.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+O+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,O,l)=>{for(let c of n)c.line==r.length&&c.from>l&&(c.from--,c.to--);return O}),r.push(o)}return new i(r,n)}},xS=E.widget({widget:new class extends St{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),kS=E.mark({class:"cm-snippetField"}),Ui=class i{constructor(e,t){this.ranges=e,this.active=t,this.deco=E.set(e.map(r=>(r.from==r.to?xS:kS).range(r.from,r.to)),!0)}map(e){let t=[];for(let r of this.ranges){let n=r.map(e);if(!n)return null;t.push(n)}return new i(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(r=>r.field==this.active&&r.from<=t.from&&r.to>=t.to))}},vr=B.define({map(i,e){return i&&i.map(e)}}),XS=B.define(),Xr=be.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(vr))return t.value;if(t.is(XS)&&i)return new Ui(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=>k.decorations.from(i,e=>e?e.deco:E.none)});function Ha(i,e){return Q.create(i.filter(t=>t.field==e).map(t=>Q.range(t.from,t.to)))}function vS(i){let e=Fa.parse(i);return(t,r,n,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,n),{main:O}=t.state.selection,l={changes:{from:n,to:s==O.from?O.to:s,insert:q.of(o)},scrollIntoView:!0,annotations:r?[yS.of(r),re.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=Ha(a,0)),a.some(c=>c.field>0)){let c=new Ui(a,0),h=l.effects=[vr.of(c)];t.state.field(Xr,!1)===void 0&&h.push(B.appendConfig.of([Xr,_S,YS,wS]))}t.dispatch(t.state.update(l))}}function iu(i){return({state:e,dispatch:t})=>{let r=e.field(Xr,!1);if(!r||i<0&&r.active==0)return!1;let n=r.active+i,s=i>0&&!r.ranges.some(o=>o.field==n+i);return t(e.update({selection:Ha(r.ranges,n),effects:vr.of(s?null:new Ui(r.ranges,n)),scrollIntoView:!0})),!0}}var RS=({state:i,dispatch:e})=>i.field(Xr,!1)?(e(i.update({effects:vr.of(null)})),!0):!1,ZS=iu(1),VS=iu(-1);var zS=[{key:"Tab",run:ZS,shift:VS},{key:"Escape",run:RS}],Jf=v.define({combine(i){return i.length?i[0]:zS}}),_S=at.highest(ct.compute([Jf],i=>i.facet(Jf)));function Pe(i,e){return{...e,apply:vS(i)}}var YS=k.domEventHandlers({mousedown(i,e){let t=e.state.field(Xr,!1),r;if(!t||(r=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let n=t.ranges.find(s=>s.from<=r&&s.to>=r);return!n||n.field==t.active?!1:(e.dispatch({selection:Ha(t.ranges,n.field),effects:vr.of(t.ranges.some(s=>s.field>n.field)?new Ui(t.ranges,n.field):null),scrollIntoView:!0}),!0)}});var ru=new class extends Me{};ru.startSide=1;ru.endSide=-1;var Cb=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent);var au=[Pe("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Pe("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Pe("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Pe("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Pe("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Pe(`try { \${} } catch (\${error}) { \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),Te("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Te(`if (\${}) { +}`,{label:"try",detail:"/ catch block",type:"keyword"}),Pe("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Pe(`if (\${}) { \${} } else { \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),Te(`class \${name} { +}`,{label:"if",detail:"/ else block",type:"keyword"}),Pe(`class \${name} { constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Te('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Te('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],RS=tu.concat([Te("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Te("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Te("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Kf=new wi,iu=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function vn(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}var ZS=["FunctionDeclaration"],VS={FunctionDeclaration:vn("function"),ClassDeclaration:vn("class"),ClassExpression:()=>!0,EnumDeclaration:vn("constant"),TypeAliasDeclaration:vn("type"),NamespaceDeclaration:vn("namespace"),VariableDefinition(i,e){i.matchContext(ZS)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function nu(i,e){let t=Kf.get(e);if(t)return t;let n=[],r=!0;function s(o,a){let O=i.sliceString(o.from,o.to);n.push({label:O,type:a})}return e.cursor(L.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let a=VS[o.name];if(a&&a(o,s)||iu.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of nu(i,o.node))n.push(a);return!1}}),Kf.set(e,n),n}var Jf=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,ru=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function YS(i){let e=G(i.state).resolveInner(i.pos,-1);if(ru.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Jf.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)iu.has(r.name)&&(n=n.concat(nu(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:Jf}}var tt=ue.define({name:"javascript",parser:jf.configure({props:[de.add({IfStatement:_e({except:/^\s*({|else\b)/}),TryStatement:_e({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:uc,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},Block:Wr({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":_e({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),be.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ut,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),su={test:i=>/^JSX/.test(i.name),facet:Ri({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Ca=tt.configure({dialect:"ts"},"typescript"),qa=tt.configure({dialect:"jsx",props:[Ar.add(i=>i.isTop?[su]:void 0)]}),Aa=tt.configure({dialect:"jsx ts",props:[Ar.add(i=>i.isTop?[su]:void 0)]},"typescript"),ou=i=>({label:i,type:"keyword"}),au="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(ou),_S=au.concat(["declare","implements","private","protected","public"].map(ou));function hi(i={}){let e=i.jsx?i.typescript?Aa:qa:i.typescript?Ca:tt,t=i.typescript?RS.concat(_S):tu.concat(au);return new oe(e,[tt.data.of({autocomplete:Nf(ru,If(t))}),tt.data.of({autocomplete:YS}),i.jsx?qS:[]])}function zS(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function eu(i,e,t=i.length){for(let n=e?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return i.sliceString(n.from,Math.min(n.to,t));return""}var CS=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),qS=v.inputHandler.of((i,e,t,n,r)=>{if((CS?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||n!=">"&&n!="/"||!tt.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,a=o.changeByRange(O=>{var l;let{head:h}=O,c=G(o).resolveInner(h-1,-1),f;if(c.name=="JSXStartTag"&&(c=c.parent),!(o.doc.sliceString(h-1,h)!=n||c.name=="JSXAttributeValue"&&c.to>h)){if(n==">"&&c.name=="JSXFragmentTag")return{range:O,changes:{from:h,insert:""}};if(n=="/"&&c.name=="JSXStartCloseTag"){let d=c.parent,$=d.parent;if($&&d.from==h-2&&((f=eu(o.doc,$.firstChild,h))||((l=$.firstChild)===null||l===void 0?void 0:l.name)=="JSXFragmentTag")){let p=`${f}>`;return{range:S.cursor(h+p.length,-1),changes:{from:h,insert:p}}}}else if(n==">"){let d=zS(c);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(h,h+2))&&(f=eu(o.doc,d,h)))return{range:O,changes:{from:h,insert:``}}}}return{range:O}});return a.changes.empty?!1:(i.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var AS=55,WS=1,US=56,MS=2,ES=57,GS=3,Ou=4,LS=5,Ga=6,pu=7,mu=8,Qu=9,gu=10,jS=11,DS=12,BS=13,Wa=58,IS=14,NS=15,lu=59,Su=21,FS=23,Pu=24,HS=25,Ma=27,yu=28,KS=29,JS=32,eP=35,tP=37,iP=38,nP=0,rP=1,sP={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},oP={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},hu={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function aP(i){return i==45||i==46||i==58||i>=65&&i<=90||i==95||i>=97&&i<=122||i>=161}var cu=null,fu=null,uu=0;function Ea(i,e){let t=i.pos+e;if(uu==t&&fu==i)return cu;let n=i.peek(e),r="";for(;aP(n);)r+=String.fromCharCode(n),n=i.peek(++e);return fu=i,uu=t,cu=r?r.toLowerCase():n==OP||n==lP?void 0:null}var bu=60,Kr=62,La=47,OP=63,lP=33,hP=45;function du(i,e){this.name=i,this.parent=e}var cP=[Ga,gu,pu,mu,Qu],fP=new Lt({start:null,shift(i,e,t,n){return cP.indexOf(e)>-1?new du(Ea(n,1)||"",i):i},reduce(i,e){return e==Su&&i?i.parent:i},reuse(i,e,t,n){let r=e.type.id;return r==Ga||r==tP?new du(Ea(n,1)||"",i):i},strict:!1}),uP=new J((i,e)=>{if(i.next!=bu){i.next<0&&e.context&&i.acceptToken(Wa);return}i.advance();let t=i.next==La;t&&i.advance();let n=Ea(i,0);if(n===void 0)return;if(!n)return i.acceptToken(t?NS:IS);let r=e.context?e.context.name:null;if(t){if(n==r)return i.acceptToken(jS);if(r&&oP[r])return i.acceptToken(Wa,-2);if(e.dialectEnabled(nP))return i.acceptToken(DS);for(let s=e.context;s;s=s.parent)if(s.name==n)return;i.acceptToken(BS)}else{if(n=="script")return i.acceptToken(pu);if(n=="style")return i.acceptToken(mu);if(n=="textarea")return i.acceptToken(Qu);if(sP.hasOwnProperty(n))return i.acceptToken(gu);r&&hu[r]&&hu[r][n]?i.acceptToken(Wa,-1):i.acceptToken(Ga)}},{contextual:!0}),dP=new J(i=>{for(let e=0,t=0;;t++){if(i.next<0){t&&i.acceptToken(lu);break}if(i.next==hP)e++;else if(i.next==Kr&&e>=2){t>=3&&i.acceptToken(lu,-2);break}else e=0;i.advance()}});function $P(i){for(;i;i=i.parent)if(i.name=="svg"||i.name=="math")return!0;return!1}var pP=new J((i,e)=>{if(i.next==La&&i.peek(1)==Kr){let t=e.dialectEnabled(rP)||$P(e.context);i.acceptToken(t?LS:Ou,2)}else i.next==Kr&&i.acceptToken(Ou,1)});function ja(i,e,t){let n=2+i.length;return new J(r=>{for(let s=0,o=0,a=0;;a++){if(r.next<0){a&&r.acceptToken(e);break}if(s==0&&r.next==bu||s==1&&r.next==La||s>=2&&so?r.acceptToken(e,-o):r.acceptToken(t,-(o-2));break}else if((r.next==10||r.next==13)&&a){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}var mP=ja("script",AS,WS),QP=ja("style",US,MS),gP=ja("textarea",ES,GS),SP=se({"Text RawText IncompleteTag IncompleteCloseTag":u.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":u.angleBracket,TagName:u.tagName,"MismatchedCloseTag/TagName":[u.tagName,u.invalid],AttributeName:u.attributeName,"AttributeValue UnquotedAttributeValue":u.attributeValue,Is:u.definitionOperator,"EntityReference CharacterReference":u.character,Comment:u.blockComment,ProcessingInst:u.processingInstruction,DoctypeDecl:u.documentMeta}),Tu=pe.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#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^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:fP,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[SP],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!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,c=h.firstChild,f=c&&$u(c,O),d;if(f){for(let $ of s)if($.tag==f&&(!$.attrs||$.attrs(d||(d=xu(c,O))))){let p=h.lastChild,m=p.type.id==iP?p.from:h.to;if(m>c.to)return{parser:$.parser,overlay:[{from:c.to,to:m}]}}}}if(o&&l==Pu){let h=a.node,c;if(c=h.firstChild){let f=o[O.read(c.from,c.to)];if(f)for(let d of f){if(d.tagName&&d.tagName!=$u(h.parent,O))continue;let $=h.lastChild;if($.type.id==Ma){let p=$.from+1,m=$.lastChild,Q=$.to-(m&&m.isError?0:1);if(Q>p)return{parser:d.parser,overlay:[{from:p,to:Q}]}}else if($.type.id==yu)return{parser:d.parser,overlay:[{from:$.from,to:$.to}]}}}}return null})}var Rn=["_blank","_self","_top","_parent"],Ba=["ascii","utf-8","utf-16","latin1","latin1"],Ia=["get","post","put","delete"],Na=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Ce=["true","false"],V={},PP={a:{attrs:{href:null,ping:null,type:null,media:null,target:Rn,hreflang:null}},abbr:V,address:V,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:V,aside:V,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:V,base:{attrs:{href:null,target:Rn}},bdi:V,bdo:V,blockquote:{attrs:{cite:null}},body:V,br:V,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Na,formmethod:Ia,formnovalidate:["novalidate"],formtarget:Rn,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:V,center:V,cite:V,code:V,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:V,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:V,div:V,dl:V,dt:V,em:V,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:V,figure:V,footer:V,form:{attrs:{action:null,name:null,"accept-charset":Ba,autocomplete:["on","off"],enctype:Na,method:Ia,novalidate:["novalidate"],target:Rn}},h1:V,h2:V,h3:V,h4:V,h5:V,h6:V,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:V,hgroup:V,hr:V,html:{attrs:{manifest:null}},i:V,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Na,formmethod:Ia,formnovalidate:["novalidate"],formtarget:Rn,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:V,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:V,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:V,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Ba,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:V,noscript:V,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:V,param:{attrs:{name:null,value:null}},pre:V,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:V,rt:V,ruby:V,samp:V,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Ba}},section:V,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:V,source:{attrs:{src:null,type:null,media:null}},span:V,strong:V,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:V,summary:V,sup:V,table:V,tbody:V,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:V,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:V,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:V,time:{attrs:{datetime:null}},title:V,tr:V,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:V,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:V},vu={accesskey:null,class:null,contenteditable:Ce,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Ce,autocorrect:Ce,autocapitalize:Ce,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Ce,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Ce,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Ce,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Ce,"aria-hidden":Ce,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Ce,"aria-multiselectable":Ce,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Ce,"aria-relevant":null,"aria-required":Ce,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Ru="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(i=>"on"+i);for(let i of Ru)vu[i]=null;var ci=class{constructor(e,t){this.tags={...PP,...e},this.globalAttrs={...vu,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};ci.default=new ci;function _i(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)):""}function zi(i,e=!1){for(;i;i=i.parent)if(i.name=="Element")if(e)e=!1;else return i;return null}function Zu(i,e,t){let n=t.tags[_i(i,zi(e))];return n?.children||t.allTags}function Fa(i,e){let t=[];for(let n=zi(e);n&&!n.type.isTop;n=zi(n.parent)){let r=_i(i,n);if(r&&n.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&t.push(r)}return t}var Vu=/^[:\-\.\w\u00b7-\uffff]*$/;function ku(i,e,t,n,r){let s=/\s*>/.test(i.sliceDoc(r,r+5))?"":">",o=zi(t,t.name=="StartTag"||t.name=="TagName");return{from:n,to:r,options:Zu(i.doc,o,e).map(a=>({label:a,type:"type"})).concat(Fa(i.doc,t).map((a,O)=>({label:"/"+a,apply:"/"+a+s,type:"type",boost:99-O}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function wu(i,e,t,n){let r=/\s*>/.test(i.sliceDoc(n,n+5))?"":">";return{from:t,to:n,options:Fa(i.doc,e).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:Vu}}function yP(i,e,t,n){let r=[],s=0;for(let o of Zu(i.doc,t,e))r.push({label:"<"+o,type:"type"});for(let o of Fa(i.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:n,to:n,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function bP(i,e,t,n,r){let s=zi(t),o=s?e.tags[_i(i.doc,s)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],O=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:r,options:O.map(l=>({label:l,type:"property"})),validFor:Vu}}function TP(i,e,t,n,r){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),a=[],O;if(o){let l=i.sliceDoc(o.from,o.to),h=e.globalAttrs[l];if(!h){let c=zi(t),f=c?e.tags[_i(i.doc,c)]:null;h=f?.attrs&&f.attrs[l]}if(h){let c=i.sliceDoc(n,r).toLowerCase(),f='"',d='"';/^['"]/.test(c)?(O=c[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",d=i.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),n++):O=/^[^\s<>='"]*$/;for(let $ of h)a.push({label:$,apply:f+$+d,type:"constant"})}}return{from:n,to:r,options:a,validFor:O}}function Yu(i,e){let{state:t,pos:n}=e,r=G(t).resolveInner(n,-1),s=r.resolve(n);for(let o=n,a;s==r&&(a=r.childBefore(o));){let O=a.lastChild;if(!O||!O.type.isError||O.fromYu(n,r)}var kP=tt.parser.configure({top:"SingleExpression"}),zu=[{tag:"script",attrs:i=>i.type=="text/typescript"||i.lang=="ts",parser:Ca.parser},{tag:"script",attrs:i=>i.type=="text/babel"||i.type=="text/jsx",parser:qa.parser},{tag:"script",attrs:i=>i.type=="text/typescript-jsx",parser:Aa.parser},{tag:"script",attrs(i){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(i.type)},parser:kP},{tag:"script",attrs(i){return!i.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(i.type)},parser:tt.parser},{tag:"style",attrs(i){return(!i.lang||i.lang=="css")&&(!i.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(i.type))},parser:kn.parser}],Cu=[{name:"style",parser:kn.parser.configure({top:"Styles"})}].concat(Ru.map(i=>({name:i,parser:tt.parser}))),qu=ue.define({name:"html",parser:Tu.configure({props:[de.add({Element(i){let e=/^(\s*)(<\/)?/.exec(i.textAfter);return i.node.to<=i.pos+e[0].length?i.continue():i.lineIndent(i.node.from)+(e[2]?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit},Document(i){if(i.pos+/\s*/.exec(i.textAfter)[0].lengthi.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Jr=qu.configure({wrap:Da(zu,Cu)});function Ci(i={}){let e="",t;i.matchClosingTags===!1&&(e="noMatch"),i.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(i.nestedLanguages&&i.nestedLanguages.length||i.nestedAttributes&&i.nestedAttributes.length)&&(t=Da((i.nestedLanguages||[]).concat(zu),(i.nestedAttributes||[]).concat(Cu)));let n=t?qu.configure({wrap:t,dialect:e}):e?Jr.configure({dialect:e}):Jr;return new oe(n,[Jr.data.of({autocomplete:xP(i)}),i.autoCloseTags!==!1?wP:[],hi().support,Fr().support])}var Xu=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),wP=v.inputHandler.of((i,e,t,n,r)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!Jr.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,a=o.changeByRange(O=>{var l,h,c;let f=o.doc.sliceString(O.from-1,O.to)==n,{head:d}=O,$=G(o).resolveInner(d,-1),p;if(f&&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=_i(o.doc,m.parent,d))&&!Xu.has(p)){let Q=d+(o.doc.sliceString(d,d+1)===">"?1:0),g=``;return{range:O,changes:{from:d,to:Q,insert:g}}}}else if(f&&n=="/"&&$.name=="IncompleteCloseTag"){let m=$.parent;if($.from==d-2&&((c=m.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(p=_i(o.doc,m,d))&&!Xu.has(p)){let Q=d+(o.doc.sliceString(d,d+1)===">"?1:0),g=`${p}>`;return{range:S.cursor(d+g.length,-1),changes:{from:d,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 is=class i{static create(e,t,n,r,s){let o=r+(r<<8)+e+(t<<4)|0;return new i(e,t,n,o,s,[],[])}constructor(e,t,n,r,s,o,a){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=s,this.children=o,this.positions=a,this.hashProp=[[Y.contextHash,r]]}addChild(e,t){e.prop(Y.contextHash)!=this.hash&&(e=new z(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new z(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(r,s,o)=>new z(ie.none,r,s,o,this.hashProp)})}},b;(function(i){i[i.Document=1]="Document",i[i.CodeBlock=2]="CodeBlock",i[i.FencedCode=3]="FencedCode",i[i.Blockquote=4]="Blockquote",i[i.HorizontalRule=5]="HorizontalRule",i[i.BulletList=6]="BulletList",i[i.OrderedList=7]="OrderedList",i[i.ListItem=8]="ListItem",i[i.ATXHeading1=9]="ATXHeading1",i[i.ATXHeading2=10]="ATXHeading2",i[i.ATXHeading3=11]="ATXHeading3",i[i.ATXHeading4=12]="ATXHeading4",i[i.ATXHeading5=13]="ATXHeading5",i[i.ATXHeading6=14]="ATXHeading6",i[i.SetextHeading1=15]="SetextHeading1",i[i.SetextHeading2=16]="SetextHeading2",i[i.HTMLBlock=17]="HTMLBlock",i[i.LinkReference=18]="LinkReference",i[i.Paragraph=19]="Paragraph",i[i.CommentBlock=20]="CommentBlock",i[i.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",i[i.Escape=22]="Escape",i[i.Entity=23]="Entity",i[i.HardBreak=24]="HardBreak",i[i.Emphasis=25]="Emphasis",i[i.StrongEmphasis=26]="StrongEmphasis",i[i.Link=27]="Link",i[i.Image=28]="Image",i[i.InlineCode=29]="InlineCode",i[i.HTMLTag=30]="HTMLTag",i[i.Comment=31]="Comment",i[i.ProcessingInstruction=32]="ProcessingInstruction",i[i.Autolink=33]="Autolink",i[i.HeaderMark=34]="HeaderMark",i[i.QuoteMark=35]="QuoteMark",i[i.ListMark=36]="ListMark",i[i.LinkMark=37]="LinkMark",i[i.EmphasisMark=38]="EmphasisMark",i[i.CodeMark=39]="CodeMark",i[i.CodeText=40]="CodeText",i[i.CodeInfo=41]="CodeInfo",i[i.LinkTitle=42]="LinkTitle",i[i.LinkLabel=43]="LinkLabel",i[i.URL=44]="URL"})(b||(b={}));var Ja=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},eO=class{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Vn(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let n=(i.type==b.OrderedList?dO:uO)(t,e,!1);return n>0&&(i.type!=b.BulletList||fO(t,e,!1)<0)&&t.text.charCodeAt(t.pos+n-1)==i.value}var Nu={[b.Blockquote](i,e,t){return t.next!=62?!1:(t.markers.push(W(b.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Be(t.text.charCodeAt(t.pos+1))?2:1)),i.end=e.lineStart+t.text.length,!0)},[b.ListItem](i,e,t){return t.indent-1?!1:(t.moveBaseColumn(t.baseIndent+i.value),!0)},[b.OrderedList]:Au,[b.BulletList]:Au,[b.Document](){return!0}};function Be(i){return i==32||i==9||i==10||i==13}function Vn(i,e=0){for(;et&&Be(i.charCodeAt(e-1));)e--;return e}function Fu(i){if(i.next!=96&&i.next!=126)return-1;let e=i.pos+1;for(;e-1&&i.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(rd.SetextHeading)>-1||n<3?-1:1}function Ku(i,e){for(let t=i.stack.length-1;t>=0;t--)if(i.stack[t].type==e)return!0;return!1}function uO(i,e,t){return(i.next==45||i.next==43||i.next==42)&&(i.pos==i.text.length-1||Be(i.text.charCodeAt(i.pos+1)))&&(!t||Ku(e,b.BulletList)||i.skipSpace(i.pos+2)=48&&r<=57;){n++;if(n==i.text.length)return-1;r=i.text.charCodeAt(n)}return n==i.pos||n>i.pos+9||r!=46&&r!=41||ni.pos+1||i.next!=49)?-1:n+1-i.pos}function Ju(i){if(i.next!=35)return-1;let e=i.pos+1;for(;e6?-1:t}function ed(i){if(i.next!=45&&i.next!=61||i.indent>=i.baseIndent+4)return-1;let e=i.pos+1;for(;e/,id=/\?>/,iO=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(s)return i.append(W(b.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return i.append(W(b.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(b.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=zn.test(r),a=zn.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?ad:Od,t,n,(f?1:0)|(d?2:0)))},HardBreak(i,e,t){if(e==92&&i.char(t+1)==10)return i.append(W(b.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(b.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(aO,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==aO)){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]=RP(i,s,r.type==qi?b.Link:b.Image,r.from,t+1);if(r.type==qi)for(let a=0;ae?W(b.URL,e+t,s+t):s==i.length?null:!1}}function hd(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==aO))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 lO(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=fd(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[b.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(c,t.tree),e.addNode(c,h)}if(t.type.is("Block")&&(ZP.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 fd(i,e){let t=i;for(let n=1;nes[i]),Object.keys(es).map(i=>rd[i]),Object.keys(es),XP,Nu,Object.keys(Ka).map(i=>Ka[i]),Object.keys(Ka),[]);function YP(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 dd(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Xi((r,s)=>{let o=r.type.id;if(e&&(o==b.CodeBlock||o==b.FencedCode)){let a="";if(o==b.FencedCode){let l=r.node.getChild(b.CodeInfo);l&&(a=s.read(l.from,l.to))}let O=e(a);if(O)return{parser:O,overlay:l=>l.type.id==b.CodeText}}else if(t&&(o==b.HTMLBlock||o==b.HTMLTag||o==b.CommentBlock))return{parser:t,overlay:YP(r.node,r.from,r.to)};return null})}}var _P={resolve:"Strikethrough",mark:"StrikethroughMark"},zP={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=zn.test(n),O=zn.test(r);return i.addDelimiter(_P,t,t+2,!o&&(!O||s||a),!s&&(!a||o||O))},after:"Emphasis"}]};function Yn(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 Eu(i,e){for(let t=e;tr instanceof ss)||!Eu(e.text,e.basePos))return!1;let n=i.peekLine();return $d.test(n)&&Yn(i,e.text,e.basePos)==Yn(i,n,e.basePos)},before:"SetextHeading"}]},cO=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}},qP={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 cO:null},after:"SetextHeading"}]},Gu=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Lu=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,AP=/[\w-]+\.[\w-]+($|\/)/,ju=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Du=/\/[a-zA-Z\d@.]+/gy;function Bu(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==")"&&Bu(i,e,n,")")>Bu(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 Iu(i,e){ju.lastIndex=e;let t=ju.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 UP={parseInline:[{name:"Autolink",parse(i,e,t){let n=t-i.offset;if(n&&/\w/.test(i.text[n-1]))return-1;Gu.lastIndex=n;let r=Gu.exec(i.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=WP(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=Iu(i.text,n):(s=Iu(i.text,n+r[0].length),s>-1&&r[0]=="xmpp:"&&(Du.lastIndex=s,r=Du.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)}}]},pd=[CP,qP,zP,UP];function md(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"}}}),Td=new Y,xd=ud.configure({props:[be.add(i=>!i.is("Block")||i.is("Document")||mO(i)!=null||MP(i)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Td.add(mO),de.add({Document:()=>null}),bt.add({Document:bd})]});function mO(i){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(i.name);return e?+e[1]:void 0}function MP(i){return i.name=="OrderedList"||i.name=="BulletList"}function EP(i,e){let t=i;for(;;){let n=t.nextSibling,r;if(!n||(r=mO(n.type))!=null&&r<=e)break;t=n}return t.to}var GP=dc.of((i,e,t)=>{for(let n=G(i).resolveInner(t,-1);n&&!(n.fromt)return{from:t,to:s}}return null});function QO(i){return new fe(bd,i,[],"markdown")}var LP=QO(xd),jP=xd.configure([pd,gd,Qd,Sd,{props:[be.add({Table:(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}]),os=QO(jP);function DP(i,e){return t=>{if(t&&i){let n=null;if(t=/\S*/.exec(t)[0],typeof i=="function"?n=i(t):n=Qn.matchLanguageName(i,t,!0),n instanceof Qn)return n.support?n.support.language.parser:ai.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}var Cn=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(+wd(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function kd(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 Cn(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 Cn(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 Cn(s.parent,O,O+h,o[1],l,c,s))}}return n}function wd(i,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(i.from,i.from+10))}function $O(i,e,t,n=0){for(let r=-1,s=i;;){if(s.name=="ListItem"){let a=wd(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 gO(i,e){let t=/^[ \t]*/.exec(i)[0].length;if(!t||e.facet(Wt)!=" ")return i;let n=ke(i,4,t),r="";for(let s=n;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+i.slice(t)}var BP=(i={})=>({state:e,dispatch:t})=>{let n=G(e),{doc:r}=e,s=null,o=e.changeByRange(a=>{if(!a.empty||!os.isActiveAt(e,a.from,-1)&&!os.isActiveAt(e,a.from,1))return s={range:a};let O=a.from,l=r.lineAt(O),h=kd(n.resolveInner(O,-1),r);for(;h.length&&h[h.length-1].from>O-l.from;)h.pop();if(!h.length)return s={range:a};let c=h[h.length-1];if(c.to-c.spaceAfter.length>O-l.from)return s={range:a};let f=O>=c.to-c.spaceAfter.length&&!/\S/.test(l.text.slice(c.to));if(c.item&&f){let Q=c.node.firstChild,g=c.node.getChild("ListItem","ListItem");if(Q.to>=O||g&&g.to0&&!/[^\s>]/.test(r.lineAt(l.from-1).text)||i.nonTightLists===!1){let P=h.length>1?h[h.length-2]:null,k,y="";P&&P.item?(k=l.from+P.from,y=P.marker(r,1)):k=l.from+(P?P.to:0);let x=[{from:k,to:O,insert:y}];return c.node.name=="OrderedList"&&$O(c.item,r,x,-2),P&&P.node.name=="OrderedList"&&$O(P.item,r,x),{range:S.cursor(k+y.length),changes:x}}else{let P=yd(h,e,l);return{range:S.cursor(O+P.length+1),changes:{from:l.from,insert:P+e.lineBreak}}}}if(c.node.name=="Blockquote"&&f&&l.from){let Q=r.lineAt(l.from-1),g=/>\s*$/.exec(Q.text);if(g&&g.index==c.from){let P=e.changes([{from:Q.from+g.index,to:Q.to},{from:l.from+c.from,to:l.to}]);return{range:a.map(P),changes:P}}}let d=[];c.node.name=="OrderedList"&&$O(c.item,r,d);let $=c.item&&c.item.from]*/.exec(l.text)[0].length>=c.to)for(let Q=0,g=h.length-1;Q<=g;Q++)p+=Q==g&&!$?h[Q].marker(r,1):h[Q].blank(Ql.from&&/\s/.test(l.text.charAt(m-l.from-1));)m--;return p=gO(p,e),NP(c.node,e.doc)&&(p=yd(h,e,l)+e.lineBreak+p),d.push({from:m,to:O,insert:e.lineBreak+p}),{range:S.cursor(m+p.length+1),changes:d}});return s?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},IP=BP();function Pd(i){return i.name=="QuoteMark"||i.name=="ListMark"}function NP(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=G(i),n=null,r=i.changeByRange(s=>{let o=s.from,{doc:a}=i;if(s.empty&&os.isActiveAt(i,s.from)){let O=a.lineAt(o),l=kd(FP(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{var t;let{main:n}=e.state.selection;if(n.empty)return!1;let r=(t=i.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!os.isActiveAt(e.state,n.from,1)))return!1;let s=G(e.state),o=!1;return s.iterate({from:n.from,to:n.to,enter:a=>{(a.from>n.from||t0.test(a.name))&&(o=!0)},leave:a=>{a.to=97&&i<=122||i>=65&&i<=90}function qn(i){return i==95||i>=128||Yd(i)}function PO(i){return i>=48&&i<=55||i>=97&&i<=102||i>=65&&i<=70}var m1={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},Q1=new J(i=>{if(i.next==40){i.advance();let e=0;for(;Vd(i.peek(e));)e++;let t="",n;for(;Yd(n=i.peek(e));)t+=String.fromCharCode(n),e++;for(;Vd(i.peek(e));)e++;i.peek(e)==41&&m1[t.toLowerCase()]&&i.acceptToken(n0)}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(),!qn(i.next))return;let t=String.fromCharCode(i.next);for(;i.advance(),!(!qn(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(O0)}),S1=new J((i,e)=>{i.next==63&&e.canShift(vd)&&i.peek(1)==62&&i.acceptToken(vd)});function P1(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&&PO(i.peek(2)))return PO(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(!PO(n))break}return 0}var y1=new J((i,e)=>{let t=!1;for(;!(i.next==34||i.next<0||i.next==36&&(qn(i.peek(1))||i.peek(1)==123)||i.next==123&&i.peek(1)==36);t=!0){if(i.next==92){let n=P1(i);if(n){if(t)break;return i.acceptToken(o0,n)}}else if(!t&&(i.next==91||i.next==45&&i.peek(1)==62&&qn(i.peek(2))||i.next==63&&i.peek(1)==45&&i.peek(2)==62&&qn(i.peek(3)))&&e.canShift(a0))break;i.advance()}t&&i.acceptToken(s0)}),b1=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}),T1={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},_d=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'#FrOOQO'#Ir'#IrO9cQ`O'#FxOOQO'#Ht'#HtO9kQ`O'#HXO:VQ`O'#FsO:bQ`O'#HfO:mQ`O'#GPO:uQaO'#GQO-RQaO'#G`O-RQaO'#GcO;bOrO'#GfOOQS'#JP'#JPOOQS'#JO'#JOOOQS'#Ie'#IeO/bQ`O'#GmO/bQ`O'#GoO/bQ`O'#GtOhQaO'#GvO;iQ`O'#GwO;nQ`O'#GzO:]Q`O'#G}O;sQeO'#HOO;sQeO'#HPO;sQeO'#HQO;}Q`O'#HROhQ`O'#HVO:]Q`O'#HWO>mQ`O'#HWO;}Q`O'#HXO:]Q`O'#HZO:]Q`O'#H[O:]Q`O'#H]O>rQ`O'#H`O>}Q`O'#HaOQO!$dQ`O,5POOQ#u-E;h-E;hO!1QQ`O,5=tOOO#u,5:_,5:_O!1]O#|O,5:_OOO#u-E;g-E;gOOOO,5>|,5>|OOQ#y1G0T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*|+^,Q,T,Y,c,e,g,m-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v: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:[b1],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!QK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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:[Q1,y1,S1,0,1,2,3,g1],topRules:{Template:[0,73],Program:[1,241]},dynamicPrecedences:{298:1},specialized:[{term:284,get:(i,e)=>Zd(i)<<1,external:Zd},{term:284,get:i=>T1[i]||-1}],tokenPrec:29883});var x1=ue.define({name:"php",parser:_d.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":Wr({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"String BlockComment":()=>null,Statement:_e({except:/^({|end(for|foreach|switch|while)\b)/})}),be.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 zd(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(x1.configure({wrap:t&&Xi(n=>n.type.isTop?{parser:t.parser,overlay:r=>r.name=="Text"}:null),top:i.plain?"Program":"Template"}),e)}var k1=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{|4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O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#X6}#X#Y#4f#Y#o6}#o#p%c#p;'S$};'S;=`&O<%lO$}~#4magPV~O}$}}!O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#g6}#g#hE_#h#o6}#o#p%c#p;'S$};'S;=`&O<%lO$}~#5yagPV~O}$}}!O6}!O!P8T!P!Q$}!Q![6}![!c$}!c!}6}!}#R$}#R#S6}#S#T$}#T#c6}#c#d#7O#d#o6}#o#p%c#p;'S$};'S;=`&O<%lO$}~#7VagPV~O}$}}!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 A1(i){return i==9||i==10||i==13||i==32}var qd=null,Ad=null,Wd=0;function bO(i,e){let t=i.pos+e;if(Ad==i&&Wd==t)return qd;for(;A1(i.peek(e));)e++;let n="";for(;;){let r=i.peek(e);if(!q1(r))break;n+=String.fromCharCode(r),e++}return Ad=i,Wd=t,qd=n||null}function Ud(i,e){this.name=i,this.parent=e}var W1=new Lt({start:null,shift(i,e,t,n){return e==yO?new Ud(bO(n,1)||"",i):i},reduce(i,e){return e==z1&&i?i.parent:i},reuse(i,e,t,n){let r=e.type.id;return r==yO||r==C1?new Ud(bO(n,1)||"",i):i},strict:!1}),U1=new J((i,e)=>{if(i.next==60){if(i.advance(),i.next==47){i.advance();let t=bO(i,0);if(!t)return i.acceptToken(Z1);if(e.context&&t==e.context.name)return i.acceptToken(X1);for(let n=e.context;n;n=n.parent)if(n.name==t)return i.acceptToken(v1,-2);i.acceptToken(R1)}else if(i.next!=33&&i.next!=63)return i.acceptToken(yO)}},{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"),E1=TO(Y1,"?>"),G1=TO(_1,"]]>"),L1=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)}),Md=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%U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!^$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:[U1,M1,E1,G1,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function Os(i,e){let t=e&&e.getChild("TagName");return t?i.sliceString(t.from,t.to):""}function xO(i,e){let t=e&&e.firstChild;return!t||t.name!="OpenTag"?"":Os(i,t)}function j1(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 kO(i){for(let e=i&&i.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function D1(i,e){var t;let n=G(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:kO(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:kO(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:kO(n)}:null}var XO=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"})):[]}},wO=/^[:\-\.\w\u00b7-\uffff]*$/;function Ed(i){return Object.assign(Object.assign({type:"property"},i.completion||{}),{label:i.name})}function Gd(i){return typeof i=="string"?{label:`"${i}"`,type:"constant"}:/^"/.test(i.label)?i:Object.assign(Object.assign({},i),{label:`"${i.label}"`})}function B1(i,e){let t=[],n=[],r=Object.create(null);for(let O of e){let l=Ed(O);t.push(l),O.global&&n.push(l),O.values&&(r[O.name]=O.values.map(Gd))}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(Gd)),Ed(f)))));let c=new XO(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=D1(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=xO(h,$);if(m){let Q=a[m];p=Q?.children||s}return{from:d,options:p.map(Q=>Q.completion),validFor:wO}}else if(f=="closeTag"){let p=xO(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:wO}:null}else if(f=="attrName"){let p=a[Os(h,$)];return{from:d,options:p?.attrs||n,validFor:wO}}else if(f=="attrValue"){let p=j1(h,$,d);if(!p)return null;let m=a[Os(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=xO(h,$),m=a[p],Q=[],g=$&&$.lastChild;p&&(!g||g.name!="CloseTag"||Os(h,g)!=p)&&Q.push(m?m.closeCompletion:{label:"",type:"type",boost:2});let P=Q.concat((m?.children||($?s:o)).map(k=>k.openCompletion));if($&&m?.text.length){let k=$.firstChild;k.to>O.pos-20&&!/\S/.test(O.state.sliceDoc(k.to,O.pos))&&(P=P.concat(m.text))}return{from:d,options:P,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}var vO=ue.define({name:"xml",parser:Md.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}}),be.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}}}),Pn.add({"OpenTag CloseTag":i=>i.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function jd(i={}){let e=[vO.data.of({autocomplete:B1(i.elements||[],i.attributes||[])})];return i.autoCloseTags!==!1&&e.push(I1),new oe(vO,e)}function Ld(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 I1=v.inputHandler.of((i,e,t,n,r)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!vO.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,$=G(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=Ld(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=Ld(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 Cr.define(e[i])},N1={bash:()=>R("shell"),c:()=>R("c"),css:async()=>Fr(),"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()=>hi(),json:async()=>Ef(),js:async()=>hi(),jl:()=>R("julia"),julia:()=>R("julia"),kotlin:()=>R("kotlin"),latex:()=>R("stex"),lua:()=>R("lua"),markdown:async()=>as(),matlab:()=>R("octave"),md:async()=>as(),mdown:async()=>as(),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()=>hi({typescript:!0}),twig:async()=>Cd(),typescript:async()=>hi({typescript:!0}),sql:()=>R("standardSQL"),sqlite:()=>R("sqlite"),vbs:()=>R("vbScript"),vbscript:()=>R("vbScript"),"vb.net":()=>R("vb"),vbnet:()=>R("vb"),xml:async()=>jd(),yaml:()=>R("yaml"),yml:()=>R("yaml")};function Dd(i,e){let t=i.trim().replace(/^\./g,"").toLowerCase(),n=N1[t];if(!(typeof n>"u"))return n(e)}var Bd=new WeakMap;function Wi(i,e){let t=new mt;e.extensions.push(t.of([]));let n={usage:i,editorViewConfig:e,libEditorView:v,libEditorState:B,libCompartment:mt};window.$events.emitPublic(e.parent,"library-cm6::pre-init",n);let r=new v(e);return Bd.set(r,t),window.$events.emitPublic(e.parent,"library-cm6::post-init",{editorView:r,...n}),r}async function Id(i,e,t){let n=Bd.get(i),r=await Dd(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=""){Id(this.ev,e,t)}};function F1(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",()=>{Lh(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 H1(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 Nd(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=H1(i);s&&r.setAttribute("dir",s);let o=Wi("content-code-block",{parent:r,doc:t,extensions:$a(r)});new jt(o).setMode(n,t),i.remove(),F1(o)}function IT(i){let e=i.querySelectorAll("pre");for(let t of e)Nd(t)}function NT(){let i=document.querySelectorAll(".page-content pre, .comment-box .content pre");for(let e of i)Nd(e)}function FT(i,e,t,n){let r=Wi("content-code-block",{parent:i,doc:t,extensions:$a(i),root:e}),s=new jt(r);return s.setMode(n,t),s}function HT(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 KT(i,e){let t=i.value,n={parent:i.parentElement,doc:t,extensions:[...Br(i.parentElement),v.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 JT(i,e,t,n){let r=i.textContent,s={parent:i.parentElement,doc:r,extensions:[ct.of(n),...Br(i.parentElement),v.updateListener.of(a=>{e(a)}),v.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{NT as highlight,IT as highlightWithin,KT as inlineEditor,JT as markdownEditor,HT as popupEditor,FT as wysiwygView}; +}`,{label:"class",detail:"definition",type:"keyword"}),Pe('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Pe('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],CS=au.concat([Pe("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Pe("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Pe("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),nu=new _i,Ou=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Rr(i){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,i),!0}}var qS=["FunctionDeclaration"],WS={FunctionDeclaration:Rr("function"),ClassDeclaration:Rr("class"),ClassExpression:()=>!0,EnumDeclaration:Rr("constant"),TypeAliasDeclaration:Rr("type"),NamespaceDeclaration:Rr("namespace"),VariableDefinition(i,e){i.matchContext(qS)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function lu(i,e){let t=nu.get(e);if(t)return t;let r=[],n=!0;function s(o,a){let O=i.sliceString(o.from,o.to);r.push({label:O,type:a})}return e.cursor(A.IncludeAnonymous).iterate(o=>{if(n)n=!1;else if(o.name){let a=WS[o.name];if(a&&a(o,s)||Ou.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of lu(i,o.node))r.push(a);return!1}}),nu.set(e,r),r}var su=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,cu=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function AS(i){let e=G(i.state).resolveInner(i.pos,-1);if(cu.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&su.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let r=[];for(let n=e;n;n=n.parent)Ou.has(n.name)&&(r=r.concat(lu(i.state.doc,n)));return{options:r,from:t?e.from:i.pos,validFor:su}}var nt=ue.define({name:"javascript",parser:Hf.configure({props:[de.add({IfStatement:Ye({except:/^\s*({|else\b)/}),TryStatement:Ye({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Qh,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:r?1:2)*i.unit},Block:Ln({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ye({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),Se.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Mt,BlockComment(i){return{from:i.from+2,to:i.to-2}},JSXElement(i){let e=i.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=i.lastChild;return{from:e.to,to:t.type.isError?i.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(i){var e;let t=(e=i.firstChild)===null||e===void 0?void 0:e.nextSibling,r=i.lastChild;return!t||t.type.isError?null:{from:t.to,to:r.type.isError?i.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),hu={test:i=>/^JSX/.test(i.name),facet:qi({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Ka=nt.configure({dialect:"ts"},"typescript"),Ja=nt.configure({dialect:"jsx",props:[En.add(i=>i.isTop?[hu]:void 0)]}),eO=nt.configure({dialect:"jsx ts",props:[En.add(i=>i.isTop?[hu]:void 0)]},"typescript"),fu=i=>({label:i,type:"keyword"}),uu="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(fu),US=uu.concat(["declare","implements","private","protected","public"].map(fu));function hi(i={}){let e=i.jsx?i.typescript?eO:Ja:i.typescript?Ka:nt,t=i.typescript?CS.concat(US):au.concat(uu);return new oe(e,[nt.data.of({autocomplete:tu(cu,eu(t))}),nt.data.of({autocomplete:AS}),i.jsx?LS:[]])}function MS(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function ou(i,e,t=i.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return i.sliceString(r.from,Math.min(r.to,t));return""}var ES=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),LS=k.inputHandler.of((i,e,t,r,n)=>{if((ES?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||r!=">"&&r!="/"||!nt.isActiveAt(i.state,e,-1))return!1;let s=n(),{state:o}=s,a=o.changeByRange(O=>{var l;let{head:c}=O,h=G(o).resolveInner(c-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(c-1,c)!=r||h.name=="JSXAttributeValue"&&h.to>c)){if(r==">"&&h.name=="JSXFragmentTag")return{range:O,changes:{from:c,insert:""}};if(r=="/"&&h.name=="JSXStartCloseTag"){let d=h.parent,$=d.parent;if($&&d.from==c-2&&((f=ou(o.doc,$.firstChild,c))||((l=$.firstChild)===null||l===void 0?void 0:l.name)=="JSXFragmentTag")){let p=`${f}>`;return{range:Q.cursor(c+p.length,-1),changes:{from:c,insert:p}}}}else if(r==">"){let d=MS(h);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(c,c+2))&&(f=ou(o.doc,d,c)))return{range:O,changes:{from:c,insert:``}}}}return{range:O}});return a.changes.empty?!1:(i.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var GS=55,jS=1,IS=56,BS=2,DS=57,NS=3,du=4,FS=5,sO=6,Tu=7,bu=8,yu=9,wu=10,HS=11,KS=12,JS=13,tO=58,eP=14,tP=15,$u=59,xu=21,iP=23,ku=24,rP=25,rO=27,Xu=28,nP=29,sP=32,oP=35,aP=37,OP=38,lP=0,cP=1,hP={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},fP={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},pu={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function uP(i){return i==45||i==46||i==58||i>=65&&i<=90||i==95||i>=97&&i<=122||i>=161}var mu=null,gu=null,Qu=0;function nO(i,e){let t=i.pos+e;if(Qu==t&&gu==i)return mu;let r=i.peek(e),n="";for(;uP(r);)n+=String.fromCharCode(r),r=i.peek(++e);return gu=i,Qu=t,mu=n?n.toLowerCase():r==dP||r==$P?void 0:null}var vu=60,is=62,oO=47,dP=63,$P=33,pP=45;function Su(i,e){this.name=i,this.parent=e}var mP=[sO,wu,Tu,bu,yu],gP=new jt({start:null,shift(i,e,t,r){return mP.indexOf(e)>-1?new Su(nO(r,1)||"",i):i},reduce(i,e){return e==xu&&i?i.parent:i},reuse(i,e,t,r){let n=e.type.id;return n==sO||n==aP?new Su(nO(r,1)||"",i):i},strict:!1}),QP=new ee((i,e)=>{if(i.next!=vu){i.next<0&&e.context&&i.acceptToken(tO);return}i.advance();let t=i.next==oO;t&&i.advance();let r=nO(i,0);if(r===void 0)return;if(!r)return i.acceptToken(t?tP:eP);let n=e.context?e.context.name:null;if(t){if(r==n)return i.acceptToken(HS);if(n&&fP[n])return i.acceptToken(tO,-2);if(e.dialectEnabled(lP))return i.acceptToken(KS);for(let s=e.context;s;s=s.parent)if(s.name==r)return;i.acceptToken(JS)}else{if(r=="script")return i.acceptToken(Tu);if(r=="style")return i.acceptToken(bu);if(r=="textarea")return i.acceptToken(yu);if(hP.hasOwnProperty(r))return i.acceptToken(wu);n&&pu[n]&&pu[n][r]?i.acceptToken(tO,-1):i.acceptToken(sO)}},{contextual:!0}),SP=new ee(i=>{for(let e=0,t=0;;t++){if(i.next<0){t&&i.acceptToken($u);break}if(i.next==pP)e++;else if(i.next==is&&e>=2){t>=3&&i.acceptToken($u,-2);break}else e=0;i.advance()}});function PP(i){for(;i;i=i.parent)if(i.name=="svg"||i.name=="math")return!0;return!1}var TP=new ee((i,e)=>{if(i.next==oO&&i.peek(1)==is){let t=e.dialectEnabled(cP)||PP(e.context);i.acceptToken(t?FS:du,2)}else i.next==is&&i.acceptToken(du,1)});function aO(i,e,t){let r=2+i.length;return new ee(n=>{for(let s=0,o=0,a=0;;a++){if(n.next<0){a&&n.acceptToken(e);break}if(s==0&&n.next==vu||s==1&&n.next==oO||s>=2&&so?n.acceptToken(e,-o):n.acceptToken(t,-(o-2));break}else if((n.next==10||n.next==13)&&a){n.acceptToken(e,1);break}else s=o=0;n.advance()}})}var bP=aO("script",GS,jS),yP=aO("style",IS,BS),wP=aO("textarea",DS,NS),xP=se({"Text RawText IncompleteTag IncompleteCloseTag":u.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":u.angleBracket,TagName:u.tagName,"MismatchedCloseTag/TagName":[u.tagName,u.invalid],AttributeName:u.attributeName,"AttributeValue UnquotedAttributeValue":u.attributeValue,Is:u.definitionOperator,"EntityReference CharacterReference":u.character,Comment:u.blockComment,ProcessingInst:u.processingInstruction,DoctypeDecl:u.documentMeta}),Ru=pe.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$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XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:gP,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[xP],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`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%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let l=a.type.id;if(l==nP)return iO(a,O,t);if(l==sP)return iO(a,O,r);if(l==oP)return iO(a,O,n);if(l==xu&&s.length){let c=a.node,h=c.firstChild,f=h&&Pu(h,O),d;if(f){for(let $ of s)if($.tag==f&&(!$.attrs||$.attrs(d||(d=Zu(h,O))))){let p=c.lastChild,m=p.type.id==OP?p.from:c.to;if(m>h.to)return{parser:$.parser,overlay:[{from:h.to,to:m}]}}}}if(o&&l==ku){let c=a.node,h;if(h=c.firstChild){let f=o[O.read(h.from,h.to)];if(f)for(let d of f){if(d.tagName&&d.tagName!=Pu(c.parent,O))continue;let $=c.lastChild;if($.type.id==rO){let p=$.from+1,m=$.lastChild,g=$.to-(m&&m.isError?0:1);if(g>p)return{parser:d.parser,overlay:[{from:p,to:g}],bracketed:!0}}else if($.type.id==Xu)return{parser:d.parser,overlay:[{from:$.from,to:$.to}]}}}}return null})}var Zr=["_blank","_self","_top","_parent"],lO=["ascii","utf-8","utf-16","latin1","latin1"],cO=["get","post","put","delete"],hO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],qe=["true","false"],Z={},kP={a:{attrs:{href:null,ping:null,type:null,media:null,target:Zr,hreflang:null}},abbr:Z,address:Z,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Z,aside:Z,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Z,base:{attrs:{href:null,target:Zr}},bdi:Z,bdo:Z,blockquote:{attrs:{cite:null}},body:Z,br:Z,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:hO,formmethod:cO,formnovalidate:["novalidate"],formtarget:Zr,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Z,center:Z,cite:Z,code:Z,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Z,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Z,div:Z,dl:Z,dt:Z,em:Z,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Z,figure:Z,footer:Z,form:{attrs:{action:null,name:null,"accept-charset":lO,autocomplete:["on","off"],enctype:hO,method:cO,novalidate:["novalidate"],target:Zr}},h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Z,hgroup:Z,hr:Z,html:{attrs:{manifest:null}},i:Z,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:hO,formmethod:cO,formnovalidate:["novalidate"],formtarget:Zr,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Z,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Z,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Z,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:lO,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Z,noscript:Z,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Z,param:{attrs:{name:null,value:null}},pre:Z,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Z,rt:Z,ruby:Z,samp:Z,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:lO}},section:Z,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Z,source:{attrs:{src:null,type:null,media:null}},span:Z,strong:Z,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Z,summary:Z,sup:Z,table:Z,tbody:Z,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Z,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Z,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Z,time:{attrs:{datetime:null}},title:Z,tr:Z,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Z,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Z},Yu={accesskey:null,class:null,contenteditable:qe,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:qe,autocorrect:qe,autocapitalize:qe,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":qe,"aria-autocomplete":["inline","list","both","none"],"aria-busy":qe,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":qe,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":qe,"aria-hidden":qe,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":qe,"aria-multiselectable":qe,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":qe,"aria-relevant":null,"aria-required":qe,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Cu="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(i=>"on"+i);for(let i of Cu)Yu[i]=null;var fi=class{constructor(e,t){this.tags={...kP,...e},this.globalAttrs={...Yu,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};fi.default=new fi;function Mi(i,e,t=i.length){if(!e)return"";let r=e.firstChild,n=r&&r.getChild("TagName");return n?i.sliceString(n.from,Math.min(n.to,t)):""}function Ei(i,e=!1){for(;i;i=i.parent)if(i.name=="Element")if(e)e=!1;else return i;return null}function qu(i,e,t){let r=t.tags[Mi(i,Ei(e))];return r?.children||t.allTags}function fO(i,e){let t=[];for(let r=Ei(e);r&&!r.type.isTop;r=Ei(r.parent)){let n=Mi(i,r);if(n&&r.lastChild.name=="CloseTag")break;n&&t.indexOf(n)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&t.push(n)}return t}var Wu=/^[:\-\.\w\u00b7-\uffff]*$/;function Vu(i,e,t,r,n){let s=/\s*>/.test(i.sliceDoc(n,n+5))?"":">",o=Ei(t,t.name=="StartTag"||t.name=="TagName");return{from:r,to:n,options:qu(i.doc,o,e).map(a=>({label:a,type:"type"})).concat(fO(i.doc,t).map((a,O)=>({label:"/"+a,apply:"/"+a+s,type:"type",boost:99-O}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function zu(i,e,t,r){let n=/\s*>/.test(i.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:fO(i.doc,e).map((s,o)=>({label:s,apply:s+n,type:"type",boost:99-o})),validFor:Wu}}function XP(i,e,t,r){let n=[],s=0;for(let o of qu(i.doc,t,e))n.push({label:"<"+o,type:"type"});for(let o of fO(i.doc,t))n.push({label:"",type:"type",boost:99-s++});return{from:r,to:r,options:n,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function vP(i,e,t,r,n){let s=Ei(t),o=s?e.tags[Mi(i.doc,s)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],O=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:n,options:O.map(l=>({label:l,type:"property"})),validFor:Wu}}function RP(i,e,t,r,n){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),a=[],O;if(o){let l=i.sliceDoc(o.from,o.to),c=e.globalAttrs[l];if(!c){let h=Ei(t),f=h?e.tags[Mi(i.doc,h)]:null;c=f?.attrs&&f.attrs[l]}if(c){let h=i.sliceDoc(r,n).toLowerCase(),f='"',d='"';/^['"]/.test(h)?(O=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",d=i.sliceDoc(n,n+1)==h[0]?"":h[0],h=h.slice(1),r++):O=/^[^\s<>='"]*$/;for(let $ of c)a.push({label:$,apply:f+$+d,type:"constant"})}}return{from:r,to:n,options:a,validFor:O}}function Au(i,e){let{state:t,pos:r}=e,n=G(t).resolveInner(r,-1),s=n.resolve(r);for(let o=r,a;s==n&&(a=n.childBefore(o));){let O=a.lastChild;if(!O||!O.type.isError||O.fromAu(r,n)}var VP=nt.parser.configure({top:"SingleExpression"}),Mu=[{tag:"script",attrs:i=>i.type=="text/typescript"||i.lang=="ts",parser:Ka.parser},{tag:"script",attrs:i=>i.type=="text/babel"||i.type=="text/jsx",parser:Ja.parser},{tag:"script",attrs:i=>i.type=="text/typescript-jsx",parser:eO.parser},{tag:"script",attrs(i){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(i.type)},parser:VP},{tag:"script",attrs(i){return!i.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(i.type)},parser:nt.parser},{tag:"style",attrs(i){return(!i.lang||i.lang=="css")&&(!i.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(i.type))},parser:kr.parser}],Eu=[{name:"style",parser:kr.parser.configure({top:"Styles"})}].concat(Cu.map(i=>({name:i,parser:nt.parser}))),Lu=ue.define({name:"html",parser:Ru.configure({props:[de.add({Element(i){let e=/^(\s*)(<\/)?/.exec(i.textAfter);return i.node.to<=i.pos+e[0].length?i.continue():i.lineIndent(i.node.from)+(e[2]?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit},Document(i){if(i.pos+/\s*/.exec(i.textAfter)[0].lengthi.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),rs=Lu.configure({wrap:OO(Mu,Eu)});function Li(i={}){let e="",t;i.matchClosingTags===!1&&(e="noMatch"),i.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(i.nestedLanguages&&i.nestedLanguages.length||i.nestedAttributes&&i.nestedAttributes.length)&&(t=OO((i.nestedLanguages||[]).concat(Mu),(i.nestedAttributes||[]).concat(Eu)));let r=t?Lu.configure({wrap:t,dialect:e}):e?rs.configure({dialect:e}):rs;return new oe(r,[rs.data.of({autocomplete:ZP(i)}),i.autoCloseTags!==!1?zP:[],hi().support,es().support])}var _u=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),zP=k.inputHandler.of((i,e,t,r,n)=>{if(i.composing||i.state.readOnly||e!=t||r!=">"&&r!="/"||!rs.isActiveAt(i.state,e,-1))return!1;let s=n(),{state:o}=s,a=o.changeByRange(O=>{var l,c,h;let f=o.doc.sliceString(O.from-1,O.to)==r,{head:d}=O,$=G(o).resolveInner(d,-1),p;if(f&&r==">"&&$.name=="EndTag"){let m=$.parent;if(((c=(l=m.parent)===null||l===void 0?void 0:l.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(p=Mi(o.doc,m.parent,d))&&!_u.has(p)){let g=d+(o.doc.sliceString(d,d+1)===">"?1:0),S=``;return{range:O,changes:{from:d,to:g,insert:S}}}}else if(f&&r=="/"&&$.name=="IncompleteCloseTag"){let m=$.parent;if($.from==d-2&&((h=m.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(p=Mi(o.doc,m,d))&&!_u.has(p)){let g=d+(o.doc.sliceString(d,d+1)===">"?1:0),S=`${p}>`;return{range:Q.cursor(d+S.length,-1),changes:{from:d,to:g,insert:S}}}}return{range:O}});return a.changes.empty?!1:(i.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var os=class i{static create(e,t,r,n,s){let o=n+(n<<8)+e+(t<<4)|0;return new i(e,t,r,o,s,[],[])}constructor(e,t,r,n,s,o,a){this.type=e,this.value=t,this.from=r,this.hash=n,this.end=s,this.children=o,this.positions=a,this.hashProp=[[V.contextHash,n]]}addChild(e,t){e.prop(V.contextHash)!=this.hash&&(e=new Y(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let r=this.children.length-1;return r>=0&&(t=Math.max(t,this.positions[r]+this.children[r].length+this.from)),new Y(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(n,s,o)=>new Y(ie.none,n,s,o,this.hashProp)})}},P;(function(i){i[i.Document=1]="Document",i[i.CodeBlock=2]="CodeBlock",i[i.FencedCode=3]="FencedCode",i[i.Blockquote=4]="Blockquote",i[i.HorizontalRule=5]="HorizontalRule",i[i.BulletList=6]="BulletList",i[i.OrderedList=7]="OrderedList",i[i.ListItem=8]="ListItem",i[i.ATXHeading1=9]="ATXHeading1",i[i.ATXHeading2=10]="ATXHeading2",i[i.ATXHeading3=11]="ATXHeading3",i[i.ATXHeading4=12]="ATXHeading4",i[i.ATXHeading5=13]="ATXHeading5",i[i.ATXHeading6=14]="ATXHeading6",i[i.SetextHeading1=15]="SetextHeading1",i[i.SetextHeading2=16]="SetextHeading2",i[i.HTMLBlock=17]="HTMLBlock",i[i.LinkReference=18]="LinkReference",i[i.Paragraph=19]="Paragraph",i[i.CommentBlock=20]="CommentBlock",i[i.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",i[i.Escape=22]="Escape",i[i.Entity=23]="Entity",i[i.HardBreak=24]="HardBreak",i[i.Emphasis=25]="Emphasis",i[i.StrongEmphasis=26]="StrongEmphasis",i[i.Link=27]="Link",i[i.Image=28]="Image",i[i.InlineCode=29]="InlineCode",i[i.HTMLTag=30]="HTMLTag",i[i.Comment=31]="Comment",i[i.ProcessingInstruction=32]="ProcessingInstruction",i[i.Autolink=33]="Autolink",i[i.HeaderMark=34]="HeaderMark",i[i.QuoteMark=35]="QuoteMark",i[i.ListMark=36]="ListMark",i[i.LinkMark=37]="LinkMark",i[i.EmphasisMark=38]="EmphasisMark",i[i.CodeMark=39]="CodeMark",i[i.CodeText=40]="CodeText",i[i.CodeInfo=41]="CodeInfo",i[i.LinkTitle=42]="LinkTitle",i[i.LinkLabel=43]="LinkLabel",i[i.URL=44]="URL"})(P||(P={}));var $O=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},pO=class{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return zr(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,r=0){for(let n=t;n=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let r=(i.type==P.OrderedList?XO:kO)(t,e,!1);return r>0&&(i.type!=P.BulletList||xO(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==i.value}var td={[P.Blockquote](i,e,t){return t.next!=62?!1:(t.markers.push(U(P.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Ne(t.text.charCodeAt(t.pos+1))?2:1)),i.end=e.lineStart+t.text.length,!0)},[P.ListItem](i,e,t){return t.indent-1?!1:(t.moveBaseColumn(t.baseIndent+i.value),!0)},[P.OrderedList]:Gu,[P.BulletList]:Gu,[P.Document](){return!0}};function Ne(i){return i==32||i==9||i==10||i==13}function zr(i,e=0){for(;et&&Ne(i.charCodeAt(e-1));)e--;return e}function id(i){if(i.next!=96&&i.next!=126)return-1;let e=i.pos+1;for(;e-1&&i.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(cd.SetextHeading)>-1||r<3?-1:1}function nd(i,e){for(let t=i.stack.length-1;t>=0;t--)if(i.stack[t].type==e)return!0;return!1}function kO(i,e,t){return(i.next==45||i.next==43||i.next==42)&&(i.pos==i.text.length-1||Ne(i.text.charCodeAt(i.pos+1)))&&(!t||nd(e,P.BulletList)||i.skipSpace(i.pos+2)=48&&n<=57;){r++;if(r==i.text.length)return-1;n=i.text.charCodeAt(r)}return r==i.pos||r>i.pos+9||n!=46&&n!=41||ri.pos+1||i.next!=49)?-1:r+1-i.pos}function sd(i){if(i.next!=35)return-1;let e=i.pos+1;for(;e6?-1:t}function od(i){if(i.next!=45&&i.next!=61||i.indent>=i.baseIndent+4)return-1;let e=i.pos+1;for(;e/,Od=/\?>/,gO=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(r);if(s)return i.append(U(P.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return i.append(U(P.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(r);return a?i.append(U(P.HTMLTag,t,t+1+a[0].length)):-1},Emphasis(i,e,t){if(e!=95&&e!=42)return-1;let r=t+1;for(;i.char(r)==e;)r++;let n=i.slice(t-1,t),s=i.slice(r,r+1),o=Cr.test(n),a=Cr.test(s),O=/\s|^$/.test(n),l=/\s|^$/.test(s),c=!l&&(!a||O||o),h=!O&&(!o||l||a),f=c&&(e==42||!h||o),d=h&&(e==42||!c||a);return i.append(new Te(e==95?ud:dd,t,r,(f?1:0)|(d?2:0)))},HardBreak(i,e,t){if(e==92&&i.char(t+1)==10)return i.append(U(P.HardBreak,t,t+2));if(e==32){let r=t+1;for(;i.char(r)==32;)r++;if(i.char(r)==10&&r>=t+2)return i.append(U(P.HardBreak,t,r+1))}return-1},Link(i,e,t){return e==91?i.append(new Te(ui,t,t+1,1)):-1},Image(i,e,t){return e==33&&i.char(t+1)==91?i.append(new Te(ls,t,t+2,1)):-1},LinkEnd(i,e,t){if(e!=93)return-1;for(let r=i.parts.length-1;r>=0;r--){let n=i.parts[r];if(n instanceof Te&&(n.type==ui||n.type==ls)){if(!n.side||i.skipSpace(n.to)==t&&!/[(\[]/.test(i.slice(t+1,t+2)))return i.parts[r]=null,-1;let s=i.takeContent(r),o=i.parts[r]=CP(i,s,n.type==ui?P.Link:P.Image,n.from,t+1);if(n.type==ui)for(let a=0;ae?U(P.URL,e+t,s+t):s==i.length?null:!1}}function pd(i,e,t){let r=i.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let n=r==40?41:r;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,r,n,s){return this.append(new Te(e,t,r,(n?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 Te&&(t.type==ui||t.type==ls))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r=e;O--){let p=this.parts[O];if(p instanceof Te&&p.side&1&&p.type==n.type&&!(s&&(n.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=n.type.resolve,c=[],h=a.from,f=n.to;if(s){let p=Math.min(2,a.to-a.from,o);h=a.to-p,f=n.from+p,l=p==1?"Emphasis":"StrongEmphasis"}a.type.mark&&c.push(this.elt(a.type.mark,h,a.to));for(let p=O+1;p=0;t--){let r=this.parts[t];if(r instanceof Te&&r.type==e&&r.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Te?t:null}skipSpace(e){return zr(this.text,e-this.offset)+this.offset}elt(e,t,r,n){return typeof e=="string"?U(this.parser.getNodeType(e),t,r,n):new Os(e,t)}};qr.linkStart=ui;qr.imageStart=ls;function bO(i,e){if(!e.length)return i;if(!i.length)return e;let t=i.slice(),r=0;for(let n of e){for(;r(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 r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let n=e+this.fragment.offset;for(;r.to<=n;)if(!r.parent())return!1;for(;;){if(r.from>=n)return this.fragment.from<=t;if(!r.childAfter(n))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(V.contextHash)==e}takeNodes(e){let t=this.cursor,r=this.fragment.offset,n=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-r>n){if(t.type.isAnonymous&&t.firstChild())continue;break}let c=gd(t.from-r,e.ranges);if(t.to-r<=e.ranges[e.rangeI].to)e.addNode(t.tree,c);else{let h=new Y(e.parser.nodeSet.types[P.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,c)}if(t.type.is("Block")&&(qP.indexOf(t.type.id)<0?(o=t.to-r,a=e.block.children.length):(o=O,a=l),O=t.to-r,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 gd(i,e){let t=i;for(let r=1;rns[i]),Object.keys(ns).map(i=>cd[i]),Object.keys(ns),_P,td,Object.keys(dO).map(i=>dO[i]),Object.keys(dO),[]);function AP(i,e,t){let r=[];for(let n=i.firstChild,s=e;;n=n.nextSibling){let o=n?n.from:t;if(o>s&&r.push({from:s,to:o}),!n)break;s=n.to}return r}function Sd(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Yi((n,s)=>{let o=n.type.id;if(e&&(o==P.CodeBlock||o==P.FencedCode)){let a="";if(o==P.FencedCode){let l=n.node.getChild(P.CodeInfo);l&&(a=s.read(l.from,l.to))}let O=e(a);if(O)return{parser:O,overlay:l=>l.type.id==P.CodeText,bracketed:o==P.FencedCode}}else if(t&&(o==P.HTMLBlock||o==P.HTMLTag||o==P.CommentBlock))return{parser:t,overlay:AP(n.node,n.from,n.to)};return null})}}var UP={resolve:"Strikethrough",mark:"StrikethroughMark"},MP={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 r=i.slice(t-1,t),n=i.slice(t+2,t+3),s=/\s|^$/.test(r),o=/\s|^$/.test(n),a=Cr.test(r),O=Cr.test(n);return i.addDelimiter(UP,t,t+2,!o&&(!O||s||a),!s&&(!a||o||O))},after:"Emphasis"}]};function _r(i,e,t=0,r,n=0){let s=0,o=!0,a=-1,O=-1,l=!1,c=()=>{r.push(i.elt("TableCell",n+a,n+O,i.parser.parseInline(e.slice(a,O),n+a)))};for(let h=t;h-1)&&s++,o=!1,r&&(a>-1&&c(),r.push(i.elt("TableDelimiter",h+n,h+n+1))),a=O=-1):(l||f!=32&&f!=9)&&(a<0&&(a=h),O=h+1),l=!l&&f==92}return a>-1&&(s++,r&&c()),s}function Du(i,e){for(let t=e;tn instanceof cs)||!Du(e.text,e.basePos))return!1;let r=i.peekLine();return Pd.test(r)&&_r(i,e.text,e.basePos)==_r(i,r,e.basePos)},before:"SetextHeading"}]},wO=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}},LP={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 wO:null},after:"SetextHeading"}]},Nu=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Fu=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,GP=/[\w-]+\.[\w-]+($|\/)/,Hu=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Ku=/\/[a-zA-Z\d@.]+/gy;function Ju(i,e,t,r){let n=0;for(let s=e;s-1)return-1;let r=e+t[0].length;for(;;){let n=i[r-1],s;if(/[?!.,:*_~]/.test(n)||n==")"&&Ju(i,e,r,")")>Ju(i,e,r,"("))r--;else if(n==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(i.slice(e,r))))r=e+s.index;else break}return r}function ed(i,e){Hu.lastIndex=e;let t=Hu.exec(i);if(!t)return-1;let r=t[0][t[0].length-1];return r=="_"||r=="-"?-1:e+t[0].length-(r=="."?1:0)}var IP={parseInline:[{name:"Autolink",parse(i,e,t){let r=t-i.offset;if(r&&/\w/.test(i.text[r-1]))return-1;Nu.lastIndex=r;let n=Nu.exec(i.text),s=-1;if(!n)return-1;if(n[1]||n[2]){if(s=jP(i.text,r+n[0].length),s>-1&&i.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(i.text.slice(r,s));s=r+o[0].length}}else n[3]?s=ed(i.text,r):(s=ed(i.text,r+n[0].length),s>-1&&n[0]=="xmpp:"&&(Ku.lastIndex=s,n=Ku.exec(i.text),n&&(s=n.index+n[0].length)));return s<0?-1:(i.addElement(i.elt("URL",t,s+i.offset)),s+i.offset)}}]},Td=[EP,LP,MP,IP];function bd(i,e,t){return(r,n,s)=>{if(n!=i||r.char(s+1)==i)return-1;let o=[r.elt(t,s,s+1)];for(let a=s+1;a"}}}),Rd=new V,Zd=Qd.configure({props:[Se.add(i=>!i.is("Block")||i.is("Document")||ZO(i)!=null||BP(i)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Rd.add(ZO),de.add({Document:()=>null}),wt.add({Document:vd})]});function ZO(i){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(i.name);return e?+e[1]:void 0}function BP(i){return i.name=="OrderedList"||i.name=="BulletList"}function DP(i,e){let t=i;for(;;){let r=t.nextSibling,n;if(!r||(n=ZO(r.type))!=null&&n<=e)break;t=r}return t.to}var NP=Sh.of((i,e,t)=>{for(let r=G(i).resolveInner(t,-1);r&&!(r.fromt)return{from:t,to:s}}return null});function VO(i){return new fe(vd,i,[],"markdown")}var FP=VO(Zd),HP=Zd.configure([Td,wd,yd,xd,{props:[Se.add({Table:(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}]),hs=VO(HP);function KP(i,e){return t=>{if(t&&i){let r=null;if(t=/\S*/.exec(t)[0],typeof i=="function"?r=i(t):r=Qr.matchLanguageName(i,t,!0),r instanceof Qr)return r.support?r.support.language.parser:Oi.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}var Wr=class{constructor(e,t,r,n,s,o,a){this.node=e,this.from=t,this.to=r,this.spaceBefore=n,this.spaceAfter=s,this.type=o,this.item=a}blank(e,t=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length0;n--)r+=" ";return r+(t?this.spaceAfter:"")}}marker(e,t){let r=this.node.name=="OrderedList"?String(+zd(this.item,e)[2]+t):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function Vd(i,e){let t=[],r=[];for(let n=i;n;n=n.parent){if(n.name=="FencedCode")return r;(n.name=="ListItem"||n.name=="Blockquote")&&t.push(n)}for(let n=t.length-1;n>=0;n--){let s=t[n],o,a=e.lineAt(s.from),O=s.from-a.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(O))))r.push(new Wr(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],c=o[0].length;l.length>=4&&(l=l.slice(0,l.length-4),c-=4),r.push(new Wr(s.parent,O,O+c,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],c=o[0].length;l.length>4&&(l=l.slice(0,l.length-4),c-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),r.push(new Wr(s.parent,O,O+c,o[1],l,h,s))}}return r}function zd(i,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(i.from,i.from+10))}function vO(i,e,t,r=0){for(let n=-1,s=i;;){if(s.name=="ListItem"){let a=zd(s,e),O=+a[2];if(n>=0){if(O!=n+1)return;t.push({from:s.from+a[1].length,to:s.from+a[0].length,insert:String(n+2+r)})}n=O}let o=s.nextSibling;if(!o)break;s=o}}function zO(i,e){let t=/^[ \t]*/.exec(i)[0].length;if(!t||e.facet(Ut)!=" ")return i;let r=we(i,4,t),n="";for(let s=r;s>0;)s>=4?(n+=" ",s-=4):(n+=" ",s--);return n+i.slice(t)}var JP=(i={})=>({state:e,dispatch:t})=>{let r=G(e),{doc:n}=e,s=null,o=e.changeByRange(a=>{if(!a.empty||!hs.isActiveAt(e,a.from,-1)&&!hs.isActiveAt(e,a.from,1))return s={range:a};let O=a.from,l=n.lineAt(O),c=Vd(r.resolveInner(O,-1),n);for(;c.length&&c[c.length-1].from>O-l.from;)c.pop();if(!c.length)return s={range:a};let h=c[c.length-1];if(h.to-h.spaceAfter.length>O-l.from)return s={range:a};let f=O>=h.to-h.spaceAfter.length&&!/\S/.test(l.text.slice(h.to));if(h.item&&f){let g=h.node.firstChild,S=h.node.getChild("ListItem","ListItem");if(g.to>=O||S&&S.to0&&!/[^\s>]/.test(n.lineAt(l.from-1).text)||i.nonTightLists===!1){let T=c.length>1?c[c.length-2]:null,z,y="";T&&T.item?(z=l.from+T.from,y=T.marker(n,1)):z=l.from+(T?T.to:0);let x=[{from:z,to:O,insert:y}];return h.node.name=="OrderedList"&&vO(h.item,n,x,-2),T&&T.node.name=="OrderedList"&&vO(T.item,n,x),{range:Q.cursor(z+y.length),changes:x}}else{let T=Xd(c,e,l);return{range:Q.cursor(O+T.length+1),changes:{from:l.from,insert:T+e.lineBreak}}}}if(h.node.name=="Blockquote"&&f&&l.from){let g=n.lineAt(l.from-1),S=/>\s*$/.exec(g.text);if(S&&S.index==h.from){let T=e.changes([{from:g.from+S.index,to:g.to},{from:l.from+h.from,to:l.to}]);return{range:a.map(T),changes:T}}}let d=[];h.node.name=="OrderedList"&&vO(h.item,n,d);let $=h.item&&h.item.from]*/.exec(l.text)[0].length>=h.to)for(let g=0,S=c.length-1;g<=S;g++)p+=g==S&&!$?c[g].marker(n,1):c[g].blank(gl.from&&/\s/.test(l.text.charAt(m-l.from-1));)m--;return p=zO(p,e),t0(h.node,e.doc)&&(p=Xd(c,e,l)+e.lineBreak+p),d.push({from:m,to:O,insert:e.lineBreak+p}),{range:Q.cursor(m+p.length+1),changes:d}});return s?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},e0=JP();function kd(i){return i.name=="QuoteMark"||i.name=="ListMark"}function t0(i,e){if(i.name!="OrderedList"&&i.name!="BulletList")return!1;let t=i.firstChild,r=i.getChild("ListItem","ListItem");if(!r)return!1;let n=e.lineAt(t.to),s=e.lineAt(r.from),o=/^[\s>]*$/.test(n.text);return n.number+(o?0:1){let t=G(i),r=null,n=i.changeByRange(s=>{let o=s.from,{doc:a}=i;if(s.empty&&hs.isActiveAt(i,s.from)){let O=a.lineAt(o),l=Vd(i0(t,o),a);if(l.length){let c=l[l.length-1],h=c.to-c.spaceAfter.length+(c.spaceAfter?1:0);if(o-O.from>h&&!/\S/.test(O.text.slice(h,o-O.from)))return{range:Q.cursor(O.from+h),changes:{from:O.from+h,to:o}};if(o-O.from==h&&(!c.item||O.from<=c.item.from||!/\S/.test(O.text.slice(0,c.to)))){let f=O.from+c.from;if(c.item&&c.node.from{var t;let{main:r}=e.state.selection;if(r.empty)return!1;let n=(t=i.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!n||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(n)||(/^www\./.test(n)&&(n="https://"+n),!hs.isActiveAt(e.state,r.from,1)))return!1;let s=G(e.state),o=!1;return s.iterate({from:r.from,to:r.to,enter:a=>{(a.from>r.from||a0.test(a.name))&&(o=!0)},leave:a=>{a.to=97&&i<=122||i>=65&&i<=90}function Ar(i){return i==95||i>=128||Ad(i)}function YO(i){return i>=48&&i<=55||i>=97&&i<=102||i>=65&&i<=70}var b1={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},y1=new ee(i=>{if(i.next==40){i.advance();let e=0;for(;Wd(i.peek(e));)e++;let t="",r;for(;Ad(r=i.peek(e));)t+=String.fromCharCode(r),e++;for(;Wd(i.peek(e));)e++;i.peek(e)==41&&b1[t.toLowerCase()]&&i.acceptToken(l0)}else if(i.next==60&&i.peek(1)==60&&i.peek(2)==60){for(let r=0;r<3;r++)i.advance();for(;i.next==32||i.next==9;)i.advance();let e=i.next==39;if(e&&i.advance(),!Ar(i.next))return;let t=String.fromCharCode(i.next);for(;i.advance(),!(!Ar(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 r=i.next==10||i.next==13;if(i.advance(),i.next<0)return;if(r){for(;i.next==32||i.next==9;)i.advance();let n=!0;for(let s=0;s{i.next<0&&i.acceptToken(d0)}),x1=new ee((i,e)=>{i.next==63&&e.canShift(Yd)&&i.peek(1)==62&&i.acceptToken(Yd)});function k1(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,r;for(;t<5&&(r=i.peek(t))>=48&&r<=55;)t++;return t}if(e==120&&YO(i.peek(2)))return YO(i.peek(3))?4:3;if(e==117&&i.peek(2)==123)for(let t=3;;t++){let r=i.peek(t);if(r==125)return t==2?0:t+1;if(!YO(r))break}return 0}var X1=new ee((i,e)=>{let t=!1;for(;!(i.next==34||i.next<0||i.next==36&&(Ar(i.peek(1))||i.peek(1)==123)||i.next==123&&i.peek(1)==36);t=!0){if(i.next==92){let r=k1(i);if(r){if(t)break;return i.acceptToken(f0,r)}}else if(!t&&(i.next==91||i.next==45&&i.peek(1)==62&&Ar(i.peek(2))||i.next==63&&i.peek(1)==45&&i.peek(2)==62&&Ar(i.peek(3)))&&e.canShift(u0))break;i.advance()}t&&i.acceptToken(h0)}),v1=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}),R1={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},Ud=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'#FrOOQO'#Ir'#IrO9cQ`O'#FxOOQO'#Ht'#HtO9kQ`O'#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;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_R/a,m0}}PVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g,m-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v: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,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#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:[y1,X1,x1,0,1,2,3,w1],topRules:{Template:[0,73],Program:[1,241]},dynamicPrecedences:{298:1},specialized:[{term:284,get:(i,e)=>qd(i)<<1,external:qd},{term:284,get:i=>R1[i]||-1}],tokenPrec:29889});var Z1=ue.define({name:"php",parser:Ud.configure({props:[de.add({IfStatement:Ye({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:Ye({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:r?1:2)*i.unit},ColonBlock:i=>i.baseIndent+i.unit,"Block EnumBody DeclarationList":Ln({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"String BlockComment":()=>null,Statement:Ye({except:/^({|end(for|foreach|switch|while)\b)/})}),Se.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":Mt,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 Md(i={}){let e=[],t;if(i.baseLanguage!==null)if(i.baseLanguage)t=i.baseLanguage;else{let r=Li({matchClosingTags:!1});e.push(r.support),t=r.language}return new oe(Z1.configure({wrap:t&&Yi(r=>r.type.isTop?{parser:t.parser,overlay:n=>n.name=="Text"}:null),top:i.plain?"Program":"Template"}),e)}var V1=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 ChainedIdent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}!}#R$}#R#S6}#S#T$}#T#g6}#g#h!=65&&i<=90||i==95||i>=97&&i<=122||i>=161}function G1(i){return i==9||i==10||i==13||i==32}var Ld=null,Gd=null,jd=0;function qO(i,e){let t=i.pos+e;if(Gd==i&&jd==t)return Ld;for(;G1(i.peek(e));)e++;let r="";for(;;){let n=i.peek(e);if(!L1(n))break;r+=String.fromCharCode(n),e++}return Gd=i,jd=t,Ld=r||null}function Id(i,e){this.name=i,this.parent=e}var j1=new jt({start:null,shift(i,e,t,r){return e==CO?new Id(qO(r,1)||"",i):i},reduce(i,e){return e==M1&&i?i.parent:i},reuse(i,e,t,r){let n=e.type.id;return n==CO||n==E1?new Id(qO(r,1)||"",i):i},strict:!1}),I1=new ee((i,e)=>{if(i.next==60){if(i.advance(),i.next==47){i.advance();let t=qO(i,0);if(!t)return i.acceptToken(q1);if(e.context&&t==e.context.name)return i.acceptToken(_1);for(let r=e.context;r;r=r.parent)if(r.name==t)return i.acceptToken(Y1,-2);i.acceptToken(C1)}else if(i.next!=33&&i.next!=63)return i.acceptToken(CO)}},{contextual:!0});function WO(i,e){return new ee(t=>{let r=0,n=e.charCodeAt(0);e:for(;!(t.next<0);t.advance(),r++)if(t.next==n){for(let s=1;s"),D1=WO(A1,"?>"),N1=WO(U1,"]]>"),F1=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)}),Bd=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,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sv$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:[I1,B1,D1,N1,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function us(i,e){let t=e&&e.getChild("TagName");return t?i.sliceString(t.from,t.to):""}function AO(i,e){let t=e&&e.firstChild;return!t||t.name!="OpenTag"?"":us(i,t)}function H1(i,e,t){let r=e&&e.getChildren("Attribute").find(s=>s.from<=t&&s.to>=t),n=r&&r.getChild("AttributeName");return n?i.sliceString(n.from,n.to):""}function UO(i){for(let e=i&&i.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function K1(i,e){var t;let r=G(i).resolveInner(e,-1),n=null;for(let s=r;!n&&s.parent;s=s.parent)(s.name=="OpenTag"||s.name=="CloseTag"||s.name=="SelfClosingTag"||s.name=="MismatchedCloseTag")&&(n=s);if(n&&(n.to>e||n.lastChild.type.isError)){let s=n.parent;if(r.name=="TagName")return n.name=="CloseTag"||n.name=="MismatchedCloseTag"?{type:"closeTag",from:r.from,context:s}:{type:"openTag",from:r.from,context:UO(s)};if(r.name=="AttributeName")return{type:"attrName",from:r.from,context:n};if(r.name=="AttributeValue")return{type:"attrValue",from:r.from,context:n};let o=r==n||r.name=="Attribute"?r.childBefore(e):r;return o?.name=="StartTag"?{type:"openTag",from:e,context:UO(s)}:o?.name=="StartCloseTag"&&o.to<=e?{type:"closeTag",from:e,context:s}:o?.name=="Is"?{type:"attrValue",from:e,context:n}:o?{type:"attrName",from:e,context:n}:null}else if(r.name=="StartCloseTag")return{type:"closeTag",from:e,context:r.parent};for(;r.parent&&r.to==e&&!(!((t=r.lastChild)===null||t===void 0)&&t.type.isError);)r=r.parent;return r.name=="Element"||r.name=="Text"||r.name=="Document"?{type:"tag",from:e,context:r.name=="Element"?r:UO(r)}:null}var EO=class{constructor(e,t,r){this.attrs=t,this.attrValues=r,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(n=>({label:n,type:"text"})):[]}},MO=/^[:\-\.\w\u00b7-\uffff]*$/;function Dd(i){return Object.assign(Object.assign({type:"property"},i.completion||{}),{label:i.name})}function Nd(i){return typeof i=="string"?{label:`"${i}"`,type:"constant"}:/^"/.test(i.label)?i:Object.assign(Object.assign({},i),{label:`"${i.label}"`})}function J1(i,e){let t=[],r=[],n=Object.create(null);for(let O of e){let l=Dd(O);t.push(l),O.global&&r.push(l),O.values&&(n[O.name]=O.values.map(Nd))}let s=[],o=[],a=Object.create(null);for(let O of i){let l=r,c=n;O.attributes&&(l=l.concat(O.attributes.map(f=>typeof f=="string"?t.find(d=>d.label==f)||{label:f,type:"property"}:(f.values&&(c==n&&(c=Object.create(c)),c[f.name]=f.values.map(Nd)),Dd(f)))));let h=new EO(O,l,c);a[h.name]=h,s.push(h),O.top&&o.push(h)}o.length||(o=s);for(let O=0;O{var l;let{doc:c}=O.state,h=K1(O.state,O.pos);if(!h||h.type=="tag"&&!O.explicit)return null;let{type:f,from:d,context:$}=h;if(f=="openTag"){let p=o,m=AO(c,$);if(m){let g=a[m];p=g?.children||s}return{from:d,options:p.map(g=>g.completion),validFor:MO}}else if(f=="closeTag"){let p=AO(c,$);return p?{from:d,to:O.pos+(c.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:MO}:null}else if(f=="attrName"){let p=a[us(c,$)];return{from:d,options:p?.attrs||r,validFor:MO}}else if(f=="attrValue"){let p=H1(c,$,d);if(!p)return null;let m=a[us(c,$)],g=(m?.attrValues||n)[p];return!g||!g.length?null:{from:d,to:O.pos+(c.sliceString(O.pos,O.pos+1)=='"'?1:0),options:g,validFor:/^"[^"]*"?$/}}else if(f=="tag"){let p=AO(c,$),m=a[p],g=[],S=$&&$.lastChild;p&&(!S||S.name!="CloseTag"||us(c,S)!=p)&&g.push(m?m.closeCompletion:{label:"",type:"type",boost:2});let T=g.concat((m?.children||($?s:o)).map(z=>z.openCompletion));if($&&m?.text.length){let z=$.firstChild;z.to>O.pos-20&&!/\S/.test(O.state.sliceDoc(z.to,O.pos))&&(T=T.concat(m.text))}return{from:d,options:T,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}var LO=ue.define({name:"xml",parser:Bd.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}}),Se.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}}}),Tr.add({"OpenTag CloseTag":i=>i.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function Hd(i={}){let e=[LO.data.of({autocomplete:J1(i.elements||[],i.attributes||[])})];return i.autoCloseTags!==!1&&e.push(eT),new oe(LO,e)}function Fd(i,e,t=i.length){if(!e)return"";let r=e.firstChild,n=r&&r.getChild("TagName");return n?i.sliceString(n.from,Math.min(n.to,t)):""}var eT=k.inputHandler.of((i,e,t,r,n)=>{if(i.composing||i.state.readOnly||e!=t||r!=">"&&r!="/"||!LO.isActiveAt(i.state,e,-1))return!1;let s=n(),{state:o}=s,a=o.changeByRange(O=>{var l,c,h;let{head:f}=O,d=o.doc.sliceString(f-1,f)==r,$=G(o).resolveInner(f,-1),p;if(d&&r==">"&&$.name=="EndTag"){let m=$.parent;if(((c=(l=m.parent)===null||l===void 0?void 0:l.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(p=Fd(o.doc,m.parent,f))){let g=f+(o.doc.sliceString(f,f+1)===">"?1:0),S=``;return{range:O,changes:{from:f,to:g,insert:S}}}}else if(d&&r=="/"&&$.name=="StartCloseTag"){let m=$.parent;if($.from==f-2&&((h=m.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(p=Fd(o.doc,m,f))){let g=f+(o.doc.sliceString(f,f+1)===">"?1:0),S=`${p}>`;return{range:Q.cursor(f+S.length,-1),changes:{from:f,to:g,insert:S}}}}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 Un.define(e[i])},tT={bash:()=>R("shell"),c:()=>R("c"),css:async()=>es(),"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()=>Li({selfClosingTags:!0}),ini:()=>R("properties"),java:()=>R("java"),javascript:async()=>hi(),json:async()=>Df(),js:async()=>hi(),jl:()=>R("julia"),julia:()=>R("julia"),kotlin:()=>R("kotlin"),latex:()=>R("stex"),lua:()=>R("lua"),markdown:async()=>fs(),matlab:()=>R("octave"),md:async()=>fs(),mdown:async()=>fs(),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()=>hi({typescript:!0}),twig:async()=>Ed(),typescript:async()=>hi({typescript:!0}),sql:()=>R("standardSQL"),sqlite:()=>R("sqlite"),vbs:()=>R("vbScript"),vbscript:()=>R("vbScript"),"vb.net":()=>R("vb"),vbnet:()=>R("vb"),xml:async()=>Hd(),yaml:()=>R("yaml"),yml:()=>R("yaml")};function Kd(i,e){let t=i.trim().replace(/^\./g,"").toLowerCase(),r=tT[t];if(!(typeof r>"u"))return r(e)}var Jd=new WeakMap;function ji(i,e){let t=new pt;e.extensions.push(t.of([]));let r={usage:i,editorViewConfig:e,libEditorView:k,libEditorState:D,libCompartment:pt};window.$events.emitPublic(e.parent,"library-cm6::pre-init",r);let n=new k(e);return Jd.set(n,t),window.$events.emitPublic(e.parent,"library-cm6::post-init",{editorView:n,...r}),n}async function e$(i,e,t){let r=Jd.get(i),n=await Kd(e,t);i.dispatch({effects:r.reconfigure(n||[])})}var Bt=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=""){e$(this.ev,e,t)}};function iT(i){let e='',t='',r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("cm-copy-button"),r.innerHTML=e,i.dom.appendChild(r);let n=620,s=60;r.addEventListener("click",()=>{Nc(i.state.doc.toString()),r.classList.add("success"),setTimeout(()=>{r.innerHTML=t},s/2),setTimeout(()=>{r.classList.remove("success")},n),setTimeout(()=>{r.innerHTML=e},n+s/2)})}function rT(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 t$(i){let e=i.querySelector("code[class^=language-]");i.innerHTML=i.innerHTML.replace(//gi,` +`);let t=i.textContent.trimEnd(),r="";e!==null&&(r=e.className.replace("language-",""));let n=document.createElement("div");i.parentNode.insertBefore(n,i);let s=rT(i);s&&n.setAttribute("dir",s);let o=ji("content-code-block",{parent:n,doc:t,extensions:Za(n)});new Bt(o).setMode(r,t),i.remove(),iT(o)}function iw(i){let e=i.querySelectorAll("pre");for(let t of e)t$(t)}function rw(){let i=document.querySelectorAll(".page-content pre, .comment-box .content pre");for(let e of i)t$(e)}function nw(i,e,t,r){let n=ji("content-code-block",{parent:i,doc:t,extensions:Za(i),root:e}),s=new Bt(n);return s.setMode(r,t),s}function sw(i,e){let t=i.textContent,r={parent:i.parentElement,doc:t,extensions:[...Hn(i.parentElement)]},n=new Bt(ji("code-editor",r));return n.setMode(e,t),i.style.display="none",n}function ow(i,e){let t=i.value,r={parent:i.parentElement,doc:t,extensions:[...Hn(i.parentElement),k.updateListener.of(o=>{o.docChanged&&(i.value=o.state.doc.toString())})]},n=ji("code-input",r),s=new Bt(n);return s.setMode(e,t),i.style.display="none",s}function aw(i,e,t,r){let n=i.textContent,s={parent:i.parentElement,doc:n,extensions:[ct.of(r),...Hn(i.parentElement),k.updateListener.of(a=>{e(a)}),k.domEventHandlers(t)]};window.$events.emitPublic(i,"editor-markdown-cm6::pre-init",{editorViewConfig:s});let o=ji("markdown-editor",s);return new Bt(o).setMode("markdown",""),i.style.display="none",o}export{rw as highlight,iw as highlightWithin,ow as inlineEditor,aw as markdownEditor,sw as popupEditor,nw as wysiwygView}; //# sourceMappingURL=code.js.map diff --git a/public/dist/markdown.js b/public/dist/markdown.js index c3ce90abf..38c1fc354 100644 --- a/public/dist/markdown.js +++ b/public/dist/markdown.js @@ -1,8 +1,8 @@ // See the "/licenses" URI for full package license details -var W0=Object.create;var Eu=Object.defineProperty;var X0=Object.getOwnPropertyDescriptor;var J0=Object.getOwnPropertyNames;var K0=Object.getPrototypeOf,Y0=Object.prototype.hasOwnProperty;var At=u=>{throw TypeError(u)};var Q0=(u,e,t)=>e in u?Eu(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t;var ur=(u,e)=>()=>(e||u((e={exports:{}}).exports,e),e.exports),wu=(u,e)=>{for(var t in e)Eu(u,t,{get:e[t],enumerable:!0})},er=(u,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of J0(e))!Y0.call(u,n)&&n!==t&&Eu(u,n,{get:()=>e[n],enumerable:!(r=X0(e,n))||r.enumerable});return u};var tr=(u,e,t)=>(t=u!=null?W0(K0(u)):{},er(e||!u||!u.__esModule?Eu(t,"default",{value:u,enumerable:!0}):t,u));var v=(u,e,t)=>Q0(u,typeof e!="symbol"?e+"":e,t),rr=(u,e,t)=>e.has(u)||At("Cannot "+t);var Ft=(u,e,t)=>e.has(u)?At("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t);var R=(u,e,t)=>(rr(u,e,"access private method"),t);var q0=ur((ss,R0)=>{var it=!0,L0=!1,I0=!1;R0.exports=function(u,e){e&&(it=!e.enabled,L0=!!e.label,I0=!!e.labelAfter),u.core.ruler.after("inline","github-task-lists",function(t){for(var r=t.tokens,n=2;n=0;r--)if(u[r].level===t)return r;return-1}function uo(u,e){return io(u[e])&&co(u[e-1])&&ao(u[e-2])&&so(u[e])}function eo(u,e){if(u.children.unshift(to(u,e)),u.children[1].content=u.children[1].content.slice(3),u.content=u.content.slice(3),L0)if(I0){u.children.pop();var t="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);u.children[0].content=u.children[0].content.slice(0,-1)+' id="'+t+'">',u.children.push(oo(u.content,t,e))}else u.children.unshift(ro(e)),u.children.push(no(e))}function to(u,e){var t=new e("html_inline","",0),r=it?' disabled="" ':"";return u.content.indexOf("[ ] ")===0?t.content='':(u.content.indexOf("[x] ")===0||u.content.indexOf("[X] ")===0)&&(t.content=''),t}function ro(u){var e=new u("html_inline","",0);return e.content="",e}function oo(u,e,t){var r=new t("html_inline","",0);return r.content='",r.attrs=[{for:e}],r}function io(u){return u.type==="inline"}function co(u){return u.type==="paragraph_open"}function ao(u){return u.type==="list_item_open"}function so(u){return u.content.indexOf("[ ] ")===0||u.content.indexOf("[x] ")===0||u.content.indexOf("[X] ")===0}});var de={};wu(de,{arrayReplaceAt:()=>le,assign:()=>su,escapeHtml:()=>Z,escapeRE:()=>Or,fromCodePoint:()=>bu,has:()=>Sr,isMdAsciiPunct:()=>tu,isPunctChar:()=>eu,isSpace:()=>A,isString:()=>qu,isValidEntityCode:()=>Pu,isWhiteSpace:()=>uu,lib:()=>Hr,normalizeReference:()=>ru,unescapeAll:()=>V,unescapeMd:()=>Rr});var Fu={};wu(Fu,{decode:()=>hu,encode:()=>vu,format:()=>cu,parse:()=>mu});var St={};function nr(u){let e=St[u];if(e)return e;e=St[u]=[];for(let t=0;t<128;t++){let r=String.fromCharCode(t);e.push(r)}for(let t=0;t=55296&&d<=57343?n+="\uFFFD\uFFFD\uFFFD":n+=String.fromCharCode(d),o+=6;continue}}if((c&248)===240&&o+91114111?n+="\uFFFD\uFFFD\uFFFD\uFFFD":(f-=65536,n+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}n+="\uFFFD"}return n})}Cu.defaultChars=";/?:@&=+$,#";Cu.componentChars="";var hu=Cu;var Tt={};function or(u){let e=Tt[u];if(e)return e;e=Tt[u]=[];for(let t=0;t<128;t++){let r=String.fromCharCode(t);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let t=0;t"u"&&(t=!0);let r=or(e),n="";for(let o=0,i=u.length;o=55296&&c<=57343){if(c>=55296&&c<=56319&&o+1=56320&&a<=57343){n+=encodeURIComponent(u[o]+u[o+1]),o++;continue}}n+="%EF%BF%BD";continue}n+=encodeURIComponent(u[o])}return n}Du.defaultChars=";/?:@&=+$,-_.!~*'()#";Du.componentChars="-_.!~*'()";var vu=Du;function cu(u){let e="";return e+=u.protocol||"",e+=u.slashes?"//":"",e+=u.auth?u.auth+"@":"",u.hostname&&u.hostname.indexOf(":")!==-1?e+="["+u.hostname+"]":e+=u.hostname||"",e+=u.port?":"+u.port:"",e+=u.pathname||"",e+=u.search||"",e+=u.hash||"",e}function Au(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var ir=/^([a-z0-9.+-]+:)/i,cr=/:[0-9]*$/,ar=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,sr=["<",">",'"',"`"," ","\r",` -`," "],lr=["{","}","|","\\","^","`"].concat(sr),dr=["'"].concat(lr),Mt=["%","/","?",";","#"].concat(dr),Lt=["/","?","#"],fr=255,It=/^[+a-z0-9A-Z_-]{0,63}$/,pr=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Rt={javascript:!0,"javascript:":!0},qt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function hr(u,e){if(u&&u instanceof Au)return u;let t=new Au;return t.parse(u,e),t}Au.prototype.parse=function(u,e){let t,r,n,o=u;if(o=o.trim(),!e&&u.split("#").length===1){let s=ar.exec(o);if(s)return this.pathname=s[1],s[2]&&(this.search=s[2]),this}let i=ir.exec(o);if(i&&(i=i[0],t=i.toLowerCase(),this.protocol=i,o=o.substr(i.length)),(e||i||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(n=o.substr(0,2)==="//",n&&!(i&&Rt[i])&&(o=o.substr(2),this.slashes=!0)),!Rt[i]&&(n||i&&!qt[i])){let s=-1;for(let l=0;l127?g+="x":g+=k[_];if(!g.match(It)){let _=l.slice(0,p),y=l.slice(p+1),m=k.match(pr);m&&(_.push(m[1]),y.unshift(m[2])),y.length&&(o=y.join(".")+o),this.hostname=_.join(".");break}}}}this.hostname.length>fr&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let c=o.indexOf("#");c!==-1&&(this.hash=o.substr(c),o=o.slice(0,c));let a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),qt[t]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Au.prototype.parseHost=function(u){let e=cr.exec(u);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),u=u.substr(0,u.length-e.length)),u&&(this.hostname=u)};var mu=hr;var re={};wu(re,{Any:()=>Su,Cc:()=>Tu,Cf:()=>Pt,P:()=>au,S:()=>Mu,Z:()=>Lu});var Su=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var Tu=/[\0-\x1F\x7F-\x9F]/;var Pt=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;var au=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;var Mu=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;var Lu=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var Bt=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(u=>u.charCodeAt(0)));var Nt=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(u=>u.charCodeAt(0)));var ne,mr=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),oe=(ne=String.fromCodePoint)!==null&&ne!==void 0?ne:function(u){let e="";return u>65535&&(u-=65536,e+=String.fromCharCode(u>>>10&1023|55296),u=56320|u&1023),e+=String.fromCharCode(u),e};function ie(u){var e;return u>=55296&&u<=57343||u>1114111?65533:(e=mr.get(u))!==null&&e!==void 0?e:u}var L;(function(u){u[u.NUM=35]="NUM",u[u.SEMI=59]="SEMI",u[u.EQUALS=61]="EQUALS",u[u.ZERO=48]="ZERO",u[u.NINE=57]="NINE",u[u.LOWER_A=97]="LOWER_A",u[u.LOWER_F=102]="LOWER_F",u[u.LOWER_X=120]="LOWER_X",u[u.LOWER_Z=122]="LOWER_Z",u[u.UPPER_A=65]="UPPER_A",u[u.UPPER_F=70]="UPPER_F",u[u.UPPER_Z=90]="UPPER_Z"})(L||(L={}));var br=32,J;(function(u){u[u.VALUE_LENGTH=49152]="VALUE_LENGTH",u[u.BRANCH_LENGTH=16256]="BRANCH_LENGTH",u[u.JUMP_TABLE=127]="JUMP_TABLE"})(J||(J={}));function ce(u){return u>=L.ZERO&&u<=L.NINE}function gr(u){return u>=L.UPPER_A&&u<=L.UPPER_F||u>=L.LOWER_A&&u<=L.LOWER_F}function xr(u){return u>=L.UPPER_A&&u<=L.UPPER_Z||u>=L.LOWER_A&&u<=L.LOWER_Z||ce(u)}function kr(u){return u===L.EQUALS||xr(u)}var M;(function(u){u[u.EntityStart=0]="EntityStart",u[u.NumericStart=1]="NumericStart",u[u.NumericDecimal=2]="NumericDecimal",u[u.NumericHex=3]="NumericHex",u[u.NamedEntity=4]="NamedEntity"})(M||(M={}));var O;(function(u){u[u.Legacy=0]="Legacy",u[u.Strict=1]="Strict",u[u.Attribute=2]="Attribute"})(O||(O={}));var Iu=class{constructor(e,t,r){this.decodeTree=e,this.emitCodePoint=t,this.errors=r,this.state=M.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=O.Strict}startEntity(e){this.decodeMode=e,this.state=M.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case M.EntityStart:return e.charCodeAt(t)===L.NUM?(this.state=M.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=M.NamedEntity,this.stateNamedEntity(e,t));case M.NumericStart:return this.stateNumericStart(e,t);case M.NumericDecimal:return this.stateNumericDecimal(e,t);case M.NumericHex:return this.stateNumericHex(e,t);case M.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|br)===L.LOWER_X?(this.state=M.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=M.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,r,n){if(t!==r){let o=r-t;this.result=this.result*Math.pow(n,o)+parseInt(e.substr(t,o),n),this.consumed+=o}}stateNumericHex(e,t){let r=t;for(;t>14;for(;t>14,o!==0){if(i===L.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==O.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:r}=this,n=(r[t]&J.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,r){let{decodeTree:n}=this;return this.emitCodePoint(t===1?n[e]&~J.VALUE_LENGTH:n[e+1],r),t===3&&this.emitCodePoint(n[e+2],r),r}end(){var e;switch(this.state){case M.NamedEntity:return this.result!==0&&(this.decodeMode!==O.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case M.NumericDecimal:return this.emitNumericEntity(0,2);case M.NumericHex:return this.emitNumericEntity(0,3);case M.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case M.EntityStart:return 0}}};function zt(u){let e="",t=new Iu(u,r=>e+=oe(r));return function(n,o){let i=0,c=0;for(;(c=n.indexOf("&",c))>=0;){e+=n.slice(i,c),t.startEntity(o);let s=t.write(n,c+1);if(s<0){i=c+t.end();break}i=c+s,c=s===0?i+1:i}let a=e+n.slice(i);return e="",a}}function _r(u,e,t,r){let n=(e&J.BRANCH_LENGTH)>>7,o=e&J.JUMP_TABLE;if(n===0)return o!==0&&r===o?t:-1;if(o){let a=r-o;return a<0||a>=n?-1:u[t+a]-1}let i=t,c=i+n-1;for(;i<=c;){let a=i+c>>>1,s=u[a];if(sr)c=a-1;else return u[a+n]}return-1}var yr=zt(Bt),_i=zt(Nt);function K(u,e=O.Legacy){return yr(u,e)}function Ru(u){for(let e=1;eu.codePointAt(e):(u,e)=>(u.charCodeAt(e)&64512)===55296?(u.charCodeAt(e)-55296)*1024+u.charCodeAt(e+1)-56320+65536:u.charCodeAt(e);function ae(u,e){return function(r){let n,o=0,i="";for(;n=u.exec(r);)o!==n.index&&(i+=r.substring(o,n.index)),i+=e.get(n[0].charCodeAt(0)),o=n.index+1;return i+r.substring(o)}}var Ot=ae(/[&<>'"]/g,wr),Ht=ae(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),$t=ae(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var Ut;(function(u){u[u.XML=0]="XML",u[u.HTML=1]="HTML"})(Ut||(Ut={}));var jt;(function(u){u[u.UTF8=0]="UTF8",u[u.ASCII=1]="ASCII",u[u.Extensive=2]="Extensive",u[u.Attribute=3]="Attribute",u[u.Text=4]="Text"})(jt||(jt={}));function Ar(u){return Object.prototype.toString.call(u)}function qu(u){return Ar(u)==="[object String]"}var Fr=Object.prototype.hasOwnProperty;function Sr(u,e){return Fr.call(u,e)}function su(u){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!="object")throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){u[r]=t[r]})}}),u}function le(u,e,t){return[].concat(u.slice(0,e),t,u.slice(e+1))}function Pu(u){return!(u>=55296&&u<=57343||u>=64976&&u<=65007||(u&65535)===65535||(u&65535)===65534||u>=0&&u<=8||u===11||u>=14&&u<=31||u>=127&&u<=159||u>1114111)}function bu(u){if(u>65535){u-=65536;let e=55296+(u>>10),t=56320+(u&1023);return String.fromCharCode(e,t)}return String.fromCharCode(u)}var Gt=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Tr=/&([a-z#][a-z0-9]{1,31});/gi,Mr=new RegExp(Gt.source+"|"+Tr.source,"gi"),Lr=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Ir(u,e){if(e.charCodeAt(0)===35&&Lr.test(e)){let r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Pu(r)?bu(r):u}let t=K(u);return t!==u?t:u}function Rr(u){return u.indexOf("\\")<0?u:u.replace(Gt,"$1")}function V(u){return u.indexOf("\\")<0&&u.indexOf("&")<0?u:u.replace(Mr,function(e,t,r){return t||Ir(e,r)})}var qr=/[&<>"]/,Pr=/[&<>"]/g,Br={"&":"&","<":"<",">":">",'"':"""};function Nr(u){return Br[u]}function Z(u){return qr.test(u)?u.replace(Pr,Nr):u}var zr=/[.?*+^$[\]\\(){}|-]/g;function Or(u){return u.replace(zr,"\\$&")}function A(u){switch(u){case 9:case 32:return!0}return!1}function uu(u){if(u>=8192&&u<=8202)return!0;switch(u){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function eu(u){return au.test(u)||Mu.test(u)}function tu(u){switch(u){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function ru(u){return u=u.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(u=u.replace(/ẞ/g,"\xDF")),u.toLowerCase().toUpperCase()}var Hr={mdurl:Fu,ucmicro:re};var me={};wu(me,{parseLinkDestination:()=>pe,parseLinkLabel:()=>fe,parseLinkTitle:()=>he});function fe(u,e,t){let r,n,o,i,c=u.posMax,a=u.pos;for(u.pos=e+1,r=1;u.pos32))return o;if(r===41){if(i===0)break;i--}n++}return e===n||i!==0||(o.str=V(u.slice(e,n)),o.pos=n,o.ok=!0),o}function he(u,e,t,r){let n,o=e,i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(o>=t)return i;let c=u.charCodeAt(o);if(c!==34&&c!==39&&c!==40)return i;e++,o++,c===40&&(c=41),i.marker=c}for(;o"+Z(o.content)+""};H.code_block=function(u,e,t,r,n){let o=u[e];return""+Z(u[e].content)+` +var W0=Object.create;var Eu=Object.defineProperty;var X0=Object.getOwnPropertyDescriptor;var J0=Object.getOwnPropertyNames;var K0=Object.getPrototypeOf,Y0=Object.prototype.hasOwnProperty;var vt=u=>{throw TypeError(u)};var Q0=(u,e,t)=>e in u?Eu(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t;var ur=(u,e)=>()=>(e||u((e={exports:{}}).exports,e),e.exports),wu=(u,e)=>{for(var t in e)Eu(u,t,{get:e[t],enumerable:!0})},er=(u,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of J0(e))!Y0.call(u,n)&&n!==t&&Eu(u,n,{get:()=>e[n],enumerable:!(r=X0(e,n))||r.enumerable});return u};var tr=(u,e,t)=>(t=u!=null?W0(K0(u)):{},er(e||!u||!u.__esModule?Eu(t,"default",{value:u,enumerable:!0}):t,u));var A=(u,e,t)=>Q0(u,typeof e!="symbol"?e+"":e,t),rr=(u,e,t)=>e.has(u)||vt("Cannot "+t);var Ft=(u,e,t)=>e.has(u)?vt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(u):e.set(u,t);var R=(u,e,t)=>(rr(u,e,"access private method"),t);var q0=ur((ss,R0)=>{var it=!0,L0=!1,I0=!1;R0.exports=function(u,e){e&&(it=!e.enabled,L0=!!e.label,I0=!!e.labelAfter),u.core.ruler.after("inline","github-task-lists",function(t){for(var r=t.tokens,n=2;n=0;r--)if(u[r].level===t)return r;return-1}function uo(u,e){return io(u[e])&&co(u[e-1])&&ao(u[e-2])&&so(u[e])}function eo(u,e){if(u.children.unshift(to(u,e)),u.children[1].content=u.children[1].content.slice(3),u.content=u.content.slice(3),L0)if(I0){u.children.pop();var t="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);u.children[0].content=u.children[0].content.slice(0,-1)+' id="'+t+'">',u.children.push(oo(u.content,t,e))}else u.children.unshift(ro(e)),u.children.push(no(e))}function to(u,e){var t=new e("html_inline","",0),r=it?' disabled="" ':"";return u.content.indexOf("[ ] ")===0?t.content='':(u.content.indexOf("[x] ")===0||u.content.indexOf("[X] ")===0)&&(t.content=''),t}function ro(u){var e=new u("html_inline","",0);return e.content="",e}function oo(u,e,t){var r=new t("html_inline","",0);return r.content='",r.attrs=[{for:e}],r}function io(u){return u.type==="inline"}function co(u){return u.type==="paragraph_open"}function ao(u){return u.type==="list_item_open"}function so(u){return u.content.indexOf("[ ] ")===0||u.content.indexOf("[x] ")===0||u.content.indexOf("[X] ")===0}});var de={};wu(de,{arrayReplaceAt:()=>le,assign:()=>su,escapeHtml:()=>Z,escapeRE:()=>Or,fromCodePoint:()=>bu,has:()=>Sr,isMdAsciiPunct:()=>tu,isPunctChar:()=>eu,isSpace:()=>v,isString:()=>qu,isValidEntityCode:()=>Pu,isWhiteSpace:()=>uu,lib:()=>Hr,normalizeReference:()=>ru,unescapeAll:()=>V,unescapeMd:()=>Rr});var Fu={};wu(Fu,{decode:()=>hu,encode:()=>Au,format:()=>cu,parse:()=>mu});var St={};function nr(u){let e=St[u];if(e)return e;e=St[u]=[];for(let t=0;t<128;t++){let r=String.fromCharCode(t);e.push(r)}for(let t=0;t=55296&&d<=57343?n+="\uFFFD\uFFFD\uFFFD":n+=String.fromCharCode(d),o+=6;continue}}if((c&248)===240&&o+91114111?n+="\uFFFD\uFFFD\uFFFD\uFFFD":(f-=65536,n+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}n+="\uFFFD"}return n})}Cu.defaultChars=";/?:@&=+$,#";Cu.componentChars="";var hu=Cu;var Tt={};function or(u){let e=Tt[u];if(e)return e;e=Tt[u]=[];for(let t=0;t<128;t++){let r=String.fromCharCode(t);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let t=0;t"u"&&(t=!0);let r=or(e),n="";for(let o=0,i=u.length;o=55296&&c<=57343){if(c>=55296&&c<=56319&&o+1=56320&&a<=57343){n+=encodeURIComponent(u[o]+u[o+1]),o++;continue}}n+="%EF%BF%BD";continue}n+=encodeURIComponent(u[o])}return n}Du.defaultChars=";/?:@&=+$,-_.!~*'()#";Du.componentChars="-_.!~*'()";var Au=Du;function cu(u){let e="";return e+=u.protocol||"",e+=u.slashes?"//":"",e+=u.auth?u.auth+"@":"",u.hostname&&u.hostname.indexOf(":")!==-1?e+="["+u.hostname+"]":e+=u.hostname||"",e+=u.port?":"+u.port:"",e+=u.pathname||"",e+=u.search||"",e+=u.hash||"",e}function vu(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var ir=/^([a-z0-9.+-]+:)/i,cr=/:[0-9]*$/,ar=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,sr=["<",">",'"',"`"," ","\r",` +`," "],lr=["{","}","|","\\","^","`"].concat(sr),dr=["'"].concat(lr),Mt=["%","/","?",";","#"].concat(dr),Lt=["/","?","#"],fr=255,It=/^[+a-z0-9A-Z_-]{0,63}$/,pr=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Rt={javascript:!0,"javascript:":!0},qt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function hr(u,e){if(u&&u instanceof vu)return u;let t=new vu;return t.parse(u,e),t}vu.prototype.parse=function(u,e){let t,r,n,o=u;if(o=o.trim(),!e&&u.split("#").length===1){let s=ar.exec(o);if(s)return this.pathname=s[1],s[2]&&(this.search=s[2]),this}let i=ir.exec(o);if(i&&(i=i[0],t=i.toLowerCase(),this.protocol=i,o=o.substr(i.length)),(e||i||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(n=o.substr(0,2)==="//",n&&!(i&&Rt[i])&&(o=o.substr(2),this.slashes=!0)),!Rt[i]&&(n||i&&!qt[i])){let s=-1;for(let l=0;l127?x+="x":x+=k[_];if(!x.match(It)){let _=l.slice(0,p),y=l.slice(p+1),m=k.match(pr);m&&(_.push(m[1]),y.unshift(m[2])),y.length&&(o=y.join(".")+o),this.hostname=_.join(".");break}}}}this.hostname.length>fr&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let c=o.indexOf("#");c!==-1&&(this.hash=o.substr(c),o=o.slice(0,c));let a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),qt[t]&&this.hostname&&!this.pathname&&(this.pathname=""),this};vu.prototype.parseHost=function(u){let e=cr.exec(u);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),u=u.substr(0,u.length-e.length)),u&&(this.hostname=u)};var mu=hr;var re={};wu(re,{Any:()=>Su,Cc:()=>Tu,Cf:()=>Pt,P:()=>au,S:()=>Mu,Z:()=>Lu});var Su=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var Tu=/[\0-\x1F\x7F-\x9F]/;var Pt=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;var au=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA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6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836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DE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;var Lu=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var Bt=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(u=>u.charCodeAt(0)));var Nt=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(u=>u.charCodeAt(0)));var ne,mr=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),oe=(ne=String.fromCodePoint)!==null&&ne!==void 0?ne:function(u){let e="";return u>65535&&(u-=65536,e+=String.fromCharCode(u>>>10&1023|55296),u=56320|u&1023),e+=String.fromCharCode(u),e};function ie(u){var e;return u>=55296&&u<=57343||u>1114111?65533:(e=mr.get(u))!==null&&e!==void 0?e:u}var L;(function(u){u[u.NUM=35]="NUM",u[u.SEMI=59]="SEMI",u[u.EQUALS=61]="EQUALS",u[u.ZERO=48]="ZERO",u[u.NINE=57]="NINE",u[u.LOWER_A=97]="LOWER_A",u[u.LOWER_F=102]="LOWER_F",u[u.LOWER_X=120]="LOWER_X",u[u.LOWER_Z=122]="LOWER_Z",u[u.UPPER_A=65]="UPPER_A",u[u.UPPER_F=70]="UPPER_F",u[u.UPPER_Z=90]="UPPER_Z"})(L||(L={}));var br=32,J;(function(u){u[u.VALUE_LENGTH=49152]="VALUE_LENGTH",u[u.BRANCH_LENGTH=16256]="BRANCH_LENGTH",u[u.JUMP_TABLE=127]="JUMP_TABLE"})(J||(J={}));function ce(u){return u>=L.ZERO&&u<=L.NINE}function gr(u){return u>=L.UPPER_A&&u<=L.UPPER_F||u>=L.LOWER_A&&u<=L.LOWER_F}function xr(u){return u>=L.UPPER_A&&u<=L.UPPER_Z||u>=L.LOWER_A&&u<=L.LOWER_Z||ce(u)}function kr(u){return u===L.EQUALS||xr(u)}var M;(function(u){u[u.EntityStart=0]="EntityStart",u[u.NumericStart=1]="NumericStart",u[u.NumericDecimal=2]="NumericDecimal",u[u.NumericHex=3]="NumericHex",u[u.NamedEntity=4]="NamedEntity"})(M||(M={}));var O;(function(u){u[u.Legacy=0]="Legacy",u[u.Strict=1]="Strict",u[u.Attribute=2]="Attribute"})(O||(O={}));var Iu=class{constructor(e,t,r){this.decodeTree=e,this.emitCodePoint=t,this.errors=r,this.state=M.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=O.Strict}startEntity(e){this.decodeMode=e,this.state=M.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case M.EntityStart:return e.charCodeAt(t)===L.NUM?(this.state=M.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=M.NamedEntity,this.stateNamedEntity(e,t));case M.NumericStart:return this.stateNumericStart(e,t);case M.NumericDecimal:return this.stateNumericDecimal(e,t);case M.NumericHex:return this.stateNumericHex(e,t);case M.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|br)===L.LOWER_X?(this.state=M.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=M.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,r,n){if(t!==r){let o=r-t;this.result=this.result*Math.pow(n,o)+parseInt(e.substr(t,o),n),this.consumed+=o}}stateNumericHex(e,t){let r=t;for(;t>14;for(;t>14,o!==0){if(i===L.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==O.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:r}=this,n=(r[t]&J.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,r){let{decodeTree:n}=this;return this.emitCodePoint(t===1?n[e]&~J.VALUE_LENGTH:n[e+1],r),t===3&&this.emitCodePoint(n[e+2],r),r}end(){var e;switch(this.state){case M.NamedEntity:return this.result!==0&&(this.decodeMode!==O.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case M.NumericDecimal:return this.emitNumericEntity(0,2);case M.NumericHex:return this.emitNumericEntity(0,3);case M.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case M.EntityStart:return 0}}};function zt(u){let e="",t=new Iu(u,r=>e+=oe(r));return function(n,o){let i=0,c=0;for(;(c=n.indexOf("&",c))>=0;){e+=n.slice(i,c),t.startEntity(o);let s=t.write(n,c+1);if(s<0){i=c+t.end();break}i=c+s,c=s===0?i+1:i}let a=e+n.slice(i);return e="",a}}function _r(u,e,t,r){let n=(e&J.BRANCH_LENGTH)>>7,o=e&J.JUMP_TABLE;if(n===0)return o!==0&&r===o?t:-1;if(o){let a=r-o;return a<0||a>=n?-1:u[t+a]-1}let i=t,c=i+n-1;for(;i<=c;){let a=i+c>>>1,s=u[a];if(sr)c=a-1;else return u[a+n]}return-1}var yr=zt(Bt),_i=zt(Nt);function K(u,e=O.Legacy){return yr(u,e)}function Ru(u){for(let e=1;eu.codePointAt(e):(u,e)=>(u.charCodeAt(e)&64512)===55296?(u.charCodeAt(e)-55296)*1024+u.charCodeAt(e+1)-56320+65536:u.charCodeAt(e);function ae(u,e){return function(r){let n,o=0,i="";for(;n=u.exec(r);)o!==n.index&&(i+=r.substring(o,n.index)),i+=e.get(n[0].charCodeAt(0)),o=n.index+1;return i+r.substring(o)}}var Ot=ae(/[&<>'"]/g,wr),Ht=ae(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),Ut=ae(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var $t;(function(u){u[u.XML=0]="XML",u[u.HTML=1]="HTML"})($t||($t={}));var jt;(function(u){u[u.UTF8=0]="UTF8",u[u.ASCII=1]="ASCII",u[u.Extensive=2]="Extensive",u[u.Attribute=3]="Attribute",u[u.Text=4]="Text"})(jt||(jt={}));function vr(u){return Object.prototype.toString.call(u)}function qu(u){return vr(u)==="[object String]"}var Fr=Object.prototype.hasOwnProperty;function Sr(u,e){return Fr.call(u,e)}function su(u){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!="object")throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){u[r]=t[r]})}}),u}function le(u,e,t){return[].concat(u.slice(0,e),t,u.slice(e+1))}function Pu(u){return!(u>=55296&&u<=57343||u>=64976&&u<=65007||(u&65535)===65535||(u&65535)===65534||u>=0&&u<=8||u===11||u>=14&&u<=31||u>=127&&u<=159||u>1114111)}function bu(u){if(u>65535){u-=65536;let e=55296+(u>>10),t=56320+(u&1023);return String.fromCharCode(e,t)}return String.fromCharCode(u)}var Gt=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Tr=/&([a-z#][a-z0-9]{1,31});/gi,Mr=new RegExp(Gt.source+"|"+Tr.source,"gi"),Lr=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Ir(u,e){if(e.charCodeAt(0)===35&&Lr.test(e)){let r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Pu(r)?bu(r):u}let t=K(u);return t!==u?t:u}function Rr(u){return u.indexOf("\\")<0?u:u.replace(Gt,"$1")}function V(u){return u.indexOf("\\")<0&&u.indexOf("&")<0?u:u.replace(Mr,function(e,t,r){return t||Ir(e,r)})}var qr=/[&<>"]/,Pr=/[&<>"]/g,Br={"&":"&","<":"<",">":">",'"':"""};function Nr(u){return Br[u]}function Z(u){return qr.test(u)?u.replace(Pr,Nr):u}var zr=/[.?*+^$[\]\\(){}|-]/g;function Or(u){return u.replace(zr,"\\$&")}function v(u){switch(u){case 9:case 32:return!0}return!1}function uu(u){if(u>=8192&&u<=8202)return!0;switch(u){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function eu(u){return au.test(u)||Mu.test(u)}function tu(u){switch(u){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function ru(u){return u=u.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(u=u.replace(/ẞ/g,"\xDF")),u.toLowerCase().toUpperCase()}var Hr={mdurl:Fu,ucmicro:re};var me={};wu(me,{parseLinkDestination:()=>pe,parseLinkLabel:()=>fe,parseLinkTitle:()=>he});function fe(u,e,t){let r,n,o,i,c=u.posMax,a=u.pos;for(u.pos=e+1,r=1;u.pos32))return o;if(r===41){if(i===0)break;i--}n++}return e===n||i!==0||(o.str=V(u.slice(e,n)),o.pos=n,o.ok=!0),o}function he(u,e,t,r){let n,o=e,i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(o>=t)return i;let c=u.charCodeAt(o);if(c!==34&&c!==39&&c!==40)return i;e++,o++,c===40&&(c=41),i.marker=c}for(;o"+Z(o.content)+""};H.code_block=function(u,e,t,r,n){let o=u[e];return""+Z(u[e].content)+` `};H.fence=function(u,e,t,r,n){let o=u[e],i=o.info?V(o.info).trim():"",c="",a="";if(i){let d=i.split(/(\s+)/g);c=d[0],a=d.slice(2).join("")}let s;if(t.highlight?s=t.highlight(o.content,c,a)||Z(o.content):s=Z(o.content),s.indexOf("${s} +`;if(i){let d=o.attrIndex("class"),f=o.attrs?o.attrs.slice():[];d<0?f.push(["class",t.langPrefix+c]):(f[d]=f[d].slice(),f[d][1]+=" "+t.langPrefix+c);let g={attrs:f};return`
    ${s}
    `}return`
    ${s}
    `};H.image=function(u,e,t,r,n){let o=u[e];return o.attrs[o.attrIndex("alt")][1]=n.renderInlineAsText(o.children,t,r),n.renderToken(u,e,t)};H.hardbreak=function(u,e,t){return t.xhtmlOut?`
    `:`
    @@ -12,17 +12,17 @@ var W0=Object.create;var Eu=Object.defineProperty;var X0=Object.getOwnPropertyDe `};H.text=function(u,e){return Z(u[e].content)};H.html_block=function(u,e){return u[e].content};H.html_inline=function(u,e){return u[e].content};function lu(){this.rules=su({},H)}lu.prototype.renderAttrs=function(e){let t,r,n;if(!e.attrs)return"";for(n="",t=0,r=e.attrs.length;t `:">",o};lu.prototype.renderInline=function(u,e,t){let r="",n=this.rules;for(let o=0,i=u.length;o=0&&(r=this.attrs[t][1]),r};du.prototype.attrJoin=function(e,t){let r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};var G=du;function Xt(u,e,t){this.src=u,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=e}Xt.prototype.Token=G;var Jt=Xt;var $r=/\r\n?|\n/g,Ur=/\0/g;function be(u){let e;e=u.src.replace($r,` -`),e=e.replace(Ur,"\uFFFD"),u.src=e}function ge(u){let e;u.inlineMode?(e=new u.Token("inline","",0),e.content=u.src,e.map=[0,1],e.children=[],u.tokens.push(e)):u.md.block.parse(u.src,u.md,u.env,u.tokens)}function xe(u){let e=u.tokens;for(let t=0,r=e.length;t\s]/i.test(u)}function Vr(u){return/^<\/a\s*>/i.test(u)}function ke(u){let e=u.tokens;if(u.md.options.linkify)for(let t=0,r=e.length;t=0;i--){let c=n[i];if(c.type==="link_close"){for(i--;n[i].level!==c.level&&n[i].type!=="link_open";)i--;continue}if(c.type==="html_inline"&&(jr(c.content)&&o>0&&o--,Vr(c.content)&&o++),!(o>0)&&c.type==="text"&&u.md.linkify.test(c.content)){let a=c.content,s=u.md.linkify.match(a),d=[],f=c.level,x=0;s.length>0&&s[0].index===0&&i>0&&n[i-1].type==="text_special"&&(s=s.slice(1));for(let h=0;hx){let m=new u.Token("text","",0);m.content=a.slice(x,k),m.level=f,d.push(m)}let g=new u.Token("link_open","a",1);g.attrs=[["href",p]],g.level=f++,g.markup="linkify",g.info="auto",d.push(g);let _=new u.Token("text","",0);_.content=b,_.level=f,d.push(_);let y=new u.Token("link_close","a",-1);y.level=--f,y.markup="linkify",y.info="auto",d.push(y),x=s[h].lastIndex}if(x=0;t--){let r=u[t];r.type==="text"&&!e&&(r.content=r.content.replace(Gr,Xr)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function Kr(u){let e=0;for(let t=u.length-1;t>=0;t--){let r=u[t];r.type==="text"&&!e&&Kt.test(r.content)&&(r.content=r.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function _e(u){let e;if(u.md.options.typographer)for(e=u.tokens.length-1;e>=0;e--)u.tokens[e].type==="inline"&&(Zr.test(u.tokens[e].content)&&Jr(u.tokens[e].children),Kt.test(u.tokens[e].content)&&Kr(u.tokens[e].children))}var Yr=/['"]/,Yt=/['"]/g,Qt="\u2019";function Bu(u,e,t){return u.slice(0,e)+t+u.slice(e+1)}function Qr(u,e){let t,r=[];for(let n=0;n=0&&!(r[t].level<=i);t--);if(r.length=t+1,o.type!=="text")continue;let c=o.content,a=0,s=c.length;u:for(;a=0)l=c.charCodeAt(d.index-1);else for(t=n-1;t>=0&&!(u[t].type==="softbreak"||u[t].type==="hardbreak");t--)if(u[t].content){l=u[t].content.charCodeAt(u[t].content.length-1);break}let p=32;if(a=48&&l<=57&&(x=f=!1),f&&x&&(f=b,x=k),!f&&!x){h&&(o.content=Bu(o.content,d.index,Qt));continue}if(x)for(t=r.length-1;t>=0;t--){let y=r[t];if(r[t].level=0;e--)u.tokens[e].type!=="inline"||!Yr.test(u.tokens[e].content)||Qr(u.tokens[e].children,u)}function Ee(u){let e,t,r=u.tokens,n=r.length;for(let o=0;o0&&this.level++,this.tokens.push(r),r};$.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};$.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;et;)if(!A(this.src.charCodeAt(--e)))return e+1;return e};$.prototype.skipChars=function(e,t){for(let r=this.src.length;er;)if(t!==this.src.charCodeAt(--e))return e+1;return e};$.prototype.getLines=function(e,t,r,n){if(e>=t)return"";let o=new Array(t-e);for(let i=0,c=e;cr?o[i]=new Array(a-r+1).join(" ")+this.src.slice(d,f):o[i]=this.src.slice(d,f)}return o.join("")};$.prototype.Token=G;var e0=$;var un=65536;function De(u,e){let t=u.bMarks[e]+u.tShift[e],r=u.eMarks[e];return u.src.slice(t,r)}function t0(u){let e=[],t=u.length,r=0,n=u.charCodeAt(r),o=!1,i=0,c="";for(;rt)return!1;let n=e+1;if(u.sCount[n]=4)return!1;let o=u.bMarks[n]+u.tShift[n];if(o>=u.eMarks[n])return!1;let i=u.src.charCodeAt(o++);if(i!==124&&i!==45&&i!==58||o>=u.eMarks[n])return!1;let c=u.src.charCodeAt(o++);if(c!==124&&c!==45&&c!==58&&!A(c)||i===45&&A(c))return!1;for(;o=4)return!1;s=t0(a),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop();let f=s.length;if(f===0||f!==d.length)return!1;if(r)return!0;let x=u.parentType;u.parentType="table";let h=u.md.block.ruler.getRules("blockquote"),l=u.push("table_open","table",1),p=[e,0];l.map=p;let b=u.push("thead_open","thead",1);b.map=[e,e+1];let k=u.push("tr_open","tr",1);k.map=[e,e+1];for(let y=0;y=4||(s=t0(a),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop(),_+=f-s.length,_>un))break;if(n===e+2){let E=u.push("tbody_open","tbody",1);E.map=g=[e+2,0]}let m=u.push("tr_open","tr",1);m.map=[n,n+1];for(let E=0;E=4){r++,n=r;continue}break}u.line=n;let o=u.push("code_block","code",0);return o.content=u.getLines(e,n,4+u.blkIndent,!1)+` -`,o.map=[e,u.line],!0}function Fe(u,e,t,r){let n=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4||n+3>o)return!1;let i=u.src.charCodeAt(n);if(i!==126&&i!==96)return!1;let c=n;n=u.skipChars(n,i);let a=n-c;if(a<3)return!1;let s=u.src.slice(c,n),d=u.src.slice(n,o);if(i===96&&d.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let f=e,x=!1;for(;f++,!(f>=t||(n=c=u.bMarks[f]+u.tShift[f],o=u.eMarks[f],n=4)&&(n=u.skipChars(n,i),!(n-c=4||u.src.charCodeAt(n)!==62)return!1;if(r)return!0;let c=[],a=[],s=[],d=[],f=u.md.block.ruler.getRules("blockquote"),x=u.parentType;u.parentType="blockquote";let h=!1,l;for(l=e;l=o)break;if(u.src.charCodeAt(n++)===62&&!_){let m=u.sCount[l]+1,E,w;u.src.charCodeAt(n)===32?(n++,m++,w=!1,E=!0):u.src.charCodeAt(n)===9?(E=!0,(u.bsCount[l]+m)%4===3?(n++,m++,w=!1):w=!0):E=!1;let C=m;for(c.push(u.bMarks[l]),u.bMarks[l]=n;n=o,a.push(u.bsCount[l]),u.bsCount[l]=u.sCount[l]+1+(E?1:0),s.push(u.sCount[l]),u.sCount[l]=C-m,d.push(u.tShift[l]),u.tShift[l]=n-u.bMarks[l];continue}if(h)break;let y=!1;for(let m=0,E=f.length;m";let k=[e,0];b.map=k,u.md.block.tokenize(u,e,l);let g=u.push("blockquote_close","blockquote",-1);g.markup=">",u.lineMax=i,u.parentType=x,k[1]=u.line;for(let _=0;_=4)return!1;let o=u.bMarks[e]+u.tShift[e],i=u.src.charCodeAt(o++);if(i!==42&&i!==45&&i!==95)return!1;let c=1;for(;o=r)return-1;let o=u.src.charCodeAt(n++);if(o<48||o>57)return-1;for(;;){if(n>=r)return-1;if(o=u.src.charCodeAt(n++),o>=48&&o<=57){if(n-t>=10)return-1;continue}if(o===41||o===46)break;return-1}return n=4||u.listIndent>=0&&u.sCount[a]-u.listIndent>=4&&u.sCount[a]=u.blkIndent&&(d=!0);let f,x,h;if((h=n0(u,a))>=0){if(f=!0,i=u.bMarks[a]+u.tShift[a],x=Number(u.src.slice(i,h-1)),d&&x!==1)return!1}else if((h=r0(u,a))>=0)f=!1;else return!1;if(d&&u.skipSpaces(h)>=u.eMarks[a])return!1;if(r)return!0;let l=u.src.charCodeAt(h-1),p=u.tokens.length;f?(c=u.push("ordered_list_open","ol",1),x!==1&&(c.attrs=[["start",x]])):c=u.push("bullet_list_open","ul",1);let b=[a,0];c.map=b,c.markup=String.fromCharCode(l);let k=!1,g=u.md.block.ruler.getRules("list"),_=u.parentType;for(u.parentType="list";a=n?w=1:w=m-y,w>4&&(w=1);let C=y+w;c=u.push("list_item_open","li",1),c.markup=String.fromCharCode(l);let D=[a,0];c.map=D,f&&(c.info=u.src.slice(i,h-1));let F=u.tight,S=u.tShift[a],I=u.sCount[a],q=u.listIndent;if(u.listIndent=u.blkIndent,u.blkIndent=C,u.tight=!0,u.tShift[a]=E-u.bMarks[a],u.sCount[a]=m,E>=n&&u.isEmpty(a+1)?u.line=Math.min(u.line+2,t):u.md.block.tokenize(u,a,t,!0),(!u.tight||k)&&(s=!1),k=u.line-a>1&&u.isEmpty(u.line-1),u.blkIndent=u.listIndent,u.listIndent=q,u.tShift[a]=S,u.sCount[a]=I,u.tight=F,c=u.push("list_item_close","li",-1),c.markup=String.fromCharCode(l),a=u.line,D[1]=a,a>=t||u.sCount[a]=4)break;let pu=!1;for(let j=0,Q=g.length;j=4||u.src.charCodeAt(n)!==91)return!1;function c(g){let _=u.lineMax;if(g>=_||u.isEmpty(g))return null;let y=!1;if(u.sCount[g]-u.blkIndent>3&&(y=!0),u.sCount[g]<0&&(y=!0),!y){let w=u.md.block.ruler.getRules("reference"),C=u.parentType;u.parentType="reference";let D=!1;for(let F=0,S=w.length;F"u"&&(u.env.references={}),typeof u.env.references[k]>"u"&&(u.env.references[k]={title:b,href:f}),u.line=i),!0):!1}var o0=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];var tn="[a-zA-Z_:][a-zA-Z0-9:._-]*",rn="[^\"'=<>`\\x00-\\x20]+",nn="'[^']*'",on='"[^"]*"',cn="(?:"+rn+"|"+nn+"|"+on+")",an="(?:\\s+"+tn+"(?:\\s*=\\s*"+cn+")?)",i0="<[A-Za-z][A-Za-z0-9\\-]*"+an+"*\\s*\\/?>",c0="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",sn="",ln="<[?][\\s\\S]*?[?]>",dn="]*>",fn="",a0=new RegExp("^(?:"+i0+"|"+c0+"|"+sn+"|"+ln+"|"+dn+"|"+fn+")"),s0=new RegExp("^(?:"+i0+"|"+c0+")");var fu=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(s0.source+"\\s*$"),/^$/,!1]];function Ie(u,e,t,r){let n=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4||!u.md.options.html||u.src.charCodeAt(n)!==60)return!1;let i=u.src.slice(n,o),c=0;for(;c=4)return!1;let i=u.src.charCodeAt(n);if(i!==35||n>=o)return!1;let c=1;for(i=u.src.charCodeAt(++n);i===35&&n6||nn&&A(u.src.charCodeAt(a-1))&&(o=a),u.line=e+1;let s=u.push("heading_open","h"+String(c),1);s.markup="########".slice(0,c),s.map=[e,u.line];let d=u.push("inline","",0);d.content=u.src.slice(n,o).trim(),d.map=[e,u.line],d.children=[];let f=u.push("heading_close","h"+String(c),-1);return f.markup="########".slice(0,c),!0}function qe(u,e,t){let r=u.md.block.ruler.getRules("paragraph");if(u.sCount[e]-u.blkIndent>=4)return!1;let n=u.parentType;u.parentType="paragraph";let o=0,i,c=e+1;for(;c3)continue;if(u.sCount[c]>=u.blkIndent){let h=u.bMarks[c]+u.tShift[c],l=u.eMarks[c];if(h=l))){o=i===61?1:2;break}}if(u.sCount[c]<0)continue;let x=!1;for(let h=0,l=r.length;h3||u.sCount[o]<0)continue;let s=!1;for(let d=0,f=r.length;d=t||u.sCount[i]=o){u.line=t;break}let a=u.line,s=!1;for(let d=0;d=u.line)throw new Error("block rule didn't increment state.line");break}if(!s)throw new Error("none of the block rules matched");u.tight=!c,u.isEmpty(u.line-1)&&(c=!0),i=u.line,i0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(n),r};gu.prototype.scanDelims=function(u,e){let t=this.posMax,r=this.src.charCodeAt(u),n=u>0?this.src.charCodeAt(u-1):32,o=u;for(;o0)return!1;let t=u.pos,r=u.posMax;if(t+3>r||u.src.charCodeAt(t)!==58||u.src.charCodeAt(t+1)!==47||u.src.charCodeAt(t+2)!==47)return!1;let n=u.pending.match(hn);if(!n)return!1;let o=n[1],i=u.md.linkify.matchAtStart(u.src.slice(t-o.length));if(!i)return!1;let c=i.url;if(c.length<=o.length)return!1;c=c.replace(/\*+$/,"");let a=u.md.normalizeLink(c);if(!u.md.validateLink(a))return!1;if(!e){u.pending=u.pending.slice(0,-o.length);let s=u.push("link_open","a",1);s.attrs=[["href",a]],s.markup="linkify",s.info="auto";let d=u.push("text","",0);d.content=u.md.normalizeLinkText(c);let f=u.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return u.pos+=c.length-o.length,!0}function ze(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==10)return!1;let r=u.pending.length-1,n=u.posMax;if(!e)if(r>=0&&u.pending.charCodeAt(r)===32)if(r>=1&&u.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&u.pending.charCodeAt(o-1)===32;)o--;u.pending=u.pending.slice(0,o),u.push("hardbreak","br",0)}else u.pending=u.pending.slice(0,-1),u.push("softbreak","br",0);else u.push("softbreak","br",0);for(t++;t?@[]^_`{|}~-".split("").forEach(function(u){Oe[u.charCodeAt(0)]=1});function He(u,e){let t=u.pos,r=u.posMax;if(u.src.charCodeAt(t)!==92||(t++,t>=r))return!1;let n=u.src.charCodeAt(t);if(n===10){for(e||u.push("hardbreak","br",0),t++;t=55296&&n<=56319&&t+1=56320&&c<=57343&&(o+=u.src[t+1],t++)}let i="\\"+o;if(!e){let c=u.push("text_special","",0);n<256&&Oe[n]!==0?c.content=o:c.content=i,c.markup=i,c.info="escape"}return u.pos=t+1,!0}function $e(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==96)return!1;let n=t;t++;let o=u.posMax;for(;t=0;r--){let n=e[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let o=e[n.end],i=r>0&&e[r-1].end===n.end+1&&e[r-1].marker===n.marker&&e[r-1].token===n.token-1&&e[n.end+1].token===o.token+1,c=String.fromCharCode(n.marker),a=u.tokens[n.token];a.type=i?"strong_open":"em_open",a.tag=i?"strong":"em",a.nesting=1,a.markup=i?c+c:c,a.content="";let s=u.tokens[o.token];s.type=i?"strong_close":"em_close",s.tag=i?"strong":"em",s.nesting=-1,s.markup=i?c+c:c,s.content="",i&&(u.tokens[e[r-1].token].content="",u.tokens[e[n.end+1].token].content="",r--)}}function xn(u){let e=u.tokens_meta,t=u.tokens_meta.length;p0(u,u.delimiters);for(let r=0;r=f)return!1;if(a=l,n=u.md.helpers.parseLinkDestination(u.src,l,u.posMax),n.ok){for(i=u.md.normalizeLink(n.str),u.md.validateLink(i)?l=n.pos:i="",a=l;l=f||u.src.charCodeAt(l)!==41)&&(s=!0),l++}if(s){if(typeof u.env.references>"u")return!1;if(l=0?r=u.src.slice(a,l++):l=h+1):l=h+1,r||(r=u.src.slice(x,h)),o=u.env.references[ru(r)],!o)return u.pos=d,!1;i=o.href,c=o.title}if(!e){u.pos=x,u.posMax=h;let p=u.push("link_open","a",1),b=[["href",i]];p.attrs=b,c&&b.push(["title",c]),u.linkLevel++,u.md.inline.tokenize(u),u.linkLevel--,u.push("link_close","a",-1)}return u.pos=l,u.posMax=f,!0}function Ze(u,e){let t,r,n,o,i,c,a,s,d="",f=u.pos,x=u.posMax;if(u.src.charCodeAt(u.pos)!==33||u.src.charCodeAt(u.pos+1)!==91)return!1;let h=u.pos+2,l=u.md.helpers.parseLinkLabel(u,u.pos+1,!1);if(l<0)return!1;if(o=l+1,o=x)return!1;for(s=o,c=u.md.helpers.parseLinkDestination(u.src,o,u.posMax),c.ok&&(d=u.md.normalizeLink(c.str),u.md.validateLink(d)?o=c.pos:d=""),s=o;o=x||u.src.charCodeAt(o)!==41)return u.pos=f,!1;o++}else{if(typeof u.env.references>"u")return!1;if(o=0?n=u.src.slice(s,o++):o=l+1):o=l+1,n||(n=u.src.slice(h,l)),i=u.env.references[ru(n)],!i)return u.pos=f,!1;d=i.href,a=i.title}if(!e){r=u.src.slice(h,l);let p=[];u.md.inline.parse(r,u.md,u.env,p);let b=u.push("image","img",0),k=[["src",d],["alt",""]];b.attrs=k,b.children=p,b.content=r,a&&k.push(["title",a])}return u.pos=o,u.posMax=x,!0}var kn=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,_n=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Ge(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==60)return!1;let r=u.pos,n=u.posMax;for(;;){if(++t>=n)return!1;let i=u.src.charCodeAt(t);if(i===60)return!1;if(i===62)break}let o=u.src.slice(r+1,t);if(_n.test(o)){let i=u.md.normalizeLink(o);if(!u.md.validateLink(i))return!1;if(!e){let c=u.push("link_open","a",1);c.attrs=[["href",i]],c.markup="autolink",c.info="auto";let a=u.push("text","",0);a.content=u.md.normalizeLinkText(o);let s=u.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return u.pos+=o.length+2,!0}if(kn.test(o)){let i=u.md.normalizeLink("mailto:"+o);if(!u.md.validateLink(i))return!1;if(!e){let c=u.push("link_open","a",1);c.attrs=[["href",i]],c.markup="autolink",c.info="auto";let a=u.push("text","",0);a.content=u.md.normalizeLinkText(o);let s=u.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return u.pos+=o.length+2,!0}return!1}function yn(u){return/^\s]/i.test(u)}function En(u){return/^<\/a\s*>/i.test(u)}function wn(u){let e=u|32;return e>=97&&e<=122}function We(u,e){if(!u.md.options.html)return!1;let t=u.posMax,r=u.pos;if(u.src.charCodeAt(r)!==60||r+2>=t)return!1;let n=u.src.charCodeAt(r+1);if(n!==33&&n!==63&&n!==47&&!wn(n))return!1;let o=u.src.slice(r).match(a0);if(!o)return!1;if(!e){let i=u.push("html_inline","",0);i.content=o[0],yn(i.content)&&u.linkLevel++,En(i.content)&&u.linkLevel--}return u.pos+=o[0].length,!0}var Cn=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Dn=/^&([a-z][a-z0-9]{1,31});/i;function Xe(u,e){let t=u.pos,r=u.posMax;if(u.src.charCodeAt(t)!==38||t+1>=r)return!1;if(u.src.charCodeAt(t+1)===35){let o=u.src.slice(t).match(Cn);if(o){if(!e){let i=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),c=u.push("text_special","",0);c.content=Pu(i)?bu(i):bu(65533),c.markup=o[0],c.info="entity"}return u.pos+=o[0].length,!0}}else{let o=u.src.slice(t).match(Dn);if(o){let i=K(o[0]);if(i!==o[0]){if(!e){let c=u.push("text_special","",0);c.content=i,c.markup=o[0],c.info="entity"}return u.pos+=o[0].length,!0}}}return!1}function h0(u){let e={},t=u.length;if(!t)return;let r=0,n=-2,o=[];for(let i=0;ia;s-=o[s]+1){let f=u[s];if(f.marker===c.marker&&f.open&&f.end<0){let x=!1;if((f.close||c.open)&&(f.length+c.length)%3===0&&(f.length%3!==0||c.length%3!==0)&&(x=!0),!x){let h=s>0&&!u[s-1].open?o[s-1]+1:0;o[i]=i-s+h,o[s]=h,c.open=!1,f.end=i,f.close=!1,d=-1,n=-2;break}}}d!==-1&&(e[c.marker][(c.open?3:0)+(c.length||0)%3]=d)}}function Je(u){let e=u.tokens_meta,t=u.tokens_meta.length;h0(u.delimiters);for(let r=0;r0&&r++,n[e].type==="text"&&e+1=u.pos)throw new Error("inline rule didn't increment state.pos");break}}else u.pos=u.posMax;i||u.pos++,o[e]=u.pos};xu.prototype.tokenize=function(u){let e=this.ruler.getRules(""),t=e.length,r=u.posMax,n=u.md.options.maxNesting;for(;u.pos=u.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(u.pos>=r)break;continue}u.pending+=u.src[u.pos++]}u.pending&&u.pushPending()};xu.prototype.parse=function(u,e,t,r){let n=new this.State(u,e,t,r);this.tokenize(n);let o=this.ruler2.getRules(""),i=o.length;for(let c=0;c|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function ut(u){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(r){u[r]=t[r]})}),u}function Hu(u){return Object.prototype.toString.call(u)}function vn(u){return Hu(u)==="[object String]"}function An(u){return Hu(u)==="[object Object]"}function Fn(u){return Hu(u)==="[object RegExp]"}function g0(u){return Hu(u)==="[object Function]"}function Sn(u){return u.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var k0={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Tn(u){return Object.keys(u||{}).reduce(function(e,t){return e||k0.hasOwnProperty(t)},!1)}var Mn={"http:":{validate:function(u,e,t){let r=u.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(r)?r.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(u,e,t){let r=u.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(r)?e>=3&&u[e-3]===":"||e>=3&&u[e-3]==="/"?0:r.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(u,e,t){let r=u.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(r)?r.match(t.re.mailto)[0].length:0}}},Ln="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",In="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function Rn(u){u.__index__=-1,u.__text_cache__=""}function qn(u){return function(e,t){let r=e.slice(t);return u.test(r)?r.match(u)[0].length:0}}function x0(){return function(u,e){e.normalize(u)}}function Ou(u){let e=u.re=b0(u.__opts__),t=u.__tlds__.slice();u.onCompile(),u.__tlds_replaced__||t.push(Ln),t.push(e.src_xn),e.src_tlds=t.join("|");function r(c){return c.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");let n=[];u.__compiled__={};function o(c,a){throw new Error('(LinkifyIt) Invalid schema "'+c+'": '+a)}Object.keys(u.__schemas__).forEach(function(c){let a=u.__schemas__[c];if(a===null)return;let s={validate:null,link:null};if(u.__compiled__[c]=s,An(a)){Fn(a.validate)?s.validate=qn(a.validate):g0(a.validate)?s.validate=a.validate:o(c,a),g0(a.normalize)?s.normalize=a.normalize:a.normalize?o(c,a):s.normalize=x0();return}if(vn(a)){n.push(c);return}o(c,a)}),n.forEach(function(c){u.__compiled__[u.__schemas__[c]]&&(u.__compiled__[c].validate=u.__compiled__[u.__schemas__[c]].validate,u.__compiled__[c].normalize=u.__compiled__[u.__schemas__[c]].normalize)}),u.__compiled__[""]={validate:null,normalize:x0()};let i=Object.keys(u.__compiled__).filter(function(c){return c.length>0&&u.__compiled__[c]}).map(Sn).join("|");u.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+i+")","i"),u.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+i+")","ig"),u.re.schema_at_start=RegExp("^"+u.re.schema_search.source,"i"),u.re.pretest=RegExp("("+u.re.schema_test.source+")|("+u.re.host_fuzzy_test.source+")|@","i"),Rn(u)}function Pn(u,e){let t=u.__index__,r=u.__last_index__,n=u.__text_cache__.slice(t,r);this.schema=u.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=r+e,this.raw=n,this.text=n,this.url=n}function et(u,e){let t=new Pn(u,e);return u.__compiled__[t.schema].normalize(t,u),t}function P(u,e){if(!(this instanceof P))return new P(u,e);e||Tn(u)&&(e=u,u={}),this.__opts__=ut({},k0,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=ut({},Mn,u),this.__compiled__={},this.__tlds__=In,this.__tlds_replaced__=!1,this.re={},Ou(this)}P.prototype.add=function(e,t){return this.__schemas__[e]=t,Ou(this),this};P.prototype.set=function(e){return this.__opts__=ut(this.__opts__,e),this};P.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,r,n,o,i,c,a,s,d;if(this.re.schema_test.test(e)){for(a=this.re.schema_search,a.lastIndex=0;(t=a.exec(e))!==null;)if(o=this.testSchemaAt(e,t[2],a.lastIndex),o){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(s=e.search(this.re.host_fuzzy_test),s>=0&&(this.__index__<0||s=0&&(n=e.match(this.re.email_fuzzy))!==null&&(i=n.index+n[1].length,c=n.index+n[0].length,(this.__index__<0||ithis.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=c))),this.__index__>=0};P.prototype.pretest=function(e){return this.re.pretest.test(e)};P.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0};P.prototype.match=function(e){let t=[],r=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(et(this,r)),r=this.__last_index__);let n=r?e.slice(r):e;for(;this.test(n);)t.push(et(this,r)),n=n.slice(this.__last_index__),r+=this.__last_index__;return t.length?t:null};P.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let r=this.testSchemaAt(e,t[2],t[0].length);return r?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+r,et(this,0)):null};P.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,n,o){return r!==o[n-1]}).reverse(),Ou(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Ou(this),this)};P.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};P.prototype.onCompile=function(){};var _0=P;var Bn=/^xn--/,Nn=/[^\0-\x7F]/,zn=/[\x2E\u3002\uFF0E\uFF61]/g,On={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},tt=35,U=Math.floor,rt=String.fromCharCode;function Y(u){throw new RangeError(On[u])}function Hn(u,e){let t=[],r=u.length;for(;r--;)t[r]=e(u[r]);return t}function E0(u,e){let t=u.split("@"),r="";t.length>1&&(r=t[0]+"@",u=t[1]),u=u.replace(zn,".");let n=u.split("."),o=Hn(n,e).join(".");return r+o}function w0(u){let e=[],t=0,r=u.length;for(;t=55296&&n<=56319&&tString.fromCodePoint(...u),Un=function(u){return u>=48&&u<58?26+(u-48):u>=65&&u<91?u-65:u>=97&&u<123?u-97:36},y0=function(u,e){return u+22+75*(u<26)-((e!=0)<<5)},C0=function(u,e,t){let r=0;for(u=t?U(u/700):u>>1,u+=U(u/e);u>tt*26>>1;r+=36)u=U(u/tt);return U(r+(tt+1)*u/(u+38))},D0=function(u){let e=[],t=u.length,r=0,n=128,o=72,i=u.lastIndexOf("-");i<0&&(i=0);for(let c=0;c=128&&Y("not-basic"),e.push(u.charCodeAt(c));for(let c=i>0?i+1:0;c=t&&Y("invalid-input");let x=Un(u.charCodeAt(c++));x>=36&&Y("invalid-input"),x>U((2147483647-r)/d)&&Y("overflow"),r+=x*d;let h=f<=o?1:f>=o+26?26:f-o;if(xU(2147483647/l)&&Y("overflow"),d*=l}let s=e.length+1;o=C0(r-a,s,a==0),U(r/s)>2147483647-n&&Y("overflow"),n+=U(r/s),r%=s,e.splice(r++,0,n)}return String.fromCodePoint(...e)},v0=function(u){let e=[];u=w0(u);let t=u.length,r=128,n=0,o=72;for(let a of u)a<128&&e.push(rt(a));let i=e.length,c=i;for(i&&e.push("-");c=r&&dU((2147483647-n)/s)&&Y("overflow"),n+=(a-r)*s,r=a;for(let d of u)if(d2147483647&&Y("overflow"),d===r){let f=n;for(let x=36;;x+=36){let h=x<=o?1:x>=o+26?26:x-o;if(f=0))try{e.hostname=nt.toASCII(e.hostname)}catch{}return vu(cu(e))}function Yn(u){let e=mu(u,!0);if(e.hostname&&(!e.protocol||T0.indexOf(e.protocol)>=0))try{e.hostname=nt.toUnicode(e.hostname)}catch{}return hu(cu(e),hu.defaultChars+"%")}function B(u,e){if(!(this instanceof B))return new B(u,e);e||qu(u)||(e=u||{},u="default"),this.inline=new m0,this.block=new l0,this.core=new u0,this.renderer=new Wt,this.linkify=new _0,this.validateLink=Jn,this.normalizeLink=Kn,this.normalizeLinkText=Yn,this.utils=de,this.helpers=su({},me),this.options={},this.configure(u),e&&this.set(e)}B.prototype.set=function(u){return su(this.options,u),this};B.prototype.configure=function(u){let e=this;if(qu(u)){let t=u;if(u=Gn[t],!u)throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!u)throw new Error("Wrong `markdown-it` preset, can't be empty");return u.options&&e.set(u.options),u.components&&Object.keys(u.components).forEach(function(t){u.components[t].rules&&e[t].ruler.enableOnly(u.components[t].rules),u.components[t].rules2&&e[t].ruler2.enableOnly(u.components[t].rules2)}),this};B.prototype.enable=function(u,e){let t=[];Array.isArray(u)||(u=[u]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.enable(u,!0))},this),t=t.concat(this.inline.ruler2.enable(u,!0));let r=u.filter(function(n){return t.indexOf(n)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};B.prototype.disable=function(u,e){let t=[];Array.isArray(u)||(u=[u]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.disable(u,!0))},this),t=t.concat(this.inline.ruler2.disable(u,!0));let r=u.filter(function(n){return t.indexOf(n)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};B.prototype.use=function(u){let e=[this].concat(Array.prototype.slice.call(arguments,1));return u.apply(u,e),this};B.prototype.parse=function(u,e){if(typeof u!="string")throw new Error("Input data should be a String");let t=new this.core.State(u,this,e);return this.core.process(t),t.tokens};B.prototype.render=function(u,e){return e=e||{},this.renderer.render(this.parse(u,e),this.options,e)};B.prototype.parseInline=function(u,e){let t=new this.core.State(u,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens};B.prototype.renderInline=function(u,e){return e=e||{},this.renderer.render(this.parseInline(u,e),this.options,e)};var ot=B;var P0=tr(q0());var $u=class{constructor(){v(this,"renderer");this.renderer=new ot({html:!0}),this.renderer.use(P0.default,{label:!0})}getRenderer(){return this.renderer}render(e){return this.renderer.render(e)}};function lo(u,e){return document.createElement(u,e)}function fo(u,e,t){return document.createElementNS(u,e,t)}function po(){return ou(document.createDocumentFragment())}function ho(u){return document.createTextNode(u)}function mo(u){return document.createComment(u)}function bo(u,e,t){if(W(u)){let r=u;for(;r&&W(r);)r=ou(r).parent;u=r??u}W(e)&&(e=ou(e,u)),t&&W(t)&&(t=ou(t).firstChildNode),u.insertBefore(e,t)}function go(u,e){u.removeChild(e)}function xo(u,e){W(e)&&(e=ou(e,u)),u.appendChild(e)}function B0(u){if(W(u)){for(;u&&W(u);)u=ou(u).parent;return u??null}return u.parentNode}function ko(u){var e;if(W(u)){let t=ou(u),r=B0(t);if(r&&t.lastChildNode){let n=Array.from(r.childNodes),o=n.indexOf(t.lastChildNode);return(e=n[o+1])!==null&&e!==void 0?e:null}return null}return u.nextSibling}function _o(u){return u.tagName}function yo(u,e){u.textContent=e}function Eo(u){return u.textContent}function wo(u){return u.nodeType===1}function Co(u){return u.nodeType===3}function Do(u){return u.nodeType===8}function W(u){return u.nodeType===11}function ou(u,e){var t,r,n;let o=u;return(t=o.parent)!==null&&t!==void 0||(o.parent=e??null),(r=o.firstChildNode)!==null&&r!==void 0||(o.firstChildNode=u.firstChild),(n=o.lastChildNode)!==null&&n!==void 0||(o.lastChildNode=u.lastChild),o}var Uu={createElement:lo,createElementNS:fo,createTextNode:ho,createDocumentFragment:po,createComment:mo,insertBefore:bo,removeChild:go,appendChild:xo,parentNode:B0,nextSibling:ko,tagName:_o,setTextContent:yo,getTextContent:Eo,isElement:wo,isText:Co,isComment:Do,isDocumentFragment:W};function X(u,e,t,r,n){let o=e===void 0?void 0:e.key;return{sel:u,data:e,children:t,text:r,elm:n,key:o}}var ct=Array.isArray;function N0(u){return typeof u=="string"||typeof u=="number"||u instanceof String||u instanceof Number}var at=X("",{},[],void 0,void 0);function ku(u,e){var t,r;let n=u.key===e.key,o=((t=u.data)===null||t===void 0?void 0:t.is)===((r=e.data)===null||r===void 0?void 0:r.is),i=u.sel===e.sel,c=!u.sel&&u.sel===e.sel?typeof u.text==typeof e.text:!0;return i&&n&&o&&c}function Ao(){throw new Error("The document fragment is not supported on this platform.")}function Fo(u,e){return u.isElement(e)}function So(u,e){return u.isDocumentFragment(e)}function To(u,e,t){var r;let n={};for(let o=e;o<=t;++o){let i=(r=u[o])===null||r===void 0?void 0:r.key;i!==void 0&&(n[i]=o)}return n}var Mo=["create","update","remove","destroy","pre","post"];function st(u,e,t){let r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},n=e!==void 0?e:Uu;for(let l of Mo)for(let p of u){let b=p[l];b!==void 0&&r[l].push(b)}function o(l){let p=l.id?"#"+l.id:"",b=l.getAttribute("class"),k=b?"."+b.split(" ").join("."):"";return X(n.tagName(l).toLowerCase()+p+k,{},[],void 0,l)}function i(l){return X(void 0,{},[],void 0,l)}function c(l,p){return function(){if(--p===0){let k=n.parentNode(l);k!==null&&n.removeChild(k,l)}}}function a(l,p){var b,k,g,_,y;let m,E=l.data,w=E?.hook;(b=w?.init)===null||b===void 0||b.call(w,l);let C=l.children,D=l.sel;if(D==="!")(k=l.text)!==null&&k!==void 0||(l.text=""),l.elm=n.createComment(l.text);else if(D==="")l.elm=n.createTextNode(l.text);else if(D!==void 0){let F=D.indexOf("#"),S=D.indexOf(".",F),I=F>0?F:D.length,q=S>0?S:D.length,pu=F!==-1||S!==-1?D.slice(0,Math.min(I,q)):D,j=E?.ns,Q=j===void 0?n.createElement(pu,E):n.createElementNS(j,pu,E);for(l.elm=Q,I0&&Q.setAttribute("class",D.slice(q+1).replace(/\./g," ")),m=0;mt.toUpperCase())}function _u(u,e){var t;let r=e!==void 0?e:Uu,n;if(r.isElement(u)){let o=u.id?"#"+u.id:"",i=(t=u.getAttribute("class"))===null||t===void 0?void 0:t.match(/[^\t\r\n\f ]+/g),c=i?"."+i.join("."):"",a=r.tagName(u).toLowerCase()+o+c,s={},d={},f={},x=[],h,l,p,b=u.attributes,k=u.childNodes;for(l=0,p=b.length;l0&&(f.attrs=s),Object.keys(d).length>0&&(f.dataset=d),a.startsWith("svg")&&(a.length===3||a[3]==="."||a[3]==="#")&<(f,x,a),X(a,f,x,void 0,u)}else return r.isText(u)?(n=r.getTextContent(u),X(void 0,void 0,void 0,n,u)):r.isComment(u)?(n=r.getTextContent(u),X("!",{},[],n,u)):X("",{},[],void 0,u)}var Io="http://www.w3.org/1999/xlink",Ro="http://www.w3.org/2000/xmlns/",qo="http://www.w3.org/XML/1998/namespace";function z0(u,e){let t,r=e.elm,n=u.data.attrs,o=e.data.attrs;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(t in o){let i=o[t];n[t]!==i&&(i===!0?r.setAttribute(t,""):i===!1?r.removeAttribute(t):t.charCodeAt(0)!==120?r.setAttribute(t,i):t.charCodeAt(3)===58?r.setAttributeNS(qo,t,i):t.charCodeAt(5)===58?t.charCodeAt(1)===109?r.setAttributeNS(Ro,t,i):r.setAttributeNS(Io,t,i):r.setAttribute(t,i))}for(t in n)t in o||r.removeAttribute(t)}}var dt={create:z0,update:z0};var ju;function Po(){return ju||(ju=st([dt]),ju)}function O0(u,e){let t=document.createElement("div");t.innerHTML=e,Po()(_u(u),_u(t))}var Vu=class{constructor(e){v(this,"editor");v(this,"container");v(this,"doc",null);v(this,"lastDisplayClick",0);this.editor=e,this.container=e.config.displayEl,this.container.contentDocument?.readyState==="complete"?this.onLoad():this.container.addEventListener("load",this.onLoad.bind(this)),this.updateVisibility(!!e.settings.get("showPreview")),e.settings.onChange("showPreview",t=>this.updateVisibility(!!t))}updateVisibility(e){let t=this.container.closest(".markdown-editor-wrap");t.style.display=e?"":"none"}onLoad(){this.doc=this.container.contentDocument,this.doc&&(this.loadStylesIntoDisplay(),this.doc.body.className="page-content",this.doc.addEventListener("click",this.onDisplayClick.bind(this)))}onDisplayClick(e){let t=Date.now()-this.lastDisplayClick<300,r=e.target.closest("a");if(r!==null){e.preventDefault();let o=r.getAttribute("href");o&&window.open(o);return}let n=e.target.closest("[drawio-diagram]");if(n!==null&&t){this.editor.actions.editDrawing(n);return}this.lastDisplayClick=Date.now()}loadStylesIntoDisplay(){if(!this.doc)return;this.doc.documentElement.classList.add("markdown-editor-display"),document.documentElement.classList.contains("dark-mode")&&(this.doc.documentElement.style.backgroundColor="#222",this.doc.documentElement.classList.add("dark-mode")),this.doc.head.innerHTML="";let e=document.head.querySelectorAll("style,link[rel=stylesheet]");for(let t of e){let r=t.cloneNode(!0);this.doc.head.appendChild(r)}}patchWithHtml(e){if(!this.doc)return;let{body:t}=this.doc;if(t.children.length===0){let n=document.createElement("div");this.doc.body.append(n)}let r=t.children[0];O0(r,e)}scrollToIndex(e){let t=this.doc?.body?.children[0]?.children;if(!t||t.length<=e)return;(e===-1?t[t.length-1]:t[e]).scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"})}};function Zu(u){return new Promise((e,t)=>{u.oncomplete=u.onsuccess=()=>e(u.result),u.onabort=u.onerror=()=>t(u.error)})}function Bo(u,e){let t,r=()=>{if(t)return t;let n=indexedDB.open(u);return n.onupgradeneeded=()=>n.result.createObjectStore(e),t=Zu(n),t.then(o=>{o.onclose=()=>t=void 0},()=>{}),t};return(n,o)=>r().then(i=>o(i.transaction(e,n).objectStore(e)))}var ft;function pt(){return ft||(ft=Bo("keyval-store","keyval")),ft}function ht(u,e=pt()){return e("readonly",t=>Zu(t.get(u)))}function mt(u,e,t=pt()){return t("readwrite",r=>(r.put(e,u),Zu(r.transaction)))}function bt(u,e=pt()){return e("readwrite",t=>(t.delete(u),Zu(t.transaction)))}var Gu=class extends Error{constructor(t,r){super(t.statusText);v(this,"data");v(this,"headers");v(this,"original");v(this,"redirected");v(this,"status");v(this,"statusText");v(this,"url");this.data=r,this.headers=t.headers,this.redirected=t.redirected,this.status=t.status,this.statusText=t.statusText,this.url=t.url,this.original=t}};var z=null,kt,Wu,gt,xt="last-drawing-save";function _t(u){z?.contentWindow?.postMessage(JSON.stringify(u),kt)}function zo(u){mt(xt,u.data),gt&>(u.data).then(()=>{bt(xt)})}function Oo(u){_t({action:"export",format:"xmlpng",xml:u.xml,spin:"Updating drawing"})}function Ho(){Wu&&Wu().then(u=>{_t({action:"load",autosave:1,xml:u})})}function $o(){let u={};z&&(window.$events.emitPublic(z,"editor-drawio::configure",{config:u}),_t({action:"configure",config:u}))}function H0(){window.removeEventListener("message",$0),z&&document.body.removeChild(z)}function $0(u){if(!u.data||u.data.length<1||u.origin!==kt)return;let e=JSON.parse(u.data);e.event==="init"?Ho():e.event==="exit"?H0():e.event==="save"?Oo(e):e.event==="export"?zo(e):e.event==="configure"&&$o()}async function Uo(){let u=await ht(xt),e=document.getElementById("unsaved-drawing-dialog");e||console.error("Missing expected unsaved-drawing dialog"),u&&e&&await window.$components.firstOnElement(e,"confirm-dialog").show()&&(Wu=async()=>u)}async function yt(u,e,t){Wu=e,gt=t,await Uo(),z=document.createElement("iframe"),z.setAttribute("frameborder","0"),window.addEventListener("message",$0),z.setAttribute("src",u),z.setAttribute("class","fullscreen"),z.style.backgroundColor="#FFFFFF",document.body.appendChild(z),kt=new URL(u).origin}function Xu(){H0()}async function U0(u){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${u}`))).data.content}`}catch(e){throw e instanceof Gu&&window.$events.showResponseError(e),Xu(),e}}var T,Et,iu,wt,Ct,Ju,Ku=class{constructor(e){Ft(this,T);v(this,"editor");v(this,"lastContent",{html:"",markdown:""});this.editor=e}updateAndRender(){let e=this.editor.input.getText();this.editor.config.inputEl.value=e;let t=this.editor.markdown.render(e);window.$events.emit("editor-html-change",""),window.$events.emit("editor-markdown-change",""),this.lastContent.html=t,this.lastContent.markdown=e,this.editor.display.patchWithHtml(t)}getContent(){return this.lastContent}showImageInsert(){window.$components.first("image-manager").show(t=>{let r=t.thumbs?.display||t.url,o=`[![${this.editor.input.getSelectionText()||t.name}](${r})](${t.url})`;R(this,T,iu).call(this,o,o.length)},"gallery")}insertImage(){let e=`![${this.editor.input.getSelectionText()}](http://)`;R(this,T,iu).call(this,e,e.length-1)}insertLink(){let e=this.editor.input.getSelectionText(),t=`[${e}]()`,r=e===""?-3:-1;R(this,T,iu).call(this,t,t.length+r)}showImageManager(){let e=this.editor.input.getSelection();window.$components.first("image-manager").show(r=>{R(this,T,Et).call(this,r,e)},"drawio")}showLinkSelector(){let e=this.editor.input.getSelection(),t=window.$components.first("entity-selector-popup"),r=this.editor.input.getSelectionText(e);t.show(n=>{let i=`[${r||n.name}](${n.link})`;R(this,T,iu).call(this,i,i.length,e)},{initialValue:r,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}startDrawing(){let e=this.editor.config.drawioUrl;if(!e)return;let t=this.editor.input.getSelection();yt(e,()=>Promise.resolve(""),async r=>{let n={image:r,uploaded_to:Number(this.editor.config.pageId)};try{let o=await window.$http.post("/images/drawio",n);R(this,T,Et).call(this,o.data,t),Xu()}catch(o){throw this.handleDrawingUploadError(o),new Error(`Failed to save image with error: ${o}`)}})}editDrawing(e){let{drawioUrl:t}=this.editor.config;if(!t)return;let r=this.editor.input.getSelection(),n=e.getAttribute("drawio-diagram")||"";n&&yt(t,()=>U0(n),async o=>{let i={image:o,uploaded_to:Number(this.editor.config.pageId)};try{let a=(await window.$http.post("/images/drawio",i)).data,s=`
    `,d=this.editor.input.getText().split(` +`;break;default:}return r};lu.prototype.render=function(u,e,t){let r="",n=this.rules;for(let o=0,i=u.length;o=0&&(r=this.attrs[t][1]),r};du.prototype.attrJoin=function(e,t){let r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};var G=du;function Xt(u,e,t){this.src=u,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=e}Xt.prototype.Token=G;var Jt=Xt;var Ur=/\r\n?|\n/g,$r=/\0/g;function be(u){let e;e=u.src.replace(Ur,` +`),e=e.replace($r,"\uFFFD"),u.src=e}function ge(u){let e;u.inlineMode?(e=new u.Token("inline","",0),e.content=u.src,e.map=[0,1],e.children=[],u.tokens.push(e)):u.md.block.parse(u.src,u.md,u.env,u.tokens)}function xe(u){let e=u.tokens;for(let t=0,r=e.length;t\s]/i.test(u)}function Vr(u){return/^<\/a\s*>/i.test(u)}function ke(u){let e=u.tokens;if(u.md.options.linkify)for(let t=0,r=e.length;t=0;i--){let c=n[i];if(c.type==="link_close"){for(i--;n[i].level!==c.level&&n[i].type!=="link_open";)i--;continue}if(c.type==="html_inline"&&(jr(c.content)&&o>0&&o--,Vr(c.content)&&o++),!(o>0)&&c.type==="text"&&u.md.linkify.test(c.content)){let a=c.content,s=u.md.linkify.match(a),d=[],f=c.level,g=0;s.length>0&&s[0].index===0&&i>0&&n[i-1].type==="text_special"&&(s=s.slice(1));for(let h=0;hg){let m=new u.Token("text","",0);m.content=a.slice(g,k),m.level=f,d.push(m)}let x=new u.Token("link_open","a",1);x.attrs=[["href",p]],x.level=f++,x.markup="linkify",x.info="auto",d.push(x);let _=new u.Token("text","",0);_.content=b,_.level=f,d.push(_);let y=new u.Token("link_close","a",-1);y.level=--f,y.markup="linkify",y.info="auto",d.push(y),g=s[h].lastIndex}if(g=0;t--){let r=u[t];r.type==="text"&&!e&&(r.content=r.content.replace(Gr,Xr)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function Kr(u){let e=0;for(let t=u.length-1;t>=0;t--){let r=u[t];r.type==="text"&&!e&&Kt.test(r.content)&&(r.content=r.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function _e(u){let e;if(u.md.options.typographer)for(e=u.tokens.length-1;e>=0;e--)u.tokens[e].type==="inline"&&(Zr.test(u.tokens[e].content)&&Jr(u.tokens[e].children),Kt.test(u.tokens[e].content)&&Kr(u.tokens[e].children))}var Yr=/['"]/,Yt=/['"]/g,Qt="\u2019";function Bu(u,e,t){return u.slice(0,e)+t+u.slice(e+1)}function Qr(u,e){let t,r=[];for(let n=0;n=0&&!(r[t].level<=i);t--);if(r.length=t+1,o.type!=="text")continue;let c=o.content,a=0,s=c.length;u:for(;a=0)l=c.charCodeAt(d.index-1);else for(t=n-1;t>=0&&!(u[t].type==="softbreak"||u[t].type==="hardbreak");t--)if(u[t].content){l=u[t].content.charCodeAt(u[t].content.length-1);break}let p=32;if(a=48&&l<=57&&(g=f=!1),f&&g&&(f=b,g=k),!f&&!g){h&&(o.content=Bu(o.content,d.index,Qt));continue}if(g)for(t=r.length-1;t>=0;t--){let y=r[t];if(r[t].level=0;e--)u.tokens[e].type!=="inline"||!Yr.test(u.tokens[e].content)||Qr(u.tokens[e].children,u)}function Ee(u){let e,t,r=u.tokens,n=r.length;for(let o=0;o0&&this.level++,this.tokens.push(r),r};U.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};U.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;et;)if(!v(this.src.charCodeAt(--e)))return e+1;return e};U.prototype.skipChars=function(e,t){for(let r=this.src.length;er;)if(t!==this.src.charCodeAt(--e))return e+1;return e};U.prototype.getLines=function(e,t,r,n){if(e>=t)return"";let o=new Array(t-e);for(let i=0,c=e;cr?o[i]=new Array(a-r+1).join(" ")+this.src.slice(d,f):o[i]=this.src.slice(d,f)}return o.join("")};U.prototype.Token=G;var e0=U;var un=65536;function De(u,e){let t=u.bMarks[e]+u.tShift[e],r=u.eMarks[e];return u.src.slice(t,r)}function t0(u){let e=[],t=u.length,r=0,n=u.charCodeAt(r),o=!1,i=0,c="";for(;rt)return!1;let n=e+1;if(u.sCount[n]=4)return!1;let o=u.bMarks[n]+u.tShift[n];if(o>=u.eMarks[n])return!1;let i=u.src.charCodeAt(o++);if(i!==124&&i!==45&&i!==58||o>=u.eMarks[n])return!1;let c=u.src.charCodeAt(o++);if(c!==124&&c!==45&&c!==58&&!v(c)||i===45&&v(c))return!1;for(;o=4)return!1;s=t0(a),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop();let f=s.length;if(f===0||f!==d.length)return!1;if(r)return!0;let g=u.parentType;u.parentType="table";let h=u.md.block.ruler.getRules("blockquote"),l=u.push("table_open","table",1),p=[e,0];l.map=p;let b=u.push("thead_open","thead",1);b.map=[e,e+1];let k=u.push("tr_open","tr",1);k.map=[e,e+1];for(let y=0;y=4||(s=t0(a),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop(),_+=f-s.length,_>un))break;if(n===e+2){let E=u.push("tbody_open","tbody",1);E.map=x=[e+2,0]}let m=u.push("tr_open","tr",1);m.map=[n,n+1];for(let E=0;E=4){r++,n=r;continue}break}u.line=n;let o=u.push("code_block","code",0);return o.content=u.getLines(e,n,4+u.blkIndent,!1)+` +`,o.map=[e,u.line],!0}function Fe(u,e,t,r){let n=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4||n+3>o)return!1;let i=u.src.charCodeAt(n);if(i!==126&&i!==96)return!1;let c=n;n=u.skipChars(n,i);let a=n-c;if(a<3)return!1;let s=u.src.slice(c,n),d=u.src.slice(n,o);if(i===96&&d.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let f=e,g=!1;for(;f++,!(f>=t||(n=c=u.bMarks[f]+u.tShift[f],o=u.eMarks[f],n=4)&&(n=u.skipChars(n,i),!(n-c=4||u.src.charCodeAt(n)!==62)return!1;if(r)return!0;let c=[],a=[],s=[],d=[],f=u.md.block.ruler.getRules("blockquote"),g=u.parentType;u.parentType="blockquote";let h=!1,l;for(l=e;l=o)break;if(u.src.charCodeAt(n++)===62&&!_){let m=u.sCount[l]+1,E,w;u.src.charCodeAt(n)===32?(n++,m++,w=!1,E=!0):u.src.charCodeAt(n)===9?(E=!0,(u.bsCount[l]+m)%4===3?(n++,m++,w=!1):w=!0):E=!1;let C=m;for(c.push(u.bMarks[l]),u.bMarks[l]=n;n=o,a.push(u.bsCount[l]),u.bsCount[l]=u.sCount[l]+1+(E?1:0),s.push(u.sCount[l]),u.sCount[l]=C-m,d.push(u.tShift[l]),u.tShift[l]=n-u.bMarks[l];continue}if(h)break;let y=!1;for(let m=0,E=f.length;m";let k=[e,0];b.map=k,u.md.block.tokenize(u,e,l);let x=u.push("blockquote_close","blockquote",-1);x.markup=">",u.lineMax=i,u.parentType=g,k[1]=u.line;for(let _=0;_=4)return!1;let o=u.bMarks[e]+u.tShift[e],i=u.src.charCodeAt(o++);if(i!==42&&i!==45&&i!==95)return!1;let c=1;for(;o=r)return-1;let o=u.src.charCodeAt(n++);if(o<48||o>57)return-1;for(;;){if(n>=r)return-1;if(o=u.src.charCodeAt(n++),o>=48&&o<=57){if(n-t>=10)return-1;continue}if(o===41||o===46)break;return-1}return n=4||u.listIndent>=0&&u.sCount[a]-u.listIndent>=4&&u.sCount[a]=u.blkIndent&&(d=!0);let f,g,h;if((h=n0(u,a))>=0){if(f=!0,i=u.bMarks[a]+u.tShift[a],g=Number(u.src.slice(i,h-1)),d&&g!==1)return!1}else if((h=r0(u,a))>=0)f=!1;else return!1;if(d&&u.skipSpaces(h)>=u.eMarks[a])return!1;if(r)return!0;let l=u.src.charCodeAt(h-1),p=u.tokens.length;f?(c=u.push("ordered_list_open","ol",1),g!==1&&(c.attrs=[["start",g]])):c=u.push("bullet_list_open","ul",1);let b=[a,0];c.map=b,c.markup=String.fromCharCode(l);let k=!1,x=u.md.block.ruler.getRules("list"),_=u.parentType;for(u.parentType="list";a=n?w=1:w=m-y,w>4&&(w=1);let C=y+w;c=u.push("list_item_open","li",1),c.markup=String.fromCharCode(l);let D=[a,0];c.map=D,f&&(c.info=u.src.slice(i,h-1));let F=u.tight,S=u.tShift[a],I=u.sCount[a],q=u.listIndent;if(u.listIndent=u.blkIndent,u.blkIndent=C,u.tight=!0,u.tShift[a]=E-u.bMarks[a],u.sCount[a]=m,E>=n&&u.isEmpty(a+1)?u.line=Math.min(u.line+2,t):u.md.block.tokenize(u,a,t,!0),(!u.tight||k)&&(s=!1),k=u.line-a>1&&u.isEmpty(u.line-1),u.blkIndent=u.listIndent,u.listIndent=q,u.tShift[a]=S,u.sCount[a]=I,u.tight=F,c=u.push("list_item_close","li",-1),c.markup=String.fromCharCode(l),a=u.line,D[1]=a,a>=t||u.sCount[a]=4)break;let pu=!1;for(let j=0,Q=x.length;j=4||u.src.charCodeAt(n)!==91)return!1;function c(x){let _=u.lineMax;if(x>=_||u.isEmpty(x))return null;let y=!1;if(u.sCount[x]-u.blkIndent>3&&(y=!0),u.sCount[x]<0&&(y=!0),!y){let w=u.md.block.ruler.getRules("reference"),C=u.parentType;u.parentType="reference";let D=!1;for(let F=0,S=w.length;F"u"&&(u.env.references={}),typeof u.env.references[k]>"u"&&(u.env.references[k]={title:b,href:f}),u.line=i),!0):!1}var o0=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];var tn="[a-zA-Z_:][a-zA-Z0-9:._-]*",rn="[^\"'=<>`\\x00-\\x20]+",nn="'[^']*'",on='"[^"]*"',cn="(?:"+rn+"|"+nn+"|"+on+")",an="(?:\\s+"+tn+"(?:\\s*=\\s*"+cn+")?)",i0="<[A-Za-z][A-Za-z0-9\\-]*"+an+"*\\s*\\/?>",c0="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",sn="",ln="<[?][\\s\\S]*?[?]>",dn="]*>",fn="",a0=new RegExp("^(?:"+i0+"|"+c0+"|"+sn+"|"+ln+"|"+dn+"|"+fn+")"),s0=new RegExp("^(?:"+i0+"|"+c0+")");var fu=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(s0.source+"\\s*$"),/^$/,!1]];function Ie(u,e,t,r){let n=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4||!u.md.options.html||u.src.charCodeAt(n)!==60)return!1;let i=u.src.slice(n,o),c=0;for(;c=4)return!1;let i=u.src.charCodeAt(n);if(i!==35||n>=o)return!1;let c=1;for(i=u.src.charCodeAt(++n);i===35&&n6||nn&&v(u.src.charCodeAt(a-1))&&(o=a),u.line=e+1;let s=u.push("heading_open","h"+String(c),1);s.markup="########".slice(0,c),s.map=[e,u.line];let d=u.push("inline","",0);d.content=u.src.slice(n,o).trim(),d.map=[e,u.line],d.children=[];let f=u.push("heading_close","h"+String(c),-1);return f.markup="########".slice(0,c),!0}function qe(u,e,t){let r=u.md.block.ruler.getRules("paragraph");if(u.sCount[e]-u.blkIndent>=4)return!1;let n=u.parentType;u.parentType="paragraph";let o=0,i,c=e+1;for(;c3)continue;if(u.sCount[c]>=u.blkIndent){let h=u.bMarks[c]+u.tShift[c],l=u.eMarks[c];if(h=l))){o=i===61?1:2;break}}if(u.sCount[c]<0)continue;let g=!1;for(let h=0,l=r.length;h3||u.sCount[o]<0)continue;let s=!1;for(let d=0,f=r.length;d=t||u.sCount[i]=o){u.line=t;break}let a=u.line,s=!1;for(let d=0;d=u.line)throw new Error("block rule didn't increment state.line");break}if(!s)throw new Error("none of the block rules matched");u.tight=!c,u.isEmpty(u.line-1)&&(c=!0),i=u.line,i0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(n),r};gu.prototype.scanDelims=function(u,e){let t=this.posMax,r=this.src.charCodeAt(u),n=u>0?this.src.charCodeAt(u-1):32,o=u;for(;o0)return!1;let t=u.pos,r=u.posMax;if(t+3>r||u.src.charCodeAt(t)!==58||u.src.charCodeAt(t+1)!==47||u.src.charCodeAt(t+2)!==47)return!1;let n=u.pending.match(hn);if(!n)return!1;let o=n[1],i=u.md.linkify.matchAtStart(u.src.slice(t-o.length));if(!i)return!1;let c=i.url;if(c.length<=o.length)return!1;let a=c.length;for(;a>0&&c.charCodeAt(a-1)===42;)a--;a!==c.length&&(c=c.slice(0,a));let s=u.md.normalizeLink(c);if(!u.md.validateLink(s))return!1;if(!e){u.pending=u.pending.slice(0,-o.length);let d=u.push("link_open","a",1);d.attrs=[["href",s]],d.markup="linkify",d.info="auto";let f=u.push("text","",0);f.content=u.md.normalizeLinkText(c);let g=u.push("link_close","a",-1);g.markup="linkify",g.info="auto"}return u.pos+=c.length-o.length,!0}function ze(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==10)return!1;let r=u.pending.length-1,n=u.posMax;if(!e)if(r>=0&&u.pending.charCodeAt(r)===32)if(r>=1&&u.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&u.pending.charCodeAt(o-1)===32;)o--;u.pending=u.pending.slice(0,o),u.push("hardbreak","br",0)}else u.pending=u.pending.slice(0,-1),u.push("softbreak","br",0);else u.push("softbreak","br",0);for(t++;t?@[]^_`{|}~-".split("").forEach(function(u){Oe[u.charCodeAt(0)]=1});function He(u,e){let t=u.pos,r=u.posMax;if(u.src.charCodeAt(t)!==92||(t++,t>=r))return!1;let n=u.src.charCodeAt(t);if(n===10){for(e||u.push("hardbreak","br",0),t++;t=55296&&n<=56319&&t+1=56320&&c<=57343&&(o+=u.src[t+1],t++)}let i="\\"+o;if(!e){let c=u.push("text_special","",0);n<256&&Oe[n]!==0?c.content=o:c.content=i,c.markup=i,c.info="escape"}return u.pos=t+1,!0}function Ue(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==96)return!1;let n=t;t++;let o=u.posMax;for(;t=0;r--){let n=e[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let o=e[n.end],i=r>0&&e[r-1].end===n.end+1&&e[r-1].marker===n.marker&&e[r-1].token===n.token-1&&e[n.end+1].token===o.token+1,c=String.fromCharCode(n.marker),a=u.tokens[n.token];a.type=i?"strong_open":"em_open",a.tag=i?"strong":"em",a.nesting=1,a.markup=i?c+c:c,a.content="";let s=u.tokens[o.token];s.type=i?"strong_close":"em_close",s.tag=i?"strong":"em",s.nesting=-1,s.markup=i?c+c:c,s.content="",i&&(u.tokens[e[r-1].token].content="",u.tokens[e[n.end+1].token].content="",r--)}}function xn(u){let e=u.tokens_meta,t=u.tokens_meta.length;p0(u,u.delimiters);for(let r=0;r=f)return!1;if(a=l,n=u.md.helpers.parseLinkDestination(u.src,l,u.posMax),n.ok){for(i=u.md.normalizeLink(n.str),u.md.validateLink(i)?l=n.pos:i="",a=l;l=f||u.src.charCodeAt(l)!==41)&&(s=!0),l++}if(s){if(typeof u.env.references>"u")return!1;if(l=0?r=u.src.slice(a,l++):l=h+1):l=h+1,r||(r=u.src.slice(g,h)),o=u.env.references[ru(r)],!o)return u.pos=d,!1;i=o.href,c=o.title}if(!e){u.pos=g,u.posMax=h;let p=u.push("link_open","a",1),b=[["href",i]];p.attrs=b,c&&b.push(["title",c]),u.linkLevel++,u.md.inline.tokenize(u),u.linkLevel--,u.push("link_close","a",-1)}return u.pos=l,u.posMax=f,!0}function Ze(u,e){let t,r,n,o,i,c,a,s,d="",f=u.pos,g=u.posMax;if(u.src.charCodeAt(u.pos)!==33||u.src.charCodeAt(u.pos+1)!==91)return!1;let h=u.pos+2,l=u.md.helpers.parseLinkLabel(u,u.pos+1,!1);if(l<0)return!1;if(o=l+1,o=g)return!1;for(s=o,c=u.md.helpers.parseLinkDestination(u.src,o,u.posMax),c.ok&&(d=u.md.normalizeLink(c.str),u.md.validateLink(d)?o=c.pos:d=""),s=o;o=g||u.src.charCodeAt(o)!==41)return u.pos=f,!1;o++}else{if(typeof u.env.references>"u")return!1;if(o=0?n=u.src.slice(s,o++):o=l+1):o=l+1,n||(n=u.src.slice(h,l)),i=u.env.references[ru(n)],!i)return u.pos=f,!1;d=i.href,a=i.title}if(!e){r=u.src.slice(h,l);let p=[];u.md.inline.parse(r,u.md,u.env,p);let b=u.push("image","img",0),k=[["src",d],["alt",""]];b.attrs=k,b.children=p,b.content=r,a&&k.push(["title",a])}return u.pos=o,u.posMax=g,!0}var kn=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,_n=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Ge(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==60)return!1;let r=u.pos,n=u.posMax;for(;;){if(++t>=n)return!1;let i=u.src.charCodeAt(t);if(i===60)return!1;if(i===62)break}let o=u.src.slice(r+1,t);if(_n.test(o)){let i=u.md.normalizeLink(o);if(!u.md.validateLink(i))return!1;if(!e){let c=u.push("link_open","a",1);c.attrs=[["href",i]],c.markup="autolink",c.info="auto";let a=u.push("text","",0);a.content=u.md.normalizeLinkText(o);let s=u.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return u.pos+=o.length+2,!0}if(kn.test(o)){let i=u.md.normalizeLink("mailto:"+o);if(!u.md.validateLink(i))return!1;if(!e){let c=u.push("link_open","a",1);c.attrs=[["href",i]],c.markup="autolink",c.info="auto";let a=u.push("text","",0);a.content=u.md.normalizeLinkText(o);let s=u.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return u.pos+=o.length+2,!0}return!1}function yn(u){return/^\s]/i.test(u)}function En(u){return/^<\/a\s*>/i.test(u)}function wn(u){let e=u|32;return e>=97&&e<=122}function We(u,e){if(!u.md.options.html)return!1;let t=u.posMax,r=u.pos;if(u.src.charCodeAt(r)!==60||r+2>=t)return!1;let n=u.src.charCodeAt(r+1);if(n!==33&&n!==63&&n!==47&&!wn(n))return!1;let o=u.src.slice(r).match(a0);if(!o)return!1;if(!e){let i=u.push("html_inline","",0);i.content=o[0],yn(i.content)&&u.linkLevel++,En(i.content)&&u.linkLevel--}return u.pos+=o[0].length,!0}var Cn=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Dn=/^&([a-z][a-z0-9]{1,31});/i;function Xe(u,e){let t=u.pos,r=u.posMax;if(u.src.charCodeAt(t)!==38||t+1>=r)return!1;if(u.src.charCodeAt(t+1)===35){let o=u.src.slice(t).match(Cn);if(o){if(!e){let i=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),c=u.push("text_special","",0);c.content=Pu(i)?bu(i):bu(65533),c.markup=o[0],c.info="entity"}return u.pos+=o[0].length,!0}}else{let o=u.src.slice(t).match(Dn);if(o){let i=K(o[0]);if(i!==o[0]){if(!e){let c=u.push("text_special","",0);c.content=i,c.markup=o[0],c.info="entity"}return u.pos+=o[0].length,!0}}}return!1}function h0(u){let e={},t=u.length;if(!t)return;let r=0,n=-2,o=[];for(let i=0;ia;s-=o[s]+1){let f=u[s];if(f.marker===c.marker&&f.open&&f.end<0){let g=!1;if((f.close||c.open)&&(f.length+c.length)%3===0&&(f.length%3!==0||c.length%3!==0)&&(g=!0),!g){let h=s>0&&!u[s-1].open?o[s-1]+1:0;o[i]=i-s+h,o[s]=h,c.open=!1,f.end=i,f.close=!1,d=-1,n=-2;break}}}d!==-1&&(e[c.marker][(c.open?3:0)+(c.length||0)%3]=d)}}function Je(u){let e=u.tokens_meta,t=u.tokens_meta.length;h0(u.delimiters);for(let r=0;r0&&r++,n[e].type==="text"&&e+1=u.pos)throw new Error("inline rule didn't increment state.pos");break}}else u.pos=u.posMax;i||u.pos++,o[e]=u.pos};xu.prototype.tokenize=function(u){let e=this.ruler.getRules(""),t=e.length,r=u.posMax,n=u.md.options.maxNesting;for(;u.pos=u.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(u.pos>=r)break;continue}u.pending+=u.src[u.pos++]}u.pending&&u.pushPending()};xu.prototype.parse=function(u,e,t,r){let n=new this.State(u,e,t,r);this.tokenize(n);let o=this.ruler2.getRules(""),i=o.length;for(let c=0;c|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function ut(u){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(r){u[r]=t[r]})}),u}function Hu(u){return Object.prototype.toString.call(u)}function An(u){return Hu(u)==="[object String]"}function vn(u){return Hu(u)==="[object Object]"}function Fn(u){return Hu(u)==="[object RegExp]"}function g0(u){return Hu(u)==="[object Function]"}function Sn(u){return u.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var k0={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Tn(u){return Object.keys(u||{}).reduce(function(e,t){return e||k0.hasOwnProperty(t)},!1)}var Mn={"http:":{validate:function(u,e,t){let r=u.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(r)?r.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(u,e,t){let r=u.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(r)?e>=3&&u[e-3]===":"||e>=3&&u[e-3]==="/"?0:r.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(u,e,t){let r=u.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(r)?r.match(t.re.mailto)[0].length:0}}},Ln="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",In="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function Rn(u){u.__index__=-1,u.__text_cache__=""}function qn(u){return function(e,t){let r=e.slice(t);return u.test(r)?r.match(u)[0].length:0}}function x0(){return function(u,e){e.normalize(u)}}function Ou(u){let e=u.re=b0(u.__opts__),t=u.__tlds__.slice();u.onCompile(),u.__tlds_replaced__||t.push(Ln),t.push(e.src_xn),e.src_tlds=t.join("|");function r(c){return c.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");let n=[];u.__compiled__={};function o(c,a){throw new Error('(LinkifyIt) Invalid schema "'+c+'": '+a)}Object.keys(u.__schemas__).forEach(function(c){let a=u.__schemas__[c];if(a===null)return;let s={validate:null,link:null};if(u.__compiled__[c]=s,vn(a)){Fn(a.validate)?s.validate=qn(a.validate):g0(a.validate)?s.validate=a.validate:o(c,a),g0(a.normalize)?s.normalize=a.normalize:a.normalize?o(c,a):s.normalize=x0();return}if(An(a)){n.push(c);return}o(c,a)}),n.forEach(function(c){u.__compiled__[u.__schemas__[c]]&&(u.__compiled__[c].validate=u.__compiled__[u.__schemas__[c]].validate,u.__compiled__[c].normalize=u.__compiled__[u.__schemas__[c]].normalize)}),u.__compiled__[""]={validate:null,normalize:x0()};let i=Object.keys(u.__compiled__).filter(function(c){return c.length>0&&u.__compiled__[c]}).map(Sn).join("|");u.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+i+")","i"),u.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+i+")","ig"),u.re.schema_at_start=RegExp("^"+u.re.schema_search.source,"i"),u.re.pretest=RegExp("("+u.re.schema_test.source+")|("+u.re.host_fuzzy_test.source+")|@","i"),Rn(u)}function Pn(u,e){let t=u.__index__,r=u.__last_index__,n=u.__text_cache__.slice(t,r);this.schema=u.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=r+e,this.raw=n,this.text=n,this.url=n}function et(u,e){let t=new Pn(u,e);return u.__compiled__[t.schema].normalize(t,u),t}function P(u,e){if(!(this instanceof P))return new P(u,e);e||Tn(u)&&(e=u,u={}),this.__opts__=ut({},k0,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=ut({},Mn,u),this.__compiled__={},this.__tlds__=In,this.__tlds_replaced__=!1,this.re={},Ou(this)}P.prototype.add=function(e,t){return this.__schemas__[e]=t,Ou(this),this};P.prototype.set=function(e){return this.__opts__=ut(this.__opts__,e),this};P.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,r,n,o,i,c,a,s,d;if(this.re.schema_test.test(e)){for(a=this.re.schema_search,a.lastIndex=0;(t=a.exec(e))!==null;)if(o=this.testSchemaAt(e,t[2],a.lastIndex),o){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(s=e.search(this.re.host_fuzzy_test),s>=0&&(this.__index__<0||s=0&&(n=e.match(this.re.email_fuzzy))!==null&&(i=n.index+n[1].length,c=n.index+n[0].length,(this.__index__<0||ithis.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=c))),this.__index__>=0};P.prototype.pretest=function(e){return this.re.pretest.test(e)};P.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0};P.prototype.match=function(e){let t=[],r=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(et(this,r)),r=this.__last_index__);let n=r?e.slice(r):e;for(;this.test(n);)t.push(et(this,r)),n=n.slice(this.__last_index__),r+=this.__last_index__;return t.length?t:null};P.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let r=this.testSchemaAt(e,t[2],t[0].length);return r?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+r,et(this,0)):null};P.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,n,o){return r!==o[n-1]}).reverse(),Ou(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Ou(this),this)};P.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};P.prototype.onCompile=function(){};var _0=P;var Bn=/^xn--/,Nn=/[^\0-\x7F]/,zn=/[\x2E\u3002\uFF0E\uFF61]/g,On={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},tt=35,$=Math.floor,rt=String.fromCharCode;function Y(u){throw new RangeError(On[u])}function Hn(u,e){let t=[],r=u.length;for(;r--;)t[r]=e(u[r]);return t}function E0(u,e){let t=u.split("@"),r="";t.length>1&&(r=t[0]+"@",u=t[1]),u=u.replace(zn,".");let n=u.split("."),o=Hn(n,e).join(".");return r+o}function w0(u){let e=[],t=0,r=u.length;for(;t=55296&&n<=56319&&tString.fromCodePoint(...u),$n=function(u){return u>=48&&u<58?26+(u-48):u>=65&&u<91?u-65:u>=97&&u<123?u-97:36},y0=function(u,e){return u+22+75*(u<26)-((e!=0)<<5)},C0=function(u,e,t){let r=0;for(u=t?$(u/700):u>>1,u+=$(u/e);u>tt*26>>1;r+=36)u=$(u/tt);return $(r+(tt+1)*u/(u+38))},D0=function(u){let e=[],t=u.length,r=0,n=128,o=72,i=u.lastIndexOf("-");i<0&&(i=0);for(let c=0;c=128&&Y("not-basic"),e.push(u.charCodeAt(c));for(let c=i>0?i+1:0;c=t&&Y("invalid-input");let g=$n(u.charCodeAt(c++));g>=36&&Y("invalid-input"),g>$((2147483647-r)/d)&&Y("overflow"),r+=g*d;let h=f<=o?1:f>=o+26?26:f-o;if(g$(2147483647/l)&&Y("overflow"),d*=l}let s=e.length+1;o=C0(r-a,s,a==0),$(r/s)>2147483647-n&&Y("overflow"),n+=$(r/s),r%=s,e.splice(r++,0,n)}return String.fromCodePoint(...e)},A0=function(u){let e=[];u=w0(u);let t=u.length,r=128,n=0,o=72;for(let a of u)a<128&&e.push(rt(a));let i=e.length,c=i;for(i&&e.push("-");c=r&&d$((2147483647-n)/s)&&Y("overflow"),n+=(a-r)*s,r=a;for(let d of u)if(d2147483647&&Y("overflow"),d===r){let f=n;for(let g=36;;g+=36){let h=g<=o?1:g>=o+26?26:g-o;if(f=0))try{e.hostname=nt.toASCII(e.hostname)}catch{}return Au(cu(e))}function Yn(u){let e=mu(u,!0);if(e.hostname&&(!e.protocol||T0.indexOf(e.protocol)>=0))try{e.hostname=nt.toUnicode(e.hostname)}catch{}return hu(cu(e),hu.defaultChars+"%")}function B(u,e){if(!(this instanceof B))return new B(u,e);e||qu(u)||(e=u||{},u="default"),this.inline=new m0,this.block=new l0,this.core=new u0,this.renderer=new Wt,this.linkify=new _0,this.validateLink=Jn,this.normalizeLink=Kn,this.normalizeLinkText=Yn,this.utils=de,this.helpers=su({},me),this.options={},this.configure(u),e&&this.set(e)}B.prototype.set=function(u){return su(this.options,u),this};B.prototype.configure=function(u){let e=this;if(qu(u)){let t=u;if(u=Gn[t],!u)throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!u)throw new Error("Wrong `markdown-it` preset, can't be empty");return u.options&&e.set(u.options),u.components&&Object.keys(u.components).forEach(function(t){u.components[t].rules&&e[t].ruler.enableOnly(u.components[t].rules),u.components[t].rules2&&e[t].ruler2.enableOnly(u.components[t].rules2)}),this};B.prototype.enable=function(u,e){let t=[];Array.isArray(u)||(u=[u]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.enable(u,!0))},this),t=t.concat(this.inline.ruler2.enable(u,!0));let r=u.filter(function(n){return t.indexOf(n)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};B.prototype.disable=function(u,e){let t=[];Array.isArray(u)||(u=[u]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.disable(u,!0))},this),t=t.concat(this.inline.ruler2.disable(u,!0));let r=u.filter(function(n){return t.indexOf(n)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};B.prototype.use=function(u){let e=[this].concat(Array.prototype.slice.call(arguments,1));return u.apply(u,e),this};B.prototype.parse=function(u,e){if(typeof u!="string")throw new Error("Input data should be a String");let t=new this.core.State(u,this,e);return this.core.process(t),t.tokens};B.prototype.render=function(u,e){return e=e||{},this.renderer.render(this.parse(u,e),this.options,e)};B.prototype.parseInline=function(u,e){let t=new this.core.State(u,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens};B.prototype.renderInline=function(u,e){return e=e||{},this.renderer.render(this.parseInline(u,e),this.options,e)};var ot=B;var P0=tr(q0());var Uu=class{constructor(){A(this,"renderer");this.renderer=new ot({html:!0}),this.renderer.use(P0.default,{label:!0})}getRenderer(){return this.renderer}render(e){return this.renderer.render(e)}};function lo(u,e){return document.createElement(u,e)}function fo(u,e,t){return document.createElementNS(u,e,t)}function po(){return ou(document.createDocumentFragment())}function ho(u){return document.createTextNode(u)}function mo(u){return document.createComment(u)}function bo(u,e,t){if(W(u)){let r=u;for(;r&&W(r);)r=ou(r).parent;u=r??u}W(e)&&(e=ou(e,u)),t&&W(t)&&(t=ou(t).firstChildNode),u.insertBefore(e,t)}function go(u,e){u.removeChild(e)}function xo(u,e){W(e)&&(e=ou(e,u)),u.appendChild(e)}function B0(u){if(W(u)){for(;u&&W(u);)u=ou(u).parent;return u??null}return u.parentNode}function ko(u){var e;if(W(u)){let t=ou(u),r=B0(t);if(r&&t.lastChildNode){let n=Array.from(r.childNodes),o=n.indexOf(t.lastChildNode);return(e=n[o+1])!==null&&e!==void 0?e:null}return null}return u.nextSibling}function _o(u){return u.tagName}function yo(u,e){u.textContent=e}function Eo(u){return u.textContent}function wo(u){return u.nodeType===1}function Co(u){return u.nodeType===3}function Do(u){return u.nodeType===8}function W(u){return u.nodeType===11}function ou(u,e){var t,r,n;let o=u;return(t=o.parent)!==null&&t!==void 0||(o.parent=e??null),(r=o.firstChildNode)!==null&&r!==void 0||(o.firstChildNode=u.firstChild),(n=o.lastChildNode)!==null&&n!==void 0||(o.lastChildNode=u.lastChild),o}var $u={createElement:lo,createElementNS:fo,createTextNode:ho,createDocumentFragment:po,createComment:mo,insertBefore:bo,removeChild:go,appendChild:xo,parentNode:B0,nextSibling:ko,tagName:_o,setTextContent:yo,getTextContent:Eo,isElement:wo,isText:Co,isComment:Do,isDocumentFragment:W};function X(u,e,t,r,n){let o=e===void 0?void 0:e.key;return{sel:u,data:e,children:t,text:r,elm:n,key:o}}var ct=Array.isArray;function N0(u){return typeof u=="string"||typeof u=="number"||u instanceof String||u instanceof Number}var at=X("",{},[],void 0,void 0);function ku(u,e){var t,r;let n=u.key===e.key,o=((t=u.data)===null||t===void 0?void 0:t.is)===((r=e.data)===null||r===void 0?void 0:r.is),i=u.sel===e.sel,c=!u.sel&&u.sel===e.sel?typeof u.text==typeof e.text:!0;return i&&n&&o&&c}function vo(){throw new Error("The document fragment is not supported on this platform.")}function Fo(u,e){return u.isElement(e)}function So(u,e){return u.isDocumentFragment(e)}function To(u,e,t){var r;let n={};for(let o=e;o<=t;++o){let i=(r=u[o])===null||r===void 0?void 0:r.key;i!==void 0&&(n[i]=o)}return n}var Mo=["create","update","remove","destroy","pre","post"];function st(u,e,t){let r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},n=e!==void 0?e:$u;for(let l of Mo)for(let p of u){let b=p[l];b!==void 0&&r[l].push(b)}function o(l){let p=l.id?"#"+l.id:"",b=l.getAttribute("class"),k=b?"."+b.split(" ").join("."):"";return X(n.tagName(l).toLowerCase()+p+k,{},[],void 0,l)}function i(l){return X(void 0,{},[],void 0,l)}function c(l,p){return function(){if(--p===0){let k=n.parentNode(l);k!==null&&n.removeChild(k,l)}}}function a(l,p){var b,k,x,_,y;let m,E=l.data,w=E?.hook;(b=w?.init)===null||b===void 0||b.call(w,l);let C=l.children,D=l.sel;if(D==="!")(k=l.text)!==null&&k!==void 0||(l.text=""),l.elm=n.createComment(l.text);else if(D==="")l.elm=n.createTextNode(l.text);else if(D!==void 0){let F=D.indexOf("#"),S=D.indexOf(".",F),I=F>0?F:D.length,q=S>0?S:D.length,pu=F!==-1||S!==-1?D.slice(0,Math.min(I,q)):D,j=E?.ns,Q=j===void 0?n.createElement(pu,E):n.createElementNS(j,pu,E);for(l.elm=Q,I0&&Q.setAttribute("class",D.slice(q+1).replace(/\./g," ")),m=0;mt.toUpperCase())}function _u(u,e){var t;let r=e!==void 0?e:$u,n;if(r.isElement(u)){let o=u.id?"#"+u.id:"",i=(t=u.getAttribute("class"))===null||t===void 0?void 0:t.match(/[^\t\r\n\f ]+/g),c=i?"."+i.join("."):"",a=r.tagName(u).toLowerCase()+o+c,s={},d={},f={},g=[],h,l,p,b=u.attributes,k=u.childNodes;for(l=0,p=b.length;l0&&(f.attrs=s),Object.keys(d).length>0&&(f.dataset=d),a.startsWith("svg")&&(a.length===3||a[3]==="."||a[3]==="#")&<(f,g,a),X(a,f,g,void 0,u)}else return r.isText(u)?(n=r.getTextContent(u),X(void 0,void 0,void 0,n,u)):r.isComment(u)?(n=r.getTextContent(u),X("!",{},[],n,u)):X("",{},[],void 0,u)}var Io="http://www.w3.org/1999/xlink",Ro="http://www.w3.org/2000/xmlns/",qo="http://www.w3.org/XML/1998/namespace";function z0(u,e){let t,r=e.elm,n=u.data.attrs,o=e.data.attrs;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(t in o){let i=o[t];n[t]!==i&&(i===!0?r.setAttribute(t,""):i===!1?r.removeAttribute(t):t.charCodeAt(0)!==120?r.setAttribute(t,i):t.charCodeAt(3)===58?r.setAttributeNS(qo,t,i):t.charCodeAt(5)===58?t.charCodeAt(1)===109?r.setAttributeNS(Ro,t,i):r.setAttributeNS(Io,t,i):r.setAttribute(t,i))}for(t in n)t in o||r.removeAttribute(t)}}var dt={create:z0,update:z0};var ju;function Po(){return ju||(ju=st([dt]),ju)}function O0(u,e){let t=document.createElement("div");t.innerHTML=e,Po()(_u(u),_u(t))}var Vu=class{constructor(e){A(this,"editor");A(this,"container");A(this,"doc",null);A(this,"lastDisplayClick",0);this.editor=e,this.container=e.config.displayEl,this.container.contentDocument?.readyState==="complete"?this.onLoad():this.container.addEventListener("load",this.onLoad.bind(this)),this.updateVisibility(!!e.settings.get("showPreview")),e.settings.onChange("showPreview",t=>this.updateVisibility(!!t))}updateVisibility(e){let t=this.container.closest(".markdown-editor-wrap");t.style.display=e?"":"none"}onLoad(){this.doc=this.container.contentDocument,this.doc&&(this.loadStylesIntoDisplay(),this.doc.body.className="page-content",this.doc.addEventListener("click",this.onDisplayClick.bind(this)))}onDisplayClick(e){let t=Date.now()-this.lastDisplayClick<300,r=e.target.closest("a");if(r!==null){e.preventDefault();let o=r.getAttribute("href");o&&window.open(o);return}let n=e.target.closest("[drawio-diagram]");if(n!==null&&t){this.editor.actions.editDrawing(n);return}this.lastDisplayClick=Date.now()}loadStylesIntoDisplay(){if(!this.doc)return;this.doc.documentElement.classList.add("markdown-editor-display"),document.documentElement.classList.contains("dark-mode")&&(this.doc.documentElement.style.backgroundColor="#222",this.doc.documentElement.classList.add("dark-mode")),this.doc.head.innerHTML="";let e=document.head.querySelectorAll("style,link[rel=stylesheet]");for(let t of e){let r=t.cloneNode(!0);this.doc.head.appendChild(r)}}patchWithHtml(e){if(!this.doc)return;let{body:t}=this.doc;if(t.children.length===0){let n=document.createElement("div");this.doc.body.append(n)}let r=t.children[0];O0(r,e)}scrollToIndex(e){let t=this.doc?.body?.children[0]?.children;if(!t||t.length<=e)return;(e===-1?t[t.length-1]:t[e]).scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"})}};function Zu(u){return new Promise((e,t)=>{u.oncomplete=u.onsuccess=()=>e(u.result),u.onabort=u.onerror=()=>t(u.error)})}function Bo(u,e){let t,r=()=>{if(t)return t;let n=indexedDB.open(u);return n.onupgradeneeded=()=>n.result.createObjectStore(e),t=Zu(n),t.then(o=>{o.onclose=()=>t=void 0},()=>{}),t};return(n,o)=>r().then(i=>o(i.transaction(e,n).objectStore(e)))}var ft;function pt(){return ft||(ft=Bo("keyval-store","keyval")),ft}function ht(u,e=pt()){return e("readonly",t=>Zu(t.get(u)))}function mt(u,e,t=pt()){return t("readwrite",r=>(r.put(e,u),Zu(r.transaction)))}function bt(u,e=pt()){return e("readwrite",t=>(t.delete(u),Zu(t.transaction)))}var Gu=class extends Error{constructor(t,r){super(t.statusText);A(this,"data");A(this,"headers");A(this,"original");A(this,"redirected");A(this,"status");A(this,"statusText");A(this,"url");this.data=r,this.headers=t.headers,this.redirected=t.redirected,this.status=t.status,this.statusText=t.statusText,this.url=t.url,this.original=t}};var z=null,kt,Wu,gt,xt="last-drawing-save";function _t(u){z?.contentWindow?.postMessage(JSON.stringify(u),kt)}function zo(u){mt(xt,u.data),gt&>(u.data).then(()=>{bt(xt)})}function Oo(u){_t({action:"export",format:"xmlpng",xml:u.xml,spin:"Updating drawing"})}function Ho(){Wu&&Wu().then(u=>{_t({action:"load",autosave:1,xml:u})})}function Uo(){let u={};z&&(window.$events.emitPublic(z,"editor-drawio::configure",{config:u}),_t({action:"configure",config:u}))}function H0(){window.removeEventListener("message",U0),z&&document.body.removeChild(z)}function U0(u){if(!u.data||u.data.length<1||u.origin!==kt)return;let e=JSON.parse(u.data);e.event==="init"?Ho():e.event==="exit"?H0():e.event==="save"?Oo(e):e.event==="export"?zo(e):e.event==="configure"&&Uo()}async function $o(){let u=await ht(xt),e=document.getElementById("unsaved-drawing-dialog");e||console.error("Missing expected unsaved-drawing dialog"),u&&e&&await window.$components.firstOnElement(e,"confirm-dialog").show()&&(Wu=async()=>u)}async function yt(u,e,t){Wu=e,gt=t,await $o(),z=document.createElement("iframe"),z.setAttribute("frameborder","0"),window.addEventListener("message",U0),z.setAttribute("src",u),z.setAttribute("class","fullscreen"),z.style.backgroundColor="#FFFFFF",document.body.appendChild(z),kt=new URL(u).origin}function Xu(){H0()}async function $0(u){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${u}`))).data.content}`}catch(e){throw e instanceof Gu&&window.$events.showResponseError(e),Xu(),e}}var T,Et,iu,wt,Ct,Ju,Ku=class{constructor(e){Ft(this,T);A(this,"editor");A(this,"lastContent",{html:"",markdown:""});this.editor=e}updateAndRender(){let e=this.editor.input.getText();this.editor.config.inputEl.value=e;let t=this.editor.markdown.render(e);window.$events.emit("editor-html-change",""),window.$events.emit("editor-markdown-change",""),this.lastContent.html=t,this.lastContent.markdown=e,this.editor.display.patchWithHtml(t)}getContent(){return this.lastContent}showImageInsert(){window.$components.first("image-manager").show(t=>{let r=t.thumbs?.display||t.url,o=`[![${this.editor.input.getSelectionText()||t.name}](${r})](${t.url})`;R(this,T,iu).call(this,o,o.length)},"gallery")}insertImage(){let e=`![${this.editor.input.getSelectionText()}](http://)`;R(this,T,iu).call(this,e,e.length-1)}insertLink(){let e=this.editor.input.getSelectionText(),t=`[${e}]()`,r=e===""?-3:-1;R(this,T,iu).call(this,t,t.length+r)}showImageManager(){let e=this.editor.input.getSelection();window.$components.first("image-manager").show(r=>{R(this,T,Et).call(this,r,e)},"drawio")}showLinkSelector(){let e=this.editor.input.getSelection(),t=window.$components.first("entity-selector-popup"),r=this.editor.input.getSelectionText(e);t.show(n=>{let i=`[${r||n.name}](${n.link})`;R(this,T,iu).call(this,i,i.length,e)},{initialValue:r,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}startDrawing(){let e=this.editor.config.drawioUrl;if(!e)return;let t=this.editor.input.getSelection();yt(e,()=>Promise.resolve(""),async r=>{let n={image:r,uploaded_to:Number(this.editor.config.pageId)};try{let o=await window.$http.post("/images/drawio",n);R(this,T,Et).call(this,o.data,t),Xu()}catch(o){throw this.handleDrawingUploadError(o),new Error(`Failed to save image with error: ${o}`)}})}editDrawing(e){let{drawioUrl:t}=this.editor.config;if(!t)return;let r=this.editor.input.getSelection(),n=e.getAttribute("drawio-diagram")||"";n&&yt(t,()=>$0(n),async o=>{let i={image:o,uploaded_to:Number(this.editor.config.pageId)};try{let a=(await window.$http.post("/images/drawio",i)).data,s=`
    `,d=this.editor.input.getText().split(` `).map(f=>f.indexOf(`drawio-diagram="${n}"`)!==-1?s:f).join(` `);this.editor.input.setText(d,r),Xu()}catch(c){throw this.handleDrawingUploadError(c),new Error(`Failed to save image with error: ${c}`)}})}handleDrawingUploadError(e){e.status===413?window.$events.emit("error",this.editor.config.text.serverUploadLimit):window.$events.emit("error",this.editor.config.text.imageUploadError),console.error(e)}fullScreen(){let{container:e}=this.editor.config,t=e.classList.contains("fullscreen");e.classList.toggle("fullscreen",!t),document.body.classList.toggle("markdown-fullscreen",!t)}scrollToText(e){if(!e)return;let t=this.editor.input.searchForLineContaining(e);t&&(this.editor.input.setSelection(t,!0),this.editor.input.focus())}focus(){this.editor.input.focus()}insertContent(e){R(this,T,iu).call(this,e,e.length)}prependContent(e){e=R(this,T,wt).call(this,e);let r=this.editor.input.getSelection().from+e.length+1;this.editor.input.spliceText(0,0,`${e} -`,{from:r}),this.editor.input.focus()}appendContent(e){e=R(this,T,wt).call(this,e),this.editor.input.appendText(e),this.editor.input.focus()}replaceContent(e){this.editor.input.setText(e)}replaceLineStart(e){let t=this.editor.input.getSelection(),r=this.editor.input.getLineRangeFromPosition(t.from),n=this.editor.input.getSelectionText(r),o=n.split(" ")[0];if(o===e){let s=n.replace(`${e} `,""),d=t.from+(s.length-n.length);this.editor.input.spliceText(r.from,r.to,s,{from:d});return}let i=n;/^[#>`]/.test(o)?i=n.replace(o,e).trim():e!==""&&(i=`${e} ${n}`);let a=t.from+(i.length-n.length);this.editor.input.spliceText(r.from,r.to,i,{from:a})}wrapSelection(e,t){let r=this.editor.input.getSelection(),n=this.editor.input.getSelectionText(r);if(!n){R(this,T,Ju).call(this,e,t);return}let o,i={from:r.from,to:r.to};n.startsWith(e)&&n.endsWith(t)?(o=n.slice(e.length,n.length-t.length),i.to=r.to-(e.length+t.length)):(o=`${e}${n}${t}`,i.to=r.to+(e.length+t.length)),this.editor.input.spliceText(r.from,r.to,o,i)}replaceLineStartForOrderedList(){let e=this.editor.input.getSelection(),t=this.editor.input.getLineRangeFromPosition(e.from),r=this.editor.input.getLineRangeFromPosition(t.from-1),o=this.editor.input.getSelectionText(r).match(/^(\s*)(\d)([).])\s/)||[],i=(Number(o[2])||0)+1,c=o[1]||"",a=o[3]||".",s=`${c}${i}${a}`;return this.replaceLineStart(s)}cycleCalloutTypeAtSelection(){let e=this.editor.input.getSelection(),t=this.editor.input.getLineRangeFromPosition(e.from),r=this.editor.input.getSelectionText(t),n=["info","success","warning","danger"],o=n.join("|"),c=new RegExp(`class="((${o})\\s+callout|callout\\s+(${o}))"`,"i").exec(r),a=(c?c[2]||c[3]:"").toLowerCase();if(a===n[n.length-1])R(this,T,Ju).call(this,`

    `,"

    ");else if(a==="")R(this,T,Ju).call(this,'

    ',"

    ");else if(c){let s=n.indexOf(a)+1,d=n[s],f=r.replace(c[0],c[0].replace(a,d)),x=f.length-r.length,h=Math.min(e.from,e.to),l=Math.max(e.from,e.to);this.editor.input.spliceText(t.from,t.to,f,{from:h+x,to:l+x})}}syncDisplayPosition(e){let t=e.target;if(Math.abs(t.scrollHeight-t.clientHeight-t.scrollTop)<1){this.editor.display.scrollToIndex(-1);return}let n=this.editor.input.getTextAboveView(),c=new DOMParser().parseFromString(this.editor.markdown.render(n),"text/html").documentElement.querySelectorAll("body > *");this.editor.display.scrollToIndex(c.length)}async insertTemplate(e,t){let r=this.editor.input.eventToPosition(t).from,n=(await window.$http.get(`/templates/${e}`)).data,o=n.markdown||n.html;this.editor.input.spliceText(r,r,o,{from:r})}insertClipboardImages(e,t){let r=this.editor.input.eventToPosition(t).from;for(let n of e)this.uploadImage(n,r)}async uploadImage(e,t=null){if(e===null||e.type.indexOf("image")!==0)return;let r="png";if(t===null&&(t=this.editor.input.getSelection().from),e.name){let s=e.name.match(/\.(.+)$/);s&&s.length>1&&(r=s[1])}let n=`image-${Math.random().toString(16).slice(2)}`,i=`![](${window.baseUrl(`/loading.gif#upload${n}`)})`;this.editor.input.spliceText(t,t,i,{from:t});let c=`image-${Date.now()}.${r}`,a=new FormData;a.append("file",e,c),a.append("uploaded_to",this.editor.config.pageId);try{let s=(await window.$http.post("/images/gallery",a)).data,d=`[![](${s.thumbs.display})](${s.url})`;R(this,T,Ct).call(this,i,d)}catch(s){window.$events.error(s?.data?.message||this.editor.config.text.imageUploadError),R(this,T,Ct).call(this,i,""),console.error(s)}}};T=new WeakSet,Et=function(e,t){let r=`
    `;R(this,T,iu).call(this,r,r.length,t)},iu=function(e,t=0,r=null){r=r||this.editor.input.getSelection();let n=r.from+t;this.editor.input.spliceText(r.from,r.to,e,{from:n,to:n}),this.editor.input.focus()},wt=function(e){return e.replace(/\r\n|\r/g,` -`)},Ct=function(e,t){let r=this.editor.input.getText().replace(e,t);this.editor.input.setText(r)},Ju=function(e,t){let r=this.editor.input.getSelection(),n=this.editor.input.getLineRangeFromPosition(r.from),o=this.editor.input.getSelectionText(n),i,c;o.startsWith(e)&&o.endsWith(t)?(i=o.slice(e.length,o.length-t.length),c=-e.length):(i=`${e}${o}${t}`,c=e.length),this.editor.input.spliceText(n.from,n.to,i,{from:r.from+c})};var Yu=class{constructor(e){v(this,"changeListeners",{});v(this,"settingMap",{scrollSync:!0,showPreview:!0,editorWidth:50,plainEditor:!1});this.loadFromLocalStorage(),this.applyToInputs(e),this.listenToInputChanges(e)}applyToInputs(e){for(let t of e){let r=t.getAttribute("name")?.replace("md-","");if(r&&r in this.settingMap){let n=this.settingMap[r];typeof n=="boolean"?t.checked=n:t.value=n.toString()}}}listenToInputChanges(e){for(let t of e)t.addEventListener("change",()=>{let r=t.getAttribute("name")?.replace("md-","");if(r&&r in this.settingMap){let n=t.type==="checkbox"?t.checked:Number(t.value);this.set(r,n)}})}loadFromLocalStorage(){let e=window.localStorage.getItem("md-editor-settings");if(e)try{let t=JSON.parse(e);for(let[r,n]of Object.entries(t))n!=null&&r in this.settingMap&&(this.settingMap[r]=n)}catch(t){console.warn("Failed to parse settings from localStorage:",t)}}set(e,t){this.settingMap[e]=t,window.localStorage.setItem("md-editor-settings",JSON.stringify(this.settingMap));let r=this.changeListeners[e]||[];for(let n of r)n(t)}get(e){return this.settingMap[e]??null}onChange(e,t){let r=this.changeListeners[e]||[];r.push(t),this.changeListeners[e]=r}};function Qu({html:u,markdown:e}){return e||u}function j0(u){window.$events.listen("editor::replace",e=>{let t=Qu(e);u.actions.replaceContent(t)}),window.$events.listen("editor::append",e=>{let t=Qu(e);u.actions.appendContent(t)}),window.$events.listen("editor::prepend",e=>{let t=Qu(e);u.actions.prependContent(t)}),window.$events.listen("editor::insert",e=>{let t=Qu(e);u.actions.insertContent(t)}),window.$events.listen("editor::focus",()=>{u.actions.focus()})}function Vo(u){let e=[],t=r=>()=>(r(),!0);for(let[r,n]of Object.entries(u))e.push({key:r,run:t(n),preventDefault:!0});return e}async function V0(u,e,t,r){let n=await window.importVersioned("code");function o(c){c.docChanged&&r()}let i=n.markdownEditor(u,o,t,Vo(e));return window.mdEditorView=i,i}var ue=class{constructor(e){v(this,"cm");this.cm=e}teardown(){this.cm.destroy()}focus(){this.cm.hasFocus||this.cm.focus()}getSelection(){return this.cm.state.selection.main}getSelectionText(e){return e=e||this.getSelection(),this.cm.state.sliceDoc(e.from,e.to)}setSelection(e,t=!1){this.cm.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:t})}getText(){return this.cm.state.doc.toString()}getTextAboveView(){let e=this.cm.lineBlockAtHeight(this.cm.scrollDOM.scrollTop);return this.cm.state.sliceDoc(0,e.from)}setText(e,t){t=t||this.getSelection();let r=this.cm.state.toText(e),n=Math.min(t.from,r.length),o=this.cm.scrollDOM.scrollTop;this.dispatchChange(0,this.cm.state.doc.length,e,n),this.focus(),window.requestAnimationFrame(()=>{this.cm.scrollDOM.scrollTop=o})}spliceText(e,t,r,n=null){let o=n?.from===n?.to?null:n?.to;this.dispatchChange(e,t,r,n?.from,o)}appendText(e){let t=this.cm.state.doc.length;this.dispatchChange(t,t,` -${e}`)}getLineText(e=-1){let t=e>-1?e:this.getSelection().from;return this.cm.state.doc.lineAt(t).text}eventToPosition(e){let t=this.cm.posAtCoords({x:e.screenX,y:e.screenY},!1);return{from:t,to:t}}getLineRangeFromPosition(e){let t=this.cm.state.doc.lineAt(e);return{from:t.from,to:t.to}}searchForLineContaining(e){let t=this.cm.state.doc,r=1,n=-1;for(let i of t.iterLines()){if(i.includes(e)){n=r;break}r+=1}if(n===-1)return null;let o=t.line(n);return{from:o.from,to:o.to}}dispatchChange(e,t=null,r=null,n=null,o=null){let i={from:e};t&&(i.to=t),r&&(i.insert=r);let c={changes:i};n&&(c.selection={anchor:n},o&&(c.selection.head=o)),this.cm.dispatch(c)}};function ee(u,e,t){let r=null;return function(...o){let i=this,c=function(){r=null,t||u.apply(i,o)},a=t&&!r;r&&clearTimeout(r),r=window.setTimeout(c,e),a&&u.apply(i,o)}}var Dt=class{constructor(){v(this,"onChangeDebounced");v(this,"stack",[]);v(this,"pointer",-1);v(this,"lastActionTime",0);this.onChangeDebounced=ee(this.onChange,1e3,!1)}undo(){return this.pointer<1?null:(this.lastActionTime=Date.now(),this.pointer-=1,this.stack[this.pointer])}redo(){return this.pointer===this.stack.length-1?null:(this.lastActionTime=Date.now(),this.pointer++,this.stack[this.pointer])}push(e){Date.now()-this.lastActionTime<100||this.onChangeDebounced(e)}onChange(e){this.pointer!==this.stack.length-1&&(this.stack=this.stack.slice(0,this.pointer)),this.stack.push(e()),this.stack.length>50&&(this.stack=this.stack.slice(this.stack.length-50)),this.pointer=this.stack.length-1}},te=class{constructor(e,t,r,n){v(this,"input");v(this,"shortcuts");v(this,"events");v(this,"onChange");v(this,"eventController",new AbortController);v(this,"undoStack",new Dt);v(this,"textSizeCache",null);this.input=e,this.shortcuts=t,this.events=r,this.onChange=n,this.onKeyDown=this.onKeyDown.bind(this),this.configureLocalShortcuts(),this.configureListeners(),this.input.style.removeProperty("display"),this.undoStack.push(()=>({content:this.getText(),selection:this.getSelection()}))}teardown(){this.eventController.abort("teardown")}configureLocalShortcuts(){this.shortcuts["Mod-z"]=()=>{let e=this.undoStack.undo();e&&(this.setText(e.content),this.setSelection(e.selection,!1))},this.shortcuts["Mod-y"]=()=>{let e=this.undoStack.redo();e&&(this.setText(e.content),this.setSelection(e.selection,!1))}}configureListeners(){this.input.addEventListener("keydown",this.onKeyDown,{signal:this.eventController.signal});for(let[e,t]of Object.entries(this.events))this.input.addEventListener(e,t,{signal:this.eventController.signal});this.input.addEventListener("input",()=>{this.onChange(),this.undoStack.push(()=>({content:this.input.value,selection:this.getSelection()}))},{signal:this.eventController.signal})}onKeyDown(e){let t=navigator.platform.startsWith("Mac")||navigator.platform==="iPhone",r=e.key.length>1?e.key:e.key.toLowerCase(),o=[e.shiftKey?"Shift":null,t&&e.metaKey?"Mod":null,!t&&e.ctrlKey?"Mod":null,r].filter(Boolean).join("-");this.shortcuts[o]&&(e.preventDefault(),this.shortcuts[o]())}appendText(e){this.input.value+=` +`,{from:r}),this.editor.input.focus()}appendContent(e){e=R(this,T,wt).call(this,e),this.editor.input.appendText(e),this.editor.input.focus()}replaceContent(e){this.editor.input.setText(e)}replaceLineStart(e){let t=this.editor.input.getSelection(),r=this.editor.input.getLineRangeFromPosition(t.from),n=this.editor.input.getSelectionText(r),o=n.split(" ")[0];if(o===e){let s=n.replace(`${e} `,""),d=t.from+(s.length-n.length);this.editor.input.spliceText(r.from,r.to,s,{from:d});return}let i=n;/^[#>`]/.test(o)?i=n.replace(o,e).trim():e!==""&&(i=`${e} ${n}`);let a=t.from+(i.length-n.length);this.editor.input.spliceText(r.from,r.to,i,{from:a})}wrapSelection(e,t){let r=this.editor.input.getSelection(),n=this.editor.input.getSelectionText(r);if(!n){R(this,T,Ju).call(this,e,t);return}let o,i={from:r.from,to:r.to};n.startsWith(e)&&n.endsWith(t)?(o=n.slice(e.length,n.length-t.length),i.to=r.to-(e.length+t.length)):(o=`${e}${n}${t}`,i.to=r.to+(e.length+t.length)),this.editor.input.spliceText(r.from,r.to,o,i)}replaceLineStartForOrderedList(){let e=this.editor.input.getSelection(),t=this.editor.input.getLineRangeFromPosition(e.from),r=this.editor.input.getLineRangeFromPosition(t.from-1),o=this.editor.input.getSelectionText(r).match(/^(\s*)(\d)([).])\s/)||[],i=(Number(o[2])||0)+1,c=o[1]||"",a=o[3]||".",s=`${c}${i}${a}`;return this.replaceLineStart(s)}cycleCalloutTypeAtSelection(){let e=this.editor.input.getSelection(),t=this.editor.input.getLineRangeFromPosition(e.from),r=this.editor.input.getSelectionText(t),n=["info","success","warning","danger"],o=n.join("|"),c=new RegExp(`class="((${o})\\s+callout|callout\\s+(${o}))"`,"i").exec(r),a=(c?c[2]||c[3]:"").toLowerCase();if(a===n[n.length-1])R(this,T,Ju).call(this,`

    `,"

    ");else if(a==="")R(this,T,Ju).call(this,'

    ',"

    ");else if(c){let s=n.indexOf(a)+1,d=n[s],f=r.replace(c[0],c[0].replace(a,d)),g=f.length-r.length,h=Math.min(e.from,e.to),l=Math.max(e.from,e.to);this.editor.input.spliceText(t.from,t.to,f,{from:h+g,to:l+g})}}syncDisplayPosition(e){let t=e.target;if(Math.abs(t.scrollHeight-t.clientHeight-t.scrollTop)<1){this.editor.display.scrollToIndex(-1);return}let n=this.editor.input.getTextAboveView(),c=new DOMParser().parseFromString(this.editor.markdown.render(n),"text/html").documentElement.querySelectorAll("body > *");this.editor.display.scrollToIndex(c.length)}async insertTemplate(e,t){let r=this.editor.input.eventToPosition(t).from,n=(await window.$http.get(`/templates/${e}`)).data,o=n.markdown||n.html;this.editor.input.spliceText(r,r,o,{from:r})}insertClipboardImages(e,t){let r=this.editor.input.eventToPosition(t).from;for(let n of e)this.uploadImage(n,r)}async uploadImage(e,t=null){if(e===null||e.type.indexOf("image")!==0)return;let r="png";if(t===null&&(t=this.editor.input.getSelection().from),e.name){let s=e.name.match(/\.(.+)$/);s&&s.length>1&&(r=s[1])}let n=`image-${Math.random().toString(16).slice(2)}`,i=`![](${window.baseUrl(`/loading.gif#upload${n}`)})`;this.editor.input.spliceText(t,t,i,{from:t});let c=`image-${Date.now()}.${r}`,a=new FormData;a.append("file",e,c),a.append("uploaded_to",this.editor.config.pageId);try{let s=(await window.$http.post("/images/gallery",a)).data,d=`[![](${s.thumbs.display})](${s.url})`;R(this,T,Ct).call(this,i,d)}catch(s){window.$events.error(s?.data?.message||this.editor.config.text.imageUploadError),R(this,T,Ct).call(this,i,""),console.error(s)}}};T=new WeakSet,Et=function(e,t){let r=`
    `;R(this,T,iu).call(this,r,r.length,t)},iu=function(e,t=0,r=null){r=r||this.editor.input.getSelection();let n=r.from+t;this.editor.input.spliceText(r.from,r.to,e,{from:n,to:n}),this.editor.input.focus()},wt=function(e){return e.replace(/\r\n|\r/g,` +`)},Ct=function(e,t){let r=this.editor.input.getText().replace(e,t);this.editor.input.setText(r)},Ju=function(e,t){let r=this.editor.input.getSelection(),n=this.editor.input.getLineRangeFromPosition(r.from),o=this.editor.input.getSelectionText(n),i,c;o.startsWith(e)&&o.endsWith(t)?(i=o.slice(e.length,o.length-t.length),c=-e.length):(i=`${e}${o}${t}`,c=e.length),this.editor.input.spliceText(n.from,n.to,i,{from:r.from+c})};var Yu=class{constructor(e){A(this,"changeListeners",{});A(this,"settingMap",{scrollSync:!0,showPreview:!0,editorWidth:50,plainEditor:!1});this.loadFromLocalStorage(),this.applyToInputs(e),this.listenToInputChanges(e)}applyToInputs(e){for(let t of e){let r=t.getAttribute("name")?.replace("md-","");if(r&&r in this.settingMap){let n=this.settingMap[r];typeof n=="boolean"?t.checked=n:t.value=n.toString()}}}listenToInputChanges(e){for(let t of e)t.addEventListener("change",()=>{let r=t.getAttribute("name")?.replace("md-","");if(r&&r in this.settingMap){let n=t.type==="checkbox"?t.checked:Number(t.value);this.set(r,n)}})}loadFromLocalStorage(){let e=window.localStorage.getItem("md-editor-settings");if(e)try{let t=JSON.parse(e);for(let[r,n]of Object.entries(t))n!=null&&r in this.settingMap&&(this.settingMap[r]=n)}catch(t){console.warn("Failed to parse settings from localStorage:",t)}}set(e,t){this.settingMap[e]=t,window.localStorage.setItem("md-editor-settings",JSON.stringify(this.settingMap));let r=this.changeListeners[e]||[];for(let n of r)n(t)}get(e){return this.settingMap[e]??null}onChange(e,t){let r=this.changeListeners[e]||[];r.push(t),this.changeListeners[e]=r}};function Qu({html:u,markdown:e}){return e||u}function j0(u){window.$events.listen("editor::replace",e=>{let t=Qu(e);u.actions.replaceContent(t)}),window.$events.listen("editor::append",e=>{let t=Qu(e);u.actions.appendContent(t)}),window.$events.listen("editor::prepend",e=>{let t=Qu(e);u.actions.prependContent(t)}),window.$events.listen("editor::insert",e=>{let t=Qu(e);u.actions.insertContent(t)}),window.$events.listen("editor::focus",()=>{u.actions.focus()})}function Vo(u){let e=[],t=r=>()=>(r(),!0);for(let[r,n]of Object.entries(u))e.push({key:r,run:t(n),preventDefault:!0});return e}async function V0(u,e,t,r){let n=await window.importVersioned("code");function o(c){c.docChanged&&r()}let i=n.markdownEditor(u,o,t,Vo(e));return window.mdEditorView=i,i}var ue=class{constructor(e){A(this,"cm");this.cm=e}teardown(){this.cm.destroy()}focus(){this.cm.hasFocus||this.cm.focus()}getSelection(){return this.cm.state.selection.main}getSelectionText(e){return e=e||this.getSelection(),this.cm.state.sliceDoc(e.from,e.to)}setSelection(e,t=!1){this.cm.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:t})}getText(){return this.cm.state.doc.toString()}getTextAboveView(){let e=this.cm.lineBlockAtHeight(this.cm.scrollDOM.scrollTop);return this.cm.state.sliceDoc(0,e.from)}setText(e,t){t=t||this.getSelection();let r=this.cm.state.toText(e),n=Math.min(t.from,r.length),o=this.cm.scrollDOM.scrollTop;this.dispatchChange(0,this.cm.state.doc.length,e,n),this.focus(),window.requestAnimationFrame(()=>{this.cm.scrollDOM.scrollTop=o})}spliceText(e,t,r,n=null){let o=n?.from===n?.to?null:n?.to;this.dispatchChange(e,t,r,n?.from,o)}appendText(e){let t=this.cm.state.doc.length;this.dispatchChange(t,t,` +${e}`)}getLineText(e=-1){let t=e>-1?e:this.getSelection().from;return this.cm.state.doc.lineAt(t).text}eventToPosition(e){let t=this.cm.posAtCoords({x:e.screenX,y:e.screenY},!1);return{from:t,to:t}}getLineRangeFromPosition(e){let t=this.cm.state.doc.lineAt(e);return{from:t.from,to:t.to}}searchForLineContaining(e){let t=this.cm.state.doc,r=1,n=-1;for(let i of t.iterLines()){if(i.includes(e)){n=r;break}r+=1}if(n===-1)return null;let o=t.line(n);return{from:o.from,to:o.to}}dispatchChange(e,t=null,r=null,n=null,o=null){let i={from:e};t&&(i.to=t),r&&(i.insert=r);let c={changes:i};n&&(c.selection={anchor:n},o&&(c.selection.head=o)),this.cm.dispatch(c)}};function ee(u,e,t){let r=null;return function(...o){let i=this,c=function(){r=null,t||u.apply(i,o)},a=t&&!r;r&&clearTimeout(r),r=window.setTimeout(c,e),a&&u.apply(i,o)}}var Dt=class{constructor(){A(this,"onChangeDebounced");A(this,"stack",[]);A(this,"pointer",-1);A(this,"lastActionTime",0);this.onChangeDebounced=ee(this.onChange,1e3,!1)}undo(){return this.pointer<1?null:(this.lastActionTime=Date.now(),this.pointer-=1,this.stack[this.pointer])}redo(){return this.pointer===this.stack.length-1?null:(this.lastActionTime=Date.now(),this.pointer++,this.stack[this.pointer])}push(e){Date.now()-this.lastActionTime<100||this.onChangeDebounced(e)}onChange(e){this.pointer!==this.stack.length-1&&(this.stack=this.stack.slice(0,this.pointer)),this.stack.push(e()),this.stack.length>50&&(this.stack=this.stack.slice(this.stack.length-50)),this.pointer=this.stack.length-1}},te=class{constructor(e,t,r,n){A(this,"input");A(this,"shortcuts");A(this,"events");A(this,"onChange");A(this,"eventController",new AbortController);A(this,"undoStack",new Dt);A(this,"textSizeCache",null);this.input=e,this.shortcuts=t,this.events=r,this.onChange=n,this.onKeyDown=this.onKeyDown.bind(this),this.configureLocalShortcuts(),this.configureListeners(),this.input.style.removeProperty("display"),this.undoStack.push(()=>({content:this.getText(),selection:this.getSelection()}))}teardown(){this.eventController.abort("teardown")}configureLocalShortcuts(){this.shortcuts["Mod-z"]=()=>{let e=this.undoStack.undo();e&&(this.setText(e.content),this.setSelection(e.selection,!1))},this.shortcuts["Mod-y"]=()=>{let e=this.undoStack.redo();e&&(this.setText(e.content),this.setSelection(e.selection,!1))}}configureListeners(){this.input.addEventListener("keydown",this.onKeyDown,{signal:this.eventController.signal});for(let[e,t]of Object.entries(this.events))this.input.addEventListener(e,t,{signal:this.eventController.signal});this.input.addEventListener("input",()=>{this.onChange(),this.undoStack.push(()=>({content:this.input.value,selection:this.getSelection()}))},{signal:this.eventController.signal})}onKeyDown(e){let t=navigator.platform.startsWith("Mac")||navigator.platform==="iPhone",r=e.key.length>1?e.key:e.key.toLowerCase(),o=[e.shiftKey?"Shift":null,t&&e.metaKey?"Mod":null,!t&&e.ctrlKey?"Mod":null,r].filter(Boolean).join("-");this.shortcuts[o]&&(e.preventDefault(),this.shortcuts[o]())}appendText(e){this.input.value+=` ${e}`,this.input.dispatchEvent(new Event("input"))}eventToPosition(e){let t=this.mouseEventToTextRelativeCoords(e);return this.inputPositionToSelection(t.x,t.y)}focus(){this.input.focus()}getLineRangeFromPosition(e){let t=this.getText().split(` `),r=0;for(let n=0;n-1?this.getLineRangeFromPosition(t):null}setSelection(e,t){this.input.selectionStart=e.from,this.input.selectionEnd=e.to}setText(e,t){this.input.value=e,this.input.dispatchEvent(new Event("input")),t&&this.setSelection(t,!1)}spliceText(e,t,r,n){let o=this.getText(),i=o.slice(0,e)+r+o.slice(t);if(this.setText(i),n&&n.from){let c={from:n.from,to:n.to||n.from};this.setSelection(c,!1)}}measureTextSize(){if(this.textSizeCache)return this.textSizeCache;let e=document.createElement("div");e.textContent=`a b`;let t=window.getComputedStyle(this.input);e.style.font=t.font,e.style.lineHeight=t.lineHeight,e.style.padding="0px",e.style.display="inline-block",e.style.visibility="hidden",e.style.position="absolute",e.style.whiteSpace="pre",this.input.after(e);let r=e.getBoundingClientRect();return e.remove(),this.textSizeCache={x:r.width,y:r.height/2},this.textSizeCache}measureLineCharCount(e){let t=window.getComputedStyle(this.input),r=Number(t.paddingLeft.replace("px","")),n=Number(t.paddingRight.replace("px","")),i=Number(t.width.replace("px",""))-(r+n);return Math.floor(i/e)}mouseEventToTextRelativeCoords(e){let t=this.input.getBoundingClientRect(),r=window.getComputedStyle(this.input),n=Number(r.paddingTop.replace("px","")),o=Number(r.paddingLeft.replace("px","")),i=Math.max(e.clientX-(t.left+o),0),c=Math.max(e.clientY-(t.top+n)+this.input.scrollTop,0);return{x:i,y:c}}inputPositionToSelection(e,t){let r=this.measureTextSize(),n=this.measureLineCharCount(r.x),o=this.getText().split(` -`),i=0,c=0;for(let a of o){let s=0,d=Math.max(Math.ceil(a.length/n),1);for(let f=0;ft){let x=Math.floor(e/r.x),h=Math.min(c+s+x,c+a.length);return{from:h,to:h}}s+=n}c+=a.length+1}return this.getSelection()}};function Z0(u){let e={};return e["Shift-Mod-i"]=()=>u.actions.insertImage(),e["Mod-s"]=()=>window.$events.emit("editor-save-draft"),e["Mod-Enter"]=()=>window.$events.emit("editor-save-page"),e["Shift-Mod-k"]=()=>u.actions.showLinkSelector(),e["Mod-k"]=()=>u.actions.insertLink(),e["Mod-1"]=()=>u.actions.replaceLineStart("##"),e["Mod-2"]=()=>u.actions.replaceLineStart("###"),e["Mod-3"]=()=>u.actions.replaceLineStart("####"),e["Mod-4"]=()=>u.actions.replaceLineStart("#####"),e["Mod-5"]=()=>u.actions.replaceLineStart(""),e["Mod-d"]=()=>u.actions.replaceLineStart(""),e["Mod-6"]=()=>u.actions.replaceLineStart(">"),e["Mod-q"]=()=>u.actions.replaceLineStart(">"),e["Mod-7"]=()=>u.actions.wrapSelection("\n```\n","\n```"),e["Mod-8"]=()=>u.actions.wrapSelection("`","`"),e["Shift-Mod-e"]=()=>u.actions.wrapSelection("`","`"),e["Mod-9"]=()=>u.actions.cycleCalloutTypeAtSelection(),e["Mod-p"]=()=>u.actions.replaceLineStart("-"),e["Mod-o"]=()=>u.actions.replaceLineStartForOrderedList(),e}var yu=class{constructor(e){v(this,"data");this.data=e}hasItems(){return!!this.data&&!!this.data.types&&this.data.types.length>0}containsTabularData(){let e=this.data.getData("text/rtf");return!!e&&e.includes("\\trowd")}getImages(){return this.getFiles().filter(e=>e.type.includes("image"))}getFiles(){let{files:e}=this.data;return[...e]}};function G0(u){let e=ee(u.actions.syncDisplayPosition.bind(u.actions),100,!1),t=u.settings.get("scrollSync");return u.settings.onChange("scrollSync",r=>{t=r}),{scroll:r=>t&&e(r),drop:r=>{if(!r.dataTransfer)return;let n=r.dataTransfer.getData("bookstack/template");n&&(r.preventDefault(),u.actions.insertTemplate(n,r));let i=new yu(r.dataTransfer).getImages();i.length>0&&(r.stopPropagation(),r.preventDefault(),u.actions.insertClipboardImages(i,r))},dragover:r=>{r.preventDefault()},paste:r=>{if(!r.clipboardData)return;let n=new yu(r.clipboardData);if(!n.hasItems()||n.containsTabularData())return;let o=n.getImages();for(let i of o)u.actions.uploadImage(i)}}}async function pl(u){let e={config:u,markdown:new $u,settings:new Yu(u.settingInputs)};e.actions=new Ku(e),e.display=new Vu(e);let t=G0(e),r=Z0(e),n=()=>e.actions.updateAndRender(),o=async()=>{let a=await V0(u.inputEl,r,t,n);return new ue(a)},i=async()=>new te(u.inputEl,r,t,n),c=!!e.settings.get("plainEditor");return e.input=await(c?i():o()),e.settings.onChange("plainEditor",async a=>{let d=await(!!a?i():o());e.input.teardown(),e.input=d}),j0(e),e}export{pl as init}; +`),i=0,c=0;for(let a of o){let s=0,d=Math.max(Math.ceil(a.length/n),1);for(let f=0;ft){let g=Math.floor(e/r.x),h=Math.min(c+s+g,c+a.length);return{from:h,to:h}}s+=n}c+=a.length+1}return this.getSelection()}};function Z0(u){let e={};return e["Shift-Mod-i"]=()=>u.actions.insertImage(),e["Mod-s"]=()=>window.$events.emit("editor-save-draft"),e["Mod-Enter"]=()=>window.$events.emit("editor-save-page"),e["Shift-Mod-k"]=()=>u.actions.showLinkSelector(),e["Mod-k"]=()=>u.actions.insertLink(),e["Mod-1"]=()=>u.actions.replaceLineStart("##"),e["Mod-2"]=()=>u.actions.replaceLineStart("###"),e["Mod-3"]=()=>u.actions.replaceLineStart("####"),e["Mod-4"]=()=>u.actions.replaceLineStart("#####"),e["Mod-5"]=()=>u.actions.replaceLineStart(""),e["Mod-d"]=()=>u.actions.replaceLineStart(""),e["Mod-6"]=()=>u.actions.replaceLineStart(">"),e["Mod-q"]=()=>u.actions.replaceLineStart(">"),e["Mod-7"]=()=>u.actions.wrapSelection("\n```\n","\n```"),e["Mod-8"]=()=>u.actions.wrapSelection("`","`"),e["Shift-Mod-e"]=()=>u.actions.wrapSelection("`","`"),e["Mod-9"]=()=>u.actions.cycleCalloutTypeAtSelection(),e["Mod-p"]=()=>u.actions.replaceLineStart("-"),e["Mod-o"]=()=>u.actions.replaceLineStartForOrderedList(),e}var yu=class{constructor(e){A(this,"data");this.data=e}hasItems(){return!!this.data&&!!this.data.types&&this.data.types.length>0}containsTabularData(){let e=this.data.getData("text/rtf");return!!e&&e.includes("\\trowd")}getImages(){return this.getFiles().filter(e=>e.type.includes("image"))}getFiles(){let{files:e}=this.data;return[...e]}};function G0(u){let e=ee(u.actions.syncDisplayPosition.bind(u.actions),100,!1),t=u.settings.get("scrollSync");return u.settings.onChange("scrollSync",r=>{t=r}),{scroll:r=>t&&e(r),drop:r=>{if(!r.dataTransfer)return;let n=r.dataTransfer.getData("bookstack/template");n&&(r.preventDefault(),u.actions.insertTemplate(n,r));let i=new yu(r.dataTransfer).getImages();i.length>0&&(r.stopPropagation(),r.preventDefault(),u.actions.insertClipboardImages(i,r))},dragover:r=>{r.preventDefault()},paste:r=>{if(!r.clipboardData)return;let n=new yu(r.clipboardData);if(!n.hasItems()||n.containsTabularData())return;let o=n.getImages();for(let i of o)u.actions.uploadImage(i)}}}async function pl(u){let e={config:u,markdown:new Uu,settings:new Yu(u.settingInputs)};e.actions=new Ku(e),e.display=new Vu(e);let t=G0(e),r=Z0(e),n=()=>e.actions.updateAndRender(),o=async()=>{let a=await V0(u.inputEl,r,t,n);return new ue(a)},i=async()=>new te(u.inputEl,r,t,n),c=!!e.settings.get("plainEditor");return e.input=await(c?i():o()),e.settings.onChange("plainEditor",async a=>{let d=await(!!a?i():o());e.input.teardown(),e.input=d}),j0(e),e}export{pl as init}; //# sourceMappingURL=markdown.js.map diff --git a/public/dist/wysiwyg.js b/public/dist/wysiwyg.js index fbef742a6..beffe4633 100644 --- a/public/dist/wysiwyg.js +++ b/public/dist/wysiwyg.js @@ -1,7 +1,7 @@ // See the "/licenses" URI for full package license details var lN=Object.defineProperty;var dc=o=>{throw TypeError(o)};var aN=(o,t,e)=>t in o?lN(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var p=(o,t,e)=>aN(o,typeof t!="symbol"?t+"":t,e),xl=(o,t,e)=>t.has(o)||dc("Cannot "+e);var Me=(o,t,e)=>(xl(o,t,"read from private field"),e?e.call(o):t.get(o)),vt=(o,t,e)=>t.has(o)?dc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e),po=(o,t,e,n)=>(xl(o,t,"write to private field"),n?n.call(o,e):t.set(o,e),e),hr=(o,t,e)=>(xl(o,t,"access private method"),e);function $(o){return __DEV__?{type:o}:{}}var _e=$("SELECTION_CHANGE_COMMAND"),Nr=$("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Wt=$("CLICK_COMMAND"),tt=$("DELETE_CHARACTER_COMMAND"),qt=$("INSERT_LINE_BREAK_COMMAND"),Yt=$("INSERT_PARAGRAPH_COMMAND"),ft=$("CONTROLLED_TEXT_INSERTION_COMMAND"),go=$("PASTE_COMMAND"),Sn=$("REMOVE_TEXT_COMMAND"),Dt=$("DELETE_WORD_COMMAND"),mt=$("DELETE_LINE_COMMAND"),Ee=$("FORMAT_TEXT_COMMAND"),ho=$("UNDO_COMMAND"),No=$("REDO_COMMAND"),El=$("KEYDOWN_COMMAND"),Fo=$("KEY_ARROW_RIGHT_COMMAND"),Tl=$("MOVE_TO_END"),Ko=$("KEY_ARROW_LEFT_COMMAND"),Cl=$("MOVE_TO_START"),Zt=$("KEY_ARROW_UP_COMMAND"),Vt=$("KEY_ARROW_DOWN_COMMAND"),we=$("KEY_ENTER_COMMAND"),xr=$("KEY_SPACE_COMMAND"),Xt=$("KEY_BACKSPACE_COMMAND"),Uo=$("KEY_ESCAPE_COMMAND"),jt=$("KEY_DELETE_COMMAND"),_i=$("KEY_AT_COMMAND"),zo=$("KEY_TAB_COMMAND"),bl=$("INSERT_TAB_COMMAND"),dN=$("INDENT_CONTENT_COMMAND"),cN=$("OUTDENT_CONTENT_COMMAND"),Wo=$("DROP_COMMAND"),Er=$("DRAGSTART_COMMAND"),Tr=$("DRAGOVER_COMMAND"),_l=$("DRAGEND_COMMAND"),xo=$("COPY_COMMAND"),Eo=$("CUT_COMMAND"),Ln=$("SELECT_ALL_COMMAND"),yl=$("CLEAR_EDITOR_COMMAND"),Sl=$("CLEAR_HISTORY_COMMAND"),To=$("CAN_REDO_COMMAND"),Co=$("CAN_UNDO_COMMAND"),Cr=$("FOCUS_COMMAND"),Ll=$("BLUR_COMMAND"),Ml=$("KEY_MODIFIER_COMMAND");var pe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var uN=pe&&"documentMode"in document?document.documentMode:null,Ye=pe&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ze=pe&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),bo=pe&&"InputEvent"in window&&!uN?"getTargetRanges"in new window.InputEvent("input"):!1,Gt=pe&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Ot=pe&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,cc=pe&&/Android/.test(navigator.userAgent),wl=pe&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vl=pe&&cc&&wl,Jt=pe&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!wl;var _o=1,Ve=3,At=0,Dl=1,Qt=2,uc=0,yi=1,Si=2,br=1,_r=2,Mn=4,wn=8,yr=16,Sr=32,Lr=64,Mr=128,Ol=br|_r|Mn|wn|yr|Sr|Lr|Mr,Li=1,vn=2;var fc="\xA0",fN="\u200B",Dn=Gt||Ot||Jt?fc:fN,ot=` -`,mc=Ze?fc:Dn,pc="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",gc="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",mN=new RegExp("^[^"+gc+"]*["+pc+"]"),pN=new RegExp("^[^"+pc+"]*["+gc+"]"),$e={bold:br,code:yr,highlight:Mr,italic:_r,strikethrough:Mn,subscript:Sr,superscript:Lr,underline:wn},hc={directionless:Li,unmergeable:vn},Nc={normal:uc,segmented:Si,token:yi},xc={[uc]:"normal",[Si]:"segmented",[yi]:"token"};function T(o,t,...e){if(!o){for(let n of e)t=(t||"").replace("%s",n);throw new Error(t)}}function Rt(...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 gN=100,Rl=!1,kl=0;function Ec(){return Rl}function hN(o){kl=o.timeStamp}function NN(o){kl===0&&On(o).addEventListener("textInput",hN,!0)}function Al(o,t,e){return t.__lexicalLineBreak===o||o[`__lexicalKey_${e._key}`]!==void 0}function xN(o){return o.getEditorState().read(()=>{let t=C();return t!==null?t.clone():null})}function EN(o,t,e){let n=ve(e._window),r=null,i=null;n!==null&&n.anchorNode===o&&(r=n.anchorOffset,i=n.focusOffset);let s=o.nodeValue;s!==null&&wr(t,s,r,i,!1)}function TN(o,t,e){return t.nodeType===Ve&&e.isAttached()}function Tc(o,t,e){Rl=!0;let n=performance.now()-kl>gN;try{Te(o,()=>{let r=C()||xN(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{Tc(o,t,e)})}function Cc(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 bc(o,t){let e=o.mergeWithSibling(t),n=Q()._normalizedNodes;return n.add(o.__key),n.add(t.__key),e}function Pl(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(Cc(e,t)){t=bc(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(Cc(t,n)){t=bc(t,n);break}else break}function qo(o){return _c(o.anchor),_c(o.focus),o}function _c(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 CN=1;function bN(){return""+CN++}function Lc(o,t){let e=o._nodes.get(t);return e===void 0&&T(!1,"registeredNode: Type %s not found",t),e}var Mc=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function wc(o){return H(G(o))}function In(o){let t=document.activeElement;if(t===null)return!1;let e=t.nodeName;return H(G(o))&&(e==="INPUT"||e==="TEXTAREA"||t.contentEditable==="true"&&Yo(t)==null)}function eo(o,t,e){let n=o.getRootElement();try{return n!==null&&n.contains(t)&&n.contains(e)&&t!==null&&!In(t)&&Di(t)===o}catch{return!1}}function $n(o){return o instanceof ro}function Di(o){let t=o;for(;t!=null;){let e=Yo(t);if($n(e))return e;t=Ii(t)}return null}function Yo(o){return o?o.__lexicalEditor:null}function Xe(o){return o.isToken()||o.isSegmented()}function _N(o){return o.nodeType===Ve}function Pn(o){let t=o;for(;t!=null;){if(_N(t))return t;t=t.firstChild}return null}function Dr(o,t,e){let n=$e[t];if(e!==null&&(o&n)===(e&n))return o;let r=o^n;return t==="subscript"?r&=~$e.superscript:t==="superscript"&&(r&=~$e.subscript),r}function Or(o){return L(o)||Pe(o)||H(o)}function vc(o,t){if(t!=null){__DEV__&&yN(o,t),o.__key=t;return}ue(),Zl();let e=Q(),n=rt(),r=bN();n._nodeMap.set(r,o),E(o)?e._dirtyElements.set(r,!0):e._dirtyLeaves.add(r),e._cloneNotNeeded.add(r),e._dirtyType=Dl,o.__key=r}function yN(o,t){let e=gu();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 SN(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 to(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 vr(o){Zl();let t=o.getLatest(),e=t.__parent,n=rt(),r=Q(),i=n._nodeMap,s=r._dirtyElements;e!==null&&SN(e,i,s);let l=t.__key;r._dirtyType=Dl,E(o)?s.set(l,!0):r._dirtyLeaves.add(l)}function Dc(o){let t=o.getPreviousSibling(),e=o.getNextSibling();t!==null&&vr(t),e!==null&&vr(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 nt(){return pt()?null:Q()._compositionKey}function ee(o,t){let n=(t||rt())._nodeMap.get(o);return n===void 0?null:n}function Il(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=Il(e,t);if(n!==null)return n;e=Ii(e)}return null}function Oi(o){let t=o._decorators,e=Object.assign({},t);return o._pendingDecorators=e,e}function Hl(o){return o.read(()=>F().getTextContent())}function Oc(o,t){Te(o,()=>{let e=rt();if(e.isEmpty())return;if(t==="root"){F().markDirty();return}let n=e._nodeMap;for(let[,r]of n)r.markDirty()},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function F(){return $l(rt())}function $l(o){return o._nodeMap.get("root")}function Y(o){ue();let t=rt();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 Ac(){ue();let o=Q();Mi(o)}function Zo(o){let t=Q(),e=LN(o,t);if(e===null){let n=t.getRootElement();return o===n?ee("root"):null}return ee(e)}function Fl(o,t){return t?o.getTextContentSize():0}function LN(o,t){let e=o;for(;e!=null;){let n=e[`__lexicalKey_${t._key}`];if(n!==void 0)return n;e=Ii(e)}return null}function Ai(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function Ar(o){let t=[],e=o;for(;e!==null;)t.push(e),e=e._parentEditor;return t}function Kl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ul(o){return o.nodeType===Ve?o.nodeValue:null}function Ri(o,t,e){let n=ve(t._window);if(n===null)return;let r=n.anchorNode,{anchorOffset:i,focusOffset:s}=n;if(r!==null){let l=Ul(r),a=G(r);if(l!==null&&L(a)){if(l===Dn&&e){let d=e.length;l=e,i=d,s=d}l!==null&&wr(a,l,i,s,o)}}}function wr(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]===Dn&&(l=t.slice(0,-1));let a=i.getTextContent();if(r||l!==a){if(l===""){if(le(null),!Gt&&!Ot&&!Jt){let h=Q();setTimeout(()=>{h.update(()=>{i.isAttached()&&i.remove()})},20)}else i.remove();return}let d=i.getParent(),u=je(),m=i.getTextContentSize(),c=nt(),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=z(h);i.replace(N),i=N}i.setTextContent(l)}}}function MN(o){let t=o.getPreviousSibling();return(L(t)||E(t)&&t.isInline())&&!t.canInsertTextAfter()}function Rc(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||MN(t):e===t.getTextContentSize()?!t.canInsertTextAfter()||!n.canInsertTextAfter()&&!t.isComposing()||r:!1}function kc(o,t,e,n){return o==="Tab"&&!t&&!e&&!n}function Ic(o,t,e,n){return o.toLowerCase()==="b"&&!t&&Rr(e,n)}function $c(o,t,e,n){return o.toLowerCase()==="i"&&!t&&Rr(e,n)}function Pc(o,t,e,n){return o.toLowerCase()==="u"&&!t&&Rr(e,n)}function Bc(o,t){return lu(o)&&!t}function Hc(o,t){return lu(o)&&t}function Fc(o,t){return Ye&&t&&o.toLowerCase()==="o"}function Kc(o,t,e){return An(o)&&(Ye?t:e)}function Uc(o,t,e){return Rn(o)&&(Ye?t:e)}function zc(o,t){return Ye&&t&&An(o)}function Wc(o,t){return Ye&&t&&Rn(o)}function qc(o,t,e,n){return Ye?t||e?!1:An(o)||o.toLowerCase()==="h"&&n:n||t||e?!1:An(o)}function Yc(o,t,e,n,r){return Ye?e||n||r?!1:Rn(o)||o.toLowerCase()==="d"&&t:t||n||r?!1:Rn(o)}function Zc(o,t,e,n){return o.toLowerCase()==="z"&&!t&&Rr(e,n)}function Vc(o,t,e,n){return Ye?o.toLowerCase()==="z"&&e&&t:o.toLowerCase()==="y"&&n||o.toLowerCase()==="z"&&n&&t}function Xc(o,t,e,n){return t?!1:o.toLowerCase()==="c"?Ye?e:n:!1}function jc(o,t,e,n){return t?!1:o.toLowerCase()==="x"?Ye?e:n:!1}function Gc(o){return o==="ArrowLeft"}function Jc(o){return o==="ArrowRight"}function wN(o){return o==="ArrowUp"}function vN(o){return o==="ArrowDown"}function Qc(o,t,e,n){return Gc(o)&&!t&&!n&&!e}function eu(o,t,e,n,r){return Gc(o)&&!n&&!e&&(t||r)}function tu(o,t,e,n){return Jc(o)&&!t&&!n&&!e}function ou(o,t,e,n,r){return Jc(o)&&!n&&!e&&(t||r)}function nu(o,t,e){return wN(o)&&!t&&!e}function ru(o,t,e){return vN(o)&&!t&&!e}function iu(o,t,e,n){return o||t||e||n}function su(o){return o===" "}function Rr(o,t){return Ye?o:t}function lu(o){return o==="Enter"}function An(o){return o==="Backspace"}function au(o){return o==="Escape"}function Rn(o){return o==="Delete"}function du(o){return o==="@"}function zl(o,t,e){return o.toLowerCase()==="a"&&Rr(t,e)}function Wl(){let o=F(),t=o.select(0,o.getChildrenSize());Y(qo(t))}function yo(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=Rt(r);return e[t]=i,i}return r}function ki(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 yc(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 oo(o,t){let e=o.offset;if(o.type==="element"){let n=o.getNode();return yc(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?yc(n.getParentOrThrow(),t,n.getIndexWithinParent()+(t?0:1)):r}}return null}function vi(o){let t=On(o).event,e=t&&t.inputType;return e==="insertFromPaste"||e==="insertFromPasteAsQuotation"}function O(o,t,e){return Vl(o,t,e)}function kr(o){return!ne(o)&&!o.isLastChild()&&!o.isInline()}function Bn(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 Ii(o){let t=o.assignedSlot||o.parentElement;return t!==null&&t.nodeType===11?t.host:t}function cu(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=On(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=Ii(d)}}function uu(o){let t=C();if(!_(t)||!E(o))return t;let{anchor:e,focus:n}=t,r=e.getNode(),i=n.getNode();return kn(r,o)&&e.set(o.__key,0,"element"),kn(i,o)&&n.set(o.__key,0,"element"),t}function kn(o,t){let e=o.getParent();for(;e!==null;){if(e.is(t))return!0;e=e.getParent()}return!1}function fu(o){let t=o.ownerDocument;return t&&t.defaultView||null}function On(o){let t=o._window;return t===null&&T(!1,"window object not found"),t}function ql(o){let t=o.getParentOrThrow();for(;t!==null;){if(ge(t))return t;t=t.getParentOrThrow()}return t}var XC=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 $i(o,t){let e=o.getParent();ne(e)&&!E(t)&&!H(t)&&T(!1,"Only element or decorator nodes can be inserted in to the root node")}function DN(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=Rt(n);n=t.blockCursor=r}n!==void 0&&e.classList.add(...n)}return e}function Bl(o){return(H(o)||E(o)&&!o.canBeEmpty())&&!o.isInline()}function Ir(o,t,e){e.style.removeProperty("caret-color"),t._blockCursorElement=null;let n=o.parentElement;n!==null&&n.removeChild(o)}function mu(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);Bl(u)&&(a=!0)}else{let u=i.getChildAtIndex(s);if(Bl(u)){let m=u.getPreviousSibling();(m===null||Bl(m))&&(a=!0,d=o.getElementByKey(u.__key))}}if(a){let u=o.getElementByKey(i.__key);n===null&&(o._blockCursorElement=n=DN(o._config)),t.style.caretColor="transparent",d===null?u.appendChild(n):u.insertBefore(n,d);return}}n!==null&&Ir(n,o,t)}function ve(o){return pe?(o||window).getSelection():null}function Pi(o){return he(o)&&o.tagName==="A"}function he(o){return o.nodeType===1}function Vo(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 So(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 Xo(o){if(ne(o)||H(o)&&!o.isInline())return!0;if(!E(o)||ge(o))return!1;let t=o.getFirstChild(),e=t===null||Pe(t)||L(t)||t.isInline();return!o.isInline()&&o.canBeEmpty()!==!1&&e}function Bi(o,t){let e=o;for(;e!==null&&e.getParent()!==null&&!t(e);)e=e.getParentOrThrow();return t(e)?e:null}function Yl(){return Q()}var Sc=new WeakMap,ON=new Map;function pu(o){if(!o._readOnly&&o.isEmpty())return ON;T(o._readOnly,"getCachedTypeToNodeMap called with a writable EditorState");let t=Sc.get(o);if(!t){t=new Map,Sc.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 no(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 hu(o,t){let e=o._decorators,r=o._pendingDecorators||e,i=t._nodeMap,s;for(s in r)i.has(s)||(r===e&&(r=Oi(o)),delete r[s])}function Nu(o,t,e,n,r,i){let s=o.getFirstChild();for(;s!==null;){let l=s.__key;s.__parent===t&&(E(s)&&Nu(s,l,e,n,r,i),e.has(l)||i.delete(l),r.push(l)),s=s.getNextSibling()}}function xu(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)&&Nu(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="",Lo=null,gt="",io="",Hn,De,Pr,Tu=!1,Fi=!1,Ki,jl,Gl,jo,ht,Jl,Br;function Ui(o,t){let e=jo.get(o);if(t!==null){let n=ta(o);n.parentNode===t&&t.removeChild(n)}if(ht.has(o)||De._keyToDOMMap.delete(o),E(e)){let n=Hi(e,jo);Ql(n,0,n.length-1,null)}e!==void 0&&ki(Br,Pr,Ki,e,"destroyed")}function Ql(o,t,e,n){let r=t;for(;r<=e;++r){let i=o[r];i!==void 0&&Ui(i,n)}}function zi(o,t,e){let n=ht.get(o);n===void 0&&T(!1,"createNode: node does not exist in nodeMap");let r=n.createDOM(Hn,De);if(BN(o,r,De),L(n)?r.setAttribute("data-lexical-text","true"):H(n)&&r.setAttribute("data-lexical-decorator","true"),E(n)){let i=n.__size;if(i!==0){let s=i-1,l=Hi(n,ht);ea(l,n,0,s,r,null)}n.isInline()||Cu(null,n,r),kr(n)&&(fe+=ot,io+=ot)}else{let i=n.getTextContent();if(H(n)){let s=n.decorate(De,Hn);s!==null&&bu(o,s),r.contentEditable="false"}fe+=i,io+=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),ki(Br,Pr,Ki,n,"created"),r}function ea(o,t,e,n,r,i){let s=fe;fe="";let l=e;for(;l<=n;++l){zi(o[l],r,i);let a=ht.get(o[l]);a!==null&&L(a)&&(Lo===null&&(Lo=a.getFormat()),gt===""&&(gt=a.getStyle()))}kr(t)&&(fe+=ot),r.__lexicalTextContent=fe,fe=s+fe}function Eu(o,t){let e=t.get(o);return Pe(e)||H(e)&&e.isInline()}function Cu(o,t,e){let n=o!==null&&(o.__size===0||Eu(o.__last,jo)),r=t.__size===0||Eu(t.__last,ht);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 AN(o){Ge(o)&&Lo!=null&&!Fi&&o.setTextStyle(gt)}function RN(o){Ge(o)&>!==""&>!==o.__textStyle&&!Fi&&o.setTextStyle(gt)}function kN(o,t,e){Lo=null,gt="",IN(o,t,e),AN(t),RN(t)}function Hi(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 IN(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=ta(s),u=zi(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}Ui(s,null)}let a=ht.get(l);L(a)&&(Lo===null&&(Lo=a.getFormat()),gt===""&&(gt=a.getStyle()))}else{let s=Hi(o,jo),l=Hi(t,ht);if(r===0)i!==0&&ea(l,t,0,i-1,e,null);else if(i===0){if(r!==0){let d=e.__lexicalLineBreak==null;Ql(s,0,r-1,d?null:e),d&&(e.textContent="")}}else PN(t,s,l,r,i,e)}kr(t)&&(fe+=ot),e.__lexicalTextContent=fe,fe=n+fe}function $r(o,t){let e=jo.get(o),n=ht.get(o);(e===void 0||n===void 0)&&T(!1,"reconcileNode: prevNode or nextNode does not exist in nodeMap");let r=Tu||Gl.has(o)||jl.has(o),i=Bn(De,o);if(e===n&&!r){if(E(e)){let s=i.__lexicalTextContent;s!==void 0&&(fe+=s,io+=s)}else{let s=e.getTextContent();io+=s,fe+=s}return i}if(e!==n&&r&&ki(Br,Pr,Ki,n,"updated"),n.updateDOM(e,i,Hn)){let s=zi(o,null,null);return t===null&&T(!1,"reconcileNode: parentDOM is null"),t.replaceChild(s,i),Ui(o,null),s}if(E(e)&&E(n))r&&(kN(e,n,i),!ne(n)&&!n.isInline()&&Cu(e,n,i)),kr(n)&&(fe+=ot,io+=ot);else{let s=n.getTextContent();if(H(n)){let l=n.decorate(De,Hn);l!==null&&bu(o,l)}fe+=s,io+=s}if(!Fi&&ne(n)&&n.__cachedText!==io){let s=n.getWritable();s.__cachedText=io,n=s}return __DEV__&&Object.freeze(n),i}function bu(o,t){let e=De._pendingDecorators,n=De._decorators;if(e===null){if(n[o]===t)return;e=Oi(De)}e[o]=t}function $N(o){return o.firstChild}function Xl(o){let t=o.nextSibling;return t!==null&&t===De._blockCursorElement&&(t=t.nextSibling),t}function PN(o,t,e,n,r,i){let s=n-1,l=r-1,a,d,u=$N(i),m=0,c=0;for(;m<=s&&c<=l;){let h=t[m],N=e[c];if(h===N)u=Xl($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=Xl(ta(h)),Ui(h,i),m++;else if(!S)zi(N,i,u),c++;else{let v=Bn(De,N);v===u?u=Xl($r(N,i)):(u!=null?i.insertBefore(v,u):i.appendChild(v),$r(N,i)),m++,c++}}let b=ht.get(N);b!==null&&L(b)&&(Lo===null&&(Lo=b.getFormat()),gt===""&&(gt=b.getStyle()))}let f=m>s,g=c>l;if(f&&!g){let h=e[l+1],N=h===void 0?null:De.getElementByKey(h);ea(e,o,c,l,i,N)}else g&&!f&&Ql(t,m,s,i)}function _u(o,t,e,n,r,i){fe="",io="",Tu=n===Qt,De=e,Hn=e._config,Pr=e._nodes,Ki=De._listeners.mutation,jl=r,Gl=i,jo=o._nodeMap,ht=t._nodeMap,Fi=t._readOnly,Jl=new Map(e._keyToDOMMap);let s=new Map;return Br=s,$r("root",null),De=void 0,Pr=void 0,jl=void 0,Gl=void 0,jo=void 0,ht=void 0,Hn=void 0,Jl=void 0,Br=void 0,s}function BN(o,t,e){let n=e._keyToDOMMap;t["__lexicalKey_"+e._key]=o,n.set(o,t)}function ta(o){let t=Jl.get(o);return t===void 0&&T(!1,"Reconciliation: could not find DOM element for node key %s",o),t}var so=Object.freeze({}),sa=30,oa=[["keydown",ZN],["pointerdown",FN],["compositionstart",qN],["compositionend",YN],["input",WN],["click",HN],["cut",so],["copy",so],["dragstart",so],["dragover",so],["dragend",so],["paste",so],["focus",so],["blur",so],["drop",so]];bo&&oa.push(["beforeinput",(o,t)=>zN(o,t)]);var Kr=0,wu=null,vu=0,Fn=null,Wi=new WeakMap,na=!1,ra=!1,Fr=!1,Hr=!1,Du=[0,"",0,"root",0];function Ou(o,t,e,n,r){let i=o.anchor,s=o.focus,l=i.getNode(),a=Q(),d=ve(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&&(!bo||vu1||(r||!bo)&&c!==null&&!l.isComposing()&&u!==Pn(c)||d!==null&&t!==null&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||l.getFormat()!==o.format||l.getStyle()!==o.style||Rc(o,l)}function yu(o,t){return o!==null&&o.nodeValue!==null&&o.nodeType===Ve&&t!==0&&t!==o.nodeValue.length}function Su(o,t,e){let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=o;na&&(na=!1,yu(n,r)&&yu(i,s))||Te(t,()=>{if(!e){Y(null);return}if(!eo(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=On(t).event,m=u?u.timeStamp:performance.now(),[c,f,g,h,N]=Du,b=F(),x=t.isComposing()===!1&&b.getTextContent()==="";if(m{let e=C(),n=ve(t._window),r=je();if(n){if(_(e)){let i=e.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&e.isCollapsed()&&!ne(s)&&F().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===_o||s===Ve){let l=Ur(r,n,t,o);Y(l)}}}}O(t,Wt,o)})}function FN(o,t){let e=o.target,n=o.pointerType;e instanceof Node&&n!=="touch"&&Te(t,()=>{wc(e)||(ra=!0)})}function Au(o){if(!o.getTargetRanges)return null;let t=o.getTargetRanges();return t.length===0?null:t[0]}function KN(o,t){return o!==t||E(o)||E(t)||!o.isToken()||!t.isToken()}function UN(o){return wu==="MediaLast"&&o{let r=C();if(e==="deleteContentBackward"){if(r===null){let u=je();if(!_(u))return;Y(u.clone())}if(_(r)){let u=r.anchor.key===r.focus.key;if(UN(o.timeStamp)&&t.isComposing()&&u){if(le(null),Kr=0,setTimeout(()=>{Te(t,()=>{le(null)})},sa),_(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;vl&&u&&!c||O(t,tt,!0)}return}}if(!_(r))return;let i=o.data;Fn!==null&&Ri(!1,t,Fn),(!r.dirty||Fn!==null)&&r.isCollapsed()&&!ne(r.anchor.getNode())&&n!==null&&r.applyDOMRange(n),Fn=null;let s=r.anchor,l=r.focus,a=s.getNode(),d=l.getNode();if(e==="insertText"||e==="insertTranspose"){if(i===` +`,mc=Ze?fc:Dn,pc="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",gc="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",mN=new RegExp("^[^"+gc+"]*["+pc+"]"),pN=new RegExp("^[^"+pc+"]*["+gc+"]"),$e={bold:br,code:yr,highlight:Mr,italic:_r,strikethrough:Mn,subscript:Sr,superscript:Lr,underline:wn},hc={directionless:Li,unmergeable:vn},Nc={normal:uc,segmented:Si,token:yi},xc={[uc]:"normal",[Si]:"segmented",[yi]:"token"};function T(o,t,...e){if(!o){for(let n of e)t=(t||"").replace("%s",n);throw new Error(t)}}function Rt(...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 gN=100,Rl=!1,kl=0;function Ec(){return Rl}function hN(o){kl=o.timeStamp}function NN(o){kl===0&&On(o).addEventListener("textInput",hN,!0)}function Al(o,t,e){return t.__lexicalLineBreak===o||o[`__lexicalKey_${e._key}`]!==void 0}function xN(o){return o.getEditorState().read(()=>{let t=C();return t!==null?t.clone():null})}function EN(o,t,e){let n=ve(e._window),r=null,i=null;n!==null&&n.anchorNode===o&&(r=n.anchorOffset,i=n.focusOffset);let s=o.nodeValue;s!==null&&wr(t,s,r,i,!1)}function TN(o,t,e){return t.nodeType===Ve&&e.isAttached()}function Tc(o,t,e){Rl=!0;let n=performance.now()-kl>gN;try{Te(o,()=>{let r=C()||xN(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{Tc(o,t,e)})}function Cc(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 bc(o,t){let e=o.mergeWithSibling(t),n=Q()._normalizedNodes;return n.add(o.__key),n.add(t.__key),e}function Pl(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(Cc(e,t)){t=bc(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(Cc(t,n)){t=bc(t,n);break}else break}function qo(o){return _c(o.anchor),_c(o.focus),o}function _c(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 CN=1;function bN(){return""+CN++}function Lc(o,t){let e=o._nodes.get(t);return e===void 0&&T(!1,"registeredNode: Type %s not found",t),e}var Mc=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function wc(o){return H(G(o))}function In(o){let t=document.activeElement;if(t===null)return!1;let e=t.nodeName;return H(G(o))&&(e==="INPUT"||e==="TEXTAREA"||t.contentEditable==="true"&&Yo(t)==null)}function eo(o,t,e){let n=o.getRootElement();try{return n!==null&&n.contains(t)&&n.contains(e)&&t!==null&&!In(t)&&Di(t)===o}catch{return!1}}function $n(o){return o instanceof ro}function Di(o){let t=o;for(;t!=null;){let e=Yo(t);if($n(e))return e;t=Ii(t)}return null}function Yo(o){return o?o.__lexicalEditor:null}function Xe(o){return o.isToken()||o.isSegmented()}function _N(o){return o.nodeType===Ve}function Pn(o){let t=o;for(;t!=null;){if(_N(t))return t;t=t.firstChild}return null}function Dr(o,t,e){let n=$e[t];if(e!==null&&(o&n)===(e&n))return o;let r=o^n;return t==="subscript"?r&=~$e.superscript:t==="superscript"&&(r&=~$e.subscript),r}function Or(o){return L(o)||Pe(o)||H(o)}function vc(o,t){if(t!=null){__DEV__&&yN(o,t),o.__key=t;return}ue(),Zl();let e=Q(),n=rt(),r=bN();n._nodeMap.set(r,o),E(o)?e._dirtyElements.set(r,!0):e._dirtyLeaves.add(r),e._cloneNotNeeded.add(r),e._dirtyType=Dl,o.__key=r}function yN(o,t){let e=gu();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 SN(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 to(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 vr(o){Zl();let t=o.getLatest(),e=t.__parent,n=rt(),r=Q(),i=n._nodeMap,s=r._dirtyElements;e!==null&&SN(e,i,s);let l=t.__key;r._dirtyType=Dl,E(o)?s.set(l,!0):r._dirtyLeaves.add(l)}function Dc(o){let t=o.getPreviousSibling(),e=o.getNextSibling();t!==null&&vr(t),e!==null&&vr(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 nt(){return pt()?null:Q()._compositionKey}function ee(o,t){let n=(t||rt())._nodeMap.get(o);return n===void 0?null:n}function Il(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=Il(e,t);if(n!==null)return n;e=Ii(e)}return null}function Oi(o){let t=o._decorators,e=Object.assign({},t);return o._pendingDecorators=e,e}function Hl(o){return o.read(()=>F().getTextContent())}function Oc(o,t){Te(o,()=>{let e=rt();if(e.isEmpty())return;if(t==="root"){F().markDirty();return}let n=e._nodeMap;for(let[,r]of n)r.markDirty()},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function F(){return $l(rt())}function $l(o){return o._nodeMap.get("root")}function Y(o){ue();let t=rt();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 Ac(){ue();let o=Q();Mi(o)}function Zo(o){let t=Q(),e=LN(o,t);if(e===null){let n=t.getRootElement();return o===n?ee("root"):null}return ee(e)}function Fl(o,t){return t?o.getTextContentSize():0}function LN(o,t){let e=o;for(;e!=null;){let n=e[`__lexicalKey_${t._key}`];if(n!==void 0)return n;e=Ii(e)}return null}function Ai(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function Ar(o){let t=[],e=o;for(;e!==null;)t.push(e),e=e._parentEditor;return t}function Kl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ul(o){return o.nodeType===Ve?o.nodeValue:null}function Ri(o,t,e){let n=ve(t._window);if(n===null)return;let r=n.anchorNode,{anchorOffset:i,focusOffset:s}=n;if(r!==null){let l=Ul(r),a=G(r);if(l!==null&&L(a)){if(l===Dn&&e){let d=e.length;l=e,i=d,s=d}l!==null&&wr(a,l,i,s,o)}}}function wr(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]===Dn&&(l=t.slice(0,-1));let a=i.getTextContent();if(r||l!==a){if(l===""){if(le(null),!Gt&&!Ot&&!Jt){let h=Q();setTimeout(()=>{h.update(()=>{i.isAttached()&&i.remove()})},20)}else i.remove();return}let d=i.getParent(),u=je(),m=i.getTextContentSize(),c=nt(),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=z(h);i.replace(N),i=N}i.setTextContent(l)}}}function MN(o){let t=o.getPreviousSibling();return(L(t)||E(t)&&t.isInline())&&!t.canInsertTextAfter()}function Rc(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||MN(t):e===t.getTextContentSize()?!t.canInsertTextAfter()||!n.canInsertTextAfter()&&!t.isComposing()||r:!1}function kc(o,t,e,n){return o==="Tab"&&!t&&!e&&!n}function Ic(o,t,e,n){return o.toLowerCase()==="b"&&!t&&Rr(e,n)}function $c(o,t,e,n){return o.toLowerCase()==="i"&&!t&&Rr(e,n)}function Pc(o,t,e,n){return o.toLowerCase()==="u"&&!t&&Rr(e,n)}function Bc(o,t){return lu(o)&&!t}function Hc(o,t){return lu(o)&&t}function Fc(o,t){return Ye&&t&&o.toLowerCase()==="o"}function Kc(o,t,e){return An(o)&&(Ye?t:e)}function Uc(o,t,e){return Rn(o)&&(Ye?t:e)}function zc(o,t){return Ye&&t&&An(o)}function Wc(o,t){return Ye&&t&&Rn(o)}function qc(o,t,e,n){return Ye?t||e?!1:An(o)||o.toLowerCase()==="h"&&n:n||t||e?!1:An(o)}function Yc(o,t,e,n,r){return Ye?e||n||r?!1:Rn(o)||o.toLowerCase()==="d"&&t:t||n||r?!1:Rn(o)}function Zc(o,t,e,n){return o.toLowerCase()==="z"&&!t&&Rr(e,n)}function Vc(o,t,e,n){return Ye?o.toLowerCase()==="z"&&e&&t:o.toLowerCase()==="y"&&n||o.toLowerCase()==="z"&&n&&t}function Xc(o,t,e,n){return t?!1:o.toLowerCase()==="c"?Ye?e:n:!1}function jc(o,t,e,n){return t?!1:o.toLowerCase()==="x"?Ye?e:n:!1}function Gc(o){return o==="ArrowLeft"}function Jc(o){return o==="ArrowRight"}function wN(o){return o==="ArrowUp"}function vN(o){return o==="ArrowDown"}function Qc(o,t,e,n){return Gc(o)&&!t&&!n&&!e}function eu(o,t,e,n,r){return Gc(o)&&!n&&!e&&(t||r)}function tu(o,t,e,n){return Jc(o)&&!t&&!n&&!e}function ou(o,t,e,n,r){return Jc(o)&&!n&&!e&&(t||r)}function nu(o,t,e){return wN(o)&&!t&&!e}function ru(o,t,e){return vN(o)&&!t&&!e}function iu(o,t,e,n){return o||t||e||n}function su(o){return o===" "}function Rr(o,t){return Ye?o:t}function lu(o){return o==="Enter"}function An(o){return o==="Backspace"}function au(o){return o==="Escape"}function Rn(o){return o==="Delete"}function du(o){return o==="@"}function zl(o,t,e){return o.toLowerCase()==="a"&&Rr(t,e)}function Wl(){let o=F(),t=o.select(0,o.getChildrenSize());Y(qo(t))}function yo(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=Rt(r);return e[t]=i,i}return r}function ki(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 yc(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 oo(o,t){let e=o.offset;if(o.type==="element"){let n=o.getNode();return yc(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?yc(n.getParentOrThrow(),t,n.getIndexWithinParent()+(t?0:1)):r}}return null}function vi(o){let t=On(o).event,e=t&&t.inputType;return e==="insertFromPaste"||e==="insertFromPasteAsQuotation"}function O(o,t,e){return Vl(o,t,e)}function kr(o){return!ne(o)&&!o.isLastChild()&&!o.isInline()}function Bn(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 Ii(o){let t=o.assignedSlot||o.parentElement;return t!==null&&t.nodeType===11?t.host:t}function cu(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=On(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=Ii(d)}}function uu(o){let t=C();if(!_(t)||!E(o))return t;let{anchor:e,focus:n}=t,r=e.getNode(),i=n.getNode();return kn(r,o)&&e.set(o.__key,0,"element"),kn(i,o)&&n.set(o.__key,0,"element"),t}function kn(o,t){let e=o.getParent();for(;e!==null;){if(e.is(t))return!0;e=e.getParent()}return!1}function fu(o){let t=o.ownerDocument;return t&&t.defaultView||null}function On(o){let t=o._window;return t===null&&T(!1,"window object not found"),t}function ql(o){let t=o.getParentOrThrow();for(;t!==null;){if(ge(t))return t;t=t.getParentOrThrow()}return t}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 $i(o,t){let e=o.getParent();ne(e)&&!E(t)&&!H(t)&&T(!1,"Only element or decorator nodes can be inserted in to the root node")}function DN(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=Rt(n);n=t.blockCursor=r}n!==void 0&&e.classList.add(...n)}return e}function Bl(o){return(H(o)||E(o)&&!o.canBeEmpty())&&!o.isInline()}function Ir(o,t,e){e.style.removeProperty("caret-color"),t._blockCursorElement=null;let n=o.parentElement;n!==null&&n.removeChild(o)}function mu(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);Bl(u)&&(a=!0)}else{let u=i.getChildAtIndex(s);if(Bl(u)){let m=u.getPreviousSibling();(m===null||Bl(m))&&(a=!0,d=o.getElementByKey(u.__key))}}if(a){let u=o.getElementByKey(i.__key);n===null&&(o._blockCursorElement=n=DN(o._config)),t.style.caretColor="transparent",d===null?u.appendChild(n):u.insertBefore(n,d);return}}n!==null&&Ir(n,o,t)}function ve(o){return pe?(o||window).getSelection():null}function Pi(o){return he(o)&&o.tagName==="A"}function he(o){return o.nodeType===1}function Vo(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 So(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 Xo(o){if(ne(o)||H(o)&&!o.isInline())return!0;if(!E(o)||ge(o))return!1;let t=o.getFirstChild(),e=t===null||Pe(t)||L(t)||t.isInline();return!o.isInline()&&o.canBeEmpty()!==!1&&e}function Bi(o,t){let e=o;for(;e!==null&&e.getParent()!==null&&!t(e);)e=e.getParentOrThrow();return t(e)?e:null}function Yl(){return Q()}var Sc=new WeakMap,ON=new Map;function pu(o){if(!o._readOnly&&o.isEmpty())return ON;T(o._readOnly,"getCachedTypeToNodeMap called with a writable EditorState");let t=Sc.get(o);if(!t){t=new Map,Sc.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 no(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 hu(o,t){let e=o._decorators,r=o._pendingDecorators||e,i=t._nodeMap,s;for(s in r)i.has(s)||(r===e&&(r=Oi(o)),delete r[s])}function Nu(o,t,e,n,r,i){let s=o.getFirstChild();for(;s!==null;){let l=s.__key;s.__parent===t&&(E(s)&&Nu(s,l,e,n,r,i),e.has(l)||i.delete(l),r.push(l)),s=s.getNextSibling()}}function xu(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)&&Nu(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="",Lo=null,gt="",io="",Hn,De,Pr,Tu=!1,Fi=!1,Ki,jl,Gl,jo,ht,Jl,Br;function Ui(o,t){let e=jo.get(o);if(t!==null){let n=ta(o);n.parentNode===t&&t.removeChild(n)}if(ht.has(o)||De._keyToDOMMap.delete(o),E(e)){let n=Hi(e,jo);Ql(n,0,n.length-1,null)}e!==void 0&&ki(Br,Pr,Ki,e,"destroyed")}function Ql(o,t,e,n){let r=t;for(;r<=e;++r){let i=o[r];i!==void 0&&Ui(i,n)}}function zi(o,t,e){let n=ht.get(o);n===void 0&&T(!1,"createNode: node does not exist in nodeMap");let r=n.createDOM(Hn,De);if(BN(o,r,De),L(n)?r.setAttribute("data-lexical-text","true"):H(n)&&r.setAttribute("data-lexical-decorator","true"),E(n)){let i=n.__size;if(i!==0){let s=i-1,l=Hi(n,ht);ea(l,n,0,s,r,null)}n.isInline()||Cu(null,n,r),kr(n)&&(fe+=ot,io+=ot)}else{let i=n.getTextContent();if(H(n)){let s=n.decorate(De,Hn);s!==null&&bu(o,s),r.contentEditable="false"}fe+=i,io+=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),ki(Br,Pr,Ki,n,"created"),r}function ea(o,t,e,n,r,i){let s=fe;fe="";let l=e;for(;l<=n;++l){zi(o[l],r,i);let a=ht.get(o[l]);a!==null&&L(a)&&(Lo===null&&(Lo=a.getFormat()),gt===""&&(gt=a.getStyle()))}kr(t)&&(fe+=ot),r.__lexicalTextContent=fe,fe=s+fe}function Eu(o,t){let e=t.get(o);return Pe(e)||H(e)&&e.isInline()}function Cu(o,t,e){let n=o!==null&&(o.__size===0||Eu(o.__last,jo)),r=t.__size===0||Eu(t.__last,ht);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 AN(o){Ge(o)&&Lo!=null&&!Fi&&o.setTextStyle(gt)}function RN(o){Ge(o)&>!==""&>!==o.__textStyle&&!Fi&&o.setTextStyle(gt)}function kN(o,t,e){Lo=null,gt="",IN(o,t,e),AN(t),RN(t)}function Hi(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 IN(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=ta(s),u=zi(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}Ui(s,null)}let a=ht.get(l);L(a)&&(Lo===null&&(Lo=a.getFormat()),gt===""&&(gt=a.getStyle()))}else{let s=Hi(o,jo),l=Hi(t,ht);if(r===0)i!==0&&ea(l,t,0,i-1,e,null);else if(i===0){if(r!==0){let d=e.__lexicalLineBreak==null;Ql(s,0,r-1,d?null:e),d&&(e.textContent="")}}else PN(t,s,l,r,i,e)}kr(t)&&(fe+=ot),e.__lexicalTextContent=fe,fe=n+fe}function $r(o,t){let e=jo.get(o),n=ht.get(o);(e===void 0||n===void 0)&&T(!1,"reconcileNode: prevNode or nextNode does not exist in nodeMap");let r=Tu||Gl.has(o)||jl.has(o),i=Bn(De,o);if(e===n&&!r){if(E(e)){let s=i.__lexicalTextContent;s!==void 0&&(fe+=s,io+=s)}else{let s=e.getTextContent();io+=s,fe+=s}return i}if(e!==n&&r&&ki(Br,Pr,Ki,n,"updated"),n.updateDOM(e,i,Hn)){let s=zi(o,null,null);return t===null&&T(!1,"reconcileNode: parentDOM is null"),t.replaceChild(s,i),Ui(o,null),s}if(E(e)&&E(n))r&&(kN(e,n,i),!ne(n)&&!n.isInline()&&Cu(e,n,i)),kr(n)&&(fe+=ot,io+=ot);else{let s=n.getTextContent();if(H(n)){let l=n.decorate(De,Hn);l!==null&&bu(o,l)}fe+=s,io+=s}if(!Fi&&ne(n)&&n.__cachedText!==io){let s=n.getWritable();s.__cachedText=io,n=s}return __DEV__&&Object.freeze(n),i}function bu(o,t){let e=De._pendingDecorators,n=De._decorators;if(e===null){if(n[o]===t)return;e=Oi(De)}e[o]=t}function $N(o){return o.firstChild}function Xl(o){let t=o.nextSibling;return t!==null&&t===De._blockCursorElement&&(t=t.nextSibling),t}function PN(o,t,e,n,r,i){let s=n-1,l=r-1,a,d,u=$N(i),m=0,c=0;for(;m<=s&&c<=l;){let h=t[m],N=e[c];if(h===N)u=Xl($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=Xl(ta(h)),Ui(h,i),m++;else if(!S)zi(N,i,u),c++;else{let v=Bn(De,N);v===u?u=Xl($r(N,i)):(u!=null?i.insertBefore(v,u):i.appendChild(v),$r(N,i)),m++,c++}}let b=ht.get(N);b!==null&&L(b)&&(Lo===null&&(Lo=b.getFormat()),gt===""&&(gt=b.getStyle()))}let f=m>s,g=c>l;if(f&&!g){let h=e[l+1],N=h===void 0?null:De.getElementByKey(h);ea(e,o,c,l,i,N)}else g&&!f&&Ql(t,m,s,i)}function _u(o,t,e,n,r,i){fe="",io="",Tu=n===Qt,De=e,Hn=e._config,Pr=e._nodes,Ki=De._listeners.mutation,jl=r,Gl=i,jo=o._nodeMap,ht=t._nodeMap,Fi=t._readOnly,Jl=new Map(e._keyToDOMMap);let s=new Map;return Br=s,$r("root",null),De=void 0,Pr=void 0,jl=void 0,Gl=void 0,jo=void 0,ht=void 0,Hn=void 0,Jl=void 0,Br=void 0,s}function BN(o,t,e){let n=e._keyToDOMMap;t["__lexicalKey_"+e._key]=o,n.set(o,t)}function ta(o){let t=Jl.get(o);return t===void 0&&T(!1,"Reconciliation: could not find DOM element for node key %s",o),t}var so=Object.freeze({}),sa=30,oa=[["keydown",ZN],["pointerdown",FN],["compositionstart",qN],["compositionend",YN],["input",WN],["click",HN],["cut",so],["copy",so],["dragstart",so],["dragover",so],["dragend",so],["paste",so],["focus",so],["blur",so],["drop",so]];bo&&oa.push(["beforeinput",(o,t)=>zN(o,t)]);var Kr=0,wu=null,vu=0,Fn=null,Wi=new WeakMap,na=!1,ra=!1,Fr=!1,Hr=!1,Du=[0,"",0,"root",0];function Ou(o,t,e,n,r){let i=o.anchor,s=o.focus,l=i.getNode(),a=Q(),d=ve(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&&(!bo||vu1||(r||!bo)&&c!==null&&!l.isComposing()&&u!==Pn(c)||d!==null&&t!==null&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||l.getFormat()!==o.format||l.getStyle()!==o.style||Rc(o,l)}function yu(o,t){return o!==null&&o.nodeValue!==null&&o.nodeType===Ve&&t!==0&&t!==o.nodeValue.length}function Su(o,t,e){let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=o;na&&(na=!1,yu(n,r)&&yu(i,s))||Te(t,()=>{if(!e){Y(null);return}if(!eo(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=On(t).event,m=u?u.timeStamp:performance.now(),[c,f,g,h,N]=Du,b=F(),x=t.isComposing()===!1&&b.getTextContent()==="";if(m{let e=C(),n=ve(t._window),r=je();if(n){if(_(e)){let i=e.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&e.isCollapsed()&&!ne(s)&&F().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===_o||s===Ve){let l=Ur(r,n,t,o);Y(l)}}}}O(t,Wt,o)})}function FN(o,t){let e=o.target,n=o.pointerType;e instanceof Node&&n!=="touch"&&Te(t,()=>{wc(e)||(ra=!0)})}function Au(o){if(!o.getTargetRanges)return null;let t=o.getTargetRanges();return t.length===0?null:t[0]}function KN(o,t){return o!==t||E(o)||E(t)||!o.isToken()||!t.isToken()}function UN(o){return wu==="MediaLast"&&o{let r=C();if(e==="deleteContentBackward"){if(r===null){let u=je();if(!_(u))return;Y(u.clone())}if(_(r)){let u=r.anchor.key===r.focus.key;if(UN(o.timeStamp)&&t.isComposing()&&u){if(le(null),Kr=0,setTimeout(()=>{Te(t,()=>{le(null)})},sa),_(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;vl&&u&&!c||O(t,tt,!0)}return}}if(!_(r))return;let i=o.data;Fn!==null&&Ri(!1,t,Fn),(!r.dirty||Fn!==null)&&r.isCollapsed()&&!ne(r.anchor.getNode())&&n!==null&&r.applyDOMRange(n),Fn=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,qt,!1);else if(i===ot)o.preventDefault(),O(t,Yt,void 0);else if(i==null&&o.dataTransfer){let u=o.dataTransfer.getData("text/plain");o.preventDefault(),r.insertRawText(u)}else i!=null&&Ou(r,n,i,o.timeStamp,!0)?(o.preventDefault(),O(t,ft,i)):Fn=i;vu=o.timeStamp;return}switch(o.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{O(t,ft,o);break}case"insertFromComposition":{le(null),O(t,ft,o);break}case"insertLineBreak":{le(null),O(t,qt,!1);break}case"insertParagraph":{le(null),Fr&&!Ot?(Fr=!1,O(t,qt,!1)):O(t,Yt,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{O(t,go,o);break}case"deleteByComposition":{KN(a,d)&&O(t,Sn,o);break}case"deleteByDrag":case"deleteByCut":{O(t,Sn,o);break}case"deleteContent":{O(t,tt,!1);break}case"deleteWordBackward":{O(t,Dt,!0);break}case"deleteWordForward":{O(t,Dt,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{O(t,mt,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{O(t,mt,!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,ho,void 0);break}case"historyRedo":{O(t,No,void 0);break}default:}})}function WN(o,t){o.stopPropagation(),Te(t,()=>{let e=C(),n=o.data,r=Au(o);if(n!=null&&_(e)&&Ou(e,r,n,o.timeStamp,!1)){Hr&&(ia(t,n),Hr=!1);let s=e.anchor.getNode(),l=ve(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;(!bo||e.isCollapsed()||!L(s)||l.anchorNode===null||s.getTextContent().slice(0,d)+n+s.getTextContent().slice(d+u)!==Ul(l.anchorNode))&&O(t,ft,n);let m=n.length;Ze&&m>1&&o.inputType==="insertCompositionText"&&!t.isComposing()&&(e.anchor.offset-=m),!Gt&&!Ot&&!Jt&&t.isComposing()&&(Kr=0,le(null))}else Ri(!1,t,n!==null?n:void 0),Hr&&(ia(t,n||void 0),Hr=!1);Ac()}),Fn=null}function qN(o,t){Te(t,()=>{let e=C();if(_(e)&&!t.isComposing()){let n=e.anchor,r=e.anchor.getNode();le(n.key),(o.timeStamp{ia(t,o.data)})}function ZN(o,t){if(Kr=o.timeStamp,wu=o.key,t.isComposing())return;let{key:e,shiftKey:n,ctrlKey:r,metaKey:i,altKey:s}=o;if(!O(t,El,o)&&e!=null){if(tu(e,r,s,i))O(t,Fo,o);else if(ou(e,r,n,s,i))O(t,Tl,o);else if(Qc(e,r,s,i))O(t,Ko,o);else if(eu(e,r,n,s,i))O(t,Cl,o);else if(nu(e,r,i))O(t,Zt,o);else if(ru(e,r,i))O(t,Vt,o);else if(Hc(e,n))Fr=!0,O(t,we,o);else if(su(e))O(t,xr,o);else if(Fc(e,r))o.preventDefault(),Fr=!0,O(t,qt,!0);else if(Bc(e,n))Fr=!1,O(t,we,o);else if(qc(e,s,i,r))An(e)?O(t,Xt,o):(o.preventDefault(),O(t,tt,!0));else if(au(e))O(t,Uo,o);else if(Yc(e,r,n,s,i))Rn(e)?O(t,jt,o):(o.preventDefault(),O(t,tt,!1));else if(Kc(e,s,r))o.preventDefault(),O(t,Dt,!0);else if(Uc(e,s,r))o.preventDefault(),O(t,Dt,!1);else if(zc(e,i))o.preventDefault(),O(t,mt,!0);else if(Wc(e,i))o.preventDefault(),O(t,mt,!1);else if(du(e))O(t,_i,o);else if(Ic(e,s,i,r))o.preventDefault(),O(t,Ee,"bold");else if(Pc(e,s,i,r))o.preventDefault(),O(t,Ee,"underline");else if($c(e,s,i,r))o.preventDefault(),O(t,Ee,"italic");else if(kc(e,s,r,i))O(t,zo,o);else if(Zc(e,n,i,r))o.preventDefault(),O(t,ho,void 0);else if(Vc(e,n,i,r))o.preventDefault(),O(t,No,void 0);else{let l=t._editorState._selection;Oe(l)?Xc(e,n,i,r)?(o.preventDefault(),O(t,xo,o)):jc(e,n,i,r)?(o.preventDefault(),O(t,Eo,o)):zl(e,i,r)&&(o.preventDefault(),O(t,Ln,o)):!Ze&&zl(e,i,r)&&(o.preventDefault(),O(t,Ln,o))}iu(r,n,s,i)&&O(t,Ml,o)}}function Ru(o){let t=o.__lexicalEventHandles;return t===void 0&&(t=[],o.__lexicalEventHandles=t),t}var Kn=new Map;function ku(o){let t=o.target,e=t==null?null:t.nodeType===9?t.defaultView:t.ownerDocument.defaultView,n=ve(e);if(n===null)return;let r=Di(n.anchorNode);if(r===null)return;ra&&(ra=!1,Te(r,()=>{let u=je(),m=n.anchorNode;if(m===null)return;let c=m.nodeType;if(c!==_o&&c!==Ve)return;let f=Ur(u,n,r,o);Y(f)}));let i=Ar(r),s=i[i.length-1],l=s._key,a=Kn.get(l),d=a||s;d!==r&&Su(n,d,!1),Su(n,r,!0),r!==s?Kn.set(l,r):a&&Kn.delete(l)}function Lu(o){o._lexicalHandled=!0}function Mu(o){return o._lexicalHandled===!0}function Iu(o,t){let e=o.ownerDocument,n=Wi.get(e);(n===void 0||n<1)&&e.addEventListener("selectionchange",ku),Wi.set(e,(n||0)+1),o.__lexicalEditor=t;let r=Ru(o);for(let i=0;i{Mu(d)||(Lu(d),(t.isEditable()||s==="click")&&l(d,t))}:d=>{if(Mu(d))return;Lu(d);let u=t.isEditable();switch(s){case"cut":return u&&O(t,Eo,d);case"copy":return O(t,xo,d);case"paste":return u&&O(t,go,d);case"dragstart":return u&&O(t,Er,d);case"dragover":return u&&O(t,Tr,d);case"dragend":return u&&O(t,_l,d);case"focus":return u&&O(t,Cr,d);case"blur":return u&&O(t,Ll,d);case"drop":return u&&O(t,Wo,d)}};o.addEventListener(s,a),r.push(()=>{o.removeEventListener(s,a)})}}function $u(o){let t=o.ownerDocument,e=Wi.get(t);T(e!==void 0,"Root element not registered");let n=e-1;T(n>=0,"Root element count less than 0"),Wi.set(t,n),n===0&&t.removeEventListener("selectionchange",ku);let r=Yo(o);$n(r)?(VN(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=Ru(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(H(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&&H(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&&aa(h,l),N.key===i&&aa(N,l)}return nt()===i&&le(s),l}insertAfter(t,e=!0){ue(),$i(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(to(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();Un(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(),$i(this,t);let n=this.getWritable(),r=t.getWritable(),i=r.__key;to(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();Un(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(Nt,"importDOM");function XN(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 Hu(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 Go=class o extends Nt{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=>GN(t)||JN(t)?null:{conversion:jN,priority:0}}}static importJSON(t){return xt()}exportJSON(){return{type:"linebreak",version:1}}};function jN(o){return{node:xt()}}function xt(){return re(new Go)}function Pe(o){return o instanceof Go}function GN(o){let t=o.parentElement;if(t!==null&&So(t)){let e=t.firstChild;if(e===o||e.nextSibling===o&&qi(e)){let n=t.lastChild;if(n===o||n.previousSibling===o&&qi(n))return!0}}return!1}function JN(o){let t=o.parentElement;if(t!==null&&So(t)){let e=t.firstChild;if(e===o||e.nextSibling===o&&qi(e))return!1;let n=t.lastChild;if(n===o||n.previousSibling===o&&qi(n))return!0}return!1}function qi(o){return o.nodeType===Ve&&/^( |\t|\r?\n)+$/.test(o.textContent||"")}function da(o,t){return t&yr?"code":t&Mr?"mark":t&Sr?"sub":t&Lr?"sup":null}function ca(o,t){return t&br?"strong":t&_r?"em":"span"}function zu(o,t,e,n,r){let i=n.classList,s=yo(r,"base");s!==void 0&&i.add(...s),s=yo(r,"underlineStrikethrough");let l=!1,a=t&wn&&t&Mn,d=e&wn&&e&Mn;s!==void 0&&(d?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(let u in $e){let c=$e[u];if(s=yo(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 QN(o,t){let e=o.length,n=t.length,r=0,i=0;for(;r({conversion:rx,priority:0}),b:()=>({conversion:tx,priority:0}),code:()=>({conversion:Mo,priority:0}),em:()=>({conversion:Mo,priority:0}),i:()=>({conversion:Mo,priority:0}),s:()=>({conversion:Mo,priority:0}),span:()=>({conversion:ex,priority:0}),strong:()=>({conversion:Mo,priority:0}),sub:()=>({conversion:Mo,priority:0}),sup:()=>({conversion:Mo,priority:0}),u:()=>({conversion:Mo,priority:0})}}static importJSON(e){let n=z(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=Yi(n,"strong")),this.hasFormat("italic")&&(n=Yi(n,"em")),this.hasFormat("strikethrough")&&(n=Yi(n,"s")),this.hasFormat("underline")&&(n=Yi(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"?$e[e]:e,n}setDetail(e){let n=this.getWritable();return n.__detail=typeof e=="string"?hc[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){let n=this.getFormat(),r=Dr(n,e,null);return this.setFormat(r)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=Li,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=vn,e}setMode(e){let n=Nc[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=nt();(d===s.anchor.key||d===s.focus.key)&&le(a),s.setTextNodeRange(this,r,this,i)}else return Zi(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=nt(),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),We.key===i&&We.type==="text"&&We.offset>M&&We.offset<=Z&&(We.key=k,We.offset-=M,S.dirty=!0)}s===i&&le(k),M=Z,v.push(B)}if(f!==null){Dc(this);let R=f.getWritable(),A=this.getIndexWithinParent();x?(R.splice(A,0,v),this.remove()):R.splice(A,1,v),_(S)&&Un(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;nt()===i&&le(r);let d=C();if(_(d)){let f=d.anchor,g=d.focus;f!==null&&f.key===i&&(ua(f,n,r,e,l),d.dirty=!0),g!==null&&g.key===i&&(ua(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 ex(o){let e=o.style;return{forChild:fa(e),node:null}}function tx(o){let t=o,e=t.style.fontWeight==="normal";return{forChild:fa(t.style,e?void 0:"bold"),node:null}}var Ku=new WeakMap;function ox(o){return o.nodeName==="PRE"||o.nodeType===_o&&o.style!==void 0&&o.style.whiteSpace!==void 0&&o.style.whiteSpace.startsWith("pre")}function nx(o){let t,e=o.parentNode,n=[o];for(;e!==null&&(t=Ku.get(e))===void 0&&!ox(e);)n.push(e),e=e.parentNode;let r=t===void 0?e:t;for(let i=0;i{throw TypeError(o)};var aN=(o,t,e)=>t in `||s===`\r `?n.push(xt()):s===" "?n.push(kt()):n.push(z(s))}this.insertNodes(n)}insertText(t){let e=this.anchor,n=this.focus,r=this.format,i=this.style,s=e,l=n;!this.isCollapsed()&&n.isBefore(e)&&(s=n,l=e),s.type==="element"&&gx(s,l,r,i);let a=s.offset,d=l.offset,u=this.getNodes(),m=u.length,c=u[0];L(c)||T(!1,"insertText: first node is not a text node");let g=c.getTextContent().length,h=c.getParentOrThrow(),N=m-1,b=u[N];if(m===1&&l.type==="element"&&(d=g,l.set(s.key,d,"text")),this.isCollapsed()&&a===g&&(c.isSegmented()||c.isToken()||!c.canInsertTextAfter()||!h.canInsertTextAfter()&&c.getNextSibling()===null)){let x=c.getNextSibling();if((!L(x)||!x.canInsertTextBefore()||Xe(x))&&(x=z(),x.setFormat(r),x.setStyle(i),h.canInsertTextAfter()?c.insertAfter(x):h.insertAfter(x)),x.select(0,0),c=x,t!==""){this.insertText(t);return}}else if(this.isCollapsed()&&a===0&&(c.isSegmented()||c.isToken()||!c.canInsertTextBefore()||!h.canInsertTextBefore()&&c.getPreviousSibling()===null)){let x=c.getPreviousSibling();if((!L(x)||Xe(x))&&(x=z(),x.setFormat(r),h.canInsertTextBefore()?c.insertBefore(x):h.insertBefore(x)),x.select(),c=x,t!==""){this.insertText(t);return}}else if(c.isSegmented()&&a!==g){let x=z(c.getTextContent());x.setFormat(r),c.replace(x),c=x}else if(!this.isCollapsed()&&t!==""){let x=b.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||E(x)&&(!x.canInsertTextBefore()||!x.canInsertTextAfter())){this.insertText(""),Cf(this.anchor,this.focus,null),this.insertText(t);return}}if(m===1){if(c.isToken()){let M=z(t);M.select(),c.replace(M);return}let x=c.getFormat(),S=c.getStyle();if(a===d&&(x!==r||S!==i))if(c.getTextContent()==="")c.setFormat(r),c.setStyle(i);else{let M=z(t);if(M.setFormat(r),M.setStyle(i),M.select(),a===0)c.insertBefore(M,!1);else{let[R]=c.splitText(a);R.insertAfter(M,!1)}M.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);return}else if(ma(c)){let M=z(t);M.setFormat(r),M.setStyle(i),M.select(),c.replace(M);return}let v=d-a;c=c.spliceText(a,v,t,!0),c.getTextContent()===""?c.remove():this.anchor.type==="text"&&(c.isComposing()?this.anchor.offset-=t.length:(this.format=x,this.style=S))}else{let x=new Set([...c.getParentKeys(),...b.getParentKeys()]),S=E(c)?c:c.getParentOrThrow(),v=E(b)?b:b.getParentOrThrow(),M=b;if(!S.is(v)&&v.isInline())do M=v,v=v.getParentOrThrow();while(v.isInline());if(l.type==="text"&&(d!==0||b.getTextContent()==="")||l.type==="element"&&b.getIndexWithinParent()=0;k--){let Z=R[k];if(Z.is(c)||E(Z)&&Z.isParentOf(c))break;Z.isAttached()&&(!A.has(Z)||Z.is(M)?P||B.insertAfter(Z,!1):Z.remove())}if(!P){let k=v,Z=null;for(;k!==null;){let se=k.getChildren(),We=se.length;(We===0||se[We-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=z(t);k.select(),c.replace(k)}for(let k=1;k0&&(N!==h.getTextContentSize()&&!Xe(h)&&([h]=h.splitText(N)),h.setFormat(b));for(let x=u+1;x(E(N)||H(N))&&!N.isInline();if(!t.some(i)){T(E(n),"Expected 'firstBlock' to be an ElementNode");let N=ya(this);n.splice(N,0,t),r.selectEnd();return}let s=Cx(t),l=s.getLastDescendant(),a=s.getChildren(),d=N=>E(N)&&Xo(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&&Hu(n,f);let g=Bi(l,Xo);m&&E(g)&&(m.canMergeWhenEmpty()||Xo(c))&&(g.append(...m.getChildren()),m.remove()),E(n)&&n.isEmpty()&&n.remove(),l.selectEnd();let h=E(n)?n.getLastChild():null;Pe(h)&&g!==n&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){let s=I();return F().splice(this.anchor.offset,0,[s]),s.select(),s}let t=ya(this),e=Bi(this.anchor.getNode(),Xo);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=xt();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]=Wr(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=oo(r,e);if(H(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){let f=nn();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=ve(a._window);if(!d)return;let u=a._blockCursorElement,m=a._rootElement;if(m!==null&&u!==null&&E(l)&&!l.isInline()&&!l.canBeEmpty()&&Ir(u,a,m),Nx(d,t,e?"backward":"forward",n),d.rangeCount>0){let c=d.getRangeAt(0),f=this.anchor.getNode(),g=ne(f)?f:ql(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)&&hx(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=oo(i,t);if(H(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&E(r)&&r.getChildrenSize()===0){r.remove();let l=nn();l.add(s.__key),Y(l)}else s.remove(),Q().dispatchCommand(_e,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){Nf(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){Nf(r,t,a);return}}xx(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 Oe(o){return o instanceof os}function hf(o){let t=o.offset;if(o.type==="text")return t;let e=o.getNode();return t===e.getChildrenSize()?e.getTextContent().length:0}function Wr(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]:[hf(e),hf(n)]}function hx(o){let t=o.focus,e=o.anchor,n=e.key,r=e.offset,i=e.type;vo(e,t.key,t.offset,t.type),vo(t,n,r,i),o._cachedNodes=null}function Nx(o,t,e,n){o.modify(t,e,n)}function xx(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 Ex(o,t,e){let n=o.getParent();return e===null||n===null||!n.canBeEmpty()||n!==e.getNode()}function xf(o,t,e,n){let r=t,i;if(o.nodeType===_o){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=Zo(u),L(i))r=Fl(i,s);else{let c=Zo(o);if(c===null)return null;if(E(c)){r=Math.min(c.getChildrenSize(),r);let f=c.getChildAtIndex(r);if(E(f)&&Ex(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=Fl(f,s)):f!==c&&s&&!m&&r++}else{let f=c.getIndexWithinParent();t===0&&H(c)&&Zo(o)===c?r=f:r=f+1,c=c.getParentOrThrow()}if(E(c))return He(c.__key,r,"element")}}else i=Zo(o);return L(i)?He(i.__key,r,"text"):null}function Ef(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 Cf(o,t,e){if(o.type==="text"&&t.type==="text"){let n=o.isBefore(t),r=o.is(t);Ef(o,n,r),Ef(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;vo(o,s.key,s.offset,s.type),vo(t,l.key,l.offset,l.type)}}}function bf(o,t,e,n,r,i){if(o===null||e===null||!eo(r,o,e))return null;let s=xf(o,t,_(i)?i.anchor:null,r);if(s===null)return null;let l=xf(e,n,_(i)?i.focus:null,r);if(l===null)return null;if(s.type==="element"&&l.type==="element"){let a=Zo(o),d=Zo(e);if(H(a)&&H(d))return null}return Cf(s,l,i),[s,l]}function It(o){return E(o)&&!o.isInline()}function Zi(o,t,e,n,r,i){let s=rt(),l=new Do(He(o,t,r),He(e,n,i),0,"");return l.dirty=!0,s._selection=l,l}function on(){let o=He("root",0,"element"),t=He("root",0,"element");return new Do(o,t,0,"")}function nn(){return new os(new Set)}function _f(o){let e=o.getEditorState()._selection,n=ve(o._window);return _(e)||e==null?Ur(e,n,o,null):e.clone()}function La(o,t){return Ur(null,o,t,null)}function Ur(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=!Ec()&&(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)&&!eo(e,d,u))return o.clone()}else return o.clone();let f=bf(d,m,u,c,e,o);if(f===null)return null;let[g,h]=f;return new Do(g,h,_(o)?o.format:0,_(o)?o.style:"")}function C(){return rt()._selection}function je(){return Q()._editorState._selection}function Un(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 yf(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 zn(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 ua(o,t,e,n,r){o.type==="text"?(o.key=e,t||(o.offset+=r)):o.offset>n.getIndexWithinParent()&&(o.offset-=1)}function Sf(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&&In(m))return;if(!_(t)){if(m!==null&&n.isCollapsed&&a instanceof Node){let k=G(a);if(H(k)){n.removeAllRanges(),Be(k);return}}o!==null&&eo(e,l,a)&&n.removeAllRanges();return}let c=t.anchor,f=t.focus,g=c.key,h=f.key,N=Bn(e,g),b=Bn(e,h),x=c.offset,S=f.offset,v=t.format,M=t.style,R=t.isCollapsed(),A=N,P=b,B=!1;if(c.type==="text"){A=Pn(N);let k=c.getNode();B=k.getFormat()!==v||k.getStyle()!==M}else _(o)&&o.anchor.type==="text"&&(B=!0);if(f.type==="text"&&(P=Pn(b)),!(A===null||P===null)&&(R&&(o===null||B||_(o)&&(o.format!==v||o.style!==M))&&Bu(v,M,x,g,performance.now()),!(d===x&&u===S&&l===A&&a===P&&!(n.type==="Range"&&R)&&((m===null||!i.contains(m))&&i.focus({preventScroll:!0}),c.type!=="element")))){try{n.setBaseAndExtent(A,x,P,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 Do&&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();cu(e,Z,i)}}Pu()}}function Ce(o){let t=C()||je();t===null&&(t=F().selectEnd()),t.insertNodes(o)}function ya(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(;!Xo(r);)[r,i]=Tx(r,i);return i}function Tx(o,t){let e=o.getParent();if(!e){let r=I();return F().append(r),r.select(),[F(),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 Do(He(o.__key,t,"element"),He(o.__key,t,"element"),0,""),i=o.insertNewAfter(r);i&&i.append(n,...n.getNextSiblings())}return[e,o.getIndexWithinParent()+1]}function Cx(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 rt(){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",Df()),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",Df()),Ne}function Df(){let o=0,t=new Set,e=ro.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let i=Yo(r);if($n(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 Of(){return Ne}function gu(){return me}function Mf(o,t,e){let n=t.__type,r=Lc(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()&&Pl(c),c!==void 0&&wf(c,i)&&Mf(t,c,s),e.add(m)}if(l=t._dirtyLeaves,a=l.size,a>0){ns++;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&&wf(g,i)&&Mf(t,g,s),n.set(c,f)}l=t._dirtyLeaves,a=l.size,d=t._dirtyElements,u=d.size,ns++}t._dirtyLeaves=e,t._dirtyElements=n}function wa(o){return va(o,Q()._nodes)}function va(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 Bt(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!==At,d=me,u=Fe,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,Fe=!1,o._updating=!0;try{let A=o._dirtyType,P=o._dirtyElements,B=o._dirtyLeaves;f.disconnect(),g=_u(i,e,o,A,P,B)}catch(A){if(A instanceof Error&&o._onError(A),!Ma)Oa(o,null,n,e),wi(o),o._dirtyType=Qt,Ma=!0,Bt(o,i),Ma=!1;else throw A;return}finally{f.observe(n,Lf),o._updating=c,me=d,Fe=u,Ne=m}}e._readOnly||(e._readOnly=!0,__DEV__&&(Rf(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=At,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set),hu(o,e);let M=r?null:ve(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&&Ir(A,o,n),Sf(s,l,o,M,x,n,v)}mu(o,n,l),f!==null&&f.observe(n,Lf)}finally{Ne=m,me=d}}g!==null&&Sx(o,g,x,h,i),!_(l)&&l!==null&&(s===null||!s.is(l))&&o.dispatchCommand(_e,void 0);let R=o._pendingDecorators;R!==null&&(o._decorators=R,o._pendingDecorators=null,Xn("decorator",o,!0,R)),yx(o,t||i,e),Xn("update",o,!0,{dirtyElements:N,dirtyLeaves:h,editorState:e,normalizedNodes:b,prevEditorState:t||i,tags:x}),Mx(o,S),Lx(o)}function yx(o,t,e){let n=Hl(t),r=Hl(e);n!==r&&Xn("textcontent",o,!0,r)}function Sx(o,t,e,n,r){let i=Array.from(o._listeners.mutation),s=i.length;for(let l=0;l{r=Vl(o,t,e)}),r}let n=Ar(o);for(let r=4;r>=0;r--)for(let i=0;i{Bt(o)}):(d._flushSync=!1,u&&(n.clear(),o._deferred=[],o._pendingEditorState=null))}function Te(o,t,e){o._updating?o._updates.push([t,e]):kf(o,t,e)}var X=class extends Nt{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:Hf(F())}))}};var wo=class extends X{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}};var Ff=["left","right","center","justify"];function Xr(o){let t=o.style.textAlign||"";return Ff.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 wx(o){let t=o.style.paddingLeft||"0";return Qo(t)}function jr(o){let t=(o.dir||"").toLowerCase();return t==="rtl"||t==="ltr"?t:null}function at(o,t){o.id&&t.setId(o.id),t.setAlignment(Xr(o)),t.setInset(wx(o)),t.setDirection(jr(o))}function Oo(o,t){return o.__id!==t.__id||o.__alignment!==t.__alignment||o.__inset!==t.__inset||o.__dir!==t.__dir}function Kf(o,t,e){if(o.__id!==t.__id&&e.setAttribute("id",t.__id),o.__alignment!==t.__alignment){for(let n of Ff)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 dt(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 ct(o,t){t.setId(o.id),t.setAlignment(o.alignment),t.setInset(o.inset),t.setDirection(o.direction)}var Ht=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 Ao(o,t){t.__alignment=o.__alignment,t.__inset=o.__inset}var it=class o extends Ht{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=$e[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,Ao(e,this)}createDOM(e){let n=document.createElement("p"),r=yo(e.theme,"paragraph");return r!==void 0&&n.classList.add(...r),dt(n,this),n}updateDOM(e,n,r){return Oo(e,this)}static importDOM(){return{p:e=>({conversion:vx,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 ct(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 vx(o){let t=I();return at(o,t),{node:t}}function I(){return re(new it)}function Ge(o){return o instanceof it}var Dx=!0,J=0,Ae=1,lo=2,Je=3,Ke=4;function Oa(o,t,e,n){let r=o._keyToDOMMap;r.clear(),o._editorState=Vr(),o._pendingEditorState=n,o._compositionKey=null,o._dirtyType=At,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 Ox(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 Gr(o){let t=o||{},e=Of(),n=t.theme||{},r=o===void 0?e:t.parentEditor||null,i=t.disableEvents||!1,s=Vr(),l=t.namespace||(r!==null?r._config.namespace:Kl()),a=t.editorState,d=[rn,st,Go,Jo,it,wo,...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`),P instanceof lt&&(P.hasOwnProperty("decorate")||console.warn(`${P.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`),P.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 ro(s,r,f,{disableEvents:i,namespace:l,theme:n},u||console.error,Ox(f,m?m.import:void 0),c);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=Qt),g}var ro=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");p(this,"_context");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=At,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=Kl(),this._onError=i,this._htmlConversions=s,this._editable=l,this._headless=e!==null&&e._headless,this._window=null,this._blockCursorElement=null,this._context=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?Dx: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=pu(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 Oc(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=yo(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,Oa(this,e,t,r),e!==null&&(this._config.disableEvents||$u(e),n!=null&&e.classList.remove(...n)),t!==null){let i=fu(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=Qt,wi(this),this._updateTags.add("history-merge"),Bt(this),this._config.disableEvents||Iu(t,this),n!=null&&t.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;Xn("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."),Mi(this);let n=this._pendingEditorState,r=this._updateTags,i=e!==void 0?e.tag:null;n!==null&&!n.isEmpty()&&(i!=null&&r.add(i),Bt(this)),this._pendingEditorState=t,this._dirtyType=Qt,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&r.add(i),Bt(this)}parseEditorState(t,e){let n=typeof t=="string"?JSON.parse(t):t;return Af(n,this,e)}read(t){return Bt(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=F();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(){Bt(this)}blur(){let t=this._rootElement;t!==null&&t.blur();let e=ve(this._window);e!==null&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,Xn("editable",this,!0,t))}setUiContext(t){this._context=t}getUiContext(){return this._context}toJSON(){return{editorState:this._editorState.toJSON()}}};p(ro,"version");ro.version="0.17.1";var is=0,Aa=1,Ra=2,_t=0,Ax=1,Uf=2,Rx=3,kx=4;function Ix(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 $x(o,t,e,n,r){if(o===null||e.size===0&&n.size===0&&!r)return _t;let i=t._selection,s=o._selection;if(r)return Ax;if(!_(i)||!_(s)||!s.isCollapsed()||!i.isCollapsed())return _t;let l=Ix(t,e,n);if(l.length===0)return _t;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?Uf:_t}let a=l[0],d=o._nodeMap.get(a.__key);if(!L(d)||!L(a)||d.__mode!==a.__mode)return _t;let u=d.__text,m=a.__text;if(u===m)return _t;let c=i.anchor,f=s.anchor;if(c.key!==f.key||c.type!=="text")return _t;let g=c.offset,h=f.offset,N=m.length-u.length;return N===1&&h===g-1?Uf:N===-1&&h===g+1?Rx:N===-1&&h===g?kx:_t}function Px(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 Bx(o,t){let e=Date.now(),n=_t;return(r,i,s,l,a,d)=>{let u=Date.now();if(d.has("historic"))return n=_t,e=u,Ra;let m=$x(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 is;if(r===null)return Aa;let N=i._selection;if(!(l.size>0||a.size>0))return N!==null?is:Ra;if(g===!1&&m!==_t&&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===Aa)c.length!==0&&(t.redoStack=[],o.dispatchCommand(To,!1)),m!==null&&(f.push({...m}),o.dispatchCommand(Co,!0));else if(h===Ra)return;t.current={editor:o,editorState:s}};return Et(o.registerCommand(ho,()=>(Fx(o,t),!0),J),o.registerCommand(No,()=>(Hx(o,t),!0),J),o.registerCommand(yl,()=>(zf(t),!1),J),o.registerCommand(Sl,()=>(zf(t),o.dispatchCommand(To,!1),o.dispatchCommand(Co,!1),!0),J),o.registerUpdateListener(r))}function ls(){return{current:null,redoStack:[],undoStack:[]}}var qf=o=>pe?(o||window).getSelection():null;function Yf(o,t=C()){return t==null&&T(!1,"Expected valid LexicalSelection"),_(t)&&t.isCollapsed()||t.getNodes().length===0?"":Qi(o,t)}function Zf(o,t=C()){return t==null&&T(!1,"Expected valid LexicalSelection"),_(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(Xf(o,t))}function as(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=jf(s.nodes);return ka(e,l,t)}}catch{}let r=o.getData("text/html");if(r)try{let l=new DOMParser().parseFromString(r,"text/html"),a=Ji(e,l);return ka(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(Wf(o,t,e))})});let n=o.getRootElement(),r=o._window==null?window.document:o._window.document,i=qf(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(xo,m=>(Tt(m,ClipboardEvent)&&(u(),jn!==null&&(window.clearTimeout(jn),jn=null),a(Wf(o,m,e))),!0),Ke);jn=window.setTimeout(()=>{u(),jn=null,a(!1)},Ux),r.execCommand("copy"),s.remove()})}function Wf(o,t,e){if(e===void 0){let r=qf(o._window);if(!r)return!1;let i=r.anchorNode,s=r.focusNode;if(i!==null&&s!==null&&!eo(o,i,s))return!1;let l=C();if(l===null)return!1;e=ds(l)}t.preventDefault();let n=t.clipboardData;return n===null?!1:(Gf(n,e),!0)}var zx=[["text/html",Yf],["application/x-lexical-editor",Zf]];function ds(o=C()){let t={"text/plain":o?o.getTextContent():""};if(o){let e=Yl();for(let[n,r]of zx){let i=r(e,o);i!==null&&(t[n]=i)}}return t}function Gf(o,t){for(let e in t){let n=t[e];n!==void 0&&o.setData(e,n)}}function cs(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 Jf=$("DRAG_DROP_PASTE_FILE");function Wx(o,t){o.preventDefault(),t.update(()=>{let e=C(),n=Tt(o,InputEvent)||Tt(o,KeyboardEvent)?null:o.clipboardData;n!=null&&e!==null&&as(n,e,t)},{tag:"paste"})}async function qx(o,t){await Gn(t,Tt(o,ClipboardEvent)?o:null),t.update(()=>{let e=C();_(e)?e.removeText():Oe(e)&&e.getNodes().forEach(n=>n.remove())})}function us(o){let t=null;if(Tt(o,DragEvent)?t=o.dataTransfer:Tt(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 fs(o){let t=G(o);return H(t)}function Yx(o){let t=o.focus;return t.key==="root"&&t.offset===F().getChildrenSize()}function ms(o){return Et(o.registerCommand(Wt,e=>{let n=C();return Oe(n)?(n.clear(),!0):!1},0),o.registerCommand(tt,e=>{let n=C();return _(n)?(n.deleteCharacter(e),!0):!1},J),o.registerCommand(Dt,e=>{let n=C();return _(n)?(n.deleteWord(e),!0):!1},J),o.registerCommand(mt,e=>{let n=C();return _(n)?(n.deleteLine(e),!0):!1},J),o.registerCommand(ft,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)as(r,n,o);else if(_(n)){let i=e.data;return i&&n.insertText(i),!0}}return!0},J),o.registerCommand(Sn,()=>{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(qt,e=>{let n=C();return _(n)?(n.insertLineBreak(e),!0):!1},J),o.registerCommand(Yt,()=>{let e=C();return _(e)?(e.insertParagraph(),!0):!1},J),o.registerCommand(bl,()=>(Ce([kt()]),!0),J),o.registerCommand(Zt,e=>{let n=C();if(Oe(n)&&!fs(e.target)){let r=n.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(_(n)){let r=oo(n.focus,!0);if(!e.shiftKey&&H(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},J),o.registerCommand(Vt,e=>{let n=C();if(Oe(n)){let r=n.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(_(n)){if(Yx(n))return e.preventDefault(),!0;let r=oo(n.focus,!1);if(!e.shiftKey&&H(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},J),o.registerCommand(Ko,e=>{let n=C();if(Oe(n)){let r=n.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!_(n))return!1;if(Xi(n,!0)){let r=e.shiftKey;return e.preventDefault(),ji(n,r,!0),!0}return!1},J),o.registerCommand(Fo,e=>{let n=C();if(Oe(n)&&!fs(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 Xi(n,!1)?(e.preventDefault(),ji(n,r,!1),!0):!1},J),o.registerCommand(Xt,e=>{if(fs(e.target))return!1;let n=C();return _(n)?(e.preventDefault(),o.dispatchCommand(tt,!0)):!1},J),o.registerCommand(jt,e=>{if(fs(e.target))return!1;let n=C();return _(n)?(e.preventDefault(),o.dispatchCommand(tt,!1)):!1},J),o.registerCommand(we,e=>{let n=C();if(!_(n))return!1;if(e!==null){if((Ot||Gt||Jt)&&bo)return!1;if(e.preventDefault(),e.shiftKey)return o.dispatchCommand(qt,!1)}return o.dispatchCommand(Yt,void 0)},J),o.registerCommand(Uo,()=>{let e=C();return _(e)?(o.blur(),!0):!1},J),o.registerCommand(Wo,e=>{let[,n]=us(e);if(n.length>0){let i=e.clientX,s=e.clientY,l=cs(i,s);if(l!==null){let{offset:a,node:d}=l,u=G(d);if(u!==null){let m=on();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=qo(m);Y(c)}o.dispatchCommand(Jf,n)}return e.preventDefault(),!0}let r=C();return!!_(r)},J),o.registerCommand(Er,e=>{let[n]=us(e),r=C();return!(n&&!_(r))},J),o.registerCommand(Tr,e=>{let[n]=us(e),r=C();if(n&&!_(r))return!1;let i=e.clientX,s=e.clientY,l=cs(i,s);if(l!==null){let a=G(l.node);H(a)&&e.preventDefault()}return!0},J),o.registerCommand(Ln,()=>(Wl(),!0),J),o.registerCommand(xo,e=>(Gn(o,Tt(e,ClipboardEvent)?e:null),!0),J),o.registerCommand(Eo,e=>(qx(e,o),!0),J),o.registerCommand(go,e=>{let[,n,r]=us(e);return n.length>0&&!r?(o.dispatchCommand(Jf,n),!0):In(e.target)?!1:C()!==null?(Wx(e,o),!0):!1},J))}var sn=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||""),dt(r,this),r}updateDOM(e){return e.__category!==this.__category||Oo(e,this)}insertNewAfter(e,n){let r=e?e.anchor.offset:0,i=r===this.getTextContentSize()||!e?I():Jn(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 at(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=Jn(e.category);return ct(e,n),n}};function Jn(o="info"){return new sn(o)}function Ia(o){return o instanceof sn}function $a(o,t="info"){return o instanceof sn&&o.getCategory()===t}var ln=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),ye(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:Zx,priority:1})}}static importJSON(e){let n=yt(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=yt(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 Zx(o){let t=null;if(Pi(o)){let e=o.textContent;(e!==null&&e!==""||o.children.length>0)&&(t=yt(o.getAttribute("href")||"",{rel:o.getAttribute("rel"),target:o.getAttribute("target"),title:o.getAttribute("title")}))}return{node:t}}function yt(o,t){return re(new ln(o,t))}function Ft(o){return o instanceof ln}var bL=$("TOGGLE_LINK_COMMAND");var an=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(Xr(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=dn(e.src,{alt:e.alt,width:e.width,height:e.height});return n.setAlignment(e.alignment),n}};function dn(o,t={}){return new an(o,t)}function Qe(o){return o instanceof an}function Pa(o){return"build"in o}var Re=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 Re{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()}},Jr=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 Qf(o,t,e){let n=null;return function(...i){let s=this,l=function(){n=null,e||o.apply(s,i)},a=e&&!n;n&&clearTimeout(n),n=window.setTimeout(l,t),a&&o.apply(s,i)}}function em(){let o=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${o()+o()}-${o()}-${o()}-${o()}-${o()}${o()}${o()}`}function ps(){return((1+Math.random())*65536|0).toString(16).substring(1)}var Kt=class extends Re{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])}},gs=class extends oe{constructor(e){let n=e.fields.map(r=>Pa(r)?r.build():new Kt(r));super(n);p(this,"definition");p(this,"onCancel",null);p(this,"onSuccessfulSubmit",null);this.definition=e}focusOnFirst(){let e=this.getDOMElement().querySelector("input,select,textarea");e&&e.focus()}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 Kt&&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}},Ba=class extends oe{constructor(e){let n=e.contents.map(r=>Pa(r)?r.build():new Kt(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()))}},cn=class extends oe{constructor(e){let n=e.map(r=>new Ba(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 Vx=["width","height","style","title","name","src","allow","allowfullscreen","loading","sandbox","type","data","controls","autoplay","controlslist","loop","muted","playsinline","poster","preload"];function Xx(o){let t={};for(let e of Object.keys(o))Vx.includes(e)&&(t[e]=o[e]);return t}function hs(o,t){let e=Object.assign({},o);if(!o.style)return e;let n=xa(o.style);return n.delete(t),e.style=of(n),e}function tm(o,t){let e=om(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 at(t,e),e}var Ro=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=Xx(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=hs(r,"width"),r=hs(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(hs(n,"height"))}getHeight(){let e=this.getLatest();return Qo(e.__attributes.height||"0")}setWidth(e){let n=this.getAttributes(),r=Object.assign(n,{width:e});this.setAttributes(hs(r,"width"))}getWidth(){let e=this.getLatest();return Qo(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 dt(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&&nf(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:tm(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=om(e.tag);return ct(e,n),n}};function om(o){return new Ro(o)}function nm(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)?tm(r,n):null}var jx=[{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"}],Gx=["mp4","mpeg","m4v","m4p","mov"],Jx=["3gp","aac","flac","mp3","m4a","ogg","wav","webm"],Qx=["html","htm","php","asp","aspx",""];function rm(o){for(let s of jx)if(o.match(s.regex)){let a=o.replace(s.regex,s.url),d=new Ro("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();Gx.includes(r)?t="video":Jx.includes(r)?t="audio":r&&!Qx.includes(r)&&(t="embed");let i=new Ro(t);return i.setSrc(o),i}function St(o){return o instanceof Ro}var Qr=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 Re{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")}};function Ns(o){window.$components.first("image-manager").show(e=>{o(e)},"gallery")}function im(o){let t=o.thumbs?.display||o.url,e=yt(t,{target:"_blank"}),n=dn(t,{alt:o.name});return e.append(n),e}async function sm(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}var lm='';var xs='';function Es(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 tr=class o extends Ht{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 Ao(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];ye(r,l)}return dt(r,this),r}updateDOM(e,n){return Oo(e,this)}static importDOM(){return{h1:e=>({conversion:Qn,priority:0}),h2:e=>({conversion:Qn,priority:0}),h3:e=>({conversion:Qn,priority:0}),h4:e=>({conversion:Qn,priority:0}),h5:e=>({conversion:Qn,priority:0}),h6:e=>({conversion:Qn,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=er(e.tag);return ct(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():er(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():er(this.getTag());return this.getChildren().forEach(r=>e.append(r)),this.replace(e),!0}extractWithChild(){return!0}};function Qn(o){let t=o.nodeName.toLowerCase(),e=null;return(t==="h1"||t==="h2"||t==="h3"||t==="h4"||t==="h5"||t==="h6")&&(e=er(t),at(o,e)),{node:e}}function er(o){return re(new tr(o))}function or(o){return o instanceof tr}var Ts=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-"+ps(),e.setId(r));let i=e.getTextContent();n({id:r,text:i})})})}updateDataList(e){this.getContext().editor.getEditorState().read(()=>{let n=Ta(or);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)})}};var am=o=>(o.split(" ").filter(e=>e.startsWith("language-"))[0]||"").replace("language-",""),un=class o extends lt{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=am(n.className)||r&&am(r.className)||"",s=r?(r.textContent||"").trim():(n.textContent||"").trim(),l=Cs(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=Cs(e.language,e.code);return n.setId(e.id||""),n}};function Cs(o="",t=""){return new un(o,t)}function bs(o){return o instanceof un}function ei(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)})},()=>{})}function Ha(o){let t=1,e=o.getParent();for(;e!=null;){if(j(e)){let n=e.getParent();if(W(n)){t++,e=n.getParent();continue}T(!1,"A ListItemNode must have a ListNode for a parent.")}return t}return t}function Fa(o){let t=o.getParent();W(t)||T(!1,"A ListItemNode must have a ListNode for a parent.");let e=t;for(;e!==null;)e=e.getParent(),W(e)&&(t=e);return t}function Ka(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(um(l,n)){let d=Se(t);if(ge(a)){l.replace(d);let u=Ue();d.append(u)}else if(j(l)){let u=l.getParentOrThrow();ti(d,u.getChildren()),u.replace(d)}return}}let r=new Set;for(let i=0;i0&&o.append(...r),t.remove()}function za(o){o.update(()=>{let t=C();if(_(t)){let e=new Set,n=t.getNodes(),r=t.anchor.getNode();if(um(r,n))e.add(Fa(r));else for(let i=0;i{if(T(j(e),"node is not a ListItemNode"),e.__checked==null)return;let n=e.getParent();W(n)&&n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:oE,priority:0})}}static importJSON(e){let n=Ue();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(W(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=Se(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&&nr(n)&&nr(r)&&(_s(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=Ue(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 W(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 Ge(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 Se("bullet")}canMergeWhenEmpty(){return!0}};function pm(o){let t=o.getChildren(),e=!1,n=!1;for(let r of t)W(r)?n=!0:r.getTextContent().trim().length>0&&(e=!0);return n&&!e}function gm(o,t){let e=!W(t.getFirstChild());o.classList.toggle("task-list-item",e),t.__checked?o.setAttribute("checked","checked"):o.removeAttribute("checked")}function oE(o){if(o.classList.contains("task-list-item")){for(let r of o.children)if(r.tagName==="INPUT")return nE(r)}let e=o.getAttribute("aria-checked");return{node:Ue(e==="true"?!0:e==="false"?!1:void 0)}}function nE(o){if(!(o.getAttribute("type")==="checkbox"))return{node:null};let e=o.hasAttribute("checked");return{node:Ue(e)}}function Ue(o){return re(new Ut(void 0,o))}function j(o){return o instanceof Ut}var ko=class o extends X{constructor(e,n,r){super(r);p(this,"__tag");p(this,"__start");p(this,"__listType");p(this,"__id","");let i=sE[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,hm(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:(hm(n,r.theme,this),!1)}static transform(){return e=>{T(W(e),"node is not a ListNode"),mm(e),fm(e)}}static importDOM(){return{ol:()=>({conversion:Nm,priority:0}),ul:()=>({conversion:Nm,priority:0})}}static importJSON(e){let n=Se(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&&Gi(o,...r),n.length>0&&ye(o,...n)}function rE(o){let t=[];for(let e of o)j(e)?t.push(e):t.push(dm(e));return t}function iE(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 Nm(o){let t=o.nodeName.toLowerCase(),e=null;if(t==="ol"){let n=o.start;e=Se("number",n)}else t==="ul"&&(iE(o)?e=Se("check"):e=Se("bullet"));return o.id&&e&&e.setId(o.id),o.dir&&e&&e.setDirection(jr(o)),{after:rE,node:e}}var sE={ol:"number",ul:"bullet"};function Se(o,t=1){return re(new ko(o,t))}function W(o){return o instanceof ko}var ev=$("INSERT_UNORDERED_LIST_COMMAND"),tv=$("INSERT_ORDERED_LIST_COMMAND"),ov=$("INSERT_CHECK_LIST_COMMAND"),nv=$("REMOVE_LIST_COMMAND");var rr=class o extends Ht{static getType(){return"quote"}static clone(t){let e=new o(t.__key);return Ao(t,e),e}constructor(t){super(t)}createDOM(t){let e=document.createElement("blockquote");return ye(e,t.theme.quote),dt(e,this),e}updateDOM(t,e){return Oo(t,this)}static importDOM(){return{blockquote:t=>({conversion:lE,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=ys();return ct(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 ys(){return re(new rr)}function Ss(o){return o instanceof rr}function lE(o){let t=ys();return at(o,t),{node:t}}var aE=(o,t)=>or(o)&&o.getTag()===t;function Ls(o,t){o.update(()=>{Vn(e=>aE(e,t),()=>er(t))})}function oi(o){o.update(()=>{Vn(Ge,I)})}function ni(o){o.update(()=>{Vn(Ss,ys)})}function ri(o,t){o.getEditorState().read(()=>{let e=C();de(e,r=>W(r)&&r.getListType()===t)?za(o):Ua(o,t)})}function ii(o){o.getEditorState().read(()=>{let t=C(),e=ae(o),n=V(e,bs);n===null?o.update(()=>{let r=Cs();r.setCode(t?.getTextContent()||"");let i=Pt(t),s=i[0],l=i.slice(1);s?(s.replace(r),l.forEach(a=>a.remove())):tn(r,!0),ei(o,r),Be(r)}):ei(o,n)})}function xm(o){o.update(()=>{let t=C(),e=Pt(t),n=!1;for(let i of e)Ia(i)||(i.replace(Jn("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 Ms(o,t){o.update(()=>{let e=C(),n=V(e,Ft);if(Ft(n)?(n.setURL(t.url),n.setTarget(t.target),n.setTitle(t.title)):(n=yt(t.url,{title:t.title,target:t.target}),Ce([n])),Ft(n)){for(let r of n.getChildren())r.remove(!0);n.append(z(t.text))}})}function Em(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 Tm={submitText:"Apply",async action(o,t){return t.editor.update(()=>{let e=ae(t.editor),n=V(e,Qe);Qe(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 Qr(new Kt({label:"Source",name:"src",type:"text"}),new w({label:"Browse files",icon:lm,action(o){Ns(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 ws(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=nn();r.add(o.getKey()),Y(r)}),e.show(n)}else t.editor.getEditorState().read(()=>{let i={text:C()?.getTextContent()||""};e.show(i)})}var Cm={submitText:"Apply",async action(o,t){return Ms(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 Qr(new Ts(new Kt({label:"URL",name:"url",type:"text"})),new w({label:"Browse links",icon:xs,action(o){Es(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 bm(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 _m={submitText:"Save",async action(o,t){let e=await new Promise((i,s)=>{t.editor.getEditorState().read(()=>{let l=V(C(),St);i(l)})}),n=(o.get("embed")||"").toString().trim(),r=(o.get("embed_check")||"").toString().trim();return n&&n!==r?(t.editor.update(()=>{let i=nm(n);e&&i?e.replace(i):i&&Ce([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=rm(i);(l||s)&&a.setWidthAndHeight(l,s),Ce([a])}),!0)},fields:[{build(){return new cn([{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 vs(o,t){let e=t.manager.createModal("details");o&&e.show({summary:o.getSummary()})}var ym={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"}]};var ir=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()})}),i.addEventListener("dblclick",s=>{s.preventDefault();let l=n.getUiContext();l&&n.read(()=>{vs(this,l)})}),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(jr(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=Wa();return n.setId(e.id),n.setDirection(e.direction),n}shouldSelectDirectly(){return!0}canBeEmpty(){return!1}};function Wa(){return new ir}function ce(o){return o instanceof ir}var ie={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},ao=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:Sm,priority:0}),th:e=>({conversion:Sm,priority:0})}}static importJSON(e){let n=ze(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),ye(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 Sm(o){let t=o,e=o.nodeName.toLowerCase(),n;/^(\d+(?:\.\d+)?)px$/.test(t.style.width)&&(n=parseFloat(t.style.width));let i=ze(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=Zn(o);f.delete("background-color"),i.setStyles(f),i.setAlignment(Xr(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 Pe(f)&&f.getTextContent()===` +`?a.insertParagraph():d===" "?a.insertNodes([kt()]):a.insertText(d)}}}else t.insertRawText(i)}function ka(o,t,e){o.dispatchCommand(Nr,{nodes:t,selection:e})||e.insertNodes(t)}function Kx(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 Vf(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=no(e);d=L(d)&&t!==null?zr(t,d):d,s=d}let l=E(s)?s.getChildren():[],a=Kx(s);if(L(s)){let d=s.__text;d.length>0?a.text=d:r=!1}for(let d=0;d{o.update(()=>{a(Wf(o,t,e))})});let n=o.getRootElement(),r=o._window==null?window.document:o._window.document,i=qf(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(xo,m=>(Tt(m,ClipboardEvent)&&(u(),jn!==null&&(window.clearTimeout(jn),jn=null),a(Wf(o,m,e))),!0),Ke);jn=window.setTimeout(()=>{u(),jn=null,a(!1)},Ux),r.execCommand("copy"),s.remove()})}function Wf(o,t,e){if(e===void 0){let r=qf(o._window);if(!r)return!1;let i=r.anchorNode,s=r.focusNode;if(i!==null&&s!==null&&!eo(o,i,s))return!1;let l=C();if(l===null)return!1;e=ds(l)}t.preventDefault();let n=t.clipboardData;return n===null?!1:(Gf(n,e),!0)}var zx=[["text/html",Yf],["application/x-lexical-editor",Zf]];function ds(o=C()){let t={"text/plain":o?o.getTextContent():""};if(o){let e=Yl();for(let[n,r]of zx){let i=r(e,o);i!==null&&(t[n]=i)}}return t}function Gf(o,t){for(let e in t){let n=t[e];n!==void 0&&o.setData(e,n)}}function cs(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 Jf=$("DRAG_DROP_PASTE_FILE");function Wx(o,t){o.preventDefault(),t.update(()=>{let e=C(),n=Tt(o,InputEvent)||Tt(o,KeyboardEvent)?null:o.clipboardData;n!=null&&e!==null&&as(n,e,t)},{tag:"paste"})}async function qx(o,t){await Gn(t,Tt(o,ClipboardEvent)?o:null),t.update(()=>{let e=C();_(e)?e.removeText():Oe(e)&&e.getNodes().forEach(n=>n.remove())})}function us(o){let t=null;if(Tt(o,DragEvent)?t=o.dataTransfer:Tt(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 fs(o){let t=G(o);return H(t)}function Yx(o){let t=o.focus;return t.key==="root"&&t.offset===F().getChildrenSize()}function ms(o){return Et(o.registerCommand(Wt,e=>{let n=C();return Oe(n)?(n.clear(),!0):!1},0),o.registerCommand(tt,e=>{let n=C();return _(n)?(n.deleteCharacter(e),!0):!1},J),o.registerCommand(Dt,e=>{let n=C();return _(n)?(n.deleteWord(e),!0):!1},J),o.registerCommand(mt,e=>{let n=C();return _(n)?(n.deleteLine(e),!0):!1},J),o.registerCommand(ft,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)as(r,n,o);else if(_(n)){let i=e.data;return i&&n.insertText(i),!0}}return!0},J),o.registerCommand(Sn,()=>{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(qt,e=>{let n=C();return _(n)?(n.insertLineBreak(e),!0):!1},J),o.registerCommand(Yt,()=>{let e=C();return _(e)?(e.insertParagraph(),!0):!1},J),o.registerCommand(bl,()=>(Ce([kt()]),!0),J),o.registerCommand(Zt,e=>{let n=C();if(Oe(n)&&!fs(e.target)){let r=n.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(_(n)){let r=oo(n.focus,!0);if(!e.shiftKey&&H(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},J),o.registerCommand(Vt,e=>{let n=C();if(Oe(n)){let r=n.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(_(n)){if(Yx(n))return e.preventDefault(),!0;let r=oo(n.focus,!1);if(!e.shiftKey&&H(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},J),o.registerCommand(Ko,e=>{let n=C();if(Oe(n)){let r=n.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!_(n))return!1;if(Xi(n,!0)){let r=e.shiftKey;return e.preventDefault(),ji(n,r,!0),!0}return!1},J),o.registerCommand(Fo,e=>{let n=C();if(Oe(n)&&!fs(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 Xi(n,!1)?(e.preventDefault(),ji(n,r,!1),!0):!1},J),o.registerCommand(Xt,e=>{if(fs(e.target))return!1;let n=C();return _(n)?(e.preventDefault(),o.dispatchCommand(tt,!0)):!1},J),o.registerCommand(jt,e=>{if(fs(e.target))return!1;let n=C();return _(n)?(e.preventDefault(),o.dispatchCommand(tt,!1)):!1},J),o.registerCommand(we,e=>{let n=C();if(!_(n))return!1;if(e!==null){if((Ot||Gt||Jt)&&bo)return!1;if(e.preventDefault(),e.shiftKey)return o.dispatchCommand(qt,!1)}return o.dispatchCommand(Yt,void 0)},J),o.registerCommand(Uo,()=>{let e=C();return _(e)?(o.blur(),!0):!1},J),o.registerCommand(Wo,e=>{let[,n]=us(e);if(n.length>0){let i=e.clientX,s=e.clientY,l=cs(i,s);if(l!==null){let{offset:a,node:d}=l,u=G(d);if(u!==null){let m=on();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=qo(m);Y(c)}o.dispatchCommand(Jf,n)}return e.preventDefault(),!0}let r=C();return!!_(r)},J),o.registerCommand(Er,e=>{let[n]=us(e),r=C();return!(n&&!_(r))},J),o.registerCommand(Tr,e=>{let[n]=us(e),r=C();if(n&&!_(r))return!1;let i=e.clientX,s=e.clientY,l=cs(i,s);if(l!==null){let a=G(l.node);H(a)&&e.preventDefault()}return!0},J),o.registerCommand(Ln,()=>(Wl(),!0),J),o.registerCommand(xo,e=>(Gn(o,Tt(e,ClipboardEvent)?e:null),!0),J),o.registerCommand(Eo,e=>(qx(e,o),!0),J),o.registerCommand(go,e=>{let[,n,r]=us(e);return n.length>0&&!r?(o.dispatchCommand(Jf,n),!0):In(e.target)?!1:C()!==null?(Wx(e,o),!0):!1},J))}var sn=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||""),dt(r,this),r}updateDOM(e){return e.__category!==this.__category||Oo(e,this)}insertNewAfter(e,n){let r=e?e.anchor.offset:0,i=r===this.getTextContentSize()||!e?I():Jn(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 at(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=Jn(e.category);return ct(e,n),n}};function Jn(o="info"){return new sn(o)}function Ia(o){return o instanceof sn}function $a(o,t="info"){return o instanceof sn&&o.getCategory()===t}var ln=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),ye(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:Zx,priority:1})}}static importJSON(e){let n=yt(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=yt(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 Zx(o){let t=null;if(Pi(o)){let e=o.textContent;(e!==null&&e!==""||o.children.length>0)&&(t=yt(o.getAttribute("href")||"",{rel:o.getAttribute("rel"),target:o.getAttribute("target"),title:o.getAttribute("title")}))}return{node:t}}function yt(o,t){return re(new ln(o,t))}function Ft(o){return o instanceof ln}var CL=$("TOGGLE_LINK_COMMAND");var an=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(Xr(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=dn(e.src,{alt:e.alt,width:e.width,height:e.height});return n.setAlignment(e.alignment),n}};function dn(o,t={}){return new an(o,t)}function Qe(o){return o instanceof an}function Pa(o){return"build"in o}var Re=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 Re{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()}},Jr=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 Qf(o,t,e){let n=null;return function(...i){let s=this,l=function(){n=null,e||o.apply(s,i)},a=e&&!n;n&&clearTimeout(n),n=window.setTimeout(l,t),a&&o.apply(s,i)}}function em(){let o=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${o()+o()}-${o()}-${o()}-${o()}-${o()}${o()}${o()}`}function ps(){return((1+Math.random())*65536|0).toString(16).substring(1)}var Kt=class extends Re{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])}},gs=class extends oe{constructor(e){let n=e.fields.map(r=>Pa(r)?r.build():new Kt(r));super(n);p(this,"definition");p(this,"onCancel",null);p(this,"onSuccessfulSubmit",null);this.definition=e}focusOnFirst(){let e=this.getDOMElement().querySelector("input,select,textarea");e&&e.focus()}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 Kt&&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}},Ba=class extends oe{constructor(e){let n=e.contents.map(r=>Pa(r)?r.build():new Kt(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()))}},cn=class extends oe{constructor(e){let n=e.map(r=>new Ba(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 Vx=["width","height","style","title","name","src","allow","allowfullscreen","loading","sandbox","type","data","controls","autoplay","controlslist","loop","muted","playsinline","poster","preload"];function Xx(o){let t={};for(let e of Object.keys(o))Vx.includes(e)&&(t[e]=o[e]);return t}function hs(o,t){let e=Object.assign({},o);if(!o.style)return e;let n=xa(o.style);return n.delete(t),e.style=of(n),e}function tm(o,t){let e=om(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 at(t,e),e}var Ro=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=Xx(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=hs(r,"width"),r=hs(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(hs(n,"height"))}getHeight(){let e=this.getLatest();return Qo(e.__attributes.height||"0")}setWidth(e){let n=this.getAttributes(),r=Object.assign(n,{width:e});this.setAttributes(hs(r,"width"))}getWidth(){let e=this.getLatest();return Qo(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 dt(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&&nf(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:tm(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=om(e.tag);return ct(e,n),n}};function om(o){return new Ro(o)}function nm(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)?tm(r,n):null}var jx=[{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"}],Gx=["mp4","mpeg","m4v","m4p","mov"],Jx=["3gp","aac","flac","mp3","m4a","ogg","wav","webm"],Qx=["html","htm","php","asp","aspx",""];function rm(o){for(let s of jx)if(o.match(s.regex)){let a=o.replace(s.regex,s.url),d=new Ro("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();Gx.includes(r)?t="video":Jx.includes(r)?t="audio":r&&!Qx.includes(r)&&(t="embed");let i=new Ro(t);return i.setSrc(o),i}function St(o){return o instanceof Ro}var Qr=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 Re{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")}};function Ns(o){window.$components.first("image-manager").show(e=>{o(e)},"gallery")}function im(o){let t=o.thumbs?.display||o.url,e=yt(t,{target:"_blank"}),n=dn(t,{alt:o.name});return e.append(n),e}async function sm(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}var lm='';var xs='';function Es(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 tr=class o extends Ht{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 Ao(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];ye(r,l)}return dt(r,this),r}updateDOM(e,n){return Oo(e,this)}static importDOM(){return{h1:e=>({conversion:Qn,priority:0}),h2:e=>({conversion:Qn,priority:0}),h3:e=>({conversion:Qn,priority:0}),h4:e=>({conversion:Qn,priority:0}),h5:e=>({conversion:Qn,priority:0}),h6:e=>({conversion:Qn,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=er(e.tag);return ct(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():er(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():er(this.getTag());return this.getChildren().forEach(r=>e.append(r)),this.replace(e),!0}extractWithChild(){return!0}};function Qn(o){let t=o.nodeName.toLowerCase(),e=null;return(t==="h1"||t==="h2"||t==="h3"||t==="h4"||t==="h5"||t==="h6")&&(e=er(t),at(o,e)),{node:e}}function er(o){return re(new tr(o))}function or(o){return o instanceof tr}var Ts=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-"+ps(),e.setId(r));let i=e.getTextContent();n({id:r,text:i})})})}updateDataList(e){this.getContext().editor.getEditorState().read(()=>{let n=Ta(or);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)})}};var am=o=>(o.split(" ").filter(e=>e.startsWith("language-"))[0]||"").replace("language-",""),un=class o extends lt{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=am(n.className)||r&&am(r.className)||"",s=r?(r.textContent||"").trim():(n.textContent||"").trim(),l=Cs(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=Cs(e.language,e.code);return n.setId(e.id||""),n}};function Cs(o="",t=""){return new un(o,t)}function bs(o){return o instanceof un}function ei(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)})},()=>{})}function Ha(o){let t=1,e=o.getParent();for(;e!=null;){if(j(e)){let n=e.getParent();if(W(n)){t++,e=n.getParent();continue}T(!1,"A ListItemNode must have a ListNode for a parent.")}return t}return t}function Fa(o){let t=o.getParent();W(t)||T(!1,"A ListItemNode must have a ListNode for a parent.");let e=t;for(;e!==null;)e=e.getParent(),W(e)&&(t=e);return t}function Ka(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(um(l,n)){let d=Se(t);if(ge(a)){l.replace(d);let u=Ue();d.append(u)}else if(j(l)){let u=l.getParentOrThrow();ti(d,u.getChildren()),u.replace(d)}return}}let r=new Set;for(let i=0;i0&&o.append(...r),t.remove()}function za(o){o.update(()=>{let t=C();if(_(t)){let e=new Set,n=t.getNodes(),r=t.anchor.getNode();if(um(r,n))e.add(Fa(r));else for(let i=0;i{if(T(j(e),"node is not a ListItemNode"),e.__checked==null)return;let n=e.getParent();W(n)&&n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:oE,priority:0})}}static importJSON(e){let n=Ue();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(W(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=Se(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&&nr(n)&&nr(r)&&(_s(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=Ue(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 W(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 Ge(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 Se("bullet")}canMergeWhenEmpty(){return!0}};function pm(o){let t=o.getChildren(),e=!1,n=!1;for(let r of t)W(r)?n=!0:r.getTextContent().trim().length>0&&(e=!0);return n&&!e}function gm(o,t){let e=!W(t.getFirstChild());o.classList.toggle("task-list-item",e),t.__checked?o.setAttribute("checked","checked"):o.removeAttribute("checked")}function oE(o){if(o.classList.contains("task-list-item")){for(let r of o.children)if(r.tagName==="INPUT")return nE(r)}let e=o.getAttribute("aria-checked");return{node:Ue(e==="true"?!0:e==="false"?!1:void 0)}}function nE(o){if(!(o.getAttribute("type")==="checkbox"))return{node:null};let e=o.hasAttribute("checked");return{node:Ue(e)}}function Ue(o){return re(new Ut(void 0,o))}function j(o){return o instanceof Ut}var ko=class o extends X{constructor(e,n,r){super(r);p(this,"__tag");p(this,"__start");p(this,"__listType");p(this,"__id","");let i=sE[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,hm(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:(hm(n,r.theme,this),!1)}static transform(){return e=>{T(W(e),"node is not a ListNode"),mm(e),fm(e)}}static importDOM(){return{ol:()=>({conversion:Nm,priority:0}),ul:()=>({conversion:Nm,priority:0})}}static importJSON(e){let n=Se(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&&Gi(o,...r),n.length>0&&ye(o,...n)}function rE(o){let t=[];for(let e of o)j(e)?t.push(e):t.push(dm(e));return t}function iE(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 Nm(o){let t=o.nodeName.toLowerCase(),e=null;if(t==="ol"){let n=o.start;e=Se("number",n)}else t==="ul"&&(iE(o)?e=Se("check"):e=Se("bullet"));return o.id&&e&&e.setId(o.id),o.dir&&e&&e.setDirection(jr(o)),{after:rE,node:e}}var sE={ol:"number",ul:"bullet"};function Se(o,t=1){return re(new ko(o,t))}function W(o){return o instanceof ko}var Jw=$("INSERT_UNORDERED_LIST_COMMAND"),Qw=$("INSERT_ORDERED_LIST_COMMAND"),ev=$("INSERT_CHECK_LIST_COMMAND"),tv=$("REMOVE_LIST_COMMAND");var rr=class o extends Ht{static getType(){return"quote"}static clone(t){let e=new o(t.__key);return Ao(t,e),e}constructor(t){super(t)}createDOM(t){let e=document.createElement("blockquote");return ye(e,t.theme.quote),dt(e,this),e}updateDOM(t,e){return Oo(t,this)}static importDOM(){return{blockquote:t=>({conversion:lE,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=ys();return ct(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 ys(){return re(new rr)}function Ss(o){return o instanceof rr}function lE(o){let t=ys();return at(o,t),{node:t}}var aE=(o,t)=>or(o)&&o.getTag()===t;function Ls(o,t){o.update(()=>{Vn(e=>aE(e,t),()=>er(t))})}function oi(o){o.update(()=>{Vn(Ge,I)})}function ni(o){o.update(()=>{Vn(Ss,ys)})}function ri(o,t){o.getEditorState().read(()=>{let e=C();de(e,r=>W(r)&&r.getListType()===t)?za(o):Ua(o,t)})}function ii(o){o.getEditorState().read(()=>{let t=C(),e=ae(o),n=V(e,bs);n===null?o.update(()=>{let r=Cs();r.setCode(t?.getTextContent()||"");let i=Pt(t),s=i[0],l=i.slice(1);s?(s.replace(r),l.forEach(a=>a.remove())):tn(r,!0),ei(o,r),Be(r)}):ei(o,n)})}function xm(o){o.update(()=>{let t=C(),e=Pt(t),n=!1;for(let i of e)Ia(i)||(i.replace(Jn("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 Ms(o,t){o.update(()=>{let e=C(),n=V(e,Ft);if(Ft(n)?(n.setURL(t.url),n.setTarget(t.target),n.setTitle(t.title)):(n=yt(t.url,{title:t.title,target:t.target}),Ce([n])),Ft(n)){for(let r of n.getChildren())r.remove(!0);n.append(z(t.text))}})}function Em(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 Tm={submitText:"Apply",async action(o,t){return t.editor.update(()=>{let e=ae(t.editor),n=V(e,Qe);Qe(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 Qr(new Kt({label:"Source",name:"src",type:"text"}),new w({label:"Browse files",icon:lm,action(o){Ns(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 ws(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=nn();r.add(o.getKey()),Y(r)}),e.show(n)}else t.editor.getEditorState().read(()=>{let i={text:C()?.getTextContent()||""};e.show(i)})}var Cm={submitText:"Apply",async action(o,t){return Ms(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 Qr(new Ts(new Kt({label:"URL",name:"url",type:"text"})),new w({label:"Browse links",icon:xs,action(o){Es(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 bm(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 _m={submitText:"Save",async action(o,t){let e=await new Promise((i,s)=>{t.editor.getEditorState().read(()=>{let l=V(C(),St);i(l)})}),n=(o.get("embed")||"").toString().trim(),r=(o.get("embed_check")||"").toString().trim();return n&&n!==r?(t.editor.update(()=>{let i=nm(n);e&&i?e.replace(i):i&&Ce([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=rm(i);(l||s)&&a.setWidthAndHeight(l,s),Ce([a])}),!0)},fields:[{build(){return new cn([{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 vs(o,t){let e=t.manager.createModal("details");o&&e.show({summary:o.getSummary()})}var ym={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"}]};var ir=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()})}),i.addEventListener("dblclick",s=>{s.preventDefault();let l=n.getUiContext();l&&n.read(()=>{vs(this,l)})}),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(jr(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=Wa();return n.setId(e.id),n.setDirection(e.direction),n}shouldSelectDirectly(){return!0}canBeEmpty(){return!1}};function Wa(){return new ir}function ce(o){return o instanceof ir}var ie={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},ao=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:Sm,priority:0}),th:e=>({conversion:Sm,priority:0})}}static importJSON(e){let n=ze(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),ye(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 Sm(o){let t=o,e=o.nodeName.toLowerCase(),n;/^(\d+(?:\.\d+)?)px$/.test(t.style.width)&&(n=parseFloat(t.style.width));let i=ze(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=Zn(o);f.delete("background-color"),i.setStyles(f),i.setAlignment(Xr(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 Pe(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 ze(o=ie.NO_STATUS,t=1,e){return re(new ao(o,t,e))}function D(o){return o instanceof ao}var dE=$("INSERT_TABLE_COMMAND");var co=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:cE,priority:0})}}static importJSON(e){let n=fn();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 ye(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 cE(o){let t=fn(),n=Qo(o.style.height);return t.setHeight(n),o instanceof HTMLElement&&t.setStyles(Zn(o)),{node:t}}function fn(){return re(new co)}function te(o){return o instanceof co}var sr=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 qa()}static importDOM(){return{caption:t=>({conversion(e){return{node:qa()}},priority:0})}}};function qa(){return new sr}function si(o){return o instanceof sr}function Ya(o){for(let t of o.getChildren())if(si(t))return!0;return!1}function Lm(o,t=""){let e=qa(),n=z(t||" ");e.append(n),o.append(e)}function Va(o,t,e=!0){let n=ai();for(let r=0;ro===ie.BOTH||o===t?t:ie.NO_STATUS;function Ds(o=!0){let t=C();T(_(t)||q(t),"Expected a RangeSelection or TableSelection");let e=t.focus.getNode(),[n,,r]=ke(e),[i,s]=ut(r,n,n),l=i[0].length,{startRow:a}=s;if(o){let d=a+n.__rowSpan-1,u=i[d],m=fn();for(let f=0;f1;)if(k-=M.__colSpan,k>=0){let{cell:Z,startRow:se}=x[k];P=Z,B=se}else{N.append(h(v));continue e}P.insertAfter(h(v))}else M.setColSpan(M.__colSpan+1)}g!==null&&li(g)}function Xa(){let o=C();T(_(o)||q(o),"Expected a RangeSelection or TableSelection");let t=o.anchor.getNode(),e=o.focus.getNode(),[n,,r]=ke(t),[i]=ke(e),[s,l,a]=ut(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)Ga(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];li(h)}else{let h=s[d-1],{cell:N}=h[0];li(N)}}function ja(){let o=C();T(_(o)||q(o),"Expected a RangeSelection or TableSelection");let t=o.anchor.getNode(),e=o.focus.getNode(),[n,,r]=ke(t),[i]=ke(e),[s,l,a]=ut(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;li(S)}else{let S=m1){for(let l=1;l1){let[l,a]=ut(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!si(d));for(let d=0;dx||h>S;){if(cx){let A=S-b,P=x+1;for(let B=0;B<=A;B++)v(d[b+B][P]);x=P}if(h>S){let A=x-N,P=S+1;for(let B=0;B<=A;B++)v(d[P][N+B]);S=P}}let M=[l],R=null;for(let A=f;A<=h;A++)for(let P=c;P<=g;P++){let{cell:B}=d[A][P],k=B.getParent();T(te(k),"Expected TableCellNode parent to be a TableRowNode"),k!==R&&M.push(k),M.push(B,...uE(B)),R=k}return pt()||(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 ci=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=mn(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=mn(n);di(t,r,null),Y(null),t.dispatchCommand(_e,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");Gi(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");ye(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(),di(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=Qa(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(Io(a))){let d=a.getKey();this.tableSelection=this.tableSelection.clone()||ks(),this.focusCellNodeKey=d,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),Y(this.tableSelection),n.dispatchCommand(_e,void 0),di(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():ks(),this.anchorCellNodeKey=n}})}formatCells(t){this.editor.update(()=>{let e=C();q(e)||T(!1,"Expected grid selection");let n=on(),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(_e,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();q(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(),F().selectStart();return}r.forEach(i=>{if(E(i)){let s=I(),l=z();s.append(l),i.append(s),i.getChildren().forEach(a=>{a!==s&&a.remove()})}}),di(t,this.table,null),Y(null),t.dispatchCommand(_e,void 0)})}};var fE="__lexicalTableSelection",Qa=o=>pe?(o||window).getSelection():null,mE=o=>(o.buttons&1)===1;function od(o,t,e,n){let r=e.getRootElement();if(r===null)throw new Error("No root element.");let i=new ci(e,o.getKey()),s=e._window||window;pE(t,i);let l=()=>{let c=()=>{i.isSelecting=!1,s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f)},f=g=>{setTimeout(()=>{if(!mE(g)&&i.isSelecting){i.isSelecting=!1,s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);return}let h=td(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=td(c.target);f!==null&&(gn(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;q(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(Vt,c=>ui(e,c,"down",o,i),Je)),i.listenersToRemove.add(e.registerCommand(Zt,c=>ui(e,c,"up",o,i),Je)),i.listenersToRemove.add(e.registerCommand(Ko,c=>ui(e,c,"backward",o,i),Je)),i.listenersToRemove.add(e.registerCommand(Fo,c=>ui(e,c,"forward",o,i),Je)),i.listenersToRemove.add(e.registerCommand(Uo,c=>{let f=C();if(q(f)){let g=U(f.focus.getNode(),D);if(D(g))return gn(c),g.selectEnd(),!0}return!1},Je));let d=c=>()=>{let f=C();if(!pn(f,o))return!1;if(q(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===mt&&M.getPreviousSibling()===null)return!0}return!1};[Dt,mt,tt].forEach(c=>{i.listenersToRemove.add(e.registerCommand(c,d(c),Ke))});let u=c=>{let f=C();if(!pn(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(q(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(Xt,u,Ke)),i.listenersToRemove.add(e.registerCommand(jt,u,Ke)),i.listenersToRemove.add(e.registerCommand(Eo,c=>{let f=C();if(f){if(!(q(f)||_(f)))return!1;Gn(e,Tt(c,ClipboardEvent)?c:null,ds(f));let g=u(c);return _(f)&&f.removeText(),g}return!1},Ke)),i.listenersToRemove.add(e.registerCommand(Ee,c=>{let f=C();if(!pn(f,o))return!1;if(q(f))return i.formatCells(c),!0;if(_(f)){let g=U(f.anchor.getNode(),h=>D(h));if(!D(g))return!1}return!1},Ke)),i.listenersToRemove.add(e.registerCommand(ft,c=>{let f=C();if(!pn(f,o))return!1;if(q(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=Dm(e,f,o);if(h)return vm(h,o,[z(c)]),!0}}return!1},Ke)),n&&i.listenersToRemove.add(e.registerCommand(zo,c=>{let f=C();if(!_(f)||!f.isCollapsed()||!pn(f,o))return!1;let g=$s(f.anchor.getNode());if(g===null)return!1;gn(c);let h=o.getCordsFromCellNode(g,i.table);return Om(i,o,h.x,h.y,c.shiftKey?"backward":"forward"),!0},Ke)),i.listenersToRemove.add(e.registerCommand(Cr,c=>o.isSelected(),Je));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(Nr,c=>{let{nodes:f,selection:g}=c,h=g.getStartEndPoints(),N=q(g),x=_(g)&&U(g.anchor.getNode(),qe=>D(qe))!==null&&U(g.focus.getNode(),qe=>D(qe))!==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(),P=U(S.getNode(),qe=>D(qe)),B=P&&U(P,qe=>te(qe)),k=B&&U(B,qe=>K(qe));if(!D(P)||!te(B)||!K(k))return!1;let Z=B.getIndexWithinParent(),se=Math.min(k.getChildrenSize()-1,Z+A-1),We=P.getIndexWithinParent(),nc=Math.min(B.getChildrenSize()-1,We+R-1),Qh=Math.min(We,nc),eN=Math.min(Z,se),tN=Math.max(We,nc),oN=Math.max(Z,se),nN=k.getChildren(),rc=0;for(let qe=eN;qe<=oN;qe++){let ic=nN[qe];if(!te(ic))return!1;let sc=M[rc];if(!te(sc))return!1;let rN=ic.getChildren(),iN=sc.getChildren(),lc=0;for(let Nl=Qh;Nl<=tN;Nl++){let bi=rN[Nl];if(!D(bi))return!1;let ac=iN[lc];if(!D(ac))return!1;let sN=bi.getChildren();ac.getChildren().forEach(yn=>{L(yn)&&I().append(yn),bi.append(yn)}),sN.forEach(yn=>yn.remove()),lc++}rc++}return!0},Ke)),i.listenersToRemove.add(e.registerCommand(_e,()=>{let c=C(),f=je();if(_(c)){let{anchor:g,focus:h}=c,N=g.getNode(),b=h.getNode(),x=$s(N),S=$s(b),v=!!(x&&o.is(Io(x))),M=!!(S&&o.is(Io(S))),R=v!==M,A=v&&M,P=c.isBackward();if(R){let B=c.clone();if(M){let[k]=ut(o,S,S),Z=k[0][0].cell,se=k[k.length-1].at(-1).cell;B.focus.set(P?Z.getKey():se.getKey(),P?Z.getChildrenSize():se.getChildrenSize(),"element")}Y(B),wm(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&&q(c)&&c.is(f)&&c.tableKey===o.getKey()){let g=Qa(e._window);if(g&&g.anchorNode&&g.focusNode){let h=G(g.focusNode),N=h&&!o.is(Io(h)),b=G(g.anchorNode),x=b&&o.is(Io(b));if(N&&x&&g.rangeCount>0){let S=La(g,e);S&&(S.anchor.set(o.getKey(),c.isBackward()?o.getChildrenSize():0,"element"),g.removeAllRanges(),Y(S))}}}return c&&!c.is(f)&&(q(c)||q(f))&&i.tableSelection&&!i.tableSelection.is(f)?(q(c)&&c.tableKey===i.tableNodeKey?i.updateTableTableSelection(c):!q(c)&&q(f)&&f.tableKey===i.tableNodeKey&&i.updateTableTableSelection(null),!1):(i.hasHijackedSelectionStyles&&!o.isSelected()?gE(e,i):!i.hasHijackedSelectionStyles&&o.isSelected()&&wm(e,i),!1)},Ke)),i.listenersToRemove.add(e.registerCommand(Yt,()=>{let c=C();if(!_(c)||!c.isCollapsed()||!pn(c,o))return!1;let f=Dm(e,c,o);return f?(vm(f,o),!0):!1},Ke)),i}function pE(o,t){o[fE]=t}function td(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 mn(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 di(o,t,e){let n=new Set(e?e.getNodes():[]);nd(t,(r,i)=>{let s=r.elem;n.has(i)?(r.highlighted=!0,Am(o,r)):(r.highlighted=!1,Rm(o,r),s.getAttribute("style")||s.removeAttribute("style"))})}function nd(o,t){let{domRows:e}=o;for(let n=0;n{e.highlighted=!0,Am(o,e)})}function gE(o,t){t.enableHighlightStyle(),nd(t.table,e=>{let n=e.elem;e.highlighted=!1,Rm(o,e),n.getAttribute("style")||n.removeAttribute("style")})}var Om=(o,t,e,n,r)=>{let i=r==="forward";switch(r){case"backward":case"forward":return e!==(i?o.table.columns-1:0)?Is(t.getCellNodeFromCordsOrThrow(e+(i?1:-1),n,o.table),i):n!==(i?o.table.rows-1:0)?Is(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?Is(t.getCellNodeFromCordsOrThrow(e,n-1,o.table),!1):qr(t,!1),!0;case"down":return n!==o.table.rows-1?Is(t.getCellNodeFromCordsOrThrow(e,n+1,o.table),!0):qr(t,!0),!0;default:return!1}},hE=(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 pn(o,t){if(_(o)||q(o)){let e=t.isParentOf(o.anchor.getNode()),n=t.isParentOf(o.focus.getNode());return e&&n}return!1}function Is(o,t){t?o.selectStart():o.selectEnd()}var ed="172,206,247";function Am(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(${ed})`):e.style.setProperty("background-image",`linear-gradient(to right, rgba(${ed},0.85), rgba(${ed},0.85))`),e.style.setProperty("caret-color","transparent")}function Rm(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 $s(o){let t=U(o,D);return D(t)?t:null}function Io(o){let t=U(o,K);return K(t)?t:null}function ui(o,t,e,n,r){if((e==="up"||e==="down")&&NE(o))return!1;let i=C();if(!pn(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:(gn(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]=ke(d),[c]=ke(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]=ke(d),[c]=ke(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=Io(a);if(u!==n&&u!=null){let x=o.getElementByKey(u.getKey());if(x!=null)return r.table=mn(x),ui(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&&H(M[0])?!1:xE(x,S,v,e)?CE(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){gn(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 Om(r,n,x.x,x.y,e);return!0}}else if(q(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=mn(m),f=n.getCordsFromCellNode(a,c),g=n.getDOMCellFromCordsOrThrow(f.x,f.y,c);if(r.setAnchorCellForSelection(g),gn(t),t.shiftKey){let h=n.getCordsFromCellNode(d,c);return hE(r,u,h.x,h.y,e)}else d.selectEnd();return!0}return!1}function gn(o){o.preventDefault(),o.stopImmediatePropagation(),o.stopPropagation()}function NE(o){let t=o.getRootElement();return t?t.hasAttribute("aria-controls")&&t.getAttribute("aria-controls")==="typeahead-menu":!1}function xE(o,t,e,n){return EE(o,e,n)||TE(o,t,e,n)}function EE(o,t,e){return o==="element"&&(e==="backward"?t.getPreviousSibling()===null:t.getNextSibling()===null)}function TE(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 CE(o,t,e,n){let r=U(t,D);if(!D(r))return!1;let[i,s]=ut(e,r,r);if(!bE(i,s,n))return!1;let l=_E(t,n,e);return!l||K(l)?!1:(gn(o),n==="backward"?l.selectEnd():l.selectStart(),!0)}function bE(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 _E(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 vm(o,t,e){let n=I();o==="first"?t.insertBefore(n):t.insertAfter(n),n.append(...e||[]),n.selectEnd()}function Dm(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]=ut(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 zt=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 km(o){return[...o.children].map(t=>yE(t))}function yE(o){let t=o.style.width||o.getAttribute("width");return t&&!Number.isNaN(Number(t))&&(t=t+"px"),t||""}function id(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]=Ct(e),o.setColWidths(i)}function Pm(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=$m(r);if(i&&i.children.length>e)return i.children[e].clientWidth}return 0}function Bm(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 Hm(o,t){let e=rd(o),n=Bm(o);e&&n>=0&&id(e,n,t)}function Fm(o,t){let e=rd(t),n=Bm(t);if(!e)return"";let r=e.getColWidths();return r.length>n?r[n]:""}function sd(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 hn(o){if(q(o))return o.getNodes().filter(n=>D(n));let t=V(o,D);return t?[t]:[]}function Km(o){let t=o.getShape(),e=hn(o);if(e.length===0)return;let n=rd(e[0]);if(!n)return;let r=new zt(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 zm(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 ld(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 Wm(o){let t=null;return ld(o,e=>{let n=e.getStyles().get("padding")||"";if(t===null&&(t=n),n!==t)return t=null,!1}),t||""}var Mt=class o extends Ht{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 Ao(e,n),n.__colWidths=[...e.__colWidths],n.__styles=new Map(e.__styles),n}static importDOM(){return{table:e=>({conversion:SE,priority:1})}}static importJSON(e){let n=ai();return ct(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");ye(r,e.theme.table),dt(r,this);let i=this.getColWidths(),s=sd(i);s&&r.append(s);for(let[l,a]of this.__styles.entries())r.style.setProperty(l,a);return r}updateDOM(e,n){if(Kf(e,this,n),this.__colWidths.join(":")!==e.__colWidths.join(":")){let r=Array.from(n.children).find(s=>s.nodeName==="COLGROUP"),i=sd(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=ad();return n.setId(e.id),n}};function ad(){return new lr}function qm(o){return o instanceof lr}var $o=class o extends lt{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=ar(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=ar(e.drawingId,e.drawingUrl);return n.setId(e.id||""),n}};function ar(o="",t=""){return new $o(o,t)}var dr=class o extends lt{constructor(){super(...arguments);p(this,"__user_id",0);p(this,"__user_name","");p(this,"__user_slug","")}static getType(){return"mention"}static clone(e){let n=new o(e.__key);return n.__user_id=e.__user_id,n.__user_name=e.__user_name,n.__user_slug=e.__user_slug,n}setUserDetails(e,n,r){let i=this.getWritable();i.__user_id=e,i.__user_name=n,i.__user_slug=r}hasUserSet(){return this.__user_id>0}isInline(){return!0}isParentRequired(){return!0}decorate(e,n){return{type:"mention",getNode:()=>this}}createDOM(e,n){let r=document.createElement("a");return r.setAttribute("target","_blank"),r.setAttribute("href",window.baseUrl("/user/"+this.__user_slug)),r.setAttribute("data-mention-user-id",String(this.__user_id)),r.setAttribute("title","@"+this.__user_name),r.textContent="@"+this.__user_name,r}updateDOM(e){return e.__user_id!==this.__user_id}static importDOM(){return{a(e){return e.hasAttribute("data-mention-user-id")?{conversion:n=>{let r=new o;return r.setUserDetails(Number(n.getAttribute("data-mention-user-id")||"0"),n.innerText.replace(/^@/,""),n.getAttribute("href")?.split("/user/")[1]||""),{node:r,after(i){return[]}}},priority:4}:null}}}exportJSON(){return{type:"mention",version:1,user_id:this.__user_id,user_name:this.__user_name,user_slug:this.__user_slug}}static importJSON(e){return dd(e.user_id,e.user_name,e.user_slug)}};function dd(o,t,e){let n=new dr;return n.setUserDetails(o,t,e),n}function Ym(o){return o instanceof dr}function Zm(){return[sn,tr,rr,ko,Ut,Mt,co,ao,sr,an,lr,ir,un,$o,Ro,it,ln]}function cd(){return[ko,Ut,it,ln]}function Vm(){return[...cd(),dr]}function Xm(o){let t=[an,un,$o],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))}var jm='';var Ps=class extends oe{constructor(e,n){super([new gs(e.form)]);p(this,"definition");p(this,"key");p(this,"originalFocus",null);this.definition=e,this.key=n}show(e){this.originalFocus=document.activeElement;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),r.focusOnFirst()}hide(){this.getContext().manager.setModalInactive(this.key),this.teardown(),this.originalFocus instanceof HTMLElement&&this.originalFocus.isConnected&&this.originalFocus.focus()}getForm(){return this.children[0]}buildDOM(){let e=y("button",{class:"editor-modal-close",type:"button",title:this.trans("Close")});e.innerHTML=jm,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.addEventListener("keydown",i=>{i.key==="Escape"&&this.hide()}),r}};var Bs=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 ME(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 Hs=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,ME(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 Fs=class{constructor(){p(this,"dropdowns",new Hs);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,t)}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 Ps(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(this.getContext());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())}getToolbar(){return this.toolbar}registerContextToolbar(t,e){this.contextToolbarDefinitionsByKey[t]=e}triggerStateUpdate(t){df(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()}focus(){this.getContext().editorDOM.focus(),this.getContext().editor.focus()}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 Bs(s,l);a.setContext(this.getContext()),this.activeContextToolbars.push(a),this.getContext().containerDOM.append(a.getDOMElement()),a.updatePosition()}}setupEditor(t,e){t.setUiContext(e);let n=r=>{t.getEditorState().read(()=>{let i=Object.keys(r);for(let s of i){let l=t.getElementByKey(s);if(!l)continue;let a=r[s],d=this.getDecorator(a.type,s);d.setNode(a.getNode());let u=d.render(l);u&&l.append(u)}})};t.registerDecoratorListener(n),t.registerUpdateListener(({editorState:r,prevEditorState:i})=>{!i._selection?.is(r._selection)&&t.update(()=>{let l=C();this.triggerStateUpdate({editor:t,selection:l})})})}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 Ks(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 Fs,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 Po(o,t){o.update(()=>{let e=F();for(let r of e.getChildren())r.remove(!0);let n=en(o,t);e.append(...n)})}function Us(o,t){o.update(()=>{let e=F(),n=en(o,t);e.append(...n)})}function zs(o,t){o.update(()=>{let e=F(),n=en(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 Ws(o,t){o.update(()=>{let e=C(),n=Ea(o,t),r=e?.getNodes()[0],i=!1,s=r?bt(r):null;for(let l=n.length-1;l>=0;l--){let a=n[l];It(a)&&s?i?s.insertBefore(a):s.insertAfter(a):It(a)?F().append(a):i?r?.insertBefore(a):(Ce([a]),r=a,s=bt(r),i=!0)}})}function qs(o){return new Promise((t,e)=>{o.getEditorState().read(()=>{let n=Qi(o);t(n)})})}function Ys(o){o.focus(()=>{},{defaultSelection:"rootStart"})}var cr=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 ud=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 Mt){let c=Pm(e.editor,m,d),f=Math.max(c+u,10);id(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 co){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 Gm(o,t){let e=new ud(o,t);return()=>{e.teardown()}}function Zs(o){return o.html||""}function Jm(o){window.$events.listen("editor::replace",e=>{let n=Zs(e);Po(o,n)}),window.$events.listen("editor::append",e=>{let n=Zs(e);Us(o,n)}),window.$events.listen("editor::prepend",e=>{let n=Zs(e);zs(o,n)}),window.$events.listen("editor::insert",e=>{let n=Zs(e);Ws(o,n)}),window.$events.listen("editor::focus",()=>{Ys(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 Vs=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 wE(o,t){let e=o.clientX,n=o.clientY;return document.elementFromPoint(e,n)?rf(t,o.clientX,o.clientY):null}function Qm(o,t,e){let n=wE(t,e);n&&Be(n),Ca(o,!0),(!H(n)||!n?.getTextContent())&&n?.remove()}async function vE(o,t,e){let i=((await window.$http.get(`/templates/${t}`)).data||{html:""}).html||"";o.update(()=>{let s=en(o,i);Qm(s,e,o)})}function ep(o,t){let e=new Vs(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=dn(s),a=I();a.append(l),Ce([a]);try{let d=await sm(i,t.options.pageId),u=d.name.replace(/"/g,"");t.editor.update(()=>{let m=dn(d.thumbs?.display||"",{alt:u}),c=yt(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 DE(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=dn(n);Ce([r]),r.select()}),!0):!1}function OE(o){let t=o.editor;return e=>{let n=e.dataTransfer?.getData("bookstack/template")||"";if(n)return vE(t,n,e),e.preventDefault(),e.stopPropagation(),!0;let r=e.dataTransfer?.getData("text/html")||"";return r?(t.update(()=>{let i=en(t,r);Qm(i,e,t)}),e.preventDefault(),e.stopPropagation(),!0):e.dataTransfer&&ep(e.dataTransfer,o)?(e.preventDefault(),e.stopPropagation(),!0):!1}}function AE(o){return t=>{if(!t.clipboardData)return!1;let e=DE(t.clipboardData,o)||ep(t.clipboardData,o);return e&&t.preventDefault(),e}}function tp(o){let t=OE(o),e=AE(o),n=o.editor.registerCommand(Wo,t,Je),r=o.editor.registerCommand(go,e,Je);return o.scrollDOM.addEventListener("drop",t),()=>{n(),r(),o.scrollDOM.removeEventListener("drop",t)}}var fd=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 op(o,t){let e=new fd(o,t);return()=>{e.teardown()}}var md=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(Mt,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=od(t,n,this.editor,!0);this.tableSelections.set(e,r)}}teardown(){this.unregisterMutationListener();for(let[,t]of this.tableSelections)t.removeListeners()}};function np(o){let t=new md(o);return()=>{t.teardown()}}function Xs(o,t){return Ls(o.editor,t),o.manager.triggerFutureStateRefresh(),!0}function fo(o){return(t,e)=>(o(t),e.manager.triggerFutureStateRefresh(),!0)}function rp(o){return o.dispatchCommand(Ee,"code"),!0}var ip={"meta+s":()=>(window.$events.emit("editor-save-draft"),!0),"meta+enter":()=>(window.$events.emit("editor-save-page"),!0),"meta+1":(o,t)=>Xs(t,"h2"),"meta+2":(o,t)=>Xs(t,"h3"),"meta+3":(o,t)=>Xs(t,"h4"),"meta+4":(o,t)=>Xs(t,"h5"),"meta+5":fo(oi),"meta+d":fo(oi),"meta+6":fo(ni),"meta+q":fo(ni),"meta+7":fo(ii),"meta+e":fo(ii),"meta+8":rp,"meta+shift+e":rp,"meta+9":fo(xm),"meta+o":fo(o=>ri(o,"number")),"meta+p":fo(o=>ri(o,"bullet")),"meta+k":(o,t)=>(o.getEditorState().read(()=>{let e=V(C(),Ft);ws(e,t)}),!0),"meta+shift+k":(o,t)=>(o.getEditorState().read(()=>{let n=C()?.getTextContent()||"";Es(r=>{Ms(o,{text:r.name,title:r.link,target:"",url:r.link})},n)}),!0)};function RE(o){return t=>{let e=kE(t);ip[e]&&ip[e](o.editor,o)&&(t.stopPropagation(),t.preventDefault())}}function kE(o){return[(sp()?o.metaKey:o.ctrlKey)?"meta":"",o.shiftKey?"shift":"",o.key].filter(Boolean).join("+").toLowerCase()}function sp(){return window.navigator.userAgent.includes("Mac OS X")}function IE(o){o.registerCommand(we,t=>sp()?t?.metaKey||!1:t?.ctrlKey||!1,Je)}function js(o){let t=RE(o);return IE(o.editor),o.editor.registerRootListener((e,n)=>{e?.addEventListener("keydown",t),n?.removeEventListener("keydown",t)})}function $E(o){return Qe(o)||St(o)}var pd=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&&$E(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"});Qe(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 cr(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 lp(o){let t=new pd(o);return()=>{t.teardown()}}function PE(o){let t=o.getParent();if(!W(t))return o;let e=o.getChildren().filter(d=>W(d))[0]||null,n=e?.getChildren()||[],r=t.getChildren(),i=r.findIndex(d=>d.getKey()===o.getKey()),s=i===0,l=Ue(),a=Se(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 BE(o){let t=o.getParent(),e=t?.getParent(),n=e?.getParent();if(!W(t)||!W(n)||!j(e))return o;let r=o.getNextSiblings();if(e.insertAfter(o),t.getChildren().length===0&&t.remove(),r.length>0){let i=Se(t.getListType());i.append(...r),o.append(i)}return t.getChildrenSize()===0&&t.remove(),e.getChildren().length===0&&e.remove(),o}function HE(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 FE(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 sf(e)}function fi(o,t){let e=C(),n=e?.getStartEndPoints(),r=HE(e);if(r.length>0&&!r.includes(null)){let l=[],a=FE(r);if(t>0)for(let d of a)l.push(PE(d));else if(t<0){for(let d of[...a].reverse())l.push(BE(d));l.reverse()}if(l.length===1&&n){let d=l[0],u=d.getChildren()[0];u||(u=z(""),d.append(u)),u.select(n[0].offset,n[1].offset)}else pf(l);return}let s=Pt(e);for(let l of s)if(lf(l)){let a=l.getInset(),d=Math.min(Math.max(a+t,0),500);l.setInset(d)}gf(o)}var ur=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 Gs(o){return new Promise((t,e)=>{o.oncomplete=o.onsuccess=()=>t(o.result),o.onabort=o.onerror=()=>e(o.error)})}function KE(o,t){let e,n=()=>{if(e)return e;let r=indexedDB.open(o);return r.onupgradeneeded=()=>r.result.createObjectStore(t),e=Gs(r),e.then(i=>{i.onclose=()=>e=void 0},()=>{}),e};return(r,i)=>n().then(s=>i(s.transaction(t,r).objectStore(t)))}var gd;function hd(){return gd||(gd=KE("keyval-store","keyval")),gd}function Nd(o,t=hd()){return t("readonly",e=>Gs(e.get(o)))}function xd(o,t,e=hd()){return e("readwrite",n=>(n.put(t,o),Gs(n.transaction)))}function Ed(o,t=hd()){return t("readwrite",e=>(e.delete(o),Gs(e.transaction)))}var wt=null,bd,Js,Td,Cd="last-drawing-save";function _d(o){wt?.contentWindow?.postMessage(JSON.stringify(o),bd)}function zE(o){xd(Cd,o.data),Td&&Td(o.data).then(()=>{Ed(Cd)})}function WE(o){_d({action:"export",format:"xmlpng",xml:o.xml,spin:"Updating drawing"})}function qE(){Js&&Js().then(o=>{_d({action:"load",autosave:1,xml:o})})}function YE(){let o={};wt&&(window.$events.emitPublic(wt,"editor-drawio::configure",{config:o}),_d({action:"configure",config:o}))}function ap(){window.removeEventListener("message",dp),wt&&document.body.removeChild(wt)}function dp(o){if(!o.data||o.data.length<1||o.origin!==bd)return;let t=JSON.parse(o.data);t.event==="init"?qE():t.event==="exit"?ap():t.event==="save"?WE(t):t.event==="export"?zE(t):t.event==="configure"&&YE()}async function ZE(){let o=await Nd(Cd),t=document.getElementById("unsaved-drawing-dialog");t||console.error("Missing expected unsaved-drawing dialog"),o&&t&&await window.$components.firstOnElement(t,"confirm-dialog").show()&&(Js=async()=>o)}async function cp(o,t,e){Js=t,Td=e,await ZE(),wt=document.createElement("iframe"),wt.setAttribute("frameborder","0"),window.addEventListener("message",dp),wt.setAttribute("src",o),wt.setAttribute("class","fullscreen"),wt.style.backgroundColor="#FFFFFF",document.body.appendChild(wt),bd=new URL(o).origin}async function up(o,t){let e={image:o,uploaded_to:t};return(await window.$http.post(window.baseUrl("/images/drawio"),e)).data}function yd(){ap()}async function fp(o){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${o}`))).data.content}`}catch(t){throw t instanceof ur&&window.$events.showResponseError(t),yd(),t}}function mo(o){return o instanceof $o}function XE(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 jE(o,t){return await new Promise((n,r)=>{o.getEditorState().read(()=>{let{id:i}=t.getDrawingIdAndUrl();n(i)})})||""}async function GE(o,t,e,n){if(yd(),n){let r=window.baseUrl("/loading.gif");o.editor.update(()=>{t.setDrawingIdAndUrl("",r)})}try{let r=await up(e,o.options.pageId);o.editor.update(()=>{t.setDrawingIdAndUrl(String(r.id),r.url)})}catch(r){throw r instanceof ur&&XE(r,o),n&&o.editor.update(()=>{t.remove()}),new Error(`Failed to save image with error: ${r}`)}}function mi(o,t){let e=!1;cp(o.options.drawioUrl,async()=>{let n=await jE(o.editor,t);return e=!n,e?"":fp(n)},async n=>GE(o,t,n,e))}function JE(o){window.$components.first("image-manager").show(e=>{o(e)},"drawio")}function mp(o){let t=ae(o.editor);JE(e=>{o.editor.update(()=>{let n=ar(e.id,e.url),r=V(t,mo);mo(r)?r.replace(n):Ce([n])})})}function Qs(o){let t=o.getChildren();for(let e of t)o.insertBefore(e);o.remove()}function Sd(o){if(o.length===1){let t=o[0];if(H(t)||Qe(t)||St(t)||mo(t))return!0}return!1}function pp(o){let t=ae(o)?.getNodes()||[];Sd(t)&&o.update(()=>{t[0].remove()})}function QE(o,t){let e=ae(o)?.getNodes()||[];if(Sd(e)){let n=e[0],r=bt(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 gp(o,t,e=!0){let n=ae(o)?.getNodes()||[];if(!Sd(n))return!1;t?.preventDefault();let r=n[0];return o.update(()=>{qr(r,e)}),!0}function eT(o,t){let e=hp(o);return e===null||e.detailsSibling?!1:(o.update(()=>{let n=I();e.parentDetails.insertAfter(n),n.select()}),t?.preventDefault(),!0)}function tT(o,t){let e=hp(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 hp(o){let e=ae(o)?.getNodes()[0];if(!e)return null;let n=bt(e),r=$t(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 oT(o,t){let e=C(),n=e?.getNodes()||[];if(n.length!==1)return!1;let r=bt(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(()=>{Qs(i),r.selectStart(),o.manager.triggerLayoutUpdate()}),!0):!1}function nT(o){if(o.length!==1)return!1;let t=o[0];return j(t)||j(t.getParent())}function rT(o,t){let e=t?.shiftKey?-40:40,r=C()?.getNodes()||[];return r.length>1||nT(r)?(o.update(()=>{fi(o,e)}),t?.preventDefault(),!0):!1}function Np(o){let t=o.editor.registerCommand(Xt,l=>(pp(o.editor),oT(o,l)),Ae),e=o.editor.registerCommand(jt,()=>(pp(o.editor),!1),Ae),n=o.editor.registerCommand(we,l=>QE(o.editor,l)||tT(o.editor,l),Ae),r=o.editor.registerCommand(zo,l=>rT(o.editor,l),Ae),i=o.editor.registerCommand(Zt,l=>gp(o.editor,l,!1),Ae),s=o.editor.registerCommand(Vt,l=>eT(o.editor,l)||gp(o.editor,l,!0),Ae);return()=>{t(),e(),n(),r(),i(),s()}}function iT(o){return o.toLowerCase().startsWith("http")?/(http|https):\/\/(\S+)\.\S+$/.test(o):!1}function sT(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);iT(d)&&e.update(()=>{let u=yt(d);u.append(new st(d));let m=o.splitText(a,r),c=a>0?1:0,f=m[c];f&&f.replace(u)})}function el(o){let t=r=>{let i=C(),s=cf(i);return s&&i&&sT(s,i,o),!1},e=o.registerCommand(xr,t,lo),n=o.registerCommand(we,t,lo);return()=>{e(),n()}}var tl=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 et=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 xp='';var ol=class extends w{buildDOM(){let t=super.buildDOM(),e=y("div",{class:"editor-menu-button-icon"});return e.innerHTML=xp,t.append(e),t}};var aT={showOnHover:!1,direction:"horizontal",showAside:void 0,hideOnAction:!0,button:{label:"Menu"}},be=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({},aT,e),e.button instanceof w)this.button=e.button;else{let r=e.button.format==="long"?ol: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 Ep='';var Tp='';var Cp=["#000000","#ffffff","#BFEDD2","#FBEEB8","#F8CAC6","#ECCAFA","#C2E0F4","#2DC26B","#F1C40F","#E03E2D","#B96AD9","#3598DB","#169179","#E67E23","#BA372A","#843FA1","#236FA1","#ECF0F1","#CED4D9","#95A5A6","#7E8C8D","#34495E"],bp="bs-lexical-custom-colors",Nn=class extends Re{constructor(e){super();p(this,"callback");this.callback=e}buildDOM(){let e=ps(),r=[...Cp,...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=Ep,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=Tp,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=Va(e,n,!1);s.setColWidths(i),tn(s)})}};var pi=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=Na(e.selection,this.style);this.getColorBar().setAttribute("fill",n)}}};var _p='';var Ie=class extends oe{constructor(e,n,r){super(r);p(this,"size");p(this,"overflowButton");p(this,"content");p(this,"label");this.label=e,this.size=n,this.content=r,this.overflowButton=new be({button:{label:"More",icon:_p},hideOnAction:!1},[]),this.addChildren(this.overflowButton)}addChild(e,n=-1){this.content.splice(n,0,e),this.addChildren(e)}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)}getLabel(){return this.label}};var Ld='';var rl='';var yp='';var Sp='';var Lp='';var Mp='';var wp='';var vp='';var Dp=` @@ -28,5 +28,5 @@ var lN=Object.defineProperty;var dc=o=>{throw TypeError(o)};var aN=(o,t,e)=>t in `;var Kg='';var Ug='';var zg='';var Wg='';var qg='';var Yg='';function En(o,t,e){return{label:o,icon:e,action(n){n.editor.dispatchCommand(Ee,t)},isActive(n){return uf(n,t)}}}var Kd=En("Bold","bold",Pg),Ud=En("Italic","italic",Bg),Zg=En("Underline","underline",Hg),Vg={label:"Text color",icon:Fg},Xg={label:"Highlight color",icon:Kg};function jg(o,t,e){o.editor.update(()=>{let n=C();n&&ha(n,{[t]:e||null})})}var Gg=(o,t)=>jg(t,"color",o),Jg=(o,t)=>jg(t,"background-color",o),Qg=En("Strikethrough","strikethrough",Ug),eh=En("Superscript","superscript",zg),th=En("Subscript","subscript",Wg),oh=En("Inline code","code",qg),nh={label:"Clear formatting",icon:Yg,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 rh='';var ih='';var sh='';var lh='';var ah='';var dh='';function al(o,t){let e=ae(o.editor),n=e?.getNodes()||[];if(n.length===1&&E(n[0])&&n[0].isInline()&&Yr(n[0])){n[0].setAlignment(t),Be(n[0]),o.manager.triggerFutureStateRefresh();return}let i=Pt(e).filter(a=>Yr(a)),l=i.every(a=>a.getAlignment()===t)?"":t;for(let a of i)a.setAlignment(l);o.manager.triggerFutureStateRefresh()}function ch(o,t){let e=ae(o.editor),n=Pt(e);for(let r of n)r.setDirection(t);o.manager.triggerFutureStateRefresh()}var uh={label:"Align left",icon:rh,action(o){o.editor.update(()=>al(o,"left"))},isActive(o){return Zr(o,"left")}},fh={label:"Align center",icon:ih,action(o){o.editor.update(()=>al(o,"center"))},isActive(o){return Zr(o,"center")}},mh={label:"Align right",icon:sh,action(o){o.editor.update(()=>al(o,"right"))},isActive(o){return Zr(o,"right")}},ph={label:"Justify",icon:lh,action(o){o.editor.update(()=>al(o,"justify"))},isActive(o){return Zr(o,"justify")}},gh={label:"Left to right",icon:ah,action(o){o.editor.update(()=>ch(o,"ltr"))},isActive(o){return ba(o,"ltr")}},hh={label:"Right to left",icon:dh,action(o){o.editor.update(()=>ch(o,"rtl"))},isActive(o){return ba(o,"rtl")}};var Nh='';var xh='';var Eh='';var Th='';var Ch='';function zd(o,t,e){return{label:o,icon:e,action(n){ri(n.editor,t)},isActive(n){return de(n,r=>W(r)&&r.getListType()===t)}}}var Wd=zd("Bullet list","bullet",Nh),qd=zd("Numbered list","number",xh),bh=zd("Task list","check",Eh),_h={label:"Increase indent",icon:Th,action(o){o.editor.update(()=>{fi(o.editor,40)})},isActive(){return!1}},yh={label:"Decrease indent",icon:Ch,action(o){o.editor.update(()=>{fi(o.editor,-40)})},isActive(){return!1}};var Sh='';var Lh='';var Mh='';var wh='';var vh='';var Dh='';var Oh='';var Ah='';var Rh=` `;var kh='';var Ih='';var dl={label:"Insert/edit link",icon:Sh,action(o){o.editor.getEditorState().read(()=>{let t=V(C(),Ft);ws(t,o)})},isActive(o){return de(o,Ft)}},$h={label:"Remove link",icon:Lh,action(o){o.editor.update(()=>{let t=ae(o.editor),e=V(t,Ft);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}},Yd={label:"Insert/Edit Image",icon:Mh,action(o){o.editor.getEditorState().read(()=>{let t=ae(o.editor),e=V(t,Qe);if(e){Em(e,o);return}Ns(n=>{o.editor.update(()=>{let r=im(n);Ce([r]),r.select()})})})},isActive(o){return de(o,Qe)}},Ph={label:"Insert horizontal line",icon:wh,action(o){o.editor.update(()=>{tn(ad(),!1)})},isActive(o){return de(o,qm)}},Zd={label:"Insert code block",icon:vh,action(o){ii(o.editor)},isActive(o){return de(o,bs)}},Bh=Object.assign({},Zd,{label:"Edit code block",icon:Dh}),Hh={label:"Insert/edit drawing",icon:Oh,action(o){o.editor.getEditorState().read(()=>{let t=ae(o.editor),e=V(t,mo);e===null?o.editor.update(()=>{let n=ar();tn(n,!0),mi(o,n),n.selectStart()}):mi(o,e)})},isActive(o){return de(o,mo)}},Fh={label:"Drawing manager",action(o){mp(o)},isActive(){return!1}},Vd={label:"Insert/edit media",icon:Ih,action(o){o.editor.getEditorState().read(()=>{let t=C(),e=V(t,St);bm(e,o)})},isActive(o){return de(o,St)}},Kh={label:"Insert collapsible block",icon:Ah,action(o){o.editor.update(()=>{let t=C(),e=Wa(),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):F().append(e);for(let s of i)e.append(s)})},isActive(o){return de(o,ce)}},Uh={label:"Edit label",icon:kh,action(o){o.editor.getEditorState().read(()=>{let t=V(C(),ce);ce(t)&&vs(t,o)})},isActive(o){return!1}},zh={label:"Toggle open/closed",icon:Rh,action(o){o.editor.update(()=>{let t=V(C(),ce);ce(t)&&(t.setOpen(!t.getOpen()),o.manager.triggerLayoutUpdate())})},isActive(o){return!1}},Wh={label:"Unwrap",icon:rl,action(o){o.editor.update(()=>{let t=V(C(),ce);ce(t)&&(Qs(t),o.manager.triggerLayoutUpdate())})},isActive(o){return!1}};var qh=` `;var cl=class extends oe{constructor(e,n){super([e]);p(this,"button");p(this,"dropdownButton");this.button=e,this.dropdownButton=new be({button:{label:"Menu",icon:qh},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 Tn=class extends Re{buildDOM(){return y("div",{class:"editor-separator"})}};function Yh(o){let t=o.manager.getDefaultDirection()==="rtl";return new Jr("editor-toolbar-main",[new Ie("history",2,[new w(bg),new w(_g)]),new tl([new et(y("h2"),Og),new et(y("h3"),Ag),new et(y("h4"),Rg),new et(y("h5"),kg),new et(y("blockquote"),Ig),new et(y("p"),$g),new be({button:{label:"Callouts",format:"long"},showOnHover:!0,direction:"vertical"},[new et(y("p",{class:"callout info"}),Mg),new et(y("p",{class:"callout success"}),Dg),new et(y("p",{class:"callout warning"}),vg),new et(y("p",{class:"callout danger"}),wg)])]),new Ie("inline_formats",6,[new w(Kd),new w(Ud),new w(Zg),new be({button:new pi(Vg,"color")},[new Nn(Gg)]),new be({button:new pi(Xg,"background-color")},[new Nn(Jg)]),new w(Qg),new w(eh),new w(th),new w(oh),new w(nh)]),new Ie("alignment",6,[new w(uh),new w(fh),new w(mh),new w(ph),t?new w(gh):null,t?new w(hh):null].filter(e=>e!==null)),new Ie("lists",3,[new w(Wd),new w(qd),new w(bh),new w(yh),new w(_h)]),new Ie("inserts",4,[new w(dl),new be({button:tg,direction:"vertical",showAside:!1},[new be({button:{label:"Insert",format:"long"},showOnHover:!0,showAside:!0},[new nl]),new Tn,new be({button:{label:"Cell",format:"long"},direction:"vertical",showOnHover:!0},[new w(pg),new w(gg),new w(hg)]),new be({button:{label:"Row",format:"long"},direction:"vertical",showOnHover:!0},[new w({...Id,format:"long"}),new w({...$d,format:"long"}),new w({...Pd,format:"long"}),new w(ig),new Tn,new w(sg),new w(lg),new w(ag),new w(dg)]),new be({button:{label:"Column",format:"long"},direction:"vertical",showOnHover:!0},[new w({...Bd,format:"long"}),new w({...Hd,format:"long"}),new w({...Fd,format:"long"}),new Tn,new w(cg),new w(ug),new w(fg),new w(mg)]),new Tn,new w({...Rd,format:"long"}),new w(og),new w(ng),new w(rg)]),new w(Yd),new w(Ph),new w(Zd),new cl(new w(Hh),[new w(Fh)]),new w(Vd),new w(Kh)]),new Ie("meta",3,[new w(yg),new w(Lg),new w(Sg)])])}function Xd(o){return new Jr("editor-toolbar-main",[new Ie("formats",7,[new w(Kd),new w(Ud),new w(dl),new w(Wd),new w(qd)])])}var Ni={image:{selector:"img:not([drawio-diagram] img)",content:()=>[new w(Yd)]},media:{selector:".editor-media-wrap",content:()=>[new w(Vd)]},link:{selector:"a:not([data-mention-user-id])",content(){return[new w(dl),new w($h)]},displayTargetLocator(o){return o.querySelector("img")||o}},code:{selector:".editor-code-block-wrap",content:()=>[new w(Bh)]},table:{selector:"td,th",content(){return[new Ie("table",2,[new w(Rd),new w(kd)]),new Ie("table_row",3,[new w(Id),new w($d),new w(Pd)]),new Ie("table_column",3,[new w(Bd),new w(Hd),new w(Fd)])]},displayTargetLocator(o){return o.closest("table")}},details:{selector:"details",content(){return[new w(Uh),new w(zh),new w(Wh)]}}};var ul=class extends Re{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 Zh={submitText:"Save",async action(o,t){return Po(t.editor,o.get("source")?.toString()||""),!0},fields:[{label:"Source",name:"source",type:"textarea"}]},Vh={submitText:"Close",async action(){return!0},fields:[{build(){return new ul("/help/wysiwyg")}}]};var xi={link:{title:"Insert/Edit Link",form:Cm},image:{title:"Insert/Edit Image",form:Tm},media:{title:"Insert/Edit Media",form:_m},source:{title:"Source code",form:Zh},cell_properties:{title:"Cell Properties",form:Rp},row_properties:{title:"Row Properties",form:Ip},table_properties:{title:"Table Properties",form:Pp},details:{title:"Edit collapsible block",form:ym},about:{title:"About the WYSIWYG Editor",form:Vh}};var Bo=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 fl=class extends Bo{constructor(){super(...arguments);p(this,"completedSetup",!1);p(this,"latestCode","");p(this,"latestLanguage","");p(this,"editor",null)}setup(e){let n=this.getNode(),r=e.querySelector("pre");if(!r)return;r&&(r.hidden=!0),this.latestCode=n.__code,this.latestLanguage=n.__language;let s=this.latestCode.split(` -`).length*19.2+18+24;e.style.height=`${s}px`;let l=Date.now();e.addEventListener("click",u=>{requestAnimationFrame(()=>{this.context.editor.update(()=>{Be(this.getNode())})})}),e.addEventListener("dblclick",u=>{this.context.editor.getEditorState().read(()=>{ei(this.context.editor,this.getNode())})});let a=u=>{e.classList.toggle("selected",ts(u,n))};this.context.manager.onSelectionChange(a),this.onDestroy(()=>{this.context.manager.offSelectionChange(a)});let d=u=>{this.editor=u.wysiwygView(e,document,this.latestCode,this.latestLanguage),setTimeout(()=>{e.style.height=""},12)};window.importVersioned("code").then(u=>{let m=Date.now()-l<20?20:0;setTimeout(()=>d(u),m)}),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){this.completedSetup?this.update():this.setup(e)}};var ml=class extends Bo{constructor(){super(...arguments);p(this,"completedSetup",!1)}setup(e){let n=this.getNode();e.classList.add("editor-diagram"),this.context.editor.registerCommand(Wt,i=>e.contains(i.target)?(this.context.editor.update(()=>{Be(this.getNode())}),!0):!1,lo),e.addEventListener("dblclick",i=>{this.context.editor.getEditorState().read(()=>{mi(this.context,this.getNode())})});let r=i=>{e.classList.toggle("selected",ts(i,n))};this.context.manager.onSelectionChange(r),this.onDestroy(()=>{this.context.manager.offSelectionChange(r)}),this.completedSetup=!0}update(){}render(e){this.completedSetup?this.update():this.setup(e)}};function lC(o){return H(o)||Qe(o)||St(o)||mo(o)||K(o)||ce(o)}function aC(o){if(o.target instanceof HTMLElement){let t=o.target.closest("details");if(t){let e=G(t);if(ce(e))return e}}return F()}function dC(o,t){let e=aC(t),n=e.getLastChild();if(!n||!lC(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 Xh(o){let t=o.editor.registerCommand(Wt,e=>(dC(o,e),!1),Ae);return()=>{t()}}var jd=new Set;function cC(o){for(let n of jd)n.classList.remove("selected"),jd.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"),jd.add(n))}return!1}function jh(o){let t=o.editor.registerCommand(_e,()=>(cC(o),!1),Ae);return()=>{t()}}var Cn,Ei,Gd=class{constructor(t,e){vt(this,Cn);vt(this,Ei,!1);po(this,Cn,new w({label:t.label||"",icon:t.icon||"",action:()=>{t.action()},isActive:()=>Me(this,Ei)})),Me(this,Cn).setContext(e)}setActive(t=!0){po(this,Ei,t),Me(this,Cn).setActiveState(t)}_getOriginalModel(){return Me(this,Cn)}};Cn=new WeakMap,Ei=new WeakMap;var Ti,Jd=class{constructor(t){vt(this,Ti);po(this,Ti,t)}getSections(){return Me(this,Ti).getChildren().filter(e=>e instanceof Ie).map(e=>new Qd(e))}};Ti=new WeakMap;var bn,Qd=class{constructor(t){vt(this,bn);po(this,bn,t)}getLabel(){return Me(this,bn).getLabel()}addButton(t,e=-1){Me(this,bn).addChild(t._getOriginalModel(),e),Me(this,bn).rebuildDOM()}};bn=new WeakMap;var fr,pl=class{constructor(t){vt(this,fr);po(this,fr,t)}createButton(t){return new Gd(t,Me(this,fr))}getMainToolbar(){let t=Me(this,fr).manager.getToolbar();return t?new Jd(t):null}};fr=new WeakMap;var _n,gl=class{constructor(t){vt(this,_n);po(this,_n,t)}insertHtml(t,e="selection"){let n=["start","end","selection"];if(!n.includes(e))throw new Error(`Invalid position: ${e}. Valid positions are: ${n.join(", ")}`);e==="start"?zs(Me(this,_n).editor,t):e==="end"?Us(Me(this,_n).editor,t):Ws(Me(this,_n).editor,t)}};_n=new WeakMap;var mr=class{constructor(t){p(this,"ui");p(this,"content");this.ui=new pl(t),this.content=new gl(t)}};function pr(o){return o instanceof HTMLElement}function Gh(o){o.innerHTML='
    '}var Ho,ec,tc,hl=class{constructor(t,e=null,n=null){vt(this,Ho);p(this,"containers");p(this,"onEscape");p(this,"onEnter");this.containers=[t],this.onEscape=e,this.onEnter=n,t.addEventListener("keydown",hr(this,Ho,ec).bind(this))}shareHandlingToEl(t){this.containers.push(t),t.addEventListener("keydown",hr(this,Ho,ec).bind(this))}focusNext(){let t=hr(this,Ho,tc).call(this),e=document.activeElement,r=(pr(e)?t.indexOf(e):-1)+1;r>=t.length&&(r=0),t[r].focus()}focusPrevious(){let t=hr(this,Ho,tc).call(this),e=document.activeElement,r=(pr(e)?t.indexOf(e):-1)-1;r<0&&(r=t.length-1),t[r].focus()}};Ho=new WeakSet,ec=function(t){pr(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):pr(document.activeElement)&&document.activeElement.blur():t.key==="Enter"&&this.onEnter&&this.onEnter(t))},tc=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 r=[...n.querySelectorAll(e)].filter(i=>pr(i));t.push(...r)}return t};function uC(o){return t=>{let e=t.target.closest("a[data-id]");if(!e)return;let n=Number(e.dataset.id||"0"),r=e.dataset.name||"",i=e.dataset.slug||"";o(n,r,i),t.preventDefault()}}function fC(o,t,e,n){t.addEventListener("keydown",i=>{i.key==="Escape"&&n()},{signal:e.signal});let r=t.querySelector("input");r.addEventListener("keydown",i=>{i.key==="Backspace"&&r.value===""&&(n(),i.preventDefault(),i.stopPropagation())},{signal:e.signal}),o.editorDOM.addEventListener("click",i=>{n()},{signal:e.signal}),o.editorDOM.addEventListener("keydown",i=>{n()},{signal:e.signal})}function mC(o){let t=new Map,e=async i=>{for(let d of[...o.children])d.remove();let s="";if(t.has(i))s=t.get(i)||"";else{let d=y("div",{class:"flex-container-row items-center dropdown-search-item"});Gh(d),o.appendChild(d),s=(await window.$http.get(`/search/users/mention?search=${i}`)).data,t.set(i,s),d.remove()}let a=[...es(s).body.children];for(let d of a){let u=window.document.adoptNode(d);o.appendChild(u)}};e("");let n=o.parentElement?.querySelector("input"),r=Qf(e,200,!1);n.addEventListener("input",()=>{let i=n.value;r(i)})}function pC(o,t){let e=y("input",{type:"text"}),n=y("div",{class:"dropdown-search-list"}),r=y("div");r.innerHTML=xs;let i=r.children[0];i.classList.add("svg-icon");let s=y("div",{class:"dropdown-search-dropdown compact card"},[y("div",{class:"dropdown-search-search"},[i,e]),n]);o.containerDOM.appendChild(s),s.style.display="block",s.style.top="0",s.style.left="0";let l=t.getBoundingClientRect(),a=s.getBoundingClientRect();return s.style.top=`${l.bottom-a.top+3}px`,s.style.left=`${l.left-a.left}px`,e.focus(),s}var gr=class extends Bo{constructor(){super(...arguments);p(this,"abortController",null);p(this,"dropdownContainer",null);p(this,"mentionElement",null)}setup(e){this.mentionElement=e,e.addEventListener("click",n=>{this.showSelection(),n.preventDefault(),n.stopPropagation()})}showSelection(){!this.mentionElement||this.dropdownContainer||(this.hideSelection(),this.abortController=new AbortController,this.dropdownContainer=pC(this.context,this.mentionElement),mC(this.dropdownContainer.querySelector(".dropdown-search-list")),this.dropdownContainer.addEventListener("click",uC((e,n,r)=>{this.context.editor.update(()=>{let i=this.getNode();this.hideSelection(),i.setUserDetails(e,n,r),i.selectNext()})}),{signal:this.abortController.signal}),fC(this.context,this.dropdownContainer,this.abortController,()=>{this.getNode().hasUserSet()?this.hideSelection():this.revertMention()}),new hl(this.dropdownContainer))}hideSelection(){this.abortController?.abort(),this.dropdownContainer?.remove(),this.abortController=null,this.dropdownContainer=null,this.context.manager.focus()}revertMention(){this.hideSelection(),this.context.editor.update(()=>{let e=z("@"),n=this.getNode().getPreviousSibling();this.getNode().replace(e),requestAnimationFrame(()=>{this.context.editor.update(()=>{e.isAttached()?e.selectEnd():n?.isAttached()&&n?.selectEnd()})})})}render(e){this.setup(e)}};function gC(o,t){let e=t.getNodes()[0],n=t.getStartEndPoints();if(!n)return;let r=n[0].offset,i=r===0,s=e.getTextContent().charAt(r-1)===" ";if(!i&&!s)return;let l=e.splitText(r),a=l[0],d=l[i?0:1],u=dd(0,"","");a.insertAfter(u),d.spliceText(0,1,"",!1),Be(u),requestAnimationFrame(()=>{let m=o.manager.getDecoratorByNodeKey(u.getKey());m instanceof gr&&m.showSelection()})}function hC(o,t){let e=C()?.getNodes()||[];if(e.length===1&&Ym(e[0])){let n=e[0];return o.manager.getDecoratorByNodeKey(n.getKey()).showSelection(),t.preventDefault(),t.stopPropagation(),!0}return!1}function Jh(o){let t=o.editor,e=t.registerCommand(_i,function(r){let i=C();return _(i)&&i.isCollapsed()&&window.setTimeout(()=>{t.update(()=>{gC(o,i)})},1),!1},lo),n=t.registerCommand(we,function(r){return hC(o,r)},lo);return()=>{e(),n()}}var oc={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 GF(o,t,e={}){let n=Gr({namespace:"BookStackPageEditor",nodes:Zm(),onError:console.error,theme:oc}),r=Ks(o,n,{...e,editorClass:"page-content"});n.setRootElement(r.editorDOM),Et(ms(n),ss(n,ls(),300),js(r),Np(r),Xh(r),jh(r),Gm(n,r.scrollDOM),np(n),op(n,r.editorDOM),tp(r),lp(r),el(n)),r.manager.setToolbar(Yh(r));for(let s of Object.keys(Ni))r.manager.registerContextToolbar(s,Ni[s]);for(let s of Object.keys(xi))r.manager.registerModal(s,xi[s]);r.manager.registerDecoratorType("code",fl),r.manager.registerDecoratorType("diagram",ml),Jm(n),Po(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(),Xm(r),window.$events.emitPublic(o,"editor-wysiwyg::post-init",{usage:"page-editor",api:new mr(r)}),new Ci(r)}function JF(o,t,e={}){let n=Gr({namespace:"BookStackBasicEditor",nodes:cd(),onError:console.error,theme:oc}),r=Ks(o,n,e);n.setRootElement(r.editorDOM);let i=Et(ms(n),ss(n,ls(),300),js(r),el(n));return r.manager.setToolbar(Xd(r)),r.manager.registerContextToolbar("link",Ni.link),r.manager.registerModal("link",xi.link),r.manager.onTeardown(i),Po(n,t),window.$events.emitPublic(o,"editor-wysiwyg::post-init",{usage:"description-editor",api:new mr(r)}),new Ci(r)}function QF(o,t,e={}){let n=Gr({namespace:"BookStackCommentEditor",nodes:Vm(),onError:console.error,theme:oc}),r=Ks(o,n,e);n.setRootElement(r.editorDOM);let i=Et(ms(n),ss(n,ls(),300),js(r),el(n),Jh(r));return r.manager.setToolbar(Xd(r)),r.manager.registerContextToolbar("link",Ni.link),r.manager.registerModal("link",xi.link),r.manager.onTeardown(i),r.manager.registerDecoratorType("mention",gr),Po(n,t),window.$events.emitPublic(o,"editor-wysiwyg::post-init",{usage:"comment-editor",api:new mr(r)}),new Ci(r)}var Ci=class{constructor(t){p(this,"context");p(this,"onChangeListeners",[]);p(this,"editorListenerTeardown",null);this.context=t}async getContentAsHtml(){return await qs(this.context.editor)}onChange(t){this.onChangeListeners.push(t),this.startListeningToChanges()}focus(){Ys(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{Ci as SimpleWysiwygEditorInterface,JF as createBasicEditorInstance,QF as createCommentEditorInstance,GF as createPageEditorInstance}; +`).length*19.2+18+24;e.style.height=`${s}px`;let l=Date.now();e.addEventListener("click",u=>{requestAnimationFrame(()=>{this.context.editor.update(()=>{Be(this.getNode())})})}),e.addEventListener("dblclick",u=>{this.context.editor.getEditorState().read(()=>{ei(this.context.editor,this.getNode())})});let a=u=>{e.classList.toggle("selected",ts(u,n))};this.context.manager.onSelectionChange(a),this.onDestroy(()=>{this.context.manager.offSelectionChange(a)});let d=u=>{this.editor=u.wysiwygView(e,document,this.latestCode,this.latestLanguage),setTimeout(()=>{e.style.height=""},12)};window.importVersioned("code").then(u=>{let m=Date.now()-l<20?20:0;setTimeout(()=>d(u),m)}),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){this.completedSetup?this.update():this.setup(e)}};var ml=class extends Bo{constructor(){super(...arguments);p(this,"completedSetup",!1)}setup(e){let n=this.getNode();e.classList.add("editor-diagram"),this.context.editor.registerCommand(Wt,i=>e.contains(i.target)?(this.context.editor.update(()=>{Be(this.getNode())}),!0):!1,lo),e.addEventListener("dblclick",i=>{this.context.editor.getEditorState().read(()=>{mi(this.context,this.getNode())})});let r=i=>{e.classList.toggle("selected",ts(i,n))};this.context.manager.onSelectionChange(r),this.onDestroy(()=>{this.context.manager.offSelectionChange(r)}),this.completedSetup=!0}update(){}render(e){this.completedSetup?this.update():this.setup(e)}};function lC(o){return H(o)||Qe(o)||St(o)||mo(o)||K(o)||ce(o)}function aC(o){if(o.target instanceof HTMLElement){let t=o.target.closest("details");if(t){let e=G(t);if(ce(e))return e}}return F()}function dC(o,t){let e=aC(t),n=e.getLastChild();if(!n||!lC(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 Xh(o){let t=o.editor.registerCommand(Wt,e=>(dC(o,e),!1),Ae);return()=>{t()}}var jd=new Set;function cC(o){for(let n of jd)n.classList.remove("selected"),jd.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"),jd.add(n))}return!1}function jh(o){let t=o.editor.registerCommand(_e,()=>(cC(o),!1),Ae);return()=>{t()}}var Cn,Ei,Gd=class{constructor(t,e){vt(this,Cn);vt(this,Ei,!1);po(this,Cn,new w({label:t.label||"",icon:t.icon||"",action:()=>{t.action()},isActive:()=>Me(this,Ei)})),Me(this,Cn).setContext(e)}setActive(t=!0){po(this,Ei,t),Me(this,Cn).setActiveState(t)}_getOriginalModel(){return Me(this,Cn)}};Cn=new WeakMap,Ei=new WeakMap;var Ti,Jd=class{constructor(t){vt(this,Ti);po(this,Ti,t)}getSections(){return Me(this,Ti).getChildren().filter(e=>e instanceof Ie).map(e=>new Qd(e))}};Ti=new WeakMap;var bn,Qd=class{constructor(t){vt(this,bn);po(this,bn,t)}getLabel(){return Me(this,bn).getLabel()}addButton(t,e=-1){Me(this,bn).addChild(t._getOriginalModel(),e),Me(this,bn).rebuildDOM()}};bn=new WeakMap;var fr,pl=class{constructor(t){vt(this,fr);po(this,fr,t)}createButton(t){return new Gd(t,Me(this,fr))}getMainToolbar(){let t=Me(this,fr).manager.getToolbar();return t?new Jd(t):null}};fr=new WeakMap;var _n,gl=class{constructor(t){vt(this,_n);po(this,_n,t)}insertHtml(t,e="selection"){let n=["start","end","selection"];if(!n.includes(e))throw new Error(`Invalid position: ${e}. Valid positions are: ${n.join(", ")}`);e==="start"?zs(Me(this,_n).editor,t):e==="end"?Us(Me(this,_n).editor,t):Ws(Me(this,_n).editor,t)}};_n=new WeakMap;var mr=class{constructor(t){p(this,"ui");p(this,"content");this.ui=new pl(t),this.content=new gl(t)}};function pr(o){return o instanceof HTMLElement}function Gh(o){o.innerHTML='
    '}var Ho,ec,tc,hl=class{constructor(t,e=null,n=null){vt(this,Ho);p(this,"containers");p(this,"onEscape");p(this,"onEnter");this.containers=[t],this.onEscape=e,this.onEnter=n,t.addEventListener("keydown",hr(this,Ho,ec).bind(this))}shareHandlingToEl(t){this.containers.push(t),t.addEventListener("keydown",hr(this,Ho,ec).bind(this))}focusNext(){let t=hr(this,Ho,tc).call(this),e=document.activeElement,r=(pr(e)?t.indexOf(e):-1)+1;r>=t.length&&(r=0),t[r].focus()}focusPrevious(){let t=hr(this,Ho,tc).call(this),e=document.activeElement,r=(pr(e)?t.indexOf(e):-1)-1;r<0&&(r=t.length-1),t[r].focus()}};Ho=new WeakSet,ec=function(t){pr(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):pr(document.activeElement)&&document.activeElement.blur():t.key==="Enter"&&this.onEnter&&this.onEnter(t))},tc=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 r=[...n.querySelectorAll(e)].filter(i=>pr(i));t.push(...r)}return t};function uC(o){return t=>{let e=t.target.closest("a[data-id]");if(!e)return;let n=Number(e.dataset.id||"0"),r=e.dataset.name||"",i=e.dataset.slug||"";o(n,r,i),t.preventDefault()}}function fC(o,t,e,n){t.addEventListener("keydown",i=>{i.key==="Escape"&&n()},{signal:e.signal});let r=t.querySelector("input");r.addEventListener("keydown",i=>{i.key==="Backspace"&&r.value===""&&(n(),i.preventDefault(),i.stopPropagation())},{signal:e.signal}),o.editorDOM.addEventListener("click",i=>{n()},{signal:e.signal}),o.editorDOM.addEventListener("keydown",i=>{n()},{signal:e.signal})}function mC(o){let t=new Map,e=async i=>{for(let d of[...o.children])d.remove();let s="";if(t.has(i))s=t.get(i)||"";else{let d=y("div",{class:"flex-container-row items-center dropdown-search-item"});Gh(d),o.appendChild(d),s=(await window.$http.get(`/search/users/mention?search=${i}`)).data,t.set(i,s),d.remove()}let a=[...es(s).body.children];for(let d of a){let u=window.document.adoptNode(d);o.appendChild(u)}};e("");let n=o.parentElement?.querySelector("input"),r=Qf(e,200,!1);n.addEventListener("input",()=>{let i=n.value;r(i)})}function pC(o,t){let e=y("input",{type:"text"}),n=y("div",{class:"dropdown-search-list"}),r=y("div");r.innerHTML=xs;let i=r.children[0];i.classList.add("svg-icon");let s=y("div",{class:"dropdown-search-dropdown compact card"},[y("div",{class:"dropdown-search-search"},[i,e]),n]);o.containerDOM.appendChild(s),s.style.display="block",s.style.top="0",s.style.left="0";let l=t.getBoundingClientRect(),a=s.getBoundingClientRect();return s.style.top=`${l.bottom-a.top+3}px`,s.style.left=`${l.left-a.left}px`,e.focus(),s}var gr=class extends Bo{constructor(){super(...arguments);p(this,"abortController",null);p(this,"dropdownContainer",null);p(this,"mentionElement",null)}setup(e){this.mentionElement=e,e.addEventListener("click",n=>{this.showSelection(),n.preventDefault(),n.stopPropagation()})}showSelection(){!this.mentionElement||this.dropdownContainer||(this.hideSelection(),this.abortController=new AbortController,this.dropdownContainer=pC(this.context,this.mentionElement),mC(this.dropdownContainer.querySelector(".dropdown-search-list")),this.dropdownContainer.addEventListener("click",uC((e,n,r)=>{this.context.editor.update(()=>{let i=this.getNode();this.hideSelection(),i.setUserDetails(e,n,r),i.selectNext()})}),{signal:this.abortController.signal}),fC(this.context,this.dropdownContainer,this.abortController,()=>{this.getNode().hasUserSet()?this.hideSelection():this.revertMention()}),new hl(this.dropdownContainer))}hideSelection(){this.abortController?.abort(),this.dropdownContainer?.remove(),this.abortController=null,this.dropdownContainer=null,this.context.manager.focus()}revertMention(){this.hideSelection(),this.context.editor.update(()=>{let e=z("@"),n=this.getNode().getPreviousSibling();this.getNode().replace(e),requestAnimationFrame(()=>{this.context.editor.update(()=>{e.isAttached()?e.selectEnd():n?.isAttached()&&n?.selectEnd()})})})}render(e){this.setup(e)}};function gC(o,t){let e=t.getNodes()[0],n=t.getStartEndPoints();if(!n)return;let r=n[0].offset,i=r===0,s=e.getTextContent().charAt(r-1)===" ";if(!i&&!s)return;let l=e.splitText(r),a=l[0],d=l[i?0:1],u=dd(0,"","");a.insertAfter(u),d.spliceText(0,1,"",!1),Be(u),requestAnimationFrame(()=>{let m=o.manager.getDecoratorByNodeKey(u.getKey());m instanceof gr&&m.showSelection()})}function hC(o,t){let e=C()?.getNodes()||[];if(e.length===1&&Ym(e[0])){let n=e[0];return o.manager.getDecoratorByNodeKey(n.getKey()).showSelection(),t.preventDefault(),t.stopPropagation(),!0}return!1}function Jh(o){let t=o.editor,e=t.registerCommand(_i,function(r){let i=C();return _(i)&&i.isCollapsed()&&window.setTimeout(()=>{t.update(()=>{gC(o,i)})},1),!1},lo),n=t.registerCommand(we,function(r){return hC(o,r)},lo);return()=>{e(),n()}}var oc={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 XF(o,t,e={}){let n=Gr({namespace:"BookStackPageEditor",nodes:Zm(),onError:console.error,theme:oc}),r=Ks(o,n,{...e,editorClass:"page-content"});n.setRootElement(r.editorDOM),Et(ms(n),ss(n,ls(),300),js(r),Np(r),Xh(r),jh(r),Gm(n,r.scrollDOM),np(n),op(n,r.editorDOM),tp(r),lp(r),el(n)),r.manager.setToolbar(Yh(r));for(let s of Object.keys(Ni))r.manager.registerContextToolbar(s,Ni[s]);for(let s of Object.keys(xi))r.manager.registerModal(s,xi[s]);r.manager.registerDecoratorType("code",fl),r.manager.registerDecoratorType("diagram",ml),Jm(n),Po(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(),Xm(r),window.$events.emitPublic(o,"editor-wysiwyg::post-init",{usage:"page-editor",api:new mr(r)}),new Ci(r)}function jF(o,t,e={}){let n=Gr({namespace:"BookStackBasicEditor",nodes:cd(),onError:console.error,theme:oc}),r=Ks(o,n,e);n.setRootElement(r.editorDOM);let i=Et(ms(n),ss(n,ls(),300),js(r),el(n));return r.manager.setToolbar(Xd(r)),r.manager.registerContextToolbar("link",Ni.link),r.manager.registerModal("link",xi.link),r.manager.onTeardown(i),Po(n,t),window.$events.emitPublic(o,"editor-wysiwyg::post-init",{usage:"description-editor",api:new mr(r)}),new Ci(r)}function GF(o,t,e={}){let n=Gr({namespace:"BookStackCommentEditor",nodes:Vm(),onError:console.error,theme:oc}),r=Ks(o,n,e);n.setRootElement(r.editorDOM);let i=Et(ms(n),ss(n,ls(),300),js(r),el(n),Jh(r));return r.manager.setToolbar(Xd(r)),r.manager.registerContextToolbar("link",Ni.link),r.manager.registerModal("link",xi.link),r.manager.onTeardown(i),r.manager.registerDecoratorType("mention",gr),Po(n,t),window.$events.emitPublic(o,"editor-wysiwyg::post-init",{usage:"comment-editor",api:new mr(r)}),new Ci(r)}var Ci=class{constructor(t){p(this,"context");p(this,"onChangeListeners",[]);p(this,"editorListenerTeardown",null);this.context=t}async getContentAsHtml(){return await qs(this.context.editor)}onChange(t){this.onChangeListeners.push(t),this.startListeningToChanges()}focus(){Ys(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{Ci as SimpleWysiwygEditorInterface,jF as createBasicEditorInstance,GF as createCommentEditorInstance,XF as createPageEditorInstance}; //# sourceMappingURL=wysiwyg.js.map diff --git a/version b/version index 43874c5da..08d918cf1 100644 --- a/version +++ b/version @@ -1 +1 @@ -v26.03.3 +v26.03.4