From 423fd2c2e623d506f0c995ab770d689febed4881 Mon Sep 17 00:00:00 2001 From: TJ Date: Mon, 8 Apr 2024 18:43:09 +0900 Subject: [PATCH] feat: render the maximum iframe height accordingly --- assets/js/autocomplete/autocomplete-list.js | 18 ++++++- assets/js/preview.js | 12 +++++ formatters/html/dist/html-EN2IJ2EZ.js | 56 +++++++++++++++++++++ formatters/html/dist/html-Y7ASKYHF.js | 56 --------------------- 4 files changed, 85 insertions(+), 57 deletions(-) create mode 100644 formatters/html/dist/html-EN2IJ2EZ.js delete mode 100644 formatters/html/dist/html-Y7ASKYHF.js diff --git a/assets/js/autocomplete/autocomplete-list.js b/assets/js/autocomplete/autocomplete-list.js index 81850aecb..5ae55c9d0 100644 --- a/assets/js/autocomplete/autocomplete-list.js +++ b/assets/js/autocomplete/autocomplete-list.js @@ -83,6 +83,18 @@ export function moveAutocompleteSelection (offset) { setAutocompleteSelection(newAutocompleteIndex(offset)) } +function handlePreviewMessage (event) { + if (event.origin !== 'null' && event.origin !== window.location.origin) return + + if (event.data.type === 'preview') { + const { maxHeight, contentHeight } = event.data + const previewContainer = qs('.autocomplete-preview') + if (previewContainer) { + previewContainer.style.height = `${Math.min(maxHeight, contentHeight + 32)}px` + } + } +} + export function setAutocompleteSelection (index) { state.selectedIdx = index const suggestionList = qs(AUTOCOMPLETE_SUGGESTION_LIST_SELECTOR) @@ -150,12 +162,16 @@ export function showPreview (elementToSelect) { if (elementToSelect) { setAutocompleteSelection(parseInt(elementToSelect.dataset.index)) + window.addEventListener('message', handlePreviewMessage) } } function removePreview () { const preview = qs('.autocomplete-preview') - if (preview) { preview.remove() } + if (preview) { + preview.remove() + window.removeEventListener('message', handlePreviewMessage) + } } function newAutocompleteIndex (offset) { diff --git a/assets/js/preview.js b/assets/js/preview.js index c47bc09ef..b453d54d8 100644 --- a/assets/js/preview.js +++ b/assets/js/preview.js @@ -12,6 +12,18 @@ function preview (previewing) { replaceContents(previewing) makeLinksOpenInParent() scrollToTop() + sendPreviewInfoToParent() +} + +function sendPreviewInfoToParent () { + const maxHeight = document.body.scrollHeight + const contentHeight = document.getElementById('content').scrollHeight + const message = { + type: 'preview', + maxHeight, + contentHeight + } + window.parent.postMessage(message, '*') } function makeLinksOpenInParent () { diff --git a/formatters/html/dist/html-EN2IJ2EZ.js b/formatters/html/dist/html-EN2IJ2EZ.js new file mode 100644 index 000000000..096a373f5 --- /dev/null +++ b/formatters/html/dist/html-EN2IJ2EZ.js @@ -0,0 +1,56 @@ +(()=>{var Xn=Object.create;var ut=Object.defineProperty;var Zn=Object.getOwnPropertyDescriptor;var ei=Object.getOwnPropertyNames;var ti=Object.getPrototypeOf,ni=Object.prototype.hasOwnProperty;var dt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ii=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ei(t))!ni.call(e,r)&&r!==n&&ut(e,r,{get:()=>t[r],enumerable:!(i=Zn(t,r))||i.enumerable});return e};var ft=(e,t,n)=>(n=e!=null?Xn(ti(e)):{},ii(t||!e||!e.__esModule?ut(n,"default",{value:e,enumerable:!0}):n,e));var kt=dt((ro,wt)=>{var Tt="Expected a function",Et=NaN,pi="[object Symbol]",mi=/^\s+|\s+$/g,gi=/^[-+]0x[0-9a-f]+$/i,yi=/^0b[01]+$/i,vi=/^0o[0-7]+$/i,bi=parseInt,Si=typeof global=="object"&&global&&global.Object===Object&&global,xi=typeof self=="object"&&self&&self.Object===Object&&self,Ei=Si||xi||Function("return this")(),Li=Object.prototype,Ti=Li.toString,wi=Math.max,ki=Math.min,Fe=function(){return Ei.Date.now()};function _i(e,t,n){var i,r,s,o,a,l,u=0,f=!1,y=!1,g=!0;if(typeof e!="function")throw new TypeError(Tt);t=Lt(t)||0,be(n)&&(f=!!n.leading,y="maxWait"in n,s=y?wi(Lt(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g);function L(S){var C=i,D=r;return i=r=void 0,u=S,o=e.apply(D,C),o}function b(S){return u=S,a=setTimeout(p,t),f?L(S):o}function T(S){var C=S-l,D=S-u,V=t-C;return y?ki(V,s-D):V}function m(S){var C=S-l,D=S-u;return l===void 0||C>=t||C<0||y&&D>=s}function p(){var S=Fe();if(m(S))return _(S);a=setTimeout(p,T(S))}function _(S){return a=void 0,g&&i?L(S):(i=r=void 0,o)}function w(){a!==void 0&&clearTimeout(a),u=0,i=l=r=a=void 0}function N(){return a===void 0?o:_(Fe())}function F(){var S=Fe(),C=m(S);if(i=arguments,r=this,l=S,C){if(a===void 0)return b(l);if(y)return a=setTimeout(p,t),L(l)}return a===void 0&&(a=setTimeout(p,t)),o}return F.cancel=w,F.flush=N,F}function Oi(e,t,n){var i=!0,r=!0;if(typeof e!="function")throw new TypeError(Tt);return be(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),_i(e,t,{leading:i,maxWait:t,trailing:r})}function be(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ii(e){return!!e&&typeof e=="object"}function Ci(e){return typeof e=="symbol"||Ii(e)&&Ti.call(e)==pi}function Lt(e){if(typeof e=="number")return e;if(Ci(e))return Et;if(be(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=be(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(mi,"");var n=yi.test(e);return n||vi.test(e)?bi(e.slice(2),n?2:8):gi.test(e)?Et:+e}wt.exports=Oi});var ln=dt((an,cn)=>{(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 f=e.utils.clone(n)||{};f.position=[a,u],f.index=s.length,s.push(new e.Token(i.slice(a,o),f))}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(ol?f+=2:a==l&&(n+=i[u+1]*r[f+1],u+=2,f+=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 l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),r.push({node:l,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 u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),r.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var f=s.str.charAt(0),y=s.str.charAt(1),g;y in s.node.edges?g=s.node.edges[y]:(g=new e.TokenSet,s.node.edges[y]=g),s.str.length==1&&(g.final=!0),r.push({node:g,editsRemaining:s.editsRemaining-1,str:f+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),l=0;l1?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 an=="object"?cn.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 e+".html"===n?t.fn(this):t.inverse(this)});var c=document.querySelector.bind(document),k=document.querySelectorAll.bind(document);function ht(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function me(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function $(){return document.body.dataset.type}function pt(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 ge(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())?ri(n):null:null}function ri(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 Z(){return window.location.hash.replace(/^#/,"")}function mt(e){return new URLSearchParams(window.location.search).get(e)}function gt(e){return fetch(e).then(t=>t.ok).catch(()=>!1)}function yt(e){document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)}function ee(e){return!e||e.trim()===""}function vt(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{n=null,e(...r)},t)}}function ye(){return document.head.querySelector("meta[name=project][content]").content}function ve(){return/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)}var bt="ex_doc:settings",si={tooltips:!0,theme:null,livebookUrl:null},He=class{constructor(){this._subscribers=[],this._settings=si,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(bt);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(bt,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"))}},O=new He;var oi=".content",St=".content-inner",ai=".livebook-badge";function xt(e){e||ui(),di(),ci(),li()}function ci(){c(oi).querySelectorAll("a").forEach(e=>{e.querySelector("code, img")&&e.classList.add("no-underline")})}function li(){["warning","info","error","neutral","tip"].forEach(t=>{k(`blockquote h3.${t}, blockquote h4.${t}`).forEach(n=>{n.closest("blockquote").classList.add(t)})})}function ui(){c(St).setAttribute("tabindex",-1),c(St).focus()}function di(){let t=window.location.pathname.replace(/(\.html)?$/,".livemd"),n=new URL(t,window.location.href).toString();O.getAndSubscribe(i=>{let r=i.livebookUrl?hi(i.livebookUrl,n):fi(n);for(let s of k(ai))s.href=r})}function fi(e){return`https://livebook.dev/run?url=${encodeURIComponent(e)}`}function hi(e,t){return`${e}/import?url=${encodeURIComponent(t)}`}var Ot=ft(kt());var Ai=768,De=300,te=".sidebar-toggle",Pi=".content",M={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"},Ri=Object.values(Q),A={togglingTimeout:null,lastWindowWidth:window.innerWidth,sidebarPreference:M.NO_PREF};function It(){Ct(),Ni(),Qi()}function Ni(){let e=sessionStorage.getItem("sidebar_width");e&&_t(e),new ResizeObserver(n=>{for(let i of n)_t(i.contentRect.width)}).observe(document.getElementById("sidebar"))}function _t(e){sessionStorage.setItem("sidebar_width",e),document.body.style.setProperty("--sidebarWidth",`${e}px`)}function Ct(){sessionStorage.getItem("sidebar_state")==="closed"||At()?(q(Q.closed),c(te).setAttribute("aria-expanded","false")):(q(Q.opened),c(te).setAttribute("aria-expanded","true")),setTimeout(()=>c(te).classList.add("sidebar-toggle--animated"),De)}function At(){return window.matchMedia(`screen and (max-width: ${Ai}px)`).matches}function q(...e){document.body.classList.remove(...Ri),document.body.classList.add(...e)}function Qi(){c(te).addEventListener("click",e=>{Me(),Mi()}),c(Pi).addEventListener("click",e=>{Di()}),window.addEventListener("resize",(0,Ot.default)(e=>{Fi()},100))}function Me(){return Be()?Pt():Hi()}function Be(){return document.body.classList.contains(Q.opened)||document.body.classList.contains(Q.opening)}function Hi(){Rt(),sessionStorage.setItem("sidebar_state","opened"),c(te).setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{q(Q.openingStart),requestAnimationFrame(()=>(q(Q.opening),new Promise((e,t)=>{A.togglingTimeout=setTimeout(()=>{q(Q.opened),e()},De)})))})}function Pt(){Rt(),sessionStorage.setItem("sidebar_state","closed"),c(te).setAttribute("aria-expanded","false"),requestAnimationFrame(()=>{q(Q.closingStart),requestAnimationFrame(()=>(q(Q.closing),new Promise((e,t)=>{A.togglingTimeout=setTimeout(()=>{q(Q.closed),e()},De)})))})}function Rt(){A.togglingTimeout&&(clearTimeout(A.togglingTimeout),A.togglingTimeout=null)}function Fi(){A.lastWindowWidth!==window.innerWidth&&(A.lastWindowWidth=window.innerWidth,(A.sidebarPreference===M.OPEN||A.sidebarPreference===M.NO_PREF)&&Ct())}function Di(){At()&&Be()&&Pt()}function Mi(){switch(A.sidebarPreference){case M.OPEN:A.sidebarPreference=M.CLOSED;break;case M.CLOSED:A.sidebarPreference=M.OPEN;break;case M.NO_PREF:Be()?A.sidebarPreference=M.OPEN:A.sidebarPreference=M.CLOSED}}function ae(){return window.sidebarNodes||{}}function Nt(){return window.versionNodes||[]}var ze={search:"search",extras:"extras",modules:"modules",tasks:"tasks"},$e=[ze.extras,ze.modules,ze.tasks],xe=e=>`#${e}-full-list`;function Qt(){$e.forEach(e=>{Bi(ae(),e)}),Se($()),Ft(),Ht(),Wi()}function Bi(e,t){let n=e[t]||[],i=c(xe(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 l=o.target.closest("li");$i(l)})}),i.querySelectorAll("li a").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.closest("li"),u=i.querySelector(".current-section");u&&Vi(u),s.matches(".expand")&&s.pathname===window.location.pathname&&qe(l)})})}function qe(e){e.classList.add("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","true")}function zi(e){e.classList.remove("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","false")}function $i(e){e.classList.contains("open")?zi(e):qe(e)}function qi(e){e.classList.add("current-section"),e.querySelector("a").setAttribute("aria-current","true")}function Vi(e){e.classList.remove("current-section"),e.querySelector("a").setAttribute("aria-current","false")}function ji(e){e.classList.add("current-hash"),e.querySelector("a").setAttribute("aria-current","true")}function Ui(e){e.classList.remove("current-hash"),e.querySelector("a").setAttribute("aria-current","false")}function Se(e){$e.forEach(t=>{let n=c(`#${t}-list-tab-button`);if(n){let i=c(`#${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 Ht(){let e=c(xe($()));if(!e)return;let t=e.querySelector("li.current-page");t&&(t.scrollIntoView(),e.scrollTop-=40)}function Ft(){let e=Z()||"content",n=ae()[$()]||[],i=pt(n,e),r=c(xe($()));if(!r)return;let s=r.querySelector(`li.current-page a.expand[href$="#${i}"]`);s&&qe(s.closest("li"));let o=r.querySelector(`li.current-page a[href$="#${e}"]`);if(o){let a=o.closest("ul");a.classList.contains("deflist")&&qi(a.closest("li")),ji(o.closest("li"))}}function Wi(){$e.forEach(t=>{let n=c(`#${t}-list-tab-button`);n&&n.addEventListener("click",i=>{Se(t),Ht()})});let e=c("#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];Se(s),c(`#${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];Se(s),c(`#${s}-list-tab-button`).focus()}}),window.addEventListener("hashchange",t=>{let n=c(xe($()));if(!n)return;let i=n.querySelector("li.current-page li.current-hash");i&&Ui(i),Ft()})}var B={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function Mt(e,t=8){if(ee(e))return[];let n=ae(),i=[...Ve(n.modules,e,B.module,"module"),...Gi(n.modules,e,B.moduleChild),...Ve(n.tasks,e,B.mixTask,"mix task"),...Ve(n.extras,e,B.extra,"page"),...je(n.modules,e,B.section,"module"),...je(n.tasks,e,B.section,"mix task"),...je(n.extras,e,B.section,"page")].filter(r=>r!==null);return tr(i).slice(0,t)}function Ve(e,t,n,i){return e.map(r=>Yi(r,t,n,i))}function Gi(e,t,n){return e.filter(i=>i.nodeGroups).flatMap(i=>i.nodeGroups.flatMap(({key:r,nodes:s})=>{let o=er(r);return s.map(a=>Ji(a,i.id,t,n,o)||Zi(a,i.id,t,n,o))}))}function je(e,t,n,i){return e.flatMap(r=>Ki(r).map(s=>Xi(r,s,t,n,i)))}function Ki(e){return(e.sections||[]).concat(e.headers||[])}function Yi(e,t,n,i){return Le(e.title,t)?{link:`${e.id}.html`,title:ke(e.title,t),description:null,matchQuality:Te(e.title,t),deprecated:e.deprecated,labels:[i],category:n}:null}function Ji(e,t,n,i,r){return Le(e.id,n)?{link:`${t}.html#${e.anchor}`,title:ke(e.id,n),labels:[r],description:t,matchQuality:Te(e.id,n),deprecated:e.deprecated,category:i}:null}function Xi(e,t,n,i,r){return Bt(t.id,n)?{link:`${e.id}.html#${t.anchor}`,title:ke(t.id,n),description:e.title,matchQuality:Te(t.id,n),labels:[r,"section"],category:i}:null}function Zi(e,t,n,i,r){let s=`${t}.${e.id}`,o=`${t}:${e.id}`,a,l;if(Le(s,n))a=s,l=/\./g;else if(Le(o,n))a=o,l=/:/g;else return null;let u=n.replace(l," ");return Bt(e.id,u)?{link:`${t}.html#${e.anchor}`,title:ke(e.id,u),label:r,description:t,matchQuality:Te(a,n),deprecated:e.deprecated,category:i}:null}function er(e){switch(e){case"callbacks":return"callback";case"types":return"type";default:return"function"}}function tr(e){return e.slice().sort((t,n)=>t.matchQuality!==n.matchQuality?n.matchQuality-t.matchQuality:Dt(t.category)-Dt(n.category))}function Dt(e){switch(e){case B.module:return 1;case B.moduleChild:return 2;case B.mixTask:return 3;default:return 4}}function Bt(e,t){return we(t).some(i=>zt(e,i))}function Le(e,t){return we(t).every(i=>zt(e,i))}function zt(e,t){return e.toLowerCase().includes(t.toLowerCase())}function Te(e,t){let n=we(t),r=n.map(o=>o.length).reduce((o,a)=>o+a,0)/e.length,s=nr(e,n[0])?1:0;return r+s}function nr(e,t){return e.toLowerCase().startsWith(t.toLowerCase())}function we(e){return e.trim().split(/\s+/)}function ke(e,t){let n=we(t).sort((i,r)=>r.length-i.length);return Ee(e,n)}function Ee(e,t){if(t.length===0)return e;let[n,...i]=t,r=e.match(new RegExp(`(.*)(${ht(n)})(.*)`,"i"));if(r){let[,s,o,a]=r;return Ee(s,t)+""+me(o)+""+Ee(a,t)}else return Ee(e,i)}var _e=null,G=null;function $t(){G=document.getElementById("toast"),G.addEventListener("click",e=>{clearTimeout(_e),e.target.classList.remove("show")})}function Ue(e){G&&(clearTimeout(_e),G.innerText=e,G.classList.add("show"),_e=setTimeout(()=>{G.classList.remove("show"),_e=setTimeout(function(){G.innerText=""},1e3)},5e3))}var qt="dark",We=["system","dark","light"];function Vt(e){O.getAndSubscribe(t=>{document.body.classList.toggle(qt,Ut(e||t.theme))}),rr()}function jt(){let e=We[We.indexOf(Ge())+1]||We[0];O.update({theme:e}),Ue(`Set theme to "${e}"`)}function Ge(){return O.get().theme||"system"}function Ut(e){return e==="dark"||ir()&&(e==null||e==="system")}function ir(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function rr(){window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>{let t=O.get().theme,n=Ut(t);(t==null||t==="system")&&(document.body.classList.toggle(qt,n),Ue(`Browser changed theme to "${n?"dark":"light"}"`))})}var ne=".autocomplete",Ie=".autocomplete-suggestions",Oe=".autocomplete-suggestion",I={autocompleteSuggestions:[],previewOpen:!1,selectedIdx:-1};function sr(){c(ne).classList.add("shown")}function Ke(){c(ne).classList.remove("shown")}function Wt(){return c(ne).classList.contains("shown")}function Ye(e){I.autocompleteSuggestions=Mt(e),I.selectedIdx=-1,ee(e)?Ke():(or({term:e,suggestions:I.autocompleteSuggestions}),Ce(0),sr())}function or({term:e,suggestions:t}){let n=Handlebars.templates["autocomplete-suggestions"]({suggestions:t,term:e}),i=c(ne);i.innerHTML=n}function Gt(){return I.selectedIdx===-1?null:I.autocompleteSuggestions[I.selectedIdx]}function Ce(e){Yt(ar(e))}function Kt(e){if(!(e.origin!=="null"&&e.origin!==window.location.origin)&&e.data.type==="preview"){let{maxHeight:t,contentHeight:n}=e.data,i=c(".autocomplete-preview");i&&(i.style.height=`${Math.min(t,n+32)}px`)}}function Yt(e){I.selectedIdx=e;let t=c(Ie),n=c(`${Oe}.selected`),i=c(`${Oe}[data-index="${I.selectedIdx}"]`);if(n&&n.classList.remove("selected"),i){if(I.previewOpen){Xt(),t.classList.add("previewing");let r=document.createElement("div");r.classList.add("autocomplete-preview");let s=document.createElement("iframe"),o=i.href.replace(".html",`.html?preview=true&theme=${Ge()}`);s.setAttribute("sandbox","allow-scripts allow-same-origin allow-popups"),s.setAttribute("src",o),r.replaceChildren(s),i.parentNode.insertBefore(r,i.nextSibling)}i.classList.add("selected"),i.scrollIntoView({block:"nearest"})}else t&&(t.scrollTop=0)}function Jt(){I.previewOpen?Ae():Je()}function Ae(){I.previewOpen=!1,c(Ie).classList.remove("previewing"),Xt()}function Je(e){I.previewOpen=!0,e?e=e.closest(Oe):e=c(`${Oe}[data-index="${I.selectedIdx}"]`),e&&(Yt(parseInt(e.dataset.index)),window.addEventListener("message",Kt))}function Xt(){let e=c(".autocomplete-preview");e&&(e.remove(),window.removeEventListener("message",Kt))}function ar(e){let t=I.autocompleteSuggestions.length+1;return(I.selectedIdx+e+1+t)%t-1}var le="form.search-bar input",cr="form.search-bar .search-close-button";function nn(){lr(),window.onTogglePreviewClick=function(e,t){e.preventDefault(),e.stopImmediatePropagation(),Xe(),t?Je(e.target):Ae()}}function rn(e){let t=c(le);t.value=e}function Xe(){let e=c(le);document.body.classList.add("search-focused"),e.focus()}function lr(){let e=c(le);if(document.querySelector('meta[name="exdoc:autocomplete"][content="off"]'))return e.addEventListener("keydown",t=>{t.key==="Enter"&&Zt(t)}),!0;e.addEventListener("keydown",t=>{let n=ve();t.key==="Escape"?(Pe(),e.blur()):t.key==="Enter"?Zt(t):t.key==="ArrowUp"||n&&t.ctrlKey&&t.key==="p"?(Ce(-1),t.preventDefault()):t.key==="ArrowDown"||n&&t.ctrlKey&&t.key==="n"?(Ce(1),t.preventDefault()):t.key==="Tab"&&(Jt(),t.preventDefault())}),e.addEventListener("input",t=>{Ye(t.target.value)}),e.addEventListener("focus",t=>{document.body.classList.contains("search-focused")||(document.body.classList.add("search-focused"),Ye(t.target.value))}),e.addEventListener("blur",t=>{let n=t.relatedTarget;if(n){if(c(Ie).contains(n))return setTimeout(()=>{Wt()&&e.focus()},1e3),null;ce()}else ce()}),c(ne).addEventListener("click",t=>{t.shiftKey||t.ctrlKey?e.focus():(Pe(),ce())}),c(cr).addEventListener("click",t=>{Pe(),ce()})}function Zt(e){let t=c(le),n=e.shiftKey||e.ctrlKey,i=Gt();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||(Pe(),ce())}function Pe(){let e=c(le);e.value=""}function ce(){Ae(),document.body.classList.remove("search-focused"),Ke()}var en=window.scrollY,tn=70;window.addEventListener("scroll",function(){let e=window.scrollY;e>tn*2&&document.body.classList.add("scroll-sticky"),e===0&&document.body.classList.remove("scroll-sticky"),e>en&&e>tn?document.body.classList.remove("scroll-sticky"):document.body.classList.add("scroll-sticky"),en=e<=0?0:e},!1);var sn=".sidebar-projectVersion",ur=".sidebar-projectVersionsDropdown";function on(){let e=Nt();if(e.length>0){let n=c(sn).textContent.trim(),i=fr(e,n);dr({nodes:i})}}function dr({nodes:e}){let t=c(sn),n=Handlebars.templates["versions-dropdown"]({nodes:e});t.innerHTML=n,c(ur).addEventListener("change",pr)}function fr(e,t){return hr(e,t).map(i=>({...i,isCurrentVersion:i.version===t}))}function hr(e,t){return e.some(i=>i.version===t)?e:[{version:t,url:"#"},...e]}function pr(e){let t=e.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,i=`${t}/${n}`;gt(i).then(r=>{r?window.location.href=i:window.location.href=t})}var H=ft(ln());var Re=80,mr="#search";function dn(){if(window.location.pathname.endsWith("/search.html")){let e=mt("q");gr(e)}}async function gr(e){if(ee(e))Ze({value:e});else{rn(e);let t=await yr();try{let n=e.replaceAll(/(\B|\\):/g,"\\:"),i=_r(t.search(n));Ze({value:e,results:i})}catch(n){Ze({value:e,errorMessage:n.message})}}}function Ze({value:e,results:t,errorMessage:n}){let i=c(mr),r=Handlebars.templates["search-results"]({value:e,results:t,errorMessage:n});i.innerHTML=r}async function yr(){H.default.tokenizer.separator=/\s+/,H.default.QueryLexer.termSeparator=/\s+/,H.default.Pipeline.registerFunction(hn,"docTokenSplitter"),H.default.Pipeline.registerFunction(pn,"docTrimmer");let e=await vr();if(e)return e;let t=Tr();return br(t),t}async function vr(){try{let e=sessionStorage.getItem(fn());if(e){let t=await xr(e);return H.default.Index.load(t)}else return null}catch(e){return console.error("Failed to load index: ",e),null}}async function br(e){try{let t=await Sr(e);sessionStorage.setItem(fn(),t)}catch(t){console.error("Failed to save index: ",t)}}async function Sr(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 Er(i)}async function xr(e){let t=new Blob([Lr(e)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(t).text();return JSON.parse(n)}function Er(e){let t="",n=new Uint8Array(e),i=n.byteLength;for(let r=0;r{this.add(e)})})}function wr(e){e.pipeline.before(H.default.stemmer,hn)}function hn(e){let t=e.toString().split(/\:|\.|\/|_|-/).map(n=>e.clone().update(()=>n));return t.length>1?[...t,e]:t}function kr(e){e.pipeline.before(H.default.stemmer,pn)}function pn(e){return e.update(function(t){return t.replace(/^[^@:\w]+/,"").replace(/[^\?\!\w]+$/,"")})}function _r(e){return e.filter(t=>un(t.ref)).map(t=>{let n=un(t.ref),i=t.matchData.metadata;return{...n,metadata:i,excerpts:Or(n,i)}})}function un(e){return searchData.items.find(t=>t.ref===e)||null}function Or(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])=>Ir(n,o,a))).reduce((s,o)=>s.concat(o),[]);return r.length===0?[n.slice(0,Re*2)+(Re*20?"...":"",e.slice(i,t),""+me(e.slice(t,t+n))+"",e.slice(t+n,r),r{let n=t.getAttribute("data-group-id");t.addEventListener("mouseenter",i=>{mn(n,!0)}),t.addEventListener("mouseleave",i=>{mn(n,!1)})})}function mn(e,t){k(`[data-group-id="${e}"]`).forEach(i=>{i.classList.toggle(Cr,t)})}var ie="#modal",Pr="#modal .modal-close",Rr="#modal .modal-title",Nr="#modal .modal-body",yn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',z={prevFocus:null,lastFocus:null,ignoreFocusChanges:!1};function vn(){Qr()}function Qr(){let e=Handlebars.templates["modal-layout"]();document.body.insertAdjacentHTML("beforeend",e),c(ie).addEventListener("keydown",t=>{t.key==="Escape"&&ue()}),c(Pr).addEventListener("click",t=>{ue()})}function bn(e){if(z.ignoreFocusChanges)return;let t=c(ie);if(t.contains(e.target))z.lastFocus=e.target;else{z.ignoreFocusChanges=!0;let n=Hr(t);z.lastFocus===n?Fr(t).focus():n.focus(),z.ignoreFocusChanges=!1,z.lastFocus=document.activeElement}}function Hr(e){return e.querySelector(yn)}function Fr(e){let t=e.querySelectorAll(yn);return t[t.length-1]}function Ne({title:e,body:t}){z.prevFocus=document.activeElement,document.addEventListener("focus",bn,!0),c(Rr).innerHTML=e,c(Nr).innerHTML=t,c(ie).classList.add("shown"),c(ie).focus()}function ue(){c(ie).classList.remove("shown"),document.addEventListener("focus",bn,!0),z.prevFocus&&z.prevFocus.focus(),z.prevFocus=null}function Sn(){return c(ie).classList.contains("shown")}var Dr="https://hexdocs.pm/%%",Mr="https://hex.pm/api/packages?search=name:%%*",Br=".display-quick-switch",et="#quick-switch-input",En="#quick-switch-results",zr=".quick-switch-result",$r=300,qr=9,Vr=["elixir","eex","ex_unit","hex","iex","logger","mix"].map(e=>({name:e})),Ln=2,P={autocompleteResults:[],selectedIdx:null};function Tn(){jr()}function jr(){k(Br).forEach(e=>{e.addEventListener("click",t=>{nt()})})}function Ur(e){if(e.key==="Enter"){let t=e.target.value;Gr(t),e.preventDefault()}else e.key==="ArrowUp"?(xn(-1),e.preventDefault()):e.key==="ArrowDown"&&(xn(1),e.preventDefault())}function Wr(e){let t=e.target.value;if(t.lengthn.json()).then(n=>{Array.isArray(n)&&(P.autocompleteResults=Xr(e,n),P.selectedIdx=null,c(et).value.length>=Ln&&Jr({results:P.autocompleteResults}))})}function Jr({results:e}){let t=c(En),n=Handlebars.templates["quick-switch-results"]({results:e});t.innerHTML=n,k(zr).forEach(i=>{i.addEventListener("click",r=>{let s=i.getAttribute("data-index"),o=P.autocompleteResults[s];tt(o.name)})})}function Xr(e,t){return Vr.concat(t).filter(n=>n.name.toLowerCase().includes(e.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,qr)}function xn(e){P.selectedIdx=Zr(e);let t=c(".quick-switch-result.selected"),n=c(`.quick-switch-result[data-index="${P.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function Zr(e){let t=P.autocompleteResults.length;if(P.selectedIdx===null){if(e>=0)return 0;if(e<0)return t-1}return(P.selectedIdx+e+t)%t}var es=".display-settings",ts="#settings-modal-content",it="#modal-settings-tab",rt="#modal-keyboard-shortcuts-tab",kn="#settings-content",_n="#keyboard-shortcuts-content",ns=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];function On(){is()}function is(){k(es).forEach(e=>{e.addEventListener("click",t=>{st()})})}function wn(){c(rt).classList.remove("active"),c(it).classList.add("active"),c(kn).classList.remove("hidden"),c(_n).classList.add("hidden")}function rs(){c(rt).classList.add("active"),c(it).classList.remove("active"),c(_n).classList.remove("hidden"),c(kn).classList.add("hidden")}function st(){Ne({title:ns.map(({id:s,title:o})=>``).join(""),body:Handlebars.templates["settings-modal-body"]({shortcuts:ot})});let e=c(ts),t=e.querySelector('[name="theme"]'),n=e.querySelector('[name="tooltips"]'),i=e.querySelector('[name="direct_livebook_url"]'),r=e.querySelector('[name="livebook_url"]');O.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=>{O.update({theme:s.target.value})}),n.addEventListener("change",s=>{O.update({tooltips:s.target.checked})}),i.addEventListener("change",s=>{let o=s.target.checked?r.value:null;O.update({livebookUrl:o})}),r.addEventListener("input",s=>{O.update({livebookUrl:s.target.value})}),c(it).addEventListener("click",s=>{wn()}),c(rt).addEventListener("click",s=>{rs()}),wn()}var ss="#settings-modal-content",ot=[{key:"c",description:"Toggle sidebar",action:Me},{key:"n",description:"Cycle themes",action:jt},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:at},{key:"/",action:at},{key:"k",hasModifier:!0,action:at},{key:"g",description:"Search HexDocs package",displayAs:"g",action:nt},{key:"?",displayAs:"?",description:"Bring up this modal",action:ls}],ct={shortcutBeingPressed:null};function In(){os()}function os(){document.addEventListener("keydown",as),document.addEventListener("keyup",cs)}function as(e){if(ct.shortcutBeingPressed||e.target.matches("input, textarea"))return;let t=ot.find(n=>n.hasModifier?ve()&&e.metaKey||e.ctrlKey?n.key===e.key:!1:e.ctrlKey||e.metaKey||e.altKey?!1:n.key===e.key);t&&(ct.shortcutBeingPressed=t,e.preventDefault(),t.action(e))}function cs(e){ct.shortcutBeingPressed=null}function at(e){ue(),Xe()}function ls(){us()?ue():st()}function us(){return Sn()&&c(ss)}var K={plain:"plain",function:"function",module:"module"},ds=[{href:"typespecs.html#basic-types",hint:{kind:K.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:K.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:K.plain,description:"Built-in type"}}],Qe={cancelHintFetching:null};function Cn(e){if(Pn(e))return!0;let t=/#.*\//;return e.includes("#")&&!t.test(e)?!1:e.includes(".html")}function An(e){let t=Pn(e);return t?Promise.resolve(t):fs(e)}function Pn(e){let t=ds.find(n=>e.includes(n.href));return t?t.hint:null}function fs(e){let t=e.replace(".html",".html?hint=true");return new Promise((n,i)=>{let r=document.createElement("iframe");r.setAttribute("sandbox","allow-scripts allow-same-origin"),r.setAttribute("src",t),r.style.display="none";function s(a){let{href:l,hint:u}=a.data;t===l&&(o(),n(u))}Qe.cancelHintFetching=()=>{o(),i(new Error("cancelled"))};function o(){r.remove(),window.removeEventListener("message",s),Qe.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(r)})}function Rn(){Qe.cancelHintFetching&&Qe.cancelHintFetching()}function Nn(e){let n=e.querySelector("h1").textContent,i=e.querySelector(".docstring > p"),r=i?i.innerHTML:"";return{kind:K.function,title:n.trim(),description:r.trim()}}function Qn(e){let n=e.querySelector("h1 > span").textContent,i=e.querySelector("#moduledoc p"),r=i?i.innerHTML:"";return{kind:K.module,title:n.trim(),description:r.trim()}}var hs=".content a",lt="#tooltip",ps="#tooltip .tooltip-body",Fn="body .content-inner",ms="#content",Dn="tooltip-shown",de=10,gs=de*4,Hn={height:450,width:768},ys=100,re={currentLinkElement:null,hoverDelayTimeout:null};function Mn(){vs(),bs()}function vs(){let e=Handlebars.templates["tooltip-layout"]();c(Fn).insertAdjacentHTML("beforeend",e)}function bs(){k(hs).forEach(e=>{Ss(e)&&(e.addEventListener("mouseenter",t=>{Es(e)}),e.addEventListener("mouseleave",t=>{ks(e)}))})}function Ss(e){return!(e.classList.contains("detail-link")||xs(e.href)||!Cn(e.href))}function xs(e){let t=e.replace(ms,"");return window.location.href.split("#")[0]===t}function Es(e){Ls()&&(re.currentLinkElement=e,re.hoverDelayTimeout=setTimeout(()=>{An(e.href).then(t=>{Ts(t),ws()}).catch(()=>{})},ys))}function Ls(){let e=window.innerWidthe.firstElementChild&&e.firstElementChild.tagName==="CODE").forEach(e=>e.insertAdjacentHTML("beforeend",Qs)),Array.from(k(".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 Vn(){let t=/(Macintosh|iPhone|iPad|iPod)/.test(window.navigator.userAgent)?"apple-os":"non-apple-os";document.documentElement.classList.add(t)}var Fs="content",Ds="tabs-open",Ms="tabs-close",Bs="H3",zs="tabset";function Un(){$s().map(qs).forEach(n=>Us(n))}function $s(){let e=document.createNodeIterator(document.getElementById(Fs),NodeFilter.SHOW_COMMENT,{acceptNode(i){return i.nodeValue.trim()===Ds?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),t=[],n;for(;n=e.nextNode();)t.push(n);return t}function qs(e,t,n){let i=[],r=[],s={label:"",content:[]};for(;e=e.nextSibling;){if(Vs(e)){jn(s,r,t);break}i.push(e),e.nodeName===Bs?(jn(s,r,t),s.label=e.innerText,s.content=[]):s.content.push(e.outerHTML)}let o=document.createElement("div");return o.className=zs,js(i,o),o.innerHTML=Handlebars.templates.tabset({tabs:r}),o}function Vs(e){return e.nodeName==="#comment"&&e.nodeValue.trim()===Ms}function jn(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 js(e,t){if(!e||!e.length)return!1;e[0].parentNode.insertBefore(t,e[0]),e.forEach(n=>t.appendChild(n))}function Us(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}function Wn(){let e=ge(Z(),!0);e&&Ws(e)}function Ws(e){Js(e),Ks(),Ys(),Gs()}function Gs(){let e=document.body.scrollHeight,t=document.getElementById("content").scrollHeight,n={type:"preview",maxHeight:e,contentHeight:t};window.parent.postMessage(n,"*")}function Ks(){let e=document.getElementsByTagName("a");for(let t of e)t.getAttribute("target")!=="_blank"&&t.setAttribute("target","_parent")}function Ys(){window.scrollTo(0,0)}function Js(e){document.body.classList.add("preview");let t=document.getElementById("content");t.innerHTML=e.innerHTML}yt(()=>{let e=new URLSearchParams(window.location.search),t=e.has("preview");Vt(e.get("theme")),xt(t),gn(),Mn(),$n(),qn(),Vn(),Un(),t?Wn():(on(),It(),Qt(),nn(),vn(),In(),Tn(),$t(),dn(),On())});})(); +/*! 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/formatters/html/dist/html-Y7ASKYHF.js b/formatters/html/dist/html-Y7ASKYHF.js deleted file mode 100644 index 8068007ef..000000000 --- a/formatters/html/dist/html-Y7ASKYHF.js +++ /dev/null @@ -1,56 +0,0 @@ -(()=>{var Jn=Object.create;var ut=Object.defineProperty;var Xn=Object.getOwnPropertyDescriptor;var Zn=Object.getOwnPropertyNames;var er=Object.getPrototypeOf,tr=Object.prototype.hasOwnProperty;var dt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var nr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zn(t))!tr.call(e,i)&&i!==n&&ut(e,i,{get:()=>t[i],enumerable:!(r=Xn(t,i))||r.enumerable});return e};var ft=(e,t,n)=>(n=e!=null?Jn(er(e)):{},nr(t||!e||!e.__esModule?ut(n,"default",{value:e,enumerable:!0}):n,e));var kt=dt((no,wt)=>{var Tt="Expected a function",Et=NaN,hr="[object Symbol]",pr=/^\s+|\s+$/g,mr=/^[-+]0x[0-9a-f]+$/i,gr=/^0b[01]+$/i,yr=/^0o[0-7]+$/i,vr=parseInt,br=typeof global=="object"&&global&&global.Object===Object&&global,Sr=typeof self=="object"&&self&&self.Object===Object&&self,xr=br||Sr||Function("return this")(),Er=Object.prototype,Lr=Er.toString,Tr=Math.max,wr=Math.min,Fe=function(){return xr.Date.now()};function kr(e,t,n){var r,i,s,o,a,l,u=0,f=!1,y=!1,g=!0;if(typeof e!="function")throw new TypeError(Tt);t=Lt(t)||0,be(n)&&(f=!!n.leading,y="maxWait"in n,s=y?Tr(Lt(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g);function L(S){var C=r,D=i;return r=i=void 0,u=S,o=e.apply(D,C),o}function b(S){return u=S,a=setTimeout(p,t),f?L(S):o}function T(S){var C=S-l,D=S-u,V=t-C;return y?wr(V,s-D):V}function m(S){var C=S-l,D=S-u;return l===void 0||C>=t||C<0||y&&D>=s}function p(){var S=Fe();if(m(S))return _(S);a=setTimeout(p,T(S))}function _(S){return a=void 0,g&&r?L(S):(r=i=void 0,o)}function w(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function N(){return a===void 0?o:_(Fe())}function F(){var S=Fe(),C=m(S);if(r=arguments,i=this,l=S,C){if(a===void 0)return b(l);if(y)return a=setTimeout(p,t),L(l)}return a===void 0&&(a=setTimeout(p,t)),o}return F.cancel=w,F.flush=N,F}function _r(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(Tt);return be(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),kr(e,t,{leading:r,maxWait:t,trailing:i})}function be(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Or(e){return!!e&&typeof e=="object"}function Ir(e){return typeof e=="symbol"||Or(e)&&Lr.call(e)==hr}function Lt(e){if(typeof e=="number")return e;if(Ir(e))return Et;if(be(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=be(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(pr,"");var n=gr.test(e);return n||yr.test(e)?vr(e.slice(2),n?2:8):mr.test(e)?Et:+e}wt.exports=_r});var cn=dt((on,an)=>{(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),r=Object.keys(t),i=0;i0){var f=e.utils.clone(n)||{};f.position=[a,u],f.index=s.length,s.push(new e.Token(r.slice(a,o),f))}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(r){var i=e.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),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 r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,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,r=0;r1&&(ot&&(r=s),o!=t);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==t||o>t)return s*2;if(ol?f+=2:a==l&&(n+=r[u+1]*i[f+1],u+=2,f+=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,r=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),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.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 u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var f=s.str.charAt(0),y=s.str.charAt(1),g;y in s.node.edges?g=s.node.edges[y]:(g=new e.TokenSet,s.node.edges[y]=g),s.str.length==1&&(g.final=!0),i.push({node:g,editsRemaining:s.editsRemaining-1,str:f+s.str.slice(2)})}}}return r},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,r=n,i=0,s=t.length;i=t;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.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 r=new e.QueryParser(t,n);r.parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=t},e.Builder.prototype.k1=function(t){this._k1=t},e.Builder.prototype.add=function(t,n){var r=t[this._ref],i=Object.keys(this._fields);this._documents[r]=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 r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new e.QueryParseError(r,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 r="unrecognised presence operator'"+n.str+"'";throw new e.QueryParseError(r,n.start,n.end)}var i=t.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new e.QueryParseError(r,n.start,n.end)}switch(i.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new e.QueryParseError(r,i.start,i.end)}}},e.QueryParser.parseField=function(t){var n=t.consumeLexeme();if(n!=null){if(t.query.allFields.indexOf(n.str)==-1){var r=t.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.fields=[n.str];var s=t.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new e.QueryParseError(i,n.start,n.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new e.QueryParseError(i,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 r=t.peekLexeme();if(r==null){t.nextClause();return}switch(r.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 i="Unexpected lexeme type '"+r.type+"'";throw new e.QueryParseError(i,r.start,r.end)}}},e.QueryParser.parseEditDistance=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.editDistance=r;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 i="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(i,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.boost=r;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 i="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(i,s.start,s.end)}}},function(t,n){typeof define=="function"&&define.amd?define(n):typeof on=="object"?an.exports=n():t.lunr=n()}(this,function(){return e})})()});Handlebars.registerHelper("groupChanged",function(e,t,n){let r=t||"";if(e.group!==r)return delete e.nestedContext,e.group=r,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 e+".html"===n?t.fn(this):t.inverse(this)});var c=document.querySelector.bind(document),k=document.querySelectorAll.bind(document);function ht(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function me(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function $(){return document.body.dataset.type}function pt(e,t){if(e){for(let n of e){let r=n.nodeGroups&&n.nodeGroups.find(i=>i.nodes.some(s=>s.anchor===t));if(r)return r.key}return null}}function ge(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())?rr(n):null:null}function rr(e){let t=[e],n=e.nextElementSibling,r=e.tagName.toLowerCase();for(;n;){let s=n.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6"].includes(s)&&s<=r?n=null:(t.push(n),n=n.nextElementSibling)}let i=document.createElement("div");return i.append(...t),i}function Z(){return window.location.hash.replace(/^#/,"")}function mt(e){return new URLSearchParams(window.location.search).get(e)}function gt(e){return fetch(e).then(t=>t.ok).catch(()=>!1)}function yt(e){document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e)}function ee(e){return!e||e.trim()===""}function vt(e,t){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{n=null,e(...i)},t)}}function ye(){return document.head.querySelector("meta[name=project][content]").content}function ve(){return/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)}var bt="ex_doc:settings",ir={tooltips:!0,theme:null,livebookUrl:null},He=class{constructor(){this._subscribers=[],this._settings=ir,this._loadSettings()}get(){return this._settings}update(t){let n=this._settings;this._settings={...this._settings,...t},this._subscribers.forEach(r=>r(this._settings,n)),this._storeSettings()}getAndSubscribe(t){this._subscribers.push(t),t(this._settings)}_loadSettings(){try{let t=localStorage.getItem(bt);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(bt,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"))}},O=new He;var sr=".content",St=".content-inner",or=".livebook-badge";function xt(e){e||lr(),ur(),ar(),cr()}function ar(){c(sr).querySelectorAll("a").forEach(e=>{e.querySelector("code, img")&&e.classList.add("no-underline")})}function cr(){["warning","info","error","neutral","tip"].forEach(t=>{k(`blockquote h3.${t}, blockquote h4.${t}`).forEach(n=>{n.closest("blockquote").classList.add(t)})})}function lr(){c(St).setAttribute("tabindex",-1),c(St).focus()}function ur(){let t=window.location.pathname.replace(/(\.html)?$/,".livemd"),n=new URL(t,window.location.href).toString();O.getAndSubscribe(r=>{let i=r.livebookUrl?fr(r.livebookUrl,n):dr(n);for(let s of k(or))s.href=i})}function dr(e){return`https://livebook.dev/run?url=${encodeURIComponent(e)}`}function fr(e,t){return`${e}/import?url=${encodeURIComponent(t)}`}var Ot=ft(kt());var Cr=768,De=300,te=".sidebar-toggle",Ar=".content",M={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"},Pr=Object.values(Q),A={togglingTimeout:null,lastWindowWidth:window.innerWidth,sidebarPreference:M.NO_PREF};function It(){Ct(),Rr(),Nr()}function Rr(){let e=sessionStorage.getItem("sidebar_width");e&&_t(e),new ResizeObserver(n=>{for(let r of n)_t(r.contentRect.width)}).observe(document.getElementById("sidebar"))}function _t(e){sessionStorage.setItem("sidebar_width",e),document.body.style.setProperty("--sidebarWidth",`${e}px`)}function Ct(){sessionStorage.getItem("sidebar_state")==="closed"||At()?(q(Q.closed),c(te).setAttribute("aria-expanded","false")):(q(Q.opened),c(te).setAttribute("aria-expanded","true")),setTimeout(()=>c(te).classList.add("sidebar-toggle--animated"),De)}function At(){return window.matchMedia(`screen and (max-width: ${Cr}px)`).matches}function q(...e){document.body.classList.remove(...Pr),document.body.classList.add(...e)}function Nr(){c(te).addEventListener("click",e=>{Me(),Dr()}),c(Ar).addEventListener("click",e=>{Fr()}),window.addEventListener("resize",(0,Ot.default)(e=>{Hr()},100))}function Me(){return Be()?Pt():Qr()}function Be(){return document.body.classList.contains(Q.opened)||document.body.classList.contains(Q.opening)}function Qr(){Rt(),sessionStorage.setItem("sidebar_state","opened"),c(te).setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{q(Q.openingStart),requestAnimationFrame(()=>(q(Q.opening),new Promise((e,t)=>{A.togglingTimeout=setTimeout(()=>{q(Q.opened),e()},De)})))})}function Pt(){Rt(),sessionStorage.setItem("sidebar_state","closed"),c(te).setAttribute("aria-expanded","false"),requestAnimationFrame(()=>{q(Q.closingStart),requestAnimationFrame(()=>(q(Q.closing),new Promise((e,t)=>{A.togglingTimeout=setTimeout(()=>{q(Q.closed),e()},De)})))})}function Rt(){A.togglingTimeout&&(clearTimeout(A.togglingTimeout),A.togglingTimeout=null)}function Hr(){A.lastWindowWidth!==window.innerWidth&&(A.lastWindowWidth=window.innerWidth,(A.sidebarPreference===M.OPEN||A.sidebarPreference===M.NO_PREF)&&Ct())}function Fr(){At()&&Be()&&Pt()}function Dr(){switch(A.sidebarPreference){case M.OPEN:A.sidebarPreference=M.CLOSED;break;case M.CLOSED:A.sidebarPreference=M.OPEN;break;case M.NO_PREF:Be()?A.sidebarPreference=M.OPEN:A.sidebarPreference=M.CLOSED}}function ae(){return window.sidebarNodes||{}}function Nt(){return window.versionNodes||[]}var ze={search:"search",extras:"extras",modules:"modules",tasks:"tasks"},$e=[ze.extras,ze.modules,ze.tasks],xe=e=>`#${e}-full-list`;function Qt(){$e.forEach(e=>{Mr(ae(),e)}),Se($()),Ft(),Ht(),Ur()}function Mr(e,t){let n=e[t]||[],r=c(xe(t));if(!r)return;let i=Handlebars.templates["sidebar-items"]({nodes:n,group:""});r.innerHTML=i,r.querySelectorAll("ul").forEach(s=>{if(s.innerHTML.trim()===""){let o=s.previousElementSibling;o.classList.contains("expand")&&o.classList.remove("expand"),s.remove()}}),r.querySelectorAll("li a + button").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.closest("li");zr(l)})}),r.querySelectorAll("li a").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.closest("li"),u=r.querySelector(".current-section");u&&qr(u),s.matches(".expand")&&s.pathname===window.location.pathname&&qe(l)})})}function qe(e){e.classList.add("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","true")}function Br(e){e.classList.remove("open"),e.querySelector("button[aria-controls]").setAttribute("aria-expanded","false")}function zr(e){e.classList.contains("open")?Br(e):qe(e)}function $r(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 Vr(e){e.classList.add("current-hash"),e.querySelector("a").setAttribute("aria-current","true")}function jr(e){e.classList.remove("current-hash"),e.querySelector("a").setAttribute("aria-current","false")}function Se(e){$e.forEach(t=>{let n=c(`#${t}-list-tab-button`);if(n){let r=c(`#${n.getAttribute("aria-controls")}`);t===e?(n.parentElement.classList.add("selected"),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0"),r.removeAttribute("hidden")):(n.parentElement.classList.remove("selected"),n.setAttribute("aria-selected","false"),n.setAttribute("tabindex","-1"),r.setAttribute("hidden","hidden"))}})}function Ht(){let e=c(xe($()));if(!e)return;let t=e.querySelector("li.current-page");t&&(t.scrollIntoView(),e.scrollTop-=40)}function Ft(){let e=Z()||"content",n=ae()[$()]||[],r=pt(n,e),i=c(xe($()));if(!i)return;let s=i.querySelector(`li.current-page a.expand[href$="#${r}"]`);s&&qe(s.closest("li"));let o=i.querySelector(`li.current-page a[href$="#${e}"]`);if(o){let a=o.closest("ul");a.classList.contains("deflist")&&$r(a.closest("li")),Vr(o.closest("li"))}}function Ur(){$e.forEach(t=>{let n=c(`#${t}-list-tab-button`);n&&n.addEventListener("click",r=>{Se(t),Ht()})});let e=c("#sidebar-listNav");e.addEventListener("keydown",t=>{if(t.key!=="ArrowRight"&&t.key!=="ArrowLeft")return;let n=Array.from(e.querySelectorAll('[role="tab"]')).map(i=>i.dataset.type),r=e.querySelector('[role="tab"][aria-selected="true"]').dataset.type;if(t.key==="ArrowRight"){let i=n.indexOf(r)+1;i>=n.length&&(i=0);let s=n[i];Se(s),c(`#${s}-list-tab-button`).focus()}else if(t.key==="ArrowLeft"){let i=n.indexOf(r)-1;i<0&&(i=n.length-1);let s=n[i];Se(s),c(`#${s}-list-tab-button`).focus()}}),window.addEventListener("hashchange",t=>{let n=c(xe($()));if(!n)return;let r=n.querySelector("li.current-page li.current-hash");r&&jr(r),Ft()})}var B={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function Mt(e,t=8){if(ee(e))return[];let n=ae(),r=[...Ve(n.modules,e,B.module,"module"),...Wr(n.modules,e,B.moduleChild),...Ve(n.tasks,e,B.mixTask,"mix task"),...Ve(n.extras,e,B.extra,"page"),...je(n.modules,e,B.section,"module"),...je(n.tasks,e,B.section,"mix task"),...je(n.extras,e,B.section,"page")].filter(i=>i!==null);return ei(r).slice(0,t)}function Ve(e,t,n,r){return e.map(i=>Kr(i,t,n,r))}function Wr(e,t,n){return e.filter(r=>r.nodeGroups).flatMap(r=>r.nodeGroups.flatMap(({key:i,nodes:s})=>{let o=Zr(i);return s.map(a=>Yr(a,r.id,t,n,o)||Xr(a,r.id,t,n,o))}))}function je(e,t,n,r){return e.flatMap(i=>Gr(i).map(s=>Jr(i,s,t,n,r)))}function Gr(e){return(e.sections||[]).concat(e.headers||[])}function Kr(e,t,n,r){return Le(e.title,t)?{link:`${e.id}.html`,title:ke(e.title,t),description:null,matchQuality:Te(e.title,t),deprecated:e.deprecated,labels:[r],category:n}:null}function Yr(e,t,n,r,i){return Le(e.id,n)?{link:`${t}.html#${e.anchor}`,title:ke(e.id,n),labels:[i],description:t,matchQuality:Te(e.id,n),deprecated:e.deprecated,category:r}:null}function Jr(e,t,n,r,i){return Bt(t.id,n)?{link:`${e.id}.html#${t.anchor}`,title:ke(t.id,n),description:e.title,matchQuality:Te(t.id,n),labels:[i,"section"],category:r}:null}function Xr(e,t,n,r,i){let s=`${t}.${e.id}`,o=`${t}:${e.id}`,a,l;if(Le(s,n))a=s,l=/\./g;else if(Le(o,n))a=o,l=/:/g;else return null;let u=n.replace(l," ");return Bt(e.id,u)?{link:`${t}.html#${e.anchor}`,title:ke(e.id,u),label:i,description:t,matchQuality:Te(a,n),deprecated:e.deprecated,category:r}:null}function Zr(e){switch(e){case"callbacks":return"callback";case"types":return"type";default:return"function"}}function ei(e){return e.slice().sort((t,n)=>t.matchQuality!==n.matchQuality?n.matchQuality-t.matchQuality:Dt(t.category)-Dt(n.category))}function Dt(e){switch(e){case B.module:return 1;case B.moduleChild:return 2;case B.mixTask:return 3;default:return 4}}function Bt(e,t){return we(t).some(r=>zt(e,r))}function Le(e,t){return we(t).every(r=>zt(e,r))}function zt(e,t){return e.toLowerCase().includes(t.toLowerCase())}function Te(e,t){let n=we(t),i=n.map(o=>o.length).reduce((o,a)=>o+a,0)/e.length,s=ti(e,n[0])?1:0;return i+s}function ti(e,t){return e.toLowerCase().startsWith(t.toLowerCase())}function we(e){return e.trim().split(/\s+/)}function ke(e,t){let n=we(t).sort((r,i)=>i.length-r.length);return Ee(e,n)}function Ee(e,t){if(t.length===0)return e;let[n,...r]=t,i=e.match(new RegExp(`(.*)(${ht(n)})(.*)`,"i"));if(i){let[,s,o,a]=i;return Ee(s,t)+""+me(o)+""+Ee(a,t)}else return Ee(e,r)}var _e=null,G=null;function $t(){G=document.getElementById("toast"),G.addEventListener("click",e=>{clearTimeout(_e),e.target.classList.remove("show")})}function Ue(e){G&&(clearTimeout(_e),G.innerText=e,G.classList.add("show"),_e=setTimeout(()=>{G.classList.remove("show"),_e=setTimeout(function(){G.innerText=""},1e3)},5e3))}var qt="dark",We=["system","dark","light"];function Vt(e){O.getAndSubscribe(t=>{document.body.classList.toggle(qt,Ut(e||t.theme))}),ri()}function jt(){let e=We[We.indexOf(Ge())+1]||We[0];O.update({theme:e}),Ue(`Set theme to "${e}"`)}function Ge(){return O.get().theme||"system"}function Ut(e){return e==="dark"||ni()&&(e==null||e==="system")}function ni(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function ri(){window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>{let t=O.get().theme,n=Ut(t);(t==null||t==="system")&&(document.body.classList.toggle(qt,n),Ue(`Browser changed theme to "${n?"dark":"light"}"`))})}var ne=".autocomplete",Ie=".autocomplete-suggestions",Oe=".autocomplete-suggestion",I={autocompleteSuggestions:[],previewOpen:!1,selectedIdx:-1};function ii(){c(ne).classList.add("shown")}function Ke(){c(ne).classList.remove("shown")}function Wt(){return c(ne).classList.contains("shown")}function Ye(e){I.autocompleteSuggestions=Mt(e),I.selectedIdx=-1,ee(e)?Ke():(si({term:e,suggestions:I.autocompleteSuggestions}),Ce(0),ii())}function si({term:e,suggestions:t}){let n=Handlebars.templates["autocomplete-suggestions"]({suggestions:t,term:e}),r=c(ne);r.innerHTML=n}function Gt(){return I.selectedIdx===-1?null:I.autocompleteSuggestions[I.selectedIdx]}function Ce(e){Kt(oi(e))}function Kt(e){I.selectedIdx=e;let t=c(Ie),n=c(`${Oe}.selected`),r=c(`${Oe}[data-index="${I.selectedIdx}"]`);if(n&&n.classList.remove("selected"),r){if(I.previewOpen){Jt(),t.classList.add("previewing");let i=document.createElement("div");i.classList.add("autocomplete-preview");let s=document.createElement("iframe"),o=r.href.replace(".html",`.html?preview=true&theme=${Ge()}`);s.setAttribute("sandbox","allow-scripts allow-same-origin allow-popups"),s.setAttribute("src",o),i.replaceChildren(s),r.parentNode.insertBefore(i,r.nextSibling)}r.classList.add("selected"),r.scrollIntoView({block:"nearest"})}else t&&(t.scrollTop=0)}function Yt(){I.previewOpen?Ae():Je()}function Ae(){I.previewOpen=!1,c(Ie).classList.remove("previewing"),Jt()}function Je(e){I.previewOpen=!0,e?e=e.closest(Oe):e=c(`${Oe}[data-index="${I.selectedIdx}"]`),e&&Kt(parseInt(e.dataset.index))}function Jt(){let e=c(".autocomplete-preview");e&&e.remove()}function oi(e){let t=I.autocompleteSuggestions.length+1;return(I.selectedIdx+e+1+t)%t-1}var le="form.search-bar input",ai="form.search-bar .search-close-button";function tn(){ci(),window.onTogglePreviewClick=function(e,t){e.preventDefault(),e.stopImmediatePropagation(),Xe(),t?Je(e.target):Ae()}}function nn(e){let t=c(le);t.value=e}function Xe(){let e=c(le);document.body.classList.add("search-focused"),e.focus()}function ci(){let e=c(le);if(document.querySelector('meta[name="exdoc:autocomplete"][content="off"]'))return e.addEventListener("keydown",t=>{t.key==="Enter"&&Xt(t)}),!0;e.addEventListener("keydown",t=>{let n=ve();t.key==="Escape"?(Pe(),e.blur()):t.key==="Enter"?Xt(t):t.key==="ArrowUp"||n&&t.ctrlKey&&t.key==="p"?(Ce(-1),t.preventDefault()):t.key==="ArrowDown"||n&&t.ctrlKey&&t.key==="n"?(Ce(1),t.preventDefault()):t.key==="Tab"&&(Yt(),t.preventDefault())}),e.addEventListener("input",t=>{Ye(t.target.value)}),e.addEventListener("focus",t=>{document.body.classList.contains("search-focused")||(document.body.classList.add("search-focused"),Ye(t.target.value))}),e.addEventListener("blur",t=>{let n=t.relatedTarget;if(n){if(c(Ie).contains(n))return setTimeout(()=>{Wt()&&e.focus()},1e3),null;ce()}else ce()}),c(ne).addEventListener("click",t=>{t.shiftKey||t.ctrlKey?e.focus():(Pe(),ce())}),c(ai).addEventListener("click",t=>{Pe(),ce()})}function Xt(e){let t=c(le),n=e.shiftKey||e.ctrlKey,r=Gt();e.preventDefault();let i=n?"_blank":"_self",s=document.createElement("a");if(s.setAttribute("target",i),r)s.setAttribute("href",r.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||(Pe(),ce())}function Pe(){let e=c(le);e.value=""}function ce(){Ae(),document.body.classList.remove("search-focused"),Ke()}var Zt=window.scrollY,en=70;window.addEventListener("scroll",function(){let e=window.scrollY;e>en*2&&document.body.classList.add("scroll-sticky"),e===0&&document.body.classList.remove("scroll-sticky"),e>Zt&&e>en?document.body.classList.remove("scroll-sticky"):document.body.classList.add("scroll-sticky"),Zt=e<=0?0:e},!1);var rn=".sidebar-projectVersion",li=".sidebar-projectVersionsDropdown";function sn(){let e=Nt();if(e.length>0){let n=c(rn).textContent.trim(),r=di(e,n);ui({nodes:r})}}function ui({nodes:e}){let t=c(rn),n=Handlebars.templates["versions-dropdown"]({nodes:e});t.innerHTML=n,c(li).addEventListener("change",hi)}function di(e,t){return fi(e,t).map(r=>({...r,isCurrentVersion:r.version===t}))}function fi(e,t){return e.some(r=>r.version===t)?e:[{version:t,url:"#"},...e]}function hi(e){let t=e.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,r=`${t}/${n}`;gt(r).then(i=>{i?window.location.href=r:window.location.href=t})}var H=ft(cn());var Re=80,pi="#search";function un(){if(window.location.pathname.endsWith("/search.html")){let e=mt("q");mi(e)}}async function mi(e){if(ee(e))Ze({value:e});else{nn(e);let t=await gi();try{let n=e.replaceAll(/(\B|\\):/g,"\\:"),r=ki(t.search(n));Ze({value:e,results:r})}catch(n){Ze({value:e,errorMessage:n.message})}}}function Ze({value:e,results:t,errorMessage:n}){let r=c(pi),i=Handlebars.templates["search-results"]({value:e,results:t,errorMessage:n});r.innerHTML=i}async function gi(){H.default.tokenizer.separator=/\s+/,H.default.QueryLexer.termSeparator=/\s+/,H.default.Pipeline.registerFunction(fn,"docTokenSplitter"),H.default.Pipeline.registerFunction(hn,"docTrimmer");let e=await yi();if(e)return e;let t=Li();return vi(t),t}async function yi(){try{let e=sessionStorage.getItem(dn());if(e){let t=await Si(e);return H.default.Index.load(t)}else return null}catch(e){return console.error("Failed to load index: ",e),null}}async function vi(e){try{let t=await bi(e);sessionStorage.setItem(dn(),t)}catch(t){console.error("Failed to save index: ",t)}}async function bi(e){let t=new Blob([JSON.stringify(e)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),r=await(await new Response(t).blob()).arrayBuffer();return xi(r)}async function Si(e){let t=new Blob([Ei(e)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(t).text();return JSON.parse(n)}function xi(e){let t="",n=new Uint8Array(e),r=n.byteLength;for(let i=0;i{this.add(e)})})}function Ti(e){e.pipeline.before(H.default.stemmer,fn)}function fn(e){let t=e.toString().split(/\:|\.|\/|_|-/).map(n=>e.clone().update(()=>n));return t.length>1?[...t,e]:t}function wi(e){e.pipeline.before(H.default.stemmer,hn)}function hn(e){return e.update(function(t){return t.replace(/^[^@:\w]+/,"").replace(/[^\?\!\w]+$/,"")})}function ki(e){return e.filter(t=>ln(t.ref)).map(t=>{let n=ln(t.ref),r=t.matchData.metadata;return{...n,metadata:r,excerpts:_i(n,r)}})}function ln(e){return searchData.items.find(t=>t.ref===e)||null}function _i(e,t){let{doc:n}=e,i=Object.keys(t).filter(s=>"doc"in t[s]).map(s=>t[s].doc.position.map(([o,a])=>Oi(n,o,a))).reduce((s,o)=>s.concat(o),[]);return i.length===0?[n.slice(0,Re*2)+(Re*20?"...":"",e.slice(r,t),""+me(e.slice(t,t+n))+"",e.slice(t+n,i),i{let n=t.getAttribute("data-group-id");t.addEventListener("mouseenter",r=>{pn(n,!0)}),t.addEventListener("mouseleave",r=>{pn(n,!1)})})}function pn(e,t){k(`[data-group-id="${e}"]`).forEach(r=>{r.classList.toggle(Ii,t)})}var re="#modal",Ai="#modal .modal-close",Pi="#modal .modal-title",Ri="#modal .modal-body",gn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',z={prevFocus:null,lastFocus:null,ignoreFocusChanges:!1};function yn(){Ni()}function Ni(){let e=Handlebars.templates["modal-layout"]();document.body.insertAdjacentHTML("beforeend",e),c(re).addEventListener("keydown",t=>{t.key==="Escape"&&ue()}),c(Ai).addEventListener("click",t=>{ue()})}function vn(e){if(z.ignoreFocusChanges)return;let t=c(re);if(t.contains(e.target))z.lastFocus=e.target;else{z.ignoreFocusChanges=!0;let n=Qi(t);z.lastFocus===n?Hi(t).focus():n.focus(),z.ignoreFocusChanges=!1,z.lastFocus=document.activeElement}}function Qi(e){return e.querySelector(gn)}function Hi(e){let t=e.querySelectorAll(gn);return t[t.length-1]}function Ne({title:e,body:t}){z.prevFocus=document.activeElement,document.addEventListener("focus",vn,!0),c(Pi).innerHTML=e,c(Ri).innerHTML=t,c(re).classList.add("shown"),c(re).focus()}function ue(){c(re).classList.remove("shown"),document.addEventListener("focus",vn,!0),z.prevFocus&&z.prevFocus.focus(),z.prevFocus=null}function bn(){return c(re).classList.contains("shown")}var Fi="https://hexdocs.pm/%%",Di="https://hex.pm/api/packages?search=name:%%*",Mi=".display-quick-switch",et="#quick-switch-input",xn="#quick-switch-results",Bi=".quick-switch-result",zi=300,$i=9,qi=["elixir","eex","ex_unit","hex","iex","logger","mix"].map(e=>({name:e})),En=2,P={autocompleteResults:[],selectedIdx:null};function Ln(){Vi()}function Vi(){k(Mi).forEach(e=>{e.addEventListener("click",t=>{nt()})})}function ji(e){if(e.key==="Enter"){let t=e.target.value;Wi(t),e.preventDefault()}else e.key==="ArrowUp"?(Sn(-1),e.preventDefault()):e.key==="ArrowDown"&&(Sn(1),e.preventDefault())}function Ui(e){let t=e.target.value;if(t.lengthn.json()).then(n=>{Array.isArray(n)&&(P.autocompleteResults=Ji(e,n),P.selectedIdx=null,c(et).value.length>=En&&Yi({results:P.autocompleteResults}))})}function Yi({results:e}){let t=c(xn),n=Handlebars.templates["quick-switch-results"]({results:e});t.innerHTML=n,k(Bi).forEach(r=>{r.addEventListener("click",i=>{let s=r.getAttribute("data-index"),o=P.autocompleteResults[s];tt(o.name)})})}function Ji(e,t){return qi.concat(t).filter(n=>n.name.toLowerCase().includes(e.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,$i)}function Sn(e){P.selectedIdx=Xi(e);let t=c(".quick-switch-result.selected"),n=c(`.quick-switch-result[data-index="${P.selectedIdx}"]`);t&&t.classList.remove("selected"),n&&n.classList.add("selected")}function Xi(e){let t=P.autocompleteResults.length;if(P.selectedIdx===null){if(e>=0)return 0;if(e<0)return t-1}return(P.selectedIdx+e+t)%t}var Zi=".display-settings",es="#settings-modal-content",rt="#modal-settings-tab",it="#modal-keyboard-shortcuts-tab",wn="#settings-content",kn="#keyboard-shortcuts-content",ts=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];function _n(){ns()}function ns(){k(Zi).forEach(e=>{e.addEventListener("click",t=>{st()})})}function Tn(){c(it).classList.remove("active"),c(rt).classList.add("active"),c(wn).classList.remove("hidden"),c(kn).classList.add("hidden")}function rs(){c(it).classList.add("active"),c(rt).classList.remove("active"),c(kn).classList.remove("hidden"),c(wn).classList.add("hidden")}function st(){Ne({title:ts.map(({id:s,title:o})=>``).join(""),body:Handlebars.templates["settings-modal-body"]({shortcuts:ot})});let e=c(es),t=e.querySelector('[name="theme"]'),n=e.querySelector('[name="tooltips"]'),r=e.querySelector('[name="direct_livebook_url"]'),i=e.querySelector('[name="livebook_url"]');O.getAndSubscribe(s=>{t.value=s.theme||"system",n.checked=s.tooltips,s.livebookUrl===null?(r.checked=!1,i.classList.add("hidden"),i.tabIndex=-1):(r.checked=!0,i.classList.remove("hidden"),i.tabIndex=0,i.value=s.livebookUrl)}),t.addEventListener("change",s=>{O.update({theme:s.target.value})}),n.addEventListener("change",s=>{O.update({tooltips:s.target.checked})}),r.addEventListener("change",s=>{let o=s.target.checked?i.value:null;O.update({livebookUrl:o})}),i.addEventListener("input",s=>{O.update({livebookUrl:s.target.value})}),c(rt).addEventListener("click",s=>{Tn()}),c(it).addEventListener("click",s=>{rs()}),Tn()}var is="#settings-modal-content",ot=[{key:"c",description:"Toggle sidebar",action:Me},{key:"n",description:"Cycle themes",action:jt},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:at},{key:"/",action:at},{key:"k",hasModifier:!0,action:at},{key:"g",description:"Search HexDocs package",displayAs:"g",action:nt},{key:"?",displayAs:"?",description:"Bring up this modal",action:cs}],ct={shortcutBeingPressed:null};function On(){ss()}function ss(){document.addEventListener("keydown",os),document.addEventListener("keyup",as)}function os(e){if(ct.shortcutBeingPressed||e.target.matches("input, textarea"))return;let t=ot.find(n=>n.hasModifier?ve()&&e.metaKey||e.ctrlKey?n.key===e.key:!1:e.ctrlKey||e.metaKey||e.altKey?!1:n.key===e.key);t&&(ct.shortcutBeingPressed=t,e.preventDefault(),t.action(e))}function as(e){ct.shortcutBeingPressed=null}function at(e){ue(),Xe()}function cs(){ls()?ue():st()}function ls(){return bn()&&c(is)}var K={plain:"plain",function:"function",module:"module"},us=[{href:"typespecs.html#basic-types",hint:{kind:K.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:K.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:K.plain,description:"Built-in type"}}],Qe={cancelHintFetching:null};function In(e){if(An(e))return!0;let t=/#.*\//;return e.includes("#")&&!t.test(e)?!1:e.includes(".html")}function Cn(e){let t=An(e);return t?Promise.resolve(t):ds(e)}function An(e){let t=us.find(n=>e.includes(n.href));return t?t.hint:null}function ds(e){let t=e.replace(".html",".html?hint=true");return new Promise((n,r)=>{let i=document.createElement("iframe");i.setAttribute("sandbox","allow-scripts allow-same-origin"),i.setAttribute("src",t),i.style.display="none";function s(a){let{href:l,hint:u}=a.data;t===l&&(o(),n(u))}Qe.cancelHintFetching=()=>{o(),r(new Error("cancelled"))};function o(){i.remove(),window.removeEventListener("message",s),Qe.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(i)})}function Pn(){Qe.cancelHintFetching&&Qe.cancelHintFetching()}function Rn(e){let n=e.querySelector("h1").textContent,r=e.querySelector(".docstring > p"),i=r?r.innerHTML:"";return{kind:K.function,title:n.trim(),description:i.trim()}}function Nn(e){let n=e.querySelector("h1 > span").textContent,r=e.querySelector("#moduledoc p"),i=r?r.innerHTML:"";return{kind:K.module,title:n.trim(),description:i.trim()}}var fs=".content a",lt="#tooltip",hs="#tooltip .tooltip-body",Hn="body .content-inner",ps="#content",Fn="tooltip-shown",de=10,ms=de*4,Qn={height:450,width:768},gs=100,ie={currentLinkElement:null,hoverDelayTimeout:null};function Dn(){ys(),vs()}function ys(){let e=Handlebars.templates["tooltip-layout"]();c(Hn).insertAdjacentHTML("beforeend",e)}function vs(){k(fs).forEach(e=>{bs(e)&&(e.addEventListener("mouseenter",t=>{xs(e)}),e.addEventListener("mouseleave",t=>{ws(e)}))})}function bs(e){return!(e.classList.contains("detail-link")||Ss(e.href)||!In(e.href))}function Ss(e){let t=e.replace(ps,"");return window.location.href.split("#")[0]===t}function xs(e){Es()&&(ie.currentLinkElement=e,ie.hoverDelayTimeout=setTimeout(()=>{Cn(e.href).then(t=>{Ls(t),Ts()}).catch(()=>{})},gs))}function Es(){let e=window.innerWidthe.firstElementChild&&e.firstElementChild.tagName==="CODE").forEach(e=>e.insertAdjacentHTML("beforeend",Ns)),Array.from(k(".copy-button")).forEach(e=>{let t;e.addEventListener("click",()=>{let n=e.querySelector("[aria-live]");t&&clearTimeout(t);let r=Array.from(e.parentElement.querySelector("code").childNodes).filter(i=>!(i.tagName==="SPAN"&&i.classList.contains("unselectable"))).map(i=>i.textContent).join("");navigator.clipboard.writeText(r),e.classList.add("clicked"),n.innerHTML="Copied! ✓",t=setTimeout(()=>{e.classList.remove("clicked"),n.innerHTML=""},3e3)})})}function qn(){let t=/(Macintosh|iPhone|iPad|iPod)/.test(window.navigator.userAgent)?"apple-os":"non-apple-os";document.documentElement.classList.add(t)}var Hs="content",Fs="tabs-open",Ds="tabs-close",Ms="H3",Bs="tabset";function jn(){zs().map($s).forEach(n=>js(n))}function zs(){let e=document.createNodeIterator(document.getElementById(Hs),NodeFilter.SHOW_COMMENT,{acceptNode(r){return r.nodeValue.trim()===Fs?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),t=[],n;for(;n=e.nextNode();)t.push(n);return t}function $s(e,t,n){let r=[],i=[],s={label:"",content:[]};for(;e=e.nextSibling;){if(qs(e)){Vn(s,i,t);break}r.push(e),e.nodeName===Ms?(Vn(s,i,t),s.label=e.innerText,s.content=[]):s.content.push(e.outerHTML)}let o=document.createElement("div");return o.className=Bs,Vs(r,o),o.innerHTML=Handlebars.templates.tabset({tabs:i}),o}function qs(e){return e.nodeName==="#comment"&&e.nodeValue.trim()===Ds}function Vn(e,t,n){if(e.label===""&&!e.content.length)return!1;let r=e.label,i=e.content;t.push({label:r,content:i,setIndex:n})}function Vs(e,t){if(!e||!e.length)return!1;e[0].parentNode.insertBefore(t,e[0]),e.forEach(n=>t.appendChild(n))}function js(e){let t={tabs:e.querySelectorAll(':scope [role="tab"]'),panels:e.querySelectorAll(':scope [role="tabpanel"]'),activeIndex:0};t.tabs.forEach((n,r)=>{n.addEventListener("click",i=>{Y(r,t)}),n.addEventListener("keydown",i=>{let s=t.tabs.length-1;i.code==="ArrowLeft"?(i.preventDefault(),t.activeIndex===0?Y(s,t):Y(t.activeIndex-1,t)):i.code==="ArrowRight"?(i.preventDefault(),t.activeIndex===s?Y(0,t):Y(t.activeIndex+1,t)):i.code==="Home"?(i.preventDefault(),Y(0,t)):i.code==="End"&&(i.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}function Un(){let e=ge(Z(),!0);e&&Us(e)}function Us(e){Ks(e),Ws(),Gs()}function Ws(){let e=document.getElementsByTagName("a");for(let t of e)t.getAttribute("target")!=="_blank"&&t.setAttribute("target","_parent")}function Gs(){window.scrollTo(0,0)}function Ks(e){document.body.classList.add("preview");let t=document.getElementById("content");t.innerHTML=e.innerHTML}yt(()=>{let e=new URLSearchParams(window.location.search),t=e.has("preview");Vt(e.get("theme")),xt(t),mn(),Dn(),zn(),$n(),qn(),jn(),t?Un():(sn(),It(),Qt(),tn(),yn(),On(),Ln(),$t(),un(),_n())});})(); -/*! 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 - *) -*/