diff --git a/assets/js/search-bar.js b/assets/js/search-bar.js index f8b78660d..a8b5390fe 100644 --- a/assets/js/search-bar.js +++ b/assets/js/search-bar.js @@ -80,7 +80,7 @@ function addEventListeners () { } else if (event.key === 'ArrowDown' || (appleOS && event.ctrlKey && event.key === 'n')) { moveAutocompleteSelection(1) event.preventDefault() - } else if (event.key === 'Tab') { + } else if (event.key === 'Tab' && selectedAutocompleteSuggestion() !== null) { togglePreview() event.preventDefault() } diff --git a/formatters/html/dist/html-ZOXW4WH5.js b/formatters/html/dist/html-ZOXW4WH5.js deleted file mode 100644 index ebeb9fade..000000000 --- a/formatters/html/dist/html-ZOXW4WH5.js +++ /dev/null @@ -1,56 +0,0 @@ -(()=>{var Qi=Object.create;var Dt=Object.defineProperty;var Mi=Object.getOwnPropertyDescriptor;var Di=Object.getOwnPropertyNames;var Fi=Object.getPrototypeOf,Bi=Object.prototype.hasOwnProperty;var Ft=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var $i=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Di(t))!Bi.call(e,r)&&r!==n&&Dt(e,r,{get:()=>t[r],enumerable:!(i=Mi(t,r))||i.enumerable});return e};var Bt=(e,t,n)=>(n=e!=null?Qi(Fi(e)):{},$i(t||!e||!e.__esModule?Dt(n,"default",{value:e,enumerable:!0}):n,e));var nn=Ft((da,tn)=>{var en="Expected a function",Xt=NaN,ar="[object Symbol]",cr=/^\s+|\s+$/g,lr=/^[-+]0x[0-9a-f]+$/i,ur=/^0b[01]+$/i,dr=/^0o[0-7]+$/i,hr=parseInt,fr=typeof global=="object"&&global&&global.Object===Object&&global,pr=typeof self=="object"&&self&&self.Object===Object&&self,mr=fr||pr||Function("return this")(),gr=Object.prototype,vr=gr.toString,yr=Math.max,wr=Math.min,Ye=function(){return mr.Date.now()};function br(e,t,n){var i,r,s,o,a,c,l=0,u=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(en);t=Zt(t)||0,Le(n)&&(u=!!n.leading,h="maxWait"in n,s=h?yr(Zt(n.maxWait)||0,t):s,f="trailing"in n?!!n.trailing:f);function y(E){var P=i,B=r;return i=r=void 0,l=E,o=e.apply(B,P),o}function w(E){return l=E,a=setTimeout(m,t),u?y(E):o}function b(E){var P=E-c,B=E-l,z=t-P;return h?wr(z,s-B):z}function g(E){var P=E-c,B=E-l;return c===void 0||P>=t||P<0||h&&B>=s}function m(){var E=Ye();if(g(E))return x(E);a=setTimeout(m,b(E))}function x(E){return a=void 0,f&&i?y(E):(i=r=void 0,o)}function C(){a!==void 0&&clearTimeout(a),l=0,i=c=r=a=void 0}function M(){return a===void 0?o:x(Ye())}function F(){var E=Ye(),P=g(E);if(i=arguments,r=this,c=E,P){if(a===void 0)return w(c);if(h)return a=setTimeout(m,t),y(c)}return a===void 0&&(a=setTimeout(m,t)),o}return F.cancel=C,F.flush=M,F}function Sr(e,t,n){var i=!0,r=!0;if(typeof e!="function")throw new TypeError(en);return Le(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),br(e,t,{leading:i,maxWait:t,trailing:r})}function Le(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Er(e){return!!e&&typeof e=="object"}function xr(e){return typeof e=="symbol"||Er(e)&&vr.call(e)==ar}function Zt(e){if(typeof e=="number")return e;if(xr(e))return Xt;if(Le(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Le(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(cr,"");var n=ur.test(e);return n||dr.test(e)?hr(e.slice(2),n?2:8):lr.test(e)?Xt:+e}tn.exports=Sr});var Fn=Ft((Mn,Dn)=>{(function(){var e=function(t){var n=new e.Builder;return n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),n.searchPipeline.add(e.stemmer),t.call(n,n),n.build()};e.version="2.3.9";e.utils={},e.utils.warn=function(t){return function(n){t.console&&console.warn&&console.warn(n)}}(this),e.utils.asString=function(t){return t==null?"":t.toString()},e.utils.clone=function(t){if(t==null)return t;for(var n=Object.create(null),i=Object.keys(t),r=0;r0){var u=e.utils.clone(n)||{};u.position=[a,l],u.index=s.length,s.push(new e.Token(i.slice(a,o),u))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/;e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var n=t.label&&t.label in this.registeredFunctions;n||e.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(i){var r=e.Pipeline.registeredFunctions[i];if(r)n.add(r);else throw new Error("Cannot load unregistered function: "+i)}),n},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(n){e.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},e.Pipeline.prototype.after=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i=i+1,this._stack.splice(i,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},e.Pipeline.prototype.remove=function(t){var n=this._stack.indexOf(t);n!=-1&&this._stack.splice(n,1)},e.Pipeline.prototype.run=function(t){for(var n=this._stack.length,i=0;i1&&(ot&&(i=s),o!=t);)r=i-n,s=n+Math.floor(r/2),o=this.elements[s*2];if(o==t||o>t)return s*2;if(oc?u+=2:a==c&&(n+=i[l+1]*r[u+1],l+=2,u+=2);return n},e.Vector.prototype.similarity=function(t){return this.dot(t)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var t=new Array(this.elements.length/2),n=1,i=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new e.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),r.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new e.TokenSet;s.node.edges["*"]=c}if(s.str.length==0&&(c.final=!0),r.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&r.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),r.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var u=s.str.charAt(0),h=s.str.charAt(1),f;h in s.node.edges?f=s.node.edges[h]:(f=new e.TokenSet,s.node.edges[h]=f),s.str.length==1&&(f.final=!0),r.push({node:f,editsRemaining:s.editsRemaining-1,str:u+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,i=n,r=0,s=t.length;r=t;n--){var i=this.uncheckedNodes[n],r=i.child.toString();r in this.minimizedNodes?i.parent.edges[i.char]=this.minimizedNodes[r]:(i.child._str=r,this.minimizedNodes[r]=i.child),this.uncheckedNodes.pop()}};e.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},e.Index.prototype.search=function(t){return this.query(function(n){var i=new e.QueryParser(t,n);i.parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),i=Object.create(null),r=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),c=0;c1?this._b=1:this._b=t},e.Builder.prototype.k1=function(t){this._k1=t},e.Builder.prototype.add=function(t,n){var i=t[this._ref],r=Object.keys(this._fields);this._documents[i]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,n;do t=this.next(),n=t.charCodeAt(0);while(n>47&&n<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var n=t.next();if(n==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){t.escapeCharacter();continue}if(n==":")return e.QueryLexer.lexField;if(n=="~")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if(n=="^")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if(n=="+"&&t.width()===1||n=="-"&&t.width()===1)return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(n.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}},e.QueryParser=function(t,n){this.lexer=new e.QueryLexer(t),this.query=n,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},e.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},e.QueryParser.parseClause=function(t){var n=t.peekLexeme();if(n!=null)switch(n.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(i+=" with value '"+n.str+"'"),new e.QueryParseError(i,n.start,n.end)}},e.QueryParser.parsePresence=function(t){var n=t.consumeLexeme();if(n!=null){switch(n.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+n.str+"'";throw new e.QueryParseError(i,n.start,n.end)}var r=t.peekLexeme();if(r==null){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,n.start,n.end)}switch(r.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+r.type+"'";throw new e.QueryParseError(i,r.start,r.end)}}},e.QueryParser.parseField=function(t){var n=t.consumeLexeme();if(n!=null){if(t.query.allFields.indexOf(n.str)==-1){var i=t.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),r="unrecognised field '"+n.str+"', possible fields: "+i;throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.fields=[n.str];var s=t.peekLexeme();if(s==null){var r="expecting term, found nothing";throw new e.QueryParseError(r,n.start,n.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expecting term, found '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var n=t.consumeLexeme();if(n!=null){t.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(i==null){t.nextClause();return}switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(r,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var n=t.consumeLexeme();if(n!=null){var i=parseInt(n.str,10);if(isNaN(i)){var r="edit distance must be numeric";throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(s==null){t.nextClause();return}switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var n=t.consumeLexeme();if(n!=null){var i=parseInt(n.str,10);if(isNaN(i)){var r="boost must be numeric";throw new e.QueryParseError(r,n.start,n.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(s==null){t.nextClause();return}switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(r,s.start,s.end)}}},function(t,n){typeof define=="function"&&define.amd?define(n):typeof Mn=="object"?Dn.exports=n():t.lunr=n()}(this,function(){return e})})()});Handlebars.registerHelper("groupChanged",function(e,t,n){let i=t||"";if(e.group!==i)return delete e.nestedContext,e.group=i,n.fn(this)});Handlebars.registerHelper("nestingChanged",function(e,t,n){if(t.nested_context&&t.nested_context!==e.nestedContext){if(e.nestedContext=t.nested_context,e.lastModuleSeenInGroup!==t.nested_context)return n.fn(this)}else e.lastModuleSeenInGroup=t.title});Handlebars.registerHelper("showSections",function(e,t){if(e.sections.length>0)return t.fn(this)});Handlebars.registerHelper("showSummary",function(e,t){if(e.nodeGroups)return t.fn(this)});Handlebars.registerHelper("isArray",function(e,t){return Array.isArray(e)?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isNonEmptyArray",function(e,t){return Array.isArray(e)&&e.length>0?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isEmptyArray",function(e,t){return Array.isArray(e)&&e.length===0?t.fn(this):t.inverse(this)});Handlebars.registerHelper("isLocal",function(e,t){let n=window.location.pathname.split("/").pop();return n===e+".html"||n===e?t.fn(this):t.inverse(this)});var d=document.querySelector.bind(document),A=document.querySelectorAll.bind(document);function $t(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Se(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function V(){return document.getElementById("main").dataset.type}function Ut(e,t){if(e){for(let n of e){let i=n.nodeGroups&&n.nodeGroups.find(r=>r.nodes.some(s=>s.anchor===t));if(i)return i.key}return null}}function Ee(e,t=!1){if(!e)return t?document.getElementById("top-content"):null;let n=document.getElementById(e);return n?n.matches(".detail")?n:["h1","h2","h3","h4","h5","h6"].includes(n.tagName.toLowerCase())?Ui(n):null:null}function Ui(e){let t=[e],n=e.nextElementSibling,i=e.tagName.toLowerCase();for(;n;){let s=n.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6"].includes(s)&&s<=i?n=null:(t.push(n),n=n.nextElementSibling)}let r=document.createElement("div");return r.append(...t),r}function ie(){return window.location.hash.replace(/^#/,"")}function qt(e){return new URLSearchParams(window.location.search).get(e)}function Vt(e){return fetch(e).then(t=>t.ok).catch(()=>!1)}function jt(e){document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)}function re(e){return!e||e.trim()===""}function zt(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{n=null,e(...r)},t)}}function xe(){return document.head.querySelector("meta[name=project][content]").content}function se(){return/(Macintosh|iPhone|iPad|iPod)/.test(window.navigator.userAgent)}var qi="content",Vi="tabs-open",ji="tabs-close",zi="H3",Wi="tabset";function Gt(){Gi().map(Ki).forEach(n=>Xi(n))}function Gi(){let e=document.createNodeIterator(document.getElementById(qi),NodeFilter.SHOW_COMMENT,{acceptNode(i){return i.nodeValue.trim()===Vi?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),t=[],n;for(;n=e.nextNode();)t.push(n);return t}function Ki(e,t,n){let i=[],r=[],s={label:"",content:[]};for(;e=e.nextSibling;){if(Yi(e)){Wt(s,r,t);break}i.push(e),e.nodeName===zi?(Wt(s,r,t),s.label=e.innerText,s.content=[]):s.content.push(e.outerHTML)}let o=document.createElement("div");return o.className=Wi,Ji(i,o),o.innerHTML=Handlebars.templates.tabset({tabs:r}),o}function Yi(e){return e.nodeName==="#comment"&&e.nodeValue.trim()===ji}function Wt(e,t,n){if(e.label===""&&!e.content.length)return!1;let i=e.label,r=e.content;t.push({label:i,content:r,setIndex:n})}function Ji(e,t){if(!e||!e.length)return!1;e[0].parentNode.insertBefore(t,e[0]),e.forEach(n=>t.appendChild(n))}function Xi(e){let t={tabs:e.querySelectorAll(':scope [role="tab"]'),panels:e.querySelectorAll(':scope [role="tabpanel"]'),activeIndex:0};t.tabs.forEach((n,i)=>{n.addEventListener("click",r=>{Y(i,t)}),n.addEventListener("keydown",r=>{let s=t.tabs.length-1;r.code==="ArrowLeft"?(r.preventDefault(),t.activeIndex===0?Y(s,t):Y(t.activeIndex-1,t)):r.code==="ArrowRight"?(r.preventDefault(),t.activeIndex===s?Y(0,t):Y(t.activeIndex+1,t)):r.code==="Home"?(r.preventDefault(),Y(0,t)):r.code==="End"&&(r.preventDefault(),Y(s,t))})})}function Y(e,t){t.tabs[t.activeIndex].setAttribute("aria-selected","false"),t.tabs[t.activeIndex].tabIndex=-1,t.tabs[e].setAttribute("aria-selected","true"),t.tabs[e].tabIndex=0,t.tabs[e].focus(),t.panels[t.activeIndex].setAttribute("hidden",""),t.panels[t.activeIndex].tabIndex=-1,t.panels[e].removeAttribute("hidden"),t.panels[e].tabIndex=0,t.activeIndex=e}var Kt="ex_doc:settings",Zi={tooltips:!0,theme:null,livebookUrl:null},Ke=class{constructor(){this._subscribers=[],this._settings=Zi,this._loadSettings()}get(){return this._settings}update(t){let n=this._settings;this._settings={...this._settings,...t},this._subscribers.forEach(i=>i(this._settings,n)),this._storeSettings()}getAndSubscribe(t){this._subscribers.push(t),t(this._settings)}_loadSettings(){try{let t=localStorage.getItem(Kt);if(t){let n=JSON.parse(t);this._settings={...this._settings,...n}}this._loadSettingsLegacy()}catch(t){console.error(`Failed to load settings: ${t}`)}}_storeSettings(){try{this._storeSettingsLegacy(),localStorage.setItem(Kt,JSON.stringify(this._settings))}catch(t){console.error(`Failed to persist settings: ${t}`)}}_loadSettingsLegacy(){localStorage.getItem("tooltipsDisabled")!==null&&(this._settings={...this._settings,tooltips:!1}),localStorage.getItem("night-mode")==="true"&&(this._settings={...this._settings,nightMode:!0}),this._settings.nightMode===!0&&(this._settings={...this._settings,theme:"dark"})}_storeSettingsLegacy(){this._settings.tooltips?localStorage.removeItem("tooltipsDisabled"):localStorage.setItem("tooltipsDisabled","true"),this._settings.nightMode!==null?localStorage.setItem("night-mode",this._settings.nightMode===!0?"true":"false"):localStorage.removeItem("night-mode"),this._settings.theme!==null?(localStorage.setItem("night-mode",this._settings.theme==="dark"?"true":"false"),this._settings.nightMode=this._settings.theme==="dark"):(delete this._settings.nightMode,localStorage.removeItem("night-mode"))}},I=new Ke;var er=".content",Yt=".content-inner",tr=".livebook-badge";function Jt(e){e||ir(),rr(),nr()}function nr(){d(er).querySelectorAll("a").forEach(e=>{e.querySelector("code, img")&&e.classList.add("no-underline")})}function ir(){d(Yt).setAttribute("tabindex",-1),d(Yt).focus()}function rr(){let t=window.location.pathname.replace(/(\.html)?$/,".livemd"),n=new URL(t,window.location.href).toString();I.getAndSubscribe(i=>{let r=i.livebookUrl?or(i.livebookUrl,n):sr(n);for(let s of A(tr))s.href=r})}function sr(e){return`https://livebook.dev/run?url=${encodeURIComponent(e)}`}function or(e,t){return`${e}/import?url=${encodeURIComponent(t)}`}var sn=Bt(nn());var Lr=768,Je=300,oe=".sidebar-toggle",Tr=".content",$={CLOSED:"closed",OPEN:"open",NO_PREF:"no_pref"},Q={opened:"sidebar-opened",openingStart:"sidebar-opening-start",opening:"sidebar-opening",closed:"sidebar-closed",closingStart:"sidebar-closing-start",closing:"sidebar-closing"},kr=Object.values(Q),R={togglingTimeout:null,lastWindowWidth:window.innerWidth,sidebarPreference:$.NO_PREF};function on(){an(),Or(),Cr()}function Or(){let e=sessionStorage.getItem("sidebar_width");e&&rn(e),new ResizeObserver(n=>{for(let i of n)rn(i.contentRect.width)}).observe(document.getElementById("sidebar"))}function rn(e){sessionStorage.setItem("sidebar_width",e),document.body.style.setProperty("--sidebarWidth",`${e}px`)}function an(){sessionStorage.getItem("sidebar_state")==="closed"||cn()?(j(Q.closed),d(oe).setAttribute("aria-expanded","false")):(j(Q.opened),d(oe).setAttribute("aria-expanded","true")),setTimeout(()=>d(oe).classList.add("sidebar-toggle--animated"),Je)}function cn(){return window.matchMedia(`screen and (max-width: ${Lr}px)`).matches}function j(...e){document.body.classList.remove(...kr),document.body.classList.add(...e)}function Cr(){d(oe).addEventListener("click",e=>{Xe(),_r()}),d(Tr).addEventListener("click",e=>{Ir()}),window.addEventListener("resize",(0,sn.default)(e=>{Ar()},100))}function Xe(){return Ze()?un():et()}function Ze(){return document.body.classList.contains(Q.opened)||document.body.classList.contains(Q.opening)}function ln(){return document.body.classList.contains(Q.opened)}function et(){return dn(),sessionStorage.setItem("sidebar_state","opened"),d(oe).setAttribute("aria-expanded","true"),new Promise((e,t)=>{requestAnimationFrame(()=>{j(Q.openingStart),requestAnimationFrame(()=>{j(Q.opening),R.togglingTimeout=setTimeout(()=>{j(Q.opened),e()},Je)})})})}function un(){return dn(),sessionStorage.setItem("sidebar_state","closed"),d(oe).setAttribute("aria-expanded","false"),new Promise((e,t)=>{requestAnimationFrame(()=>{j(Q.closingStart),requestAnimationFrame(()=>{j(Q.closing),R.togglingTimeout=setTimeout(()=>{j(Q.closed),e()},Je)})})})}function dn(){R.togglingTimeout&&(clearTimeout(R.togglingTimeout),R.togglingTimeout=null)}function Ar(){R.lastWindowWidth!==window.innerWidth&&(R.lastWindowWidth=window.innerWidth,(R.sidebarPreference===$.OPEN||R.sidebarPreference===$.NO_PREF)&&an())}function Ir(){cn()&&Ze()&&un()}function _r(){switch(R.sidebarPreference){case $.OPEN:R.sidebarPreference=$.CLOSED;break;case $.CLOSED:R.sidebarPreference=$.OPEN;break;case $.NO_PREF:Ze()?R.sidebarPreference=$.OPEN:R.sidebarPreference=$.CLOSED}}function he(){return window.sidebarNodes||{}}function hn(){return window.versionNodes||[]}var tt={search:"search",extras:"extras",modules:"modules",tasks:"tasks"},nt=[tt.extras,tt.modules,tt.tasks],ke=e=>`#${e}-full-list`;function it(){nt.forEach(e=>{Pr(he(),e)}),Te(V()),pn(),fn(),Fr()}function Pr(e,t){let n=e[t]||[],i=d(ke(t));if(!i)return;let r=Handlebars.templates["sidebar-items"]({nodes:n,group:""});i.innerHTML=r,i.querySelectorAll("ul").forEach(s=>{if(s.innerHTML.trim()===""){let o=s.previousElementSibling;o.classList.contains("expand")&&o.classList.remove("expand"),s.remove()}}),i.querySelectorAll("li a + button").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.closest("li");Nr(c)})}),i.querySelectorAll("li a").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.closest("li"),l=i.querySelector(".current-section");l&&Qr(l),s.matches(".expand")&&(s.pathname===window.location.pathname||s.pathname===window.location.pathname+".html")&&rt(c)})})}function rt(e){e.classList.add("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","true")}function Rr(e){e.classList.remove("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","false")}function Nr(e){e.classList.contains("open")?Rr(e):rt(e)}function Hr(e){e.classList.add("current-section"),e.querySelector("a").setAttribute("aria-current","true")}function Qr(e){e.classList.remove("current-section"),e.querySelector("a").setAttribute("aria-current","false")}function Mr(e){e.classList.add("current-hash"),e.querySelector("a").setAttribute("aria-current","true")}function Dr(e){e.classList.remove("current-hash"),e.querySelector("a").setAttribute("aria-current","false")}function Te(e){nt.forEach(t=>{let n=d(`#${t}-list-tab-button`);if(n){let i=d(`#${n.getAttribute("aria-controls")}`);t===e?(n.parentElement.classList.add("selected"),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),i.removeAttribute("hidden")):(n.parentElement.classList.remove("selected"),n.setAttribute("aria-selected","false"),n.setAttribute("tabindex","-1"),i.setAttribute("hidden","hidden"))}})}function fn(){let e=d(ke(V()));if(!e)return;let t=e.querySelector("li.current-page");t&&(t.scrollIntoView(),e.scrollTop-=40)}function pn(){let e=ie()||"content",n=he()[V()]||[],i=Ut(n,e),r=d(ke(V()));if(!r)return;let s=r.querySelector(`li.current-page a.expand[href$="#${i}"]`);s&&rt(s.closest("li"));let o=r.querySelector(`li.current-page a[href$="#${e}"]`);if(o){let a=o.closest("ul");a.classList.contains("deflist")&&Hr(a.closest("li")),Mr(o.closest("li"))}}function Fr(){nt.forEach(t=>{let n=d(`#${t}-list-tab-button`);n&&n.addEventListener("click",i=>{Te(t),fn()})});let e=d("#sidebar-listNav");e.addEventListener("keydown",t=>{if(t.key!=="ArrowRight"&&t.key!=="ArrowLeft")return;let n=Array.from(e.querySelectorAll('[role="tab"]')).map(r=>r.dataset.type),i=e.querySelector('[role="tab"][aria-selected="true"]').dataset.type;if(t.key==="ArrowRight"){let r=n.indexOf(i)+1;r>=n.length&&(r=0);let s=n[r];Te(s),d(`#${s}-list-tab-button`).focus()}else if(t.key==="ArrowLeft"){let r=n.indexOf(i)-1;r<0&&(r=n.length-1);let s=n[r];Te(s),d(`#${s}-list-tab-button`).focus()}}),window.addEventListener("hashchange",t=>{let n=d(ke(V()));if(!n)return;let i=n.querySelector("li.current-page li.current-hash");i&&Dr(i),pn()})}var U={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function gn(e,t=8){if(re(e))return[];let n=he(),i=[...st(n.modules,e,U.module,"module"),...Br(n.modules,e,U.moduleChild),...st(n.tasks,e,U.mixTask,"mix task"),...st(n.extras,e,U.extra,"page"),...ot(n.modules,e,U.section,"module"),...ot(n.tasks,e,U.section,"mix task"),...ot(n.extras,e,U.section,"page")].filter(r=>r!==null);return Wr(i).slice(0,t)}function st(e,t,n,i){return e.map(r=>Ur(r,t,n,i))}function Br(e,t,n){return e.filter(i=>i.nodeGroups).flatMap(i=>i.nodeGroups.flatMap(({key:r,nodes:s})=>{let o=zr(r);return s.map(a=>qr(a,i.id,t,n,o)||jr(a,i.id,t,n,o))}))}function ot(e,t,n,i){return e.flatMap(r=>$r(r).map(s=>Vr(r,s,t,n,i)))}function $r(e){return(e.sections||[]).concat(e.headers||[])}function Ur(e,t,n,i){return Ce(e.title,t)?{link:`${e.id}.html`,title:_e(e.title,t),description:null,matchQuality:Ae(e.title,t),deprecated:e.deprecated,labels:[i],category:n}:null}function qr(e,t,n,i,r){return Ce(e.id,n)?{link:`${t}.html#${e.anchor}`,title:_e(e.id,n),labels:[r],description:t,matchQuality:Ae(e.id,n),deprecated:e.deprecated,category:i}:null}function Vr(e,t,n,i,r){return vn(t.id,n)?{link:`${e.id}.html#${t.anchor}`,title:_e(t.id,n),description:e.title,matchQuality:Ae(t.id,n),labels:[r,"section"],category:i}:null}function jr(e,t,n,i,r){let s=`${t}.${e.id}`,o=`${t}:${e.id}`,a,c;if(Ce(s,n))a=s,c=/\./g;else if(Ce(o,n))a=o,c=/:/g;else return null;let l=n.replace(c," ");return vn(e.id,l)?{link:`${t}.html#${e.anchor}`,title:_e(e.id,l),label:r,description:t,matchQuality:Ae(a,n),deprecated:e.deprecated,category:i}:null}function zr(e){switch(e){case"callbacks":return"callback";case"types":return"type";default:return"function"}}function Wr(e){return e.slice().sort((t,n)=>t.matchQuality!==n.matchQuality?n.matchQuality-t.matchQuality:mn(t.category)-mn(n.category))}function mn(e){switch(e){case U.module:return 1;case U.moduleChild:return 2;case U.mixTask:return 3;default:return 4}}function vn(e,t){return Ie(t).some(i=>yn(e,i))}function Ce(e,t){return Ie(t).every(i=>yn(e,i))}function yn(e,t){return e.toLowerCase().includes(t.toLowerCase())}function Ae(e,t){let n=Ie(t),r=n.map(o=>o.length).reduce((o,a)=>o+a,0)/e.length,s=Gr(e,n[0])?1:0;return r+s}function Gr(e,t){return e.toLowerCase().startsWith(t.toLowerCase())}function Ie(e){return e.trim().split(/\s+/)}function _e(e,t){let n=Ie(t).sort((i,r)=>r.length-i.length);return Oe(e,n)}function Oe(e,t){if(t.length===0)return e;let[n,...i]=t,r=e.match(new RegExp(`(.*)(${$t(n)})(.*)`,"i"));if(r){let[,s,o,a]=r;return Oe(s,t)+""+Se(o)+""+Oe(a,t)}else return Oe(e,i)}var Pe=null,J=null;function wn(){J=document.getElementById("toast"),J.addEventListener("click",e=>{clearTimeout(Pe),e.target.classList.remove("show")})}function at(e){J&&(clearTimeout(Pe),J.innerText=e,J.classList.add("show"),Pe=setTimeout(()=>{J.classList.remove("show"),Pe=setTimeout(function(){J.innerText=""},1e3)},5e3))}var bn="dark",ct=["system","dark","light"];function Sn(e){I.getAndSubscribe(t=>{document.body.classList.toggle(bn,xn(e||t.theme))}),Yr()}function En(){let e=ct[ct.indexOf(lt())+1]||ct[0];I.update({theme:e}),at(`Set theme to "${e}"`)}function lt(){return I.get().theme||"system"}function xn(e){return e==="dark"||Kr()&&(e==null||e==="system")}function Kr(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function Yr(){window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>{let t=I.get().theme,n=xn(t);(t==null||t==="system")&&(document.body.classList.toggle(bn,n),at(`Browser changed theme to "${n?"dark":"light"}"`))})}var ae=".autocomplete",Ne=".autocomplete-suggestions",Re=".autocomplete-suggestion",_={autocompleteSuggestions:[],previewOpen:!1,selectedIdx:-1};function Jr(){d(ae).classList.add("shown")}function ut(){d(ae).classList.remove("shown")}function Ln(){return d(ae).classList.contains("shown")}function dt(e){_.autocompleteSuggestions=gn(e),_.selectedIdx=-1,re(e)?ut():(Xr({term:e,suggestions:_.autocompleteSuggestions}),He(0),Jr())}function Xr({term:e,suggestions:t}){let n=Handlebars.templates["autocomplete-suggestions"]({suggestions:t,term:e}),i=d(ae);i.innerHTML=n}function Tn(){return _.selectedIdx===-1?null:_.autocompleteSuggestions[_.selectedIdx]}function He(e){On(Zr(e))}function kn(e){if(e.data.type==="preview"){let{contentHeight:t}=e.data,n=d(".autocomplete-preview");n&&(n.style.height=`${t+32}px`,n.classList.remove("loading"))}}function On(e){_.selectedIdx=e;let t=d(Ne),n=d(`${Re}.selected`),i=d(`${Re}[data-index="${_.selectedIdx}"]`);if(n&&n.classList.remove("selected"),i){if(_.previewOpen){An(),window.addEventListener("message",kn),t.classList.add("previewing");let r=document.createElement("div");r.classList.add("autocomplete-preview"),r.classList.add("loading");let s=i.href.replace(".html",`.html?preview=true&theme=${lt()}`),o=document.createElement("iframe");o.setAttribute("src",s),r.appendChild(document.createElement("div")),r.appendChild(document.createElement("span")),r.appendChild(o),i.parentNode.insertBefore(r,i.nextSibling)}i.classList.add("selected"),i.scrollIntoView({block:"nearest"})}else t&&(t.scrollTop=0)}function Cn(){_.previewOpen?Qe():ht()}function Qe(){_.previewOpen=!1;let e=d(Ne);e&&e.classList.remove("previewing"),An()}function ht(e){_.previewOpen=!0,e?e=e.closest(Re):e=d(`${Re}[data-index="${_.selectedIdx}"]`),e&&On(parseInt(e.dataset.index))}function An(){let e=d(".autocomplete-preview");e&&(e.remove(),window.removeEventListener("message",kn))}function Zr(e){let t=_.autocompleteSuggestions.length+1;return(_.selectedIdx+e+1+t)%t-1}var fe="form.search-bar input",es="form.search-bar .search-close-button";function Pn(){ts(),window.onTogglePreviewClick=function(e,t){e.preventDefault(),e.stopImmediatePropagation(),pt(),t?ht(e.target):Qe()}}function Rn(e){let t=d(fe);t.value=e}function pt(){let e=d(fe);document.body.classList.add("search-focused"),e.focus()}function ts(){let e=d(fe);if(document.querySelector('meta[name="exdoc:autocomplete"][content="off"]'))return e.addEventListener("keydown",t=>{t.key==="Enter"&&In(t)}),!0;e.addEventListener("keydown",t=>{let n=se();t.key==="Escape"?(Me(),e.blur()):t.key==="Enter"?In(t):t.key==="ArrowUp"||n&&t.ctrlKey&&t.key==="p"?(He(-1),t.preventDefault()):t.key==="ArrowDown"||n&&t.ctrlKey&&t.key==="n"?(He(1),t.preventDefault()):t.key==="Tab"&&(Cn(),t.preventDefault())}),e.addEventListener("input",t=>{dt(t.target.value)}),e.addEventListener("focus",t=>{document.body.classList.contains("search-focused")||(document.body.classList.add("search-focused"),dt(t.target.value))}),e.addEventListener("blur",t=>{let n=t.relatedTarget,i=d(Ne);if(n&&i&&i.contains(n))return setTimeout(()=>{Ln()&&e.focus()},1e3),null;De()}),d(ae).addEventListener("click",t=>{t.shiftKey||t.ctrlKey?e.focus():(Me(),De())}),d(es).addEventListener("click",t=>{Me(),De()})}function In(e){let t=d(fe),n=e.shiftKey||e.ctrlKey,i=Tn();e.preventDefault();let r=n?"_blank":"_self",s=document.createElement("a");if(s.setAttribute("target",r),i)s.setAttribute("href",i.link);else{let o=document.querySelector('meta[name="exdoc:full-text-search-url"]'),a=o?o.getAttribute("content"):"search.html?q=";s.setAttribute("href",`${a}${encodeURIComponent(t.value)}`)}s.click(),n||(Me(),De())}function Me(){let e=d(fe);e.value=""}function De(){Qe(),document.body.classList.remove("search-focused"),ut()}var ft=window.scrollY,ns=70,_n=-2;window.addEventListener("scroll",function(){let e=window.scrollY;e===0||ft-e<_n&&e>ns?document.body.classList.remove("scroll-sticky"):ft-e>Math.abs(_n)&&document.body.classList.add("scroll-sticky"),ft=e<=0?0:e},!1);var Nn=".sidebar-projectVersion",Hn=".sidebar-projectVersionsDropdown";function Qn(){let e=hn();if(e.length>0){let n=d(Nn).textContent.trim(),i=rs(e,n);is({nodes:i})}}function is({nodes:e}){let t=d(Nn),n=Handlebars.templates["versions-dropdown"]({nodes:e});t.innerHTML=n,d(Hn).addEventListener("change",os)}function rs(e,t){return ss(e,t).map(i=>({...i,isCurrentVersion:i.version===t}))}function ss(e,t){return e.some(i=>i.version===t)?e:[{version:t,url:"#"},...e]}function os(e){let t=e.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,i=`${t}/${n}`;Vt(i).then(r=>{r?window.location.href=i:window.location.href=t})}function mt(){let e=d(Hn);e&&(e.focus(),e.addEventListener("keydown",t=>{(t.key==="Escape"||t.key==="v")&&(t.preventDefault(),e.blur())}),navigator.userActivation.isActive&&"showPicker"in HTMLSelectElement.prototype&&e.showPicker())}var D=Bt(Fn());var Fe=80,as="#search";D.default.tokenizer.separator=/\s+/;D.default.QueryLexer.termSeparator=/\s+/;D.default.Pipeline.registerFunction(Un,"docTokenSplitter");D.default.Pipeline.registerFunction(qn,"docTrimmer");function vt(){let e=window.location.pathname;if(e.endsWith("/search.html")||e.endsWith("/search")){let t=qt("q");cs(t)}}async function cs(e){if(re(e))gt({value:e});else{Rn(e);let t=await ls();try{let n=e.replaceAll(/(\B|\\):/g,"\\:"),i=ws(t.search(n));gt({value:e,results:i})}catch(n){gt({value:e,errorMessage:n.message})}}}function gt({value:e,results:t,errorMessage:n}){let i=d(as),r=Handlebars.templates["search-results"]({value:e,results:t,errorMessage:n});i.innerHTML=r}async function ls(){let e=await us();if(e)return e;let t=gs();return ds(t),t}async function us(){try{let e=sessionStorage.getItem($n());if(e){let t=await fs(e);return D.default.Index.load(t)}else return null}catch(e){return console.error("Failed to load index: ",e),null}}async function ds(e){try{let t=await hs(e);sessionStorage.setItem($n(),t)}catch(t){console.error("Failed to save index: ",t)}}async function hs(e){let t=new Blob([JSON.stringify(e)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),i=await(await new Response(t).blob()).arrayBuffer();return ps(i)}async function fs(e){let t=new Blob([ms(e)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(t).text();return JSON.parse(n)}function ps(e){let t="",n=new Uint8Array(e),i=n.byteLength;for(let r=0;r{this.add(e)})})}function vs(e){e.pipeline.before(D.default.stemmer,Un)}function Un(e){let t=[e],n=/\/\d+$/,i=/\:|\./,r=e.toString();if(r.replace(/^[.,;?!]+|[.,;]+$/g,""),r.startsWith("`")&&r.endsWith("`")&&(r=r.slice(1,-1)),n.test(r)){let o=e.toString().replace(n,"");t.push(e.clone().update(()=>o));let a=o.split(i);if(a.length>1){for(let l of a)t.push(e.clone().update(()=>l));let c=e.toString().split(i);t.push(e.clone().update(()=>c[c.length-1]))}r=a[a.length-1]}else r.startsWith("@")?(r=r.substring(1),t.push(e.clone().update(()=>r))):r.startsWith(":")&&(r=r.substring(1),t.push(e.clone().update(()=>r)));let s=r.split(/\_|\-/);if(s.length>1)for(let o of s)t.push(e.clone().update(()=>o));return t}function ys(e){e.pipeline.before(D.default.stemmer,qn)}function qn(e){return e.update(function(t){return t.replace(/^[^@:\w]+/,"").replace(/[^\?\!\w]+$/,"")})}function ws(e){return e.filter(t=>Bn(t.ref)).map(t=>{let n=Bn(t.ref),i=t.matchData.metadata;return{...n,metadata:i,excerpts:bs(n,i)}})}function Bn(e){return searchData.items.find(t=>t.ref===e)||null}function bs(e,t){let{doc:n}=e,r=Object.keys(t).filter(s=>"doc"in t[s]).map(s=>t[s].doc.position.map(([o,a])=>Ss(n,o,a))).reduce((s,o)=>s.concat(o),[]);return r.length===0?[n.slice(0,Fe*2)+(Fe*20?"...":"",e.slice(i,t),""+Se(e.slice(t,t+n))+"",e.slice(t+n,r),r{let n=t.getAttribute("data-group-id");t.addEventListener("mouseenter",i=>{Vn(n,!0)}),t.addEventListener("mouseleave",i=>{Vn(n,!1)})})}function Vn(e,t){A(`[data-group-id="${e}"]`).forEach(i=>{i.classList.toggle(Es,t)})}var Z=".modal",Ls=".modal .modal-close",Ts=".modal .modal-title",ks=".modal .modal-body",zn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',q={prevFocus:null,lastFocus:null,ignoreFocusChanges:!1};function Wn(){Os()}function Os(){let e=Handlebars.templates["modal-layout"]();document.body.insertAdjacentHTML("beforeend",e),d(Z).addEventListener("keydown",t=>{t.key==="Escape"&&X()}),d(Ls).addEventListener("click",t=>{X()}),d(Z).addEventListener("click",t=>{t.target.classList.contains("modal")&&X()})}function Gn(e){if(q.ignoreFocusChanges)return;let t=d(Z);if(t.contains(e.target))q.lastFocus=e.target;else{q.ignoreFocusChanges=!0;let n=Cs(t);q.lastFocus===n?As(t).focus():n.focus(),q.ignoreFocusChanges=!1,q.lastFocus=document.activeElement}}function Cs(e){return e.querySelector(zn)}function As(e){let t=e.querySelectorAll(zn);return t[t.length-1]}function Be({title:e,body:t}){q.prevFocus=document.activeElement,document.addEventListener("focus",Gn,!0),d(Ts).innerHTML=e,d(ks).innerHTML=t,d(Z).classList.add("shown"),d(Z).focus()}function X(){d(Z).classList.remove("shown"),document.addEventListener("focus",Gn,!0),q.prevFocus&&q.prevFocus.focus(),q.prevFocus=null}function Kn(){return d(Z).classList.contains("shown")}var Is="https://hexdocs.pm/%%",_s="https://www.erlang.org/doc/apps/%%",Ps="https://hex.pm/api/packages?search=name:%%*",Rs=".display-quick-switch",yt="#quick-switch-input",Jn="#quick-switch-results",Ns=".quick-switch-result",Hs=300,Qs=9,Xn=["erts","asn1","common_test","compiler","crypto","debugger","dialyzer","diameter","edoc","eldap","erl_interface","et","eunit","ftp","inets","jinterface","kernel","megaco","mnesia","observer","odbc","os_mon","parsetools","public_key","reltool","runtime_tools","sasl","snmp","ssh","ssl","stdlib","syntax_tools","tftp","tools","wx","xmerl"],Ms=["elixir","eex","ex_unit","hex","iex","logger","mix"].concat(Xn).map(e=>({name:e})),Zn=2,N={autocompleteResults:[],selectedIdx:null};function ei(){Ds()}function Ds(){A(Rs).forEach(e=>{e.addEventListener("click",t=>{bt()})})}function Fs(e){if(e.key==="Enter"){let t=e.target.value;$s(t),e.preventDefault()}else e.key==="ArrowUp"?(Yn(-1),e.preventDefault()):e.key==="ArrowDown"&&(Yn(1),e.preventDefault())}function Bs(e){let t=e.target.value;if(t.lengthn.json()).then(n=>{Array.isArray(n)&&(N.autocompleteResults=js(e,n),N.selectedIdx=null,d(yt).value.length>=Zn&&Vs({results:N.autocompleteResults}))})}function Vs({results:e}){let t=d(Jn),n=Handlebars.templates["quick-switch-results"]({results:e});t.innerHTML=n,A(Ns).forEach(i=>{i.addEventListener("click",r=>{let s=i.getAttribute("data-index"),o=N.autocompleteResults[s];wt(o.name)})})}function js(e,t){return Ms.concat(t).filter(n=>n.name.toLowerCase().includes(e.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,Qs)}function Yn(e){N.selectedIdx=zs(e);let t=d(".quick-switch-result.selected"),n=d(`.quick-switch-result[data-index="${N.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function zs(e){let t=N.autocompleteResults.length;if(N.selectedIdx===null){if(e>=0)return 0;if(e<0)return t-1}return(N.selectedIdx+e+t)%t}var Ws=".display-settings",Gs="#settings-modal-content",St="#modal-settings-tab",Et="#modal-keyboard-shortcuts-tab",ni="#settings-content",ii="#keyboard-shortcuts-content",Ks=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];function ri(){Ys()}function Ys(){A(Ws).forEach(e=>{e.addEventListener("click",t=>{xt()})})}function ti(){d(Et).classList.remove("active"),d(St).classList.add("active"),d(ni).classList.remove("hidden"),d(ii).classList.add("hidden")}function Js(){d(Et).classList.add("active"),d(St).classList.remove("active"),d(ii).classList.remove("hidden"),d(ni).classList.add("hidden")}function xt(){Be({title:Ks.map(({id:s,title:o})=>``).join(""),body:Handlebars.templates["settings-modal-body"]({shortcuts:Lt})});let e=d(Gs),t=e.querySelector('[name="theme"]'),n=e.querySelector('[name="tooltips"]'),i=e.querySelector('[name="direct_livebook_url"]'),r=e.querySelector('[name="livebook_url"]');I.getAndSubscribe(s=>{t.value=s.theme||"system",n.checked=s.tooltips,s.livebookUrl===null?(i.checked=!1,r.classList.add("hidden"),r.tabIndex=-1):(i.checked=!0,r.classList.remove("hidden"),r.tabIndex=0,r.value=s.livebookUrl)}),t.addEventListener("change",s=>{I.update({theme:s.target.value})}),n.addEventListener("change",s=>{I.update({tooltips:s.target.checked})}),i.addEventListener("change",s=>{let o=s.target.checked?r.value:null;I.update({livebookUrl:o})}),r.addEventListener("input",s=>{I.update({livebookUrl:s.target.value})}),d(St).addEventListener("click",s=>{ti()}),d(Et).addEventListener("click",s=>{Js()}),ti()}var Xs="#settings-modal-content",Lt=[{key:"c",description:"Toggle sidebar",action:Xe},{key:"n",description:"Cycle themes",action:En},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:Tt},{key:"/",action:Tt},{key:"k",hasModifier:!0,action:Tt},{key:"v",description:"Open/focus version select",action:no},{key:"g",description:"Go to package docs",displayAs:"g",action:bt},{key:"?",displayAs:"?",description:"Bring up this modal",action:io}],kt={shortcutBeingPressed:null};function si(){Zs()}function Zs(){document.addEventListener("keydown",eo),document.addEventListener("keyup",to)}function eo(e){if(kt.shortcutBeingPressed||e.target.matches("input, select, textarea"))return;let t=Lt.find(n=>n.hasModifier?se()&&e.metaKey||e.ctrlKey?n.key===e.key:!1:e.ctrlKey||e.metaKey||e.altKey?!1:n.key===e.key);t&&(kt.shortcutBeingPressed=t,e.preventDefault(),t.action(e))}function to(e){kt.shortcutBeingPressed=null}function Tt(e){X(),pt()}function no(){X(),ln()?mt():et().then(mt)}function io(){ro()?X():xt()}function ro(){return Kn()&&d(Xs)}var ee={plain:"plain",function:"function",module:"module"},so=[{href:"typespecs.html#basic-types",hint:{kind:ee.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:ee.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:ee.plain,description:"Built-in type"}}],$e={cancelHintFetching:null};function oi(e){if(ci(e))return!0;let t=/#.*\//;return e.includes("#")&&!t.test(e)?!1:e.includes(".html")}function ai(e){let t=ci(e);return t?Promise.resolve(t):oo(e)}function ci(e){let t=so.find(n=>e.includes(n.href));return t?t.hint:null}function oo(e){let t=e.replace(".html",".html?hint=true");return new Promise((n,i)=>{let r=document.createElement("iframe");r.setAttribute("src",t),r.style.display="none";function s(a){let{href:c,hint:l}=a.data;t===c&&(o(),n(l))}$e.cancelHintFetching=()=>{o(),i(new Error("cancelled"))};function o(){r.remove(),window.removeEventListener("message",s),$e.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(r)})}function li(){$e.cancelHintFetching&&$e.cancelHintFetching()}function ui(e){let n=e.querySelector("h1").textContent,i=e.querySelector(".docstring > p"),r=i?i.innerHTML:"";return{kind:ee.function,title:n.trim(),description:r.trim()}}function di(e){let n=e.querySelector("h1 > span").textContent,i=e.querySelector("#moduledoc p"),r=i?i.innerHTML:"";return{kind:ee.module,title:n.trim(),description:r.trim()}}var ao=".content a",Ot=".tooltip",co=".tooltip .tooltip-body",fi="body .content-inner",lo="#content",pi="tooltip-shown",pe=10,uo=pe*4,hi={height:450,width:768},ho=100,ce={currentLinkElement:null,hoverDelayTimeout:null};function mi(){fo(),po()}function fo(){let e=Handlebars.templates["tooltip-layout"]();d(fi).insertAdjacentHTML("beforeend",e)}function po(){A(ao).forEach(e=>{mo(e)&&(e.addEventListener("mouseenter",t=>{vo(e)}),e.addEventListener("mouseleave",t=>{So(e)}))})}function mo(e){return!(e.getAttribute("data-no-tooltip")!==null||go(e.href)||!oi(e.href))}function go(e){let t=e.replace(lo,"");return window.location.href.split("#")[0]===t}function vo(e){yo()&&(ce.currentLinkElement=e,ce.hoverDelayTimeout=setTimeout(()=>{ai(e.href).then(t=>{wo(t),bo()}).catch(()=>{})},ho))}function yo(){let e=window.innerWidthe.firstElementChild&&e.firstElementChild.tagName==="CODE").forEach(e=>e.insertAdjacentHTML("beforeend",Io)),Array.from(A(".copy-button")).forEach(e=>{let t;e.addEventListener("click",()=>{let n=e.querySelector("[aria-live]");t&&clearTimeout(t);let i=Array.from(e.parentElement.querySelector("code").childNodes).filter(r=>!(r.tagName==="SPAN"&&r.classList.contains("unselectable"))).map(r=>r.textContent).join("");navigator.clipboard.writeText(i),e.classList.add("clicked"),n.innerHTML="Copied! ✓",t=setTimeout(()=>{e.classList.remove("clicked"),n.innerHTML=""},3e3)})})}function bi(){let e=se()?"apple-os":"non-apple-os";document.documentElement.classList.add(e)}function Ei(){let e=Ee(ie(),!0);e&&Po(e)}function Po(e){Ho(e),Ro(),No(),Si(),window.addEventListener("resize",t=>{Si()})}function Si(){let e=document.body.scrollHeight,t=document.getElementById("content").parentElement.offsetHeight,n={type:"preview",maxHeight:e,contentHeight:t};window.parent.postMessage(n,"*")}function Ro(){let e=document.getElementsByTagName("a");for(let t of e)t.getAttribute("target")!=="_blank"&&t.setAttribute("target","_parent")}function No(){window.scrollTo(0,0)}function Ho(e){document.body.classList.add("preview");let t=document.getElementById("content");t.innerHTML=e.innerHTML}var Ct=new WeakMap;function At(e,t,n,i){if(!e&&!Ct.has(t))return!1;let r=Ct.get(t)??new WeakMap;Ct.set(t,r);let s=r.get(n)??new Set;r.set(n,s);let o=s.has(i);return e?s.add(i):s.delete(i),o&&e}function Qo(e,t){let n=e.target;if(n instanceof Text&&(n=n.parentElement),n instanceof Element&&e.currentTarget instanceof Element){let i=n.closest(t);if(i&&e.currentTarget.contains(i))return i}}function Mo(e,t,n,i={}){let{signal:r,base:s=document}=i;if(r?.aborted)return;let{once:o,...a}=i,c=s instanceof Document?s.documentElement:s,l=Boolean(typeof i=="object"?i.capture:i),u=y=>{let w=Qo(y,String(e));if(w){let b=Object.assign(y,{delegateTarget:w});n.call(c,b),o&&(c.removeEventListener(t,u,a),At(!1,c,n,h))}},h=JSON.stringify({selector:e,type:t,capture:l});At(!0,c,n,h)||c.addEventListener(t,u,a),r?.addEventListener("abort",()=>{At(!1,c,n,h)})}var Ue=Mo;function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;tString(e).toLowerCase().replace(/[\s/_.]+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+|-+$/g,"")||t||"",ge=({hash:e}={})=>window.location.pathname+window.location.search+(e?window.location.hash:""),Do=(e,t={})=>{let n=k({url:e=e||ge({hash:!0}),random:Math.random(),source:"swup"},t);window.history.pushState(n,"",e)},me=(e=null,t={})=>{e=e||ge({hash:!0});let n=k({},window.history.state||{},{url:e,random:Math.random(),source:"swup"},t);window.history.replaceState(n,"",e)},Fo=(e,t,n,i)=>{let r=new AbortController;return i=k({},i,{signal:r.signal}),Ue(e,t,n,i),{destroy:()=>r.abort()}},O=class extends URL{constructor(t,n=document.baseURI){super(t.toString(),n),Object.setPrototypeOf(this,O.prototype)}get url(){return this.pathname+this.search}static fromElement(t){let n=t.getAttribute("href")||t.getAttribute("xlink:href")||"";return new O(n)}static fromUrl(t){return new O(t)}};var le=class extends Error{constructor(t,n){super(t),this.url=void 0,this.status=void 0,this.aborted=void 0,this.timedOut=void 0,this.name="FetchError",this.url=n.url,this.status=n.status,this.aborted=n.aborted||!1,this.timedOut=n.timedOut||!1}};async function Bo(e,t={}){var n;e=O.fromUrl(e).url;let{visit:i=this.visit}=t,r=k({},this.options.requestHeaders,t.headers),s=(n=t.timeout)!=null?n:this.options.timeout,o=new AbortController,{signal:a}=o;t=k({},t,{headers:r,signal:a});let c,l=!1,u=null;s&&s>0&&(u=setTimeout(()=>{l=!0,o.abort("timeout")},s));try{c=await this.hooks.call("fetch:request",i,{url:e,options:t},(g,{url:m,options:x})=>fetch(m,x)),u&&clearTimeout(u)}catch(g){throw l?(this.hooks.call("fetch:timeout",i,{url:e}),new le(`Request timed out: ${e}`,{url:e,timedOut:l})):g?.name==="AbortError"||a.aborted?new le(`Request aborted: ${e}`,{url:e,aborted:!0}):g}let{status:h,url:f}=c,y=await c.text();if(h===500)throw this.hooks.call("fetch:error",i,{status:h,response:c,url:f}),new le(`Server error: ${f}`,{status:h,url:f});if(!y)throw new le(`Empty response: ${f}`,{status:h,url:f});let{url:w}=O.fromUrl(f),b={url:w,html:y};return!i.cache.write||t.method&&t.method!=="GET"||e!==w||this.cache.set(b.url,b),b}var _t=class{constructor(t){this.swup=void 0,this.pages=new Map,this.swup=t}get size(){return this.pages.size}get all(){let t=new Map;return this.pages.forEach((n,i)=>{t.set(i,k({},n))}),t}has(t){return this.pages.has(this.resolve(t))}get(t){let n=this.pages.get(this.resolve(t));return n&&k({},n)}set(t,n){n=k({},n,{url:t=this.resolve(t)}),this.pages.set(t,n),this.swup.hooks.callSync("cache:set",void 0,{page:n})}update(t,n){t=this.resolve(t);let i=k({},this.get(t),n,{url:t});this.pages.set(t,i)}delete(t){this.pages.delete(this.resolve(t))}clear(){this.pages.clear(),this.swup.hooks.callSync("cache:clear",void 0,void 0)}prune(t){this.pages.forEach((n,i)=>{t(i,n)&&this.delete(i)})}resolve(t){let{url:n}=O.fromUrl(t);return this.swup.resolveUrl(n)}},Pt=(e,t=document)=>t.querySelector(e),Ht=(e,t=document)=>Array.from(t.querySelectorAll(e)),Oi=()=>new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{e()})})});function Ci(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function $o(e,t=[]){return new Promise((n,i)=>{let r=e(...t);Ci(r)?r.then(n,i):n(r)})}function xi(e,t){let n=e?.closest(`[${t}]`);return n!=null&&n.hasAttribute(t)?n?.getAttribute(t)||!0:void 0}var Rt=class{constructor(t){this.swup=void 0,this.swupClasses=["to-","is-changing","is-rendering","is-popstate","is-animating","is-leaving"],this.swup=t}get selectors(){let{scope:t}=this.swup.visit.animation;return t==="containers"?this.swup.visit.containers:t==="html"?["html"]:Array.isArray(t)?t:[]}get selector(){return this.selectors.join(",")}get targets(){return this.selector.trim()?Ht(this.selector):[]}add(...t){this.targets.forEach(n=>n.classList.add(...t))}remove(...t){this.targets.forEach(n=>n.classList.remove(...t))}clear(){this.targets.forEach(t=>{let n=t.className.split(" ").filter(i=>this.isSwupClass(i));t.classList.remove(...n)})}isSwupClass(t){return this.swupClasses.some(n=>t.startsWith(n))}},je=class{constructor(t,n){this.id=void 0,this.state=void 0,this.from=void 0,this.to=void 0,this.containers=void 0,this.animation=void 0,this.trigger=void 0,this.cache=void 0,this.history=void 0,this.scroll=void 0,this.meta=void 0;let{to:i,from:r,hash:s,el:o,event:a}=n;this.id=Math.random(),this.state=1,this.from={url:r??t.location.url,hash:t.location.hash},this.to={url:i,hash:s},this.containers=t.options.containers,this.animation={animate:!0,wait:!1,name:void 0,native:t.options.native,scope:t.options.animationScope,selector:t.options.animationSelector},this.trigger={el:o,event:a},this.cache={read:t.options.cache,write:t.options.cache},this.history={action:"push",popstate:!1,direction:void 0},this.scroll={reset:!0,target:void 0},this.meta={}}advance(t){this.state=7}};function Uo(e){return new je(this,e)}var Nt=class{constructor(t){this.swup=void 0,this.registry=new Map,this.hooks=["animation:out:start","animation:out:await","animation:out:end","animation:in:start","animation:in:await","animation:in:end","animation:skip","cache:clear","cache:set","content:replace","content:scroll","enable","disable","fetch:request","fetch:error","fetch:timeout","history:popstate","link:click","link:self","link:anchor","link:newtab","page:load","page:view","scroll:top","scroll:anchor","visit:start","visit:transition","visit:abort","visit:end"],this.swup=t,this.init()}init(){this.hooks.forEach(t=>this.create(t))}create(t){this.registry.has(t)||this.registry.set(t,new Map)}exists(t){return this.registry.has(t)}get(t){let n=this.registry.get(t);if(n)return n;console.error(`Unknown hook '${t}'`)}clear(){this.registry.forEach(t=>t.clear())}on(t,n,i={}){let r=this.get(t);if(!r)return console.warn(`Hook '${t}' not found.`),()=>{};let s=k({},i,{id:r.size+1,hook:t,handler:n});return r.set(n,s),()=>this.off(t,n)}before(t,n,i={}){return this.on(t,n,k({},i,{before:!0}))}replace(t,n,i={}){return this.on(t,n,k({},i,{replace:!0}))}once(t,n,i={}){return this.on(t,n,k({},i,{once:!0}))}off(t,n){let i=this.get(t);i&&n?i.delete(n)||console.warn(`Handler for hook '${t}' not found.`):i&&i.clear()}async call(t,n,i,r){let[s,o,a]=this.parseCallArgs(t,n,i,r),{before:c,handler:l,after:u}=this.getHandlers(t,a);await this.run(c,s,o);let[h]=await this.run(l,s,o,!0);return await this.run(u,s,o),this.dispatchDomEvent(t,s,o),h}callSync(t,n,i,r){let[s,o,a]=this.parseCallArgs(t,n,i,r),{before:c,handler:l,after:u}=this.getHandlers(t,a);this.runSync(c,s,o);let[h]=this.runSync(l,s,o,!0);return this.runSync(u,s,o),this.dispatchDomEvent(t,s,o),h}parseCallArgs(t,n,i,r){return n instanceof je||typeof n!="object"&&typeof i!="function"?[n,i,r]:[void 0,n,i]}async run(t,n=this.swup.visit,i,r=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:c,once:l}of t)if(n==null||!n.done){l&&this.off(o,a);try{let u=await $o(a,[n,i,c]);s.push(u)}catch(u){if(r)throw u;console.error(`Error in hook '${o}':`,u)}}return s}runSync(t,n=this.swup.visit,i,r=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:c,once:l}of t)if(n==null||!n.done){l&&this.off(o,a);try{let u=a(n,i,c);s.push(u),Ci(u)&&console.warn(`Swup will not await Promises in handler for synchronous hook '${o}'.`)}catch(u){if(r)throw u;console.error(`Error in hook '${o}':`,u)}}return s}getHandlers(t,n){let i=this.get(t);if(!i)return{found:!1,before:[],handler:[],after:[],replaced:!1};let r=Array.from(i.values()),s=this.sortRegistrations,o=r.filter(({before:h,replace:f})=>h&&!f).sort(s),a=r.filter(({replace:h})=>h).filter(h=>!0).sort(s),c=r.filter(({before:h,replace:f})=>!h&&!f).sort(s),l=a.length>0,u=[];if(n&&(u=[{id:0,hook:t,handler:n}],l)){let h=a.length-1,{handler:f,once:y}=a[h],w=b=>{let g=a[b-1];return g?(m,x)=>g.handler(m,x,w(b-1)):n};u=[{id:0,hook:t,once:y,handler:f,defaultHandler:w(h)}]}return{found:!0,before:o,handler:u,after:c,replaced:l}}sortRegistrations(t,n){var i,r;return((i=t.priority)!=null?i:0)-((r=n.priority)!=null?r:0)||t.id-n.id||0}dispatchDomEvent(t,n,i){if(n!=null&&n.done)return;let r={hook:t,args:i,visit:n||this.swup.visit};document.dispatchEvent(new CustomEvent("swup:any",{detail:r,bubbles:!0})),document.dispatchEvent(new CustomEvent(`swup:${t}`,{detail:r,bubbles:!0}))}parseName(t){let[n,...i]=t.split(".");return[n,i.reduce((r,s)=>k({},r,{[s]:!0}),{})]}},qo=e=>{if(e&&e.charAt(0)==="#"&&(e=e.substring(1)),!e)return null;let t=decodeURIComponent(e),n=document.getElementById(e)||document.getElementById(t)||Pt(`a[name='${CSS.escape(e)}']`)||Pt(`a[name='${CSS.escape(t)}']`);return n||e!=="top"||(n=document.body),n},qe="transition",It="animation";async function Vo({selector:e,elements:t}){if(e===!1&&!t)return;let n=[];if(t)n=Array.from(t);else if(e&&(n=Ht(e,document.body),!n.length))return void console.warn(`[swup] No elements found matching animationSelector \`${e}\``);let i=n.map(r=>function(s){let{type:o,timeout:a,propCount:c}=function(l){let u=window.getComputedStyle(l),h=Ve(u,`${qe}Delay`),f=Ve(u,`${qe}Duration`),y=Li(h,f),w=Ve(u,`${It}Delay`),b=Ve(u,`${It}Duration`),g=Li(w,b),m=Math.max(y,g),x=m>0?y>g?qe:It:null;return{type:x,timeout:m,propCount:x?x===qe?f.length:b.length:0}}(s);return!(!o||!a)&&new Promise(l=>{let u=`${o}end`,h=performance.now(),f=0,y=()=>{s.removeEventListener(u,w),l()},w=b=>{b.target===s&&((performance.now()-h)/1e3=c&&y())};setTimeout(()=>{f0?await Promise.all(i):e&&console.warn(`[swup] No CSS animation duration defined on elements matching \`${e}\``)}function Ve(e,t){return(e[t]||"").split(", ")}function Li(e,t){for(;e.lengthTi(n)+Ti(e[i])))}function Ti(e){return 1e3*parseFloat(e)}function jo(e,t={},n={}){if(typeof e!="string")throw new Error("swup.navigate() requires a URL parameter");if(this.shouldIgnoreVisit(e,{el:n.el,event:n.event}))return void window.location.assign(e);let{url:i,hash:r}=O.fromUrl(e),s=this.createVisit(k({},n,{to:i,hash:r}));this.performNavigation(s,t)}async function zo(e,t={}){if(this.navigating){if(this.visit.state>=6)return e.state=2,void(this.onVisitEnd=()=>this.performNavigation(e,t));await this.hooks.call("visit:abort",this.visit,void 0),delete this.visit.to.document,this.visit.state=8}this.navigating=!0,this.visit=e;let{el:n}=e.trigger;t.referrer=t.referrer||this.location.url,t.animate===!1&&(e.animation.animate=!1),e.animation.animate||this.classes.clear();let i=t.history||xi(n,"data-swup-history");typeof i=="string"&&["push","replace"].includes(i)&&(e.history.action=i);let r=t.animation||xi(n,"data-swup-animation");var s,o;typeof r=="string"&&(e.animation.name=r),e.meta=t.meta||{},typeof t.cache=="object"?(e.cache.read=(s=t.cache.read)!=null?s:e.cache.read,e.cache.write=(o=t.cache.write)!=null?o:e.cache.write):t.cache!==void 0&&(e.cache={read:!!t.cache,write:!!t.cache}),delete t.cache;try{await this.hooks.call("visit:start",e,void 0),e.state=3;let a=this.hooks.call("page:load",e,{options:t},async(l,u)=>{let h;return l.cache.read&&(h=this.cache.get(l.to.url)),u.page=h||await this.fetchPage(l.to.url,u.options),u.cache=!!h,u.page});a.then(({html:l})=>{e.advance(5),e.to.html=l,e.to.document=new DOMParser().parseFromString(l,"text/html")});let c=e.to.url+e.to.hash;if(e.history.popstate||(e.history.action==="replace"||e.to.url===this.location.url?me(c):(this.currentHistoryIndex++,Do(c,{index:this.currentHistoryIndex}))),this.location=O.fromUrl(c),e.history.popstate&&this.classes.add("is-popstate"),e.animation.name&&this.classes.add(`to-${ki(e.animation.name)}`),e.animation.wait&&await a,e.done||(await this.hooks.call("visit:transition",e,void 0,async()=>{if(!e.animation.animate)return await this.hooks.call("animation:skip",void 0),void await this.renderPage(e,await a);e.advance(4),await this.animatePageOut(e),e.animation.native&&document.startViewTransition?await document.startViewTransition(async()=>await this.renderPage(e,await a)).finished:await this.renderPage(e,await a),await this.animatePageIn(e)}),e.done))return;await this.hooks.call("visit:end",e,void 0,()=>this.classes.clear()),e.state=7,this.navigating=!1,this.onVisitEnd&&(this.onVisitEnd(),this.onVisitEnd=void 0)}catch(a){if(!a||a!=null&&a.aborted)return void(e.state=8);e.state=9,console.error(a),this.options.skipPopStateHandling=()=>(window.location.assign(e.to.url+e.to.hash),!0),window.history.back()}finally{delete e.to.document}}var Wo=async function(e){await this.hooks.call("animation:out:start",e,void 0,()=>{this.classes.add("is-changing","is-animating","is-leaving")}),await this.hooks.call("animation:out:await",e,{skip:!1},(t,{skip:n})=>{if(!n)return this.awaitAnimations({selector:t.animation.selector})}),await this.hooks.call("animation:out:end",e,void 0)},Go=function(e){var t;let n=e.to.document;if(!n)return!1;let i=((t=n.querySelector("title"))==null?void 0:t.innerText)||"";document.title=i;let r=Ht('[data-swup-persist]:not([data-swup-persist=""])'),s=e.containers.map(o=>{let a=document.querySelector(o),c=n.querySelector(o);return a&&c?(a.replaceWith(c.cloneNode(!0)),!0):(a||console.warn(`[swup] Container missing in current document: ${o}`),c||console.warn(`[swup] Container missing in incoming document: ${o}`),!1)}).filter(Boolean);return r.forEach(o=>{let a=o.getAttribute("data-swup-persist"),c=Pt(`[data-swup-persist="${a}"]`);c&&c!==o&&c.replaceWith(o)}),s.length===e.containers.length},Ko=function(e){let t={behavior:"auto"},{target:n,reset:i}=e.scroll,r=n??e.to.hash,s=!1;return r&&(s=this.hooks.callSync("scroll:anchor",e,{hash:r,options:t},(o,{hash:a,options:c})=>{let l=this.getAnchorElement(a);return l&&l.scrollIntoView(c),!!l})),i&&!s&&(s=this.hooks.callSync("scroll:top",e,{options:t},(o,{options:a})=>(window.scrollTo(k({top:0,left:0},a)),!0))),s},Yo=async function(e){if(e.done)return;let t=this.hooks.call("animation:in:await",e,{skip:!1},(n,{skip:i})=>{if(!i)return this.awaitAnimations({selector:n.animation.selector})});await Oi(),await this.hooks.call("animation:in:start",e,void 0,()=>{this.classes.remove("is-animating")}),await t,await this.hooks.call("animation:in:end",e,void 0)},Jo=async function(e,t){if(e.done)return;e.advance(6);let{url:n}=t;this.isSameResolvedUrl(ge(),n)||(me(n),this.location=O.fromUrl(n),e.to.url=this.location.url,e.to.hash=this.location.hash),await this.hooks.call("content:replace",e,{page:t},(i,{})=>{if(this.classes.remove("is-leaving"),i.animation.animate&&this.classes.add("is-rendering"),!this.replaceContent(i))throw new Error("[swup] Container mismatch, aborting");i.animation.animate&&(this.classes.add("is-changing","is-animating","is-rendering"),i.animation.name&&this.classes.add(`to-${ki(i.animation.name)}`))}),await this.hooks.call("content:scroll",e,void 0,()=>this.scrollToContent(e)),await this.hooks.call("page:view",e,{url:this.location.url,title:document.title})},Xo=function(e){var t;if(t=e,Boolean(t?.isSwupPlugin)){if(e.swup=this,!e._checkRequirements||e._checkRequirements())return e._beforeMount&&e._beforeMount(),e.mount(),this.plugins.push(e),this.plugins}else console.error("Not a swup plugin instance",e)};function Zo(e){let t=this.findPlugin(e);if(t)return t.unmount(),t._afterUnmount&&t._afterUnmount(),this.plugins=this.plugins.filter(n=>n!==t),this.plugins;console.error("No such plugin",t)}function ea(e){return this.plugins.find(t=>t===e||t.name===e||t.name===`Swup${String(e)}`)}function ta(e){if(typeof this.options.resolveUrl!="function")return console.warn("[swup] options.resolveUrl expects a callback function."),e;let t=this.options.resolveUrl(e);return t&&typeof t=="string"?t.startsWith("//")||t.startsWith("http")?(console.warn("[swup] options.resolveUrl needs to return a relative url"),e):t:(console.warn("[swup] options.resolveUrl needs to return a url"),e)}function na(e,t){return this.resolveUrl(e)===this.resolveUrl(t)}var ia={animateHistoryBrowsing:!1,animationSelector:'[class*="transition-"]',animationScope:"html",cache:!0,containers:["#swup"],hooks:{},ignoreVisit:(e,{el:t}={})=>!(t==null||!t.closest("[data-no-swup]")),linkSelector:"a[href]",linkToSelf:"scroll",native:!1,plugins:[],resolveUrl:e=>e,requestHeaders:{"X-Requested-With":"swup",Accept:"text/html, application/xhtml+xml"},skipPopStateHandling:e=>{var t;return((t=e.state)==null?void 0:t.source)!=="swup"},timeout:0},ze=class{get currentPageUrl(){return this.location.url}constructor(t={}){var n,i;this.version="4.8.1",this.options=void 0,this.defaults=ia,this.plugins=[],this.visit=void 0,this.cache=void 0,this.hooks=void 0,this.classes=void 0,this.location=O.fromUrl(window.location.href),this.currentHistoryIndex=void 0,this.clickDelegate=void 0,this.navigating=!1,this.onVisitEnd=void 0,this.use=Xo,this.unuse=Zo,this.findPlugin=ea,this.log=()=>{},this.navigate=jo,this.performNavigation=zo,this.createVisit=Uo,this.delegateEvent=Fo,this.fetchPage=Bo,this.awaitAnimations=Vo,this.renderPage=Jo,this.replaceContent=Go,this.animatePageIn=Yo,this.animatePageOut=Wo,this.scrollToContent=Ko,this.getAnchorElement=qo,this.getCurrentUrl=ge,this.resolveUrl=ta,this.isSameResolvedUrl=na,this.options=k({},this.defaults,t),this.handleLinkClick=this.handleLinkClick.bind(this),this.handlePopState=this.handlePopState.bind(this),this.cache=new _t(this),this.classes=new Rt(this),this.hooks=new Nt(this),this.visit=this.createVisit({to:""}),this.currentHistoryIndex=(n=(i=window.history.state)==null?void 0:i.index)!=null?n:1,this.enable()}async enable(){var t;let{linkSelector:n}=this.options;this.clickDelegate=this.delegateEvent(n,"click",this.handleLinkClick),window.addEventListener("popstate",this.handlePopState),this.options.animateHistoryBrowsing&&(window.history.scrollRestoration="manual"),this.options.native=this.options.native&&!!document.startViewTransition,this.options.plugins.forEach(i=>this.use(i));for(let[i,r]of Object.entries(this.options.hooks)){let[s,o]=this.hooks.parseName(i);this.hooks.on(s,r,o)}((t=window.history.state)==null?void 0:t.source)!=="swup"&&me(null,{index:this.currentHistoryIndex}),await Oi(),await this.hooks.call("enable",void 0,void 0,()=>{let i=document.documentElement;i.classList.add("swup-enabled"),i.classList.toggle("swup-native",this.options.native)})}async destroy(){this.clickDelegate.destroy(),window.removeEventListener("popstate",this.handlePopState),this.cache.clear(),this.options.plugins.forEach(t=>this.unuse(t)),await this.hooks.call("disable",void 0,void 0,()=>{let t=document.documentElement;t.classList.remove("swup-enabled"),t.classList.remove("swup-native")}),this.hooks.clear()}shouldIgnoreVisit(t,{el:n,event:i}={}){let{origin:r,url:s,hash:o}=O.fromUrl(t);return r!==window.location.origin||!(!n||!this.triggerWillOpenNewWindow(n))||!!this.options.ignoreVisit(s+o,{el:n,event:i})}handleLinkClick(t){let n=t.delegateTarget,{href:i,url:r,hash:s}=O.fromElement(n);if(this.shouldIgnoreVisit(i,{el:n,event:t}))return;if(this.navigating&&r===this.visit.to.url)return void t.preventDefault();let o=this.createVisit({to:r,hash:s,el:n,event:t});t.metaKey||t.ctrlKey||t.shiftKey||t.altKey?this.hooks.callSync("link:newtab",o,{href:i}):t.button===0&&this.hooks.callSync("link:click",o,{el:n,event:t},()=>{var a;let c=(a=o.from.url)!=null?a:"";t.preventDefault(),r&&r!==c?this.isSameResolvedUrl(r,c)||this.performNavigation(o):s?this.hooks.callSync("link:anchor",o,{hash:s},()=>{me(r+s),this.scrollToContent(o)}):this.hooks.callSync("link:self",o,void 0,()=>{this.options.linkToSelf==="navigate"?this.performNavigation(o):(me(r),this.scrollToContent(o))})})}handlePopState(t){var n,i,r,s;let o=(n=(i=t.state)==null?void 0:i.url)!=null?n:window.location.href;if(this.options.skipPopStateHandling(t)||this.isSameResolvedUrl(ge(),this.location.url))return;let{url:a,hash:c}=O.fromUrl(o),l=this.createVisit({to:a,hash:c,event:t});l.history.popstate=!0;let u=(r=(s=t.state)==null?void 0:s.index)!=null?r:0;u&&u!==this.currentHistoryIndex&&(l.history.direction=u-this.currentHistoryIndex>0?"forwards":"backwards",this.currentHistoryIndex=u),l.animation.animate=!1,l.scroll.reset=!1,l.scroll.target=!1,this.options.animateHistoryBrowsing&&(l.animation.animate=!0,l.scroll.reset=!0),this.hooks.callSync("history:popstate",l,{event:t},()=>{this.performNavigation(l)})}triggerWillOpenNewWindow(t){return!!t.matches('[download], [target="_blank"]')}};function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;tString(e).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join("."),We=class{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEach(([t,n])=>{if(!function(i,r,s){let o=function(a,c){var l;if(a==="swup")return(l=c.version)!=null?l:"";{var u;let h=c.findPlugin(a);return(u=h?.version)!=null?u:""}}(i,s);return!!o&&((a,c)=>c.every(l=>{let[,u,h]=l.match(/^([\D]+)?(.*)$/)||[];var f,y;return((w,b)=>{let g={"":m=>m===0,">":m=>m>0,">=":m=>m>=0,"<":m=>m<0,"<=":m=>m<=0};return(g[b]||g[""])(w)})((y=h,f=Ai(f=a),y=Ai(y),f.localeCompare(y,void 0,{numeric:!0})),u||">=")}))(o,r)}(t,n=Array.isArray(n)?n:[n],this.swup)){let i=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${i}`)}}),!0}on(t,n,i={}){var r;n=!(r=n).name.startsWith("bound ")||r.hasOwnProperty("prototype")?n.bind(this):n;let s=this.swup.hooks.on(t,n,i);return this.handlersToUnregister.push(s),s}once(t,n,i={}){return this.on(t,n,ve({},i,{once:!0}))}before(t,n,i={}){return this.on(t,n,ve({},i,{before:!0}))}replace(t,n,i={}){return this.on(t,n,ve({},i,{replace:!0}))}off(t,n){return this.swup.hooks.off(t,n)}};(function(){if(!(typeof window>"u"||typeof document>"u"||typeof HTMLElement>"u")){var e=!1;try{var t=document.createElement("div");t.addEventListener("focus",function(s){s.preventDefault(),s.stopPropagation()},!0),t.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&typeof navigator.userAgent<"u"&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return e=!1;e=!0}}))}catch{}if(HTMLElement.prototype.nativeFocus===void 0&&!e){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var n=function(s){for(var o=s.parentNode,a=[],c=document.scrollingElement||document.documentElement;o&&o!==c;)(o.offsetHeightn.replace(`{${i}}`,t[i]||""),e||"")}var Mt=class{constructor(){var t;this.id="swup-announcer",this.style="position:absolute;top:0;left:0;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap;word-wrap:normal;width:1px;height:1px;",this.region=void 0,this.region=(t=this.getRegion())!=null?t:this.createRegion()}getRegion(){return document.getElementById(this.id)}createRegion(){let t=function(n){let i=document.createElement("template");return i.innerHTML=n,i.content.children[0]}(`

`);return document.body.appendChild(t),t}announce(t,n=0){return new Promise(i=>{setTimeout(()=>{this.region.textContent===t&&(t=`${t}.`),this.region.textContent="",this.region.textContent=t,i()},n)})}};function _i(e){let t;if(t=typeof e=="string"?document.querySelector(e):e,!(t instanceof HTMLElement))return;let n=t.getAttribute("tabindex");t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}),n!==null&&t.setAttribute("tabindex",n)}var Ge=class extends We{constructor(t={}){super(),this.name="SwupA11yPlugin",this.requires={swup:">=4"},this.defaults={headingSelector:"h1",respectReducedMotion:!0,autofocus:!1,announcements:{visit:"Navigated to: {title}",url:"New page at {url}"}},this.options=void 0,this.announcer=void 0,this.announcementDelay=100,this.rootSelector="body",this.handleAnchorScroll=(n,{hash:i})=>{let r=this.swup.getAnchorElement(i);r instanceof HTMLElement&&_i(r)},this.options=Qt({},this.defaults,t),this.announcer=new Mt}mount(){this.swup.hooks.create("content:announce"),this.swup.hooks.create("content:focus"),this.before("visit:start",this.prepareVisit),this.on("visit:start",this.markAsBusy),this.on("visit:end",this.unmarkAsBusy),this.on("visit:end",this.focusContent),this.on("visit:end",this.announceContent),this.on("scroll:anchor",this.handleAnchorScroll),this.before("visit:start",this.disableAnimations),this.before("link:self",this.disableAnimations),this.before("link:anchor",this.disableAnimations),this.swup.announce=this.announce.bind(this)}unmount(){this.swup.announce=void 0}async announce(t){await this.announcer.announce(t)}markAsBusy(){document.documentElement.setAttribute("aria-busy","true")}unmarkAsBusy(){document.documentElement.removeAttribute("aria-busy")}prepareVisit(t){t.a11y={announce:void 0,focus:this.rootSelector}}announceContent(t){this.swup.hooks.callSync("content:announce",t,void 0,n=>{n.a11y.announce===void 0&&(n.a11y.announce=this.getPageAnnouncement()),n.a11y.announce&&this.announcer.announce(n.a11y.announce,this.announcementDelay)})}focusContent(t){this.swup.hooks.callSync("content:focus",t,void 0,n=>{n.a11y.focus&&(this.options.autofocus&&function(){let i=function(){let r=document.querySelector("body [autofocus]");if(r&&!r.closest('[inert], [aria-disabled], [aria-hidden="true"]'))return r}();return!!i&&(i!==document.activeElement&&i.focus(),!0)}()===!0||_i(n.a11y.focus))})}getPageAnnouncement(){let{headingSelector:t,announcements:n}=this.options;return function({headingSelector:i="h1",announcements:r={}}){var s,o;let a=document.documentElement.lang||"*",{href:c,url:l,pathname:u}=O.fromUrl(window.location.href),h=(s=(o=r[a])!=null?o:r["*"])!=null?s:r;if(typeof h!="object")return;let f=document.querySelector(i);f||console.warn(`SwupA11yPlugin: No main heading (${i}) found on new page`);let y=f?.getAttribute("aria-label")||f?.textContent||document.title||Ii(h.url,{href:c,url:l,path:u});return Ii(h.visit,{title:y,href:c,url:l,path:u})}({headingSelector:t,announcements:n})}disableAnimations(t){this.options.respectReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(t.animation.animate=!1,t.scroll.animate=!1)}};jt(()=>{let e=new URLSearchParams(window.location.search),t=e.has("preview");Gt(),Sn(e.get("theme")),Jt(t),jn(),mi(),yi(),wi(),bi(),t?Ei():(window.location.protocol!=="file:"&&new ze({animationSelector:!1,containers:["#main"],ignoreVisit:n=>{let i=n.split("#")[0];return i===window.location.pathname||i===window.location.pathname+".html"},hooks:{"page:view":()=>{it(),vt()}},linkSelector:'a[href]:not([href^="/"]):not([href^="http"])',plugins:[new Ge]}),Qn(),on(),it(),Pn(),Wn(),si(),ei(),wn(),vt(),ri())});})(); -/*! Bundled license information: - -lunr/lunr.js: - (** - * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 - * Copyright (C) 2020 Oliver Nightingale - * @license MIT - *) - (*! - * lunr.utils - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Set - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.tokenizer - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Pipeline - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Vector - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.stemmer - * Copyright (C) 2020 Oliver Nightingale - * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt - *) - (*! - * lunr.stopWordFilter - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.trimmer - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.TokenSet - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Index - * Copyright (C) 2020 Oliver Nightingale - *) - (*! - * lunr.Builder - * Copyright (C) 2020 Oliver Nightingale - *) -*/ diff --git a/lib/ex_doc/formatter/html/templates/sidebar_template.eex b/lib/ex_doc/formatter/html/templates/sidebar_template.eex index 6d731e391..1962229e2 100644 --- a/lib/ex_doc/formatter/html/templates/sidebar_template.eex +++ b/lib/ex_doc/formatter/html/templates/sidebar_template.eex @@ -75,8 +75,8 @@ Search documentation of <%= config.project %> -