diff --git a/public/dist/app.js b/public/dist/app.js index 07971db87..d2139ad7a 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 Xn=Object.defineProperty;var yo=(i,t,e)=>t in i?Xn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var fe=(i,t)=>{for(var e in t)Xn(i,e,{get:t[e],enumerable:!0})};var U=(i,t,e)=>(yo(i,typeof t!="symbol"?t+"":t,e),e),Co=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var Yi=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)};var jt=(i,t,e)=>(Co(i,t,"access private method"),e);var Qi={};fe(Qi,{emit:()=>Zi,emitPublic:()=>So,error:()=>Ji,listen:()=>xo,showResponseError:()=>$o,showValidationErrors:()=>Lo,success:()=>ko});var me={},Eo=[];function Zi(i,t){Eo.push({name:i,data:t});let e=me[i]||[];for(let n of e)n(t)}function xo(i,t){typeof me[i]>"u"&&(me[i]=[]),me[i].push(t)}function So(i,t,e){let n=new CustomEvent(t,{detail:e,bubbles:!0});i.dispatchEvent(n)}function ko(i){Zi("success",i)}function Ji(i){Zi("error",i)}function Lo(i){if(i.status&&i.status===422&&i.data){let t=Object.values(i.data).flat().join(` -`);Ji(t)}}function $o(i){i.status&&i.status>=400&&i.data&&i.data.message&&Ji(i.data.message)}var tn={};fe(tn,{HttpError:()=>ge,createXMLHttpRequest:()=>Do,delete:()=>Po,get:()=>Ao,patch:()=>Bo,post:()=>Io,put:()=>Mo});async function To(i){if(i.status===204)return null;let e=(i.headers.get("Content-Type")||"").split(";")[0].split("/").pop();return e==="javascript"||e==="json"?i.json():i.text()}var ge=class extends Error{constructor(t,e){super(t.statusText),this.data=e,this.headers=t.headers,this.redirected=t.redirected,this.status=t.status,this.statusText=t.statusText,this.url=t.url,this.original=t}};function Do(i,t,e={}){let n=document.querySelector("meta[name=token]").getAttribute("content"),s=new XMLHttpRequest;for(let[o,r]of Object.entries(e))s.addEventListener(o,r.bind(s));return s.open(i,t),s.withCredentials=!0,s.setRequestHeader("X-CSRF-TOKEN",n),s}async function Gn(i,t={}){let e=i;if(e.startsWith("http")||(e=window.baseUrl(e)),t.params){let l=new URL(e);for(let c of Object.keys(t.params)){let h=t.params[c];typeof h<"u"&&h!==null&&l.searchParams.set(c,h)}e=l.toString()}let n=document.querySelector("meta[name=token]").getAttribute("content"),s={...t,credentials:"same-origin"};s.headers={...s.headers||{},baseURL:window.baseUrl(""),"X-CSRF-TOKEN":n};let o=await fetch(e,s),r=await To(o),a={data:r,headers:o.headers,redirected:o.redirected,status:o.status,statusText:o.statusText,url:o.url,original:o};if(!o.ok)throw new ge(o,r);return a}async function we(i,t,e=null){let n={method:i,body:e};return typeof e=="object"&&!(e instanceof FormData)&&(n.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},n.body=JSON.stringify(e)),e instanceof FormData&&i!=="post"&&(e.append("_method",i),n.method="post"),Gn(t,n)}async function Ao(i,t={}){return Gn(i,{method:"GET",params:t})}async function Io(i,t=null){return we("POST",i,t)}async function Mo(i,t=null){return we("PUT",i,t)}async function Bo(i,t=null){return we("PATCH",i,t)}async function Po(i,t=null){return we("DELETE",i,t)}var en=class{constructor(){this.store=new Map,this.parseTranslations()}parseTranslations(){let t=document.querySelectorAll('meta[name="translation"]');for(let e of t){let n=e.getAttribute("key"),s=e.getAttribute("value");this.store.set(n,s)}}get(t,e){let n=this.getTransText(t);return this.performReplacements(n,e)}getPlural(t,e,n){let s=this.getTransText(t);return this.parsePlural(s,e,n)}parsePlural(t,e,n){let s=t.split("|"),o=/^{([0-9]+)}/,r=/^\[([0-9]+),([0-9*]+)]/,a=null;for(let l of s){let c=l.match(o);if(c!==null&&Number(c[1])===e){a=l.replace(o,"").trim();break}let h=l.match(r);if(h!==null&&Number(h[1])<=e&&(h[2]==="*"||Number(h[2])>=e)){a=l.replace(r,"").trim();break}}return a===null&&s.length>1&&(a=e===1?s[0]:s[1]),a===null&&(a=s[0]),this.performReplacements(a,n)}getTransText(t){let e=this.store.get(t);return e===void 0&&console.warn(`Translation with key "${t}" does not exist`),e}performReplacements(t,e){if(!e)return t;let n=t.match(/:(\S+)/g);if(n===null)return t;let s=t;return n.forEach(o=>{let r=o.substring(1);typeof e[r]>"u"||(s=s.replace(o,e[r]))}),s}},Yn=en;var an={};fe(an,{first:()=>Fo,firstOnElement:()=>Ho,get:()=>Ro,init:()=>on,register:()=>rn});function nn(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 Zn(i){return i.replace(/[A-Z]/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}var Wt={},Jn={},sn=new WeakMap;function Oo(i,t){let e={},n={},s=`${i}@`,o=`[refs*="${s}"]`,r=[...t.querySelectorAll(o)];t.matches(o)&&r.push(t);for(let a of r){let l=a.getAttribute("refs").split(" ").filter(c=>c.startsWith(s)).map(c=>c.replace(s,"")).map(nn);for(let c of l)e[c]=a,typeof n[c]>"u"&&(n[c]=[]),n[c].push(a)}return{refs:e,manyRefs:n}}function _o(i,t){let e={},n=`option:${i}:`;for(let{name:s,value:o}of t.attributes)if(s.startsWith(n)){let r=s.replace(n,"");e[nn(r)]=o||""}return e}function No(i,t){let e=Jn[i];if(e===void 0)return;let n;try{n=new e,n.$name=i,n.$el=t;let o=Oo(i,t);n.$refs=o.refs,n.$manyRefs=o.manyRefs,n.$opts=_o(i,t),n.setup()}catch(o){console.error("Failed to create component",o,i,t)}typeof Wt[i]>"u"&&(Wt[i]=[]),Wt[i].push(n);let s=sn.get(t)||{};s[i]=n,sn.set(t,s)}function on(i=document){let t=i.querySelectorAll("[component],[components]");for(let e of t){let n=`${e.getAttribute("component")||""} ${e.getAttribute("components")}`.toLowerCase().split(" ").filter(Boolean);for(let s of n)No(s,e)}}function rn(i){let t=Object.keys(i);for(let e of t)Jn[Zn(e)]=i[e]}function Fo(i){return(Wt[i]||[null])[0]}function Ro(i){return Wt[i]||[]}function Ho(i,t){return(sn.get(i)||{})[t]||null}var Wn={};fe(Wn,{AddRemoveRows:()=>ve,AjaxDeleteRow:()=>ye,AjaxForm:()=>Ce,Attachments:()=>Ee,AttachmentsList:()=>xe,AutoSubmit:()=>ke,AutoSuggest:()=>Se,BackToTop:()=>Le,BookSort:()=>ze,ChapterContents:()=>We,CodeEditor:()=>Ke,CodeHighlighter:()=>Xe,CodeTextarea:()=>Ge,Collapsible:()=>Ye,ConfirmDialog:()=>Ze,CustomCheckbox:()=>Je,DetailsHighlighter:()=>Qe,Dropdown:()=>ti,DropdownSearch:()=>ei,Dropzone:()=>ii,EditorToolbox:()=>ni,EntityPermissions:()=>si,EntitySearch:()=>oi,EntitySelector:()=>ri,EntitySelectorPopup:()=>ai,EventEmitSelect:()=>li,ExpandToggle:()=>ci,GlobalSearch:()=>di,HeaderMobileToggle:()=>hi,ImageManager:()=>ui,ImagePicker:()=>pi,ListSortControl:()=>fi,MarkdownEditor:()=>mi,NewUserPassword:()=>gi,Notification:()=>wi,OptionalInput:()=>bi,PageComment:()=>Si,PageComments:()=>ki,PageDisplay:()=>Li,PageEditor:()=>$i,PagePicker:()=>Di,PermissionsTable:()=>Ai,Pointer:()=>Ii,Popup:()=>Mi,SettingAppColorScheme:()=>Bi,SettingColorPicker:()=>Pi,SettingHomepageControl:()=>Oi,ShelfSort:()=>_i,ShortcutInput:()=>Fi,Shortcuts:()=>Ni,SortableList:()=>Ri,SubmitOnChange:()=>Hi,Tabs:()=>qi,TagManager:()=>Ui,TemplateManager:()=>Vi,ToggleSwitch:()=>zi,TriLayout:()=>ji,UserSelect:()=>Wi,WebhookEvents:()=>Ki,WysiwygEditor:()=>Xi,WysiwygInput:()=>Gi});function it(i,t={},e=[]){let n=document.createElement(i);for(let[s,o]of Object.entries(t))o===null?n.removeAttribute(s):n.setAttribute(s,o);for(let s of e)typeof s=="string"?n.append(document.createTextNode(s)):n.append(s);return n}function ln(i,t){let e=document.querySelectorAll(i);for(let n of e)t(n)}function be(i,t,e){for(let n of t)i.addEventListener(n,e)}function x(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 Qn(i,t,e){Array.isArray(t)||(t=[t]);let n=s=>{s.key===i&&e(s)};t.forEach(s=>s.addEventListener("keydown",n))}function Lt(i,t){Qn("Enter",i,t)}function ts(i,t){Qn("Escape",i,t)}function A(i,t,e,n){i.addEventListener(e,s=>{let o=s.target.closest(t);o&&n.call(o,s,o)})}function es(i,t){let e=document.querySelectorAll(i);t=t.toLowerCase();for(let n of e)if(n.textContent.toLowerCase().includes(t))return n;return null}function Kt(i){i.innerHTML='
'}function $t(){let i=document.createElement("div");return i.classList.add("loading-container"),i.innerHTML="
",i}function Xt(i){let t=i.querySelectorAll(".loading-container");for(let e of t)e.remove()}function nt(i){let t=document.createElement("div");return t.innerHTML=i,window.$components.init(t),t.children[0]}function Tt(i,t,e){let n;return function(...o){let r=this,a=function(){n=null,e||i.apply(r,o)},l=e&&!n;clearTimeout(n),n=setTimeout(a,t),l&&i.apply(r,o)}}function dn(i){if(!i)return;let t=i;for(;t.parentElement;)t=t.parentElement,t.nodeName==="DETAILS"&&!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.transition=null,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.transition=null,i.style.outline=null,i.style.outlineOffset=null};i.addEventListener("transitionend",n)},1e3)}function is(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ns(){let i=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${i()+i()}-${i()}-${i()}-${i()}-${i()}${i()}${i()}`}function ss(i){return new Promise(t=>{setTimeout(t,i)})}var d=class{constructor(){U(this,"$name","");U(this,"$el",null);U(this,"$refs",{});U(this,"$manyRefs",{});U(this,"$opts",{})}setup(){}$emit(t,e={}){e.from=this;let n=this.$name,s=new CustomEvent(`${n}-${t}`,{bubbles:!0,detail:e});this.$el.dispatchEvent(s)}};var ve=class extends d{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)),A(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=ns(),n=t.querySelectorAll('[name*="randrowid"]');for(let s of n)s.name=s.name.split("randrowid").join(e)}};var ye=class extends d{setup(){this.row=this.$el,this.url=this.$opts.url,this.deleteButtons=this.$manyRefs.delete,x(this.deleteButtons,this.runDelete.bind(this))}runDelete(){this.row.style.opacity="0.7",this.row.style.pointerEvents="none",window.$http.delete(this.url).then(t=>{typeof t.data=="object"&&t.data.message&&window.$events.emit("success",t.data.message),this.row.remove()}).catch(()=>{this.row.style.opacity=null,this.row.style.pointerEvents=null})}};var Ce=class extends d{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}Lt(this.container,t=>{this.submitFakeForm(),t.preventDefault()}),this.submitButtons.forEach(t=>x(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 Ee=class extends d{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"),s=JSON.parse(n);window.$events.emit("editor::insert",{html:s["text/html"],markdown:s["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,s]of Object.entries(e))s.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"),Kt(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 xe=class extends d{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 Gt,hn,Yt,un,ut=class{constructor(t,e=null,n=null){Yi(this,Gt);Yi(this,Yt);this.containers=[t],this.onEscape=e,this.onEnter=n,t.addEventListener("keydown",jt(this,Gt,hn).bind(this))}shareHandlingToEl(t){this.containers.push(t),t.addEventListener("keydown",jt(this,Gt,hn).bind(this))}focusNext(){let t=jt(this,Yt,un).call(this),n=t.indexOf(document.activeElement)+1;n>=t.length&&(n=0),t[n].focus()}focusPrevious(){let t=jt(this,Yt,un).call(this),n=t.indexOf(document.activeElement)-1;n<0&&(n=t.length-1),t[n].focus()}};Gt=new WeakSet,hn=function(t){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):document.activeElement&&document.activeElement.blur():t.key==="Enter"&&this.onEnter&&this.onEnter(t))},Yt=new WeakSet,un=function(){let t=[],e='[tabindex]:not([tabindex="-1"]),[href],button:not([tabindex="-1"],[disabled]),input:not([type=hidden])';for(let n of this.containers)t.push(...n.querySelectorAll(e));return t};var pn={},Se=class extends d{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 ut(this.list,()=>{this.input.focus(),setTimeout(()=>this.hideSuggestions(),1)},e=>{e.preventDefault();let n=e.target.textContent;n&&this.selectSuggestion(n)}).shareHandlingToEl(this.input),A(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(),s=(await this.loadSuggestions(e,t)).filter(o=>e===""||o.toLowerCase().startsWith(e)).slice(0,10);this.displaySuggestions(s)}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},s=`${this.url}:${JSON.stringify(n)}`;if(pn[s])return pn[s];let o=await window.$http.get(this.url,n);return pn[s]=o.data,o.data}displaySuggestions(t){if(t.length===0){this.hideSuggestions();return}this.list.innerHTML=t.map(e=>`
  • ${is(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 ke=class extends d{setup(){this.form=this.$el,this.form.submit()}};var Le=class extends d{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,s=Date.now(),o=this.targetElem.getBoundingClientRect().top;function r(){let a=1-(Date.now()-s)/n,l=Math.abs(a*o);a>0?(e.scrollTop=l,requestAnimationFrame(r.bind(this))):e.scrollTop=t}requestAnimationFrame(r.bind(this))}};function os(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),e.push.apply(e,n)}return e}function ot(i){for(var t=1;t=0)&&(e[s]=i[s]);return e}function Vo(i,t){if(i==null)return{};var e=Uo(i,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(e[n]=i[n])}return e}function zo(i){return jo(i)||Wo(i)||Ko(i)||Xo()}function jo(i){if(Array.isArray(i))return Sn(i)}function Wo(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Ko(i,t){if(i){if(typeof i=="string")return Sn(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 Sn(i,t)}}function Sn(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 Yo(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function Y(i,t,e,n){if(i){e=e||document;do{if(t!=null&&(t[0]===">"?i.parentNode===e&&Fe(i,t):Fe(i,t))||n&&i===e)return i;if(i===e)break}while(i=Yo(i))}return null}var as=/\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(as," ").replace(" "+t+" "," ");i.className=(n+(e?" "+t:"")).replace(as," ")}}function f(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 Ct(i,t){var e="";if(typeof i=="string")e=i;else do{var n=f(i,"transform");n&&n!=="none"&&(e=n+" "+e)}while(!t&&(i=i.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(e)}function vs(i,t,e){if(i){var n=i.getElementsByTagName(t),s=0,o=n.length;if(e)for(;s=o:r=s<=o,!r)return n;if(n===st())break;n=mt(n,!1)}return!1}function Pt(i,t,e,n){for(var s=0,o=0,r=i.children;o2&&arguments[2]!==void 0?arguments[2]:{},s=n.evt,o=Vo(n,nr);de.pluginEvent.bind(g)(t,e,ot({dragEl:p,parentEl:I,ghostEl:b,rootEl:T,nextEl:yt,lastDownEl:Pe,cloneEl:D,cloneHidden:ft,dragStarted:ee,putSortable:N,activeSortable:g.active,originalEvent:s,oldIndex:Bt,oldDraggableIndex:re,newIndex:X,newDraggableIndex:pt,hideGhostForTarget:Ls,unhideGhostForTarget:$s,cloneNowHidden:function(){ft=!0},cloneNowShown:function(){ft=!1},dispatchSortableEvent:function(a){H({sortable:e,name:a,originalEvent:s})}},o))};function H(i){te(ot({putSortable:N,cloneEl:D,targetEl:p,rootEl:T,oldIndex:Bt,oldDraggableIndex:re,newIndex:X,newDraggableIndex:pt},i))}var p,I,b,T,yt,Pe,D,ft,Bt,X,re,pt,$e,N,Mt=!1,Re=!1,He=[],bt,Z,wn,bn,hs,us,ee,At,ae,le=!1,Te=!1,Oe,F,vn=[],kn=!1,qe=[],Ve=typeof document<"u",De=gs,ps=ce||ct?"cssFloat":"float",sr=Ve&&!ws&&!gs&&"draggable"in document.createElement("div"),xs=function(){if(Ve){if(ct)return!1;var i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}}(),Ss=function(t,e){var n=f(t),s=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Pt(t,0,e),r=Pt(t,1,e),a=o&&f(o),l=r&&f(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+$(o).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+$(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(o&&a.float&&a.float!=="none"){var u=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===u)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=s&&n[ps]==="none"||r&&n[ps]==="none"&&c+h>s)?"vertical":"horizontal"},or=function(t,e,n){var s=n?t.left:t.top,o=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,c=n?e.width:e.height;return s===a||o===l||s+r/2===a+c/2},rr=function(t,e){var n;return He.some(function(s){var o=s[R].options.emptyInsertThreshold;if(!(!o||Dn(s))){var r=$(s),a=t>=r.left-o&&t<=r.right+o,l=e>=r.top-o&&e<=r.bottom+o;if(a&&l)return n=s}}),n},ks=function(t){function e(o,r){return function(a,l,c,h){var u=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(o==null&&(r||u))return!0;if(o==null||o===!1)return!1;if(r&&o==="clone")return o;if(typeof o=="function")return e(o(a,l,c,h),r)(a,l,c,h);var m=(r?a:l).options.group.name;return o===!0||typeof o=="string"&&o===m||o.join&&o.indexOf(m)>-1}}var n={},s=t.group;(!s||Be(s)!="object")&&(s={name:s}),n.name=s.name,n.checkPull=e(s.pull,!0),n.checkPut=e(s.put),n.revertClone=s.revertClone,t.group=n},Ls=function(){!xs&&b&&f(b,"display","none")},$s=function(){!xs&&b&&f(b,"display","")};Ve&&!ws&&document.addEventListener("click",function(i){if(Re)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),Re=!1,!1},!0);var vt=function(t){if(p){t=t.touches?t.touches[0]:t;var e=rr(t.clientX,t.clientY);if(e){var n={};for(var s in t)t.hasOwnProperty(s)&&(n[s]=t[s]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[R]._onDragOver(n)}}},ar=function(t){p&&p.parentNode[R]._isOutsideThisEl(t.target)};function g(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=Q({},t),i[R]=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 Ss(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:g.supportPointer!==!1&&"PointerEvent"in window&&!se,emptyInsertThreshold:5};de.initializePlugins(this,i,e);for(var n in e)!(n in t)&&(t[n]=e[n]);ks(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:sr,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(i,"pointerdown",this._onTapStart):(E(i,"mousedown",this._onTapStart),E(i,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(i,"dragover",this),E(i,"dragenter",this)),He.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Q(this,tr())}g.prototype={constructor:g,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(At=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,p):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,s=this.options,o=s.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,h=s.filter;if(mr(n),!p&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||s.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&se&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=Y(l,s.draggable,n,!1),!(l&&l.animated)&&Pe!==l)){if(Bt=O(l),re=O(l,s.draggable),typeof h=="function"){if(h.call(this,t,l,this)){H({sortable:e,rootEl:c,name:"filter",targetEl:l,toEl:n,fromEl:n}),V("filter",e,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(h&&(h=h.split(",").some(function(u){if(u=Y(c,u.trim(),n,!1),u)return H({sortable:e,rootEl:u,name:"filter",targetEl:l,fromEl:n,toEl:n}),V("filter",e,{evt:t}),!0}),h)){o&&t.cancelable&&t.preventDefault();return}s.handle&&!Y(c,s.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var s=this,o=s.el,r=s.options,a=o.ownerDocument,l;if(n&&!p&&n.parentNode===o){var c=$(n);if(T=o,p=n,I=p.parentNode,yt=p.nextSibling,Pe=n,$e=r.group,g.dragged=p,bt={target:p,clientX:(e||t).clientX,clientY:(e||t).clientY},hs=bt.clientX-c.left,us=bt.clientY-c.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,p.style["will-change"]="all",l=function(){if(V("delayEnded",s,{evt:t}),g.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!rs&&s.nativeDraggable&&(p.draggable=!0),s._triggerDragStart(t,e),H({sortable:s,name:"choose",originalEvent:t}),P(p,r.chosenClass,!0)},r.ignore.split(",").forEach(function(h){vs(p,h.trim(),yn)}),E(a,"dragover",vt),E(a,"mousemove",vt),E(a,"touchmove",vt),E(a,"mouseup",s._onDrop),E(a,"touchend",s._onDrop),E(a,"touchcancel",s._onDrop),rs&&this.nativeDraggable&&(this.options.touchStartThreshold=4,p.draggable=!0),V("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(ce||ct))){if(g.eventCanceled){this._onDrop();return}E(a,"mouseup",s._disableDelayedDrag),E(a,"touchend",s._disableDelayedDrag),E(a,"touchcancel",s._disableDelayedDrag),E(a,"mousemove",s._delayedDragTouchMoveHandler),E(a,"touchmove",s._delayedDragTouchMoveHandler),r.supportPointer&&E(a,"pointermove",s._delayedDragTouchMoveHandler),s._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(){p&&yn(p),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;y(t,"mouseup",this._disableDelayedDrag),y(t,"touchend",this._disableDelayedDrag),y(t,"touchcancel",this._disableDelayedDrag),y(t,"mousemove",this._delayedDragTouchMoveHandler),y(t,"touchmove",this._delayedDragTouchMoveHandler),y(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):e?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(p,"dragend",this),E(T,"dragstart",this._onDragStart));try{document.selection?_e(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Mt=!1,T&&p){V("dragStarted",this,{evt:e}),this.nativeDraggable&&E(document,"dragover",ar);var n=this.options;!t&&P(p,n.dragClass,!1),P(p,n.ghostClass,!0),g.active=this,t&&this._appendGhost(),H({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Z){this._lastX=Z.clientX,this._lastY=Z.clientY,Ls();for(var t=document.elementFromPoint(Z.clientX,Z.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Z.clientX,Z.clientY),t!==e);)e=t;if(p.parentNode[R]._isOutsideThisEl(t),e)do{if(e[R]){var n=void 0;if(n=e[R]._onDragOver({clientX:Z.clientX,clientY:Z.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);$s()}},_onTouchMove:function(t){if(bt){var e=this.options,n=e.fallbackTolerance,s=e.fallbackOffset,o=t.touches?t.touches[0]:t,r=b&&Ct(b,!0),a=b&&r&&r.a,l=b&&r&&r.d,c=De&&F&&cs(F),h=(o.clientX-bt.clientX+s.x)/(a||1)+(c?c[0]-vn[0]:0)/(a||1),u=(o.clientY-bt.clientY+s.y)/(l||1)+(c?c[1]-vn[1]:0)/(l||1);if(!g.active&&!Mt){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(H({rootEl:I,name:"add",toEl:I,fromEl:T,originalEvent:t}),H({sortable:this,name:"remove",toEl:I,originalEvent:t}),H({rootEl:I,name:"sort",toEl:I,fromEl:T,originalEvent:t}),H({sortable:this,name:"sort",toEl:I,originalEvent:t})),N&&N.save()):X!==Bt&&X>=0&&(H({sortable:this,name:"update",toEl:I,originalEvent:t}),H({sortable:this,name:"sort",toEl:I,originalEvent:t})),g.active&&((X==null||X===-1)&&(X=Bt,pt=re),H({sortable:this,name:"end",toEl:I,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){V("nulling",this),T=p=I=b=yt=D=Pe=ft=bt=Z=ee=X=pt=Bt=re=At=ae=N=$e=g.dragged=g.ghost=g.clone=g.active=null,qe.forEach(function(t){t.checked=!0}),qe.length=wn=bn=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":p&&(this._onDragOver(t),lr(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,s=0,o=n.length,r=this.options;ss.right+o||i.clientY>n.bottom&&i.clientX>n.left:i.clientY>s.bottom+o||i.clientX>n.right&&i.clientY>n.top}function ur(i,t,e,n,s,o,r,a){var l=n?i.clientY:i.clientX,c=n?e.height:e.width,h=n?e.top:e.left,u=n?e.bottom:e.right,m=!1;if(!r){if(a&&Oeh+c*o/2:lu-Oe)return-ae}else if(l>h+c*(1-s)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}function pr(i){return O(p)1&&(w.forEach(function(a){o.addAnimationState({target:a,rect:z?$(a):r}),mn(a),a.fromRect=r,n.removeAnimationState(a)}),z=!1,wr(!this.options.removeCloneOnHide,s))},dragOverCompleted:function(e){var n=e.sortable,s=e.isOwner,o=e.insertion,r=e.activeSortable,a=e.parentEl,l=e.putSortable,c=this.options;if(o){if(s&&r._hideClone(),Jt=!1,c.animation&&w.length>1&&(z||!s&&!r.options.sort&&!l)){var h=$(L,!1,!0,!0);w.forEach(function(m){m!==L&&(ds(m,h),a.appendChild(m))}),z=!0}if(!s)if(z||Me(),w.length>1){var u=Ie;r._showClone(n),r.options.animation&&!Ie&&u&&K.forEach(function(m){r.addAnimationState({target:m,rect:Qt}),m.fromRect=Qt,m.thisAnimationDuration=null})}else r._showClone(n)}},dragOverAnimationCapture:function(e){var n=e.dragRect,s=e.isOwner,o=e.activeSortable;if(w.forEach(function(a){a.thisAnimationDuration=null}),o.options.animation&&!s&&o.multiDrag.isMultiDrag){Qt=Q({},n);var r=Ct(L,!0);Qt.top-=r.f,Qt.left-=r.e}},dragOverAnimationComplete:function(){z&&(z=!1,Me())},drop:function(e){var n=e.originalEvent,s=e.rootEl,o=e.parentEl,r=e.sortable,a=e.dispatchSortableEvent,l=e.oldIndex,c=e.putSortable,h=c||this.sortable;if(n){var u=this.options,m=o.children;if(!It)if(u.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),P(L,u.selectedClass,!~w.indexOf(L)),~w.indexOf(L))w.splice(w.indexOf(L),1),Zt=null,te({sortable:r,rootEl:s,name:"deselect",targetEl:L,originalEvent:n});else{if(w.push(L),te({sortable:r,rootEl:s,name:"select",targetEl:L,originalEvent:n}),n.shiftKey&&Zt&&r.el.contains(Zt)){var C=O(Zt),v=O(L);if(~C&&~v&&C!==v){var S,M;for(v>C?(M=C,S=v):(M=v,S=C+1);M1){var G=$(L),_=O(L,":not(."+this.options.selectedClass+")");if(!Jt&&u.animation&&(L.thisAnimationDuration=null),h.captureAnimationState(),!Jt&&(u.animation&&(L.fromRect=G,w.forEach(function(k){if(k.thisAnimationDuration=null,k!==L){var tt=z?$(k):G;k.fromRect=tt,h.addAnimationState({target:k,rect:tt})}})),Me(),w.forEach(function(k){m[_]?o.insertBefore(k,m[_]):o.appendChild(k),_++}),l===O(L))){var q=!1;w.forEach(function(k){if(k.sortableIndex!==O(k)){q=!0;return}}),q&&(a("update"),a("sort"))}w.forEach(function(k){mn(k)}),h.animateAll()}J=h}(s===o||c&&c.lastPutMode!=="clone")&&K.forEach(function(k){k.parentNode&&k.parentNode.removeChild(k)})}},nullingGlobal:function(){this.isMultiDrag=It=!1,K.length=0},destroyGlobal:function(){this._deselectMultiDrag(),y(document,"pointerup",this._deselectMultiDrag),y(document,"mouseup",this._deselectMultiDrag),y(document,"touchend",this._deselectMultiDrag),y(document,"keydown",this._checkKeyDown),y(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof It<"u"&&It)&&J===this.sortable&&!(e&&Y(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;w.length;){var n=w[0];P(n,this.options.selectedClass,!1),w.shift(),te({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)}},Q(i,{pluginName:"multiDrag",utils:{select:function(e){var n=e.parentNode[R];!n||!n.options.multiDrag||~w.indexOf(e)||(J&&J!==n&&(J.multiDrag._deselectMultiDrag(),J=n),P(e,n.options.selectedClass,!0),w.push(e))},deselect:function(e){var n=e.parentNode[R],s=w.indexOf(e);!n||!n.options.multiDrag||!~s||(P(e,n.options.selectedClass,!1),w.splice(s,1))}},eventProperties:function(){var e=this,n=[],s=[];return w.forEach(function(o){n.push({multiDragElement:o,index:o.sortableIndex});var r;z&&o!==L?r=-1:z?r=O(o,":not(."+e.options.selectedClass+")"):r=O(o),s.push({multiDragElement:o,index:r})}),{items:zo(w),clones:[].concat(K),oldIndicies:n,newIndicies:s}},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 wr(i,t){w.forEach(function(e,n){var s=t.children[e.sortableIndex+(i?Number(n):0)];s?t.insertBefore(e,s):t.appendChild(e)})}function ms(i,t){K.forEach(function(e,n){var s=t.children[e.sortableIndex+(i?Number(n):0)];s?t.insertBefore(e,s):t.appendChild(e)})}function Me(){w.forEach(function(i){i!==L&&i.parentNode&&i.parentNode.removeChild(i)})}g.mount(new gr);g.mount(Mn,In);var Et=g;var As={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}},Is={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),s=n.indexOf(e);return n.slice(s+1).find(o=>o.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),s=n.indexOf(e);return n.slice(0,s).reverse().find(o=>o.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)}}},ze=class extends d{setup(){this.container=this.$el,this.sortContainer=this.$refs.sortContainer,this.input=this.$refs.input,Et.mount(new Ds);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",s=>{let o=s.target.closest(".sort-box-options [data-sort]");if(!o)return;s.preventDefault();let r=o.closest(".sort-box").querySelectorAll("ul"),a=o.getAttribute("data-sort");e=t===a?!e:!1;let l=As[a];e&&n.includes(a)&&(l=function(h,u){return 0-As[a](h,u)});for(let c of r)Array.from(c.children).filter(u=>u.matches("li")).sort(l).forEach(u=>{c.appendChild(u)});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(s=>{let o=nt(s.data);this.sortContainer.append(o),this.setupBookSortable(o),this.updateMoveActionStateForAll(),o.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"]},s={name:"chapter",pull:["book","chapter"],put(o,r,a){return a.getAttribute("data-type")==="page"}};for(let o of e)Et.create(o,{group:o.classList.contains("sort-list")?n:s,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 s=n.closest('[data-type="book"]').getAttribute("data-id"),o=Array.from(n.children).filter(r=>r.matches('[data-type="page"], [data-type="chapter"]'));for(let r=0;r{for(let r of s)i.style[r]=null;i.style.transition=null,i.removeEventListener("transitionend",o),je.delete(i),n&&n()};setTimeout(()=>{i.style.transition=`all ease-in-out ${e}ms`;for(let r of s)i.style[r]=t[r][1];i.addEventListener("transitionend",o),je.set(i,o)},15)}function ue(i){je.has(i)&&je.get(i)()}function Ms(i,t=400,e=null){ue(i),i.style.display="block",he(i,{opacity:["0","1"]},t,()=>{e&&e()})}function Bs(i,t=400,e=null){ue(i),he(i,{opacity:["1","0"]},t,()=>{i.style.display="none",e&&e()})}function Ot(i,t=400){ue(i);let e=i.getBoundingClientRect().height,n=getComputedStyle(i),s=n.getPropertyValue("padding-top"),o=n.getPropertyValue("padding-bottom"),r={maxHeight:[`${e}px`,"0px"],overflow:["hidden","hidden"],paddingTop:[s,"0px"],paddingBottom:[o,"0px"]};he(i,r,t,()=>{i.style.display="none"})}function _t(i,t=400){ue(i),i.style.display="block";let e=i.getBoundingClientRect().height,n=getComputedStyle(i),s=n.getPropertyValue("padding-top"),o=n.getPropertyValue("padding-bottom"),r={maxHeight:["0px",`${e}px`],overflow:["hidden","hidden"],paddingTop:["0px",s],paddingBottom:["0px",o]};he(i,r,t)}function Ps(i,t=400){let e=i.getBoundingClientRect().height,n=getComputedStyle(i),s=n.getPropertyValue("padding-top"),o=n.getPropertyValue("padding-bottom");return()=>{ue(i);let r=i.getBoundingClientRect().height,a=getComputedStyle(i),l=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-bottom"),h={height:[`${e}px`,`${r}px`],overflow:["hidden","hidden"],paddingTop:[s,l],paddingBottom:[o,c]};he(i,h,t)}}var We=class extends d{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"),_t(this.list,180),this.isOpen=!0}close(){this.toggle.classList.remove("open"),this.toggle.setAttribute("aria-expanded","false"),Ot(this.list,180),this.isOpen=!1}click(t){t.preventDefault(),this.isOpen?this.close():this.open()}};var Ke=class extends d{constructor(){super(...arguments);U(this,"editor",null);U(this,"saveCallback",null);U(this,"cancelCallback",null);U(this,"history",{});U(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()}),x(this.languageButtons,e=>{let n=e.target.dataset.lang;this.languageInput.value=n,this.languageInputChange(n)}),Lt(this.languageInput,()=>this.save()),this.languageInput.addEventListener("input",()=>this.languageInputChange(this.languageInput.value)),x(this.saveButton,()=>this.save()),A(this.historyList,"button","click",(e,n)=>{e.preventDefault();let s=n.dataset.time;this.editor&&this.editor.setContent(this.history[s])})}setupFavourites(){for(let e of this.languageButtons)this.setupFavouritesForButton(e);this.sortLanguageList()}setupFavouritesForButton(e){let n=e.dataset.lang,s=this.favourites.has(n);e.setAttribute("data-favourite",s?"true":"false"),A(e.parentElement,".lang-option-favorite-toggle","click",()=>{s=!s,s?this.favourites.add(n):this.favourites.delete(n),e.setAttribute("data-favourite",s?"true":"false"),window.$http.patch("/preferences/update-code-language-favourite",{language:n,active:s}),this.sortLanguageList(),s&&e.scrollIntoView({block:"center",behavior:"smooth"})})}sortLanguageList(){let e=this.languageButtons.sort((n,s)=>{let o=n.dataset.favourite==="true",r=s.dataset.favourite==="true";return o&&!r?-1:r&&!o||n.dataset.lang>s.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,s,o,r){this.languageInput.value=n,this.saveCallback=o,this.cancelCallback=r,await this.show(),this.languageInputChange(n),this.editor.setContent(e),this.setDirection(s)}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 s of this.languageButtons){let o=s.dataset.lang.toLowerCase().trim(),r=n===o;s.classList.toggle("active",r),r&&s.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 s=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 s=JSON.stringify(this.history);window.sessionStorage.setItem(this.historyKey,s)}};var Xe=class extends d{setup(){let t=this.$el;t.querySelectorAll("pre").length>0&&window.importVersioned("code").then(n=>{n.highlightWithin(t)})}};var Ge=class extends d{async setup(){let{mode:t}=this.$opts;(await window.importVersioned("code")).inlineEditor(this.$el,t)}};var Ye=class extends d{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"),_t(this.content,300)}close(){this.container.classList.remove("open"),this.trigger.setAttribute("aria-expanded","false"),Ot(this.content,300)}toggle(){this.container.classList.contains("open")?this.close():this.open()}openIfContainsError(){this.content.querySelector(".text-neg.text-small")&&this.open()}};var Ze=class extends d{setup(){this.container=this.$el,this.confirmButton=this.$refs.confirm,this.res=null,x(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 Je=class extends d{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 Qe=class extends d{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 ti=class extends d{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,s=this.toggle.getBoundingClientRect().height,o=e.bottom>window.innerHeight,r=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`,o?n=window.innerHeight-e.top-s/2:n=e.top),o){this.menu.style.top="initial",this.menu.style.bottom=`${n}px`;let c=window.innerHeight-40-(window.innerHeight-r.bottom);this.menu.style.maxHeight=`${Math.floor(c)}px`}else{this.menu.style.top=`${n}px`,this.menu.style.bottom="initial";let c=window.innerHeight-40-r.top;this.menu.style.maxHeight=`${Math.floor(c)}px`}this.menu.addEventListener("mouseleave",this.hide),window.addEventListener("click",c=>{this.menu.contains(c.target)||this.hide()});let a=this.menu.querySelector("input");a!==null&&a.focus(),this.showing=!0;let l=new Event("show");this.container.dispatchEvent(l),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 ut(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()}),x(this.toggle,e=>{e.stopPropagation(),e.preventDefault(),this.show(e),e instanceof KeyboardEvent&&t.focusNext()})}};var ei=class extends d{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=Tt(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 s=!t||n.textContent.toLowerCase().includes(t);n.style.display=s?"flex":"none",n.classList.toggle("hidden",!s)}}async loadList(t=""){this.listContainerElem.innerHTML="",this.toggleLoading(!0);try{let e=await window.$http.get(this.getAjaxUrl(t)),n=Ps(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 Nt=class{constructor(t){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(){let{types:t}=this.data,e=[];for(let s of t)if(s.includes("image")){let o=this.data.getData(s);e.push(o.getAsFile())}let n=this.getFiles().filter(s=>s.type.includes("image"));return e.push(...n),e}getFiles(){let{files:t}=this.data;return[...t]}};async function Bn(i){if(window.isSecureContext&&navigator.clipboard){await navigator.clipboard.writeText(i);return}let t=document.createElement("textarea");t.style="position: absolute; left: -1000px; top: -1000px;",t.value=i,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}var ii=class extends d{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(){x(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 o=new Nt(n.dataTransfer).getFiles();for(let r of o)this.createUploadFromFile(r)})}manualSelectHandler(){let t=it("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=it("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:s,dismiss:o}=this.createDomForFile(t);this.statusArea.append(e);let r=this,a={file:t,dom:e,updateProgress(l){s.textContent=`${l}%`,s.style.width=`${l}%`},markError(l){n.setAttribute("data-status","error"),n.textContent=l,Xt(e),this.updateProgress(100)},markSuccess(l){n.setAttribute("data-status","success"),n.textContent=l,Xt(e),setTimeout(o,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,s=window.$http.createXMLHttpRequest("POST",this.url,{error(){t.markError(n.errorMessage)},readystatechange(){if(this.readyState===XMLHttpRequest.DONE&&this.status===200)t.markSuccess(n.successMessage);else if(this.readyState===XMLHttpRequest.DONE&&this.status>=400){let o=this.responseText,r=o.startsWith("{")?JSON.parse(o):{message:o},a=r?.message||r?.error||o;t.markError(a)}}});s.upload.addEventListener("progress",o=>{let r=Math.min(Math.ceil(o.loaded/o.total*100),100);t.updateProgress(r)}),s.setRequestHeader("Accept","application/json"),s.send(e)}createDomForFile(t){let e=it("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=it("div",{class:"dropzone-file-item-status"},[]),s=it("div",{class:"dropzone-file-item-progress"}),o=it("div",{class:"dropzone-file-item-image-wrap"},[e]),r=it("div",{class:"dropzone-file-item"},[o,it("div",{class:"dropzone-file-item-text-wrap"},[it("div",{class:"dropzone-file-item-label"},[t.name]),$t(),n]),s]);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:s,status:n,dismiss:a}}};var ni=class extends d{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",t=>{let e=t.target.closest("button");if(this.buttons.includes(e)){let n=e.dataset.tab;this.setActiveTab(n,!0)}})}toggle(){this.container.classList.toggle("open");let t=this.container.classList.contains("open");this.toggleButton.setAttribute("aria-expanded",t?"true":"false"),this.editorWrapEl.classList.toggle("toolbox-open",t)}setActiveTab(t,e=!1){for(let n of this.buttons)n.classList.remove("active"),n.dataset.tab===t&&n.classList.add("active");for(let n of this.contentElements)n.style.display="none",n.dataset.tabContent===t&&(n.style.display="block");e&&!this.container.classList.contains("open")&&this.toggle()}};var si=class extends d{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 s of n)s.disabled=e,s.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}`),s=nt(n.data);this.roleContainer.append(s),this.roleSelect.disabled=!1}removeRowOnButtonClick(t){let e=t.closest(".item-list-row"),{roleId:n}=t.dataset,{roleName:s}=t.dataset,o=document.createElement("option");o.value=n,o.textContent=s,this.roleSelect.append(o),e.remove()}};var oi=class extends d{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()}),x(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 ri=class extends d{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.search="",this.lastClick=0,this.setupListeners(),this.showLoading(),this.searchOptions.searchEndpoint&&this.initialLoad()}configureSearchOptions(t){Object.assign(this.searchOptions,t),this.reset(),this.searchInput.value=this.searchOptions.initialValue}setupListeners(){this.elem.addEventListener("click",this.onClick.bind(this));let t=0;this.searchInput.addEventListener("input",()=>{t=Date.now(),this.showLoading(),setTimeout(()=>{Date.now()-t<199||this.searchEntities(this.searchInput.value)},200)}),this.searchInput.addEventListener("keydown",e=>{e.keyCode===13&&e.preventDefault()}),A(this.$el,"[data-entity-type]","keydown",e=>{if(e.ctrlKey&&e.code==="Enter"){let n=this.$el.closest("form");if(n){n.submit(),e.preventDefault();return}}e.code==="ArrowDown"&&this.focusAdjacent(!0),e.code==="ArrowUp"&&this.focusAdjacent(!1)}),this.searchInput.addEventListener("keydown",e=>{e.code==="ArrowDown"&&this.focusAdjacent(!0)})}focusAdjacent(t=!0){let e=Array.from(this.resultsContainer.querySelectorAll("[data-entity-type]")),n=e.indexOf(document.activeElement),s=e[n+(t?1:-1)]||e[0];s&&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(t=>{this.resultsContainer.innerHTML=t.data,this.hideLoading()})}searchUrl(){let t=`types=${encodeURIComponent(this.searchOptions.entityTypes)}&permission=${encodeURIComponent(this.searchOptions.entityPermission)}`;return`${this.searchOptions.searchEndpoint}?${t}`}searchEntities(t){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");this.input.value="";let e=`${this.searchUrl()}&term=${encodeURIComponent(t)}`;window.$http.get(e).then(n=>{this.resultsContainer.innerHTML=n.data,this.hideLoading()})}isDoubleClick(){let t=Date.now(),e=t-this.lastClick<300;return this.lastClick=t,e}onClick(t){let e=t.target.closest("[data-entity-type]");e&&(t.preventDefault(),t.stopPropagation(),this.selectItem(e))}selectItem(t){let e=this.isDoubleClick(),n=t.getAttribute("data-entity-type"),s=t.getAttribute("data-entity-id"),o=!t.classList.contains("selected")||e;this.unselectAll(),this.input.value=o?`${n}:${s}`:"";let r=t.getAttribute("href"),a=t.querySelector(".entity-list-item-name").textContent,l={id:Number(s),name:a,link:r};o?t.classList.add("selected"):window.$events.emit("entity-select-change",null),!(!e&&!o)&&(e&&this.confirmSelection(l),o&&window.$events.emit("entity-select-change",l))}confirmSelection(t){window.$events.emit("entity-select-confirm",t)}unselectAll(){let t=this.elem.querySelectorAll(".selected");for(let e of t)e.classList.remove("selected","primary-background")}};var ai=class extends d{setup(){this.container=this.$el,this.selectButton=this.$refs.select,this.selectorEl=this.$refs.selector,this.callback=null,this.selection=null,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(t,e={}){this.callback=t,this.getSelector().configureSearchOptions(e),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(t){this.selection=t,t===null?this.selectButton.setAttribute("disabled","true"):this.selectButton.removeAttribute("disabled")}handleConfirmedSelection(t){this.hide(),this.getSelector().reset(),this.callback&&t&&this.callback(t)}};var li=class extends d{setup(){this.container=this.$el,this.name=this.$opts.name,x(this.$el,()=>{this.$emit(this.name,this.$opts)})}};var ci=class extends d{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){_t(t,200)}close(t){Ot(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 di=class extends d{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=Tt(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 ut(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=nt(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 hi=class extends d{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 ui=class extends d{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(){x(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()}),x(this.cancelSearch,()=>{this.resetListView(),this.resetSearchView(),this.loadGallery()}),A(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),x(this.selectButton,()=>{this.callback&&this.callback(this.lastSelected),this.hide()}),A(this.formContainer,"#image-manager-delete","click",()=>{this.lastSelected&&this.loadImageEditForm(this.lastSelected.id,!0)}),A(this.formContainer,"#image-manager-rebuild-thumbs","click",async(n,s)=>{s.disabled=!0,this.lastSelected&&await this.rebuildThumbnails(this.lastSelected.id),s.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),Xt(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 s of[...e.children])this.listContainer.appendChild(s)}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(){Kt(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,s=t.target.classList.contains("selected");[...this.listContainer.querySelectorAll(".selected")].forEach(o=>{o.classList.remove("selected")}),!s&&!n?(t.target.classList.add("selected"),e=await this.loadImageEditForm(e.id)):n?n&&(e=this.lastSelected):this.resetEditForm(),this.selectButton.classList.toggle("hidden",s),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:s}=await window.$http.get(`/images/edit/${t}`,n);this.formContainer.innerHTML=s,this.formContainerPlaceholder.setAttribute("hidden",""),window.$components.init(this.formContainer);let o=this.formContainer.querySelector("#image-manager-form-image-data");return JSON.parse(o.text)}runLoadMore(){Kt(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 pi=class extends d{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 fi=class extends d{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()}};var mi=class extends d{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 s of n)s.classList.remove("active");e.closest(".markdown-editor-wrap").classList.add("active")}),this.handleDividerDrag()}handleDividerDrag(){this.divider.addEventListener("pointerdown",()=>{let e=this.elem.getBoundingClientRect(),n=o=>{let r=o.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)},s=()=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",s),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",s)});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")||""}getContent(){return this.editor.actions.getContent()}};var gi=class extends d{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 wi=class extends d{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 bi=class extends d{setup(){this.removeButton=this.$refs.remove,this.showButton=this.$refs.show,this.input=this.$refs.input,this.setupListeners()}setupListeners(){x(this.removeButton,()=>{this.input.value="",this.input.classList.add("hidden"),this.removeButton.classList.add("hidden"),this.showButton.classList.remove("hidden")}),x(this.showButton,()=>{this.input.classList.remove("hidden"),this.removeButton.classList.remove("hidden"),this.showButton.classList.add("hidden")})}};function Os(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"],o=(n.findIndex(a=>e&&e.classList.contains(a))+1)%n.length,r=n[o];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 _s(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 br(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 Ns(i){let e=new URL(window.location).searchParams.get("content-id");e&&br(i,e)}var xt,vi;function vr(i){return i&&!!(i.textContent||i.innerText)}async function yr(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 Fs(i,t,e){let n=new Nt(e.clipboardData||e.dataTransfer);if(!n.hasItems()||n.containsTabularData())return;let s=n.getImages();for(let o of s){let r=`image-${Math.random().toString(16).slice(2)}`,a=window.baseUrl("/loading.gif");e.preventDefault(),setTimeout(()=>{i.insertContent(`

    `),yr(o,t.pageId).then(l=>{let c=l.name.replace(/"/g,""),h=`${c}`,u=i.dom.create("a",{target:"_blank",href:l.url},h);i.dom.replace(u,r)}).catch(l=>{i.dom.remove(r),window.$events.error(l?.data?.message||t.translations.imageUploadErrorText),console.error(l)})},10)}}function Cr(i){let t=i.selection.getNode();t.nodeName==="IMG"&&(xt=i.dom.getParent(t,".mceTemp"),!xt&&t.parentNode.nodeName==="A"&&!vr(t.parentNode)&&(xt=t.parentNode)),t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="false"&&(vi=t)}function Er(i,t,e){let{dom:n}=i,s=window.tinymce.dom.RangeUtils.getCaretRangeFromPoint(e.clientX,e.clientY,i.getDoc()),o=e.dataTransfer&&e.dataTransfer.getData("bookstack/template");o&&(e.preventDefault(),window.$http.get(`/templates/${o}`).then(r=>{i.selection.setRng(s),i.undoManager.transact(()=>{i.execCommand("mceInsertContent",!1,r.data.html)})})),n.getParent(s.startContainer,".mceTemp")?e.preventDefault():xt&&(e.preventDefault(),i.undoManager.transact(()=>{i.selection.setRng(s),i.selection.setNode(xt),n.remove(xt)})),!e.isDefaultPrevented()&&vi&&(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(vi):l.before(vi)})),e.isDefaultPrevented()||Fs(i,t,e),xt=null}function xr(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 Rs(i,t){i.on("dragover",e=>xr(i,e)),i.on("dragstart",()=>Cr(i)),i.on("drop",e=>Er(i,t,e)),i.on("paste",e=>Fs(i,t,e))}function Hs(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 Sr(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 kr(i){i.ui.registry.addContextToolbar("linkcontexttoolbar",{predicate(t){return t.closest("a")!==null},position:"node",scope:"node",items:"link unlink openlink"})}function Lr(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 $r(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 qs(i){Sr(i),kr(i),Lr(i),$r(i)}var Tr={"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 Us(i){for(let[t,e]of Object.entries(Tr))i.ui.registry.addIcon(t,e)}function Dr(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 Ar(i){i.parser.addNodeFilter("div",t=>{for(let e of t){let n=e.attr("id")||"",s=e.attr("class")||"";(n==="pointer"||s.includes("pointer"))&&e.remove()}})}function Vs(i){Dr(i),Ar(i)}function zs(i){return i.tagName.toLowerCase()==="code-block"}function Ws(i,t,e,n,s){let o=window.$components.first("code-editor"),r=i.selection.getBookmark();o.open(t,e,n,(a,l)=>{s(a,l),i.focus(),i.selection.moveToBookmark(r)},()=>{i.focus(),i.selection.moveToBookmark(r)})}function js(i,t){let e=t.getAttribute("dir")||"";Ws(i,t.getContent(),t.getLanguage(),e,(n,s)=>{t.setContent(n,s)})}function Ir(i){let t=i.getDoc(),e=t.defaultView;class n extends e.HTMLElement{constructor(){super();U(this,"editor",null);this.attachShadow({mode:"open"});let r=document.head.querySelectorAll('link[rel="stylesheet"]:not([media="print"]),style'),a=Array.from(r).map(c=>c.cloneNode(!0)),l=document.createElement("div");l.style.pointerEvents="none",l.contentEditable="false",l.classList.add("CodeMirrorContainer"),l.classList.toggle("dark-mode",document.documentElement.classList.contains("dark-mode")),this.shadowRoot.append(...a,l)}getLanguage(){let r=c=>(c.split(" ").filter(u=>u.startsWith("language-"))[0]||"").replace("language-",""),a=this.querySelector("code"),l=this.querySelector("pre");return r(l.className)||a&&r(a.className)||""}setContent(r,a){this.editor&&(this.editor.setContent(r),this.editor.setMode(a,r));let l=this.querySelector("pre");l||(l=t.createElement("pre"),this.append(l)),l.innerHTML="";let c=t.createElement("code");l.append(c),c.innerText=r,c.className=`language-${a}`}getContent(){let r=this.querySelector("code")||this.querySelector("pre"),a=document.createElement("pre");a.innerHTML=r.innerHTML.replace(/\ufeff/g,"");let l=a.querySelectorAll("br");for(let c of l)c.replaceWith(` +var Gn=Object.defineProperty;var Co=(i,t,e)=>t in i?Gn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var fe=(i,t)=>{for(var e in t)Gn(i,e,{get:t[e],enumerable:!0})};var U=(i,t,e)=>(Co(i,typeof t!="symbol"?t+"":t,e),e),Eo=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var Yi=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)};var jt=(i,t,e)=>(Eo(i,t,"access private method"),e);var Qi={};fe(Qi,{emit:()=>Ji,emitPublic:()=>ko,error:()=>Zi,listen:()=>So,showResponseError:()=>To,showValidationErrors:()=>$o,success:()=>Lo});var me={},xo=[];function Ji(i,t){xo.push({name:i,data:t});let e=me[i]||[];for(let n of e)n(t)}function So(i,t){typeof me[i]>"u"&&(me[i]=[]),me[i].push(t)}function ko(i,t,e){let n=new CustomEvent(t,{detail:e,bubbles:!0});i.dispatchEvent(n)}function Lo(i){Ji("success",i)}function Zi(i){Ji("error",i)}function $o(i){if(i.status&&i.status===422&&i.data){let t=Object.values(i.data).flat().join(` +`);Zi(t)}}function To(i){i.status&&i.status>=400&&i.data&&i.data.message&&Zi(i.data.message)}var tn={};fe(tn,{HttpError:()=>ge,createXMLHttpRequest:()=>Ao,delete:()=>Oo,formatErrorResponseText:()=>_o,get:()=>Io,patch:()=>Po,post:()=>Mo,put:()=>Bo});async function Do(i){if(i.status===204)return null;let e=(i.headers.get("Content-Type")||"").split(";")[0].split("/").pop();return e==="javascript"||e==="json"?i.json():i.text()}var ge=class extends Error{constructor(t,e){super(t.statusText),this.data=e,this.headers=t.headers,this.redirected=t.redirected,this.status=t.status,this.statusText=t.statusText,this.url=t.url,this.original=t}};function Ao(i,t,e={}){let n=document.querySelector("meta[name=token]").getAttribute("content"),s=new XMLHttpRequest;for(let[o,r]of Object.entries(e))s.addEventListener(o,r.bind(s));return s.open(i,t),s.withCredentials=!0,s.setRequestHeader("X-CSRF-TOKEN",n),s}async function Yn(i,t={}){let e=i;if(e.startsWith("http")||(e=window.baseUrl(e)),t.params){let l=new URL(e);for(let c of Object.keys(t.params)){let h=t.params[c];typeof h<"u"&&h!==null&&l.searchParams.set(c,h)}e=l.toString()}let n=document.querySelector("meta[name=token]").getAttribute("content"),s={...t,credentials:"same-origin"};s.headers={...s.headers||{},baseURL:window.baseUrl(""),"X-CSRF-TOKEN":n};let o=await fetch(e,s),r=await Do(o),a={data:r,headers:o.headers,redirected:o.redirected,status:o.status,statusText:o.statusText,url:o.url,original:o};if(!o.ok)throw new ge(o,r);return a}async function we(i,t,e=null){let n={method:i,body:e};return typeof e=="object"&&!(e instanceof FormData)&&(n.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},n.body=JSON.stringify(e)),e instanceof FormData&&i!=="post"&&(e.append("_method",i),n.method="post"),Yn(t,n)}async function Io(i,t={}){return Yn(i,{method:"GET",params:t})}async function Mo(i,t=null){return we("POST",i,t)}async function Bo(i,t=null){return we("PUT",i,t)}async function Po(i,t=null){return we("PATCH",i,t)}async function Oo(i,t=null){return we("DELETE",i,t)}function _o(i){let t=i.startsWith("{")?JSON.parse(i):{message:i};if(!t)return i;if(t.message||t.error)return t.message||t.error;let e=Object.values(t);return e.every(s=>Array.isArray(s)||s.every(o=>typeof o=="string"))?e.flat().join(" "):i}var en=class{constructor(){this.store=new Map,this.parseTranslations()}parseTranslations(){let t=document.querySelectorAll('meta[name="translation"]');for(let e of t){let n=e.getAttribute("key"),s=e.getAttribute("value");this.store.set(n,s)}}get(t,e){let n=this.getTransText(t);return this.performReplacements(n,e)}getPlural(t,e,n){let s=this.getTransText(t);return this.parsePlural(s,e,n)}parsePlural(t,e,n){let s=t.split("|"),o=/^{([0-9]+)}/,r=/^\[([0-9]+),([0-9*]+)]/,a=null;for(let l of s){let c=l.match(o);if(c!==null&&Number(c[1])===e){a=l.replace(o,"").trim();break}let h=l.match(r);if(h!==null&&Number(h[1])<=e&&(h[2]==="*"||Number(h[2])>=e)){a=l.replace(r,"").trim();break}}return a===null&&s.length>1&&(a=e===1?s[0]:s[1]),a===null&&(a=s[0]),this.performReplacements(a,n)}getTransText(t){let e=this.store.get(t);return e===void 0&&console.warn(`Translation with key "${t}" does not exist`),e}performReplacements(t,e){if(!e)return t;let n=t.match(/:(\S+)/g);if(n===null)return t;let s=t;return n.forEach(o=>{let r=o.substring(1);typeof e[r]>"u"||(s=s.replace(o,e[r]))}),s}},Jn=en;var an={};fe(an,{first:()=>Ho,firstOnElement:()=>Uo,get:()=>qo,init:()=>on,register:()=>rn});function nn(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 Zn(i){return i.replace(/[A-Z]/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}var Wt={},Qn={},sn=new WeakMap;function No(i,t){let e={},n={},s=`${i}@`,o=`[refs*="${s}"]`,r=[...t.querySelectorAll(o)];t.matches(o)&&r.push(t);for(let a of r){let l=a.getAttribute("refs").split(" ").filter(c=>c.startsWith(s)).map(c=>c.replace(s,"")).map(nn);for(let c of l)e[c]=a,typeof n[c]>"u"&&(n[c]=[]),n[c].push(a)}return{refs:e,manyRefs:n}}function Fo(i,t){let e={},n=`option:${i}:`;for(let{name:s,value:o}of t.attributes)if(s.startsWith(n)){let r=s.replace(n,"");e[nn(r)]=o||""}return e}function Ro(i,t){let e=Qn[i];if(e===void 0)return;let n;try{n=new e,n.$name=i,n.$el=t;let o=No(i,t);n.$refs=o.refs,n.$manyRefs=o.manyRefs,n.$opts=Fo(i,t),n.setup()}catch(o){console.error("Failed to create component",o,i,t)}typeof Wt[i]>"u"&&(Wt[i]=[]),Wt[i].push(n);let s=sn.get(t)||{};s[i]=n,sn.set(t,s)}function on(i=document){let t=i.querySelectorAll("[component],[components]");for(let e of t){let n=`${e.getAttribute("component")||""} ${e.getAttribute("components")}`.toLowerCase().split(" ").filter(Boolean);for(let s of n)Ro(s,e)}}function rn(i){let t=Object.keys(i);for(let e of t)Qn[Zn(e)]=i[e]}function Ho(i){return(Wt[i]||[null])[0]}function qo(i){return Wt[i]||[]}function Uo(i,t){return(sn.get(i)||{})[t]||null}var Kn={};fe(Kn,{AddRemoveRows:()=>be,AjaxDeleteRow:()=>ye,AjaxForm:()=>Ce,Attachments:()=>Ee,AttachmentsList:()=>xe,AutoSubmit:()=>ke,AutoSuggest:()=>Se,BackToTop:()=>Le,BookSort:()=>ze,ChapterContents:()=>We,CodeEditor:()=>Ke,CodeHighlighter:()=>Xe,CodeTextarea:()=>Ge,Collapsible:()=>Ye,ConfirmDialog:()=>Je,CustomCheckbox:()=>Ze,DetailsHighlighter:()=>Qe,Dropdown:()=>ti,DropdownSearch:()=>ei,Dropzone:()=>ii,EditorToolbox:()=>ni,EntityPermissions:()=>si,EntitySearch:()=>oi,EntitySelector:()=>ri,EntitySelectorPopup:()=>ai,EventEmitSelect:()=>li,ExpandToggle:()=>ci,GlobalSearch:()=>di,HeaderMobileToggle:()=>hi,ImageManager:()=>ui,ImagePicker:()=>pi,ListSortControl:()=>fi,MarkdownEditor:()=>mi,NewUserPassword:()=>gi,Notification:()=>wi,OptionalInput:()=>vi,PageComment:()=>Si,PageComments:()=>ki,PageDisplay:()=>Li,PageEditor:()=>$i,PagePicker:()=>Di,PermissionsTable:()=>Ai,Pointer:()=>Ii,Popup:()=>Mi,SettingAppColorScheme:()=>Bi,SettingColorPicker:()=>Pi,SettingHomepageControl:()=>Oi,ShelfSort:()=>_i,ShortcutInput:()=>Fi,Shortcuts:()=>Ni,SortableList:()=>Ri,SubmitOnChange:()=>Hi,Tabs:()=>qi,TagManager:()=>Ui,TemplateManager:()=>Vi,ToggleSwitch:()=>zi,TriLayout:()=>ji,UserSelect:()=>Wi,WebhookEvents:()=>Ki,WysiwygEditor:()=>Xi,WysiwygInput:()=>Gi});function it(i,t={},e=[]){let n=document.createElement(i);for(let[s,o]of Object.entries(t))o===null?n.removeAttribute(s):n.setAttribute(s,o);for(let s of e)typeof s=="string"?n.append(document.createTextNode(s)):n.append(s);return n}function ln(i,t){let e=document.querySelectorAll(i);for(let n of e)t(n)}function ve(i,t,e){for(let n of t)i.addEventListener(n,e)}function x(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 ts(i,t,e){Array.isArray(t)||(t=[t]);let n=s=>{s.key===i&&e(s)};t.forEach(s=>s.addEventListener("keydown",n))}function Lt(i,t){ts("Enter",i,t)}function es(i,t){ts("Escape",i,t)}function A(i,t,e,n){i.addEventListener(e,s=>{let o=s.target.closest(t);o&&n.call(o,s,o)})}function is(i,t){let e=document.querySelectorAll(i);t=t.toLowerCase();for(let n of e)if(n.textContent.toLowerCase().includes(t))return n;return null}function Kt(i){i.innerHTML='
    '}function $t(){let i=document.createElement("div");return i.classList.add("loading-container"),i.innerHTML="
    ",i}function Xt(i){let t=i.querySelectorAll(".loading-container");for(let e of t)e.remove()}function nt(i){let t=document.createElement("div");return t.innerHTML=i,window.$components.init(t),t.children[0]}function Tt(i,t,e){let n;return function(...o){let r=this,a=function(){n=null,e||i.apply(r,o)},l=e&&!n;clearTimeout(n),n=setTimeout(a,t),l&&i.apply(r,o)}}function dn(i){if(!i)return;let t=i;for(;t.parentElement;)t=t.parentElement,t.nodeName==="DETAILS"&&!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.transition=null,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.transition=null,i.style.outline=null,i.style.outlineOffset=null};i.addEventListener("transitionend",n)},1e3)}function ns(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ss(){let i=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${i()+i()}-${i()}-${i()}-${i()}-${i()}${i()}${i()}`}function os(i){return new Promise(t=>{setTimeout(t,i)})}var d=class{constructor(){U(this,"$name","");U(this,"$el",null);U(this,"$refs",{});U(this,"$manyRefs",{});U(this,"$opts",{})}setup(){}$emit(t,e={}){e.from=this;let n=this.$name,s=new CustomEvent(`${n}-${t}`,{bubbles:!0,detail:e});this.$el.dispatchEvent(s)}};var be=class extends d{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)),A(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=ss(),n=t.querySelectorAll('[name*="randrowid"]');for(let s of n)s.name=s.name.split("randrowid").join(e)}};var ye=class extends d{setup(){this.row=this.$el,this.url=this.$opts.url,this.deleteButtons=this.$manyRefs.delete,x(this.deleteButtons,this.runDelete.bind(this))}runDelete(){this.row.style.opacity="0.7",this.row.style.pointerEvents="none",window.$http.delete(this.url).then(t=>{typeof t.data=="object"&&t.data.message&&window.$events.emit("success",t.data.message),this.row.remove()}).catch(()=>{this.row.style.opacity=null,this.row.style.pointerEvents=null})}};var Ce=class extends d{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}Lt(this.container,t=>{this.submitFakeForm(),t.preventDefault()}),this.submitButtons.forEach(t=>x(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 Ee=class extends d{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"),s=JSON.parse(n);window.$events.emit("editor::insert",{html:s["text/html"],markdown:s["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,s]of Object.entries(e))s.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"),Kt(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 xe=class extends d{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 Gt,hn,Yt,un,ut=class{constructor(t,e=null,n=null){Yi(this,Gt);Yi(this,Yt);this.containers=[t],this.onEscape=e,this.onEnter=n,t.addEventListener("keydown",jt(this,Gt,hn).bind(this))}shareHandlingToEl(t){this.containers.push(t),t.addEventListener("keydown",jt(this,Gt,hn).bind(this))}focusNext(){let t=jt(this,Yt,un).call(this),n=t.indexOf(document.activeElement)+1;n>=t.length&&(n=0),t[n].focus()}focusPrevious(){let t=jt(this,Yt,un).call(this),n=t.indexOf(document.activeElement)-1;n<0&&(n=t.length-1),t[n].focus()}};Gt=new WeakSet,hn=function(t){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):document.activeElement&&document.activeElement.blur():t.key==="Enter"&&this.onEnter&&this.onEnter(t))},Yt=new WeakSet,un=function(){let t=[],e='[tabindex]:not([tabindex="-1"]),[href],button:not([tabindex="-1"],[disabled]),input:not([type=hidden])';for(let n of this.containers)t.push(...n.querySelectorAll(e));return t};var pn={},Se=class extends d{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 ut(this.list,()=>{this.input.focus(),setTimeout(()=>this.hideSuggestions(),1)},e=>{e.preventDefault();let n=e.target.textContent;n&&this.selectSuggestion(n)}).shareHandlingToEl(this.input),A(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(),s=(await this.loadSuggestions(e,t)).filter(o=>e===""||o.toLowerCase().startsWith(e)).slice(0,10);this.displaySuggestions(s)}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},s=`${this.url}:${JSON.stringify(n)}`;if(pn[s])return pn[s];let o=await window.$http.get(this.url,n);return pn[s]=o.data,o.data}displaySuggestions(t){if(t.length===0){this.hideSuggestions();return}this.list.innerHTML=t.map(e=>`
  • ${ns(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 ke=class extends d{setup(){this.form=this.$el,this.form.submit()}};var Le=class extends d{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,s=Date.now(),o=this.targetElem.getBoundingClientRect().top;function r(){let a=1-(Date.now()-s)/n,l=Math.abs(a*o);a>0?(e.scrollTop=l,requestAnimationFrame(r.bind(this))):e.scrollTop=t}requestAnimationFrame(r.bind(this))}};function rs(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),e.push.apply(e,n)}return e}function ot(i){for(var t=1;t=0)&&(e[s]=i[s]);return e}function jo(i,t){if(i==null)return{};var e=zo(i,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(e[n]=i[n])}return e}function Wo(i){return Ko(i)||Xo(i)||Go(i)||Yo()}function Ko(i){if(Array.isArray(i))return Sn(i)}function Xo(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Go(i,t){if(i){if(typeof i=="string")return Sn(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 Sn(i,t)}}function Sn(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 Zo(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function Y(i,t,e,n){if(i){e=e||document;do{if(t!=null&&(t[0]===">"?i.parentNode===e&&Fe(i,t):Fe(i,t))||n&&i===e)return i;if(i===e)break}while(i=Zo(i))}return null}var ls=/\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(ls," ").replace(" "+t+" "," ");i.className=(n+(e?" "+t:"")).replace(ls," ")}}function f(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 Ct(i,t){var e="";if(typeof i=="string")e=i;else do{var n=f(i,"transform");n&&n!=="none"&&(e=n+" "+e)}while(!t&&(i=i.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(e)}function ys(i,t,e){if(i){var n=i.getElementsByTagName(t),s=0,o=n.length;if(e)for(;s=o:r=s<=o,!r)return n;if(n===st())break;n=mt(n,!1)}return!1}function Pt(i,t,e,n){for(var s=0,o=0,r=i.children;o2&&arguments[2]!==void 0?arguments[2]:{},s=n.evt,o=jo(n,or);de.pluginEvent.bind(g)(t,e,ot({dragEl:p,parentEl:I,ghostEl:v,rootEl:T,nextEl:yt,lastDownEl:Pe,cloneEl:D,cloneHidden:ft,dragStarted:ee,putSortable:N,activeSortable:g.active,originalEvent:s,oldIndex:Bt,oldDraggableIndex:re,newIndex:X,newDraggableIndex:pt,hideGhostForTarget:$s,unhideGhostForTarget:Ts,cloneNowHidden:function(){ft=!0},cloneNowShown:function(){ft=!1},dispatchSortableEvent:function(a){H({sortable:e,name:a,originalEvent:s})}},o))};function H(i){te(ot({putSortable:N,cloneEl:D,targetEl:p,rootEl:T,oldIndex:Bt,oldDraggableIndex:re,newIndex:X,newDraggableIndex:pt},i))}var p,I,v,T,yt,Pe,D,ft,Bt,X,re,pt,$e,N,Mt=!1,Re=!1,He=[],vt,J,wn,vn,us,ps,ee,At,ae,le=!1,Te=!1,Oe,F,bn=[],kn=!1,qe=[],Ve=typeof document<"u",De=ws,fs=ce||ct?"cssFloat":"float",rr=Ve&&!vs&&!ws&&"draggable"in document.createElement("div"),Ss=function(){if(Ve){if(ct)return!1;var i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}}(),ks=function(t,e){var n=f(t),s=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Pt(t,0,e),r=Pt(t,1,e),a=o&&f(o),l=r&&f(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+$(o).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+$(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(o&&a.float&&a.float!=="none"){var u=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===u)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=s&&n[fs]==="none"||r&&n[fs]==="none"&&c+h>s)?"vertical":"horizontal"},ar=function(t,e,n){var s=n?t.left:t.top,o=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,c=n?e.width:e.height;return s===a||o===l||s+r/2===a+c/2},lr=function(t,e){var n;return He.some(function(s){var o=s[R].options.emptyInsertThreshold;if(!(!o||Dn(s))){var r=$(s),a=t>=r.left-o&&t<=r.right+o,l=e>=r.top-o&&e<=r.bottom+o;if(a&&l)return n=s}}),n},Ls=function(t){function e(o,r){return function(a,l,c,h){var u=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(o==null&&(r||u))return!0;if(o==null||o===!1)return!1;if(r&&o==="clone")return o;if(typeof o=="function")return e(o(a,l,c,h),r)(a,l,c,h);var m=(r?a:l).options.group.name;return o===!0||typeof o=="string"&&o===m||o.join&&o.indexOf(m)>-1}}var n={},s=t.group;(!s||Be(s)!="object")&&(s={name:s}),n.name=s.name,n.checkPull=e(s.pull,!0),n.checkPut=e(s.put),n.revertClone=s.revertClone,t.group=n},$s=function(){!Ss&&v&&f(v,"display","none")},Ts=function(){!Ss&&v&&f(v,"display","")};Ve&&!vs&&document.addEventListener("click",function(i){if(Re)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),Re=!1,!1},!0);var bt=function(t){if(p){t=t.touches?t.touches[0]:t;var e=lr(t.clientX,t.clientY);if(e){var n={};for(var s in t)t.hasOwnProperty(s)&&(n[s]=t[s]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[R]._onDragOver(n)}}},cr=function(t){p&&p.parentNode[R]._isOutsideThisEl(t.target)};function g(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=Q({},t),i[R]=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 ks(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:g.supportPointer!==!1&&"PointerEvent"in window&&!se,emptyInsertThreshold:5};de.initializePlugins(this,i,e);for(var n in e)!(n in t)&&(t[n]=e[n]);Ls(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:rr,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(i,"pointerdown",this._onTapStart):(E(i,"mousedown",this._onTapStart),E(i,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(i,"dragover",this),E(i,"dragenter",this)),He.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Q(this,ir())}g.prototype={constructor:g,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(At=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,p):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,s=this.options,o=s.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,h=s.filter;if(wr(n),!p&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||s.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&se&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=Y(l,s.draggable,n,!1),!(l&&l.animated)&&Pe!==l)){if(Bt=O(l),re=O(l,s.draggable),typeof h=="function"){if(h.call(this,t,l,this)){H({sortable:e,rootEl:c,name:"filter",targetEl:l,toEl:n,fromEl:n}),V("filter",e,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(h&&(h=h.split(",").some(function(u){if(u=Y(c,u.trim(),n,!1),u)return H({sortable:e,rootEl:u,name:"filter",targetEl:l,fromEl:n,toEl:n}),V("filter",e,{evt:t}),!0}),h)){o&&t.cancelable&&t.preventDefault();return}s.handle&&!Y(c,s.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var s=this,o=s.el,r=s.options,a=o.ownerDocument,l;if(n&&!p&&n.parentNode===o){var c=$(n);if(T=o,p=n,I=p.parentNode,yt=p.nextSibling,Pe=n,$e=r.group,g.dragged=p,vt={target:p,clientX:(e||t).clientX,clientY:(e||t).clientY},us=vt.clientX-c.left,ps=vt.clientY-c.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,p.style["will-change"]="all",l=function(){if(V("delayEnded",s,{evt:t}),g.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!as&&s.nativeDraggable&&(p.draggable=!0),s._triggerDragStart(t,e),H({sortable:s,name:"choose",originalEvent:t}),P(p,r.chosenClass,!0)},r.ignore.split(",").forEach(function(h){ys(p,h.trim(),yn)}),E(a,"dragover",bt),E(a,"mousemove",bt),E(a,"touchmove",bt),E(a,"mouseup",s._onDrop),E(a,"touchend",s._onDrop),E(a,"touchcancel",s._onDrop),as&&this.nativeDraggable&&(this.options.touchStartThreshold=4,p.draggable=!0),V("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(ce||ct))){if(g.eventCanceled){this._onDrop();return}E(a,"mouseup",s._disableDelayedDrag),E(a,"touchend",s._disableDelayedDrag),E(a,"touchcancel",s._disableDelayedDrag),E(a,"mousemove",s._delayedDragTouchMoveHandler),E(a,"touchmove",s._delayedDragTouchMoveHandler),r.supportPointer&&E(a,"pointermove",s._delayedDragTouchMoveHandler),s._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(){p&&yn(p),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;y(t,"mouseup",this._disableDelayedDrag),y(t,"touchend",this._disableDelayedDrag),y(t,"touchcancel",this._disableDelayedDrag),y(t,"mousemove",this._delayedDragTouchMoveHandler),y(t,"touchmove",this._delayedDragTouchMoveHandler),y(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):e?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(p,"dragend",this),E(T,"dragstart",this._onDragStart));try{document.selection?_e(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Mt=!1,T&&p){V("dragStarted",this,{evt:e}),this.nativeDraggable&&E(document,"dragover",cr);var n=this.options;!t&&P(p,n.dragClass,!1),P(p,n.ghostClass,!0),g.active=this,t&&this._appendGhost(),H({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(J){this._lastX=J.clientX,this._lastY=J.clientY,$s();for(var t=document.elementFromPoint(J.clientX,J.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(J.clientX,J.clientY),t!==e);)e=t;if(p.parentNode[R]._isOutsideThisEl(t),e)do{if(e[R]){var n=void 0;if(n=e[R]._onDragOver({clientX:J.clientX,clientY:J.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Ts()}},_onTouchMove:function(t){if(vt){var e=this.options,n=e.fallbackTolerance,s=e.fallbackOffset,o=t.touches?t.touches[0]:t,r=v&&Ct(v,!0),a=v&&r&&r.a,l=v&&r&&r.d,c=De&&F&&ds(F),h=(o.clientX-vt.clientX+s.x)/(a||1)+(c?c[0]-bn[0]:0)/(a||1),u=(o.clientY-vt.clientY+s.y)/(l||1)+(c?c[1]-bn[1]:0)/(l||1);if(!g.active&&!Mt){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(H({rootEl:I,name:"add",toEl:I,fromEl:T,originalEvent:t}),H({sortable:this,name:"remove",toEl:I,originalEvent:t}),H({rootEl:I,name:"sort",toEl:I,fromEl:T,originalEvent:t}),H({sortable:this,name:"sort",toEl:I,originalEvent:t})),N&&N.save()):X!==Bt&&X>=0&&(H({sortable:this,name:"update",toEl:I,originalEvent:t}),H({sortable:this,name:"sort",toEl:I,originalEvent:t})),g.active&&((X==null||X===-1)&&(X=Bt,pt=re),H({sortable:this,name:"end",toEl:I,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){V("nulling",this),T=p=I=v=yt=D=Pe=ft=vt=J=ee=X=pt=Bt=re=At=ae=N=$e=g.dragged=g.ghost=g.clone=g.active=null,qe.forEach(function(t){t.checked=!0}),qe.length=wn=vn=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":p&&(this._onDragOver(t),dr(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,s=0,o=n.length,r=this.options;ss.right+o||i.clientY>n.bottom&&i.clientX>n.left:i.clientY>s.bottom+o||i.clientX>n.right&&i.clientY>n.top}function fr(i,t,e,n,s,o,r,a){var l=n?i.clientY:i.clientX,c=n?e.height:e.width,h=n?e.top:e.left,u=n?e.bottom:e.right,m=!1;if(!r){if(a&&Oeh+c*o/2:lu-Oe)return-ae}else if(l>h+c*(1-s)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}function mr(i){return O(p)1&&(w.forEach(function(a){o.addAnimationState({target:a,rect:z?$(a):r}),mn(a),a.fromRect=r,n.removeAnimationState(a)}),z=!1,br(!this.options.removeCloneOnHide,s))},dragOverCompleted:function(e){var n=e.sortable,s=e.isOwner,o=e.insertion,r=e.activeSortable,a=e.parentEl,l=e.putSortable,c=this.options;if(o){if(s&&r._hideClone(),Zt=!1,c.animation&&w.length>1&&(z||!s&&!r.options.sort&&!l)){var h=$(L,!1,!0,!0);w.forEach(function(m){m!==L&&(hs(m,h),a.appendChild(m))}),z=!0}if(!s)if(z||Me(),w.length>1){var u=Ie;r._showClone(n),r.options.animation&&!Ie&&u&&K.forEach(function(m){r.addAnimationState({target:m,rect:Qt}),m.fromRect=Qt,m.thisAnimationDuration=null})}else r._showClone(n)}},dragOverAnimationCapture:function(e){var n=e.dragRect,s=e.isOwner,o=e.activeSortable;if(w.forEach(function(a){a.thisAnimationDuration=null}),o.options.animation&&!s&&o.multiDrag.isMultiDrag){Qt=Q({},n);var r=Ct(L,!0);Qt.top-=r.f,Qt.left-=r.e}},dragOverAnimationComplete:function(){z&&(z=!1,Me())},drop:function(e){var n=e.originalEvent,s=e.rootEl,o=e.parentEl,r=e.sortable,a=e.dispatchSortableEvent,l=e.oldIndex,c=e.putSortable,h=c||this.sortable;if(n){var u=this.options,m=o.children;if(!It)if(u.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),P(L,u.selectedClass,!~w.indexOf(L)),~w.indexOf(L))w.splice(w.indexOf(L),1),Jt=null,te({sortable:r,rootEl:s,name:"deselect",targetEl:L,originalEvent:n});else{if(w.push(L),te({sortable:r,rootEl:s,name:"select",targetEl:L,originalEvent:n}),n.shiftKey&&Jt&&r.el.contains(Jt)){var C=O(Jt),b=O(L);if(~C&&~b&&C!==b){var S,M;for(b>C?(M=C,S=b):(M=b,S=C+1);M1){var G=$(L),_=O(L,":not(."+this.options.selectedClass+")");if(!Zt&&u.animation&&(L.thisAnimationDuration=null),h.captureAnimationState(),!Zt&&(u.animation&&(L.fromRect=G,w.forEach(function(k){if(k.thisAnimationDuration=null,k!==L){var tt=z?$(k):G;k.fromRect=tt,h.addAnimationState({target:k,rect:tt})}})),Me(),w.forEach(function(k){m[_]?o.insertBefore(k,m[_]):o.appendChild(k),_++}),l===O(L))){var q=!1;w.forEach(function(k){if(k.sortableIndex!==O(k)){q=!0;return}}),q&&(a("update"),a("sort"))}w.forEach(function(k){mn(k)}),h.animateAll()}Z=h}(s===o||c&&c.lastPutMode!=="clone")&&K.forEach(function(k){k.parentNode&&k.parentNode.removeChild(k)})}},nullingGlobal:function(){this.isMultiDrag=It=!1,K.length=0},destroyGlobal:function(){this._deselectMultiDrag(),y(document,"pointerup",this._deselectMultiDrag),y(document,"mouseup",this._deselectMultiDrag),y(document,"touchend",this._deselectMultiDrag),y(document,"keydown",this._checkKeyDown),y(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof It<"u"&&It)&&Z===this.sortable&&!(e&&Y(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;w.length;){var n=w[0];P(n,this.options.selectedClass,!1),w.shift(),te({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)}},Q(i,{pluginName:"multiDrag",utils:{select:function(e){var n=e.parentNode[R];!n||!n.options.multiDrag||~w.indexOf(e)||(Z&&Z!==n&&(Z.multiDrag._deselectMultiDrag(),Z=n),P(e,n.options.selectedClass,!0),w.push(e))},deselect:function(e){var n=e.parentNode[R],s=w.indexOf(e);!n||!n.options.multiDrag||!~s||(P(e,n.options.selectedClass,!1),w.splice(s,1))}},eventProperties:function(){var e=this,n=[],s=[];return w.forEach(function(o){n.push({multiDragElement:o,index:o.sortableIndex});var r;z&&o!==L?r=-1:z?r=O(o,":not(."+e.options.selectedClass+")"):r=O(o),s.push({multiDragElement:o,index:r})}),{items:Wo(w),clones:[].concat(K),oldIndicies:n,newIndicies:s}},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 br(i,t){w.forEach(function(e,n){var s=t.children[e.sortableIndex+(i?Number(n):0)];s?t.insertBefore(e,s):t.appendChild(e)})}function gs(i,t){K.forEach(function(e,n){var s=t.children[e.sortableIndex+(i?Number(n):0)];s?t.insertBefore(e,s):t.appendChild(e)})}function Me(){w.forEach(function(i){i!==L&&i.parentNode&&i.parentNode.removeChild(i)})}g.mount(new vr);g.mount(Mn,In);var Et=g;var Is={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}},Ms={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),s=n.indexOf(e);return n.slice(s+1).find(o=>o.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),s=n.indexOf(e);return n.slice(0,s).reverse().find(o=>o.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)}}},ze=class extends d{setup(){this.container=this.$el,this.sortContainer=this.$refs.sortContainer,this.input=this.$refs.input,Et.mount(new As);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",s=>{let o=s.target.closest(".sort-box-options [data-sort]");if(!o)return;s.preventDefault();let r=o.closest(".sort-box").querySelectorAll("ul"),a=o.getAttribute("data-sort");e=t===a?!e:!1;let l=Is[a];e&&n.includes(a)&&(l=function(h,u){return 0-Is[a](h,u)});for(let c of r)Array.from(c.children).filter(u=>u.matches("li")).sort(l).forEach(u=>{c.appendChild(u)});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(s=>{let o=nt(s.data);this.sortContainer.append(o),this.setupBookSortable(o),this.updateMoveActionStateForAll(),o.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"]},s={name:"chapter",pull:["book","chapter"],put(o,r,a){return a.getAttribute("data-type")==="page"}};for(let o of e)Et.create(o,{group:o.classList.contains("sort-list")?n:s,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 s=n.closest('[data-type="book"]').getAttribute("data-id"),o=Array.from(n.children).filter(r=>r.matches('[data-type="page"], [data-type="chapter"]'));for(let r=0;r{for(let r of s)i.style[r]=null;i.style.transition=null,i.removeEventListener("transitionend",o),je.delete(i),n&&n()};setTimeout(()=>{i.style.transition=`all ease-in-out ${e}ms`;for(let r of s)i.style[r]=t[r][1];i.addEventListener("transitionend",o),je.set(i,o)},15)}function ue(i){je.has(i)&&je.get(i)()}function Bs(i,t=400,e=null){ue(i),i.style.display="block",he(i,{opacity:["0","1"]},t,()=>{e&&e()})}function Ps(i,t=400,e=null){ue(i),he(i,{opacity:["1","0"]},t,()=>{i.style.display="none",e&&e()})}function Ot(i,t=400){ue(i);let e=i.getBoundingClientRect().height,n=getComputedStyle(i),s=n.getPropertyValue("padding-top"),o=n.getPropertyValue("padding-bottom"),r={maxHeight:[`${e}px`,"0px"],overflow:["hidden","hidden"],paddingTop:[s,"0px"],paddingBottom:[o,"0px"]};he(i,r,t,()=>{i.style.display="none"})}function _t(i,t=400){ue(i),i.style.display="block";let e=i.getBoundingClientRect().height,n=getComputedStyle(i),s=n.getPropertyValue("padding-top"),o=n.getPropertyValue("padding-bottom"),r={maxHeight:["0px",`${e}px`],overflow:["hidden","hidden"],paddingTop:["0px",s],paddingBottom:["0px",o]};he(i,r,t)}function Os(i,t=400){let e=i.getBoundingClientRect().height,n=getComputedStyle(i),s=n.getPropertyValue("padding-top"),o=n.getPropertyValue("padding-bottom");return()=>{ue(i);let r=i.getBoundingClientRect().height,a=getComputedStyle(i),l=a.getPropertyValue("padding-top"),c=a.getPropertyValue("padding-bottom"),h={height:[`${e}px`,`${r}px`],overflow:["hidden","hidden"],paddingTop:[s,l],paddingBottom:[o,c]};he(i,h,t)}}var We=class extends d{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"),_t(this.list,180),this.isOpen=!0}close(){this.toggle.classList.remove("open"),this.toggle.setAttribute("aria-expanded","false"),Ot(this.list,180),this.isOpen=!1}click(t){t.preventDefault(),this.isOpen?this.close():this.open()}};var Ke=class extends d{constructor(){super(...arguments);U(this,"editor",null);U(this,"saveCallback",null);U(this,"cancelCallback",null);U(this,"history",{});U(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()}),x(this.languageButtons,e=>{let n=e.target.dataset.lang;this.languageInput.value=n,this.languageInputChange(n)}),Lt(this.languageInput,()=>this.save()),this.languageInput.addEventListener("input",()=>this.languageInputChange(this.languageInput.value)),x(this.saveButton,()=>this.save()),A(this.historyList,"button","click",(e,n)=>{e.preventDefault();let s=n.dataset.time;this.editor&&this.editor.setContent(this.history[s])})}setupFavourites(){for(let e of this.languageButtons)this.setupFavouritesForButton(e);this.sortLanguageList()}setupFavouritesForButton(e){let n=e.dataset.lang,s=this.favourites.has(n);e.setAttribute("data-favourite",s?"true":"false"),A(e.parentElement,".lang-option-favorite-toggle","click",()=>{s=!s,s?this.favourites.add(n):this.favourites.delete(n),e.setAttribute("data-favourite",s?"true":"false"),window.$http.patch("/preferences/update-code-language-favourite",{language:n,active:s}),this.sortLanguageList(),s&&e.scrollIntoView({block:"center",behavior:"smooth"})})}sortLanguageList(){let e=this.languageButtons.sort((n,s)=>{let o=n.dataset.favourite==="true",r=s.dataset.favourite==="true";return o&&!r?-1:r&&!o||n.dataset.lang>s.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,s,o,r){this.languageInput.value=n,this.saveCallback=o,this.cancelCallback=r,await this.show(),this.languageInputChange(n),this.editor.setContent(e),this.setDirection(s)}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 s of this.languageButtons){let o=s.dataset.lang.toLowerCase().trim(),r=n===o;s.classList.toggle("active",r),r&&s.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 s=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 s=JSON.stringify(this.history);window.sessionStorage.setItem(this.historyKey,s)}};var Xe=class extends d{setup(){let t=this.$el;t.querySelectorAll("pre").length>0&&window.importVersioned("code").then(n=>{n.highlightWithin(t)})}};var Ge=class extends d{async setup(){let{mode:t}=this.$opts;(await window.importVersioned("code")).inlineEditor(this.$el,t)}};var Ye=class extends d{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"),_t(this.content,300)}close(){this.container.classList.remove("open"),this.trigger.setAttribute("aria-expanded","false"),Ot(this.content,300)}toggle(){this.container.classList.contains("open")?this.close():this.open()}openIfContainsError(){this.content.querySelector(".text-neg.text-small")&&this.open()}};var Je=class extends d{setup(){this.container=this.$el,this.confirmButton=this.$refs.confirm,this.res=null,x(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 Ze=class extends d{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 Qe=class extends d{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 ti=class extends d{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,s=this.toggle.getBoundingClientRect().height,o=e.bottom>window.innerHeight,r=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`,o?n=window.innerHeight-e.top-s/2:n=e.top),o){this.menu.style.top="initial",this.menu.style.bottom=`${n}px`;let c=window.innerHeight-40-(window.innerHeight-r.bottom);this.menu.style.maxHeight=`${Math.floor(c)}px`}else{this.menu.style.top=`${n}px`,this.menu.style.bottom="initial";let c=window.innerHeight-40-r.top;this.menu.style.maxHeight=`${Math.floor(c)}px`}this.menu.addEventListener("mouseleave",this.hide),window.addEventListener("click",c=>{this.menu.contains(c.target)||this.hide()});let a=this.menu.querySelector("input");a!==null&&a.focus(),this.showing=!0;let l=new Event("show");this.container.dispatchEvent(l),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 ut(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()}),x(this.toggle,e=>{e.stopPropagation(),e.preventDefault(),this.show(e),e instanceof KeyboardEvent&&t.focusNext()})}};var ei=class extends d{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=Tt(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 s=!t||n.textContent.toLowerCase().includes(t);n.style.display=s?"flex":"none",n.classList.toggle("hidden",!s)}}async loadList(t=""){this.listContainerElem.innerHTML="",this.toggleLoading(!0);try{let e=await window.$http.get(this.getAjaxUrl(t)),n=Os(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 Nt=class{constructor(t){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(){let{types:t}=this.data,e=[];for(let s of t)if(s.includes("image")){let o=this.data.getData(s);e.push(o.getAsFile())}let n=this.getFiles().filter(s=>s.type.includes("image"));return e.push(...n),e}getFiles(){let{files:t}=this.data;return[...t]}};async function Bn(i){if(window.isSecureContext&&navigator.clipboard){await navigator.clipboard.writeText(i);return}let t=document.createElement("textarea");t.style="position: absolute; left: -1000px; top: -1000px;",t.value=i,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}var ii=class extends d{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(){x(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 o=new Nt(n.dataTransfer).getFiles();for(let r of o)this.createUploadFromFile(r)})}manualSelectHandler(){let t=it("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=it("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:s,dismiss:o}=this.createDomForFile(t);this.statusArea.append(e);let r=this,a={file:t,dom:e,updateProgress(l){s.textContent=`${l}%`,s.style.width=`${l}%`},markError(l){n.setAttribute("data-status","error"),n.textContent=l,Xt(e),this.updateProgress(100)},markSuccess(l){n.setAttribute("data-status","success"),n.textContent=l,Xt(e),setTimeout(o,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,s=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))}});s.upload.addEventListener("progress",o=>{let r=Math.min(Math.ceil(o.loaded/o.total*100),100);t.updateProgress(r)}),s.setRequestHeader("Accept","application/json"),s.send(e)}createDomForFile(t){let e=it("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=it("div",{class:"dropzone-file-item-status"},[]),s=it("div",{class:"dropzone-file-item-progress"}),o=it("div",{class:"dropzone-file-item-image-wrap"},[e]),r=it("div",{class:"dropzone-file-item"},[o,it("div",{class:"dropzone-file-item-text-wrap"},[it("div",{class:"dropzone-file-item-label"},[t.name]),$t(),n]),s]);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:s,status:n,dismiss:a}}};var ni=class extends d{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",t=>{let e=t.target.closest("button");if(this.buttons.includes(e)){let n=e.dataset.tab;this.setActiveTab(n,!0)}})}toggle(){this.container.classList.toggle("open");let t=this.container.classList.contains("open");this.toggleButton.setAttribute("aria-expanded",t?"true":"false"),this.editorWrapEl.classList.toggle("toolbox-open",t)}setActiveTab(t,e=!1){for(let n of this.buttons)n.classList.remove("active"),n.dataset.tab===t&&n.classList.add("active");for(let n of this.contentElements)n.style.display="none",n.dataset.tabContent===t&&(n.style.display="block");e&&!this.container.classList.contains("open")&&this.toggle()}};var si=class extends d{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 s of n)s.disabled=e,s.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}`),s=nt(n.data);this.roleContainer.append(s),this.roleSelect.disabled=!1}removeRowOnButtonClick(t){let e=t.closest(".item-list-row"),{roleId:n}=t.dataset,{roleName:s}=t.dataset,o=document.createElement("option");o.value=n,o.textContent=s,this.roleSelect.append(o),e.remove()}};var oi=class extends d{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()}),x(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 ri=class extends d{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.search="",this.lastClick=0,this.setupListeners(),this.showLoading(),this.searchOptions.searchEndpoint&&this.initialLoad()}configureSearchOptions(t){Object.assign(this.searchOptions,t),this.reset(),this.searchInput.value=this.searchOptions.initialValue}setupListeners(){this.elem.addEventListener("click",this.onClick.bind(this));let t=0;this.searchInput.addEventListener("input",()=>{t=Date.now(),this.showLoading(),setTimeout(()=>{Date.now()-t<199||this.searchEntities(this.searchInput.value)},200)}),this.searchInput.addEventListener("keydown",e=>{e.keyCode===13&&e.preventDefault()}),A(this.$el,"[data-entity-type]","keydown",e=>{if(e.ctrlKey&&e.code==="Enter"){let n=this.$el.closest("form");if(n){n.submit(),e.preventDefault();return}}e.code==="ArrowDown"&&this.focusAdjacent(!0),e.code==="ArrowUp"&&this.focusAdjacent(!1)}),this.searchInput.addEventListener("keydown",e=>{e.code==="ArrowDown"&&this.focusAdjacent(!0)})}focusAdjacent(t=!0){let e=Array.from(this.resultsContainer.querySelectorAll("[data-entity-type]")),n=e.indexOf(document.activeElement),s=e[n+(t?1:-1)]||e[0];s&&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(t=>{this.resultsContainer.innerHTML=t.data,this.hideLoading()})}searchUrl(){let t=`types=${encodeURIComponent(this.searchOptions.entityTypes)}&permission=${encodeURIComponent(this.searchOptions.entityPermission)}`;return`${this.searchOptions.searchEndpoint}?${t}`}searchEntities(t){if(!this.searchOptions.searchEndpoint)throw new Error("Search endpoint not set for entity-selector load");this.input.value="";let e=`${this.searchUrl()}&term=${encodeURIComponent(t)}`;window.$http.get(e).then(n=>{this.resultsContainer.innerHTML=n.data,this.hideLoading()})}isDoubleClick(){let t=Date.now(),e=t-this.lastClick<300;return this.lastClick=t,e}onClick(t){let e=t.target.closest("[data-entity-type]");e&&(t.preventDefault(),t.stopPropagation(),this.selectItem(e))}selectItem(t){let e=this.isDoubleClick(),n=t.getAttribute("data-entity-type"),s=t.getAttribute("data-entity-id"),o=!t.classList.contains("selected")||e;this.unselectAll(),this.input.value=o?`${n}:${s}`:"";let r=t.getAttribute("href"),a=t.querySelector(".entity-list-item-name").textContent,l={id:Number(s),name:a,link:r};o?t.classList.add("selected"):window.$events.emit("entity-select-change",null),!(!e&&!o)&&(e&&this.confirmSelection(l),o&&window.$events.emit("entity-select-change",l))}confirmSelection(t){window.$events.emit("entity-select-confirm",t)}unselectAll(){let t=this.elem.querySelectorAll(".selected");for(let e of t)e.classList.remove("selected","primary-background")}};var ai=class extends d{setup(){this.container=this.$el,this.selectButton=this.$refs.select,this.selectorEl=this.$refs.selector,this.callback=null,this.selection=null,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(t,e={}){this.callback=t,this.getSelector().configureSearchOptions(e),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(t){this.selection=t,t===null?this.selectButton.setAttribute("disabled","true"):this.selectButton.removeAttribute("disabled")}handleConfirmedSelection(t){this.hide(),this.getSelector().reset(),this.callback&&t&&this.callback(t)}};var li=class extends d{setup(){this.container=this.$el,this.name=this.$opts.name,x(this.$el,()=>{this.$emit(this.name,this.$opts)})}};var ci=class extends d{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){_t(t,200)}close(t){Ot(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 di=class extends d{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=Tt(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 ut(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=nt(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 hi=class extends d{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 ui=class extends d{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(){x(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()}),x(this.cancelSearch,()=>{this.resetListView(),this.resetSearchView(),this.loadGallery()}),A(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),x(this.selectButton,()=>{this.callback&&this.callback(this.lastSelected),this.hide()}),A(this.formContainer,"#image-manager-delete","click",()=>{this.lastSelected&&this.loadImageEditForm(this.lastSelected.id,!0)}),A(this.formContainer,"#image-manager-rebuild-thumbs","click",async(n,s)=>{s.disabled=!0,this.lastSelected&&await this.rebuildThumbnails(this.lastSelected.id),s.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),Xt(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 s of[...e.children])this.listContainer.appendChild(s)}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(){Kt(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,s=t.target.classList.contains("selected");[...this.listContainer.querySelectorAll(".selected")].forEach(o=>{o.classList.remove("selected")}),!s&&!n?(t.target.classList.add("selected"),e=await this.loadImageEditForm(e.id)):n?n&&(e=this.lastSelected):this.resetEditForm(),this.selectButton.classList.toggle("hidden",s),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:s}=await window.$http.get(`/images/edit/${t}`,n);this.formContainer.innerHTML=s,this.formContainerPlaceholder.setAttribute("hidden",""),window.$components.init(this.formContainer);let o=this.formContainer.querySelector("#image-manager-form-image-data");return JSON.parse(o.text)}runLoadMore(){Kt(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 pi=class extends d{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 fi=class extends d{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()}};var mi=class extends d{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 s of n)s.classList.remove("active");e.closest(".markdown-editor-wrap").classList.add("active")}),this.handleDividerDrag()}handleDividerDrag(){this.divider.addEventListener("pointerdown",()=>{let e=this.elem.getBoundingClientRect(),n=o=>{let r=o.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)},s=()=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",s),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",s)});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")||""}getContent(){return this.editor.actions.getContent()}};var gi=class extends d{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 wi=class extends d{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 vi=class extends d{setup(){this.removeButton=this.$refs.remove,this.showButton=this.$refs.show,this.input=this.$refs.input,this.setupListeners()}setupListeners(){x(this.removeButton,()=>{this.input.value="",this.input.classList.add("hidden"),this.removeButton.classList.add("hidden"),this.showButton.classList.remove("hidden")}),x(this.showButton,()=>{this.input.classList.remove("hidden"),this.removeButton.classList.remove("hidden"),this.showButton.classList.add("hidden")})}};function _s(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"],o=(n.findIndex(a=>e&&e.classList.contains(a))+1)%n.length,r=n[o];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 Ns(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 yr(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 Fs(i){let e=new URL(window.location).searchParams.get("content-id");e&&yr(i,e)}var xt,bi;function Cr(i){return i&&!!(i.textContent||i.innerText)}async function Er(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 Rs(i,t,e){let n=new Nt(e.clipboardData||e.dataTransfer);if(!n.hasItems()||n.containsTabularData())return;let s=n.getImages();for(let o of s){let r=`image-${Math.random().toString(16).slice(2)}`,a=window.baseUrl("/loading.gif");e.preventDefault(),setTimeout(()=>{i.insertContent(`

    `),Er(o,t.pageId).then(l=>{let c=l.name.replace(/"/g,""),h=`${c}`,u=i.dom.create("a",{target:"_blank",href:l.url},h);i.dom.replace(u,r)}).catch(l=>{i.dom.remove(r),window.$events.error(l?.data?.message||t.translations.imageUploadErrorText),console.error(l)})},10)}}function xr(i){let t=i.selection.getNode();t.nodeName==="IMG"&&(xt=i.dom.getParent(t,".mceTemp"),!xt&&t.parentNode.nodeName==="A"&&!Cr(t.parentNode)&&(xt=t.parentNode)),t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="false"&&(bi=t)}function Sr(i,t,e){let{dom:n}=i,s=window.tinymce.dom.RangeUtils.getCaretRangeFromPoint(e.clientX,e.clientY,i.getDoc()),o=e.dataTransfer&&e.dataTransfer.getData("bookstack/template");o&&(e.preventDefault(),window.$http.get(`/templates/${o}`).then(r=>{i.selection.setRng(s),i.undoManager.transact(()=>{i.execCommand("mceInsertContent",!1,r.data.html)})})),n.getParent(s.startContainer,".mceTemp")?e.preventDefault():xt&&(e.preventDefault(),i.undoManager.transact(()=>{i.selection.setRng(s),i.selection.setNode(xt),n.remove(xt)})),!e.isDefaultPrevented()&&bi&&(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(bi):l.before(bi)})),e.isDefaultPrevented()||Rs(i,t,e),xt=null}function kr(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 Hs(i,t){i.on("dragover",e=>kr(i,e)),i.on("dragstart",()=>xr(i)),i.on("drop",e=>Sr(i,t,e)),i.on("paste",e=>Rs(i,t,e))}function qs(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 Lr(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 $r(i){i.ui.registry.addContextToolbar("linkcontexttoolbar",{predicate(t){return t.closest("a")!==null},position:"node",scope:"node",items:"link unlink openlink"})}function Tr(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 Dr(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 Us(i){Lr(i),$r(i),Tr(i),Dr(i)}var Ar={"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 Vs(i){for(let[t,e]of Object.entries(Ar))i.ui.registry.addIcon(t,e)}function Ir(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 Mr(i){i.parser.addNodeFilter("div",t=>{for(let e of t){let n=e.attr("id")||"",s=e.attr("class")||"";(n==="pointer"||s.includes("pointer"))&&e.remove()}})}function zs(i){Ir(i),Mr(i)}function js(i){return i.tagName.toLowerCase()==="code-block"}function Ks(i,t,e,n,s){let o=window.$components.first("code-editor"),r=i.selection.getBookmark();o.open(t,e,n,(a,l)=>{s(a,l),i.focus(),i.selection.moveToBookmark(r)},()=>{i.focus(),i.selection.moveToBookmark(r)})}function Ws(i,t){let e=t.getAttribute("dir")||"";Ks(i,t.getContent(),t.getLanguage(),e,(n,s)=>{t.setContent(n,s)})}function Br(i){let t=i.getDoc(),e=t.defaultView;class n extends e.HTMLElement{constructor(){super();U(this,"editor",null);this.attachShadow({mode:"open"});let r=document.head.querySelectorAll('link[rel="stylesheet"]:not([media="print"]),style'),a=Array.from(r).map(c=>c.cloneNode(!0)),l=document.createElement("div");l.style.pointerEvents="none",l.contentEditable="false",l.classList.add("CodeMirrorContainer"),l.classList.toggle("dark-mode",document.documentElement.classList.contains("dark-mode")),this.shadowRoot.append(...a,l)}getLanguage(){let r=c=>(c.split(" ").filter(u=>u.startsWith("language-"))[0]||"").replace("language-",""),a=this.querySelector("code"),l=this.querySelector("pre");return r(l.className)||a&&r(a.className)||""}setContent(r,a){this.editor&&(this.editor.setContent(r),this.editor.setMode(a,r));let l=this.querySelector("pre");l||(l=t.createElement("pre"),this.append(l)),l.innerHTML="";let c=t.createElement("code");l.append(c),c.innerText=r,c.className=`language-${a}`}getContent(){let r=this.querySelector("code")||this.querySelector("pre"),a=document.createElement("pre");a.innerHTML=r.innerHTML.replace(/\ufeff/g,"");let l=a.querySelectorAll("br");for(let c of l)c.replaceWith(` `);return a.textContent}connectedCallback(){let r=Date.now();if(this.editor)return;this.cleanChildContent();let a=this.getContent(),c=a.split(` -`).length*19.2+18+24;this.style.height=`${c}px`;let h=this.shadowRoot.querySelector(".CodeMirrorContainer"),u=m=>{this.editor=m.wysiwygView(h,this.shadowRoot,a,this.getLanguage()),setTimeout(()=>{this.style.height=null},12)};window.importVersioned("code").then(m=>{let C=Date.now()-r<20?20:0;setTimeout(()=>u(m),C)})}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 Mr(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(zs(t))js(i,t);else{let n=i.selection.getContent({format:"text"}),s=document.dir==="rtl"?"ltr":"";Ws(i,n,"",s,(o,r)=>{let a=e.createElement("pre"),l=e.createElement("code");l.classList.add(`language-${r}`),l.innerText=o,s&&a.setAttribute("dir",s),a.append(l),i.insertContent(a.outerHTML)})}}),i.on("dblclick",()=>{let t=i.selection.getNode();zs(t)&&js(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"}),s=e.children().filter(a=>a.name==="code")[0]||null,o=e.attr("dir")||s&&s.attr("dir")||"";o&&n.attr("dir",o);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",()=>{Ir(i)})}function Ks(){return Mr}function yi(i){return new Promise((t,e)=>{i.oncomplete=i.onsuccess=()=>t(i.result),i.onabort=i.onerror=()=>e(i.error)})}function Br(i,t){let e=indexedDB.open(i);e.onupgradeneeded=()=>e.result.createObjectStore(t);let n=yi(e);return(s,o)=>n.then(r=>o(r.transaction(t,s).objectStore(t)))}var Pn;function On(){return Pn||(Pn=Br("keyval-store","keyval")),Pn}function _n(i,t=On()){return t("readonly",e=>yi(e.get(i)))}function Nn(i,t,e=On()){return e("readwrite",n=>(n.put(t,i),yi(n.transaction)))}function Fn(i,t=On()){return t("readwrite",e=>(e.delete(i),yi(e.transaction)))}var rt=null,qn,Ci,Rn,Hn="last-drawing-save";function Un(i){rt.contentWindow.postMessage(JSON.stringify(i),qn)}function Or(i){Nn(Hn,i.data),Rn&&Rn(i.data).then(()=>{Fn(Hn)})}function _r(i){Un({action:"export",format:"xmlpng",xml:i.xml,spin:"Updating drawing"})}function Nr(){Ci&&Ci().then(i=>{Un({action:"load",autosave:1,xml:i})})}function Fr(){let i={};window.$events.emitPublic(rt,"editor-drawio::configure",{config:i}),Un({action:"configure",config:i})}function Xs(){window.removeEventListener("message",Gs),rt&&document.body.removeChild(rt)}function Gs(i){if(!i.data||i.data.length<1||i.origin!==qn)return;let t=JSON.parse(i.data);t.event==="init"?Nr():t.event==="exit"?Xs():t.event==="save"?_r(t):t.event==="export"?Or(t):t.event==="configure"&&Fr()}async function Rr(){let i=await _n(Hn),t=document.getElementById("unsaved-drawing-dialog");t||console.error("Missing expected unsaved-drawing dialog"),i&&await window.$components.firstOnElement(t,"confirm-dialog").show()&&(Ci=async()=>i)}async function Ys(i,t,e){Ci=t,Rn=e,await Rr(),rt=document.createElement("iframe"),rt.setAttribute("frameborder","0"),window.addEventListener("message",Gs),rt.setAttribute("src",i),rt.setAttribute("class","fullscreen"),rt.style.backgroundColor="#FFFFFF",document.body.appendChild(rt),qn=new URL(i).origin}async function Vn(i,t){let e={image:i,uploaded_to:t};return(await window.$http.post(window.baseUrl("/images/drawio"),e)).data}function Ei(){Xs()}async function Zs(i){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${i}`))).data.content}`}catch(t){throw t instanceof window.$http.HttpError&&window.$events.showResponseError(t),Ei(),t}}var j=null,kt=null,St={};function zn(i){return i.hasAttribute("drawio-diagram")}function qr(i,t=null){j=i,kt=t,window.$components.first("image-manager").show(n=>{if(t){let s=t.querySelector("img");j.undoManager.transact(()=>{j.dom.setAttrib(s,"src",n.url),j.dom.setAttrib(t,"drawio-diagram",n.id)})}else{let s=`
    `;j.insertContent(s)}},"drawio")}async function Ur(i){let t=window.baseUrl("/loading.gif"),e=o=>{o.status===413?window.$events.emit("error",St.translations.serverUploadLimitText):window.$events.emit("error",St.translations.imageUploadErrorText),console.error(o)};if(kt){Ei();let o=kt.querySelector("img");try{let r=await Vn(i,St.pageId);j.undoManager.transact(()=>{j.dom.setAttrib(o,"src",r.url),j.dom.setAttrib(kt,"drawio-diagram",r.id)})}catch(r){throw e(r),new Error(`Failed to save image with error: ${r}`)}return}await ss(5);let n=`drawing-${Math.random().toString(16).slice(2)}`,s=`drawing-wrap-${Math.random().toString(16).slice(2)}`;j.insertContent(`
    `),Ei();try{let o=await Vn(i,St.pageId);j.undoManager.transact(()=>{j.dom.setAttrib(n,"src",o.url),j.dom.setAttrib(s,"drawio-diagram",o.id)})}catch(o){throw j.dom.remove(s),e(o),new Error(`Failed to save image with error: ${o}`)}}function Vr(){if(!kt)return Promise.resolve("");let i=kt.getAttribute("drawio-diagram");return Zs(i)}function Js(i,t=null){j=i,kt=t,Ys(St.drawioUrl,Vr,Ur)}function zr(i){i.addCommand("drawio",()=>{let t=i.selection.getNode();Js(i,zn(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();qr(i,zn(n)?n:null)}}}),i.on("dblclick",()=>{let t=i.selection.getNode();zn(t)&&Js(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 Qs(i){return St=i,zr}function jr(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 to(){return jr}function Wr(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,s=``;s+=`${e.name}`,s+="",i.execCommand("mceInsertContent",!1,s)},"gallery")}})}function eo(){return Wr}function Kr(i){let t={title:"About the WYSIWYG Editor",url:window.baseUrl("/help/wysiwyg")};i.ui.registry.addButton("about",{icon:"help",tooltip:"About the editor",onAction(){window.tinymce.activeEditor.windowManager.openUrl(t)}})}function io(){return Kr}var no=["p","h1","h2","h3","h4","h5","h6","div","blockquote","pre","code-block","details","ul","ol","table","hr"];function xi(i){return i.selection.getNode().closest("details")}function Xr(i,t){let e=xi(i);e&&i.undoManager.transact(()=>{let n=e.querySelector("summary");n||(n=document.createElement("summary"),e.prepend(n)),n.textContent=t})}function Gr(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();Xr(i,e),t.close()}}}function Yr(i){let t=i.querySelector("summary");return t?t.textContent:""}function so(i){let t=xi(i);i.windowManager.open(Gr(i)).setData({summary:Yr(t)})}function Zr(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 s of n)t.parentNode.insertBefore(s,t);t.remove()})}i.focus(),i.selection.moveToBookmark(e)}function jn(i){i.attr("contenteditable",null);let t=!1;for(let e of i.children())e.name==="doc-root"&&(e.unwrap(),t=!0);t&&jn(i)}function Jr(i){jn(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;no.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 Qr(i){i.parser.addNodeFilter("details",t=>{for(let e of t)Jr(e)}),i.serializer.addNodeFilter("details",t=>{for(let e of t)jn(e),e.attr("open",null)}),i.serializer.addNodeFilter("doc-root",t=>{for(let e of t)e.unwrap()})}function ta(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(){Zr(i)}}),i.ui.registry.addButton("editdetials",{icon:"togglelabel",tooltip:"Edit label",onAction(){so(i)}}),i.on("dblclick",t=>{!xi(i)||t.target.closest("doc-root")||so(i)}),i.ui.registry.addButton("toggledetails",{icon:"togglefold",tooltip:"Toggle open/closed",onAction(){xi(i).toggleAttribute("open"),i.focus()}}),i.addCommand("InsertDetailsBlock",()=>{let t=i.selection.getContent({format:"html"}),e=document.createElement("details"),n=document.createElement("summary"),s=`details-${Date.now()}`;e.setAttribute("data-id",s),e.appendChild(n),t||(t="


    "),e.innerHTML+=t,i.insertContent(e.outerHTML),i.focus();let o=i.dom.select(`[data-id="${s}"]`)[0]||null;if(o){let r=o.querySelector("doc-root > *");r&&r.focus(),o.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",()=>{Qr(i)})}function oo(){return ta}function ea(i){i.ui.registry.addIcon("tableclearformatting",'');let t={items:" | tablerowheader",predicate(n){let s=n.nodeName.toLowerCase()==="table",o=i.selection.getNode(),r=o.closest("table");return!s||!r?!1:r.querySelector("tr").contains(o)},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 s=["class","style","width","height"],o=[n,...n.querySelectorAll(s.map(r=>`[${r}]`).join(","))];for(let r of o)for(let a of s)r.removeAttribute(a)}),i.addCommand("tableclearsizes",()=>{let n=i.dom.getParent(i.selection.getStart(),"table");if(!n)return;let s=[n,...n.querySelectorAll("tr,td,th,tbody,thead,tfoot,th>*,td>*")];for(let o of s)o.removeAttribute("width"),o.removeAttribute("height"),o.style.height=null,o.style.width=null});let e=()=>{let n=i.ui.registry.getAll().buttons;i.ui.registry.addMenuButton("customtable",{...n.table,fetch:s=>s("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 ro(){return ea}function ia(i){let t=i.closest("li");return t&&t.parentNode.nodeName==="UL"&&t.classList.contains("task-list-item")}function na(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 sa(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 oa(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 ra(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",s=>{let o=s.parents.find(a=>a.nodeName==="LI"),r=o&&o.classList.contains("task-list-item");n.setActive(!!r)})}});let t=i.ui.registry.getAll().buttons.bullist;t.onSetup=function(s){i.on("NodeChange",o=>{let r=o.parents.find(c=>c.nodeName==="LI"),a=r&&r.classList.contains("task-list-item"),l=r&&r.parentNode.nodeName==="UL";s.setActive(!!(l&&!a))})},t.onAction=function(){ia(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 s of n)s.attributes.map.class==="task-list-item"&&sa(s)}),i.serializer.addNodeFilter("li",n=>{for(let s of n)s.attributes.map.class==="task-list-item"&&oa(s)})}),i.on("click",n=>{let s=n.target;s.nodeName==="LI"&&s.classList.contains("task-list-item")&&(na(n,s,i),n.preventDefault())})}function ao(){return ra}function lo(i){function t(e){let n=e.querySelector("iframe, video");if(!n)return;let s=[...n.classList.values()].filter(r=>r.startsWith("align-")),o=[...e.classList.values()].filter(r=>r.startsWith("align-"));e.classList.remove(...o),e.classList.add(...s)}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 o=e.node.querySelector("iframe, video");if(o){let r=(i.formatter.get(e.format)[0]?.classes||[])[0],a=!o.classList.contains(r),c=(e.node.getAttribute("data-mce-p-class")||"").split(" ").filter(u=>!u.startsWith("align-"));a&&c.push(r);let h=c.join(" ");e.node.setAttribute("data-mce-p-class",h),o.setAttribute("class",h),i.formatter.apply(e.format,{},o),t(e.node)}})}function co(i){let t=i.querySelectorAll('[dir],[style*="direction"],[style*="text-align"]');for(let e of t)e.removeAttribute("dir"),e.style.direction=null,e.style.textAlign=null;i.style.direction=null,i.style.textAlign=null}function ho(i){let t=[];i.on("TableSelectionChange",n=>{t=(n.cells||[]).map(s=>s.dom)}),i.on("TableSelectionClear",()=>{t=[]});let e=["class","style","width","height"];i.on("ExecCommand",n=>{if(n.command==="RemoveFormat")for(let s of t)for(let o of e)s.removeAttribute(o)}),i.on("ExecCommand",n=>{let s=n.command;if(s!=="mceDirectionLTR"&&s!=="mceDirectionRTL")return;let o=s==="mceDirectionLTR"?"ltr":"rtl";for(let r of t)r.setAttribute("dir",o),co(r)})}function uo(i){i.on("ExecCommand",t=>{let e=t.command;if(e!=="mceDirectionLTR"&&e!=="mceDirectionRTL")return;let n=i.selection.getSelectedBlocks();for(let s of n)co(s)})}var aa=[{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"}]}],la={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"}}},ca=["#BFEDD2","","#FBEEB8","","#F8CAC6","","#ECCAFA","","#C2E0F4","","#2DC26B","","#F1C40F","","#E03E2D","","#B96AD9","","#3598DB","","#169179","","#E67E23","","#BA372A","","#843FA1","","#236FA1","","#ECF0F1","","#CED4D9","","#95A5A6","","#7E8C8D","","#34495E","","#000000","","#ffffff",""];function po(i,t,e){if(e.filetype==="file"){let n=window.$components.first("entity-selector-popup"),s=this.selection.getContent({format:"text"}).trim();n.show(o=>{i(o.link,{text:o.name,title:o.name})},{initialValue:s,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}e.filetype==="image"&&window.$components.first("image-manager").show(s=>{i(s.url,{alt:s.name})},"gallery")}function da(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",Ks()),window.tinymce.PluginManager.add("customhr",to()),window.tinymce.PluginManager.add("imagemanager",eo()),window.tinymce.PluginManager.add("about",io()),window.tinymce.PluginManager.add("details",oo()),window.tinymce.PluginManager.add("tasklist",ao()),window.tinymce.PluginManager.add("tableadditions",ro()),i.drawioUrl&&(window.tinymce.PluginManager.add("drawio",Qs(i)),t.push("drawio")),t.filter(e=>!!e)}function fo(i){let t=document.head.innerHTML.split(` +`).length*19.2+18+24;this.style.height=`${c}px`;let h=this.shadowRoot.querySelector(".CodeMirrorContainer"),u=m=>{this.editor=m.wysiwygView(h,this.shadowRoot,a,this.getLanguage()),setTimeout(()=>{this.style.height=null},12)};window.importVersioned("code").then(m=>{let C=Date.now()-r<20?20:0;setTimeout(()=>u(m),C)})}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 Pr(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(js(t))Ws(i,t);else{let n=i.selection.getContent({format:"text"}),s=document.dir==="rtl"?"ltr":"";Ks(i,n,"",s,(o,r)=>{let a=e.createElement("pre"),l=e.createElement("code");l.classList.add(`language-${r}`),l.innerText=o,s&&a.setAttribute("dir",s),a.append(l),i.insertContent(a.outerHTML)})}}),i.on("dblclick",()=>{let t=i.selection.getNode();js(t)&&Ws(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"}),s=e.children().filter(a=>a.name==="code")[0]||null,o=e.attr("dir")||s&&s.attr("dir")||"";o&&n.attr("dir",o);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",()=>{Br(i)})}function Xs(){return Pr}function yi(i){return new Promise((t,e)=>{i.oncomplete=i.onsuccess=()=>t(i.result),i.onabort=i.onerror=()=>e(i.error)})}function Or(i,t){let e=indexedDB.open(i);e.onupgradeneeded=()=>e.result.createObjectStore(t);let n=yi(e);return(s,o)=>n.then(r=>o(r.transaction(t,s).objectStore(t)))}var Pn;function On(){return Pn||(Pn=Or("keyval-store","keyval")),Pn}function _n(i,t=On()){return t("readonly",e=>yi(e.get(i)))}function Nn(i,t,e=On()){return e("readwrite",n=>(n.put(t,i),yi(n.transaction)))}function Fn(i,t=On()){return t("readwrite",e=>(e.delete(i),yi(e.transaction)))}var rt=null,qn,Ci,Rn,Hn="last-drawing-save";function Un(i){rt.contentWindow.postMessage(JSON.stringify(i),qn)}function Nr(i){Nn(Hn,i.data),Rn&&Rn(i.data).then(()=>{Fn(Hn)})}function Fr(i){Un({action:"export",format:"xmlpng",xml:i.xml,spin:"Updating drawing"})}function Rr(){Ci&&Ci().then(i=>{Un({action:"load",autosave:1,xml:i})})}function Hr(){let i={};window.$events.emitPublic(rt,"editor-drawio::configure",{config:i}),Un({action:"configure",config:i})}function Gs(){window.removeEventListener("message",Ys),rt&&document.body.removeChild(rt)}function Ys(i){if(!i.data||i.data.length<1||i.origin!==qn)return;let t=JSON.parse(i.data);t.event==="init"?Rr():t.event==="exit"?Gs():t.event==="save"?Fr(t):t.event==="export"?Nr(t):t.event==="configure"&&Hr()}async function qr(){let i=await _n(Hn),t=document.getElementById("unsaved-drawing-dialog");t||console.error("Missing expected unsaved-drawing dialog"),i&&await window.$components.firstOnElement(t,"confirm-dialog").show()&&(Ci=async()=>i)}async function Js(i,t,e){Ci=t,Rn=e,await qr(),rt=document.createElement("iframe"),rt.setAttribute("frameborder","0"),window.addEventListener("message",Ys),rt.setAttribute("src",i),rt.setAttribute("class","fullscreen"),rt.style.backgroundColor="#FFFFFF",document.body.appendChild(rt),qn=new URL(i).origin}async function Vn(i,t){let e={image:i,uploaded_to:t};return(await window.$http.post(window.baseUrl("/images/drawio"),e)).data}function Ei(){Gs()}async function Zs(i){try{return`data:image/png;base64,${(await window.$http.get(window.baseUrl(`/images/drawio/base64/${i}`))).data.content}`}catch(t){throw t instanceof window.$http.HttpError&&window.$events.showResponseError(t),Ei(),t}}var j=null,kt=null,St={};function zn(i){return i.hasAttribute("drawio-diagram")}function Vr(i,t=null){j=i,kt=t,window.$components.first("image-manager").show(n=>{if(t){let s=t.querySelector("img");j.undoManager.transact(()=>{j.dom.setAttrib(s,"src",n.url),j.dom.setAttrib(t,"drawio-diagram",n.id)})}else{let s=`
    `;j.insertContent(s)}},"drawio")}async function zr(i){let t=window.baseUrl("/loading.gif"),e=o=>{o.status===413?window.$events.emit("error",St.translations.serverUploadLimitText):window.$events.emit("error",St.translations.imageUploadErrorText),console.error(o)};if(kt){Ei();let o=kt.querySelector("img");try{let r=await Vn(i,St.pageId);j.undoManager.transact(()=>{j.dom.setAttrib(o,"src",r.url),j.dom.setAttrib(kt,"drawio-diagram",r.id)})}catch(r){throw e(r),new Error(`Failed to save image with error: ${r}`)}return}await os(5);let n=`drawing-${Math.random().toString(16).slice(2)}`,s=`drawing-wrap-${Math.random().toString(16).slice(2)}`;j.insertContent(`
    `),Ei();try{let o=await Vn(i,St.pageId);j.undoManager.transact(()=>{j.dom.setAttrib(n,"src",o.url),j.dom.setAttrib(s,"drawio-diagram",o.id)})}catch(o){throw j.dom.remove(s),e(o),new Error(`Failed to save image with error: ${o}`)}}function jr(){if(!kt)return Promise.resolve("");let i=kt.getAttribute("drawio-diagram");return Zs(i)}function Qs(i,t=null){j=i,kt=t,Js(St.drawioUrl,jr,zr)}function Wr(i){i.addCommand("drawio",()=>{let t=i.selection.getNode();Qs(i,zn(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();Vr(i,zn(n)?n:null)}}}),i.on("dblclick",()=>{let t=i.selection.getNode();zn(t)&&Qs(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 to(i){return St=i,Wr}function Kr(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 eo(){return Kr}function Xr(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,s=``;s+=`${e.name}`,s+="",i.execCommand("mceInsertContent",!1,s)},"gallery")}})}function io(){return Xr}function Gr(i){let t={title:"About the WYSIWYG Editor",url:window.baseUrl("/help/wysiwyg")};i.ui.registry.addButton("about",{icon:"help",tooltip:"About the editor",onAction(){window.tinymce.activeEditor.windowManager.openUrl(t)}})}function no(){return Gr}var so=["p","h1","h2","h3","h4","h5","h6","div","blockquote","pre","code-block","details","ul","ol","table","hr"];function xi(i){return i.selection.getNode().closest("details")}function Yr(i,t){let e=xi(i);e&&i.undoManager.transact(()=>{let n=e.querySelector("summary");n||(n=document.createElement("summary"),e.prepend(n)),n.textContent=t})}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();Yr(i,e),t.close()}}}function Zr(i){let t=i.querySelector("summary");return t?t.textContent:""}function oo(i){let t=xi(i);i.windowManager.open(Jr(i)).setData({summary:Zr(t)})}function Qr(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 s of n)t.parentNode.insertBefore(s,t);t.remove()})}i.focus(),i.selection.moveToBookmark(e)}function jn(i){i.attr("contenteditable",null);let t=!1;for(let e of i.children())e.name==="doc-root"&&(e.unwrap(),t=!0);t&&jn(i)}function ta(i){jn(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;so.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 ea(i){i.parser.addNodeFilter("details",t=>{for(let e of t)ta(e)}),i.serializer.addNodeFilter("details",t=>{for(let e of t)jn(e),e.attr("open",null)}),i.serializer.addNodeFilter("doc-root",t=>{for(let e of t)e.unwrap()})}function ia(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(){Qr(i)}}),i.ui.registry.addButton("editdetials",{icon:"togglelabel",tooltip:"Edit label",onAction(){oo(i)}}),i.on("dblclick",t=>{!xi(i)||t.target.closest("doc-root")||oo(i)}),i.ui.registry.addButton("toggledetails",{icon:"togglefold",tooltip:"Toggle open/closed",onAction(){xi(i).toggleAttribute("open"),i.focus()}}),i.addCommand("InsertDetailsBlock",()=>{let t=i.selection.getContent({format:"html"}),e=document.createElement("details"),n=document.createElement("summary"),s=`details-${Date.now()}`;e.setAttribute("data-id",s),e.appendChild(n),t||(t="


    "),e.innerHTML+=t,i.insertContent(e.outerHTML),i.focus();let o=i.dom.select(`[data-id="${s}"]`)[0]||null;if(o){let r=o.querySelector("doc-root > *");r&&r.focus(),o.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",()=>{ea(i)})}function ro(){return ia}function na(i){i.ui.registry.addIcon("tableclearformatting",'');let t={items:" | tablerowheader",predicate(n){let s=n.nodeName.toLowerCase()==="table",o=i.selection.getNode(),r=o.closest("table");return!s||!r?!1:r.querySelector("tr").contains(o)},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 s=["class","style","width","height"],o=[n,...n.querySelectorAll(s.map(r=>`[${r}]`).join(","))];for(let r of o)for(let a of s)r.removeAttribute(a)}),i.addCommand("tableclearsizes",()=>{let n=i.dom.getParent(i.selection.getStart(),"table");if(!n)return;let s=[n,...n.querySelectorAll("tr,td,th,tbody,thead,tfoot,th>*,td>*")];for(let o of s)o.removeAttribute("width"),o.removeAttribute("height"),o.style.height=null,o.style.width=null});let e=()=>{let n=i.ui.registry.getAll().buttons;i.ui.registry.addMenuButton("customtable",{...n.table,fetch:s=>s("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 ao(){return na}function sa(i){let t=i.closest("li");return t&&t.parentNode.nodeName==="UL"&&t.classList.contains("task-list-item")}function oa(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 ra(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 aa(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 la(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",s=>{let o=s.parents.find(a=>a.nodeName==="LI"),r=o&&o.classList.contains("task-list-item");n.setActive(!!r)})}});let t=i.ui.registry.getAll().buttons.bullist;t.onSetup=function(s){i.on("NodeChange",o=>{let r=o.parents.find(c=>c.nodeName==="LI"),a=r&&r.classList.contains("task-list-item"),l=r&&r.parentNode.nodeName==="UL";s.setActive(!!(l&&!a))})},t.onAction=function(){sa(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 s of n)s.attributes.map.class==="task-list-item"&&ra(s)}),i.serializer.addNodeFilter("li",n=>{for(let s of n)s.attributes.map.class==="task-list-item"&&aa(s)})}),i.on("click",n=>{let s=n.target;s.nodeName==="LI"&&s.classList.contains("task-list-item")&&(oa(n,s,i),n.preventDefault())})}function lo(){return la}function co(i){function t(e){let n=e.querySelector("iframe, video");if(!n)return;let s=[...n.classList.values()].filter(r=>r.startsWith("align-")),o=[...e.classList.values()].filter(r=>r.startsWith("align-"));e.classList.remove(...o),e.classList.add(...s)}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 o=e.node.querySelector("iframe, video");if(o){let r=(i.formatter.get(e.format)[0]?.classes||[])[0],a=!o.classList.contains(r),c=(e.node.getAttribute("data-mce-p-class")||"").split(" ").filter(u=>!u.startsWith("align-"));a&&c.push(r);let h=c.join(" ");e.node.setAttribute("data-mce-p-class",h),o.setAttribute("class",h),i.formatter.apply(e.format,{},o),t(e.node)}})}function ho(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 Wn(i){let t=i.querySelectorAll('[dir],[style*="direction"]');for(let e of t)e.removeAttribute("dir"),e.style.direction=null;ho(i),i.style.direction=null,i.style.textAlign=null,i.removeAttribute("align")}function uo(i){let t=[];i.on("TableSelectionChange",n=>{t=(n.cells||[]).map(s=>s.dom)}),i.on("TableSelectionClear",()=>{t=[]});let e={RemoveFormat:n=>{let s=["class","style","width","height","align"];for(let o of s)n.removeAttribute(o)},mceDirectionLTR:n=>{n.setAttribute("dir","ltr"),Wn(n)},mceDirectionRTL:n=>{n.setAttribute("dir","rtl"),Wn(n)},JustifyLeft:n=>{n.removeAttribute("align"),ho(n)},JustifyRight:this.JustifyLeft,JustifyCenter:this.JustifyLeft,JustifyFull:this.JustifyLeft};i.on("ExecCommand",n=>{let s=e[n.command];if(s)for(let o of t)s(o)})}function po(i){i.on("ExecCommand",t=>{let e=t.command;if(e!=="mceDirectionLTR"&&e!=="mceDirectionRTL")return;let n=i.selection.getSelectedBlocks();for(let s of n)Wn(s)})}var ca=[{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"}]}],da={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"}}},ha=["#BFEDD2","","#FBEEB8","","#F8CAC6","","#ECCAFA","","#C2E0F4","","#2DC26B","","#F1C40F","","#E03E2D","","#B96AD9","","#3598DB","","#169179","","#E67E23","","#BA372A","","#843FA1","","#236FA1","","#ECF0F1","","#CED4D9","","#95A5A6","","#7E8C8D","","#34495E","","#000000","","#ffffff",""];function fo(i,t,e){if(e.filetype==="file"){let n=window.$components.first("entity-selector-popup"),s=this.selection.getContent({format:"text"}).trim();n.show(o=>{i(o.link,{text:o.name,title:o.name})},{initialValue:s,searchEndpoint:"/search/entity-selector",entityTypes:"page,book,chapter,bookshelf",entityPermission:"view"})}e.filetype==="image"&&window.$components.first("image-manager").show(s=>{i(s.url,{alt:s.name})},"gallery")}function ua(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",Xs()),window.tinymce.PluginManager.add("customhr",eo()),window.tinymce.PluginManager.add("imagemanager",io()),window.tinymce.PluginManager.add("about",no()),window.tinymce.PluginManager.add("details",ro()),window.tinymce.PluginManager.add("tasklist",lo()),window.tinymce.PluginManager.add("tableadditions",ao()),i.drawioUrl&&(window.tinymce.PluginManager.add("drawio",to(i)),t.push("drawio")),t.filter(e=>!!e)}function mo(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 s=t.slice(e+1,n).join(` -`),o=i.createElement("div");o.innerHTML=s,i.head.append(...o.children)}function ha(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),_s(e),Rs(e,i),e.on("init",()=>{n(),Ns(e),window.editor=e,Os(e)}),e.on("PreInit",()=>{Vs(e)}),lo(e),ho(e),uo(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 mo(i){return` +`),o=i.createElement("div");o.innerHTML=s,i.head.append(...o.children)}function pa(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),Ns(e),Hs(e,i),e.on("init",()=>{n(),Fs(e),window.editor=e,_s(e)}),e.on("PreInit",()=>{zs(e)}),co(e),uo(e),po(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 go(i){return` html, body, html.dark-mode { background: ${i.darkMode?"#222":"#fff"}; } @@ -19,7 +19,7 @@ body { margin-right: auto !important; overflow-y: hidden !important; }`.trim().replace(` -`,"")}function go(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:da(i),contextmenu:!1,toolbar:Hs(i),content_style:mo(i),style_formats:aa,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:la,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:ca,file_picker_callback:po,paste_preprocess(e,n){let{content:s}=n;s.indexOf('this.$emit("reply",{id:this.commentLocalId,element:this.container})),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))}toggleEditMode(t){this.contentContainer.toggleAttribute("hidden",t),this.form.toggleAttribute("hidden",!t)}startEdit(){if(this.toggleEditMode(!0),this.wysiwygEditor){this.wysiwygEditor.focus();return}let t=Ft({language:this.wysiwygLanguage,containerElement:this.input,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.wysiwygTextDirection,translations:{},translationMap:window.editor_translations});window.tinymce.init(t).then(e=>{this.wysiwygEditor=e[0],setTimeout(()=>this.wysiwygEditor.focus(),50)})}async update(t){t.preventDefault();let e=this.showLoading();this.form.toggleAttribute("hidden",!0);let n={html:this.wysiwygEditor.getContent(),parent_id:this.parentId||null};try{let s=await window.$http.put(`/comment/${this.commentId}`,n),o=nt(s.data);this.container.replaceWith(o),window.$events.success(this.updatedText)}catch(s){console.error(s),window.$events.showValidationErrors(s),this.form.toggleAttribute("hidden",!1),e.remove()}}async delete(){this.showLoading(),await window.$http.delete(`/comment/${this.commentId}`),this.container.closest(".comment-branch").remove(),window.$events.success(this.deletedText),this.$emit("delete")}showLoading(){let t=$t();return t.classList.add("px-l"),this.container.append(t),t}};var ki=class extends d{setup(){this.elem=this.$el,this.pageId=Number(this.$opts.pageId),this.container=this.$refs.commentContainer,this.commentCountBar=this.$refs.commentCountBar,this.commentsTitle=this.$refs.commentsTitle,this.addButtonContainer=this.$refs.addButtonContainer,this.replyToRow=this.$refs.replyToRow,this.formContainer=this.$refs.formContainer,this.form=this.$refs.form,this.formInput=this.$refs.formInput,this.formReplyLink=this.$refs.formReplyLink,this.addCommentButton=this.$refs.addCommentButton,this.hideFormButton=this.$refs.hideFormButton,this.removeReplyToButton=this.$refs.removeReplyToButton,this.wysiwygLanguage=this.$opts.wysiwygLanguage,this.wysiwygTextDirection=this.$opts.wysiwygTextDirection,this.wysiwygEditor=null,this.createdText=this.$opts.createdText,this.countText=this.$opts.countText,this.parentId=null,this.formReplyText=this.formReplyLink?.textContent||"",this.setupListeners()}setupListeners(){this.elem.addEventListener("page-comment-delete",()=>{this.updateCount(),this.hideForm()}),this.elem.addEventListener("page-comment-reply",t=>{this.setReply(t.detail.id,t.detail.element)}),this.form&&(this.removeReplyToButton.addEventListener("click",this.removeReplyTo.bind(this)),this.hideFormButton.addEventListener("click",this.hideForm.bind(this)),this.addCommentButton.addEventListener("click",this.showForm.bind(this)),this.form.addEventListener("submit",this.saveComment.bind(this)))}saveComment(t){t.preventDefault(),t.stopPropagation();let e=$t();e.classList.add("px-l"),this.form.after(e),this.form.toggleAttribute("hidden",!0);let n={html:this.wysiwygEditor.getContent(),parent_id:this.parentId||null};window.$http.post(`/comment/${this.pageId}`,n).then(s=>{let o=nt(s.data);this.formContainer.after(o),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),e.remove()}updateCount(){let t=this.getCommentCount();this.commentsTitle.textContent=window.trans_plural(this.countText,t,{count:t})}resetForm(){this.removeEditor(),this.formInput.value="",this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer)}showForm(){this.removeEditor(),this.formContainer.toggleAttribute("hidden",!1),this.addButtonContainer.toggleAttribute("hidden",!0),this.formContainer.scrollIntoView({behavior:"smooth",block:"nearest"}),this.loadEditor()}hideForm(){this.resetForm(),this.formContainer.toggleAttribute("hidden",!0),this.getCommentCount()>0?this.elem.append(this.addButtonContainer):this.commentCountBar.append(this.addButtonContainer),this.addButtonContainer.toggleAttribute("hidden",!1)}loadEditor(){if(this.wysiwygEditor){this.wysiwygEditor.focus();return}let t=Ft({language:this.wysiwygLanguage,containerElement:this.formInput,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.wysiwygTextDirection,translations:{},translationMap:window.editor_translations});window.tinymce.init(t).then(e=>{this.wysiwygEditor=e[0],setTimeout(()=>this.wysiwygEditor.focus(),50)})}removeEditor(){this.wysiwygEditor&&(this.wysiwygEditor.remove(),this.wysiwygEditor=null)}getCommentCount(){return this.container.querySelectorAll('[component="page-comment"]').length}setReply(t,e){e.closest(".comment-branch").querySelector(".comment-branch-children").append(this.formContainer),this.showForm(),this.parentId=t,this.replyToRow.toggleAttribute("hidden",!1),this.formReplyLink.textContent=this.formReplyText.replace("1234",this.parentId),this.formReplyLink.href=`#comment${this.parentId}`}removeReplyTo(){this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.showForm()}};function ua(i,t){ln(`#page-navigation a[href="#${i}"]`,e=>{e.closest("li").classList.toggle("current-heading",t)})}function pa(i){for(let t of i){let e=t.intersectionRatio===1;ua(t.target.id,e)}}function fa(i){let t={rootMargin:"0px 0px 0px 0px",threshold:1},e=new IntersectionObserver(pa,t);for(let n of i)e.observe(n)}var Li=class extends d{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&&A(t,"a","click",(e,n)=>{e.preventDefault(),window.$components.first("tri-layout").showContent();let s=n.getAttribute("href").substr(1);this.goToText(s),window.history.pushState(null,null,`#${s}`)})}goToText(t){let e=document.getElementById(t);if(ln(".page-content [data-highlighted]",n=>{n.removeAttribute("data-highlighted"),n.style.backgroundColor=null}),e!==null)dn(e);else{let n=es(".page-content > div > *",t);n&&dn(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&&fa(e)}};function wo(i){let t=new Date(i*1e3),e=t.getHours(),n=t.getMinutes();return`${(e>9?"":"0")+e}:${(n>9?"":"0")+n}`}var $i=class extends d{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.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=Tt(this.updateChangelogDisplay.bind(this),300,!1);this.changelogInput.addEventListener("input",e),x(this.saveDraftButton,this.saveDraft.bind(this)),x(this.discardDraftButton,this.discardDraft.bind(this)),x(this.deleteDraftButton,this.deleteDraft.bind(this)),x(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),s=window.$http.delete(`/page-revisions/user-drafts/${this.pageId}`);await Promise.all([n,s]),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"),[s,o]=await Promise.all([this.saveDraft(),n.show()]);s&&o&&(window.location=e)}getEditorComponent(){return window.$components.first("markdown-editor")||window.$components.first("wysiwyg-editor")}};function Ti(i,t){i.toggleAttribute("hidden",!t)}var Di=class extends d{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(Ti(this.resetButton,e),Ti(this.buttonSep,e),Ti(this.defaultDisplay,!e),Ti(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 Ai=class extends d{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),s=this.container.querySelectorAll(this.rowSelector),o=[];for(let r of s){let a=r.children[n];a&&o.push(...a.querySelectorAll("input[type=checkbox]"))}this.toggleAllInputs(o)}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 Ii=class extends d{setup(){this.container=this.$el,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.modeToggles=this.$manyRefs.modeToggle,this.modeSections=this.$manyRefs.modeSection,this.pageId=this.$opts.pageId,this.showing=!1,this.isSelection=!1,this.setupListeners()}setupListeners(){this.includeButton.addEventListener("click",()=>Bn(this.includeInput.value)),this.linkButton.addEventListener("click",()=>Bn(this.linkInput.value)),x([this.includeInput,this.linkInput],e=>{e.target.select(),e.stopPropagation()}),be(this.pointer,["click","focus"],e=>{e.stopPropagation()}),be(document.body,["click","focus"],()=>{!this.showing||this.isSelection||this.hidePointer()}),ts(this.pointer,this.hidePointer.bind(this));let t=document.querySelector(".page-content");be(t,["mouseup","keyup"],e=>{e.stopPropagation();let n=e.target.closest('[id^="bkmrk"]');n&&window.getSelection().toString().length>0&&this.showPointerAtTarget(n,e.pageX,!1)}),x(this.sectionModeButton,this.enterSectionSelectMode.bind(this)),x(this.modeToggles,e=>{for(let n of this.modeSections){let s=!n.contains(e.target);n.toggleAttribute("hidden",!s)}this.modeToggles.find(n=>n!==e.target).focus()})}hidePointer(){this.pointer.style.display=null,this.showing=!1}showPointerAtTarget(t,e,n){this.updateForTarget(t),this.pointer.style.display="block";let s=t.getBoundingClientRect(),o=this.pointer.getBoundingClientRect(),a=Math.min(Math.max(e,s.left),s.right)-o.width/2,l=s.top-o.height-16;this.pointer.style.left=`${a}px`,this.pointer.style.top=`${l}px`,this.showing=!0,this.isSelection=!0,setTimeout(()=>{this.isSelection=!1},100);let c=()=>{this.hidePointer(),window.removeEventListener("scroll",c,{passive:!0})};t.parentElement.insertBefore(this.pointer,t),n||window.addEventListener("scroll",c,{passive:!0})}updateForTarget(t){let e=window.baseUrl(`/link/${this.pageId}#${t.id}`),n=`{{@${this.pageId}#${t.id}}}`;this.linkInput.value=e,this.includeInput.value=n;let s=this.pointer.querySelector("#pointer-edit");if(s&&t){let{editHref:o}=s.dataset,r=t.id,a=t.textContent&&t.textContent.substring(0,50);s.href=`${o}?content-id=${r}&content-text=${encodeURIComponent(a)}`}}enterSectionSelectMode(){let t=Array.from(document.querySelectorAll('.page-content [id^="bkmrk"]'));for(let e of t)e.setAttribute("tabindex","0");t[0].focus(),Lt(t,e=>{this.showPointerAtTarget(e.target,0,!0),this.pointer.focus()})}};var Mi=class extends d{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()}),x(this.hideButtons,()=>this.hide())}hide(t=null){Bs(this.container,120,t),this.onkeyup&&(window.removeEventListener("keyup",this.onkeyup),this.onkeyup=null),this.onHide&&this.onHide()}show(t=null,e=null){Ms(this.container,120,t),this.onkeyup=n=>{n.key==="Escape"&&this.hide()},window.addEventListener("keyup",this.onkeyup),this.onHide=e}};var Bi=class extends d{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 s=e.detail.showing==="color-scheme-panel-light"?"light":"dark";this.handleModeChange(s)});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 s=n.name.split("-"),o=s.indexOf("color"),r=s.slice(1,o).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,s=this.hexToRgb(n),o=`rgba(${[s.r,s.g,s.b,"0.15"].join(",")})`,r=this.container.querySelector(`input[name="${e}"][type="hidden"]`);r.value=o}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 Pi=class extends d{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 Oi=class extends d{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"}};var ga={move_up(i){let t=i.parentNode,e=Array.from(t.children).indexOf(i),n=Math.max(e-1,0);t.insertBefore(i,t.children[n]||null)},move_down(i){let t=i.parentNode,e=Array.from(t.children).indexOf(i),n=Math.min(e+2,t.children.length);t.insertBefore(i,t.children[n]||null)},remove(i,t,e){e.appendChild(i)},add(i,t){t.appendChild(i)}},_i=class extends d{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 Et(e,{group:"shelf-books",ghostClass:"primary-background-light",handle:".handle",animation:150,onSort:this.onChange.bind(this)})}setupListeners(){this.elem.addEventListener("click",t=>{let e=t.target.closest(".scroll-box-item button[data-action]");e&&this.sortItemActionClick(e)}),this.bookSearchInput.addEventListener("input",()=>{this.filterBooksByName(this.bookSearchInput.value)}),this.sortButtonContainer.addEventListener("click",t=>{let e=t.target.closest("button[data-sort]");e&&this.sortShelfBooks(e.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 s of e){let o=!t||s.textContent.toLowerCase().includes(n);s.style.display=o?null:"none"}}sortItemActionClick(t){let e=t.closest(".scroll-box-item"),{action:n}=t.dataset,s=ga[n];s(e,this.shelfBookList,this.allBookList),this.onChange()}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((s,o)=>{let r=s.dataset[t].toLowerCase(),a=o.dataset[t].toLowerCase();return n?a.localeCompare(r):r.localeCompare(a)});for(let s of e)this.shelfBookList.append(s);this.lastSort=this.lastSort===t?null:t,this.onChange()}};function wa(i){let t={};for(let[e,n]of Object.entries(i))t[n]=e;return t}var Ni=class extends d{setup(){this.container=this.$el,this.mapById=JSON.parse(this.$opts.keyMap),this.mapByShortcut=wa(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")){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(o=>!!o).join(" + "),s=this.mapByShortcut[n];s&&this.runShortcut(s)&&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 o of e){let r=o.getAttribute("data-shortcut");if(n.has(r))continue;let a=this.mapById[r];this.showHintLabel(o,a,t),n.add(r)}this.hintAbortController=new AbortController;let s=this.hintAbortController.signal;window.addEventListener("scroll",this.hideHints,{signal:s}),window.addEventListener("focus",this.hideHints,{signal:s}),window.addEventListener("blur",this.hideHints,{signal:s}),window.addEventListener("click",this.hideHints,{signal:s}),this.hintsShowing=!0}showHintLabel(t,e,n){let s=t.getBoundingClientRect(),o=document.createElement("div");o.classList.add("shortcut-hint"),o.textContent=e;let r=document.createElement("div");r.classList.add("shortcut-linkage"),r.style.left=`${s.x}px`,r.style.top=`${s.y}px`,r.style.width=`${s.width}px`,r.style.height=`${s.height}px`,n.append(o,r);let a=o.getBoundingClientRect();o.style.insetInlineStart=`${s.x+s.width-(a.width+6)}px`,o.style.insetBlockStart=`${s.y+(s.height-a.height)/2}px`}hideHints(){this.container.querySelector(".shortcut-container").remove(),this.hintAbortController?.abort(),this.hintsShowing=!1}};var ba=["Control","Alt","Shift","Meta","Super"," ","+","Tab","Escape"],Fi=class extends d{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(ba.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 Ri=class extends d{setup(){this.container=this.$el,this.handleSelector=this.$opts.handleSelector;let t=new Et(this.container,{handle:this.handleSelector,animation:150,onSort:()=>{this.$emit("sort",{ids:t.toArray()})},setData(e,n){let s=n.getAttribute("data-drag-content");if(s){let o=JSON.parse(s);for(let[r,a]of Object.entries(o))e.setData(r,a)}},revertOnSpill:!0,dropBubble:!0,dragoverBubble:!1})}};var Hi=class extends d{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 qi=class extends d{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.active=null,this.container.addEventListener("click",t=>{let e=t.target.closest('[role="tab"]');e&&this.tabs.includes(e)&&this.show(e.getAttribute("aria-controls"))}),window.addEventListener("resize",this.updateActiveState.bind(this),{passive:!0}),this.updateActiveState()}show(t){for(let e of this.panels)e.toggleAttribute("hidden",e.id!==t);for(let e of this.tabs){let s=e.getAttribute("aria-controls")===t;e.setAttribute("aria-selected",s?"true":"false")}this.$emit("change",{showing:t})}updateActiveState(){let t=window.innerWidth!e.hasAttribute("hidden"))||this.panels[0];this.show(t.id),this.tabList.toggleAttribute("hidden",!1)}deactivate(){for(let t of this.panels)t.removeAttribute("hidden");for(let t of this.tabs)t.setAttribute("aria-selected","false");this.tabList.toggleAttribute("hidden",!0)}};var Ui=class extends d{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(s=>s.value).length===0)!==void 0}};var Vi=class extends d{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(){A(this.container,"[template-action]","click",this.handleTemplateActionClick.bind(this)),A(this.container,".pagination a","click",this.handlePaginationClick.bind(this)),A(this.container,".template-item-content","click",this.handleTemplateItemClick.bind(this)),A(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"),s=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(s,n)}async insertTemplate(t,e="replace"){let n=await window.$http.get(`/templates/${t}`),s=`editor::${e}`;window.$events.emit(s,n.data)}async handlePaginationClick(t,e){t.preventDefault();let n=e.getAttribute("href"),s=await window.$http.get(n);this.list.innerHTML=s.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 zi=class extends d{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 ji=class extends d{setup(){this.container=this.$refs.container,this.tabs=this.$manyRefs.tab,this.lastLayoutType="none",this.onDestroy=null,this.scrollCache={content:0,info:0},this.lastTabShown="content",this.mobileTabClick=this.mobileTabClick.bind(this),this.updateLayout(),window.addEventListener("resize",()=>{this.updateLayout()},{passive:!0})}updateLayout(){let t="tablet";window.innerWidth<=1e3&&(t="mobile"),window.innerWidth>=1400&&(t="desktop"),t!==this.lastLayoutType&&(this.onDestroy&&(this.onDestroy(),this.onDestroy=null),t==="desktop"?this.setupDesktop():t==="mobile"&&this.setupMobile(),this.lastLayoutType=t)}setupMobile(){for(let t of this.tabs)t.addEventListener("click",this.mobileTabClick);this.onDestroy=()=>{for(let t of this.tabs)t.removeEventListener("click",this.mobileTabClick)}}setupDesktop(){}mobileTabClick(t){let{tab:e}=t.target.dataset;this.showTab(e)}showContent(){this.showTab("content",!1)}showTab(t,e=!0){this.scrollCache[this.lastTabShown]=document.documentElement.scrollTop;for(let s of this.tabs){let o=s.dataset.tab===t;s.setAttribute("aria-selected",o?"true":"false")}let n=t==="info";if(this.container.classList.toggle("show-info",n),e){let o=document.querySelector("header").getBoundingClientRect().bottom;document.documentElement.scrollTop=this.scrollCache[t]||o,setTimeout(()=>{document.documentElement.scrollTop=this.scrollCache[t]||o},50)}this.lastTabShown=t}};var Wi=class extends d{setup(){this.container=this.$el,this.input=this.$refs.input,this.userInfoContainer=this.$refs.userInfo,A(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 Ki=class extends d{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 Xi=class extends d{setup(){this.elem=this.$el,this.tinyMceConfig=go({language:this.$opts.language,containerElement:this.elem,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.$opts.textDirection,drawioUrl:this.getDrawIoUrl(),pageId:Number(this.$opts.pageId),translations:{imageUploadErrorText:this.$opts.imageUploadErrorText,serverUploadLimitText:this.$opts.serverUploadLimitText},translationMap:window.editor_translations}),window.$events.emitPublic(this.elem,"editor-tinymce::pre-init",{config:this.tinyMceConfig}),window.tinymce.init(this.tinyMceConfig).then(t=>{this.editor=t[0]})}getDrawIoUrl(){let t=document.querySelector("[drawio-url]");return t?t.getAttribute("drawio-url"):""}getContent(){return{html:this.editor.getContent()}}};var Gi=class extends d{setup(){this.elem=this.$el;let t=Ft({language:this.$opts.language,containerElement:this.elem,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.$opts.textDirection,translations:{},translationMap:window.editor_translations});window.tinymce.init(t).then(e=>{this.editor=e[0]})}};window.baseUrl=function(t){let e=t,n=document.querySelector('meta[name="base-url"]').getAttribute("content");return n[n.length-1]==="/"&&(n=n.slice(0,n.length-1)),e[0]==="/"&&(e=e.slice(1)),`${n}/${e}`};window.importVersioned=function(t){let e=document.querySelector('link[href*="/dist/styles.css?version="]').href.split("?version=").pop();return import(window.baseUrl(`dist/${t}.js?version=${e}`))};window.$http=tn;window.$events=Qi;var Rt=new Yn;window.trans=Rt.get.bind(Rt);window.trans_choice=Rt.getPlural.bind(Rt);window.trans_plural=Rt.parsePlural.bind(Rt);rn(Wn);window.$components=an;on(); +`,"")}function wo(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:ua(i),contextmenu:!1,toolbar:qs(i),content_style:go(i),style_formats:ca,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:da,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:ha,file_picker_callback:fo,paste_preprocess(e,n){let{content:s}=n;s.indexOf('this.$emit("reply",{id:this.commentLocalId,element:this.container})),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))}toggleEditMode(t){this.contentContainer.toggleAttribute("hidden",t),this.form.toggleAttribute("hidden",!t)}startEdit(){if(this.toggleEditMode(!0),this.wysiwygEditor){this.wysiwygEditor.focus();return}let t=Ft({language:this.wysiwygLanguage,containerElement:this.input,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.wysiwygTextDirection,translations:{},translationMap:window.editor_translations});window.tinymce.init(t).then(e=>{this.wysiwygEditor=e[0],setTimeout(()=>this.wysiwygEditor.focus(),50)})}async update(t){t.preventDefault();let e=this.showLoading();this.form.toggleAttribute("hidden",!0);let n={html:this.wysiwygEditor.getContent(),parent_id:this.parentId||null};try{let s=await window.$http.put(`/comment/${this.commentId}`,n),o=nt(s.data);this.container.replaceWith(o),window.$events.success(this.updatedText)}catch(s){console.error(s),window.$events.showValidationErrors(s),this.form.toggleAttribute("hidden",!1),e.remove()}}async delete(){this.showLoading(),await window.$http.delete(`/comment/${this.commentId}`),this.container.closest(".comment-branch").remove(),window.$events.success(this.deletedText),this.$emit("delete")}showLoading(){let t=$t();return t.classList.add("px-l"),this.container.append(t),t}};var ki=class extends d{setup(){this.elem=this.$el,this.pageId=Number(this.$opts.pageId),this.container=this.$refs.commentContainer,this.commentCountBar=this.$refs.commentCountBar,this.commentsTitle=this.$refs.commentsTitle,this.addButtonContainer=this.$refs.addButtonContainer,this.replyToRow=this.$refs.replyToRow,this.formContainer=this.$refs.formContainer,this.form=this.$refs.form,this.formInput=this.$refs.formInput,this.formReplyLink=this.$refs.formReplyLink,this.addCommentButton=this.$refs.addCommentButton,this.hideFormButton=this.$refs.hideFormButton,this.removeReplyToButton=this.$refs.removeReplyToButton,this.wysiwygLanguage=this.$opts.wysiwygLanguage,this.wysiwygTextDirection=this.$opts.wysiwygTextDirection,this.wysiwygEditor=null,this.createdText=this.$opts.createdText,this.countText=this.$opts.countText,this.parentId=null,this.formReplyText=this.formReplyLink?.textContent||"",this.setupListeners()}setupListeners(){this.elem.addEventListener("page-comment-delete",()=>{this.updateCount(),this.hideForm()}),this.elem.addEventListener("page-comment-reply",t=>{this.setReply(t.detail.id,t.detail.element)}),this.form&&(this.removeReplyToButton.addEventListener("click",this.removeReplyTo.bind(this)),this.hideFormButton.addEventListener("click",this.hideForm.bind(this)),this.addCommentButton.addEventListener("click",this.showForm.bind(this)),this.form.addEventListener("submit",this.saveComment.bind(this)))}saveComment(t){t.preventDefault(),t.stopPropagation();let e=$t();e.classList.add("px-l"),this.form.after(e),this.form.toggleAttribute("hidden",!0);let n={html:this.wysiwygEditor.getContent(),parent_id:this.parentId||null};window.$http.post(`/comment/${this.pageId}`,n).then(s=>{let o=nt(s.data);this.formContainer.after(o),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),e.remove()}updateCount(){let t=this.getCommentCount();this.commentsTitle.textContent=window.trans_plural(this.countText,t,{count:t})}resetForm(){this.removeEditor(),this.formInput.value="",this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer)}showForm(){this.removeEditor(),this.formContainer.toggleAttribute("hidden",!1),this.addButtonContainer.toggleAttribute("hidden",!0),this.formContainer.scrollIntoView({behavior:"smooth",block:"nearest"}),this.loadEditor()}hideForm(){this.resetForm(),this.formContainer.toggleAttribute("hidden",!0),this.getCommentCount()>0?this.elem.append(this.addButtonContainer):this.commentCountBar.append(this.addButtonContainer),this.addButtonContainer.toggleAttribute("hidden",!1)}loadEditor(){if(this.wysiwygEditor){this.wysiwygEditor.focus();return}let t=Ft({language:this.wysiwygLanguage,containerElement:this.formInput,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.wysiwygTextDirection,translations:{},translationMap:window.editor_translations});window.tinymce.init(t).then(e=>{this.wysiwygEditor=e[0],setTimeout(()=>this.wysiwygEditor.focus(),50)})}removeEditor(){this.wysiwygEditor&&(this.wysiwygEditor.remove(),this.wysiwygEditor=null)}getCommentCount(){return this.container.querySelectorAll('[component="page-comment"]').length}setReply(t,e){e.closest(".comment-branch").querySelector(".comment-branch-children").append(this.formContainer),this.showForm(),this.parentId=t,this.replyToRow.toggleAttribute("hidden",!1),this.formReplyLink.textContent=this.formReplyText.replace("1234",this.parentId),this.formReplyLink.href=`#comment${this.parentId}`}removeReplyTo(){this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.showForm()}};function fa(i,t){ln(`#page-navigation a[href="#${i}"]`,e=>{e.closest("li").classList.toggle("current-heading",t)})}function ma(i){for(let t of i){let e=t.intersectionRatio===1;fa(t.target.id,e)}}function ga(i){let t={rootMargin:"0px 0px 0px 0px",threshold:1},e=new IntersectionObserver(ma,t);for(let n of i)e.observe(n)}var Li=class extends d{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&&A(t,"a","click",(e,n)=>{e.preventDefault(),window.$components.first("tri-layout").showContent();let s=n.getAttribute("href").substr(1);this.goToText(s),window.history.pushState(null,null,`#${s}`)})}goToText(t){let e=document.getElementById(t);if(ln(".page-content [data-highlighted]",n=>{n.removeAttribute("data-highlighted"),n.style.backgroundColor=null}),e!==null)dn(e);else{let n=is(".page-content > div > *",t);n&&dn(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&&ga(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 $i=class extends d{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.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=Tt(this.updateChangelogDisplay.bind(this),300,!1);this.changelogInput.addEventListener("input",e),x(this.saveDraftButton,this.saveDraft.bind(this)),x(this.discardDraftButton,this.discardDraft.bind(this)),x(this.deleteDraftButton,this.deleteDraft.bind(this)),x(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),s=window.$http.delete(`/page-revisions/user-drafts/${this.pageId}`);await Promise.all([n,s]),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"),[s,o]=await Promise.all([this.saveDraft(),n.show()]);s&&o&&(window.location=e)}getEditorComponent(){return window.$components.first("markdown-editor")||window.$components.first("wysiwyg-editor")}};function Ti(i,t){i.toggleAttribute("hidden",!t)}var Di=class extends d{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(Ti(this.resetButton,e),Ti(this.buttonSep,e),Ti(this.defaultDisplay,!e),Ti(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 Ai=class extends d{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),s=this.container.querySelectorAll(this.rowSelector),o=[];for(let r of s){let a=r.children[n];a&&o.push(...a.querySelectorAll("input[type=checkbox]"))}this.toggleAllInputs(o)}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 Ii=class extends d{setup(){this.container=this.$el,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.modeToggles=this.$manyRefs.modeToggle,this.modeSections=this.$manyRefs.modeSection,this.pageId=this.$opts.pageId,this.showing=!1,this.isSelection=!1,this.setupListeners()}setupListeners(){this.includeButton.addEventListener("click",()=>Bn(this.includeInput.value)),this.linkButton.addEventListener("click",()=>Bn(this.linkInput.value)),x([this.includeInput,this.linkInput],e=>{e.target.select(),e.stopPropagation()}),ve(this.pointer,["click","focus"],e=>{e.stopPropagation()}),ve(document.body,["click","focus"],()=>{!this.showing||this.isSelection||this.hidePointer()}),es(this.pointer,this.hidePointer.bind(this));let t=document.querySelector(".page-content");ve(t,["mouseup","keyup"],e=>{e.stopPropagation();let n=e.target.closest('[id^="bkmrk"]');n&&window.getSelection().toString().length>0&&this.showPointerAtTarget(n,e.pageX,!1)}),x(this.sectionModeButton,this.enterSectionSelectMode.bind(this)),x(this.modeToggles,e=>{for(let n of this.modeSections){let s=!n.contains(e.target);n.toggleAttribute("hidden",!s)}this.modeToggles.find(n=>n!==e.target).focus()})}hidePointer(){this.pointer.style.display=null,this.showing=!1}showPointerAtTarget(t,e,n){this.updateForTarget(t),this.pointer.style.display="block";let s=t.getBoundingClientRect(),o=this.pointer.getBoundingClientRect(),a=Math.min(Math.max(e,s.left),s.right)-o.width/2,l=s.top-o.height-16;this.pointer.style.left=`${a}px`,this.pointer.style.top=`${l}px`,this.showing=!0,this.isSelection=!0,setTimeout(()=>{this.isSelection=!1},100);let c=()=>{this.hidePointer(),window.removeEventListener("scroll",c,{passive:!0})};t.parentElement.insertBefore(this.pointer,t),n||window.addEventListener("scroll",c,{passive:!0})}updateForTarget(t){let e=window.baseUrl(`/link/${this.pageId}#${t.id}`),n=`{{@${this.pageId}#${t.id}}}`;this.linkInput.value=e,this.includeInput.value=n;let s=this.pointer.querySelector("#pointer-edit");if(s&&t){let{editHref:o}=s.dataset,r=t.id,a=t.textContent&&t.textContent.substring(0,50);s.href=`${o}?content-id=${r}&content-text=${encodeURIComponent(a)}`}}enterSectionSelectMode(){let t=Array.from(document.querySelectorAll('.page-content [id^="bkmrk"]'));for(let e of t)e.setAttribute("tabindex","0");t[0].focus(),Lt(t,e=>{this.showPointerAtTarget(e.target,0,!0),this.pointer.focus()})}};var Mi=class extends d{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()}),x(this.hideButtons,()=>this.hide())}hide(t=null){Ps(this.container,120,t),this.onkeyup&&(window.removeEventListener("keyup",this.onkeyup),this.onkeyup=null),this.onHide&&this.onHide()}show(t=null,e=null){Bs(this.container,120,t),this.onkeyup=n=>{n.key==="Escape"&&this.hide()},window.addEventListener("keyup",this.onkeyup),this.onHide=e}};var Bi=class extends d{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 s=e.detail.showing==="color-scheme-panel-light"?"light":"dark";this.handleModeChange(s)});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 s=n.name.split("-"),o=s.indexOf("color"),r=s.slice(1,o).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,s=this.hexToRgb(n),o=`rgba(${[s.r,s.g,s.b,"0.15"].join(",")})`,r=this.container.querySelector(`input[name="${e}"][type="hidden"]`);r.value=o}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 Pi=class extends d{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 Oi=class extends d{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"}};var va={move_up(i){let t=i.parentNode,e=Array.from(t.children).indexOf(i),n=Math.max(e-1,0);t.insertBefore(i,t.children[n]||null)},move_down(i){let t=i.parentNode,e=Array.from(t.children).indexOf(i),n=Math.min(e+2,t.children.length);t.insertBefore(i,t.children[n]||null)},remove(i,t,e){e.appendChild(i)},add(i,t){t.appendChild(i)}},_i=class extends d{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 Et(e,{group:"shelf-books",ghostClass:"primary-background-light",handle:".handle",animation:150,onSort:this.onChange.bind(this)})}setupListeners(){this.elem.addEventListener("click",t=>{let e=t.target.closest(".scroll-box-item button[data-action]");e&&this.sortItemActionClick(e)}),this.bookSearchInput.addEventListener("input",()=>{this.filterBooksByName(this.bookSearchInput.value)}),this.sortButtonContainer.addEventListener("click",t=>{let e=t.target.closest("button[data-sort]");e&&this.sortShelfBooks(e.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 s of e){let o=!t||s.textContent.toLowerCase().includes(n);s.style.display=o?null:"none"}}sortItemActionClick(t){let e=t.closest(".scroll-box-item"),{action:n}=t.dataset,s=va[n];s(e,this.shelfBookList,this.allBookList),this.onChange()}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((s,o)=>{let r=s.dataset[t].toLowerCase(),a=o.dataset[t].toLowerCase();return n?a.localeCompare(r):r.localeCompare(a)});for(let s of e)this.shelfBookList.append(s);this.lastSort=this.lastSort===t?null:t,this.onChange()}};function ba(i){let t={};for(let[e,n]of Object.entries(i))t[n]=e;return t}var Ni=class extends d{setup(){this.container=this.$el,this.mapById=JSON.parse(this.$opts.keyMap),this.mapByShortcut=ba(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")){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(o=>!!o).join(" + "),s=this.mapByShortcut[n];s&&this.runShortcut(s)&&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 o of e){let r=o.getAttribute("data-shortcut");if(n.has(r))continue;let a=this.mapById[r];this.showHintLabel(o,a,t),n.add(r)}this.hintAbortController=new AbortController;let s=this.hintAbortController.signal;window.addEventListener("scroll",this.hideHints,{signal:s}),window.addEventListener("focus",this.hideHints,{signal:s}),window.addEventListener("blur",this.hideHints,{signal:s}),window.addEventListener("click",this.hideHints,{signal:s}),this.hintsShowing=!0}showHintLabel(t,e,n){let s=t.getBoundingClientRect(),o=document.createElement("div");o.classList.add("shortcut-hint"),o.textContent=e;let r=document.createElement("div");r.classList.add("shortcut-linkage"),r.style.left=`${s.x}px`,r.style.top=`${s.y}px`,r.style.width=`${s.width}px`,r.style.height=`${s.height}px`,n.append(o,r);let a=o.getBoundingClientRect();o.style.insetInlineStart=`${s.x+s.width-(a.width+6)}px`,o.style.insetBlockStart=`${s.y+(s.height-a.height)/2}px`}hideHints(){this.container.querySelector(".shortcut-container").remove(),this.hintAbortController?.abort(),this.hintsShowing=!1}};var ya=["Control","Alt","Shift","Meta","Super"," ","+","Tab","Escape"],Fi=class extends d{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(ya.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 Ri=class extends d{setup(){this.container=this.$el,this.handleSelector=this.$opts.handleSelector;let t=new Et(this.container,{handle:this.handleSelector,animation:150,onSort:()=>{this.$emit("sort",{ids:t.toArray()})},setData(e,n){let s=n.getAttribute("data-drag-content");if(s){let o=JSON.parse(s);for(let[r,a]of Object.entries(o))e.setData(r,a)}},revertOnSpill:!0,dropBubble:!0,dragoverBubble:!1})}};var Hi=class extends d{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 qi=class extends d{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.active=null,this.container.addEventListener("click",t=>{let e=t.target.closest('[role="tab"]');e&&this.tabs.includes(e)&&this.show(e.getAttribute("aria-controls"))}),window.addEventListener("resize",this.updateActiveState.bind(this),{passive:!0}),this.updateActiveState()}show(t){for(let e of this.panels)e.toggleAttribute("hidden",e.id!==t);for(let e of this.tabs){let s=e.getAttribute("aria-controls")===t;e.setAttribute("aria-selected",s?"true":"false")}this.$emit("change",{showing:t})}updateActiveState(){let t=window.innerWidth!e.hasAttribute("hidden"))||this.panels[0];this.show(t.id),this.tabList.toggleAttribute("hidden",!1)}deactivate(){for(let t of this.panels)t.removeAttribute("hidden");for(let t of this.tabs)t.setAttribute("aria-selected","false");this.tabList.toggleAttribute("hidden",!0)}};var Ui=class extends d{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(s=>s.value).length===0)!==void 0}};var Vi=class extends d{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(){A(this.container,"[template-action]","click",this.handleTemplateActionClick.bind(this)),A(this.container,".pagination a","click",this.handlePaginationClick.bind(this)),A(this.container,".template-item-content","click",this.handleTemplateItemClick.bind(this)),A(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"),s=e.closest("[template-id]").getAttribute("template-id");this.insertTemplate(s,n)}async insertTemplate(t,e="replace"){let n=await window.$http.get(`/templates/${t}`),s=`editor::${e}`;window.$events.emit(s,n.data)}async handlePaginationClick(t,e){t.preventDefault();let n=e.getAttribute("href"),s=await window.$http.get(n);this.list.innerHTML=s.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 zi=class extends d{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 ji=class extends d{setup(){this.container=this.$refs.container,this.tabs=this.$manyRefs.tab,this.lastLayoutType="none",this.onDestroy=null,this.scrollCache={content:0,info:0},this.lastTabShown="content",this.mobileTabClick=this.mobileTabClick.bind(this),this.updateLayout(),window.addEventListener("resize",()=>{this.updateLayout()},{passive:!0})}updateLayout(){let t="tablet";window.innerWidth<=1e3&&(t="mobile"),window.innerWidth>=1400&&(t="desktop"),t!==this.lastLayoutType&&(this.onDestroy&&(this.onDestroy(),this.onDestroy=null),t==="desktop"?this.setupDesktop():t==="mobile"&&this.setupMobile(),this.lastLayoutType=t)}setupMobile(){for(let t of this.tabs)t.addEventListener("click",this.mobileTabClick);this.onDestroy=()=>{for(let t of this.tabs)t.removeEventListener("click",this.mobileTabClick)}}setupDesktop(){}mobileTabClick(t){let{tab:e}=t.target.dataset;this.showTab(e)}showContent(){this.showTab("content",!1)}showTab(t,e=!0){this.scrollCache[this.lastTabShown]=document.documentElement.scrollTop;for(let s of this.tabs){let o=s.dataset.tab===t;s.setAttribute("aria-selected",o?"true":"false")}let n=t==="info";if(this.container.classList.toggle("show-info",n),e){let o=document.querySelector("header").getBoundingClientRect().bottom;document.documentElement.scrollTop=this.scrollCache[t]||o,setTimeout(()=>{document.documentElement.scrollTop=this.scrollCache[t]||o},50)}this.lastTabShown=t}};var Wi=class extends d{setup(){this.container=this.$el,this.input=this.$refs.input,this.userInfoContainer=this.$refs.userInfo,A(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 Ki=class extends d{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 Xi=class extends d{setup(){this.elem=this.$el,this.tinyMceConfig=wo({language:this.$opts.language,containerElement:this.elem,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.$opts.textDirection,drawioUrl:this.getDrawIoUrl(),pageId:Number(this.$opts.pageId),translations:{imageUploadErrorText:this.$opts.imageUploadErrorText,serverUploadLimitText:this.$opts.serverUploadLimitText},translationMap:window.editor_translations}),window.$events.emitPublic(this.elem,"editor-tinymce::pre-init",{config:this.tinyMceConfig}),window.tinymce.init(this.tinyMceConfig).then(t=>{this.editor=t[0]})}getDrawIoUrl(){let t=document.querySelector("[drawio-url]");return t?t.getAttribute("drawio-url"):""}getContent(){return{html:this.editor.getContent()}}};var Gi=class extends d{setup(){this.elem=this.$el;let t=Ft({language:this.$opts.language,containerElement:this.elem,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.$opts.textDirection,translations:{},translationMap:window.editor_translations});window.tinymce.init(t).then(e=>{this.editor=e[0]})}};window.baseUrl=function(t){let e=t,n=document.querySelector('meta[name="base-url"]').getAttribute("content");return n[n.length-1]==="/"&&(n=n.slice(0,n.length-1)),e[0]==="/"&&(e=e.slice(1)),`${n}/${e}`};window.importVersioned=function(t){let e=document.querySelector('link[href*="/dist/styles.css?version="]').href.split("?version=").pop();return import(window.baseUrl(`dist/${t}.js?version=${e}`))};window.$http=tn;window.$events=Qi;var Rt=new Jn;window.trans=Rt.get.bind(Rt);window.trans_choice=Rt.getPlural.bind(Rt);window.trans_plural=Rt.parsePlural.bind(Rt);rn(Kn);window.$components=an;on(); /*! Bundled license information: sortablejs/modular/sortable.esm.js: diff --git a/public/dist/styles.css b/public/dist/styles.css index 7505d44ca..0de8297ff 100644 --- a/public/dist/styles.css +++ b/public/dist/styles.css @@ -1 +1 @@ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after{content:"";content:none}q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}:root{--font-body: -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Roboto, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--font-code: Lucida Console, DejaVu Sans Mono, Ubuntu Mono, Monaco, monospace;--color-primary: #206ea7;--color-primary-light: rgba(32,110,167,0.15);--color-link: #206ea7;--color-page: #206ea7;--color-page-draft: #7e50b1;--color-chapter: #af4d0d;--color-book: #077b70;--color-bookshelf: #a94747;--color-positive: #0f7d15;--color-negative: #ab0f0e;--color-info: #0288D1;--color-warning: #cf4d03;--bg-disabled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25'%3E%3Cdefs%3E%3Cpattern id='doodad' width='19' height='19' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform='rotate(143)'%3E%3Crect width='100%25' height='100%25' fill='rgba(42, 67, 101,0)'/%3E%3Cpath d='M-10 30h60v20h-60zM-10-10h60v20h-60' fill='rgba(26, 32, 44,0)'/%3E%3Cpath d='M-10 10h60v20h-60zM-10-30h60v20h-60z' fill='rgba(0, 0, 0,0.05)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23doodad)' height='200%25' width='200%25'/%3E%3C/svg%3E")}:root.dark-mode{--bg-disabled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25'%3E%3Cdefs%3E%3Cpattern id='doodad' width='19' height='19' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform='rotate(143)'%3E%3Crect width='100%25' height='100%25' fill='rgba(42, 67, 101,0)'/%3E%3Cpath d='M-10 30h60v20h-60zM-10-10h60v20h-60' fill='rgba(26, 32, 44,0)'/%3E%3Cpath d='M-10 10h60v20h-60zM-10-30h60v20h-60z' fill='rgba(255, 255, 255,0.05)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23doodad)' height='200%25' width='200%25'/%3E%3C/svg%3E");color-scheme:only dark;--color-positive: #4aa850;--color-negative: #e85c5b;--color-warning: #de8a5a}:root:not(.dark-mode){color-scheme:only light}.m-none{margin:0 !important}.mx-none{margin-inline-start:0 !important;margin-inline-end:0 !important}.my-none{margin-top:0 !important;margin-bottom:0 !important}.mt-none{margin-top:0 !important}.mr-none{margin-inline-end:0 !important}.mb-none{margin-bottom:0 !important}.ml-none{margin-inline-start:0 !important}.m-xxs{margin:3px !important}.mx-xxs{margin-inline-start:3px !important;margin-inline-end:3px !important}.my-xxs{margin-top:3px !important;margin-bottom:3px !important}.mt-xxs{margin-top:3px !important}.mr-xxs{margin-inline-end:3px !important}.mb-xxs{margin-bottom:3px !important}.ml-xxs{margin-inline-start:3px !important}.m-xs{margin:6px !important}.mx-xs{margin-inline-start:6px !important;margin-inline-end:6px !important}.my-xs{margin-top:6px !important;margin-bottom:6px !important}.mt-xs{margin-top:6px !important}.mr-xs{margin-inline-end:6px !important}.mb-xs{margin-bottom:6px !important}.ml-xs{margin-inline-start:6px !important}.m-s{margin:12px !important}.mx-s{margin-inline-start:12px !important;margin-inline-end:12px !important}.my-s{margin-top:12px !important;margin-bottom:12px !important}.mt-s{margin-top:12px !important}.mr-s{margin-inline-end:12px !important}.mb-s{margin-bottom:12px !important}.ml-s{margin-inline-start:12px !important}.m-m{margin:16px !important}.mx-m{margin-inline-start:16px !important;margin-inline-end:16px !important}.my-m{margin-top:16px !important;margin-bottom:16px !important}.mt-m{margin-top:16px !important}.mr-m{margin-inline-end:16px !important}.mb-m{margin-bottom:16px !important}.ml-m{margin-inline-start:16px !important}.m-l{margin:24px !important}.mx-l{margin-inline-start:24px !important;margin-inline-end:24px !important}.my-l{margin-top:24px !important;margin-bottom:24px !important}.mt-l{margin-top:24px !important}.mr-l{margin-inline-end:24px !important}.mb-l{margin-bottom:24px !important}.ml-l{margin-inline-start:24px !important}.m-xl{margin:32px !important}.mx-xl{margin-inline-start:32px !important;margin-inline-end:32px !important}.my-xl{margin-top:32px !important;margin-bottom:32px !important}.mt-xl{margin-top:32px !important}.mr-xl{margin-inline-end:32px !important}.mb-xl{margin-bottom:32px !important}.ml-xl{margin-inline-start:32px !important}.m-xxl{margin:48px !important}.mx-xxl{margin-inline-start:48px !important;margin-inline-end:48px !important}.my-xxl{margin-top:48px !important;margin-bottom:48px !important}.mt-xxl{margin-top:48px !important}.mr-xxl{margin-inline-end:48px !important}.mb-xxl{margin-bottom:48px !important}.ml-xxl{margin-inline-start:48px !important}.m-auto{margin:auto !important}.mx-auto{margin-inline-start:auto !important;margin-inline-end:auto !important}.my-auto{margin-top:auto !important;margin-bottom:auto !important}.mt-auto{margin-top:auto !important}.mr-auto{margin-inline-end:auto !important}.mb-auto{margin-bottom:auto !important}.ml-auto{margin-inline-start:auto !important}.p-none{padding:0 !important}.px-none{padding-inline-start:0 !important;padding-inline-end:0 !important}.py-none{padding-top:0 !important;padding-bottom:0 !important}.pt-none{padding-top:0 !important}.pr-none{padding-inline-end:0 !important}.pb-none{padding-bottom:0 !important}.pl-none{padding-inline-start:0 !important}.p-xxs{padding:3px !important}.px-xxs{padding-inline-start:3px !important;padding-inline-end:3px !important}.py-xxs{padding-top:3px !important;padding-bottom:3px !important}.pt-xxs{padding-top:3px !important}.pr-xxs{padding-inline-end:3px !important}.pb-xxs{padding-bottom:3px !important}.pl-xxs{padding-inline-start:3px !important}.p-xs{padding:6px !important}.px-xs{padding-inline-start:6px !important;padding-inline-end:6px !important}.py-xs{padding-top:6px !important;padding-bottom:6px !important}.pt-xs{padding-top:6px !important}.pr-xs{padding-inline-end:6px !important}.pb-xs{padding-bottom:6px !important}.pl-xs{padding-inline-start:6px !important}.p-s{padding:12px !important}.px-s{padding-inline-start:12px !important;padding-inline-end:12px !important}.py-s{padding-top:12px !important;padding-bottom:12px !important}.pt-s{padding-top:12px !important}.pr-s{padding-inline-end:12px !important}.pb-s{padding-bottom:12px !important}.pl-s{padding-inline-start:12px !important}.p-m{padding:16px !important}.px-m{padding-inline-start:16px !important;padding-inline-end:16px !important}.py-m{padding-top:16px !important;padding-bottom:16px !important}.pt-m{padding-top:16px !important}.pr-m{padding-inline-end:16px !important}.pb-m{padding-bottom:16px !important}.pl-m{padding-inline-start:16px !important}.p-l{padding:24px !important}.px-l{padding-inline-start:24px !important;padding-inline-end:24px !important}.py-l{padding-top:24px !important;padding-bottom:24px !important}.pt-l{padding-top:24px !important}.pr-l{padding-inline-end:24px !important}.pb-l{padding-bottom:24px !important}.pl-l{padding-inline-start:24px !important}.p-xl{padding:32px !important}.px-xl{padding-inline-start:32px !important;padding-inline-end:32px !important}.py-xl{padding-top:32px !important;padding-bottom:32px !important}.pt-xl{padding-top:32px !important}.pr-xl{padding-inline-end:32px !important}.pb-xl{padding-bottom:32px !important}.pl-xl{padding-inline-start:32px !important}.p-xxl{padding:48px !important}.px-xxl{padding-inline-start:48px !important;padding-inline-end:48px !important}.py-xxl{padding-top:48px !important;padding-bottom:48px !important}.pt-xxl{padding-top:48px !important}.pr-xxl{padding-inline-end:48px !important}.pb-xxl{padding-bottom:48px !important}.pl-xxl{padding-inline-start:48px !important}.p-auto{padding:auto !important}.px-auto{padding-inline-start:auto !important;padding-inline-end:auto !important}.py-auto{padding-top:auto !important;padding-bottom:auto !important}.pt-auto{padding-top:auto !important}.pr-auto{padding-inline-end:auto !important}.pb-auto{padding-bottom:auto !important}.pl-auto{padding-inline-start:auto !important}.gap-none{gap:0 !important}.gap-x-none{column-gap:0 !important}.gap-y-none{row-gap:0 !important}.gap-xxs{gap:3px !important}.gap-x-xxs{column-gap:3px !important}.gap-y-xxs{row-gap:3px !important}.gap-xs{gap:6px !important}.gap-x-xs{column-gap:6px !important}.gap-y-xs{row-gap:6px !important}.gap-s{gap:12px !important}.gap-x-s{column-gap:12px !important}.gap-y-s{row-gap:12px !important}.gap-m{gap:16px !important}.gap-x-m{column-gap:16px !important}.gap-y-m{row-gap:16px !important}.gap-l{gap:24px !important}.gap-x-l{column-gap:24px !important}.gap-y-l{row-gap:24px !important}.gap-xl{gap:32px !important}.gap-x-xl{column-gap:32px !important}.gap-y-xl{row-gap:32px !important}.gap-xxl{gap:48px !important}.gap-x-xxl{column-gap:48px !important}.gap-y-xxl{row-gap:48px !important}.gap-auto{gap:auto !important}.gap-x-auto{column-gap:auto !important}.gap-y-auto{row-gap:auto !important}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}*{box-sizing:border-box;outline-color:var(--color-primary);outline-width:1px}*:focus{outline-style:dotted}html{height:100%;overflow-y:scroll;background-color:#f2f2f2}html.flexbox{overflow-y:hidden}html.dark-mode{background-color:#111}body{font-size:14px;line-height:1.6;color:#444;-webkit-font-smoothing:antialiased;height:100%;display:flex;flex-direction:column}html.dark-mode body{color:#aaa}body,button,input,select,label,textarea{font-family:var(--font-body)}pre,#markdown-editor-input,.text-mono,.code-base,span.code,code{font-family:var(--font-code)}h1{font-size:3.425em;line-height:1.22222222em;margin-top:.48888889em;margin-bottom:.48888889em}h2{font-size:2.8275em;line-height:1.294117647em;margin-top:.8627451em;margin-bottom:.43137255em}h3{font-size:2.333em;line-height:1.221428572em;margin-top:.78571429em;margin-bottom:.43137255em}h4{font-size:1.666em;line-height:1.375em;margin-top:.78571429em;margin-bottom:.43137255em}h1,h2,h3,h4,h5,h6{font-weight:400;position:relative;display:block;font-family:var(--font-heading, var(--font-body));color:#222}html.dark-mode h1,html.dark-mode h2,html.dark-mode h3,html.dark-mode h4,html.dark-mode h5,html.dark-mode h6{color:#bbb}h1 .subheader,h2 .subheader,h3 .subheader,h4 .subheader,h5 .subheader,h6 .subheader{font-size:.5em;line-height:1em;color:#969696}h5{font-size:1.4em}h5,h6{line-height:1.2em;margin-top:.78571429em;margin-bottom:.66em}@media screen and (max-width: 600px){h1{font-size:2.8275em}h2{font-size:2.333em}h3{font-size:1.666em}h4{font-size:1.333em}h5{font-size:1.161616em}}.list-heading{font-size:2rem}h2.list-heading{font-size:1.333rem}a{color:var(--color-link);fill:currentColor;cursor:pointer;text-decoration:none;transition:filter ease-in-out 80ms;line-height:1.6}a:hover{text-decoration:underline}a.icon{display:inline-block}a svg{position:relative;display:inline-block}a:focus img:only-child{outline:2px dashed var(--color-link);outline-offset:2px}a.no-link-style{color:inherit}a.no-link-style:hover{text-decoration:none}.blended-links a{color:inherit}.blended-links a svg{fill:currentColor}p,ul,ol,pre,table,blockquote{margin-top:.3em;margin-bottom:1.375em}hr{border:0;height:1px;background:#eaeaea;margin-bottom:24px}html.dark-mode hr{background:#555}hr.faded{background-image:linear-gradient(to right, #FFF, #e3e0e0 20%, #e3e0e0 80%, #FFF)}hr.darker{background:#ddd}html.dark-mode hr.darker{background:#666}hr.margin-top,hr.even{margin-top:24px}strong,b,.bold,.strong{font-weight:bold}strong>strong,strong>b,strong>.bold,strong>.strong,b>strong,b>b,b>.bold,b>.strong,.bold>strong,.bold>b,.bold>.bold,.bold>.strong,.strong>strong,.strong>b,.strong>.bold,.strong>.strong{font-weight:bolder}em,i,.italic{font-style:italic}small,p.small,span.small,.text-small{font-size:.75rem}sup,.superscript{vertical-align:super;font-size:.8em}sub,.subscript{vertical-align:sub;font-size:.8em}pre{font-size:12px;border:1px solid #ddd;background-color:#fff;border-color:#ddd;border-radius:4px;padding-inline-start:26px;position:relative;padding-top:3px;padding-bottom:3px}html.dark-mode pre{background-color:#2b2b2b}html.dark-mode pre{border-color:#111}pre:before{content:"";display:block;position:absolute;top:0;width:22.4px;inset-inline-start:0;height:100%;background-color:#f5f5f5;border-inline-end:1px solid #ddd}html.dark-mode pre:before{background-color:#313335}html.dark-mode pre:before{border-inline-end:none}@media print{pre{padding-left:12px}pre:before{display:none}}blockquote{display:block;position:relative;border-left:4px solid rgba(0,0,0,0);border-left-color:var(--color-primary);background-color:#f8f8f8;padding:12px 16px 12px 32px;overflow:auto}html.dark-mode blockquote{background-color:#333}blockquote:before{content:"“";font-size:2em;font-weight:bold;position:absolute;top:12px;left:12px;color:#777}.text-mono{font-family:var(--font-code)}.text-uppercase{text-transform:uppercase}.text-capitals{text-transform:capitalize}.code-base,span.code,code{font-size:.84em;border:1px solid #ddd;border-radius:3px;background-color:#f8f8f8;border-color:#ddd}html.dark-mode .code-base,html.dark-mode span.code,html.dark-mode code{background-color:#2b2b2b}html.dark-mode .code-base,html.dark-mode span.code,html.dark-mode code{border-color:#444}code{display:inline;padding:1px 3px;white-space:pre-wrap;line-height:1.2em}span.code{padding:1px 6px}pre code{background-color:rgba(0,0,0,0);border:0;font-size:1em;display:block;line-height:1.6}span.highlight{font-weight:bold;padding:2px 4px}ul,ol{padding-left:32px;padding-right:32px;display:flow-root}ul p,ol p{margin:0}ul{list-style:disc}ul ul{list-style:circle}ul label{margin:0}ol{list-style:decimal}li>ol,li>ul{margin-top:0;margin-bottom:0;margin-block-end:0;margin-block-start:0;padding-block-end:0;padding-block-start:0;padding-left:19.2px;padding-right:19.2px}li.checkbox-item,li.task-list-item{display:list-item;list-style:none;margin-left:-19.2px}li.checkbox-item input[type=checkbox],li.task-list-item input[type=checkbox]{margin-right:6px}li.checkbox-item li.checkbox-item,li.checkbox-item li.task-list-item,li.task-list-item li.checkbox-item,li.task-list-item li.task-list-item{margin-left:6px}.underlined{text-decoration:underline}.text-center{text-align:center}.text-left{text-align:start}.text-right{text-align:end}@media screen and (min-width: 360px){.text-xxs-center{text-align:center}.text-xxs-left{text-align:start}.text-xxs-right{text-align:end}}@media screen and (min-width: 400px){.text-xs-center{text-align:center}.text-xs-left{text-align:start}.text-xs-right{text-align:end}}@media screen and (min-width: 600px){.text-s-center{text-align:center}.text-s-left{text-align:start}.text-s-right{text-align:end}}@media screen and (min-width: 880px){.text-m-center{text-align:center}.text-m-left{text-align:start}.text-m-right{text-align:end}}@media screen and (min-width: 1000px){.text-l-center{text-align:center}.text-l-left{text-align:start}.text-l-right{text-align:end}}@media screen and (min-width: 1100px){.text-xl-center{text-align:center}.text-xl-left{text-align:start}.text-xl-right{text-align:end}}.text-bigger{font-size:1.1em}.text-large{font-size:1.6666em}.no-color{color:inherit}.break-text{white-space:normal;word-wrap:break-word;overflow-wrap:break-word}.text-limit-lines-1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-limit-lines-2{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.header-group{margin:16px 0}.header-group h1,.header-group h2,.header-group h3,.header-group h4,.header-group h5,.header-group h6{margin:0}span.sep{color:#bbb;padding:0 6px}.list>*{display:block}.svg-icon{width:1em;height:1em;display:inline-block;position:relative;bottom:-0.105em;margin-inline-end:6px;pointer-events:none;fill:currentColor}.primary-background{background-color:var(--color-primary) !important}.primary-background-light{background-color:var(--color-primary-light)}html.dark-mode .primary-background-light{background:#000}html.dark-mode .primary-background-light .text-link{color:#aaa !important}.link-background{background-color:var(--color-link) !important}.text-pos,.text-pos:hover,.text-pos-hover:hover{color:var(--color-positive) !important;fill:var(--color-positive) !important}.text-warn,.text-warn:hover,.text-warn-hover:hover{color:var(--color-warning) !important;fill:var(--color-warning) !important}.text-neg,.text-neg:hover,.text-neg-hover:hover{color:var(--color-negative) !important;fill:var(--color-negative) !important}.text-primary,.text-primary:hover,.text-primary-hover:hover{color:var(--color-primary) !important;fill:var(--color-primary) !important}.text-link,.text-link:hover,.text-link-hover:hover{color:var(--color-link) !important;fill:var(--color-link) !important}.text-muted{color:#575757 !important;fill:currentColor !important}html.dark-mode .text-muted{color:#888 !important}.text-dark{color:#222 !important;fill:currentColor !important}html.dark-mode .text-dark{color:#ccc !important}.text-white{color:#fff;fill:currentColor !important}.text-bookshelf,.text-bookshelf:hover{color:var(--color-bookshelf);fill:var(--color-bookshelf)}.text-book,.text-book:hover{color:var(--color-book);fill:var(--color-book)}.text-page,.text-page:hover{color:var(--color-page);fill:var(--color-page)}.text-page.draft,.text-page.draft:hover{color:var(--color-page-draft);fill:var(--color-page-draft)}.text-chapter,.text-chapter:hover{color:var(--color-chapter);fill:var(--color-chapter)}.bg-white{background-color:#fff}.bg-book{background-color:var(--color-book)}.bg-chapter{background-color:var(--color-chapter)}.bg-bookshelf{background-color:var(--color-bookshelf)}.container{max-width:1400px;margin-inline-start:auto;margin-inline-end:auto;padding-inline-start:16px;padding-inline-end:16px}.container.medium{max-width:1100px}.container.small{max-width:840px}.container.very-small{max-width:480px}.grid{display:grid;grid-column-gap:24px;grid-row-gap:24px}.grid>*{min-width:0}.grid.half{grid-template-columns:1fr 1fr}.grid.third{grid-template-columns:1fr 1fr 1fr}.grid.left-focus{grid-template-columns:2fr 1fr}.grid.right-focus{grid-template-columns:1fr 3fr}.grid.gap-y-xs{grid-row-gap:6px}.grid.gap-xl{grid-column-gap:32px;grid-row-gap:32px}.grid.gap-xxl{grid-column-gap:48px;grid-row-gap:48px}.grid.v-center{align-items:center}.grid.v-end{align-items:end}.grid.no-gap{grid-row-gap:0;grid-column-gap:0}.grid.no-row-gap{grid-row-gap:0}@media screen and (max-width: 880px){.grid.third:not(.no-break){grid-template-columns:1fr 1fr}.grid.half:not(.no-break),.grid.left-focus:not(.no-break),.grid.right-focus:not(.no-break){grid-template-columns:1fr}.grid.half.collapse-xs{grid-template-columns:1fr 1fr}.grid.gap-xl{grid-column-gap:16px;grid-row-gap:16px}.grid.right-focus.reverse-collapse>*:nth-child(2){order:0}.grid.right-focus.reverse-collapse>*:nth-child(1){order:1}}@media screen and (max-width: 600px){.grid.third:not(.no-break){grid-template-columns:1fr}}@media screen and (max-width: 400px){.grid.half.collapse-xs{grid-template-columns:1fr}}#content{flex:1 0 auto}body.flexbox{display:flex;flex-direction:column;align-items:stretch;height:100%;min-height:100%;max-height:100%;overflow:hidden}body.flexbox #content{flex:1;display:flex;min-height:0}.flex-fill{display:flex;align-items:stretch;min-height:0;max-width:100%;position:relative}.flex-container-row{display:flex;flex-direction:row}.flex-container-row.v-center{align-items:center}.flex-container-column{display:flex;flex-direction:column}.flex-container-row.inline,.flex-container-column.inline{display:inline-flex !important}.flex-container-column.wrap,.flex-container-row.wrap{flex-wrap:wrap}.flex{min-height:0;flex:1;max-width:100%}.flex.fit-content{flex-basis:auto;flex-grow:0}.flex.fill-area{flex-grow:1;flex-shrink:0;min-width:fit-content}.flex-2{min-height:0;flex:2;max-width:100%}.flex-3{min-height:0;flex:3;max-width:100%}.flex-none{flex:none}.justify-flex-start{justify-content:flex-start}.justify-flex-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-space-between{justify-content:space-between}.items-center{align-items:center}.items-stretch{align-items:stretch}.min-width-xxxxs{min-width:60px}.min-width-xxxs{min-width:80px}.min-width-xxs{min-width:100px}.min-width-xs{min-width:120px}.min-width-s{min-width:160px}.min-width-m{min-width:200px}.min-width-l{min-width:240px}.min-width-xl{min-width:280px}.min-width-xxl{min-width:320px}.block{display:block !important;position:relative}.inline{display:inline !important}.block.inline{display:inline-block !important}.relative{position:relative}.fixed{position:fixed;z-index:20}.fixed.top-right{top:0;right:0}.hidden{display:none !important}.overflow-hidden{overflow:hidden}.height-fill{height:100%}.height-auto{height:auto !important}.float{float:left}.float.right{float:right}.sticky-top-m{position:sticky;top:16px}@media screen and (max-width: 360px){.hide-under-xxs{display:none !important}}@media screen and (min-width: 360px){.hide-over-xxs{display:none !important}}@media screen and (max-width: 400px){.hide-under-xs{display:none !important}}@media screen and (min-width: 400px){.hide-over-xs{display:none !important}}@media screen and (max-width: 600px){.hide-under-s{display:none !important}}@media screen and (min-width: 600px){.hide-over-s{display:none !important}}@media screen and (max-width: 880px){.hide-under-m{display:none !important}}@media screen and (min-width: 880px){.hide-over-m{display:none !important}}@media screen and (max-width: 1000px){.hide-under-l{display:none !important}}@media screen and (min-width: 1000px){.hide-over-l{display:none !important}}@media screen and (max-width: 1100px){.hide-under-xl{display:none !important}}@media screen and (min-width: 1100px){.hide-over-xl{display:none !important}}[hidden]{display:none !important}.screen-reader-only{position:absolute;inset-inline-start:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.rounded{border-radius:4px}.dual-column-content{columns:2}@media screen and (max-width: 880px){.dual-column-content{columns:1}}.clearfix::before,.clearfix::after{content:" ";display:table}.clearfix::after{clear:both}.tri-layout-container{display:grid;margin-inline-start:32px;margin-inline-end:32px;grid-template-columns:1fr 4fr 1fr;grid-template-areas:"a b c";grid-column-gap:32px;position:relative}.tri-layout-sides{grid-column-start:a;grid-column-end:c;grid-row:1;min-width:0;z-index:4}.tri-layout-sides-content{display:grid;grid-template-areas:"a b c";grid-template-columns:1fr 4fr 1fr;height:100%}.tri-layout-middle{grid-area:b;padding-top:16px;min-width:0;z-index:5}.tri-layout-right{grid-area:c;min-width:0}.tri-layout-left{grid-area:a;min-width:0}@media screen and (min-width: 1400px){.tri-layout-left-contents,.tri-layout-right-contents{padding:32px 16px;position:sticky;top:0;max-height:100vh;min-height:50vh;overflow-y:scroll;overflow-x:hidden;height:100%;scrollbar-width:none;-ms-overflow-style:none}.tri-layout-left-contents::-webkit-scrollbar,.tri-layout-right-contents::-webkit-scrollbar{display:none}.tri-layout-middle-contents{max-width:940px;margin:0 auto}}@media screen and (min-width: 1400px)and (max-width: 1700px){.tri-layout-sides-content,.tri-layout-container{grid-template-columns:1fr 972px 1fr}.tri-layout-container{grid-column-gap:12px;margin-inline-start:16px;margin-inline-end:16px}}@media screen and (max-width: 1400px){.tri-layout-container{grid-template-areas:"a b b";grid-template-columns:1fr 3fr;grid-template-rows:min-content min-content 1fr;padding-inline-end:24px}.tri-layout-sides{grid-column-start:a;grid-column-end:a}.tri-layout-sides-content{display:block}}@media screen and (min-width: 1000px)and (max-width: 1400px){.tri-layout-sides-content{position:sticky;top:0;max-height:100vh;min-height:50vh;overflow-y:scroll;overflow-x:hidden;height:100%;scrollbar-width:none;-ms-overflow-style:none}.tri-layout-sides-content::-webkit-scrollbar{display:none}}@media screen and (min-width: 1000px){.tri-layout-mobile-tabs{display:none}.tri-layout-left-contents>*,.tri-layout-right-contents>*{opacity:.6;transition:opacity ease-in-out 120ms}html.dark-mode .tri-layout-left-contents>*,html.dark-mode .tri-layout-right-contents>*{opacity:.75}.tri-layout-left-contents>*:hover,.tri-layout-left-contents>*:focus-within,.tri-layout-right-contents>*:hover,.tri-layout-right-contents>*:focus-within{opacity:1 !important}}@media screen and (min-width: 1000px)and (prefers-contrast: more){.tri-layout-left-contents>*,.tri-layout-right-contents>*{opacity:1 !important}}@media screen and (max-width: 1000px){.tri-layout-container{grid-template-areas:none;grid-template-columns:1fr;grid-column-gap:0;padding-inline-end:6px;padding-inline-start:6px}.tri-layout-container .tri-layout-sides{padding-inline-start:16px;padding-inline-end:16px;grid-column:1/1}.tri-layout-container .tri-layout-left>*,.tri-layout-container .tri-layout-right>*{display:none;pointer-events:none}.tri-layout-container .tri-layout-left,.tri-layout-container .tri-layout-right{padding-top:0 !important}.tri-layout-container .tri-layout-middle{grid-area:none;grid-row:3;grid-column:1/1;z-index:1;overflow:hidden;transition:transform ease-in-out 240ms}.tri-layout-container .tri-layout-left{grid-row:2}.tri-layout-container.show-info{overflow:hidden}.tri-layout-container.show-info .tri-layout-middle{display:none}.tri-layout-container.show-info .tri-layout-right>*,.tri-layout-container.show-info .tri-layout-left>*{display:block;pointer-events:auto}}@media screen and (max-width: 880px){.tri-layout-container{margin-inline-start:0;margin-inline-end:0}}.card{background-color:#fff;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);border-radius:3px;break-inside:avoid}html.dark-mode .card{background-color:#222}.card .body,.card p.empty-text{padding-block:16px}.card a,.card p{word-wrap:break-word;word-break:break-word}.card-title{padding:16px 16px 6px;margin:0;font-size:14px;color:#222;fill:#222;font-weight:400}.card-title a{line-height:1}.card-footer-link,button.card-footer-link{display:block;padding:12px 16px;line-height:1;border-top:1px solid;width:100%;text-align:left;border-color:#ddd;border-radius:0 0 3px 3px;font-size:.9em;margin-top:6px}html.dark-mode .card-footer-link,html.dark-mode button.card-footer-link{border-color:#555}.card-footer-link:hover,button.card-footer-link:hover{text-decoration:none;background-color:#f2f2f2}html.dark-mode .card-footer-link:hover,html.dark-mode button.card-footer-link:hover{background-color:#2d2d2d}.card-footer-link:focus,button.card-footer-link:focus{background-color:#eee;outline:1px dotted #666;outline-offset:-2px}html.dark-mode .card-footer-link:focus,html.dark-mode button.card-footer-link:focus{background-color:#222}.card.border-card{border:1px solid;border-color:#ddd}html.dark-mode .card.border-card{border-color:#000}.card.drag-card{border:1px solid #ddd;border-color:#ddd;background-color:#fff;border-radius:4px;display:flex;padding:0 0 0 40px;margin:12px 0;position:relative}html.dark-mode .card.drag-card{border-color:#000}html.dark-mode .card.drag-card{background-color:#333}.card.drag-card .drag-card-action{cursor:pointer}.card.drag-card .handle,.card.drag-card .drag-card-action{display:flex;align-items:center;text-align:center;justify-content:center;width:28px;flex-grow:0;padding:0 6px}.card.drag-card .handle:hover,.card.drag-card .drag-card-action:hover{background-color:#eee}html.dark-mode .card.drag-card .handle:hover,html.dark-mode .card.drag-card .drag-card-action:hover{background-color:#2d2d2d}.card.drag-card .handle .svg-icon,.card.drag-card .drag-card-action .svg-icon{margin-inline-end:0px}.card.drag-card .outline input{margin:12px 0;width:100%}.card.drag-card .outline{position:relative}.card.drag-card .handle{background-color:#eee;left:0;position:absolute;top:0;bottom:0}html.dark-mode .card.drag-card .handle{background-color:#2d2d2d}.card.drag-card>div{padding:0 12px;max-width:80%;flex:1}.grid-card{display:flex;flex-direction:column;border:1px solid #ddd;border-color:#ddd;margin-bottom:24px;border-radius:4px;overflow:hidden;min-width:100px;color:#444;transition:border-color ease-in-out 120ms,box-shadow ease-in-out 120ms}html.dark-mode .grid-card{border-color:#000}.grid-card:hover{color:#444;text-decoration:none;box-shadow:0 1px 6px -1px rgba(0,0,0,.1)}html.dark-mode .grid-card:hover{box-shadow:0 1px 6px -1px rgba(0,0,0,.5)}.grid-card h2{width:100%;font-size:1.5em;margin:0 0 10px}.grid-card p{font-size:.7rem;margin:0;line-height:1.6em}.grid-card .grid-card-content{flex:1;border-top:0;border-bottom-width:2px}.grid-card .grid-card-content,.grid-card .grid-card-footer{padding:24px}.grid-card .grid-card-content+.grid-card-footer{padding-top:0}.book-grid-item .grid-card-footer p.small{font-size:.8em;margin:0}.content-wrap.card{padding:16px 48px;margin-inline-start:auto;margin-inline-end:auto;margin-bottom:24px;overflow:initial;min-height:60vh;border-radius:8px}.content-wrap.card.auto-height{min-height:0}.content-wrap.card.fill-width{width:100%}@media screen and (max-width: 1400px){.content-wrap.card{padding:16px 32px}}@media screen and (max-width: 880px){.content-wrap.card{padding:16px 24px}}@media screen and (max-width: 600px){.content-wrap.card{padding:16px 16px}}.sub-card{box-shadow:0 1px 3px 0 rgba(0,0,0,.1);border:1.5px solid;border-color:#e2e2e2;border-radius:4px}html.dark-mode .sub-card{border-color:#444}.outline-hover{border:1px solid rgba(0,0,0,0) !important}.outline-hover:hover{border:1px solid rgba(0,0,0,.1) !important}.fade-in-when-active{opacity:.6;transition:opacity ease-in-out 120ms}html.dark-mode .fade-in-when-active{opacity:.7}.fade-in-when-active:hover,.fade-in-when-active:focus-within{opacity:1 !important}@media(prefers-contrast: more){.fade-in-when-active{opacity:1 !important}}.tag-item{display:inline-flex;margin-bottom:6px;margin-inline-end:6px;border-radius:4px;border:1px solid;overflow:hidden;font-size:.85em;border-color:#ccc}html.dark-mode .tag-item{border-color:#666}.tag-item a,.tag-item span,.tag-item a:hover,.tag-item a:active{padding:4px 8px;color:rgba(0,0,0,.7);transition:background-color ease-in-out 80ms;text-decoration:none}html.dark-mode .tag-item a,html.dark-mode .tag-item span,html.dark-mode .tag-item a:hover,html.dark-mode .tag-item a:active{color:rgba(255,255,255,.8)}.tag-item a:hover{background-color:rgba(255,255,255,.7)}html.dark-mode .tag-item a:hover{background-color:rgba(255,255,255,.3)}.tag-item svg{fill:rgba(0,0,0,.5)}html.dark-mode .tag-item svg{fill:rgba(255,255,255,.5)}.tag-item .tag-value{border-inline-start:1px solid;border-color:#ddd;background-color:rgba(255,255,255,.5)}html.dark-mode .tag-item .tag-value{border-color:#666}html.dark-mode .tag-item .tag-value{background-color:rgba(255,255,255,.2)}.tag-name.highlight,.tag-value.highlight{font-weight:bold}.tag-list div:last-child .tag-item{margin-bottom:0}.item-list-row .tag-item{margin-bottom:0}.api-method{font-size:.75rem;background-color:#888;padding:6px;line-height:1.3;opacity:.7;vertical-align:top;border-radius:3px;color:#fff;display:inline-block;min-width:60px;text-align:center;font-weight:bold}.api-method[data-method=GET]{background-color:#077b70}.api-method[data-method=POST]{background-color:#cf4d03}.api-method[data-method=PUT]{background-color:#0288d1}.api-method[data-method=DELETE]{background-color:#ab0f0e}.sticky-sidebar{position:sticky;top:16px;max-height:calc(100vh - 16px);overflow-y:auto}button{background-color:rgba(0,0,0,0);border:0;font-size:100%}.button{text-decoration:none;font-size:.85rem;line-height:1.4em;padding:7.8px 16px;margin-top:6px;margin-bottom:6px;display:inline-block;font-weight:400;outline:0;border-radius:4px;cursor:pointer;transition:background-color ease-in-out 120ms,filter ease-in-out 120ms,box-shadow ease-in-out 120ms;box-shadow:none;background-color:var(--color-primary);color:#fff;border:1px solid var(--color-primary);vertical-align:top}.button:hover,.button:focus,.button:active{background-color:var(--color-primary);text-decoration:none;color:#fff}.button:hover{box-shadow:0 0 4px 1px #ccc;filter:brightness(110%)}html.dark-mode .button:hover{box-shadow:0 0 4px 1px rgba(0,0,0,.5)}.button:focus{outline:1px dotted currentColor;outline-offset:-6px;box-shadow:none;filter:brightness(90%)}.button:active{outline:0}.button.outline{background-color:rgba(0,0,0,0);color:#666;fill:currentColor;border:1px solid;border-color:#ccc}html.dark-mode .button.outline{color:#aaa}html.dark-mode .button.outline{border-color:#666}.button.outline:hover,.button.outline:focus,.button.outline:active{color:#444;border:1px solid #ccc;box-shadow:0 1px 4px 0 rgba(0,0,0,.1);background-color:#f2f2f2;background-color:#f8f8f8;filter:none}html.dark-mode .button.outline:hover,html.dark-mode .button.outline:focus,html.dark-mode .button.outline:active{color:#bbb}html.dark-mode .button.outline:hover,html.dark-mode .button.outline:focus,html.dark-mode .button.outline:active{background-color:#444}.button.outline:active{border-color:#bbb;background-color:#ddd;color:#666;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.button+.button{margin-inline-start:12px}.button.small{font-size:.75rem;padding:7.2px 12px}.text-button{cursor:pointer;background-color:rgba(0,0,0,0);padding:0;margin:0;border:none;user-select:none;font-size:.75rem;line-height:1.4em;color:var(--color-link)}.text-button:active{outline:0}.text-button:hover{text-decoration:none}.text-button:hover,.text-button:focus{color:var(--color-link);fill:var(--color-link)}.text-button.hover-underline:hover{text-decoration:underline}.button.block{width:100%;text-align:start;display:block}.button.icon .svg-icon,.icon-button .svg-icon,.text-button.icon .svg-icon{margin-inline-end:0}.icon-button{text-align:center;border:1px solid rgba(0,0,0,0)}.icon-button:hover{background-color:rgba(0,0,0,.05);border-radius:4px;border-color:#ddd;cursor:pointer}html.dark-mode .icon-button:hover{border-color:#444}.button.svg{display:flex;align-items:center;padding:12px 16px;padding-bottom:10px;width:100%}.button.svg svg{display:inline-block;width:24px;height:24px;bottom:auto;margin-inline-end:16px}.button[disabled]{background-color:#bbb;cursor:default;border-color:#ccc}.button[disabled]:hover{background-color:#bbb;cursor:default;box-shadow:none}table{min-width:100px;max-width:100%}table thead{background-color:#f8f8f8;font-weight:500}html.dark-mode table thead{background-color:#333}table td,table th{min-width:10px;padding:6px 8px;border:1px solid #ddd;overflow:auto;line-height:1.2;word-break:break-word;vertical-align:top}table td p,table th p{margin:0}table.table{width:100%}table.table tr td,table.table tr th{border-bottom:1px solid rgba(0,0,0,.05)}table.table th,table.table td{text-align:start;border:none;padding:12px 12px;vertical-align:middle;margin:0;overflow:visible}table.table th{font-weight:bold}table.table tr:hover{background-color:#f2f2f2}html.dark-mode table.table tr:hover{background-color:#333}table.table .text-right{text-align:end}table.table .text-center{text-align:center}table.table td.actions{overflow:visible}table.table a{display:inline-block}table.table.expand-to-padding{margin-left:-12px;margin-right:-12px;width:calc(100% + 2*12px);max-width:calc(100% + 2*12px)}table.no-style td{border:0;padding:0}table.list-table{margin:0 -6px}table.list-table td{border:0;vertical-align:middle;padding:6px}.input-base,input[type=text],input[type=number],input[type=email],input[type=date],input[type=search],input[type=url],input[type=color],input[type=password],select,textarea,.fake-input{border-radius:3px;border:1px solid #d4d4d4;background-color:#fff;border-color:#d4d4d4;color:#666;display:inline-block;font-size:14px;padding:10.8px;height:40px;width:250px;max-width:100%}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{background-color:#333}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{border-color:#111}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{color:#aaa}.input-base.neg,input.neg[type=text],input.neg[type=number],input.neg[type=email],input.neg[type=date],input.neg[type=search],input.neg[type=url],input.neg[type=color],input.neg[type=password],select.neg,textarea.neg,.neg.fake-input,.input-base.invalid,input.invalid[type=text],input.invalid[type=number],input.invalid[type=email],input.invalid[type=date],input.invalid[type=search],input.invalid[type=url],input.invalid[type=color],input.invalid[type=password],select.invalid,textarea.invalid,.invalid.fake-input{border:1px solid var(--color-negative)}.input-base.pos,input.pos[type=text],input.pos[type=number],input.pos[type=email],input.pos[type=date],input.pos[type=search],input.pos[type=url],input.pos[type=color],input.pos[type=password],select.pos,textarea.pos,.pos.fake-input,.input-base.valid,input.valid[type=text],input.valid[type=number],input.valid[type=email],input.valid[type=date],input.valid[type=search],input.valid[type=url],input.valid[type=color],input.valid[type=password],select.valid,textarea.valid,.valid.fake-input{border:1px solid var(--color-positive)}.input-base.disabled,input.disabled[type=text],input.disabled[type=number],input.disabled[type=email],input.disabled[type=date],input.disabled[type=search],input.disabled[type=url],input.disabled[type=color],input.disabled[type=password],select.disabled,textarea.disabled,.disabled.fake-input,.input-base[disabled],input[disabled][type=text],input[disabled][type=number],input[disabled][type=email],input[disabled][type=date],input[disabled][type=search],input[disabled][type=url],input[disabled][type=color],input[disabled][type=password],select[disabled],textarea[disabled],[disabled].fake-input{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAMUlEQVQIW2NkwAGuXbv2nxGbHEhCS0uLEUMSJgHShCKJLIEiiS4Bl8QmAZbEJQGSBAC62BuJ+tt7zgAAAABJRU5ErkJggg==)}.input-base[readonly],input[readonly][type=text],input[readonly][type=number],input[readonly][type=email],input[readonly][type=date],input[readonly][type=search],input[readonly][type=url],input[readonly][type=color],input[readonly][type=password],select[readonly],textarea[readonly],[readonly].fake-input{background-color:#f8f8f8}.input-base:focus,input[type=text]:focus,input[type=number]:focus,input[type=email]:focus,input[type=date]:focus,input[type=search]:focus,input[type=url]:focus,input[type=color]:focus,input[type=password]:focus,select:focus,textarea:focus,.fake-input:focus{border-color:var(--color-primary);outline:1px solid var(--color-primary)}.input-fill-width{width:100% !important}.fake-input{overflow:auto}#html-editor{display:none}#markdown-editor{position:relative;z-index:5}#markdown-editor #markdown-editor-input{font-style:normal;font-weight:400;padding:6px 16px;color:#444;border-radius:0;max-height:100%;flex:1;border:0;width:100%}#markdown-editor #markdown-editor-input:focus{outline:0}#markdown-editor.fullscreen{position:fixed;top:0;left:0;height:100%;z-index:2}.markdown-editor-wrap{border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-color:#ddd;position:relative;flex:1;min-width:0}html.dark-mode .markdown-editor-wrap{border-color:#000}.markdown-editor-wrap+.markdown-editor-wrap{flex-basis:50%;flex-shrink:0;flex-grow:0}.markdown-editor-wrap .cm-editor{flex:1;max-width:100%;border:0;margin:0}.markdown-panel-divider{width:2px;background-color:#ddd;cursor:col-resize}html.dark-mode .markdown-panel-divider{background-color:#000}@media screen and (max-width: 880px){#markdown-editor{flex-direction:column}#markdown-editor .markdown-editor-wrap{width:100%;max-width:100%;flex-grow:1;flex-basis:auto !important;min-height:0}.editor-toolbar-label{float:none !important;border-color:#ddd;display:block}html.dark-mode .editor-toolbar-label{border-color:#555}.markdown-editor-wrap:not(.active) .editor-toolbar+div,.markdown-editor-wrap:not(.active) .editor-toolbar .buttons,.markdown-editor-wrap:not(.active) .markdown-display{display:none}#markdown-editor .markdown-editor-wrap:not(.active){flex-grow:0;flex:none}}.markdown-editor-display{background-color:#fff}.markdown-editor-display body{display:block;background-color:#fff;padding-inline-start:12px;padding-inline-end:12px;max-width:864px}.markdown-editor-display [drawio-diagram]:hover{outline:2px solid var(--color-primary)}html.markdown-editor-display.dark-mode{background-color:#222}html.markdown-editor-display.dark-mode body{background-color:#222}.editor-toolbar{height:32px;width:100%;font-size:11px;line-height:1.6;border-bottom:1px solid #ccc;background-color:#fff;border-color:#ccc;flex:none}html.dark-mode .editor-toolbar{background-color:#333}html.dark-mode .editor-toolbar{border-color:#000}html.dark-mode .editor-toolbar button{color:#aaa}.editor-toolbar .buttons{font-size:14px}.editor-toolbar .buttons .dropdown-menu{padding:0}.editor-toolbar .buttons .toggle-switch{margin:12px 0}.editor-toolbar .buttons button{font-size:.9rem;width:2rem;text-align:center;border-left:1px solid;border-color:#ddd}html.dark-mode .editor-toolbar .buttons button{border-color:#555}.editor-toolbar .buttons button svg{margin-inline-end:0}.editor-toolbar .buttons button:hover{background-color:#ddd}html.dark-mode .editor-toolbar .buttons button:hover{background-color:#222}label{color:#666;display:block;line-height:1.4em;font-size:.94em;font-weight:400;padding-bottom:2px;margin-bottom:.2em}html.dark-mode label{color:#ddd}label.inline{display:inline-block}label.radio,label.checkbox{font-weight:400;user-select:none}label.radio input[type=radio],label.radio input[type=checkbox],label.checkbox input[type=radio],label.checkbox input[type=checkbox]{margin-inline-end:6px}label.inline.checkbox{margin-inline-end:16px}label+p.small{margin-bottom:.8em}table.form-table{max-width:100%}table.form-table td{overflow:hidden;padding:1.5px 0}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:url("data:image/svg+xml;utf8,");background-size:10px 12px;background-position:calc(100% - 20px) 64%;background-repeat:no-repeat}html[dir=rtl] select{background-position:20px 70%}input[type=date]{width:190px}input[type=color]{height:60px}input[type=color].small{height:42px;width:60px;padding:2px}.toggle-switch{user-select:none;display:inline-grid;grid-template-columns:28px 1fr;align-items:center;margin:16px 0}.toggle-switch .custom-checkbox{width:16px;height:16px;border-radius:2px;display:inline-block;border:2px solid currentColor;overflow:hidden;fill:currentColor}.toggle-switch .custom-checkbox .svg-icon{width:100%;height:100%;margin:0;bottom:auto;top:-1.5px;left:0;transition:transform ease-in-out 120ms;transform:scale(0);transform-origin:center center}.toggle-switch input[type=checkbox]{display:none}.toggle-switch input[type=checkbox]:checked+.custom-checkbox .svg-icon{transform:scale(1)}.toggle-switch .custom-checkbox:hover{background-color:rgba(0,0,0,.05);opacity:.8}.toggle-switch input[type=checkbox][disabled]~*{opacity:.8;cursor:not-allowed}.toggle-switch input[type=checkbox][disabled]~.custom-checkbox{border-color:#999;color:#999 !important;background:#f2f2f2}.toggle-switch-list .toggle-switch{margin:6px 0}.toggle-switch-list.compact .toggle-switch{margin:1px 0}.form-group{margin-bottom:12px}.setting-list>div{border-bottom:1px solid #ddd;padding:32px 0}.setting-list>div:last-child{border-bottom:none}.setting-list-label{color:#222;font-size:1rem}.setting-list-label+p.small{margin-bottom:0}.setting-list-label+.grid{margin-top:16px}.setting-list .grid input[type=text],.setting-list .grid input[type=email],.setting-list .grid input[type=password],.setting-list .grid select,.stretch-inputs input[type=text],.stretch-inputs input[type=email],.stretch-inputs input[type=password],.stretch-inputs select{width:100%}.simple-code-input{background-color:#f8f8f8;font-family:monospace;font-size:12px;min-height:100px;display:block;width:100%}.form-group div.text-pos,.form-group div.text-neg,.form-group p.text-post,.form-group p.text-neg{padding:6px 0}.form-group.collapsible{padding:0 16px;border:1px solid;border-color:#ddd;border-radius:4px}html.dark-mode .form-group.collapsible{border-color:#000}.form-group.collapsible .collapse-title{margin-inline-start:-16px;margin-inline-end:-16px;padding:12px 16px;display:block;width:calc(100% + 32px);text-align:start}.form-group.collapsible .collapse-title,.form-group.collapsible .collapse-title label{cursor:pointer}.form-group.collapsible .collapse-title label{padding-bottom:0;margin-bottom:0;color:inherit}.form-group.collapsible .collapse-title label:before{display:inline-block;content:"▸";margin-inline-end:16px;transition:all ease-in-out 400ms;transform:rotate(0)}.form-group.collapsible .collapse-content{display:none;padding-bottom:16px}.form-group.collapsible.open .collapse-title label:before{transform:rotate(90deg)}.form-group.ambrosia-container,.form-group.ambrosia-container *{position:absolute !important;height:1px !important;width:1px !important;margin:-1px !important;padding:0 !important;background:rgba(0,0,0,0) !important;color:rgba(0,0,0,0) !important;border:none !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important}.title-input input[type=text]{display:block;width:100%;padding:12px;margin-top:0;font-size:2em;height:auto}.description-input textarea{display:block;width:100%;padding:12px;font-size:14px;color:#666;height:auto}.description-input>.tox-tinymce{border:1px solid #ddd !important;border-color:#ddd !important;border-radius:3px}html.dark-mode .description-input>.tox-tinymce{border-color:#000 !important}.description-input>.tox-tinymce .tox-toolbar__primary{justify-content:end}.search-box{max-width:100%;position:relative}.search-box button[tabindex="-1"]{background-color:rgba(0,0,0,0);border:none;color:#666;padding:0;cursor:pointer;position:absolute;left:8px;top:9px}html.dark-mode .search-box button[tabindex="-1"]{color:#aaa}html[dir=rtl] .search-box button[tabindex="-1"]{right:8px;left:auto}.search-box input{display:block;padding:9px;padding-inline-start:28px;width:300px;max-width:100%;height:auto}.search-box.flexible input{width:100%}.search-box button.search-box-cancel{left:auto;right:0}.contained-search-box{display:flex;height:38px;z-index:-1}.contained-search-box.floating{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);border-radius:4px;overflow:hidden}html.dark-mode .contained-search-box.floating{border:1px solid #000}.contained-search-box input,.contained-search-box button{height:100%;border-radius:0;border:1px solid #ddd;border-color:#ddd;margin-inline-start:-1px}html.dark-mode .contained-search-box input,html.dark-mode .contained-search-box button{border-color:#000}.contained-search-box input:last-child,.contained-search-box button:last-child{border-inline-end:0}.contained-search-box input{border:0;flex:5;padding:6px 12px}.contained-search-box input:focus,.contained-search-box input:active{outline:1px dotted var(--color-primary);outline-offset:-2px;border:0}.contained-search-box button{border:0;width:48px;border-inline-start:1px solid #ddd;background-color:#fff;background-color:#fff;color:#444}html.dark-mode .contained-search-box button{background-color:#333}html.dark-mode .contained-search-box button{color:#aaa}.contained-search-box button:focus{outline:1px dotted var(--color-primary);outline-offset:-2px}.contained-search-box svg{margin:0}@media screen and (max-width: 600px){.contained-search-box{width:180px}}.outline>input{border:0;border-bottom:2px solid #ddd;border-radius:0}.outline>input:focus,.outline>input:active{border:0;border-bottom:2px solid #aaa;outline:0}.image-picker img{background-color:#bbb;max-width:100%}.custom-file-input{overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;height:1px;border:0;clip:rect(0, 0, 0, 0)}.custom-file-input:focus+label{border-color:var(--color-primary);outline:1px solid var(--color-primary)}input.shortcut-input{width:auto;max-width:120px;height:auto}.anim.fadeIn{opacity:0;animation-name:fadeIn;animation-duration:120ms;animation-timing-function:ease-in-out;animation-fill-mode:forwards}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.search-suggestions-animation{animation-name:searchSuggestions;animation-duration:120ms;animation-fill-mode:forwards;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99)}@keyframes searchSuggestions{0%{opacity:.5;transform:scale(0.9)}100%{opacity:1;transform:scale(1)}}@keyframes loadingBob{0%{transform:translate3d(0, 0, 0)}30%{transform:translate3d(0, 0, 0)}50%{transform:translate3d(0, -10px, 0)}70%{transform:translate3d(0, 0, 0)}100%{transform:translate3d(0, 0, 0)}}@keyframes pointer{0%{transform:translate3d(0, 20px, 0) scale3d(0, 0, 0)}100%{transform:translate3d(0, 0, 0) scale3d(1, 1, 1)}}.anim.pointer{transform-origin:50% 100%;animation-name:pointer;animation-duration:180ms;animation-delay:0s;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99)}.tox.tox-fullscreen{position:fixed;top:0;height:100%;width:100%;max-width:100%;z-index:100}.tox.tox-tinymce{border-inline:0;border-bottom:0}.page-content.mce-content-body{padding-block-start:1rem;padding-block-end:1rem;outline:0;display:block;max-width:870px}.wysiwyg-input.mce-content-body{padding-block-start:1rem;padding-block-end:1rem;outline:0;display:block}.wysiwyg-input.mce-content-body:before{padding:1rem;top:4px;font-style:italic;color:rgba(34,47,62,.5)}html.dark-mode .wysiwyg-input.mce-content-body:before{color:rgba(155,155,155,.5)}.page-content.mce-content-body doc-root{display:block}.page-content.mce-content-body code-block{display:block}body.page-content.mce-content-body{padding-bottom:5rem}.tox .tox-pop__dialog .tox-toolbar{background:rgba(0,0,0,0) !important}.tox-toolbar__primary{justify-content:center}.page-content.mce-content-body code-block>*{pointer-events:none}.page-content.mce-content-body code-block pre{display:none}.page-content.mce-content-body details summary{pointer-events:none}.page-content.mce-content-body details doc-root{padding:12px;margin-left:-10px;margin-right:-10px;margin-bottom:-10px;margin-top:-10px;overflow:hidden}.page-content.mce-content-body .mce-preview-object.align-right{float:right !important;margin:6px 0 6px 12px}.page-content.mce-content-body .mce-preview-object.align-left{float:left !important;margin:6px 16px 16px 0}.page-content.mce-content-body .mce-preview-object.align-center{display:block;margin-left:auto;margin-right:auto}.page-content.mce-content-body .mce-preview-object iframe,.page-content.mce-content-body .mce-preview-object video{display:block;margin:0 !important;float:none !important}.page-content.mce-content-body td[data-mce-selected]::after,.page-content.mce-content-body th[data-mce-selected]::after{top:1px;left:1px;bottom:1px;right:1px;outline:1px dashed #1a85ff;outline-offset:0}.dark-mode .tox .tox-toolbar__primary,.dark-mode .tox .tox-menu,.dark-mode .tox .tox-dialog__header,.dark-mode .tox .tox-dialog,.dark-mode .tox .tox-dialog__footer,.dark-mode .tox .tox-pop__dialog,.dark-mode .tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#333 !important}.dark-mode .tox .tox-tbtn svg,.dark-mode .tox .tox-tbtn,.dark-mode .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#dbdbdb;fill:#dbdbdb}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{width:6em !important}.tox-menu .tox-collection__item blockquote::before{content:none}.tox-menu .tox-collection__item blockquote{border-left:4px solid var(--color-primary) !important;padding:4px 6px !important}.tox-menu .tox-collection__item blockquote{border-left:4px solid var(--color-primary) !important;padding:4px 6px !important}.tox-menu .tox-collection__item p[style*=background-color]{padding:4px 6px !important;border-left:3px solid currentColor !important}.tox-menu .tox-collection__item[title^="<"]>div>div{font-family:var(--font-code) !important;border:1px solid #ddd !important;background-color:#eee !important;padding:4px 6px !important}.tox-menu .tox-collection__item-label{line-height:normal !important}.page-content.mce-content-body .task-list-item{margin-left:0;position:relative}.page-content.mce-content-body .task-list-item>input[type=checkbox]{display:none}.page-content.mce-content-body .task-list-item:before{content:"";display:inline-block;border:2px solid #ccc;width:12px;height:12px;border-radius:2px;margin-right:8px;vertical-align:text-top;cursor:pointer;position:absolute;left:-24px;top:4px}.page-content.mce-content-body .task-list-item[checked]:before{background-color:#ccc;background-image:url('data:image/svg+xml;utf8,');background-position:50% 50%;background-size:100% 100%}.cm-editor{font-size:12px;border:1px solid #ddd;line-height:1.4;margin-bottom:24px}.page-content .cm-editor,.CodeMirrorContainer .cm-editor{border-radius:4px}.cm-editor .cm-line,.cm-editor .cm-gutter{font-family:var(--font-code)}.dark-mode .cm-editor{border-color:#444}.cm-copy-button{position:absolute;display:flex;align-items:center;justify-content:center;top:-1px;inset-inline-end:-1px;background-color:#eee;border:1px solid #ddd;border-start-end-radius:4px;background-color:#eee;border-color:#ddd;color:#444;line-height:0;cursor:pointer;z-index:5;user-select:none;opacity:0;pointer-events:none;width:32px;height:32px;transition:background-color linear 60ms,color linear 60ms}html.dark-mode .cm-copy-button{background-color:#333}html.dark-mode .cm-copy-button{border-color:#444}html.dark-mode .cm-copy-button{color:#888}.cm-copy-button svg{fill:currentColor}.cm-copy-button.success{background:var(--color-positive);color:#fff}.cm-copy-button:focus{outline:0 !important}.cm-editor:hover .cm-copy-button{user-select:all;opacity:.6;pointer-events:all}.notification{position:fixed;top:0;right:0;margin:32px;padding:16px 24px;background-color:#fff;background-color:#fff;border-radius:4px;border-inline-start:6px solid currentColor;box-shadow:0 1px 6px 1px rgba(22,22,22,.2);z-index:999999;cursor:pointer;max-width:360px;transition:transform ease-in-out 280ms;transform:translateX(580px);display:grid;grid-template-columns:42px 1fr 12px;color:#444;font-weight:700}html.dark-mode .notification{background-color:#444}.notification span,.notification svg{vertical-align:middle;justify-self:center;align-self:center}.notification svg{width:2.8rem;height:2.8rem;padding-inline-end:12px;fill:currentColor}.notification .dismiss{margin-top:-8px}.notification .dismiss svg{height:1rem;color:#444}html.dark-mode .notification .dismiss svg{color:#888}.notification span{vertical-align:middle;line-height:1.3}html.dark-mode .notification span{color:#bbb}.notification.pos{color:var(--color-positive)}.notification.neg{color:var(--color-negative)}.notification.warning{color:var(--color-warning)}.notification.showing{transform:translateX(0)}.notification.showing:hover{transform:translate3d(0, -2px, 0)}.chapter-contents-toggle{cursor:pointer;margin:0;transition:all ease-in-out 180ms;user-select:none}.chapter-contents-toggle svg[data-icon=caret-right]{margin-inline-end:0;font-size:1rem;transition:all ease-in-out 180ms;transform:rotate(0deg);transform-origin:50% 50%}.chapter-contents-toggle.open svg[data-icon=caret-right]{transform:rotate(90deg)}.chapter-contents-toggle svg[data-icon=caret-right]+*{margin-inline-start:3px}[overlay],.popup-background{background-color:rgba(0,0,0,.333);position:fixed;z-index:95536;width:100%;height:100%;min-width:100%;min-height:100%;top:0;left:0;right:0;bottom:0;align-items:center;justify-content:center;display:none}html.dark-mode [overlay],html.dark-mode .popup-background{background-color:rgba(0,0,0,.6)}.popup-body-wrap{display:flex}.popup-body{background-color:#fff;max-height:90%;max-width:1200px;width:90%;height:auto;margin:2% auto;border-radius:4px;box-shadow:0 0 15px 0 rgba(0,0,0,.3);overflow:hidden;z-index:999;display:flex;flex-direction:column;position:relative}html.dark-mode .popup-body{background-color:#333}.popup-body.small{margin:2% auto;width:800px;max-width:90%}.popup-body.very-small{margin:2% auto;width:600px;max-width:90%}.popup-body:before{display:flex;align-self:flex-start}.popup-body .popup-content{overflow-y:auto}.popup-body:focus{outline:0}.popup-header button,.popup-footer button{margin:0;border-radius:0;box-shadow:none;color:#fff;padding:6px 16px;cursor:pointer}.popup-header button:not(.popup-header-close){font-size:.8rem}.popup-header button:hover{background-color:rgba(255,255,255,.1)}.popup-footer{justify-content:end;background-color:var(--color-primary-light);min-height:41px}.popup-footer button{padding:10px 16px}.popup-header-close{border:0;color:#fff;font-size:16px;cursor:pointer}.popup-header-close svg{margin-right:0}.popup-header,.popup-footer{display:flex;position:relative;height:40px;flex:0}.popup-header .popup-title,.popup-footer .popup-title{color:#fff;margin-inline-end:auto;padding:8px 16px}.popup-header.flex-container-row,.popup-footer.flex-container-row{display:flex !important}body.flexbox-support #entity-selector-wrap .popup-body .form-group{height:444px;min-height:444px}#entity-selector-wrap .popup-body .form-group{margin:0}.popup-body .entity-selector-container{flex:1}.dropzone-overlay{position:absolute;display:flex;justify-content:center;align-items:center;font-size:1.333rem;width:98%;height:98%;left:1%;top:1%;border-radius:4px;border:1px dashed var(--color-primary);font-style:italic;box-sizing:content-box;background-clip:padding-box;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23a9a9a9' fill-opacity='0.52' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");background-color:var(--color-primary);color:#fff;opacity:.8;z-index:9;pointer-events:none;animation:dzAnimIn 240ms ease-in-out}.dropzone-landing-area{background-color:var(--color-primary-light);padding:16px 24px;width:100%;border:1px dashed var(--color-primary);color:var(--color-primary);border-radius:4px}@keyframes dzAnimIn{0%{opacity:0;transform:scale(0.7)}60%{transform:scale(1.1)}100%{transform:scale(1);opacity:.8}}@keyframes dzFileItemIn{0%{opacity:.5;transform:translateY(28px)}100%{opacity:1;transform:translateY(0)}}@keyframes dzFileItemOut{0%{opacity:1;transform:translateY(0)}100%{opacity:.5;transform:translateY(28px)}}.dropzone-file-item{width:260px;height:80px;position:relative;display:flex;margin:1rem;flex-direction:row;background:#fff;box-shadow:0 1px 6px 1px rgba(22,22,22,.2);border-radius:4px;overflow:hidden;padding-bottom:3px;animation:dzFileItemIn ease-in-out 240ms;transition:transform ease-in-out 120ms,box-shadow ease-in-out 120ms;cursor:pointer}html.dark-mode .dropzone-file-item{background:#444}.dropzone-file-item:hover{transform:translateY(-3px);box-shadow:0 3px 8px 1px rgba(22,22,22,.2)}.dropzone-file-item.dismiss{animation:dzFileItemOut ease-in-out 240ms}.dropzone-file-item .loading-container{text-align:start !important;margin:0}.dropzone-file-item-image-wrap{width:80px;position:relative;background-color:var(--color-primary-light)}.dropzone-file-item-image-wrap img{object-fit:cover;width:100%;height:100%;opacity:.8}.dropzone-file-item-text-wrap{flex:1;display:block;padding:1rem;overflow:auto}.dropzone-file-item-progress{position:absolute;bottom:0;left:0;font-size:0;height:3px;background-color:var(--color-primary);transition:width ease-in-out 240ms}.dropzone-file-item-label,.dropzone-file-item-status{align-items:center;font-size:.8rem;font-weight:700}.dropzone-file-item-status[data-status]{display:flex;font-size:.6rem;font-weight:500;line-height:1.2}.dropzone-file-item-status[data-status=success]{color:var(--color-positive)}.dropzone-file-item-status[data-status=error]{color:var(--color-negative)}.dropzone-file-item-status[data-status]+.dropzone-file-item-label{display:none}.image-manager-body{min-height:70vh}.image-manager-filter-bar{position:sticky;top:0;z-index:5;background-color:rgba(255,255,255,.85)}html.dark-mode .image-manager-filter-bar{background-color:rgba(80,80,80,.85)}.image-manager-filter-bar-bg{position:absolute;left:0;top:0;width:100%;height:100%;opacity:.15;z-index:-1}.image-manager-filters{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);border-radius:4px;overflow:hidden;border-bottom:0 !important}html.dark-mode .image-manager-filters{border:1px solid #000 !important}.image-manager-filters button{line-height:0;background-color:#fff}html.dark-mode .image-manager-filters button{background-color:#333}.image-manager-filters svg{margin:0}.image-manager-list{padding:3px;display:grid;grid-template-columns:repeat(auto-fill, minmax(max(140px, 17%), 1fr));gap:3px;z-index:3}.image-manager-list>div{aspect-ratio:1}.image-manager-list .image{display:block;position:relative;border-radius:0;margin:0;width:100%;text-align:start;padding:0;cursor:pointer;aspect-ratio:1;border-color:#ddd;transition:all linear 80ms;overflow:hidden}html.dark-mode .image-manager-list .image{border-color:#000}.image-manager-list .image.selected{background-color:var(--color-primary-light);outline:currentColor 3px solid;border-radius:3px;transform:scale3d(0.95, 0.95, 0.95)}.image-manager-list .image img{width:100%;max-width:100%;display:block;object-fit:cover;height:auto}.image-manager-list .image .image-meta{opacity:0;position:absolute;width:100%;bottom:0;left:0;color:#eee;background-color:rgba(0,0,0,.7);font-size:10px;padding:3px 4px;pointer-events:none;transition:opacity ease-in-out 80ms}.image-manager-list .image .image-meta span{display:block}.image-manager-list .image.selected .image-meta,.image-manager-list .image:hover .image-meta,.image-manager-list .image:focus .image-meta{opacity:1}@media screen and (max-width: 880px){.image-manager-list .image .image-meta{display:none}}.image-manager .load-more{text-align:center;padding:12px 16px;clear:both}.image-manager .load-more .loading-container{margin:0}.image-manager .loading-container{text-align:center}.image-manager-list .image-manager-list-warning{grid-column:1/-1;aspect-ratio:auto}.image-manager-warning{background:#fff;color:var(--color-warning);font-weight:bold;border-inline:3px solid var(--color-warning)}html.dark-mode .image-manager-warning{background:#333}.image-manager-sidebar{width:300px;margin:0 auto;overflow-y:auto;overflow-x:hidden;border-inline-start:1px solid #ddd;border-color:#ddd}html.dark-mode .image-manager-sidebar{border-color:#000}.image-manager-sidebar .inner{min-height:auto;padding:16px}.image-manager-sidebar .image-manager-viewer img{max-width:100%;max-height:180px;display:block;margin:0 auto 16px auto;box-shadow:0 1px 21px 1px rgba(76,76,76,.3)}.image-manager-sidebar .image-manager-viewer{height:196px;display:flex;align-items:center;justify-content:center}.image-manager-sidebar .image-manager-viewer a{display:inline-block}@media screen and (max-width: 880px){.image-manager-sidebar{border-inline-start:0}}.image-manager-content{display:flex;flex-direction:column;flex:1;overflow-y:scroll}.image-manager-content .container{width:100%}.image-manager-content .full-tab{text-align:center}.tab-container.bordered [role=tablist] button[role=tab]{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd}html.dark-mode .tab-container.bordered [role=tablist] button[role=tab]{border-inline-end-color:#000}.tab-container.bordered [role=tablist] button[role=tab]:last-child{border-inline-end:none}.tab-container [role=tablist]{display:flex;align-items:end;justify-items:start;text-align:start;border-bottom:1px solid #ddd;border-color:#ddd;margin-bottom:16px}html.dark-mode .tab-container [role=tablist]{border-color:#444}.tab-container [role=tablist] button[role=tab]{display:inline-block;padding:12px;color:rgba(0,0,0,.5);cursor:pointer;border-bottom:2px solid rgba(0,0,0,0);margin-bottom:-1px}html.dark-mode .tab-container [role=tablist] button[role=tab]{color:rgba(255,255,255,.5)}.tab-container [role=tablist] button[role=tab][aria-selected=true]{color:var(--color-link) !important;border-bottom-color:var(--color-link) !important;outline:0 !important}.tab-container [role=tablist] button[role=tab]:hover,.tab-container [role=tablist] button[role=tab]:focus{color:rgba(0,0,0,.8);border-bottom-color:rgba(0,0,0,.2)}html.dark-mode .tab-container [role=tablist] button[role=tab]:hover,html.dark-mode .tab-container [role=tablist] button[role=tab]:focus{color:rgba(255,255,255,.8)}html.dark-mode .tab-container [role=tablist] button[role=tab]:hover,html.dark-mode .tab-container [role=tablist] button[role=tab]:focus{border-bottom-color:rgba(255,255,255,.2)}.tab-container [role=tablist] button[role=tab]:focus{outline:1px dotted var(--color-primary);outline-offset:-2px}.tab-container [role=tablist].controls-card{margin-bottom:0;border-bottom:0;padding:0 6px}.image-picker .none{display:none}.code-editor .CodeMirror{height:auto;min-height:50vh;border-bottom:0}.code-editor .lang-options{overflow-y:scroll;flex-basis:200px;flex-grow:1}.code-editor .lang-options button{display:block;padding:6px 16px;border-bottom:1px solid;color:#333;border-bottom-color:#eee;cursor:pointer;width:100%;text-align:left;font-family:var(--font-code);font-size:.7rem;padding-left:30px}html.dark-mode .code-editor .lang-options button{color:#aaa}html.dark-mode .code-editor .lang-options button{border-bottom-color:#000}.code-editor .lang-options button:hover,.code-editor .lang-options button.active{background-color:var(--color-primary-light);color:var(--color-primary)}.code-editor button.lang-option-favorite-toggle{position:absolute;top:0;left:0;width:28px;font-size:1rem;border:0;line-height:1;padding:2px;z-index:2;height:100%;text-align:center;color:var(--color-primary)}.code-editor button.lang-option-favorite-toggle svg{margin:0}.code-editor button[data-favourite=true]~.action-favourite,.code-editor button[data-favourite=false]~.action-unfavourite{display:none}.code-editor .action-favourite{opacity:.5}.code-editor button:hover~.action-favourite{opacity:1}.code-editor label{background-color:var(--color-primary-light);width:100%;color:var(--color-primary);padding:3px 12px;margin-bottom:0}.code-editor-language-list{position:relative;width:160px;z-index:2;align-items:stretch}.code-editor-language-list input{border-radius:0;border:0;border-bottom:1px solid #ddd;padding:6px 12px;height:auto}.code-editor-main{flex:1;min-width:0}.code-editor-main .cm-editor{margin-bottom:0;z-index:1;max-width:100%;width:100%}.code-editor-body-wrap{height:80vh}@media screen and (max-width: 600px){.code-editor .lang-options{display:none}.code-editor-body-wrap{flex-direction:column}.code-editor-language-list,.code-editor-language-list input{width:100%}}.comments-container{padding-inline:32px}@media screen and (max-width: 880px){.comments-container{padding-inline:6px}}.comment-box{border-radius:4px;border:1px solid #ddd;border-color:#ddd;background-color:#fff}html.dark-mode .comment-box{border-color:#000}html.dark-mode .comment-box{background-color:#222}.comment-box .content{font-size:.666em;padding:6px 12px}.comment-box .content p,.comment-box .content ul,.comment-box .content ol{font-size:14px;margin:.5em 0}.comment-box .actions{opacity:0;transition:opacity ease-in-out 120ms}.comment-box:hover .actions,.comment-box:focus-within .actions{opacity:1}.comment-box .actions button:focus{outline:1px dotted var(--color-primary)}@media screen and (max-width: 880px){.comment-box .actions{opacity:1}}.comment-box .header{border-bottom:1px solid #ddd;padding:6px 12px;border-color:#ddd}html.dark-mode .comment-box .header{border-color:#000}.comment-box .header a{color:inherit}.comment-box .header .text-muted{color:#999}.comment-box .header .meta a,.comment-box .header .meta span{white-space:nowrap}.comment-box .header .right-meta .text-muted{opacity:.8}.comment-thread-indicator{border-inline-start:3px dotted #ddd;border-color:#ddd;margin-inline-start:6px;width:24px;height:calc(100% - 16px)}html.dark-mode .comment-thread-indicator{border-color:#444}.comment-branch .comment-branch .comment-branch .comment-branch .comment-thread-indicator{display:none}.comment-reply{display:none;margin:0 !important;margin-bottom:-3px !important}.comment-branch .comment-branch .comment-branch .comment-branch .comment-reply{display:block}.comment-container-compact .comment-box .meta{font-size:.8rem}.comment-container-compact .comment-box .header{padding:6px}.comment-container-compact .comment-box .right-meta{display:none}.comment-container-compact .comment-box .content{padding:6px 12px}.comment-container-compact .comment-thread-indicator{width:16px}#tag-manager .drag-card{max-width:500px}.template-item{cursor:pointer;position:relative}.template-item:hover,.template-item .template-item-actions button:hover{background-color:#f2f2f2}.template-item .template-item-actions{position:absolute;top:0;inset-inline-end:0;width:50px;height:100%;display:flex;flex-direction:column;border-inline-start:1px solid;border-color:#ddd}html.dark-mode .template-item .template-item-actions{border-color:#000}.template-item .template-item-actions button{cursor:pointer;flex:1;background-color:#fff;border:0;border-top:1px solid;border-color:#ddd}html.dark-mode .template-item .template-item-actions button{background-color:#222}html.dark-mode .template-item .template-item-actions button{border-color:#000}.template-item .template-item-actions button svg{margin:0}.template-item .template-item-actions button:first-child{border-top:0}.dropdown-search{position:relative}.dropdown-search-toggle-breadcrumb{border:1px solid rgba(0,0,0,0);border-radius:4px;line-height:normal;padding:6px}.dropdown-search-toggle-breadcrumb:hover{border-color:#ddd}.dropdown-search-toggle-breadcrumb .svg-icon{margin-inline-end:0}.dropdown-search-toggle-select{display:flex;gap:12px;line-height:normal}.dropdown-search-toggle-select .svg-icon{height:26px;width:26px;margin:0}.dropdown-search-toggle-select .avatar{height:22px;width:22px}.dropdown-search-toggle-select .avatar+span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-search-toggle-select .dropdown-search-toggle-caret{font-size:1.15rem}.dropdown-search-toggle-select-label{min-width:0;white-space:nowrap}.dropdown-search-toggle-select-caret{line-height:0;margin-left:auto;margin-top:-2px;display:flex;align-items:center}.dropdown-search-dropdown{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);overflow:hidden;min-height:100px;width:240px;display:none;position:absolute;z-index:80;right:0;top:0;margin-top:16px}html[dir=rtl] .dropdown-search-dropdown{right:auto;left:-16px}.dropdown-search-dropdown .dropdown-search-search .svg-icon{position:absolute;left:12px;top:11px;fill:#888;pointer-events:none}html[dir=rtl] .dropdown-search-dropdown .dropdown-search-search .svg-icon{right:12px;left:auto}.dropdown-search-dropdown .dropdown-search-list{max-height:400px;overflow-y:scroll;text-align:start}.dropdown-search-dropdown .dropdown-search-item{padding:12px 16px}.dropdown-search-dropdown .dropdown-search-item:hover,.dropdown-search-dropdown .dropdown-search-item:focus{background-color:#f2f2f2;text-decoration:none}.dropdown-search-dropdown input,.dropdown-search-dropdown input:focus{padding-inline-start:32px;border-radius:0;border:0;border-bottom:1px solid #ddd}.dropdown-search-dropdown input:focus{outline:0}@media screen and (max-width: 1000px){.dropdown-search-dropdown{inset-inline:16px auto}.dropdown-search-dropdown .dropdown-search-list{max-height:240px}}.item-list{box-shadow:0 1px 3px 0 rgba(0,0,0,.1)}.item-list-row{border:1.5px solid;border-color:#e2e2e2;border-bottom-width:0}html.dark-mode .item-list-row{border-color:#444}.item-list-row label{padding-bottom:0}.item-list-row:hover{background-color:#f6f6f6}html.dark-mode .item-list-row:hover{background-color:#333}.item-list-row:first-child{border-radius:4px 4px 0 0}.item-list-row:last-child{border-radius:0 0 4px 4px;border-bottom-width:1.5px}.item-list-row:first-child:last-child{border-radius:4px}.item-list-row-toggle-all{visibility:hidden}.item-list-row:hover .item-list-row-toggle-all{visibility:visible}.status-indicator-active,.status-indicator-inactive{width:8px;height:8px;border-radius:50%;display:inline-block}.status-indicator-active{background-color:var(--color-positive)}.status-indicator-inactive{background-color:var(--color-negative)}.shortcut-container{background-color:rgba(0,0,0,.25);pointer-events:none;position:fixed;left:0;top:0;width:100%;height:100%;z-index:99}.shortcut-linkage{position:fixed;box-shadow:0 0 4px 0 #fff;border-radius:3px}.shortcut-hint{position:fixed;padding:3px 3px;font-size:.85rem;font-weight:700;line-height:1;background-color:#eee;border-radius:3px;border:1px solid #b4b4b4;box-shadow:0 1px 1px rgba(0,0,0,.2),0 2px 0 0 rgba(255,255,255,.7) inset;color:#333}.back-to-top{background-color:var(--color-primary);position:fixed;bottom:16px;right:24px;padding:5px 7px;cursor:pointer;color:#fff;fill:#fff;width:40px;height:40px;border-radius:40px;transition:all ease-in-out 180ms;opacity:0;z-index:999;overflow:hidden}.back-to-top svg{width:26.6666666667px;height:26.6666666667px;margin-inline-end:4px}.back-to-top:hover{width:136px;opacity:1 !important}.back-to-top .inner{width:136px}.back-to-top span{position:relative;vertical-align:top;line-height:2}.scroll-box{list-style:none;padding:0;margin:0;max-height:280px;overflow-y:scroll;border:1px solid;border-color:#ddd;border-radius:3px;min-height:20px;background-color:#eee}html.dark-mode .scroll-box{border-color:#000}html.dark-mode .scroll-box{background-color:#000}.scroll-box-item{border-bottom:1px solid;border-top:1px solid;border-color:#ddd;margin-top:-1px;background-color:#fff;display:flex;align-items:flex-start;padding:1px}html.dark-mode .scroll-box-item{border-color:#000}html.dark-mode .scroll-box-item{background-color:#222}.scroll-box-item:last-child{border-bottom:0}.scroll-box-item:hover{cursor:pointer;background-color:#f8f8f8}html.dark-mode .scroll-box-item:hover{background-color:#333}.scroll-box-item .handle{color:#aaa;cursor:grab}.scroll-box-item button{opacity:.6}.scroll-box-item .handle svg{margin:0}.scroll-box-item>*{padding:6px 16px}.scroll-box-item .handle+*{padding-left:0}.scroll-box-item:hover .handle{color:#444}html.dark-mode .scroll-box-item:hover .handle{color:#fff}.scroll-box-item:hover button{opacity:1}.scroll-box-item a:hover{text-decoration:none}input.scroll-box-search,.scroll-box-header-item{font-size:.8rem;border:1px solid;border-color:#ddd;background-color:#fff;margin-bottom:-1px;border-radius:3px 3px 0 0;width:100%;max-width:100%;height:auto;line-height:1.4;color:#666}html.dark-mode input.scroll-box-search,html.dark-mode .scroll-box-header-item{border-color:#000}html.dark-mode input.scroll-box-search,html.dark-mode .scroll-box-header-item{background-color:#222}.scroll-box-search+.scroll-box,.scroll-box-header-item+.scroll-box{border-radius:0 0 3px 3px}.scroll-box[refs="shelf-sort@shelf-book-list"] [data-action=add]{display:none}.scroll-box[refs="shelf-sort@all-book-list"] [data-action=remove],.scroll-box[refs="shelf-sort@all-book-list"] [data-action=move_up],.scroll-box[refs="shelf-sort@all-book-list"] [data-action=move_down]{display:none}header.grid{grid-template-columns:minmax(max-content, 2fr) 1fr minmax(max-content, 2fr)}@media screen and (max-width: 1000px){header.grid{grid-template-columns:1fr;grid-row-gap:0}}header{position:relative;display:block;z-index:11;top:0;color:#fafafa;border-bottom:1px solid #ddd;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);border-bottom-color:#ddd}html.dark-mode header{border-bottom-color:#000}header .header-links{display:flex;align-items:center;justify-content:end}header .links{display:inline-block;vertical-align:top}header .links a{display:inline-block;padding:10px 16px;color:#fff;border-radius:3px}header .links a:hover{text-decoration:none;background-color:rgba(255,255,255,.15)}header .dropdown-container{padding-inline-start:16px;padding-inline-end:0}header .avatar,header .user-name{display:inline-block}header .avatar{width:30px;height:30px}header .user-name{vertical-align:top;position:relative;display:inline-flex;align-items:center;cursor:pointer;padding:12px;margin:0 -12px;border-radius:3px;gap:6px}header .user-name>span{padding-inline-start:6px;display:inline-block;line-height:1}header .user-name>svg{font-size:18px;margin-top:-2px;margin-inline-end:0}header .user-name:hover{background-color:rgba(255,255,255,.15)}@media screen and (min-width: 1000px)and (max-width: 1100px){header .user-name{padding-inline-start:6px}header .user-name .name{display:none}}.header *,.primary-background *{outline-color:#fff}header .search-box{display:inline-block}header .search-box input{background-color:rgba(0,0,0,.2);border:1px solid rgba(255,255,255,.2);border-radius:40px;color:#eee;z-index:2;height:auto;padding:9px;padding-inline-start:40px}header .search-box input:focus{outline:none;border:1px solid rgba(255,255,255,.4)}header .search-box input::placeholder{color:#fff;opacity:.6}@media screen and (min-width: 1000px)and (max-width: 1100px){header .search-box{max-width:200px}}header .search-box:focus-within #header-search-box-button{opacity:1}#header-search-box-button{z-index:1;inset-inline-start:16px;top:10px;color:#fff;opacity:.6;color:rgba(255,255,255,.8)}html.dark-mode #header-search-box-button{color:#aaa}#header-search-box-button svg{margin-inline-end:0}.global-search-suggestions{display:none;position:absolute;top:-12px;left:0;right:0;z-index:-1;margin-left:-48px;margin-right:-48px;padding-top:56px;border-radius:3px;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);transform-origin:top center;opacity:.5;transform:scale(0.9)}.global-search-suggestions .entity-item-snippet p{display:none}.global-search-suggestions .entity-item-snippet{font-size:.8rem}.global-search-suggestions .entity-list-item-name{font-size:.9rem;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.global-search-suggestions .global-search-loading{position:absolute;width:100%}header .search-box.search-active:focus-within .global-search-suggestions{display:block}header .search-box.search-active:focus-within input{background-color:#eee;border-color:#ddd}html.dark-mode header .search-box.search-active:focus-within input{background-color:#333}html.dark-mode header .search-box.search-active:focus-within input{border-color:#111}header .search-box.search-active:focus-within #header-search-box-button,header .search-box.search-active:focus-within input{color:#444}html.dark-mode header .search-box.search-active:focus-within #header-search-box-button,html.dark-mode header .search-box.search-active:focus-within input{color:#aaa}.logo{display:inline-flex;padding:6px 12px;margin:6px -12px;gap:12px;align-items:center;border-radius:4px}.logo:hover{color:#fff;text-decoration:none;background-color:rgba(255,255,255,.15)}.logo-text{font-size:1.8em;color:#fff;font-weight:400;line-height:1}.logo-image{height:43px}.mobile-menu-toggle{color:#fff;fill:#fff;font-size:2em;border:2px solid rgba(255,255,255,.8);border-radius:4px;padding:0 6px;line-height:1;cursor:pointer;user-select:none}.mobile-menu-toggle svg{margin:0;bottom:-2px}@media screen and (max-width: 1000px){header .header-links{background-color:#fff;display:none;z-index:10;inset-inline-end:16px;border-radius:4px;overflow:hidden;position:absolute;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);margin-top:16px;padding:6px 0}html.dark-mode header .header-links{background-color:#333}header .header-links.show{display:block}header .links a,header .dropdown-container ul li a,header .dropdown-container ul li button{text-align:start;display:grid;align-items:center;padding:8px 16px;gap:16px;color:#444;grid-template-columns:16px auto;line-height:1.4;color:#444}html.dark-mode header .links a,html.dark-mode header .dropdown-container ul li a,html.dark-mode header .dropdown-container ul li button{color:#eee}header .links a svg,header .dropdown-container ul li a svg,header .dropdown-container ul li button svg{margin-inline-end:12px;width:16px}header .links a:hover,header .dropdown-container ul li a:hover,header .dropdown-container ul li button:hover{background-color:var(--color-primary-light);color:var(--color-primary);text-decoration:none}header .links a:focus,header .dropdown-container ul li a:focus,header .dropdown-container ul li button:focus{background-color:#eee;outline-color:var(--color-primary);color:var(--color-primary)}html.dark-mode header .links a:focus,html.dark-mode header .dropdown-container ul li a:focus,html.dark-mode header .dropdown-container ul li button:focus{background-color:#333}header .dropdown-container{display:block;padding-inline-start:0}header .links{display:block}header .dropdown-container ul{display:block !important;position:relative;background-color:rgba(0,0,0,0);border:0;padding:0;margin:0;box-shadow:none}}.tri-layout-mobile-tabs{position:sticky;top:0;z-index:5;background-color:#fff;border-bottom:1px solid #ddd;border-bottom-color:#ddd;box-shadow:0 1px 6px -1px rgba(0,0,0,.1)}html.dark-mode .tri-layout-mobile-tabs{border-bottom-color:#333}.tri-layout-mobile-tab{text-align:center;border-bottom:3px solid #bbb;cursor:pointer;margin:0;background-color:#fff;border-bottom-color:#bbb}html.dark-mode .tri-layout-mobile-tab{background-color:#222}html.dark-mode .tri-layout-mobile-tab{border-bottom-color:#333}.tri-layout-mobile-tab:first-child{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd}html.dark-mode .tri-layout-mobile-tab:first-child{border-inline-end-color:#000}.tri-layout-mobile-tab[aria-selected=true]{border-bottom-color:currentColor !important}.breadcrumbs{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;opacity:.7}.breadcrumbs .icon-list-item{width:auto;padding-top:6px;padding-bottom:6px}.breadcrumbs .separator{display:inline-block;fill:#aaa;font-size:1.6em;line-height:.8;margin:-2px 0 0}.breadcrumbs:hover,.breadcrumbs:focus-within{opacity:1}@media(prefers-contrast: more){.breadcrumbs{opacity:1}}@media screen and (max-width: 1000px){.breadcrumbs .icon-list-item{padding:6px}.breadcrumbs .icon-list-item>span+span{display:none}.breadcrumbs .icon-list-item>span:first-child{margin-inline-end:0}}.faded a,.faded button,.faded span,.faded span>div{color:#666;fill:#666}.faded .text-button{opacity:.5;transition:all ease-in-out 120ms}.faded .text-button:hover{opacity:1;text-decoration:none}.faded span.faded-text{display:inline-block;padding:12px}footer{flex-shrink:0;padding:1rem 1rem 2rem 1rem;text-align:center}footer a{margin:0 .5em}body.flexbox footer{display:none}.book-contents .entity-list-item .icon{width:4px;border-radius:1px;justify-self:stretch;align-self:stretch;height:auto;margin-inline-end:6px}.book-contents .entity-list-item .icon:after{opacity:.5}.book-contents .entity-list-item .icon svg{display:none}.book-contents .entity-list-item p{margin-bottom:0}.book-contents .entity-list-item .inner-page{padding-top:0;padding-bottom:0}.entity-list-item+.chapter-expansion{display:flex;padding:0 16px 16px 16px;align-items:center;border:0;width:100%;position:relative}.entity-list-item+.chapter-expansion>.icon{width:4px;height:auto;border-radius:0 0 1px 1px;align-self:stretch;flex-shrink:0}.entity-list-item+.chapter-expansion>.icon:before{position:absolute;top:0;left:0;width:100%;height:1px;background-color:currentColor;content:"";opacity:.5}.entity-list-item+.chapter-expansion>.icon:after{opacity:.5}.entity-list-item+.chapter-expansion .icon svg{display:none}.entity-list-item+.chapter-expansion>.content{flex:1}.entity-list-item+.chapter-expansion .chapter-contents-toggle{border-radius:0 4px 4px 0;padding:6px 19px;width:100%;text-align:start}.entity-list-item+.chapter-expansion .chapter-contents-toggle:hover{background-color:rgba(0,0,0,.06)}.entity-list-item.has-children{padding-bottom:0}.entity-list-item.has-children>.icon{border-radius:4px 4px 0 0}.inset-list{display:none}.inset-list .entity-list-item-name{font-size:1rem}.inset-list .entity-list-item-children{padding-top:0;padding-bottom:0}.sidebar-page-nav{list-style:none;margin-block-start:12px;margin-block-end:16px;margin-inline-start:6px;margin-inline-end:0;position:relative}.sidebar-page-nav:after{content:"";display:block;position:absolute;left:0;background-color:rgba(0,0,0,.2);width:2px;top:5px;bottom:5px;z-index:0}html[dir=rtl] .sidebar-page-nav:after{left:auto;right:0}html.dark-mode .sidebar-page-nav:after{background-color:rgba(255,255,255,.2)}.sidebar-page-nav li{margin-bottom:4px;font-size:.95em;position:relative}.sidebar-page-nav .h1{padding-inline-start:16px}.sidebar-page-nav .h2{padding-inline-start:24px}.sidebar-page-nav .h3{padding-inline-start:32px}.sidebar-page-nav .h4{padding-inline-start:40px}.sidebar-page-nav .h5{padding-inline-start:48px}.sidebar-page-nav .h6{padding-inline-start:56px}.sidebar-page-nav .current-heading{font-weight:bold}.sidebar-page-nav li:not(.current-heading) .sidebar-page-nav-bullet{background-color:#bbb !important}html.dark-mode .sidebar-page-nav li:not(.current-heading) .sidebar-page-nav-bullet{background-color:#666 !important}.sidebar-page-nav .sidebar-page-nav-bullet{width:6px;height:6px;position:absolute;left:-2px;top:30%;border-radius:50%;box-shadow:0 0 0 6px #f2f2f2;box-shadow:0 0 0 6px #f2f2f2;z-index:1}html.dark-mode .sidebar-page-nav .sidebar-page-nav-bullet{box-shadow:0 0 0 6px #111}html[dir=rtl] .sidebar-page-nav .sidebar-page-nav-bullet{left:auto;right:-2px}.book-tree .sidebar-page-list{list-style:none;margin-block-start:6px;margin-block-end:0;margin-inline-start:-12px;margin-inline-end:-12px;padding-inline-start:0;padding-inline-end:0}.book-tree .sidebar-page-list ul{list-style:none;padding-inline-start:1rem;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item{padding-top:2px;padding-bottom:2px;background-clip:content-box;border-radius:0 3px 3px 0;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item .content{width:100%;padding-top:6px;padding-bottom:6px;max-width:calc(100% - 20px)}.book-tree .sidebar-page-list .entity-list-item.selected{background-color:rgba(0,0,0,.06)}html.dark-mode .book-tree .sidebar-page-list .entity-list-item.selected{background-color:rgba(255,255,255,.06)}.book-tree .sidebar-page-list .entity-list-item.no-hover{margin-top:-6px;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item-name{font-size:1em;margin:0;margin-inline-end:16px}.book-tree .sidebar-page-list .chapter-child-menu{font-size:.8rem;margin-top:-0.2rem;margin-inline-start:-1rem}.book-tree .sidebar-page-list .chapter-contents-toggle{display:block;width:100%;text-align:start;padding:3px 12px 6px 12px;border-radius:0 3px 3px 0;line-height:1;margin-top:-3px;margin-bottom:-3px}.book-tree .sidebar-page-list .chapter-contents-toggle:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .book-tree .sidebar-page-list .chapter-contents-toggle:hover{background-color:rgba(255,255,255,.06)}.book-tree .sidebar-page-list .entity-list-item .icon{z-index:2;width:4px;height:auto;align-self:stretch;flex-shrink:0;border-radius:1px;opacity:.8}.book-tree .sidebar-page-list .entity-list-item .icon:after{opacity:1}.book-tree .sidebar-page-list .entity-list-item .icon svg{display:none}.chapter-child-menu ul.sub-menu{display:none;padding-inline-start:0;position:relative;margin-bottom:0}.sortable-page-list,.sortable-page-sublist{list-style:none}.sort-box{margin-bottom:16px;padding:16px 32px;position:relative}.sort-box::before{pointer-events:none;content:"";border-radius:4px;opacity:.5;border:2px solid var(--color-book);display:block;top:0;bottom:0;left:0;right:0;position:absolute}.sort-box-options{display:flex;flex-wrap:wrap;justify-content:space-between}.sort-box-options .button{margin-inline-start:0}.sortable-page-list{margin-inline-start:0;padding:0}.sortable-page-list .entity-list-item>span:first-child{align-self:flex-start}.sortable-page-list .sortable-selected,.sortable-page-list .sortable-selected:hover{outline:1px dotted var(--color-primary);background-color:var(--color-primary-light) !important}.sortable-page-list .entity-list-item>div{display:block;flex:1}.sortable-page-list>ul{margin-inline-start:0}.sortable-page-list .sortable-page-sublist{margin-bottom:16px;margin-top:0;padding-inline-start:16px}.sortable-page-list li{background-color:#fff;border:1px solid;border-color:#ddd;margin-top:-1px;min-height:38px}html.dark-mode .sortable-page-list li{background-color:#222}html.dark-mode .sortable-page-list li{border-color:#666}.sortable-page-list li.text-page,.sortable-page-list li.text-chapter{border-inline-start:2px solid currentColor}.sortable-page-list li:first-child{margin-top:6px}.sortable-page-list li.placeholder{position:relative}.sortable-page-list li.placeholder:before{position:absolute}.sort-box summary{list-style:none;font-size:.9rem;cursor:pointer}.sort-box summary::-webkit-details-marker{display:none}details.sort-box summary .caret-container svg{transition:transform ease-in-out 120ms}details.sort-box[open] summary .caret-container svg{transform:rotate(90deg)}.sort-box-actions .icon-button{opacity:.6}.sort-box .flex-container-row:hover .sort-box-actions .icon-button,.sort-box .flex-container-row:focus-within .sort-box-actions .icon-button{opacity:1}.sort-box-actions .icon-button[disabled]{visibility:hidden}.sort-box-actions .dropdown-menu button[disabled]{display:none}.sort-list-handle{cursor:grab}.activity-list-item{padding:12px 0;display:grid;grid-template-columns:min-content 1fr;grid-column-gap:16px;font-size:.9em}.card .activity-list-item{padding-block:12px}.user-list-item{display:inline-grid;padding:12px;grid-template-columns:min-content 1fr;grid-column-gap:16px;font-size:.9em;align-items:center}.user-list-item>div:first-child{line-height:0}ul.pagination{display:inline-flex;list-style:none;margin:16px 0;padding-inline-start:1px}ul.pagination li:first-child a,ul.pagination li:first-child span{border-radius:3px 0 0 3px}ul.pagination li:last-child a,ul.pagination li:last-child span{border-radius:0 3px 3px 0}ul.pagination a,ul.pagination span{display:block;padding:3px 12px;border:1px solid #ccc;margin-inline-start:-1px;user-select:none;color:#555;border-color:#ccc}html.dark-mode ul.pagination a,html.dark-mode ul.pagination span{color:#eee}html.dark-mode ul.pagination a,html.dark-mode ul.pagination span{border-color:#666}ul.pagination li.disabled{cursor:not-allowed}ul.pagination li.active span{color:#111;background-color:rgba(0,0,0,.05)}html.dark-mode ul.pagination li.active span{color:#eee}html.dark-mode ul.pagination li.active span{background-color:rgba(0,0,0,.5)}.compact ul.pagination{margin:0}.entity-list,.icon-list{margin:0 -16px}.entity-list h4,.icon-list h4{margin:0}.entity-list hr,.icon-list hr{margin:0}.entity-list .text-small.text-muted,.icon-list .text-small.text-muted{color:#aaa;font-size:.75em;margin-top:6px}.entity-list .text-muted p.text-muted,.icon-list .text-muted p.text-muted{margin-top:0}.entity-list .page.draft .text-page,.icon-list .page.draft .text-page{color:var(--color-page-draft);fill:var(--color-page-draft)}.entity-list>.dropdown-container,.icon-list>.dropdown-container{display:block}.icon-list hr{margin:12px 16px;max-width:140px;opacity:.25;height:1.1px}.icon-list hr+hr,.icon-list hr:first-child,.icon-list hr:last-child{display:none}.entity-list-item,.icon-list-item{padding:12px 16px;display:flex;align-items:center;gap:16px;background-color:rgba(0,0,0,0);border:0;width:100%;position:relative;word-break:break-word}.entity-list-item h4 a,.icon-list-item h4 a{color:#666}.entity-list-item>span:first-child,.icon-list-item>span:first-child{flex-basis:1.88em;flex:none}.entity-list-item>span:last-child,.icon-list-item>span:last-child{flex:1;text-align:start}.entity-list-item>.content,.icon-list-item>.content{min-width:0}.entity-list-item:not(.no-hover),.icon-list-item:not(.no-hover){cursor:pointer}.entity-list-item:not(.no-hover):hover,.icon-list-item:not(.no-hover):hover{background-color:rgba(0,0,0,.06);text-decoration:none;border-radius:4px}html.dark-mode .entity-list-item:not(.no-hover):hover,html.dark-mode .icon-list-item:not(.no-hover):hover{background-color:rgba(255,255,255,.06)}.entity-list-item.outline-hover:hover,.icon-list-item.outline-hover:hover{background-color:rgba(0,0,0,0)}.entity-list-item:focus,.icon-list-item:focus{background-color:#eee;outline:1px dotted #666;outline-offset:-2px}html.dark-mode .entity-list-item:focus,html.dark-mode .icon-list-item:focus{background-color:#222}.entity-list-item.disabled{pointer-events:none;cursor:not-allowed;opacity:.8;user-select:none;background:var(--bg-disabled)}.entity-list-item-path-sep{display:inline-block;vertical-align:top;position:relative;top:1px}.entity-list-item-path-sep svg{margin-inline-end:0}.split-icon-list-item{display:flex;align-items:center;gap:16px;background-color:rgba(0,0,0,0);border:0;width:100%;position:relative;word-break:break-word;border-radius:4px}.split-icon-list-item>a{padding:12px 16px;display:flex;align-items:center;gap:16px;flex:1}.split-icon-list-item>a:hover{text-decoration:none}.split-icon-list-item .icon{flex-basis:1.88em;flex:none}.split-icon-list-item:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .split-icon-list-item:hover{background-color:rgba(255,255,255,.06)}.icon-list-item-dropdown{margin-inline-start:auto;align-self:stretch;display:flex;align-items:stretch;border-inline-start:1px solid rgba(0,0,0,.1);visibility:hidden}.split-icon-list-item:hover .icon-list-item-dropdown,.split-icon-list-item:focus-within .icon-list-item-dropdown{visibility:visible}.icon-list-item-dropdown-toggle{padding:6px;display:flex;align-items:center;cursor:pointer;color:#888}html.dark-mode .icon-list-item-dropdown-toggle{color:#999}.icon-list-item-dropdown-toggle svg{margin:0}.icon-list-item-dropdown-toggle:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .icon-list-item-dropdown-toggle:hover{background-color:rgba(255,255,255,.06)}.card .entity-list-item:not(.no-hover,.book-contents .entity-list-item):hover{background-color:#f2f2f2;border-radius:0}html.dark-mode .card .entity-list-item:not(.no-hover,.book-contents .entity-list-item):hover{background-color:#2d2d2d}.card .entity-list-item .entity-list-item:hover{background-color:#eee}.entity-list-item-children{padding:16px 24px}.entity-list-item-children>div{overflow:hidden;padding:0 0 6px 0}.entity-list-item-children .entity-chip{text-overflow:ellipsis;height:2.5em;overflow:hidden;text-align:start;display:block;white-space:nowrap}.entity-list-item-children>.entity-list>.entity-list-item:last-child{margin-bottom:-6px}.entity-list-item-image{align-self:stretch;width:140px;flex:none;background-size:cover;background-position:50% 50%;border-radius:3px;position:relative;margin-inline-end:24px}.entity-list-item-image.entity-list-item-image-wide{width:220px}.entity-list-item-image .svg-icon{color:#fff;font-size:1.66rem;margin-inline-end:0;position:absolute;bottom:6px;left:6px}html.dark-mode .entity-list-item-image .svg-icon{color:rgba(255,255,255,.6)}@media screen and (max-width: 880px){.entity-list-item-image{width:80px}}.chapter>.entity-list-item-image{width:60px}.entity-list.compact{font-size:8.4px}.entity-list.compact h4,.entity-list.compact a{line-height:1.2}.entity-list.compact .entity-item-snippet{display:none}.entity-list.compact .entity-list-item p{font-size:11.2px;padding-top:6px}.entity-list.compact .entity-list-item p:empty{padding-top:0}.entity-list.compact p{margin:0}.entity-list.compact>p.empty-text{display:block;font-size:14px}.entity-list.compact hr{margin:0}@media screen and (max-width: 880px){.entity-list.compact h4{font-size:1.666em}}.entity-item-tags{font-size:.75rem;opacity:1}.entity-item-tags .primary-background-light{background:rgba(0,0,0,0)}.entity-item-tags .tag-name{background-color:rgba(0,0,0,.05)}.dropdown-container{display:inline-block;vertical-align:top;position:relative}.dropdown-menu{display:none;position:absolute;z-index:999;top:0;list-style:none;inset-inline-end:0;margin:16px 0;background-color:#fff;box-shadow:0 1px 6px 0 rgba(0,0,0,.18);border-radius:3px;min-width:180px;padding:6px 0;color:#555;fill:currentColor;text-align:start !important;max-height:500px;overflow-y:auto}html.dark-mode .dropdown-menu{background-color:#333}html.dark-mode .dropdown-menu{color:#eee}.dropdown-menu.anchor-left{inset-inline-end:auto;inset-inline-start:0}.dropdown-menu.wide{min-width:220px}.dropdown-menu.xl-limited{width:280px;max-width:100%}.dropdown-menu .text-muted{color:#999;fill:#999}.dropdown-menu li.active a{font-weight:600}.dropdown-menu button{width:100%;text-align:start}.dropdown-menu li.border-bottom{border-bottom:1px solid #ddd}.dropdown-menu li hr{margin:6px 0}.dropdown-menu .icon-item,.dropdown-menu .text-item,.dropdown-menu .label-item{padding:8px 16px;color:#555;fill:currentColor;white-space:nowrap;line-height:1.4;cursor:pointer}html.dark-mode .dropdown-menu .icon-item,html.dark-mode .dropdown-menu .text-item,html.dark-mode .dropdown-menu .label-item{color:#eee}.dropdown-menu .icon-item.break-text,.dropdown-menu .text-item.break-text,.dropdown-menu .label-item.break-text{white-space:normal;word-wrap:break-word;overflow-wrap:break-word}.dropdown-menu .icon-item:hover,.dropdown-menu .icon-item:focus,.dropdown-menu .text-item:hover,.dropdown-menu .text-item:focus,.dropdown-menu .label-item:hover,.dropdown-menu .label-item:focus{text-decoration:none;background-color:var(--color-primary-light);color:var(--color-primary)}.dropdown-menu .icon-item:focus,.dropdown-menu .text-item:focus,.dropdown-menu .label-item:focus{outline:1px solid var(--color-primary);outline-offset:-2px}.dropdown-menu .icon-item svg,.dropdown-menu .text-item svg,.dropdown-menu .label-item svg{margin-inline-end:12px;display:inline-block;width:16px}.dropdown-menu .text-item{display:block}.dropdown-menu .label-item{display:grid;align-items:center;grid-template-columns:auto min-content;gap:16px}.dropdown-menu .label-item>*:nth-child(2){opacity:.7}.dropdown-menu .label-item>*:nth-child(2):hover{opacity:1}.dropdown-menu .icon-item{display:grid;align-items:start;grid-template-columns:16px auto;gap:16px}.dropdown-menu .icon-item svg{margin-inline-end:0;margin-block-start:1px}.tri-layout-right .dropdown-menu,.tri-layout-left .dropdown-menu{inset-inline-end:6px}.featured-image-container{position:relative;overflow:hidden;min-height:140px;background-size:cover;background-position:50% 50%;transition:opacity ease-in-out 240ms}.featured-image-container a{display:block}.featured-image-container img{display:block;width:100%;max-width:100%;height:auto}.featured-image-container-wrap{position:relative}.featured-image-container-wrap .svg-icon{color:#fff;font-size:2rem;margin-inline-end:0;position:absolute;bottom:10px;left:6px}html.dark-mode .featured-image-container-wrap .svg-icon{color:rgba(255,255,255,.6)}.grid-card:hover .featured-image-container{opacity:.5}.action-link{background:rgba(0,0,0,0);border:none;color:currentColor;padding:16px 0}.active-link-list a{display:inline-block;padding:12px}.active-link-list a:not(.active){color:#444}html.dark-mode .active-link-list a:not(.active){color:#888}.active-link-list a:hover{background-color:rgba(0,0,0,.05);border-radius:4px;text-decoration:none}html.dark-mode .active-link-list a:hover{background-color:rgba(255,255,255,.05)}.active-link-list.in-sidebar a{display:block;margin-bottom:6px}.active-link-list.in-sidebar a.active{border-radius:4px;background-color:rgba(0,0,0,.05)}html.dark-mode .active-link-list.in-sidebar a.active{background-color:rgba(255,255,255,.05)}.entity-meta-item{display:flex;line-height:1.2;margin:.6em 0;align-content:start;gap:12px}.entity-meta-item a{line-height:1.2}.entity-meta-item svg{flex-shrink:0;width:1em;margin:0}.page-editor{display:flex;flex-direction:column;align-items:stretch;overflow:hidden}.page-editor .edit-area{flex:1;flex-direction:column;z-index:10;overflow:hidden;border-radius:0 0 8px 8px}.page-editor .mce-tinymce{box-shadow:none}.page-editor .mce-top-part::before{box-shadow:none}.page-editor-page-area{width:100%;border-radius:8px;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);background-color:#fff}html.dark-mode .page-editor-page-area{background-color:#333}.page-edit-toolbar{width:100%;margin:0 auto;display:grid;grid-template-columns:minmax(max-content, 2fr) 1.5fr minmax(max-content, 2fr);align-items:center}@media screen and (min-width: 1400px){.page-editor-wysiwyg .page-edit-toolbar,.page-editor-wysiwyg .page-editor-page-area{max-width:1140px}.page-editor-wysiwyg .floating-toolbox{position:absolute}}@media screen and (max-width: 880px){.page-edit-toolbar{display:flex;flex-direction:row;justify-content:space-between}}.title-input.page-title{font-size:.8em}.title-input.page-title .input{border:0;margin-bottom:-1px}.title-input.page-title input[type=text]{max-width:840px;margin:0 auto;border:none;height:auto;display:block;width:100%;font-size:20px;border-radius:8px}.title-input.page-title input[type=text]:focus{position:relative;outline-offset:-1px;outline:1px dashed var(--color-primary);box-shadow:0 1px 6px -1px rgba(0,0,0,.1);z-index:50}.page-editor-markdown .title-input.page-title input[type=text]{max-width:100%}body.tox-fullscreen .page-editor .edit-area,body.markdown-fullscreen .page-editor .edit-area{z-index:12}body.tox-fullscreen .page-editor,body.tox-fullscreen .flex-fill,body.markdown-fullscreen .page-editor,body.markdown-fullscreen .flex-fill{overflow:visible}@media screen and (max-width: 600px){.page-edit-toolbar{overflow-x:scroll;overflow-y:visible}.page-edit-toolbar{white-space:nowrap}.page-edit-toolbar>div{display:inline-block}}.page-save-mobile-button{position:fixed;z-index:30;border-radius:50%;width:52px;height:52px;font-size:26px;inset-inline-end:6px;bottom:12px;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);background-color:currentColor;text-align:center}.page-save-mobile-button svg{fill:#fff;margin-inline-end:0}.draft-notification{pointer-events:none;transform:scale(0);transition:transform ease-in-out 120ms;transform-origin:50% 50%}.draft-notification.visible{transform:scale(1)}.page-style.editor{padding:0 !important}.pointer-container{position:fixed;display:none;left:0;z-index:10}.pointer{border:1px solid #ccc;border-color:#ccc;border-radius:4px;box-shadow:0 0 12px 1px rgba(0,0,0,.1);background-color:#fff;width:275px}html.dark-mode .pointer{border-color:#000}html.dark-mode .pointer{background-color:#333}.pointer.is-page-editable{width:328px}.pointer:before{position:absolute;left:50%;bottom:-9px;width:16px;height:16px;margin-inline-start:-8px;content:"";display:block;transform:rotate(45deg);transform-origin:50% 50%;border-right:1px solid #ccc;border-bottom:1px solid #ccc;z-index:56;background-color:#fff;border-color:#ccc}html.dark-mode .pointer:before{background-color:#333}html.dark-mode .pointer:before{border-color:#000}.pointer input,.pointer button,.pointer a{position:relative;border-radius:0;height:28px;font-size:12px;vertical-align:top;padding:5px 16px}.pointer input{background-color:#fff;border:1px solid #ddd;border-color:#ddd;color:#666;width:160px;z-index:40;padding:5px 10px}html.dark-mode .pointer input{border-color:#000}.pointer .text-button{color:#444}html.dark-mode .pointer .text-button{color:#aaa}.pointer .input-group .button{line-height:1;margin:0 0 0 -4px;box-shadow:none}.pointer a.button{margin:0}.pointer .svg-icon{width:1.2em;height:1.2em}.pointer .button{border-color:#ddd}html.dark-mode .pointer .button{border-color:#000}.floating-toolbox{background-color:#fff;overflow:hidden;align-items:stretch;flex-direction:row;display:flex;max-height:100%;border-radius:8px;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);margin-bottom:auto;margin-inline-start:24px;position:relative}html.dark-mode .floating-toolbox{background-color:#222}.floating-toolbox.open{position:relative;right:0;max-width:480px;margin-bottom:0}.floating-toolbox:not(.open) .toolbox-tab-content{display:none !important}.floating-toolbox .toolbox-toggle svg{transition:transform ease-in-out 180ms}.floating-toolbox .toolbox-toggle{transition:background-color ease-in-out 180ms}.floating-toolbox.open .toolbox-toggle{background-color:rgba(255,0,0,.2)}.floating-toolbox.open .toolbox-toggle svg{transform:rotate(180deg)}.floating-toolbox>div{flex:1;position:relative}.floating-toolbox .tabs{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd;width:40px;flex:0 1 auto;margin-inline-end:-1px}html.dark-mode .floating-toolbox .tabs{border-inline-end-color:#000}.floating-toolbox .tabs-inner{background-color:#fff}html.dark-mode .floating-toolbox .tabs-inner{background-color:#222}.floating-toolbox .tabs svg{padding:0;margin:0}.floating-toolbox .tabs-inner>button{color:rgba(0,0,0,.7);display:block;cursor:pointer;padding:10px 6px;font-size:18px;line-height:1.6}html.dark-mode .floating-toolbox .tabs-inner>button{color:rgba(255,255,255,.5)}.floating-toolbox .tabs-inner>button:hover,.floating-toolbox.open .tabs-inner>button.active{color:var(--color-link) !important;position:relative}.floating-toolbox .tabs-inner>button:hover:after,.floating-toolbox.open .tabs-inner>button.active:after{content:"";display:block;position:absolute;left:0;width:100%;top:0;height:100%;background-color:currentColor;opacity:.075}.floating-toolbox.open .tabs-inner>button.active{border-inline-end:1px solid var(--color-link);margin-inline-end:-1px}.floating-toolbox h4{font-size:24px;margin:16px 0 0 0;padding:0 24px 12px 24px}.floating-toolbox .tags input{max-width:100%;width:100%;min-width:50px}.floating-toolbox .tags td,.floating-toolbox .inline-start-table>div>div>div{padding-inline-end:12px;padding-top:12px;position:relative}.floating-toolbox .handle{user-select:none;cursor:move;fill:#999}.floating-toolbox form{display:flex;flex:1;flex-direction:column;overflow-y:scroll}.floating-toolbox table td,.floating-toolbox table th{overflow:visible}@media screen and (max-width: 1400px){.floating-toolbox{margin-inline-start:12px}}@media screen and (max-width: 600px){.page-editor-page-area-wrap{margin:4px !important}.floating-toolbox{margin-inline-start:4px}.floating-toolbox .tabs{width:32px}.floating-toolbox .tabs-inner>button{font-size:12px}.page-edit-toolbar{padding-block:0 !important}.page-editor.toolbox-open .page-editor-page-area{display:none}}.toolbox-tab-content{display:none;overflow-y:auto;padding-bottom:45px}.suggestion-box{top:auto;margin:-4px 0 0;right:auto;left:0;padding:0}.suggestion-box li{display:block;border-bottom:1px solid #ddd}.suggestion-box li:last-child{border-bottom:0}.comments-container h5{color:#888;font-weight:normal;margin-top:.5em}.comment-editor .CodeMirror,.comment-editor .CodeMirror-scroll{min-height:175px}.mce-floatpanel[aria-label="Insert/edit media"] .mce-open{display:none}.entity-list-item>span:first-child,.icon-list-item>span:first-child,.split-icon-list-item>a>.icon,.chapter-expansion>.icon{font-size:.8rem;width:1.88em;height:1.88em;flex-shrink:0;display:flex;align-items:center;justify-content:center;text-align:center;border-radius:1em;position:relative;overflow:hidden}.entity-list-item>span:first-child svg,.icon-list-item>span:first-child svg,.split-icon-list-item>a>.icon svg,.chapter-expansion>.icon svg{margin:0;bottom:0}.entity-list-item>span:first-child:after,.icon-list-item>span:first-child:after,.split-icon-list-item>a>.icon:after,.chapter-expansion>.icon:after{content:"";position:absolute;background-color:currentColor;opacity:.2;left:0;top:0;width:100%;height:100%}.entity-chip{display:inline-block;align-items:center;justify-content:center;text-align:center;font-size:.9em;border-radius:3px;position:relative;overflow:hidden;padding:6px 12px;fill:currentColor;opacity:.85;transition:opacity ease-in-out 120ms}.entity-chip:after{content:"";position:absolute;background-color:currentColor;opacity:.15;left:0;top:0;width:100%;height:100%}.entity-chip:hover{text-decoration:none;opacity:1}@media(prefers-contrast: more){.entity-chip{opacity:1}}.page-content{width:100%;max-width:840px;margin:0 auto;overflow-wrap:break-word}.page-content .align-left{text-align:left}.page-content img.align-left,.page-content table.align-left,.page-content iframe.align-left,.page-content video.align-left{float:left !important;margin:6px 16px 16px 0}.page-content .align-right{text-align:right !important}.page-content img.align-right,.page-content table.align-right,.page-content iframe.align-right,.page-content video.align-right{float:right !important;margin:6px 0 6px 12px}.page-content .align-center{text-align:center}.page-content img.align-center,.page-content video.align-center,.page-content iframe.align-center{display:block}.page-content img.align-center,.page-content table.align-center,.page-content iframe.align-center,.page-content video.align-center{margin-left:auto;margin-right:auto}.page-content h1,.page-content h2,.page-content h3,.page-content h4,.page-content h5,.page-content h6,.page-content pre{clear:left}.page-content hr{clear:both;margin:16px 0}.page-content table{hyphens:auto;table-layout:fixed;max-width:100%;height:auto !important}.page-content ins,.page-content del{text-decoration:none}.page-content ins{background:#dbffdb}.page-content del{background:#ffecec}.page-content details{border:1px solid;border-color:#ddd;margin-bottom:1em;padding:12px}html.dark-mode .page-content details{border-color:#555}.page-content details>summary{margin-top:-12px;margin-left:-12px;margin-right:-12px;margin-bottom:-12px;font-weight:bold;background-color:#eee;padding:6px 12px}html.dark-mode .page-content details>summary{background-color:#333}.page-content details[open]>summary{margin-bottom:12px;border-bottom:1px solid;border-color:#ddd}html.dark-mode .page-content details[open]>summary{border-color:#555}.page-content details>summary+*{margin-top:.2em}.page-content details:after{content:"";display:block;clear:both}.page-content li>input[type=checkbox]{vertical-align:top;margin-top:.3em}.page-content p:empty{min-height:1.6em}.page-content.page-revision pre code{white-space:pre-wrap}.page-content .cm-editor{margin-bottom:1.375em}.page-content video{max-width:100%}.page-content a{text-decoration:underline}body .page-content img,.page-content img:not([data-mce-object]){max-width:100%;height:auto}.callout{border-left:3px solid #bbb;background-color:#eee;padding:12px 12px 12px 32px;display:block;position:relative;overflow:auto}.callout:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMTUzODAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bTEgMTVoLTJ2LTZoMnY2em0wLThoLTJWN2gydjJ6Ii8+PC9zdmc+");background-repeat:no-repeat;content:"";width:1.2em;height:1.2em;left:8px;top:50%;margin-top:-9px;display:inline-block;position:absolute;line-height:1;opacity:.8}.callout.success{border-left-color:#0f7d15;background-color:#eafdeb;color:#063409}html.dark-mode .callout.success{border-left-color:#4aa850}html.dark-mode .callout.success{background-color:#122913}html.dark-mode .callout.success{color:#4aa850}.callout.success:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+")}.callout.danger{border-left-color:#ab0f0e;background-color:#fcdbdb;color:#4d0706}html.dark-mode .callout.danger{border-left-color:#e85c5b}html.dark-mode .callout.danger{background-color:#250505}html.dark-mode .callout.danger{color:#e85c5b}.callout.danger:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==")}.callout.info{border-left-color:#0288d1;color:#01466c;background-color:#d3efff}html.dark-mode .callout.info{border-left-color:#0288d1}html.dark-mode .callout.info{color:#0288d1}html.dark-mode .callout.info{background-color:#001825}.callout.warning{border-left-color:#cf4d03;background-color:#fee3d3;color:#6a2802}html.dark-mode .callout.warning{border-left-color:#de8a5a}html.dark-mode .callout.warning{background-color:#30170a}html.dark-mode .callout.warning{color:#de8a5a}.callout.warning:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiNjUzMWMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEgMjFoMjJMMTIgMiAxIDIxem0xMi0zaC0ydi0yaDJ2MnptMC00aC0ydi00aDJ2NHoiLz48L3N2Zz4=")}.callout a{color:inherit;text-decoration:underline}@media print{html,body{font-size:12px;background-color:#fff}.page-content{margin:0 auto}.print-hidden{display:none !important}.tri-layout-container{grid-template-columns:1fr;grid-template-areas:"b";margin-inline-start:0;margin-inline-end:0;display:block}.card{box-shadow:none}.content-wrap.card{padding-inline-start:0;padding-inline-end:0}}.dragged{position:absolute;opacity:.5;z-index:2000}body.dragging,body.dragging *{cursor:move !important}.avatar{border-radius:100%;background-color:#eee;width:30px;height:30px}html.dark-mode .avatar{background-color:#000}.avatar.med{width:40px;height:40px}.avatar.large{width:80px;height:80px}.avatar.huge{width:120px;height:120px}.avatar.square{border-radius:3px}html.dark-mode .avatar[src$="user_avatar.png"]{filter:invert(1)}.loading-container{position:relative;display:block;margin:32px auto}.loading-container>div{width:10px;height:10px;border-radius:10px;display:inline-block;vertical-align:top;transform:translate3d(-10px, 0, 0);margin-top:6px;animation-name:loadingBob;animation-duration:1.4s;animation-iteration-count:infinite;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99);margin-inline-end:4px;background-color:var(--color-page);animation-delay:-300ms}.loading-container>div:first-child{left:-16px;background-color:var(--color-book);animation-delay:-600ms}.loading-container>div:last-of-type{left:16px;background-color:var(--color-chapter);animation-delay:0ms}.loading-container>span{margin-inline-start:12px;font-style:italic;color:#888;vertical-align:top}.skip-to-content-link{position:fixed;top:-52px;left:0;background-color:#fff;z-index:15;border-radius:0 4px 4px 0;display:block;box-shadow:0 0 4px 1px rgba(0,0,0,.5);font-weight:bold}.skip-to-content-link:focus{top:32px;outline-offset:-10px;outline:2px dotted var(--color-link)}.entity-selector{border:1px solid #ddd;border-color:#ddd;border-radius:3px;overflow:hidden;font-size:.8em}html.dark-mode .entity-selector{border-color:#111}.entity-selector input[type=text]{width:100%;display:block;border-radius:0;border:0;border-bottom:1px solid #ddd;font-size:16px;padding:12px 16px}.entity-selector .entity-list{overflow-y:scroll;height:400px;background-color:#eee;margin-inline-end:0;margin-inline-start:0}html.dark-mode .entity-selector .entity-list{background-color:#222}.entity-selector .entity-list-item{background-color:#fff}html.dark-mode .entity-selector .entity-list-item{background-color:#222}.entity-selector .entity-list-item p{margin-bottom:0}.entity-selector .entity-list-item:focus{outline:2px dotted var(--color-primary);outline-offset:-4px}.entity-selector .entity-list-item.selected{background-color:rgba(0,0,0,.05)}html.dark-mode .entity-selector .entity-list-item.selected{background-color:rgba(255,255,255,.05)}.entity-selector .loading{height:400px;padding-top:24px}.entity-selector.compact{font-size:10px}.entity-selector.compact .entity-item-snippet{display:none}.entity-selector.compact h4{font-size:14px}.fullscreen{border:0;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;z-index:150}@media screen and (min-width: 600px)and (max-width: 880px){#home-default>.grid.third{display:block;columns:2;column-gap:24px !important}}.list-sort-container{display:inline-block}.list-sort-container form{display:inline-block}.list-sort-container .list-sort{display:inline-grid;margin-inline-start:12px;grid-template-columns:minmax(120px, max-content) 40px;font-size:.9rem;border:2px solid #ddd;border-color:#ddd;border-radius:4px}html.dark-mode .list-sort-container .list-sort{border-color:#444}.list-sort-container .list-sort-label{font-weight:bold;display:inline-block;color:#555}html.dark-mode .list-sort-container .list-sort-label{color:#888}.list-sort-container .list-sort-type{text-align:start}.list-sort-container .list-sort-type,.list-sort-container .list-sort-dir{padding:6px 12px;cursor:pointer}.list-sort-container .list-sort-dir{border-inline-start:2px solid #ddd;color:#888;border-color:#ddd}html.dark-mode .list-sort-container .list-sort-dir{border-color:#444}.list-sort-container .list-sort-dir .svg-icon{transition:transform ease-in-out 120ms}.list-sort-container .list-sort-dir:hover .svg-icon{transform:rotate(180deg)}/*# sourceMappingURL=styles.css.map */ +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after{content:"";content:none}q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}:root{--font-body: -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Roboto, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--font-code: Lucida Console, DejaVu Sans Mono, Ubuntu Mono, Monaco, monospace;--color-primary: #206ea7;--color-primary-light: rgba(32,110,167,0.15);--color-link: #206ea7;--color-page: #206ea7;--color-page-draft: #7e50b1;--color-chapter: #af4d0d;--color-book: #077b70;--color-bookshelf: #a94747;--color-positive: #0f7d15;--color-negative: #ab0f0e;--color-info: #0288D1;--color-warning: #cf4d03;--bg-disabled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25'%3E%3Cdefs%3E%3Cpattern id='doodad' width='19' height='19' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform='rotate(143)'%3E%3Crect width='100%25' height='100%25' fill='rgba(42, 67, 101,0)'/%3E%3Cpath d='M-10 30h60v20h-60zM-10-10h60v20h-60' fill='rgba(26, 32, 44,0)'/%3E%3Cpath d='M-10 10h60v20h-60zM-10-30h60v20h-60z' fill='rgba(0, 0, 0,0.05)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23doodad)' height='200%25' width='200%25'/%3E%3C/svg%3E")}:root.dark-mode{--bg-disabled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25'%3E%3Cdefs%3E%3Cpattern id='doodad' width='19' height='19' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform='rotate(143)'%3E%3Crect width='100%25' height='100%25' fill='rgba(42, 67, 101,0)'/%3E%3Cpath d='M-10 30h60v20h-60zM-10-10h60v20h-60' fill='rgba(26, 32, 44,0)'/%3E%3Cpath d='M-10 10h60v20h-60zM-10-30h60v20h-60z' fill='rgba(255, 255, 255,0.05)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23doodad)' height='200%25' width='200%25'/%3E%3C/svg%3E");color-scheme:only dark;--color-positive: #4aa850;--color-negative: #e85c5b;--color-warning: #de8a5a}:root:not(.dark-mode){color-scheme:only light}.m-none{margin:0 !important}.mx-none{margin-inline-start:0 !important;margin-inline-end:0 !important}.my-none{margin-top:0 !important;margin-bottom:0 !important}.mt-none{margin-top:0 !important}.mr-none{margin-inline-end:0 !important}.mb-none{margin-bottom:0 !important}.ml-none{margin-inline-start:0 !important}.m-xxs{margin:3px !important}.mx-xxs{margin-inline-start:3px !important;margin-inline-end:3px !important}.my-xxs{margin-top:3px !important;margin-bottom:3px !important}.mt-xxs{margin-top:3px !important}.mr-xxs{margin-inline-end:3px !important}.mb-xxs{margin-bottom:3px !important}.ml-xxs{margin-inline-start:3px !important}.m-xs{margin:6px !important}.mx-xs{margin-inline-start:6px !important;margin-inline-end:6px !important}.my-xs{margin-top:6px !important;margin-bottom:6px !important}.mt-xs{margin-top:6px !important}.mr-xs{margin-inline-end:6px !important}.mb-xs{margin-bottom:6px !important}.ml-xs{margin-inline-start:6px !important}.m-s{margin:12px !important}.mx-s{margin-inline-start:12px !important;margin-inline-end:12px !important}.my-s{margin-top:12px !important;margin-bottom:12px !important}.mt-s{margin-top:12px !important}.mr-s{margin-inline-end:12px !important}.mb-s{margin-bottom:12px !important}.ml-s{margin-inline-start:12px !important}.m-m{margin:16px !important}.mx-m{margin-inline-start:16px !important;margin-inline-end:16px !important}.my-m{margin-top:16px !important;margin-bottom:16px !important}.mt-m{margin-top:16px !important}.mr-m{margin-inline-end:16px !important}.mb-m{margin-bottom:16px !important}.ml-m{margin-inline-start:16px !important}.m-l{margin:24px !important}.mx-l{margin-inline-start:24px !important;margin-inline-end:24px !important}.my-l{margin-top:24px !important;margin-bottom:24px !important}.mt-l{margin-top:24px !important}.mr-l{margin-inline-end:24px !important}.mb-l{margin-bottom:24px !important}.ml-l{margin-inline-start:24px !important}.m-xl{margin:32px !important}.mx-xl{margin-inline-start:32px !important;margin-inline-end:32px !important}.my-xl{margin-top:32px !important;margin-bottom:32px !important}.mt-xl{margin-top:32px !important}.mr-xl{margin-inline-end:32px !important}.mb-xl{margin-bottom:32px !important}.ml-xl{margin-inline-start:32px !important}.m-xxl{margin:48px !important}.mx-xxl{margin-inline-start:48px !important;margin-inline-end:48px !important}.my-xxl{margin-top:48px !important;margin-bottom:48px !important}.mt-xxl{margin-top:48px !important}.mr-xxl{margin-inline-end:48px !important}.mb-xxl{margin-bottom:48px !important}.ml-xxl{margin-inline-start:48px !important}.m-auto{margin:auto !important}.mx-auto{margin-inline-start:auto !important;margin-inline-end:auto !important}.my-auto{margin-top:auto !important;margin-bottom:auto !important}.mt-auto{margin-top:auto !important}.mr-auto{margin-inline-end:auto !important}.mb-auto{margin-bottom:auto !important}.ml-auto{margin-inline-start:auto !important}.p-none{padding:0 !important}.px-none{padding-inline-start:0 !important;padding-inline-end:0 !important}.py-none{padding-top:0 !important;padding-bottom:0 !important}.pt-none{padding-top:0 !important}.pr-none{padding-inline-end:0 !important}.pb-none{padding-bottom:0 !important}.pl-none{padding-inline-start:0 !important}.p-xxs{padding:3px !important}.px-xxs{padding-inline-start:3px !important;padding-inline-end:3px !important}.py-xxs{padding-top:3px !important;padding-bottom:3px !important}.pt-xxs{padding-top:3px !important}.pr-xxs{padding-inline-end:3px !important}.pb-xxs{padding-bottom:3px !important}.pl-xxs{padding-inline-start:3px !important}.p-xs{padding:6px !important}.px-xs{padding-inline-start:6px !important;padding-inline-end:6px !important}.py-xs{padding-top:6px !important;padding-bottom:6px !important}.pt-xs{padding-top:6px !important}.pr-xs{padding-inline-end:6px !important}.pb-xs{padding-bottom:6px !important}.pl-xs{padding-inline-start:6px !important}.p-s{padding:12px !important}.px-s{padding-inline-start:12px !important;padding-inline-end:12px !important}.py-s{padding-top:12px !important;padding-bottom:12px !important}.pt-s{padding-top:12px !important}.pr-s{padding-inline-end:12px !important}.pb-s{padding-bottom:12px !important}.pl-s{padding-inline-start:12px !important}.p-m{padding:16px !important}.px-m{padding-inline-start:16px !important;padding-inline-end:16px !important}.py-m{padding-top:16px !important;padding-bottom:16px !important}.pt-m{padding-top:16px !important}.pr-m{padding-inline-end:16px !important}.pb-m{padding-bottom:16px !important}.pl-m{padding-inline-start:16px !important}.p-l{padding:24px !important}.px-l{padding-inline-start:24px !important;padding-inline-end:24px !important}.py-l{padding-top:24px !important;padding-bottom:24px !important}.pt-l{padding-top:24px !important}.pr-l{padding-inline-end:24px !important}.pb-l{padding-bottom:24px !important}.pl-l{padding-inline-start:24px !important}.p-xl{padding:32px !important}.px-xl{padding-inline-start:32px !important;padding-inline-end:32px !important}.py-xl{padding-top:32px !important;padding-bottom:32px !important}.pt-xl{padding-top:32px !important}.pr-xl{padding-inline-end:32px !important}.pb-xl{padding-bottom:32px !important}.pl-xl{padding-inline-start:32px !important}.p-xxl{padding:48px !important}.px-xxl{padding-inline-start:48px !important;padding-inline-end:48px !important}.py-xxl{padding-top:48px !important;padding-bottom:48px !important}.pt-xxl{padding-top:48px !important}.pr-xxl{padding-inline-end:48px !important}.pb-xxl{padding-bottom:48px !important}.pl-xxl{padding-inline-start:48px !important}.p-auto{padding:auto !important}.px-auto{padding-inline-start:auto !important;padding-inline-end:auto !important}.py-auto{padding-top:auto !important;padding-bottom:auto !important}.pt-auto{padding-top:auto !important}.pr-auto{padding-inline-end:auto !important}.pb-auto{padding-bottom:auto !important}.pl-auto{padding-inline-start:auto !important}.gap-none{gap:0 !important}.gap-x-none{column-gap:0 !important}.gap-y-none{row-gap:0 !important}.gap-xxs{gap:3px !important}.gap-x-xxs{column-gap:3px !important}.gap-y-xxs{row-gap:3px !important}.gap-xs{gap:6px !important}.gap-x-xs{column-gap:6px !important}.gap-y-xs{row-gap:6px !important}.gap-s{gap:12px !important}.gap-x-s{column-gap:12px !important}.gap-y-s{row-gap:12px !important}.gap-m{gap:16px !important}.gap-x-m{column-gap:16px !important}.gap-y-m{row-gap:16px !important}.gap-l{gap:24px !important}.gap-x-l{column-gap:24px !important}.gap-y-l{row-gap:24px !important}.gap-xl{gap:32px !important}.gap-x-xl{column-gap:32px !important}.gap-y-xl{row-gap:32px !important}.gap-xxl{gap:48px !important}.gap-x-xxl{column-gap:48px !important}.gap-y-xxl{row-gap:48px !important}.gap-auto{gap:auto !important}.gap-x-auto{column-gap:auto !important}.gap-y-auto{row-gap:auto !important}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}*{box-sizing:border-box;outline-color:var(--color-primary);outline-width:1px}*:focus{outline-style:dotted}html{height:100%;overflow-y:scroll;background-color:#f2f2f2}html.flexbox{overflow-y:hidden}html.dark-mode{background-color:#111}body{font-size:14px;line-height:1.6;color:#444;-webkit-font-smoothing:antialiased;height:100%;display:flex;flex-direction:column}html.dark-mode body{color:#aaa}body,button,input,select,label,textarea{font-family:var(--font-body)}pre,#markdown-editor-input,.text-mono,.code-base,span.code,code{font-family:var(--font-code)}h1{font-size:3.425em;line-height:1.22222222em;margin-top:.48888889em;margin-bottom:.48888889em}h2{font-size:2.8275em;line-height:1.294117647em;margin-top:.8627451em;margin-bottom:.43137255em}h3{font-size:2.333em;line-height:1.221428572em;margin-top:.78571429em;margin-bottom:.43137255em}h4{font-size:1.666em;line-height:1.375em;margin-top:.78571429em;margin-bottom:.43137255em}h1,h2,h3,h4,h5,h6{font-weight:400;position:relative;display:block;font-family:var(--font-heading, var(--font-body));color:#222}html.dark-mode h1,html.dark-mode h2,html.dark-mode h3,html.dark-mode h4,html.dark-mode h5,html.dark-mode h6{color:#bbb}h1 .subheader,h2 .subheader,h3 .subheader,h4 .subheader,h5 .subheader,h6 .subheader{font-size:.5em;line-height:1em;color:#969696}h5{font-size:1.4em}h5,h6{line-height:1.2em;margin-top:.78571429em;margin-bottom:.66em}@media screen and (max-width: 600px){h1{font-size:2.8275em}h2{font-size:2.333em}h3{font-size:1.666em}h4{font-size:1.333em}h5{font-size:1.161616em}}.list-heading{font-size:2rem}h2.list-heading{font-size:1.333rem}a{color:var(--color-link);fill:currentColor;cursor:pointer;text-decoration:none;transition:filter ease-in-out 80ms;line-height:1.6}a:hover{text-decoration:underline}a.icon{display:inline-block}a svg{position:relative;display:inline-block}a:focus img:only-child{outline:2px dashed var(--color-link);outline-offset:2px}a.no-link-style{color:inherit}a.no-link-style:hover{text-decoration:none}.blended-links a{color:inherit}.blended-links a svg{fill:currentColor}p,ul,ol,pre,table,blockquote{margin-top:.3em;margin-bottom:1.375em}hr{border:0;height:1px;background:#eaeaea;margin-bottom:24px}html.dark-mode hr{background:#555}hr.faded{background-image:linear-gradient(to right, #FFF, #e3e0e0 20%, #e3e0e0 80%, #FFF)}hr.darker{background:#ddd}html.dark-mode hr.darker{background:#666}hr.margin-top,hr.even{margin-top:24px}strong,b,.bold,.strong{font-weight:bold}strong>strong,strong>b,strong>.bold,strong>.strong,b>strong,b>b,b>.bold,b>.strong,.bold>strong,.bold>b,.bold>.bold,.bold>.strong,.strong>strong,.strong>b,.strong>.bold,.strong>.strong{font-weight:bolder}em,i,.italic{font-style:italic}small,p.small,span.small,.text-small{font-size:.75rem}sup,.superscript{vertical-align:super;font-size:.8em}sub,.subscript{vertical-align:sub;font-size:.8em}pre{font-size:12px;border:1px solid #ddd;background-color:#fff;border-color:#ddd;border-radius:4px;padding-inline-start:26px;position:relative;padding-top:3px;padding-bottom:3px}html.dark-mode pre{background-color:#2b2b2b}html.dark-mode pre{border-color:#111}pre:before{content:"";display:block;position:absolute;top:0;width:22.4px;inset-inline-start:0;height:100%;background-color:#f5f5f5;border-inline-end:1px solid #ddd}html.dark-mode pre:before{background-color:#313335}html.dark-mode pre:before{border-inline-end:none}@media print{pre{padding-left:12px}pre:before{display:none}}blockquote{display:block;position:relative;border-left:4px solid rgba(0,0,0,0);border-left-color:var(--color-primary);background-color:#f8f8f8;padding:12px 16px 12px 32px;overflow:auto}html.dark-mode blockquote{background-color:#333}blockquote:before{content:"“";font-size:2em;font-weight:bold;position:absolute;top:12px;left:12px;color:#777}.text-mono{font-family:var(--font-code)}.text-uppercase{text-transform:uppercase}.text-capitals{text-transform:capitalize}.code-base,span.code,code{font-size:.84em;border:1px solid #ddd;border-radius:3px;background-color:#f8f8f8;border-color:#ddd}html.dark-mode .code-base,html.dark-mode span.code,html.dark-mode code{background-color:#2b2b2b}html.dark-mode .code-base,html.dark-mode span.code,html.dark-mode code{border-color:#444}code{display:inline;padding:1px 3px;white-space:pre-wrap;line-height:1.2em}span.code{padding:1px 6px}pre code{background-color:rgba(0,0,0,0);border:0;font-size:1em;display:block;line-height:1.6}span.highlight{font-weight:bold;padding:2px 4px}ul,ol{padding-left:32px;padding-right:32px;display:flow-root}ul p,ol p{margin:0}ul{list-style:disc}ul ul{list-style:circle}ul label{margin:0}ol{list-style:decimal}li>ol,li>ul{margin-top:0;margin-bottom:0;margin-block-end:0;margin-block-start:0;padding-block-end:0;padding-block-start:0;padding-left:19.2px;padding-right:19.2px}li.checkbox-item,li.task-list-item{display:list-item;list-style:none;margin-left:-19.2px}li.checkbox-item input[type=checkbox],li.task-list-item input[type=checkbox]{margin-right:6px}li.checkbox-item li.checkbox-item,li.checkbox-item li.task-list-item,li.task-list-item li.checkbox-item,li.task-list-item li.task-list-item{margin-left:6px}.underlined{text-decoration:underline}.text-center{text-align:center}.text-left{text-align:start}.text-right{text-align:end}@media screen and (min-width: 360px){.text-xxs-center{text-align:center}.text-xxs-left{text-align:start}.text-xxs-right{text-align:end}}@media screen and (min-width: 400px){.text-xs-center{text-align:center}.text-xs-left{text-align:start}.text-xs-right{text-align:end}}@media screen and (min-width: 600px){.text-s-center{text-align:center}.text-s-left{text-align:start}.text-s-right{text-align:end}}@media screen and (min-width: 880px){.text-m-center{text-align:center}.text-m-left{text-align:start}.text-m-right{text-align:end}}@media screen and (min-width: 1000px){.text-l-center{text-align:center}.text-l-left{text-align:start}.text-l-right{text-align:end}}@media screen and (min-width: 1100px){.text-xl-center{text-align:center}.text-xl-left{text-align:start}.text-xl-right{text-align:end}}.text-bigger{font-size:1.1em}.text-large{font-size:1.6666em}.no-color{color:inherit}.break-text{white-space:normal;word-wrap:break-word;overflow-wrap:break-word}.text-limit-lines-1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-limit-lines-2{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.header-group{margin:16px 0}.header-group h1,.header-group h2,.header-group h3,.header-group h4,.header-group h5,.header-group h6{margin:0}span.sep{color:#bbb;padding:0 6px}.list>*{display:block}.svg-icon{width:1em;height:1em;display:inline-block;position:relative;bottom:-0.105em;margin-inline-end:6px;pointer-events:none;fill:currentColor}.primary-background{background-color:var(--color-primary) !important}.primary-background-light{background-color:var(--color-primary-light)}html.dark-mode .primary-background-light{background:#000}html.dark-mode .primary-background-light .text-link{color:#aaa !important}.link-background{background-color:var(--color-link) !important}.text-pos,.text-pos:hover,.text-pos-hover:hover{color:var(--color-positive) !important;fill:var(--color-positive) !important}.text-warn,.text-warn:hover,.text-warn-hover:hover{color:var(--color-warning) !important;fill:var(--color-warning) !important}.text-neg,.text-neg:hover,.text-neg-hover:hover{color:var(--color-negative) !important;fill:var(--color-negative) !important}.text-primary,.text-primary:hover,.text-primary-hover:hover{color:var(--color-primary) !important;fill:var(--color-primary) !important}.text-link,.text-link:hover,.text-link-hover:hover{color:var(--color-link) !important;fill:var(--color-link) !important}.text-muted{color:#575757 !important;fill:currentColor !important}html.dark-mode .text-muted{color:#888 !important}.text-dark{color:#222 !important;fill:currentColor !important}html.dark-mode .text-dark{color:#ccc !important}.text-white{color:#fff;fill:currentColor !important}.text-bookshelf,.text-bookshelf:hover{color:var(--color-bookshelf);fill:var(--color-bookshelf)}.text-book,.text-book:hover{color:var(--color-book);fill:var(--color-book)}.text-page,.text-page:hover{color:var(--color-page);fill:var(--color-page)}.text-page.draft,.text-page.draft:hover{color:var(--color-page-draft);fill:var(--color-page-draft)}.text-chapter,.text-chapter:hover{color:var(--color-chapter);fill:var(--color-chapter)}.bg-white{background-color:#fff}.bg-book{background-color:var(--color-book)}.bg-chapter{background-color:var(--color-chapter)}.bg-bookshelf{background-color:var(--color-bookshelf)}.container{max-width:1400px;margin-inline-start:auto;margin-inline-end:auto;padding-inline-start:16px;padding-inline-end:16px}.container.medium{max-width:1100px}.container.small{max-width:840px}.container.very-small{max-width:480px}.grid{display:grid;grid-column-gap:24px;grid-row-gap:24px}.grid>*{min-width:0}.grid.half{grid-template-columns:1fr 1fr}.grid.third{grid-template-columns:1fr 1fr 1fr}.grid.left-focus{grid-template-columns:2fr 1fr}.grid.right-focus{grid-template-columns:1fr 3fr}.grid.gap-y-xs{grid-row-gap:6px}.grid.gap-xl{grid-column-gap:32px;grid-row-gap:32px}.grid.gap-xxl{grid-column-gap:48px;grid-row-gap:48px}.grid.v-center{align-items:center}.grid.v-end{align-items:end}.grid.no-gap{grid-row-gap:0;grid-column-gap:0}.grid.no-row-gap{grid-row-gap:0}@media screen and (max-width: 880px){.grid.third:not(.no-break){grid-template-columns:1fr 1fr}.grid.half:not(.no-break),.grid.left-focus:not(.no-break),.grid.right-focus:not(.no-break){grid-template-columns:1fr}.grid.half.collapse-xs{grid-template-columns:1fr 1fr}.grid.gap-xl{grid-column-gap:16px;grid-row-gap:16px}.grid.right-focus.reverse-collapse>*:nth-child(2){order:0}.grid.right-focus.reverse-collapse>*:nth-child(1){order:1}}@media screen and (max-width: 600px){.grid.third:not(.no-break){grid-template-columns:1fr}}@media screen and (max-width: 400px){.grid.half.collapse-xs{grid-template-columns:1fr}}#content{flex:1 0 auto}body.flexbox{display:flex;flex-direction:column;align-items:stretch;height:100%;min-height:100%;max-height:100%;overflow:hidden}body.flexbox #content{flex:1;display:flex;min-height:0}.flex-fill{display:flex;align-items:stretch;min-height:0;max-width:100%;position:relative}.flex-container-row{display:flex;flex-direction:row}.flex-container-row.v-center{align-items:center}.flex-container-column{display:flex;flex-direction:column}.flex-container-row.inline,.flex-container-column.inline{display:inline-flex !important}.flex-container-column.wrap,.flex-container-row.wrap{flex-wrap:wrap}.flex{min-height:0;flex:1;max-width:100%}.flex.fit-content{flex-basis:auto;flex-grow:0}.flex.fill-area{flex-grow:1;flex-shrink:0;min-width:fit-content}.flex-2{min-height:0;flex:2;max-width:100%}.flex-3{min-height:0;flex:3;max-width:100%}.flex-none{flex:none}.justify-flex-start{justify-content:flex-start}.justify-flex-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-space-between{justify-content:space-between}.items-center{align-items:center}.items-stretch{align-items:stretch}.min-width-xxxxs{min-width:60px}.min-width-xxxs{min-width:80px}.min-width-xxs{min-width:100px}.min-width-xs{min-width:120px}.min-width-s{min-width:160px}.min-width-m{min-width:200px}.min-width-l{min-width:240px}.min-width-xl{min-width:280px}.min-width-xxl{min-width:320px}.block{display:block !important;position:relative}.inline{display:inline !important}.block.inline{display:inline-block !important}.relative{position:relative}.fixed{position:fixed;z-index:20}.fixed.top-right{top:0;right:0}.hidden{display:none !important}.overflow-hidden{overflow:hidden}.height-fill{height:100%}.height-auto{height:auto !important}.float{float:left}.float.right{float:right}.sticky-top-m{position:sticky;top:16px}@media screen and (max-width: 360px){.hide-under-xxs{display:none !important}}@media screen and (min-width: 360px){.hide-over-xxs{display:none !important}}@media screen and (max-width: 400px){.hide-under-xs{display:none !important}}@media screen and (min-width: 400px){.hide-over-xs{display:none !important}}@media screen and (max-width: 600px){.hide-under-s{display:none !important}}@media screen and (min-width: 600px){.hide-over-s{display:none !important}}@media screen and (max-width: 880px){.hide-under-m{display:none !important}}@media screen and (min-width: 880px){.hide-over-m{display:none !important}}@media screen and (max-width: 1000px){.hide-under-l{display:none !important}}@media screen and (min-width: 1000px){.hide-over-l{display:none !important}}@media screen and (max-width: 1100px){.hide-under-xl{display:none !important}}@media screen and (min-width: 1100px){.hide-over-xl{display:none !important}}[hidden]{display:none !important}.screen-reader-only{position:absolute;inset-inline-start:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.rounded{border-radius:4px}.dual-column-content{columns:2}@media screen and (max-width: 880px){.dual-column-content{columns:1}}.clearfix::before,.clearfix::after{content:" ";display:table}.clearfix::after{clear:both}.tri-layout-container{display:grid;margin-inline-start:32px;margin-inline-end:32px;grid-template-columns:1fr 4fr 1fr;grid-template-areas:"a b c";grid-column-gap:32px;position:relative}.tri-layout-sides{grid-column-start:a;grid-column-end:c;grid-row:1;min-width:0;z-index:4}.tri-layout-sides-content{display:grid;grid-template-areas:"a b c";grid-template-columns:1fr 4fr 1fr;height:100%}.tri-layout-middle{grid-area:b;padding-top:16px;min-width:0;z-index:5}.tri-layout-right{grid-area:c;min-width:0}.tri-layout-left{grid-area:a;min-width:0}@media screen and (min-width: 1400px){.tri-layout-left-contents,.tri-layout-right-contents{padding:32px 16px;position:sticky;top:0;max-height:100vh;min-height:50vh;overflow-y:scroll;overflow-x:hidden;height:100%;scrollbar-width:none;-ms-overflow-style:none}.tri-layout-left-contents::-webkit-scrollbar,.tri-layout-right-contents::-webkit-scrollbar{display:none}.tri-layout-middle-contents{max-width:940px;margin:0 auto}}@media screen and (min-width: 1400px)and (max-width: 1700px){.tri-layout-sides-content,.tri-layout-container{grid-template-columns:1fr 972px 1fr}.tri-layout-container{grid-column-gap:12px;margin-inline-start:16px;margin-inline-end:16px}}@media screen and (max-width: 1400px){.tri-layout-container{grid-template-areas:"a b b";grid-template-columns:1fr 3fr;grid-template-rows:min-content min-content 1fr;padding-inline-end:24px}.tri-layout-sides{grid-column-start:a;grid-column-end:a}.tri-layout-sides-content{display:block}}@media screen and (min-width: 1000px)and (max-width: 1400px){.tri-layout-sides-content{position:sticky;top:0;max-height:100vh;min-height:50vh;overflow-y:scroll;overflow-x:hidden;height:100%;scrollbar-width:none;-ms-overflow-style:none}.tri-layout-sides-content::-webkit-scrollbar{display:none}}@media screen and (min-width: 1000px){.tri-layout-mobile-tabs{display:none}.tri-layout-left-contents>*,.tri-layout-right-contents>*{opacity:.6;transition:opacity ease-in-out 120ms}html.dark-mode .tri-layout-left-contents>*,html.dark-mode .tri-layout-right-contents>*{opacity:.75}.tri-layout-left-contents>*:hover,.tri-layout-left-contents>*:focus-within,.tri-layout-right-contents>*:hover,.tri-layout-right-contents>*:focus-within{opacity:1 !important}}@media screen and (min-width: 1000px)and (prefers-contrast: more){.tri-layout-left-contents>*,.tri-layout-right-contents>*{opacity:1 !important}}@media screen and (max-width: 1000px){.tri-layout-container{grid-template-areas:none;grid-template-columns:1fr;grid-column-gap:0;padding-inline-end:6px;padding-inline-start:6px}.tri-layout-container .tri-layout-sides{padding-inline-start:16px;padding-inline-end:16px;grid-column:1/1}.tri-layout-container .tri-layout-left>*,.tri-layout-container .tri-layout-right>*{display:none;pointer-events:none}.tri-layout-container .tri-layout-left,.tri-layout-container .tri-layout-right{padding-top:0 !important}.tri-layout-container .tri-layout-middle{grid-area:none;grid-row:3;grid-column:1/1;z-index:1;overflow:hidden;transition:transform ease-in-out 240ms}.tri-layout-container .tri-layout-left{grid-row:2}.tri-layout-container.show-info{overflow:hidden}.tri-layout-container.show-info .tri-layout-middle{display:none}.tri-layout-container.show-info .tri-layout-right>*,.tri-layout-container.show-info .tri-layout-left>*{display:block;pointer-events:auto}}@media screen and (max-width: 880px){.tri-layout-container{margin-inline-start:0;margin-inline-end:0}}.card{background-color:#fff;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);border-radius:3px;break-inside:avoid}html.dark-mode .card{background-color:#222}.card .body,.card p.empty-text{padding-block:16px}.card a,.card p{word-wrap:break-word;word-break:break-word}.card-title{padding:16px 16px 6px;margin:0;font-size:14px;color:#222;fill:#222;font-weight:400}.card-title a{line-height:1}.card-footer-link,button.card-footer-link{display:block;padding:12px 16px;line-height:1;border-top:1px solid;width:100%;text-align:left;border-color:#ddd;border-radius:0 0 3px 3px;font-size:.9em;margin-top:6px}html.dark-mode .card-footer-link,html.dark-mode button.card-footer-link{border-color:#555}.card-footer-link:hover,button.card-footer-link:hover{text-decoration:none;background-color:#f2f2f2}html.dark-mode .card-footer-link:hover,html.dark-mode button.card-footer-link:hover{background-color:#2d2d2d}.card-footer-link:focus,button.card-footer-link:focus{background-color:#eee;outline:1px dotted #666;outline-offset:-2px}html.dark-mode .card-footer-link:focus,html.dark-mode button.card-footer-link:focus{background-color:#222}.card.border-card{border:1px solid;border-color:#ddd}html.dark-mode .card.border-card{border-color:#000}.card.drag-card{border:1px solid #ddd;border-color:#ddd;background-color:#fff;border-radius:4px;display:flex;padding:0 0 0 40px;margin:12px 0;position:relative}html.dark-mode .card.drag-card{border-color:#000}html.dark-mode .card.drag-card{background-color:#333}.card.drag-card .drag-card-action{cursor:pointer}.card.drag-card .handle,.card.drag-card .drag-card-action{display:flex;align-items:center;text-align:center;justify-content:center;width:28px;flex-grow:0;padding:0 6px}.card.drag-card .handle:hover,.card.drag-card .drag-card-action:hover{background-color:#eee}html.dark-mode .card.drag-card .handle:hover,html.dark-mode .card.drag-card .drag-card-action:hover{background-color:#2d2d2d}.card.drag-card .handle .svg-icon,.card.drag-card .drag-card-action .svg-icon{margin-inline-end:0px}.card.drag-card .outline input{margin:12px 0;width:100%}.card.drag-card .outline{position:relative}.card.drag-card .handle{background-color:#eee;left:0;position:absolute;top:0;bottom:0}html.dark-mode .card.drag-card .handle{background-color:#2d2d2d}.card.drag-card>div{padding:0 12px;max-width:80%;flex:1}.grid-card{display:flex;flex-direction:column;border:1px solid #ddd;border-color:#ddd;margin-bottom:24px;border-radius:4px;overflow:hidden;min-width:100px;color:#444;transition:border-color ease-in-out 120ms,box-shadow ease-in-out 120ms}html.dark-mode .grid-card{border-color:#000}.grid-card:hover{color:#444;text-decoration:none;box-shadow:0 1px 6px -1px rgba(0,0,0,.1)}html.dark-mode .grid-card:hover{box-shadow:0 1px 6px -1px rgba(0,0,0,.5)}.grid-card h2{width:100%;font-size:1.5em;margin:0 0 10px}.grid-card p{font-size:.7rem;margin:0;line-height:1.6em}.grid-card .grid-card-content{flex:1;border-top:0;border-bottom-width:2px}.grid-card .grid-card-content,.grid-card .grid-card-footer{padding:24px}.grid-card .grid-card-content+.grid-card-footer{padding-top:0}.book-grid-item .grid-card-footer p.small{font-size:.8em;margin:0}.content-wrap.card{padding:16px 48px;margin-inline-start:auto;margin-inline-end:auto;margin-bottom:24px;overflow:initial;min-height:60vh;border-radius:8px}.content-wrap.card.auto-height{min-height:0}.content-wrap.card.fill-width{width:100%}@media screen and (max-width: 1400px){.content-wrap.card{padding:16px 32px}}@media screen and (max-width: 880px){.content-wrap.card{padding:16px 24px}}@media screen and (max-width: 600px){.content-wrap.card{padding:16px 16px}}.sub-card{box-shadow:0 1px 3px 0 rgba(0,0,0,.1);border:1.5px solid;border-color:#e2e2e2;border-radius:4px}html.dark-mode .sub-card{border-color:#444}.outline-hover{border:1px solid rgba(0,0,0,0) !important}.outline-hover:hover{border:1px solid rgba(0,0,0,.1) !important}.fade-in-when-active{opacity:.6;transition:opacity ease-in-out 120ms}html.dark-mode .fade-in-when-active{opacity:.7}.fade-in-when-active:hover,.fade-in-when-active:focus-within{opacity:1 !important}@media(prefers-contrast: more){.fade-in-when-active{opacity:1 !important}}.tag-item{display:inline-flex;margin-bottom:6px;margin-inline-end:6px;border-radius:4px;border:1px solid;overflow:hidden;font-size:.85em;border-color:#ccc}html.dark-mode .tag-item{border-color:#666}.tag-item a,.tag-item span,.tag-item a:hover,.tag-item a:active{padding:4px 8px;color:rgba(0,0,0,.7);transition:background-color ease-in-out 80ms;text-decoration:none}html.dark-mode .tag-item a,html.dark-mode .tag-item span,html.dark-mode .tag-item a:hover,html.dark-mode .tag-item a:active{color:rgba(255,255,255,.8)}.tag-item a:hover{background-color:rgba(255,255,255,.7)}html.dark-mode .tag-item a:hover{background-color:rgba(255,255,255,.3)}.tag-item svg{fill:rgba(0,0,0,.5)}html.dark-mode .tag-item svg{fill:rgba(255,255,255,.5)}.tag-item .tag-value{border-inline-start:1px solid;border-color:#ddd;background-color:rgba(255,255,255,.5)}html.dark-mode .tag-item .tag-value{border-color:#666}html.dark-mode .tag-item .tag-value{background-color:rgba(255,255,255,.2)}.tag-name.highlight,.tag-value.highlight{font-weight:bold}.tag-list div:last-child .tag-item{margin-bottom:0}.item-list-row .tag-item{margin-bottom:0}.api-method{font-size:.75rem;background-color:#888;padding:6px;line-height:1.3;opacity:.7;vertical-align:top;border-radius:3px;color:#fff;display:inline-block;min-width:60px;text-align:center;font-weight:bold}.api-method[data-method=GET]{background-color:#077b70}.api-method[data-method=POST]{background-color:#cf4d03}.api-method[data-method=PUT]{background-color:#0288d1}.api-method[data-method=DELETE]{background-color:#ab0f0e}.sticky-sidebar{position:sticky;top:16px;max-height:calc(100vh - 16px);overflow-y:auto}button{background-color:rgba(0,0,0,0);border:0;font-size:100%}.button{text-decoration:none;font-size:.85rem;line-height:1.4em;padding:7.8px 16px;margin-top:6px;margin-bottom:6px;display:inline-block;font-weight:400;outline:0;border-radius:4px;cursor:pointer;transition:background-color ease-in-out 120ms,filter ease-in-out 120ms,box-shadow ease-in-out 120ms;box-shadow:none;background-color:var(--color-primary);color:#fff;border:1px solid var(--color-primary);vertical-align:top}.button:hover,.button:focus,.button:active{background-color:var(--color-primary);text-decoration:none;color:#fff}.button:hover{box-shadow:0 0 4px 1px #ccc;filter:brightness(110%)}html.dark-mode .button:hover{box-shadow:0 0 4px 1px rgba(0,0,0,.5)}.button:focus{outline:1px dotted currentColor;outline-offset:-6px;box-shadow:none;filter:brightness(90%)}.button:active{outline:0}.button.outline{background-color:rgba(0,0,0,0);color:#666;fill:currentColor;border:1px solid;border-color:#ccc}html.dark-mode .button.outline{color:#aaa}html.dark-mode .button.outline{border-color:#666}.button.outline:hover,.button.outline:focus,.button.outline:active{color:#444;border:1px solid #ccc;box-shadow:0 1px 4px 0 rgba(0,0,0,.1);background-color:#f2f2f2;background-color:#f8f8f8;filter:none}html.dark-mode .button.outline:hover,html.dark-mode .button.outline:focus,html.dark-mode .button.outline:active{color:#bbb}html.dark-mode .button.outline:hover,html.dark-mode .button.outline:focus,html.dark-mode .button.outline:active{background-color:#444}.button.outline:active{border-color:#bbb;background-color:#ddd;color:#666;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.button+.button{margin-inline-start:12px}.button.small{font-size:.75rem;padding:7.2px 12px}.text-button{cursor:pointer;background-color:rgba(0,0,0,0);padding:0;margin:0;border:none;user-select:none;font-size:.75rem;line-height:1.4em;color:var(--color-link)}.text-button:active{outline:0}.text-button:hover{text-decoration:none}.text-button:hover,.text-button:focus{color:var(--color-link);fill:var(--color-link)}.text-button.hover-underline:hover{text-decoration:underline}.button.block{width:100%;text-align:start;display:block}.button.icon .svg-icon,.icon-button .svg-icon,.text-button.icon .svg-icon{margin-inline-end:0}.icon-button{text-align:center;border:1px solid rgba(0,0,0,0)}.icon-button:hover{background-color:rgba(0,0,0,.05);border-radius:4px;border-color:#ddd;cursor:pointer}html.dark-mode .icon-button:hover{border-color:#444}.button.svg{display:flex;align-items:center;padding:12px 16px;padding-bottom:10px;width:100%}.button.svg svg{display:inline-block;width:24px;height:24px;bottom:auto;margin-inline-end:16px}.button[disabled]{background-color:#bbb;cursor:default;border-color:#ccc}.button[disabled]:hover{background-color:#bbb;cursor:default;box-shadow:none}table{min-width:100px;max-width:100%}table thead{background-color:#f8f8f8;font-weight:500}html.dark-mode table thead{background-color:#333}table td,table th{min-width:10px;padding:6px 8px;border:1px solid #ddd;overflow:auto;line-height:1.2;word-break:break-word;vertical-align:top}table td p,table th p{margin:0}table.table{width:100%}table.table tr td,table.table tr th{border-bottom:1px solid rgba(0,0,0,.05)}table.table th,table.table td{text-align:start;border:none;padding:12px 12px;vertical-align:middle;margin:0;overflow:visible}table.table th{font-weight:bold}table.table tr:hover{background-color:#f2f2f2}html.dark-mode table.table tr:hover{background-color:#333}table.table .text-right{text-align:end}table.table .text-center{text-align:center}table.table td.actions{overflow:visible}table.table a{display:inline-block}table.table.expand-to-padding{margin-left:-12px;margin-right:-12px;width:calc(100% + 2*12px);max-width:calc(100% + 2*12px)}table.no-style td{border:0;padding:0}table.list-table{margin:0 -6px}table.list-table td{border:0;vertical-align:middle;padding:6px}.input-base,input[type=text],input[type=number],input[type=email],input[type=date],input[type=search],input[type=url],input[type=color],input[type=password],select,textarea,.fake-input{border-radius:3px;border:1px solid #d4d4d4;background-color:#fff;border-color:#d4d4d4;color:#666;display:inline-block;font-size:14px;padding:10.8px;height:40px;width:250px;max-width:100%}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{background-color:#333}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{border-color:#111}html.dark-mode .input-base,html.dark-mode input[type=text],html.dark-mode input[type=number],html.dark-mode input[type=email],html.dark-mode input[type=date],html.dark-mode input[type=search],html.dark-mode input[type=url],html.dark-mode input[type=color],html.dark-mode input[type=password],html.dark-mode select,html.dark-mode textarea,html.dark-mode .fake-input{color:#aaa}.input-base.neg,input.neg[type=text],input.neg[type=number],input.neg[type=email],input.neg[type=date],input.neg[type=search],input.neg[type=url],input.neg[type=color],input.neg[type=password],select.neg,textarea.neg,.neg.fake-input,.input-base.invalid,input.invalid[type=text],input.invalid[type=number],input.invalid[type=email],input.invalid[type=date],input.invalid[type=search],input.invalid[type=url],input.invalid[type=color],input.invalid[type=password],select.invalid,textarea.invalid,.invalid.fake-input{border:1px solid var(--color-negative)}.input-base.pos,input.pos[type=text],input.pos[type=number],input.pos[type=email],input.pos[type=date],input.pos[type=search],input.pos[type=url],input.pos[type=color],input.pos[type=password],select.pos,textarea.pos,.pos.fake-input,.input-base.valid,input.valid[type=text],input.valid[type=number],input.valid[type=email],input.valid[type=date],input.valid[type=search],input.valid[type=url],input.valid[type=color],input.valid[type=password],select.valid,textarea.valid,.valid.fake-input{border:1px solid var(--color-positive)}.input-base.disabled,input.disabled[type=text],input.disabled[type=number],input.disabled[type=email],input.disabled[type=date],input.disabled[type=search],input.disabled[type=url],input.disabled[type=color],input.disabled[type=password],select.disabled,textarea.disabled,.disabled.fake-input,.input-base[disabled],input[disabled][type=text],input[disabled][type=number],input[disabled][type=email],input[disabled][type=date],input[disabled][type=search],input[disabled][type=url],input[disabled][type=color],input[disabled][type=password],select[disabled],textarea[disabled],[disabled].fake-input{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAMUlEQVQIW2NkwAGuXbv2nxGbHEhCS0uLEUMSJgHShCKJLIEiiS4Bl8QmAZbEJQGSBAC62BuJ+tt7zgAAAABJRU5ErkJggg==)}.input-base[readonly],input[readonly][type=text],input[readonly][type=number],input[readonly][type=email],input[readonly][type=date],input[readonly][type=search],input[readonly][type=url],input[readonly][type=color],input[readonly][type=password],select[readonly],textarea[readonly],[readonly].fake-input{background-color:#f8f8f8}.input-base:focus,input[type=text]:focus,input[type=number]:focus,input[type=email]:focus,input[type=date]:focus,input[type=search]:focus,input[type=url]:focus,input[type=color]:focus,input[type=password]:focus,select:focus,textarea:focus,.fake-input:focus{border-color:var(--color-primary);outline:1px solid var(--color-primary)}.input-fill-width{width:100% !important}.fake-input{overflow:auto}#html-editor{display:none}#markdown-editor{position:relative;z-index:5}#markdown-editor #markdown-editor-input{font-style:normal;font-weight:400;padding:6px 16px;color:#444;border-radius:0;max-height:100%;flex:1;border:0;width:100%}#markdown-editor #markdown-editor-input:focus{outline:0}#markdown-editor.fullscreen{position:fixed;top:0;left:0;height:100%;z-index:2}.markdown-editor-wrap{border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-color:#ddd;position:relative;flex:1;min-width:0}html.dark-mode .markdown-editor-wrap{border-color:#000}.markdown-editor-wrap+.markdown-editor-wrap{flex-basis:50%;flex-shrink:0;flex-grow:0}.markdown-editor-wrap .cm-editor{flex:1;max-width:100%;border:0;margin:0}.markdown-panel-divider{width:2px;background-color:#ddd;cursor:col-resize}html.dark-mode .markdown-panel-divider{background-color:#000}@media screen and (max-width: 880px){#markdown-editor{flex-direction:column}#markdown-editor .markdown-editor-wrap{width:100%;max-width:100%;flex-grow:1;flex-basis:auto !important;min-height:0}.editor-toolbar-label{float:none !important;border-color:#ddd;display:block}html.dark-mode .editor-toolbar-label{border-color:#555}.markdown-editor-wrap:not(.active) .editor-toolbar+div,.markdown-editor-wrap:not(.active) .editor-toolbar .buttons,.markdown-editor-wrap:not(.active) .markdown-display{display:none}#markdown-editor .markdown-editor-wrap:not(.active){flex-grow:0;flex:none}}.markdown-editor-display{background-color:#fff}.markdown-editor-display body{display:block;background-color:#fff;padding-inline-start:12px;padding-inline-end:12px;max-width:864px}.markdown-editor-display [drawio-diagram]:hover{outline:2px solid var(--color-primary)}html.markdown-editor-display.dark-mode{background-color:#222}html.markdown-editor-display.dark-mode body{background-color:#222}.editor-toolbar{height:32px;width:100%;font-size:11px;line-height:1.6;border-bottom:1px solid #ccc;background-color:#fff;border-color:#ccc;flex:none}html.dark-mode .editor-toolbar{background-color:#333}html.dark-mode .editor-toolbar{border-color:#000}html.dark-mode .editor-toolbar button{color:#aaa}.editor-toolbar .buttons{font-size:14px}.editor-toolbar .buttons .dropdown-menu{padding:0}.editor-toolbar .buttons .toggle-switch{margin:12px 0}.editor-toolbar .buttons button{font-size:.9rem;width:2rem;text-align:center;border-left:1px solid;border-color:#ddd}html.dark-mode .editor-toolbar .buttons button{border-color:#555}.editor-toolbar .buttons button svg{margin-inline-end:0}.editor-toolbar .buttons button:hover{background-color:#ddd}html.dark-mode .editor-toolbar .buttons button:hover{background-color:#222}label{color:#666;display:block;line-height:1.4em;font-size:.94em;font-weight:400;padding-bottom:2px;margin-bottom:.2em}html.dark-mode label{color:#ddd}label.inline{display:inline-block}label.radio,label.checkbox{font-weight:400;user-select:none}label.radio input[type=radio],label.radio input[type=checkbox],label.checkbox input[type=radio],label.checkbox input[type=checkbox]{margin-inline-end:6px}label.inline.checkbox{margin-inline-end:16px}label+p.small{margin-bottom:.8em}table.form-table{max-width:100%}table.form-table td{overflow:hidden;padding:1.5px 0}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:url("data:image/svg+xml;utf8,");background-size:10px 12px;background-position:calc(100% - 20px) 64%;background-repeat:no-repeat}html[dir=rtl] select{background-position:20px 70%}input[type=date]{width:190px}input[type=color]{height:60px}input[type=color].small{height:42px;width:60px;padding:2px}.toggle-switch{user-select:none;display:inline-grid;grid-template-columns:28px 1fr;align-items:center;margin:16px 0}.toggle-switch .custom-checkbox{width:16px;height:16px;border-radius:2px;display:inline-block;border:2px solid currentColor;overflow:hidden;fill:currentColor}.toggle-switch .custom-checkbox .svg-icon{width:100%;height:100%;margin:0;bottom:auto;top:-1.5px;left:0;transition:transform ease-in-out 120ms;transform:scale(0);transform-origin:center center}.toggle-switch input[type=checkbox]{display:none}.toggle-switch input[type=checkbox]:checked+.custom-checkbox .svg-icon{transform:scale(1)}.toggle-switch .custom-checkbox:hover{background-color:rgba(0,0,0,.05);opacity:.8}.toggle-switch input[type=checkbox][disabled]~*{opacity:.8;cursor:not-allowed}.toggle-switch input[type=checkbox][disabled]~.custom-checkbox{border-color:#999;color:#999 !important;background:#f2f2f2}.toggle-switch-list .toggle-switch{margin:6px 0}.toggle-switch-list.compact .toggle-switch{margin:1px 0}.form-group{margin-bottom:12px}.setting-list>div{border-bottom:1px solid #ddd;padding:32px 0}.setting-list>div:last-child{border-bottom:none}.setting-list-label{color:#222;color:#222;font-size:1rem}html.dark-mode .setting-list-label{color:#ddd}.setting-list-label+p.small{margin-bottom:0}.setting-list-label+.grid{margin-top:16px}.setting-list .grid input[type=text],.setting-list .grid input[type=email],.setting-list .grid input[type=password],.setting-list .grid select,.stretch-inputs input[type=text],.stretch-inputs input[type=email],.stretch-inputs input[type=password],.stretch-inputs select{width:100%}.simple-code-input{background-color:#f8f8f8;font-family:monospace;font-size:12px;min-height:100px;display:block;width:100%}.form-group div.text-pos,.form-group div.text-neg,.form-group p.text-post,.form-group p.text-neg{padding:6px 0}.form-group.collapsible{padding:0 16px;border:1px solid;border-color:#ddd;border-radius:4px}html.dark-mode .form-group.collapsible{border-color:#000}.form-group.collapsible .collapse-title{margin-inline-start:-16px;margin-inline-end:-16px;padding:12px 16px;display:block;width:calc(100% + 32px);text-align:start}.form-group.collapsible .collapse-title,.form-group.collapsible .collapse-title label{cursor:pointer}.form-group.collapsible .collapse-title label{padding-bottom:0;margin-bottom:0;color:inherit}.form-group.collapsible .collapse-title label:before{display:inline-block;content:"▸";margin-inline-end:16px;transition:all ease-in-out 400ms;transform:rotate(0)}.form-group.collapsible .collapse-content{display:none;padding-bottom:16px}.form-group.collapsible.open .collapse-title label:before{transform:rotate(90deg)}.form-group.ambrosia-container,.form-group.ambrosia-container *{position:absolute !important;height:1px !important;width:1px !important;margin:-1px !important;padding:0 !important;background:rgba(0,0,0,0) !important;color:rgba(0,0,0,0) !important;border:none !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important}.title-input input[type=text]{display:block;width:100%;padding:12px;margin-top:0;font-size:2em;height:auto}.description-input textarea{display:block;width:100%;padding:12px;font-size:14px;color:#666;height:auto}.description-input>.tox-tinymce{border:1px solid #ddd !important;border-color:#ddd !important;border-radius:3px}html.dark-mode .description-input>.tox-tinymce{border-color:#000 !important}.description-input>.tox-tinymce .tox-toolbar__primary{justify-content:end}.search-box{max-width:100%;position:relative}.search-box button[tabindex="-1"]{background-color:rgba(0,0,0,0);border:none;color:#666;padding:0;cursor:pointer;position:absolute;left:8px;top:9px}html.dark-mode .search-box button[tabindex="-1"]{color:#aaa}html[dir=rtl] .search-box button[tabindex="-1"]{right:8px;left:auto}.search-box input{display:block;padding:9px;padding-inline-start:28px;width:300px;max-width:100%;height:auto}.search-box.flexible input{width:100%}.search-box button.search-box-cancel{left:auto;right:0}.contained-search-box{display:flex;height:38px;z-index:-1}.contained-search-box.floating{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);border-radius:4px;overflow:hidden}html.dark-mode .contained-search-box.floating{border:1px solid #000}.contained-search-box input,.contained-search-box button{height:100%;border-radius:0;border:1px solid #ddd;border-color:#ddd;margin-inline-start:-1px}html.dark-mode .contained-search-box input,html.dark-mode .contained-search-box button{border-color:#000}.contained-search-box input:last-child,.contained-search-box button:last-child{border-inline-end:0}.contained-search-box input{border:0;flex:5;padding:6px 12px}.contained-search-box input:focus,.contained-search-box input:active{outline:1px dotted var(--color-primary);outline-offset:-2px;border:0}.contained-search-box button{border:0;width:48px;border-inline-start:1px solid #ddd;background-color:#fff;background-color:#fff;color:#444}html.dark-mode .contained-search-box button{background-color:#333}html.dark-mode .contained-search-box button{color:#aaa}.contained-search-box button:focus{outline:1px dotted var(--color-primary);outline-offset:-2px}.contained-search-box svg{margin:0}@media screen and (max-width: 600px){.contained-search-box{width:180px}}.outline>input{border:0;border-bottom:2px solid #ddd;border-radius:0}.outline>input:focus,.outline>input:active{border:0;border-bottom:2px solid #aaa;outline:0}.image-picker img{background-color:#bbb;max-width:100%}.custom-file-input{overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;height:1px;border:0;clip:rect(0, 0, 0, 0)}.custom-file-input:focus+label{border-color:var(--color-primary);outline:1px solid var(--color-primary)}input.shortcut-input{width:auto;max-width:120px;height:auto}.anim.fadeIn{opacity:0;animation-name:fadeIn;animation-duration:120ms;animation-timing-function:ease-in-out;animation-fill-mode:forwards}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.search-suggestions-animation{animation-name:searchSuggestions;animation-duration:120ms;animation-fill-mode:forwards;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99)}@keyframes searchSuggestions{0%{opacity:.5;transform:scale(0.9)}100%{opacity:1;transform:scale(1)}}@keyframes loadingBob{0%{transform:translate3d(0, 0, 0)}30%{transform:translate3d(0, 0, 0)}50%{transform:translate3d(0, -10px, 0)}70%{transform:translate3d(0, 0, 0)}100%{transform:translate3d(0, 0, 0)}}@keyframes pointer{0%{transform:translate3d(0, 20px, 0) scale3d(0, 0, 0)}100%{transform:translate3d(0, 0, 0) scale3d(1, 1, 1)}}.anim.pointer{transform-origin:50% 100%;animation-name:pointer;animation-duration:180ms;animation-delay:0s;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99)}.tox.tox-fullscreen{position:fixed;top:0;height:100%;width:100%;max-width:100%;z-index:100}.tox.tox-tinymce{border-inline:0;border-bottom:0}.page-content.mce-content-body{padding-block-start:1rem;padding-block-end:1rem;outline:0;display:block;max-width:870px}.wysiwyg-input.mce-content-body{padding-block-start:1rem;padding-block-end:1rem;outline:0;display:block}.wysiwyg-input.mce-content-body:before{padding:1rem;top:4px;font-style:italic;color:rgba(34,47,62,.5)}html.dark-mode .wysiwyg-input.mce-content-body:before{color:rgba(155,155,155,.5)}.page-content.mce-content-body doc-root{display:block}.page-content.mce-content-body code-block{display:block}body.page-content.mce-content-body{padding-bottom:5rem}.tox .tox-pop__dialog .tox-toolbar{background:rgba(0,0,0,0) !important}.tox-toolbar__primary{justify-content:center}.page-content.mce-content-body code-block>*{pointer-events:none}.page-content.mce-content-body code-block pre{display:none}.page-content.mce-content-body details summary{pointer-events:none}.page-content.mce-content-body details doc-root{padding:12px;margin-left:-10px;margin-right:-10px;margin-bottom:-10px;margin-top:-10px;overflow:hidden}.page-content.mce-content-body .mce-preview-object.align-right{float:right !important;margin:6px 0 6px 12px}.page-content.mce-content-body .mce-preview-object.align-left{float:left !important;margin:6px 16px 16px 0}.page-content.mce-content-body .mce-preview-object.align-center{display:block;margin-left:auto;margin-right:auto}.page-content.mce-content-body .mce-preview-object iframe,.page-content.mce-content-body .mce-preview-object video{display:block;margin:0 !important;float:none !important}.page-content.mce-content-body td[data-mce-selected]::after,.page-content.mce-content-body th[data-mce-selected]::after{top:1px;left:1px;bottom:1px;right:1px;outline:1px dashed #1a85ff;outline-offset:0}.dark-mode .tox .tox-toolbar__primary,.dark-mode .tox .tox-menu,.dark-mode .tox .tox-dialog__header,.dark-mode .tox .tox-dialog,.dark-mode .tox .tox-dialog__footer,.dark-mode .tox .tox-pop__dialog,.dark-mode .tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#333 !important}.dark-mode .tox .tox-tbtn svg,.dark-mode .tox .tox-tbtn,.dark-mode .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#dbdbdb;fill:#dbdbdb}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{width:6em !important}.tox-menu .tox-collection__item blockquote::before{content:none}.tox-menu .tox-collection__item blockquote{border-left:4px solid var(--color-primary) !important;padding:4px 6px !important}.tox-menu .tox-collection__item blockquote{border-left:4px solid var(--color-primary) !important;padding:4px 6px !important}.tox-menu .tox-collection__item p[style*=background-color]{padding:4px 6px !important;border-left:3px solid currentColor !important}.tox-menu .tox-collection__item[title^="<"]>div>div{font-family:var(--font-code) !important;border:1px solid #ddd !important;background-color:#eee !important;padding:4px 6px !important}.tox-menu .tox-collection__item-label{line-height:normal !important}.page-content.mce-content-body .task-list-item{margin-left:0;position:relative}.page-content.mce-content-body .task-list-item>input[type=checkbox]{display:none}.page-content.mce-content-body .task-list-item:before{content:"";display:inline-block;border:2px solid #ccc;width:12px;height:12px;border-radius:2px;margin-right:8px;vertical-align:text-top;cursor:pointer;position:absolute;left:-24px;top:4px}.page-content.mce-content-body .task-list-item[checked]:before{background-color:#ccc;background-image:url('data:image/svg+xml;utf8,');background-position:50% 50%;background-size:100% 100%}.cm-editor{font-size:12px;border:1px solid #ddd;line-height:1.4;margin-bottom:24px}.page-content .cm-editor,.CodeMirrorContainer .cm-editor{border-radius:4px}.cm-editor .cm-line,.cm-editor .cm-gutter{font-family:var(--font-code)}.dark-mode .cm-editor{border-color:#444}.cm-copy-button{position:absolute;display:flex;align-items:center;justify-content:center;top:-1px;inset-inline-end:-1px;background-color:#eee;border:1px solid #ddd;border-start-end-radius:4px;background-color:#eee;border-color:#ddd;color:#444;line-height:0;cursor:pointer;z-index:5;user-select:none;opacity:0;pointer-events:none;width:32px;height:32px;transition:background-color linear 60ms,color linear 60ms}html.dark-mode .cm-copy-button{background-color:#333}html.dark-mode .cm-copy-button{border-color:#444}html.dark-mode .cm-copy-button{color:#888}.cm-copy-button svg{fill:currentColor}.cm-copy-button.success{background:var(--color-positive);color:#fff}.cm-copy-button:focus{outline:0 !important}.cm-editor:hover .cm-copy-button{user-select:all;opacity:.6;pointer-events:all}.notification{position:fixed;top:0;right:0;margin:32px;padding:16px 24px;background-color:#fff;background-color:#fff;border-radius:4px;border-inline-start:6px solid currentColor;box-shadow:0 1px 6px 1px rgba(22,22,22,.2);z-index:999999;cursor:pointer;max-width:360px;transition:transform ease-in-out 280ms;transform:translateX(580px);display:grid;grid-template-columns:42px 1fr 12px;color:#444;font-weight:700}html.dark-mode .notification{background-color:#444}.notification span,.notification svg{vertical-align:middle;justify-self:center;align-self:center}.notification svg{width:2.8rem;height:2.8rem;padding-inline-end:12px;fill:currentColor}.notification .dismiss{margin-top:-8px}.notification .dismiss svg{height:1rem;color:#444}html.dark-mode .notification .dismiss svg{color:#888}.notification span{vertical-align:middle;line-height:1.3}html.dark-mode .notification span{color:#bbb}.notification.pos{color:var(--color-positive)}.notification.neg{color:var(--color-negative)}.notification.warning{color:var(--color-warning)}.notification.showing{transform:translateX(0)}.notification.showing:hover{transform:translate3d(0, -2px, 0)}.chapter-contents-toggle{cursor:pointer;margin:0;transition:all ease-in-out 180ms;user-select:none}.chapter-contents-toggle svg[data-icon=caret-right]{margin-inline-end:0;font-size:1rem;transition:all ease-in-out 180ms;transform:rotate(0deg);transform-origin:50% 50%}.chapter-contents-toggle.open svg[data-icon=caret-right]{transform:rotate(90deg)}.chapter-contents-toggle svg[data-icon=caret-right]+*{margin-inline-start:3px}[overlay],.popup-background{background-color:rgba(0,0,0,.333);position:fixed;z-index:95536;width:100%;height:100%;min-width:100%;min-height:100%;top:0;left:0;right:0;bottom:0;align-items:center;justify-content:center;display:none}html.dark-mode [overlay],html.dark-mode .popup-background{background-color:rgba(0,0,0,.6)}.popup-body-wrap{display:flex}.popup-body{background-color:#fff;max-height:90%;max-width:1200px;width:90%;height:auto;margin:2% auto;border-radius:4px;box-shadow:0 0 15px 0 rgba(0,0,0,.3);overflow:hidden;z-index:999;display:flex;flex-direction:column;position:relative}html.dark-mode .popup-body{background-color:#333}.popup-body.small{margin:2% auto;width:800px;max-width:90%}.popup-body.very-small{margin:2% auto;width:600px;max-width:90%}.popup-body:before{display:flex;align-self:flex-start}.popup-body .popup-content{overflow-y:auto}.popup-body:focus{outline:0}.popup-header button,.popup-footer button{margin:0;border-radius:0;box-shadow:none;color:#fff;padding:6px 16px;cursor:pointer}.popup-header button:not(.popup-header-close){font-size:.8rem}.popup-header button:hover{background-color:rgba(255,255,255,.1)}.popup-footer{justify-content:end;background-color:var(--color-primary-light);min-height:41px}.popup-footer button{padding:10px 16px}.popup-header-close{border:0;color:#fff;font-size:16px;cursor:pointer}.popup-header-close svg{margin-right:0}.popup-header,.popup-footer{display:flex;position:relative;height:40px;flex:0}.popup-header .popup-title,.popup-footer .popup-title{color:#fff;margin-inline-end:auto;padding:8px 16px}.popup-header.flex-container-row,.popup-footer.flex-container-row{display:flex !important}body.flexbox-support #entity-selector-wrap .popup-body .form-group{height:444px;min-height:444px}#entity-selector-wrap .popup-body .form-group{margin:0}.popup-body .entity-selector-container{flex:1}.dropzone-overlay{position:absolute;display:flex;justify-content:center;align-items:center;font-size:1.333rem;width:98%;height:98%;left:1%;top:1%;border-radius:4px;border:1px dashed var(--color-primary);font-style:italic;box-sizing:content-box;background-clip:padding-box;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23a9a9a9' fill-opacity='0.52' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");background-color:var(--color-primary);color:#fff;opacity:.8;z-index:9;pointer-events:none;animation:dzAnimIn 240ms ease-in-out}.dropzone-landing-area{background-color:var(--color-primary-light);padding:16px 24px;width:100%;border:1px dashed var(--color-primary);color:var(--color-primary);border-radius:4px}@keyframes dzAnimIn{0%{opacity:0;transform:scale(0.7)}60%{transform:scale(1.1)}100%{transform:scale(1);opacity:.8}}@keyframes dzFileItemIn{0%{opacity:.5;transform:translateY(28px)}100%{opacity:1;transform:translateY(0)}}@keyframes dzFileItemOut{0%{opacity:1;transform:translateY(0)}100%{opacity:.5;transform:translateY(28px)}}.dropzone-file-item{width:260px;height:80px;position:relative;display:flex;margin:1rem;flex-direction:row;background:#fff;box-shadow:0 1px 6px 1px rgba(22,22,22,.2);border-radius:4px;overflow:hidden;padding-bottom:3px;animation:dzFileItemIn ease-in-out 240ms;transition:transform ease-in-out 120ms,box-shadow ease-in-out 120ms;cursor:pointer}html.dark-mode .dropzone-file-item{background:#444}.dropzone-file-item:hover{transform:translateY(-3px);box-shadow:0 3px 8px 1px rgba(22,22,22,.2)}.dropzone-file-item.dismiss{animation:dzFileItemOut ease-in-out 240ms}.dropzone-file-item .loading-container{text-align:start !important;margin:0}.dropzone-file-item-image-wrap{width:80px;position:relative;background-color:var(--color-primary-light)}.dropzone-file-item-image-wrap img{object-fit:cover;width:100%;height:100%;opacity:.8}.dropzone-file-item-text-wrap{flex:1;display:block;padding:1rem;overflow:auto}.dropzone-file-item-progress{position:absolute;bottom:0;left:0;font-size:0;height:3px;background-color:var(--color-primary);transition:width ease-in-out 240ms}.dropzone-file-item-label{line-height:1.2;margin-bottom:.2rem}.dropzone-file-item-label,.dropzone-file-item-status{align-items:center;font-size:.8rem;font-weight:700}.dropzone-file-item-status[data-status]{display:flex;font-size:.6rem;font-weight:500;line-height:1.2}.dropzone-file-item-status[data-status=success]{color:var(--color-positive)}.dropzone-file-item-status[data-status=error]{color:var(--color-negative)}.dropzone-file-item-status[data-status]+.dropzone-file-item-label{display:none}.image-manager-body{min-height:70vh}.image-manager-filter-bar{position:sticky;top:0;z-index:5;background-color:rgba(255,255,255,.85)}html.dark-mode .image-manager-filter-bar{background-color:rgba(80,80,80,.85)}.image-manager-filter-bar-bg{position:absolute;left:0;top:0;width:100%;height:100%;opacity:.15;z-index:-1}.image-manager-filters{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);border-radius:4px;overflow:hidden;border-bottom:0 !important}html.dark-mode .image-manager-filters{border:1px solid #000 !important}.image-manager-filters button{line-height:0;background-color:#fff}html.dark-mode .image-manager-filters button{background-color:#333}.image-manager-filters svg{margin:0}.image-manager-list{padding:3px;display:grid;grid-template-columns:repeat(auto-fill, minmax(max(140px, 17%), 1fr));gap:3px;z-index:3}.image-manager-list>div{aspect-ratio:1}.image-manager-list .image{display:block;position:relative;border-radius:0;margin:0;width:100%;text-align:start;padding:0;cursor:pointer;aspect-ratio:1;border-color:#ddd;transition:all linear 80ms;overflow:hidden}html.dark-mode .image-manager-list .image{border-color:#000}.image-manager-list .image.selected{background-color:var(--color-primary-light);outline:currentColor 3px solid;border-radius:3px;transform:scale3d(0.95, 0.95, 0.95)}.image-manager-list .image img{width:100%;max-width:100%;display:block;object-fit:cover;height:auto}.image-manager-list .image .image-meta{opacity:0;position:absolute;width:100%;bottom:0;left:0;color:#eee;background-color:rgba(0,0,0,.7);font-size:10px;padding:3px 4px;pointer-events:none;transition:opacity ease-in-out 80ms}.image-manager-list .image .image-meta span{display:block}.image-manager-list .image.selected .image-meta,.image-manager-list .image:hover .image-meta,.image-manager-list .image:focus .image-meta{opacity:1}@media screen and (max-width: 880px){.image-manager-list .image .image-meta{display:none}}.image-manager .load-more{text-align:center;padding:12px 16px;clear:both}.image-manager .load-more .loading-container{margin:0}.image-manager .loading-container{text-align:center}.image-manager-list .image-manager-list-warning{grid-column:1/-1;aspect-ratio:auto}.image-manager-warning{background:#fff;color:var(--color-warning);font-weight:bold;border-inline:3px solid var(--color-warning)}html.dark-mode .image-manager-warning{background:#333}.image-manager-sidebar{width:300px;margin:0 auto;overflow-y:auto;overflow-x:hidden;border-inline-start:1px solid #ddd;border-color:#ddd}html.dark-mode .image-manager-sidebar{border-color:#000}.image-manager-sidebar .inner{min-height:auto;padding:16px}.image-manager-sidebar .image-manager-viewer img{max-width:100%;max-height:180px;display:block;margin:0 auto 16px auto;box-shadow:0 1px 21px 1px rgba(76,76,76,.3)}.image-manager-sidebar .image-manager-viewer{height:196px;display:flex;align-items:center;justify-content:center}.image-manager-sidebar .image-manager-viewer a{display:inline-block}@media screen and (max-width: 880px){.image-manager-sidebar{border-inline-start:0}}.image-manager-content{display:flex;flex-direction:column;flex:1;overflow-y:scroll}.image-manager-content .container{width:100%}.image-manager-content .full-tab{text-align:center}.tab-container.bordered [role=tablist] button[role=tab]{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd}html.dark-mode .tab-container.bordered [role=tablist] button[role=tab]{border-inline-end-color:#000}.tab-container.bordered [role=tablist] button[role=tab]:last-child{border-inline-end:none}.tab-container [role=tablist]{display:flex;align-items:end;justify-items:start;text-align:start;border-bottom:1px solid #ddd;border-color:#ddd;margin-bottom:16px}html.dark-mode .tab-container [role=tablist]{border-color:#444}.tab-container [role=tablist] button[role=tab]{display:inline-block;padding:12px;color:rgba(0,0,0,.5);cursor:pointer;border-bottom:2px solid rgba(0,0,0,0);margin-bottom:-1px}html.dark-mode .tab-container [role=tablist] button[role=tab]{color:rgba(255,255,255,.5)}.tab-container [role=tablist] button[role=tab][aria-selected=true]{color:var(--color-link) !important;border-bottom-color:var(--color-link) !important;outline:0 !important}.tab-container [role=tablist] button[role=tab]:hover,.tab-container [role=tablist] button[role=tab]:focus{color:rgba(0,0,0,.8);border-bottom-color:rgba(0,0,0,.2)}html.dark-mode .tab-container [role=tablist] button[role=tab]:hover,html.dark-mode .tab-container [role=tablist] button[role=tab]:focus{color:rgba(255,255,255,.8)}html.dark-mode .tab-container [role=tablist] button[role=tab]:hover,html.dark-mode .tab-container [role=tablist] button[role=tab]:focus{border-bottom-color:rgba(255,255,255,.2)}.tab-container [role=tablist] button[role=tab]:focus{outline:1px dotted var(--color-primary);outline-offset:-2px}.tab-container [role=tablist].controls-card{margin-bottom:0;border-bottom:0;padding:0 6px}.image-picker .none{display:none}.code-editor .CodeMirror{height:auto;min-height:50vh;border-bottom:0}.code-editor .lang-options{overflow-y:scroll;flex-basis:200px;flex-grow:1}.code-editor .lang-options button{display:block;padding:6px 16px;border-bottom:1px solid;color:#333;border-bottom-color:#eee;cursor:pointer;width:100%;text-align:left;font-family:var(--font-code);font-size:.7rem;padding-left:30px}html.dark-mode .code-editor .lang-options button{color:#aaa}html.dark-mode .code-editor .lang-options button{border-bottom-color:#000}.code-editor .lang-options button:hover,.code-editor .lang-options button.active{background-color:var(--color-primary-light);color:var(--color-primary)}.code-editor button.lang-option-favorite-toggle{position:absolute;top:0;left:0;width:28px;font-size:1rem;border:0;line-height:1;padding:2px;z-index:2;height:100%;text-align:center;color:var(--color-primary)}.code-editor button.lang-option-favorite-toggle svg{margin:0}.code-editor button[data-favourite=true]~.action-favourite,.code-editor button[data-favourite=false]~.action-unfavourite{display:none}.code-editor .action-favourite{opacity:.5}.code-editor button:hover~.action-favourite{opacity:1}.code-editor label{background-color:var(--color-primary-light);width:100%;color:var(--color-primary);padding:3px 12px;margin-bottom:0}.code-editor-language-list{position:relative;width:160px;z-index:2;align-items:stretch}.code-editor-language-list input{border-radius:0;border:0;border-bottom:1px solid #ddd;padding:6px 12px;height:auto}.code-editor-main{flex:1;min-width:0}.code-editor-main .cm-editor{margin-bottom:0;z-index:1;max-width:100%;width:100%}.code-editor-body-wrap{height:80vh}@media screen and (max-width: 600px){.code-editor .lang-options{display:none}.code-editor-body-wrap{flex-direction:column}.code-editor-language-list,.code-editor-language-list input{width:100%}}.comments-container{padding-inline:32px}@media screen and (max-width: 880px){.comments-container{padding-inline:6px}}.comment-box{border-radius:4px;border:1px solid #ddd;border-color:#ddd;background-color:#fff}html.dark-mode .comment-box{border-color:#000}html.dark-mode .comment-box{background-color:#222}.comment-box .content{font-size:.666em;padding:6px 12px}.comment-box .content p,.comment-box .content ul,.comment-box .content ol{font-size:14px;margin:.5em 0}.comment-box .actions{opacity:0;transition:opacity ease-in-out 120ms}.comment-box:hover .actions,.comment-box:focus-within .actions{opacity:1}.comment-box .actions button:focus{outline:1px dotted var(--color-primary)}@media screen and (max-width: 880px){.comment-box .actions{opacity:1}}.comment-box .header{border-bottom:1px solid #ddd;padding:6px 12px;border-color:#ddd}html.dark-mode .comment-box .header{border-color:#000}.comment-box .header a{color:inherit}.comment-box .header .text-muted{color:#999}.comment-box .header .meta a,.comment-box .header .meta span{white-space:nowrap}.comment-box .header .right-meta .text-muted{opacity:.8}.comment-thread-indicator{border-inline-start:3px dotted #ddd;border-color:#ddd;margin-inline-start:6px;width:24px;height:calc(100% - 16px)}html.dark-mode .comment-thread-indicator{border-color:#444}.comment-branch .comment-branch .comment-branch .comment-branch .comment-thread-indicator{display:none}.comment-reply{display:none;margin:0 !important;margin-bottom:-3px !important}.comment-branch .comment-branch .comment-branch .comment-branch .comment-reply{display:block}.comment-container-compact .comment-box .meta{font-size:.8rem}.comment-container-compact .comment-box .header{padding:6px}.comment-container-compact .comment-box .right-meta{display:none}.comment-container-compact .comment-box .content{padding:6px 12px}.comment-container-compact .comment-thread-indicator{width:16px}#tag-manager .drag-card{max-width:500px}.template-item{cursor:pointer;position:relative}.template-item:hover,.template-item .template-item-actions button:hover{background-color:#f2f2f2}.template-item .template-item-actions{position:absolute;top:0;inset-inline-end:0;width:50px;height:100%;display:flex;flex-direction:column;border-inline-start:1px solid;border-color:#ddd}html.dark-mode .template-item .template-item-actions{border-color:#000}.template-item .template-item-actions button{cursor:pointer;flex:1;background-color:#fff;border:0;border-top:1px solid;border-color:#ddd}html.dark-mode .template-item .template-item-actions button{background-color:#222}html.dark-mode .template-item .template-item-actions button{border-color:#000}.template-item .template-item-actions button svg{margin:0}.template-item .template-item-actions button:first-child{border-top:0}.dropdown-search{position:relative}.dropdown-search-toggle-breadcrumb{border:1px solid rgba(0,0,0,0);border-radius:4px;line-height:normal;padding:6px}.dropdown-search-toggle-breadcrumb:hover{border-color:#ddd}.dropdown-search-toggle-breadcrumb .svg-icon{margin-inline-end:0}.dropdown-search-toggle-select{display:flex;gap:12px;line-height:normal}.dropdown-search-toggle-select .svg-icon{height:26px;width:26px;margin:0}.dropdown-search-toggle-select .avatar{height:22px;width:22px}.dropdown-search-toggle-select .avatar+span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-search-toggle-select .dropdown-search-toggle-caret{font-size:1.15rem}.dropdown-search-toggle-select-label{min-width:0;white-space:nowrap}.dropdown-search-toggle-select-caret{line-height:0;margin-left:auto;margin-top:-2px;display:flex;align-items:center}.dropdown-search-dropdown{box-shadow:0 1px 3px 1px rgba(76,76,76,.26);overflow:hidden;min-height:100px;width:240px;display:none;position:absolute;z-index:80;right:0;top:0;margin-top:16px}html[dir=rtl] .dropdown-search-dropdown{right:auto;left:-16px}.dropdown-search-dropdown .dropdown-search-search .svg-icon{position:absolute;left:12px;top:11px;fill:#888;pointer-events:none}html[dir=rtl] .dropdown-search-dropdown .dropdown-search-search .svg-icon{right:12px;left:auto}.dropdown-search-dropdown .dropdown-search-list{max-height:400px;overflow-y:scroll;text-align:start}.dropdown-search-dropdown .dropdown-search-item{padding:12px 16px}.dropdown-search-dropdown .dropdown-search-item:hover,.dropdown-search-dropdown .dropdown-search-item:focus{background-color:#f2f2f2;text-decoration:none}.dropdown-search-dropdown input,.dropdown-search-dropdown input:focus{padding-inline-start:32px;border-radius:0;border:0;border-bottom:1px solid #ddd}.dropdown-search-dropdown input:focus{outline:0}@media screen and (max-width: 1000px){.dropdown-search-dropdown{inset-inline:16px auto}.dropdown-search-dropdown .dropdown-search-list{max-height:240px}}.item-list{box-shadow:0 1px 3px 0 rgba(0,0,0,.1)}.item-list-row{border:1.5px solid;border-color:#e2e2e2;border-bottom-width:0}html.dark-mode .item-list-row{border-color:#444}.item-list-row label{padding-bottom:0}.item-list-row:hover{background-color:#f6f6f6}html.dark-mode .item-list-row:hover{background-color:#333}.item-list-row:first-child{border-radius:4px 4px 0 0}.item-list-row:last-child{border-radius:0 0 4px 4px;border-bottom-width:1.5px}.item-list-row:first-child:last-child{border-radius:4px}.item-list-row-toggle-all{visibility:hidden}.item-list-row:hover .item-list-row-toggle-all{visibility:visible}.status-indicator-active,.status-indicator-inactive{width:8px;height:8px;border-radius:50%;display:inline-block}.status-indicator-active{background-color:var(--color-positive)}.status-indicator-inactive{background-color:var(--color-negative)}.shortcut-container{background-color:rgba(0,0,0,.25);pointer-events:none;position:fixed;left:0;top:0;width:100%;height:100%;z-index:99}.shortcut-linkage{position:fixed;box-shadow:0 0 4px 0 #fff;border-radius:3px}.shortcut-hint{position:fixed;padding:3px 3px;font-size:.85rem;font-weight:700;line-height:1;background-color:#eee;border-radius:3px;border:1px solid #b4b4b4;box-shadow:0 1px 1px rgba(0,0,0,.2),0 2px 0 0 rgba(255,255,255,.7) inset;color:#333}.back-to-top{background-color:var(--color-primary);position:fixed;bottom:16px;right:24px;padding:5px 7px;cursor:pointer;color:#fff;fill:#fff;width:40px;height:40px;border-radius:40px;transition:all ease-in-out 180ms;opacity:0;z-index:999;overflow:hidden}.back-to-top svg{width:26.6666666667px;height:26.6666666667px;margin-inline-end:4px}.back-to-top:hover{width:136px;opacity:1 !important}.back-to-top .inner{width:136px}.back-to-top span{position:relative;vertical-align:top;line-height:2}.scroll-box{list-style:none;padding:0;margin:0;max-height:280px;overflow-y:scroll;border:1px solid;border-color:#ddd;border-radius:3px;min-height:20px;background-color:#eee}html.dark-mode .scroll-box{border-color:#000}html.dark-mode .scroll-box{background-color:#000}.scroll-box-item{border-bottom:1px solid;border-top:1px solid;border-color:#ddd;margin-top:-1px;background-color:#fff;display:flex;align-items:flex-start;padding:1px}html.dark-mode .scroll-box-item{border-color:#000}html.dark-mode .scroll-box-item{background-color:#222}.scroll-box-item:last-child{border-bottom:0}.scroll-box-item:hover{cursor:pointer;background-color:#f8f8f8}html.dark-mode .scroll-box-item:hover{background-color:#333}.scroll-box-item .handle{color:#aaa;cursor:grab}.scroll-box-item button{opacity:.6}.scroll-box-item .handle svg{margin:0}.scroll-box-item>*{padding:6px 16px}.scroll-box-item .handle+*{padding-left:0}.scroll-box-item:hover .handle{color:#444}html.dark-mode .scroll-box-item:hover .handle{color:#fff}.scroll-box-item:hover button{opacity:1}.scroll-box-item a:hover{text-decoration:none}input.scroll-box-search,.scroll-box-header-item{font-size:.8rem;border:1px solid;border-color:#ddd;background-color:#fff;margin-bottom:-1px;border-radius:3px 3px 0 0;width:100%;max-width:100%;height:auto;line-height:1.4;color:#666}html.dark-mode input.scroll-box-search,html.dark-mode .scroll-box-header-item{border-color:#000}html.dark-mode input.scroll-box-search,html.dark-mode .scroll-box-header-item{background-color:#222}.scroll-box-search+.scroll-box,.scroll-box-header-item+.scroll-box{border-radius:0 0 3px 3px}.scroll-box[refs="shelf-sort@shelf-book-list"] [data-action=add]{display:none}.scroll-box[refs="shelf-sort@all-book-list"] [data-action=remove],.scroll-box[refs="shelf-sort@all-book-list"] [data-action=move_up],.scroll-box[refs="shelf-sort@all-book-list"] [data-action=move_down]{display:none}header.grid{grid-template-columns:minmax(max-content, 2fr) 1fr minmax(max-content, 2fr)}@media screen and (max-width: 1000px){header.grid{grid-template-columns:1fr;grid-row-gap:0}}header{position:relative;display:block;z-index:11;top:0;color:#fafafa;border-bottom:1px solid #ddd;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);border-bottom-color:#ddd}html.dark-mode header{border-bottom-color:#000}header .header-links{display:flex;align-items:center;justify-content:end}header .links{display:inline-block;vertical-align:top}header .links a{display:inline-block;padding:10px 16px;color:#fff;border-radius:3px}header .links a:hover{text-decoration:none;background-color:rgba(255,255,255,.15)}header .dropdown-container{padding-inline-start:16px;padding-inline-end:0}header .avatar,header .user-name{display:inline-block}header .avatar{width:30px;height:30px}header .user-name{vertical-align:top;position:relative;display:inline-flex;align-items:center;cursor:pointer;padding:12px;margin:0 -12px;border-radius:3px;gap:6px}header .user-name>span{padding-inline-start:6px;display:inline-block;line-height:1}header .user-name>svg{font-size:18px;margin-top:-2px;margin-inline-end:0}header .user-name:hover{background-color:rgba(255,255,255,.15)}@media screen and (min-width: 1000px)and (max-width: 1100px){header .user-name{padding-inline-start:6px}header .user-name .name{display:none}}.header *,.primary-background *{outline-color:#fff}header .search-box{display:inline-block}header .search-box input{background-color:rgba(0,0,0,.2);border:1px solid rgba(255,255,255,.2);border-radius:40px;color:#eee;z-index:2;height:auto;padding:9px;padding-inline-start:40px}header .search-box input:focus{outline:none;border:1px solid rgba(255,255,255,.4)}header .search-box input::placeholder{color:#fff;opacity:.6}@media screen and (min-width: 1000px)and (max-width: 1100px){header .search-box{max-width:200px}}header .search-box:focus-within #header-search-box-button{opacity:1}#header-search-box-button{z-index:1;inset-inline-start:16px;top:10px;color:#fff;opacity:.6;color:rgba(255,255,255,.8)}html.dark-mode #header-search-box-button{color:#aaa}#header-search-box-button svg{margin-inline-end:0}.global-search-suggestions{display:none;position:absolute;top:-12px;left:0;right:0;z-index:-1;margin-left:-48px;margin-right:-48px;padding-top:56px;border-radius:3px;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);transform-origin:top center;opacity:.5;transform:scale(0.9)}.global-search-suggestions .entity-item-snippet p{display:none}.global-search-suggestions .entity-item-snippet{font-size:.8rem}.global-search-suggestions .entity-list-item-name{font-size:.9rem;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.global-search-suggestions .global-search-loading{position:absolute;width:100%}header .search-box.search-active:focus-within .global-search-suggestions{display:block}header .search-box.search-active:focus-within input{background-color:#eee;border-color:#ddd}html.dark-mode header .search-box.search-active:focus-within input{background-color:#333}html.dark-mode header .search-box.search-active:focus-within input{border-color:#111}header .search-box.search-active:focus-within #header-search-box-button,header .search-box.search-active:focus-within input{color:#444}html.dark-mode header .search-box.search-active:focus-within #header-search-box-button,html.dark-mode header .search-box.search-active:focus-within input{color:#aaa}.logo{display:inline-flex;padding:6px 12px;margin:6px -12px;gap:12px;align-items:center;border-radius:4px}.logo:hover{color:#fff;text-decoration:none;background-color:rgba(255,255,255,.15)}.logo-text{font-size:1.8em;color:#fff;font-weight:400;line-height:1}.logo-image{height:43px}.mobile-menu-toggle{color:#fff;fill:#fff;font-size:2em;border:2px solid rgba(255,255,255,.8);border-radius:4px;padding:0 6px;line-height:1;cursor:pointer;user-select:none}.mobile-menu-toggle svg{margin:0;bottom:-2px}@media screen and (max-width: 1000px){header .header-links{background-color:#fff;display:none;z-index:10;inset-inline-end:16px;border-radius:4px;overflow:hidden;position:absolute;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);margin-top:16px;padding:6px 0}html.dark-mode header .header-links{background-color:#333}header .header-links.show{display:block}header .links a,header .dropdown-container ul li a,header .dropdown-container ul li button{text-align:start;display:grid;align-items:center;padding:8px 16px;gap:16px;color:#444;grid-template-columns:16px auto;line-height:1.4;color:#444}html.dark-mode header .links a,html.dark-mode header .dropdown-container ul li a,html.dark-mode header .dropdown-container ul li button{color:#eee}header .links a svg,header .dropdown-container ul li a svg,header .dropdown-container ul li button svg{margin-inline-end:12px;width:16px}header .links a:hover,header .dropdown-container ul li a:hover,header .dropdown-container ul li button:hover{background-color:var(--color-primary-light);color:var(--color-primary);text-decoration:none}header .links a:focus,header .dropdown-container ul li a:focus,header .dropdown-container ul li button:focus{background-color:#eee;outline-color:var(--color-primary);color:var(--color-primary)}html.dark-mode header .links a:focus,html.dark-mode header .dropdown-container ul li a:focus,html.dark-mode header .dropdown-container ul li button:focus{background-color:#333}header .dropdown-container{display:block;padding-inline-start:0}header .links{display:block}header .dropdown-container ul{display:block !important;position:relative;background-color:rgba(0,0,0,0);border:0;padding:0;margin:0;box-shadow:none}}.tri-layout-mobile-tabs{position:sticky;top:0;z-index:5;background-color:#fff;border-bottom:1px solid #ddd;border-bottom-color:#ddd;box-shadow:0 1px 6px -1px rgba(0,0,0,.1)}html.dark-mode .tri-layout-mobile-tabs{border-bottom-color:#333}.tri-layout-mobile-tab{text-align:center;border-bottom:3px solid #bbb;cursor:pointer;margin:0;background-color:#fff;border-bottom-color:#bbb}html.dark-mode .tri-layout-mobile-tab{background-color:#222}html.dark-mode .tri-layout-mobile-tab{border-bottom-color:#333}.tri-layout-mobile-tab:first-child{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd}html.dark-mode .tri-layout-mobile-tab:first-child{border-inline-end-color:#000}.tri-layout-mobile-tab[aria-selected=true]{border-bottom-color:currentColor !important}.breadcrumbs{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;opacity:.7}.breadcrumbs .icon-list-item{width:auto;padding-top:6px;padding-bottom:6px}.breadcrumbs .separator{display:inline-block;fill:#aaa;font-size:1.6em;line-height:.8;margin:-2px 0 0}.breadcrumbs:hover,.breadcrumbs:focus-within{opacity:1}@media(prefers-contrast: more){.breadcrumbs{opacity:1}}@media screen and (max-width: 1000px){.breadcrumbs .icon-list-item{padding:6px}.breadcrumbs .icon-list-item>span+span{display:none}.breadcrumbs .icon-list-item>span:first-child{margin-inline-end:0}}.faded a,.faded button,.faded span,.faded span>div{color:#666;fill:#666}.faded .text-button{opacity:.5;transition:all ease-in-out 120ms}.faded .text-button:hover{opacity:1;text-decoration:none}.faded span.faded-text{display:inline-block;padding:12px}footer{flex-shrink:0;padding:1rem 1rem 2rem 1rem;text-align:center}footer a{margin:0 .5em}body.flexbox footer{display:none}.book-contents .entity-list-item .icon{width:4px;border-radius:1px;justify-self:stretch;align-self:stretch;height:auto;margin-inline-end:6px}.book-contents .entity-list-item .icon:after{opacity:.5}.book-contents .entity-list-item .icon svg{display:none}.book-contents .entity-list-item p{margin-bottom:0}.book-contents .entity-list-item .inner-page{padding-top:0;padding-bottom:0}.entity-list-item+.chapter-expansion{display:flex;padding:0 16px 16px 16px;align-items:center;border:0;width:100%;position:relative}.entity-list-item+.chapter-expansion>.icon{width:4px;height:auto;border-radius:0 0 1px 1px;align-self:stretch;flex-shrink:0}.entity-list-item+.chapter-expansion>.icon:before{position:absolute;top:0;left:0;width:100%;height:1px;background-color:currentColor;content:"";opacity:.5}.entity-list-item+.chapter-expansion>.icon:after{opacity:.5}.entity-list-item+.chapter-expansion .icon svg{display:none}.entity-list-item+.chapter-expansion>.content{flex:1}.entity-list-item+.chapter-expansion .chapter-contents-toggle{border-radius:0 4px 4px 0;padding:6px 19px;width:100%;text-align:start}.entity-list-item+.chapter-expansion .chapter-contents-toggle:hover{background-color:rgba(0,0,0,.06)}.entity-list-item.has-children{padding-bottom:0}.entity-list-item.has-children>.icon{border-radius:4px 4px 0 0}.inset-list{display:none}.inset-list .entity-list-item-name{font-size:1rem}.inset-list .entity-list-item-children{padding-top:0;padding-bottom:0}.sidebar-page-nav{list-style:none;margin-block-start:12px;margin-block-end:16px;margin-inline-start:6px;margin-inline-end:0;position:relative}.sidebar-page-nav:after{content:"";display:block;position:absolute;left:0;background-color:rgba(0,0,0,.2);width:2px;top:5px;bottom:5px;z-index:0}html[dir=rtl] .sidebar-page-nav:after{left:auto;right:0}html.dark-mode .sidebar-page-nav:after{background-color:rgba(255,255,255,.2)}.sidebar-page-nav li{margin-bottom:4px;font-size:.95em;position:relative}.sidebar-page-nav .h1{padding-inline-start:16px}.sidebar-page-nav .h2{padding-inline-start:24px}.sidebar-page-nav .h3{padding-inline-start:32px}.sidebar-page-nav .h4{padding-inline-start:40px}.sidebar-page-nav .h5{padding-inline-start:48px}.sidebar-page-nav .h6{padding-inline-start:56px}.sidebar-page-nav .current-heading{font-weight:bold}.sidebar-page-nav li:not(.current-heading) .sidebar-page-nav-bullet{background-color:#bbb !important}html.dark-mode .sidebar-page-nav li:not(.current-heading) .sidebar-page-nav-bullet{background-color:#666 !important}.sidebar-page-nav .sidebar-page-nav-bullet{width:6px;height:6px;position:absolute;left:-2px;top:30%;border-radius:50%;box-shadow:0 0 0 6px #f2f2f2;box-shadow:0 0 0 6px #f2f2f2;z-index:1}html.dark-mode .sidebar-page-nav .sidebar-page-nav-bullet{box-shadow:0 0 0 6px #111}html[dir=rtl] .sidebar-page-nav .sidebar-page-nav-bullet{left:auto;right:-2px}.book-tree .sidebar-page-list{list-style:none;margin-block-start:6px;margin-block-end:0;margin-inline-start:-12px;margin-inline-end:-12px;padding-inline-start:0;padding-inline-end:0}.book-tree .sidebar-page-list ul{list-style:none;padding-inline-start:1rem;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item{padding-top:2px;padding-bottom:2px;background-clip:content-box;border-radius:0 3px 3px 0;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item .content{width:100%;padding-top:6px;padding-bottom:6px;max-width:calc(100% - 20px)}.book-tree .sidebar-page-list .entity-list-item.selected{background-color:rgba(0,0,0,.06)}html.dark-mode .book-tree .sidebar-page-list .entity-list-item.selected{background-color:rgba(255,255,255,.06)}.book-tree .sidebar-page-list .entity-list-item.no-hover{margin-top:-6px;padding-inline-end:0}.book-tree .sidebar-page-list .entity-list-item-name{font-size:1em;margin:0;margin-inline-end:16px}.book-tree .sidebar-page-list .chapter-child-menu{font-size:.8rem;margin-top:-0.2rem;margin-inline-start:-1rem}.book-tree .sidebar-page-list .chapter-contents-toggle{display:block;width:100%;text-align:start;padding:3px 12px 6px 12px;border-radius:0 3px 3px 0;line-height:1;margin-top:-3px;margin-bottom:-3px}.book-tree .sidebar-page-list .chapter-contents-toggle:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .book-tree .sidebar-page-list .chapter-contents-toggle:hover{background-color:rgba(255,255,255,.06)}.book-tree .sidebar-page-list .entity-list-item .icon{z-index:2;width:4px;height:auto;align-self:stretch;flex-shrink:0;border-radius:1px;opacity:.8}.book-tree .sidebar-page-list .entity-list-item .icon:after{opacity:1}.book-tree .sidebar-page-list .entity-list-item .icon svg{display:none}.chapter-child-menu ul.sub-menu{display:none;padding-inline-start:0;position:relative;margin-bottom:0}.sortable-page-list,.sortable-page-sublist{list-style:none}.sort-box{margin-bottom:16px;padding:16px 32px;position:relative}.sort-box::before{pointer-events:none;content:"";border-radius:4px;opacity:.5;border:2px solid var(--color-book);display:block;top:0;bottom:0;left:0;right:0;position:absolute}.sort-box-options{display:flex;flex-wrap:wrap;justify-content:space-between}.sort-box-options .button{margin-inline-start:0}.sortable-page-list{margin-inline-start:0;padding:0}.sortable-page-list .entity-list-item>span:first-child{align-self:flex-start}.sortable-page-list .sortable-selected,.sortable-page-list .sortable-selected:hover{outline:1px dotted var(--color-primary);background-color:var(--color-primary-light) !important}.sortable-page-list .entity-list-item>div{display:block;flex:1}.sortable-page-list>ul{margin-inline-start:0}.sortable-page-list .sortable-page-sublist{margin-bottom:16px;margin-top:0;padding-inline-start:16px}.sortable-page-list li{background-color:#fff;border:1px solid;border-color:#ddd;margin-top:-1px;min-height:38px}html.dark-mode .sortable-page-list li{background-color:#222}html.dark-mode .sortable-page-list li{border-color:#666}.sortable-page-list li.text-page,.sortable-page-list li.text-chapter{border-inline-start:2px solid currentColor}.sortable-page-list li:first-child{margin-top:6px}.sortable-page-list li.placeholder{position:relative}.sortable-page-list li.placeholder:before{position:absolute}.sort-box summary{list-style:none;font-size:.9rem;cursor:pointer}.sort-box summary::-webkit-details-marker{display:none}details.sort-box summary .caret-container svg{transition:transform ease-in-out 120ms}details.sort-box[open] summary .caret-container svg{transform:rotate(90deg)}.sort-box-actions .icon-button{opacity:.6}.sort-box .flex-container-row:hover .sort-box-actions .icon-button,.sort-box .flex-container-row:focus-within .sort-box-actions .icon-button{opacity:1}.sort-box-actions .icon-button[disabled]{visibility:hidden}.sort-box-actions .dropdown-menu button[disabled]{display:none}.sort-list-handle{cursor:grab}.activity-list-item{padding:12px 0;display:grid;grid-template-columns:min-content 1fr;grid-column-gap:16px;font-size:.9em}.card .activity-list-item{padding-block:12px}.user-list-item{display:inline-grid;padding:12px;grid-template-columns:min-content 1fr;grid-column-gap:16px;font-size:.9em;align-items:center}.user-list-item>div:first-child{line-height:0}ul.pagination{display:inline-flex;list-style:none;margin:16px 0;padding-inline-start:1px}ul.pagination li:first-child a,ul.pagination li:first-child span{border-radius:3px 0 0 3px}ul.pagination li:last-child a,ul.pagination li:last-child span{border-radius:0 3px 3px 0}ul.pagination a,ul.pagination span{display:block;padding:3px 12px;border:1px solid #ccc;margin-inline-start:-1px;user-select:none;color:#555;border-color:#ccc}html.dark-mode ul.pagination a,html.dark-mode ul.pagination span{color:#eee}html.dark-mode ul.pagination a,html.dark-mode ul.pagination span{border-color:#666}ul.pagination li.disabled{cursor:not-allowed}ul.pagination li.active span{color:#111;background-color:rgba(0,0,0,.05)}html.dark-mode ul.pagination li.active span{color:#eee}html.dark-mode ul.pagination li.active span{background-color:rgba(0,0,0,.5)}.compact ul.pagination{margin:0}.entity-list,.icon-list{margin:0 -16px}.entity-list h4,.icon-list h4{margin:0}.entity-list hr,.icon-list hr{margin:0}.entity-list .text-small.text-muted,.icon-list .text-small.text-muted{color:#aaa;font-size:.75em;margin-top:6px}.entity-list .text-muted p.text-muted,.icon-list .text-muted p.text-muted{margin-top:0}.entity-list .page.draft .text-page,.icon-list .page.draft .text-page{color:var(--color-page-draft);fill:var(--color-page-draft)}.entity-list>.dropdown-container,.icon-list>.dropdown-container{display:block}.icon-list hr{margin:12px 16px;max-width:140px;opacity:.25;height:1.1px}.icon-list hr+hr,.icon-list hr:first-child,.icon-list hr:last-child{display:none}.entity-list-item,.icon-list-item{padding:12px 16px;display:flex;align-items:center;gap:16px;background-color:rgba(0,0,0,0);border:0;width:100%;position:relative;word-break:break-word}.entity-list-item h4 a,.icon-list-item h4 a{color:#666}.entity-list-item>span:first-child,.icon-list-item>span:first-child{flex-basis:1.88em;flex:none}.entity-list-item>span:last-child,.icon-list-item>span:last-child{flex:1;text-align:start}.entity-list-item>.content,.icon-list-item>.content{min-width:0}.entity-list-item:not(.no-hover),.icon-list-item:not(.no-hover){cursor:pointer}.entity-list-item:not(.no-hover):hover,.icon-list-item:not(.no-hover):hover{background-color:rgba(0,0,0,.06);text-decoration:none;border-radius:4px}html.dark-mode .entity-list-item:not(.no-hover):hover,html.dark-mode .icon-list-item:not(.no-hover):hover{background-color:rgba(255,255,255,.06)}.entity-list-item.outline-hover:hover,.icon-list-item.outline-hover:hover{background-color:rgba(0,0,0,0)}.entity-list-item:focus,.icon-list-item:focus{background-color:#eee;outline:1px dotted #666;outline-offset:-2px}html.dark-mode .entity-list-item:focus,html.dark-mode .icon-list-item:focus{background-color:#222}.entity-list-item.disabled{pointer-events:none;cursor:not-allowed;opacity:.8;user-select:none;background:var(--bg-disabled)}.entity-list-item-path-sep{display:inline-block;vertical-align:top;position:relative;top:1px}.entity-list-item-path-sep svg{margin-inline-end:0}.split-icon-list-item{display:flex;align-items:center;gap:16px;background-color:rgba(0,0,0,0);border:0;width:100%;position:relative;word-break:break-word;border-radius:4px}.split-icon-list-item>a{padding:12px 16px;display:flex;align-items:center;gap:16px;flex:1}.split-icon-list-item>a:hover{text-decoration:none}.split-icon-list-item .icon{flex-basis:1.88em;flex:none}.split-icon-list-item:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .split-icon-list-item:hover{background-color:rgba(255,255,255,.06)}.icon-list-item-dropdown{margin-inline-start:auto;align-self:stretch;display:flex;align-items:stretch;border-inline-start:1px solid rgba(0,0,0,.1);visibility:hidden}.split-icon-list-item:hover .icon-list-item-dropdown,.split-icon-list-item:focus-within .icon-list-item-dropdown{visibility:visible}.icon-list-item-dropdown-toggle{padding:6px;display:flex;align-items:center;cursor:pointer;color:#888}html.dark-mode .icon-list-item-dropdown-toggle{color:#999}.icon-list-item-dropdown-toggle svg{margin:0}.icon-list-item-dropdown-toggle:hover{background-color:rgba(0,0,0,.06)}html.dark-mode .icon-list-item-dropdown-toggle:hover{background-color:rgba(255,255,255,.06)}.card .entity-list-item:not(.no-hover,.book-contents .entity-list-item):hover{background-color:#f2f2f2;border-radius:0}html.dark-mode .card .entity-list-item:not(.no-hover,.book-contents .entity-list-item):hover{background-color:#2d2d2d}.card .entity-list-item .entity-list-item:hover{background-color:#eee}.entity-list-item-children{padding:16px 24px}.entity-list-item-children>div{overflow:hidden;padding:0 0 6px 0}.entity-list-item-children .entity-chip{text-overflow:ellipsis;height:2.5em;overflow:hidden;text-align:start;display:block;white-space:nowrap}.entity-list-item-children>.entity-list>.entity-list-item:last-child{margin-bottom:-6px}.entity-list-item-image{align-self:stretch;width:140px;flex:none;background-size:cover;background-position:50% 50%;border-radius:3px;position:relative;margin-inline-end:24px}.entity-list-item-image.entity-list-item-image-wide{width:220px}.entity-list-item-image .svg-icon{color:#fff;font-size:1.66rem;margin-inline-end:0;position:absolute;bottom:6px;left:6px}html.dark-mode .entity-list-item-image .svg-icon{color:rgba(255,255,255,.6)}@media screen and (max-width: 880px){.entity-list-item-image{width:80px}}.chapter>.entity-list-item-image{width:60px}.entity-list.compact{font-size:8.4px}.entity-list.compact h4,.entity-list.compact a{line-height:1.2}.entity-list.compact .entity-item-snippet{display:none}.entity-list.compact .entity-list-item p{font-size:11.2px;padding-top:6px}.entity-list.compact .entity-list-item p:empty{padding-top:0}.entity-list.compact p{margin:0}.entity-list.compact>p.empty-text{display:block;font-size:14px}.entity-list.compact hr{margin:0}@media screen and (max-width: 880px){.entity-list.compact h4{font-size:1.666em}}.entity-item-tags{font-size:.75rem;opacity:1}.entity-item-tags .primary-background-light{background:rgba(0,0,0,0)}.entity-item-tags .tag-name{background-color:rgba(0,0,0,.05)}.dropdown-container{display:inline-block;vertical-align:top;position:relative}.dropdown-menu{display:none;position:absolute;z-index:999;top:0;list-style:none;inset-inline-end:0;margin:16px 0;background-color:#fff;box-shadow:0 1px 6px 0 rgba(0,0,0,.18);border-radius:3px;min-width:180px;padding:6px 0;color:#555;fill:currentColor;text-align:start !important;max-height:500px;overflow-y:auto}html.dark-mode .dropdown-menu{background-color:#333}html.dark-mode .dropdown-menu{color:#eee}.dropdown-menu.anchor-left{inset-inline-end:auto;inset-inline-start:0}.dropdown-menu.wide{min-width:220px}.dropdown-menu.xl-limited{width:280px;max-width:100%}.dropdown-menu .text-muted{color:#999;fill:#999}.dropdown-menu li.active a{font-weight:600}.dropdown-menu button{width:100%;text-align:start}.dropdown-menu li.border-bottom{border-bottom:1px solid #ddd}.dropdown-menu li hr{margin:6px 0}.dropdown-menu .icon-item,.dropdown-menu .text-item,.dropdown-menu .label-item{padding:8px 16px;color:#555;fill:currentColor;white-space:nowrap;line-height:1.4;cursor:pointer}html.dark-mode .dropdown-menu .icon-item,html.dark-mode .dropdown-menu .text-item,html.dark-mode .dropdown-menu .label-item{color:#eee}.dropdown-menu .icon-item.break-text,.dropdown-menu .text-item.break-text,.dropdown-menu .label-item.break-text{white-space:normal;word-wrap:break-word;overflow-wrap:break-word}.dropdown-menu .icon-item:hover,.dropdown-menu .icon-item:focus,.dropdown-menu .text-item:hover,.dropdown-menu .text-item:focus,.dropdown-menu .label-item:hover,.dropdown-menu .label-item:focus{text-decoration:none;background-color:var(--color-primary-light);color:var(--color-primary)}.dropdown-menu .icon-item:focus,.dropdown-menu .text-item:focus,.dropdown-menu .label-item:focus{outline:1px solid var(--color-primary);outline-offset:-2px}.dropdown-menu .icon-item svg,.dropdown-menu .text-item svg,.dropdown-menu .label-item svg{margin-inline-end:12px;display:inline-block;width:16px}.dropdown-menu .text-item{display:block}.dropdown-menu .label-item{display:grid;align-items:center;grid-template-columns:auto min-content;gap:16px}.dropdown-menu .label-item>*:nth-child(2){opacity:.7}.dropdown-menu .label-item>*:nth-child(2):hover{opacity:1}.dropdown-menu .icon-item{display:grid;align-items:start;grid-template-columns:16px auto;gap:16px}.dropdown-menu .icon-item svg{margin-inline-end:0;margin-block-start:1px}.tri-layout-right .dropdown-menu,.tri-layout-left .dropdown-menu{inset-inline-end:6px}.featured-image-container{position:relative;overflow:hidden;min-height:140px;background-size:cover;background-position:50% 50%;transition:opacity ease-in-out 240ms}.featured-image-container a{display:block}.featured-image-container img{display:block;width:100%;max-width:100%;height:auto}.featured-image-container-wrap{position:relative}.featured-image-container-wrap .svg-icon{color:#fff;font-size:2rem;margin-inline-end:0;position:absolute;bottom:10px;left:6px}html.dark-mode .featured-image-container-wrap .svg-icon{color:rgba(255,255,255,.6)}.grid-card:hover .featured-image-container{opacity:.5}.action-link{background:rgba(0,0,0,0);border:none;color:currentColor;padding:16px 0}.active-link-list a{display:inline-block;padding:12px}.active-link-list a:not(.active){color:#444}html.dark-mode .active-link-list a:not(.active){color:#888}.active-link-list a:hover{background-color:rgba(0,0,0,.05);border-radius:4px;text-decoration:none}html.dark-mode .active-link-list a:hover{background-color:rgba(255,255,255,.05)}.active-link-list.in-sidebar a{display:block;margin-bottom:6px}.active-link-list.in-sidebar a.active{border-radius:4px;background-color:rgba(0,0,0,.05)}html.dark-mode .active-link-list.in-sidebar a.active{background-color:rgba(255,255,255,.05)}.entity-meta-item{display:flex;line-height:1.2;margin:.6em 0;align-content:start;gap:12px}.entity-meta-item a{line-height:1.2}.entity-meta-item svg{flex-shrink:0;width:1em;margin:0}.page-editor{display:flex;flex-direction:column;align-items:stretch;overflow:hidden}.page-editor .edit-area{flex:1;flex-direction:column;z-index:10;overflow:hidden;border-radius:0 0 8px 8px}.page-editor .mce-tinymce{box-shadow:none}.page-editor .mce-top-part::before{box-shadow:none}.page-editor-page-area{width:100%;border-radius:8px;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);background-color:#fff}html.dark-mode .page-editor-page-area{background-color:#333}.page-edit-toolbar{width:100%;margin:0 auto;display:grid;grid-template-columns:minmax(max-content, 2fr) 1.5fr minmax(max-content, 2fr);align-items:center}@media screen and (min-width: 1400px){.page-editor-wysiwyg .page-edit-toolbar,.page-editor-wysiwyg .page-editor-page-area{max-width:1140px}.page-editor-wysiwyg .floating-toolbox{position:absolute}}@media screen and (max-width: 880px){.page-edit-toolbar{display:flex;flex-direction:row;justify-content:space-between}}.title-input.page-title{font-size:.8em}.title-input.page-title .input{border:0;margin-bottom:-1px}.title-input.page-title input[type=text]{max-width:840px;margin:0 auto;border:none;height:auto;display:block;width:100%;font-size:20px;border-radius:8px}.title-input.page-title input[type=text]:focus{position:relative;outline-offset:-1px;outline:1px dashed var(--color-primary);box-shadow:0 1px 6px -1px rgba(0,0,0,.1);z-index:50}.page-editor-markdown .title-input.page-title input[type=text]{max-width:100%}body.tox-fullscreen .page-editor .edit-area,body.markdown-fullscreen .page-editor .edit-area{z-index:12}body.tox-fullscreen .page-editor,body.tox-fullscreen .flex-fill,body.markdown-fullscreen .page-editor,body.markdown-fullscreen .flex-fill{overflow:visible}@media screen and (max-width: 600px){.page-edit-toolbar{overflow-x:scroll;overflow-y:visible}.page-edit-toolbar{white-space:nowrap}.page-edit-toolbar>div{display:inline-block}}.page-save-mobile-button{position:fixed;z-index:30;border-radius:50%;width:52px;height:52px;font-size:26px;inset-inline-end:6px;bottom:12px;box-shadow:0 2px 2px 1px rgba(0,0,0,.13);background-color:currentColor;text-align:center}.page-save-mobile-button svg{fill:#fff;margin-inline-end:0}.draft-notification{pointer-events:none;transform:scale(0);transition:transform ease-in-out 120ms;transform-origin:50% 50%}.draft-notification.visible{transform:scale(1)}.page-style.editor{padding:0 !important}.pointer-container{position:fixed;display:none;left:0;z-index:10}.pointer{border:1px solid #ccc;border-color:#ccc;border-radius:4px;box-shadow:0 0 12px 1px rgba(0,0,0,.1);background-color:#fff;width:275px}html.dark-mode .pointer{border-color:#000}html.dark-mode .pointer{background-color:#333}.pointer.is-page-editable{width:328px}.pointer:before{position:absolute;left:50%;bottom:-9px;width:16px;height:16px;margin-inline-start:-8px;content:"";display:block;transform:rotate(45deg);transform-origin:50% 50%;border-right:1px solid #ccc;border-bottom:1px solid #ccc;z-index:56;background-color:#fff;border-color:#ccc}html.dark-mode .pointer:before{background-color:#333}html.dark-mode .pointer:before{border-color:#000}.pointer input,.pointer button,.pointer a{position:relative;border-radius:0;height:28px;font-size:12px;vertical-align:top;padding:5px 16px}.pointer input{background-color:#fff;border:1px solid #ddd;border-color:#ddd;color:#666;width:160px;z-index:40;padding:5px 10px}html.dark-mode .pointer input{border-color:#000}.pointer .text-button{color:#444}html.dark-mode .pointer .text-button{color:#aaa}.pointer .input-group .button{line-height:1;margin:0 0 0 -4px;box-shadow:none}.pointer a.button{margin:0}.pointer .svg-icon{width:1.2em;height:1.2em}.pointer .button{border-color:#ddd}html.dark-mode .pointer .button{border-color:#000}.floating-toolbox{background-color:#fff;overflow:hidden;align-items:stretch;flex-direction:row;display:flex;max-height:100%;border-radius:8px;box-shadow:0 1px 6px -1px rgba(0,0,0,.1);margin-bottom:auto;margin-inline-start:24px;position:relative}html.dark-mode .floating-toolbox{background-color:#222}.floating-toolbox.open{position:relative;right:0;max-width:480px;margin-bottom:0}.floating-toolbox:not(.open) .toolbox-tab-content{display:none !important}.floating-toolbox .toolbox-toggle svg{transition:transform ease-in-out 180ms}.floating-toolbox .toolbox-toggle{transition:background-color ease-in-out 180ms}.floating-toolbox.open .toolbox-toggle{background-color:rgba(255,0,0,.2)}.floating-toolbox.open .toolbox-toggle svg{transform:rotate(180deg)}.floating-toolbox>div{flex:1;position:relative}.floating-toolbox .tabs{border-inline-end:1px solid #ddd;border-inline-end-color:#ddd;width:40px;flex:0 1 auto;margin-inline-end:-1px}html.dark-mode .floating-toolbox .tabs{border-inline-end-color:#000}.floating-toolbox .tabs-inner{background-color:#fff}html.dark-mode .floating-toolbox .tabs-inner{background-color:#222}.floating-toolbox .tabs svg{padding:0;margin:0}.floating-toolbox .tabs-inner>button{color:rgba(0,0,0,.7);display:block;cursor:pointer;padding:10px 6px;font-size:18px;line-height:1.6}html.dark-mode .floating-toolbox .tabs-inner>button{color:rgba(255,255,255,.5)}.floating-toolbox .tabs-inner>button:hover,.floating-toolbox.open .tabs-inner>button.active{color:var(--color-link) !important;position:relative}.floating-toolbox .tabs-inner>button:hover:after,.floating-toolbox.open .tabs-inner>button.active:after{content:"";display:block;position:absolute;left:0;width:100%;top:0;height:100%;background-color:currentColor;opacity:.075}.floating-toolbox.open .tabs-inner>button.active{border-inline-end:1px solid var(--color-link);margin-inline-end:-1px}.floating-toolbox h4{font-size:24px;margin:16px 0 0 0;padding:0 24px 12px 24px}.floating-toolbox .tags input{max-width:100%;width:100%;min-width:50px}.floating-toolbox .tags td,.floating-toolbox .inline-start-table>div>div>div{padding-inline-end:12px;padding-top:12px;position:relative}.floating-toolbox .handle{user-select:none;cursor:move;fill:#999}.floating-toolbox form{display:flex;flex:1;flex-direction:column;overflow-y:scroll}.floating-toolbox table td,.floating-toolbox table th{overflow:visible}@media screen and (max-width: 1400px){.floating-toolbox{margin-inline-start:12px}}@media screen and (max-width: 600px){.page-editor-page-area-wrap{margin:4px !important}.floating-toolbox{margin-inline-start:4px}.floating-toolbox .tabs{width:32px}.floating-toolbox .tabs-inner>button{font-size:12px}.page-edit-toolbar{padding-block:0 !important}.page-editor.toolbox-open .page-editor-page-area{display:none}}.toolbox-tab-content{display:none;overflow-y:auto;padding-bottom:45px}.suggestion-box{top:auto;margin:-4px 0 0;right:auto;left:0;padding:0}.suggestion-box li{display:block;border-bottom:1px solid #ddd}.suggestion-box li:last-child{border-bottom:0}.comments-container h5{color:#888;font-weight:normal;margin-top:.5em}.comment-editor .CodeMirror,.comment-editor .CodeMirror-scroll{min-height:175px}.mce-floatpanel[aria-label="Insert/edit media"] .mce-open{display:none}.entity-list-item>span:first-child,.icon-list-item>span:first-child,.split-icon-list-item>a>.icon,.chapter-expansion>.icon{font-size:.8rem;width:1.88em;height:1.88em;flex-shrink:0;display:flex;align-items:center;justify-content:center;text-align:center;border-radius:1em;position:relative;overflow:hidden}.entity-list-item>span:first-child svg,.icon-list-item>span:first-child svg,.split-icon-list-item>a>.icon svg,.chapter-expansion>.icon svg{margin:0;bottom:0}.entity-list-item>span:first-child:after,.icon-list-item>span:first-child:after,.split-icon-list-item>a>.icon:after,.chapter-expansion>.icon:after{content:"";position:absolute;background-color:currentColor;opacity:.2;left:0;top:0;width:100%;height:100%}.entity-chip{display:inline-block;align-items:center;justify-content:center;text-align:center;font-size:.9em;border-radius:3px;position:relative;overflow:hidden;padding:6px 12px;fill:currentColor;opacity:.85;transition:opacity ease-in-out 120ms}.entity-chip:after{content:"";position:absolute;background-color:currentColor;opacity:.15;left:0;top:0;width:100%;height:100%}.entity-chip:hover{text-decoration:none;opacity:1}@media(prefers-contrast: more){.entity-chip{opacity:1}}.page-content{width:100%;max-width:840px;margin:0 auto;overflow-wrap:break-word}.page-content .align-left{text-align:left}.page-content img.align-left,.page-content table.align-left,.page-content iframe.align-left,.page-content video.align-left{float:left !important;margin:6px 16px 16px 0}.page-content .align-right{text-align:right !important}.page-content img.align-right,.page-content table.align-right,.page-content iframe.align-right,.page-content video.align-right{float:right !important;margin:6px 0 6px 12px}.page-content .align-center{text-align:center}.page-content img.align-center,.page-content video.align-center,.page-content iframe.align-center{display:block}.page-content img.align-center,.page-content table.align-center,.page-content iframe.align-center,.page-content video.align-center{margin-left:auto;margin-right:auto}.page-content h1,.page-content h2,.page-content h3,.page-content h4,.page-content h5,.page-content h6,.page-content pre{clear:left}.page-content hr{clear:both;margin:16px 0}.page-content table{hyphens:auto;table-layout:fixed;max-width:100%;height:auto !important}.page-content ins,.page-content del{text-decoration:none}.page-content ins{background:#dbffdb}.page-content del{background:#ffecec}.page-content details{border:1px solid;border-color:#ddd;margin-bottom:1em;padding:12px}html.dark-mode .page-content details{border-color:#555}.page-content details>summary{margin-top:-12px;margin-left:-12px;margin-right:-12px;margin-bottom:-12px;font-weight:bold;background-color:#eee;padding:6px 12px}html.dark-mode .page-content details>summary{background-color:#333}.page-content details[open]>summary{margin-bottom:12px;border-bottom:1px solid;border-color:#ddd}html.dark-mode .page-content details[open]>summary{border-color:#555}.page-content details>summary+*{margin-top:.2em}.page-content details:after{content:"";display:block;clear:both}.page-content li>input[type=checkbox]{vertical-align:top;margin-top:.3em}.page-content p:empty{min-height:1.6em}.page-content.page-revision pre code{white-space:pre-wrap}.page-content .cm-editor{margin-bottom:1.375em}.page-content video{max-width:100%}.page-content a{text-decoration:underline}body .page-content img,.page-content img:not([data-mce-object]){max-width:100%;height:auto}.callout{border-left:3px solid #bbb;background-color:#eee;padding:12px 12px 12px 32px;display:block;position:relative;overflow:auto}.callout:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMTUzODAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bTEgMTVoLTJ2LTZoMnY2em0wLThoLTJWN2gydjJ6Ii8+PC9zdmc+");background-repeat:no-repeat;content:"";width:1.2em;height:1.2em;left:8px;top:50%;margin-top:-9px;display:inline-block;position:absolute;line-height:1;opacity:.8}.callout.success{border-left-color:#0f7d15;background-color:#eafdeb;color:#063409}html.dark-mode .callout.success{border-left-color:#4aa850}html.dark-mode .callout.success{background-color:#122913}html.dark-mode .callout.success{color:#4aa850}.callout.success:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+")}.callout.danger{border-left-color:#ab0f0e;background-color:#fcdbdb;color:#4d0706}html.dark-mode .callout.danger{border-left-color:#e85c5b}html.dark-mode .callout.danger{background-color:#250505}html.dark-mode .callout.danger{color:#e85c5b}.callout.danger:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==")}.callout.info{border-left-color:#0288d1;color:#01466c;background-color:#d3efff}html.dark-mode .callout.info{border-left-color:#0288d1}html.dark-mode .callout.info{color:#0288d1}html.dark-mode .callout.info{background-color:#001825}.callout.warning{border-left-color:#cf4d03;background-color:#fee3d3;color:#6a2802}html.dark-mode .callout.warning{border-left-color:#de8a5a}html.dark-mode .callout.warning{background-color:#30170a}html.dark-mode .callout.warning{color:#de8a5a}.callout.warning:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiNjUzMWMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEgMjFoMjJMMTIgMiAxIDIxem0xMi0zaC0ydi0yaDJ2MnptMC00aC0ydi00aDJ2NHoiLz48L3N2Zz4=")}.callout a{color:inherit;text-decoration:underline}@media print{html,body{font-size:12px;background-color:#fff}.page-content{margin:0 auto}.print-hidden{display:none !important}.tri-layout-container{grid-template-columns:1fr;grid-template-areas:"b";margin-inline-start:0;margin-inline-end:0;display:block}.card{box-shadow:none}.content-wrap.card{padding-inline-start:0;padding-inline-end:0}}.dragged{position:absolute;opacity:.5;z-index:2000}body.dragging,body.dragging *{cursor:move !important}.avatar{border-radius:100%;background-color:#eee;width:30px;height:30px}html.dark-mode .avatar{background-color:#000}.avatar.med{width:40px;height:40px}.avatar.large{width:80px;height:80px}.avatar.huge{width:120px;height:120px}.avatar.square{border-radius:3px}html.dark-mode .avatar[src$="user_avatar.png"]{filter:invert(1)}.loading-container{position:relative;display:block;margin:32px auto}.loading-container>div{width:10px;height:10px;border-radius:10px;display:inline-block;vertical-align:top;transform:translate3d(-10px, 0, 0);margin-top:6px;animation-name:loadingBob;animation-duration:1.4s;animation-iteration-count:infinite;animation-timing-function:cubic-bezier(0.62, 0.28, 0.23, 0.99);margin-inline-end:4px;background-color:var(--color-page);animation-delay:-300ms}.loading-container>div:first-child{left:-16px;background-color:var(--color-book);animation-delay:-600ms}.loading-container>div:last-of-type{left:16px;background-color:var(--color-chapter);animation-delay:0ms}.loading-container>span{margin-inline-start:12px;font-style:italic;color:#888;vertical-align:top}.skip-to-content-link{position:fixed;top:-52px;left:0;background-color:#fff;z-index:15;border-radius:0 4px 4px 0;display:block;box-shadow:0 0 4px 1px rgba(0,0,0,.5);font-weight:bold}.skip-to-content-link:focus{top:32px;outline-offset:-10px;outline:2px dotted var(--color-link)}.entity-selector{border:1px solid #ddd;border-color:#ddd;border-radius:3px;overflow:hidden;font-size:.8em}html.dark-mode .entity-selector{border-color:#111}.entity-selector input[type=text]{width:100%;display:block;border-radius:0;border:0;border-bottom:1px solid #ddd;font-size:16px;padding:12px 16px}.entity-selector .entity-list{overflow-y:scroll;height:400px;background-color:#eee;margin-inline-end:0;margin-inline-start:0}html.dark-mode .entity-selector .entity-list{background-color:#222}.entity-selector .entity-list-item{background-color:#fff}html.dark-mode .entity-selector .entity-list-item{background-color:#222}.entity-selector .entity-list-item p{margin-bottom:0}.entity-selector .entity-list-item:focus{outline:2px dotted var(--color-primary);outline-offset:-4px}.entity-selector .entity-list-item.selected{background-color:rgba(0,0,0,.05)}html.dark-mode .entity-selector .entity-list-item.selected{background-color:rgba(255,255,255,.05)}.entity-selector .loading{height:400px;padding-top:24px}.entity-selector.compact{font-size:10px}.entity-selector.compact .entity-item-snippet{display:none}.entity-selector.compact h4{font-size:14px}.fullscreen{border:0;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;z-index:150}@media screen and (min-width: 600px)and (max-width: 880px){#home-default>.grid.third{display:block;columns:2;column-gap:24px !important}}.list-sort-container{display:inline-block}.list-sort-container form{display:inline-block}.list-sort-container .list-sort{display:inline-grid;margin-inline-start:12px;grid-template-columns:minmax(120px, max-content) 40px;font-size:.9rem;border:2px solid #ddd;border-color:#ddd;border-radius:4px}html.dark-mode .list-sort-container .list-sort{border-color:#444}.list-sort-container .list-sort-label{font-weight:bold;display:inline-block;color:#555}html.dark-mode .list-sort-container .list-sort-label{color:#888}.list-sort-container .list-sort-type{text-align:start}.list-sort-container .list-sort-type,.list-sort-container .list-sort-dir{padding:6px 12px;cursor:pointer}.list-sort-container .list-sort-dir{border-inline-start:2px solid #ddd;color:#888;border-color:#ddd}html.dark-mode .list-sort-container .list-sort-dir{border-color:#444}.list-sort-container .list-sort-dir .svg-icon{transition:transform ease-in-out 120ms}.list-sort-container .list-sort-dir:hover .svg-icon{transform:rotate(180deg)}/*# sourceMappingURL=styles.css.map */ diff --git a/version b/version index 4bf7b7d12..bb85ca38b 100644 --- a/version +++ b/version @@ -1 +1 @@ -v24.05 +v24.05.1