From 4745a6eeb867e77e457ba43f02070640c45ddc64 Mon Sep 17 00:00:00 2001 From: James Harton Date: Wed, 22 Jan 2025 11:46:39 +1300 Subject: [PATCH 1/5] wip: First draft of latest/related typesense search function. --- assets/js/globals.js | 4 + assets/js/search-page.js | 72 ++++++++- formatters/html/dist/html-XTJIJCYG.js | 223 ++++++++++++++++++++++++++ 3 files changed, 291 insertions(+), 8 deletions(-) create mode 100644 formatters/html/dist/html-XTJIJCYG.js diff --git a/assets/js/globals.js b/assets/js/globals.js index 179ac6ef4..7a12c3ab7 100644 --- a/assets/js/globals.js +++ b/assets/js/globals.js @@ -14,3 +14,7 @@ export function getSidebarNodes () { export function getVersionNodes () { return window.versionNodes || [] } + +export function getSearchNodes () { + return window.searchNodes || [] +} diff --git a/assets/js/search-page.js b/assets/js/search-page.js index 7f647b4bd..1ab40b3f5 100644 --- a/assets/js/search-page.js +++ b/assets/js/search-page.js @@ -4,6 +4,7 @@ import lunr from 'lunr' import { qs, escapeHtmlEntities, isBlank, getQueryParamByName, getProjectNameAndVersion } from './helpers' import { setSearchInputValue } from './search-bar' import searchResultsTemplate from './handlebars/templates/search-results.handlebars' +import { getSearchNodes } from './globals' const EXCERPT_RADIUS = 80 const SEARCH_CONTAINER_SELECTOR = '#search' @@ -26,23 +27,27 @@ function initialize () { const pathname = window.location.pathname if (pathname.endsWith('/search.html') || pathname.endsWith('/search')) { const query = getQueryParamByName('q') - search(query) + const queryType = getQueryParamByName('type') + search(query, queryType) } } -async function search (value) { +async function search (value, queryType) { if (isBlank(value)) { renderResults({ value }) } else { setSearchInputValue(value) - const index = await getIndex() - try { - // We cannot match on atoms :foo because that would be considered - // a filter. So we escape all colons not preceded by a word. - const fixedValue = value.replaceAll(/(\B|\\):/g, '\\:') - const results = searchResultsToDecoratedSearchItems(index.search(fixedValue)) + let results = [] + const searchNodes = getSearchNodes() + + if (['related', 'latest'].includes(queryType) && searchNodes.length > 0) { + results = await remoteSearch(value, queryType, searchNodes) + } else { + results = await localSearch(value) + } + renderResults({ value, results }) } catch (error) { renderResults({ value, errorMessage: error.message }) @@ -50,6 +55,57 @@ async function search (value) { } } +async function localSearch (value) { + const index = await getIndex() + + // We cannot match on atoms :foo because that would be considered + // a filter. So we escape all colons not preceded by a word. + const fixedValue = value.replaceAll(/(\B|\\):/g, '\\:') + return searchResultsToDecoratedSearchItems(index.search(fixedValue)) +} + +async function remoteSearch (value, queryType, searchNodes) { + let filterNodes = searchNodes + + if (queryType === 'latest') { + filterNodes = searchNodes.slice(0, 1) + } + + const filters = filterNodes.map(node => `package:=${node.name}-${node.version}`).join(' || ') + + const params = new URLSearchParams() + params.set('q', value) + params.set('query_by', 'title,doc') + params.set('filter_by', filters) + + const response = await fetch(`https://search.hexdocs.pm/?${params.toString()}`) + const payload = await response.json() + + if (Array.isArray(payload.hits)) { + return payload.hits.map(result => { + const [packageName, packageVersion] = result.document.package.split('-') + + const doc = result.document.doc + const excerpts = [doc] + const metadata = {} + const ref = `https://hexdocs.pm/${packageName}/${packageVersion}/${result.document.ref}` + const title = result.document.title + const type = result.document.type + + return { + doc, + excerpts, + metadata, + ref, + title, + type + } + }) + } else { + return [] + } +} + function renderResults ({ value, results, errorMessage }) { const searchContainer = qs(SEARCH_CONTAINER_SELECTOR) const resultsHtml = searchResultsTemplate({ value, results, errorMessage }) diff --git a/formatters/html/dist/html-XTJIJCYG.js b/formatters/html/dist/html-XTJIJCYG.js new file mode 100644 index 000000000..15021520e --- /dev/null +++ b/formatters/html/dist/html-XTJIJCYG.js @@ -0,0 +1,223 @@ +(()=>{var Ns=Object.create;var Wn=Object.defineProperty;var Ds=Object.getOwnPropertyDescriptor;var Bs=Object.getOwnPropertyNames;var Qs=Object.getPrototypeOf,qs=Object.prototype.hasOwnProperty;var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fs=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Bs(e))!qs.call(t,i)&&i!==n&&Wn(t,i,{get:()=>e[i],enumerable:!(r=Ds(e,i))||r.enumerable});return t};var Y=(t,e,n)=>(n=t!=null?Ns(Qs(t)):{},Fs(e||!t||!t.__esModule?Wn(n,"default",{value:t,enumerable:!0}):n,t));var vr=_((lc,gr)=>{var mr="Expected a function",fr=NaN,Ws="[object Symbol]",zs=/^\s+|\s+$/g,Gs=/^[-+]0x[0-9a-f]+$/i,Ks=/^0b[01]+$/i,Ys=/^0o[0-7]+$/i,Js=parseInt,Xs=typeof global=="object"&&global&&global.Object===Object&&global,Zs=typeof self=="object"&&self&&self.Object===Object&&self,eo=Xs||Zs||Function("return this")(),to=Object.prototype,no=to.toString,ro=Math.max,io=Math.min,Dt=function(){return eo.Date.now()};function so(t,e,n){var r,i,s,o,a,l,u=0,c=!1,d=!1,h=!0;if(typeof t!="function")throw new TypeError(mr);e=pr(e)||0,Fe(n)&&(c=!!n.leading,d="maxWait"in n,s=d?ro(pr(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function f(S){var R=r,U=i;return r=i=void 0,u=S,o=t.apply(U,R),o}function m(S){return u=S,a=setTimeout(w,e),c?f(S):o}function g(S){var R=S-l,U=S-u,ee=e-R;return d?io(ee,s-U):ee}function v(S){var R=S-l,U=S-u;return l===void 0||R>=e||R<0||d&&U>=s}function w(){var S=Dt();if(v(S))return x(S);a=setTimeout(w,g(S))}function x(S){return a=void 0,h&&r?f(S):(r=i=void 0,o)}function I(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function q(){return a===void 0?o:x(Dt())}function $(){var S=Dt(),R=v(S);if(r=arguments,i=this,l=S,R){if(a===void 0)return m(l);if(d)return a=setTimeout(w,e),f(l)}return a===void 0&&(a=setTimeout(w,e)),o}return $.cancel=I,$.flush=q,$}function oo(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(mr);return Fe(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),so(t,e,{leading:r,maxWait:e,trailing:i})}function Fe(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function ao(t){return!!t&&typeof t=="object"}function lo(t){return typeof t=="symbol"||ao(t)&&no.call(t)==Ws}function pr(t){if(typeof t=="number")return t;if(lo(t))return fr;if(Fe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Fe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(zs,"");var n=Ks.test(t);return n||Ys.test(t)?Js(t.slice(2),n?2:8):Gs.test(t)?fr:+t}gr.exports=oo});var F=_(D=>{"use strict";D.__esModule=!0;D.extend=Cr;D.indexOf=Eo;D.escapeExpression=xo;D.isEmpty=ko;D.createFrame=So;D.blockParams=_o;D.appendContextPath=Lo;var vo={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},yo=/[&<>"'`=]/g,wo=/[&<>"'`=]/;function bo(t){return vo[t]}function Cr(t){for(var e=1;e{"use strict";je.__esModule=!0;var Wt=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function zt(t,e){var n=e&&e.loc,r=void 0,i=void 0,s=void 0,o=void 0;n&&(r=n.start.line,i=n.end.line,s=n.start.column,o=n.end.column,t+=" - "+r+":"+s);for(var a=Error.prototype.constructor.call(this,t),l=0;l{"use strict";We.__esModule=!0;var Gt=F();We.default=function(t){t.registerHelper("blockHelperMissing",function(e,n){var r=n.inverse,i=n.fn;if(e===!0)return i(this);if(e===!1||e==null)return r(this);if(Gt.isArray(e))return e.length>0?(n.ids&&(n.ids=[n.name]),t.helpers.each(e,n)):r(this);if(n.data&&n.ids){var s=Gt.createFrame(n.data);s.contextPath=Gt.appendContextPath(n.data.contextPath,n.name),n={data:s}}return i(e,n)})};Hr.exports=We.default});var Br=_((ze,Dr)=>{"use strict";ze.__esModule=!0;function To(t){return t&&t.__esModule?t:{default:t}}var we=F(),Po=X(),Oo=To(Po);ze.default=function(t){t.registerHelper("each",function(e,n){if(!n)throw new Oo.default("Must pass iterator to #each");var r=n.fn,i=n.inverse,s=0,o="",a=void 0,l=void 0;n.data&&n.ids&&(l=we.appendContextPath(n.data.contextPath,n.ids[0])+"."),we.isFunction(e)&&(e=e.call(this)),n.data&&(a=we.createFrame(n.data));function u(m,g,v){a&&(a.key=m,a.index=g,a.first=g===0,a.last=!!v,l&&(a.contextPath=l+m)),o=o+r(e[m],{data:a,blockParams:we.blockParams([e[m],m],[l+m,null])})}if(e&&typeof e=="object")if(we.isArray(e))for(var c=e.length;s{"use strict";Ge.__esModule=!0;function Io(t){return t&&t.__esModule?t:{default:t}}var Ao=X(),Co=Io(Ao);Ge.default=function(t){t.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new Co.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};Qr.exports=Ge.default});var Ur=_((Ke,$r)=>{"use strict";Ke.__esModule=!0;function Ro(t){return t&&t.__esModule?t:{default:t}}var Fr=F(),Mo=X(),Vr=Ro(Mo);Ke.default=function(t){t.registerHelper("if",function(e,n){if(arguments.length!=2)throw new Vr.default("#if requires exactly one argument");return Fr.isFunction(e)&&(e=e.call(this)),!n.hash.includeZero&&!e||Fr.isEmpty(e)?n.inverse(this):n.fn(this)}),t.registerHelper("unless",function(e,n){if(arguments.length!=2)throw new Vr.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:n.inverse,inverse:n.fn,hash:n.hash})})};$r.exports=Ke.default});var Wr=_((Ye,jr)=>{"use strict";Ye.__esModule=!0;Ye.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],n=arguments[arguments.length-1],r=0;r{"use strict";Je.__esModule=!0;Je.default=function(t){t.registerHelper("lookup",function(e,n,r){return e&&r.lookupProperty(e,n)})};zr.exports=Je.default});var Yr=_((Xe,Kr)=>{"use strict";Xe.__esModule=!0;function Ho(t){return t&&t.__esModule?t:{default:t}}var be=F(),No=X(),Do=Ho(No);Xe.default=function(t){t.registerHelper("with",function(e,n){if(arguments.length!=2)throw new Do.default("#with requires exactly one argument");be.isFunction(e)&&(e=e.call(this));var r=n.fn;if(be.isEmpty(e))return n.inverse(this);var i=n.data;return n.data&&n.ids&&(i=be.createFrame(n.data),i.contextPath=be.appendContextPath(n.data.contextPath,n.ids[0])),r(e,{data:i,blockParams:be.blockParams([e],[i&&i.contextPath])})})};Kr.exports=Xe.default});var Kt=_(Ze=>{"use strict";Ze.__esModule=!0;Ze.registerDefaultHelpers=Xo;Ze.moveHelperToHooks=Zo;function se(t){return t&&t.__esModule?t:{default:t}}var Bo=Nr(),Qo=se(Bo),qo=Br(),Fo=se(qo),Vo=qr(),$o=se(Vo),Uo=Ur(),jo=se(Uo),Wo=Wr(),zo=se(Wo),Go=Gr(),Ko=se(Go),Yo=Yr(),Jo=se(Yo);function Xo(t){Qo.default(t),Fo.default(t),$o.default(t),jo.default(t),zo.default(t),Ko.default(t),Jo.default(t)}function Zo(t,e,n){t.helpers[e]&&(t.hooks[e]=t.helpers[e],n||delete t.helpers[e])}});var Xr=_((et,Jr)=>{"use strict";et.__esModule=!0;var ea=F();et.default=function(t){t.registerDecorator("inline",function(e,n,r,i){var s=e;return n.partials||(n.partials={},s=function(o,a){var l=r.partials;r.partials=ea.extend({},l,n.partials);var u=e(o,a);return r.partials=l,u}),n.partials[i.args[0]]=i.fn,s})};Jr.exports=et.default});var Zr=_(Yt=>{"use strict";Yt.__esModule=!0;Yt.registerDefaultDecorators=ia;function ta(t){return t&&t.__esModule?t:{default:t}}var na=Xr(),ra=ta(na);function ia(t){ra.default(t)}});var Jt=_((tt,ei)=>{"use strict";tt.__esModule=!0;var sa=F(),fe={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var n=sa.indexOf(fe.methodMap,e.toLowerCase());n>=0?e=n:e=parseInt(e,10)}return e},log:function(e){if(e=fe.lookupLevel(e),typeof console<"u"&&fe.lookupLevel(fe.level)<=e){var n=fe.methodMap[e];console[n]||(n="log");for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s{"use strict";Xt.__esModule=!0;Xt.createNewLookupObject=aa;var oa=F();function aa(){for(var t=arguments.length,e=Array(t),n=0;n{"use strict";Ee.__esModule=!0;Ee.createProtoAccessControl=da;Ee.resultIsAllowed=ha;Ee.resetLoggedProperties=pa;function la(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var ni=ti(),ua=Jt(),ca=la(ua),nt=Object.create(null);function da(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var n=Object.create(null);return n.__proto__=!1,{properties:{whitelist:ni.createNewLookupObject(n,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:ni.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}}function ha(t,e,n){return ri(typeof t=="function"?e.methods:e.properties,n)}function ri(t,e){return t.whitelist[e]!==void 0?t.whitelist[e]===!0:t.defaultValue!==void 0?t.defaultValue:(fa(e),!1)}function fa(t){nt[t]!==!0&&(nt[t]=!0,ca.log("error",'Handlebars: Access has been denied to resolve the property "'+t+`" because it is not an "own property" of its parent. +You can add a runtime option to disable the check or this warning: +See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function pa(){Object.keys(nt).forEach(function(t){delete nt[t]})}});var rn=_(j=>{"use strict";j.__esModule=!0;j.HandlebarsEnvironment=nn;function ii(t){return t&&t.__esModule?t:{default:t}}var oe=F(),ma=X(),en=ii(ma),ga=Kt(),va=Zr(),ya=Jt(),rt=ii(ya),wa=Zt(),ba="4.7.7";j.VERSION=ba;var Ea=8;j.COMPILER_REVISION=Ea;var xa=7;j.LAST_COMPATIBLE_COMPILER_REVISION=xa;var ka={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};j.REVISION_CHANGES=ka;var tn="[object Object]";function nn(t,e,n){this.helpers=t||{},this.partials=e||{},this.decorators=n||{},ga.registerDefaultHelpers(this),va.registerDefaultDecorators(this)}nn.prototype={constructor:nn,logger:rt.default,log:rt.default.log,registerHelper:function(e,n){if(oe.toString.call(e)===tn){if(n)throw new en.default("Arg not supported with multiple helpers");oe.extend(this.helpers,e)}else this.helpers[e]=n},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,n){if(oe.toString.call(e)===tn)oe.extend(this.partials,e);else{if(typeof n>"u")throw new en.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=n}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,n){if(oe.toString.call(e)===tn){if(n)throw new en.default("Arg not supported with multiple decorators");oe.extend(this.decorators,e)}else this.decorators[e]=n},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){wa.resetLoggedProperties()}};var Sa=rt.default.log;j.log=Sa;j.createFrame=oe.createFrame;j.logger=rt.default});var oi=_((it,si)=>{"use strict";it.__esModule=!0;function sn(t){this.string=t}sn.prototype.toString=sn.prototype.toHTML=function(){return""+this.string};it.default=sn;si.exports=it.default});var ai=_(on=>{"use strict";on.__esModule=!0;on.wrapHelper=_a;function _a(t,e){if(typeof t!="function")return t;var n=function(){var i=arguments[arguments.length-1];return arguments[arguments.length-1]=e(i),t.apply(this,arguments)};return n}});var hi=_(Z=>{"use strict";Z.__esModule=!0;Z.checkRevision=Aa;Z.template=Ca;Z.wrapProgram=st;Z.resolvePartial=Ra;Z.invokePartial=Ma;Z.noop=ci;function La(t){return t&&t.__esModule?t:{default:t}}function Ta(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var Pa=F(),z=Ta(Pa),Oa=X(),G=La(Oa),K=rn(),li=Kt(),Ia=ai(),ui=Zt();function Aa(t){var e=t&&t[0]||1,n=K.COMPILER_REVISION;if(!(e>=K.LAST_COMPATIBLE_COMPILER_REVISION&&e<=K.COMPILER_REVISION))if(e{"use strict";ot.__esModule=!0;ot.default=function(t){var e=typeof global<"u"?global:window,n=e.Handlebars;t.noConflict=function(){return e.Handlebars===t&&(e.Handlebars=n),t}};fi.exports=ot.default});var ae=_((at,yi)=>{"use strict";at.__esModule=!0;function ln(t){return t&&t.__esModule?t:{default:t}}function un(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var Ba=rn(),mi=un(Ba),Qa=oi(),qa=ln(Qa),Fa=X(),Va=ln(Fa),$a=F(),an=un($a),Ua=hi(),gi=un(Ua),ja=pi(),Wa=ln(ja);function vi(){var t=new mi.HandlebarsEnvironment;return an.extend(t,mi),t.SafeString=qa.default,t.Exception=Va.default,t.Utils=an,t.escapeExpression=an.escapeExpression,t.VM=gi,t.template=function(e){return gi.template(e,t)},t}var xe=vi();xe.create=vi;Wa.default(xe);xe.default=xe;at.default=xe;yi.exports=at.default});var Zi=_((Ji,Xi)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var c=t.utils.clone(n)||{};c.position=[a,u],c.index=s.length,s.push(new t.Token(r.slice(a,o),c))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?c+=2:a==l&&(n+=r[u+1]*i[c+1],u+=2,c+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=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 t.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 t.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 t.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 c=s.str.charAt(0),d=s.str.charAt(1),h;d in s.node.edges?h=s.node.edges[d]:(h=new t.TokenSet,s.node.edges[d]=h),s.str.length==1&&(h.final=!0),i.push({node:h,editsRemaining:s.editsRemaining-1,str:c+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;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()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.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=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.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 t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof Ji=="object"?Xi.exports=n():e.lunr=n()}(this,function(){return t})})()});var zn=new URLSearchParams(window.location.search),A=window.self!==window.parent,Gn=zn.has("preview"),Kn=zn.has("hint");function Ae(){return window.sidebarNodes||{}}function Yn(){return window.versionNodes||[]}function Jn(){return window.searchNodes||[]}var p=document.querySelector.bind(document),M=document.querySelectorAll.bind(document);function Xn(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Re(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function Me(){return document.getElementById("main").dataset.type}var Ce=["H1","H2","H3","H4","H5","H6"];function He(t=!1){let e=window.location.hash.replace(/^#/,"");if(!e)return t?document.getElementById("top-content"):null;let n=document.getElementById(e);if(!n)return null;if(n.matches(".detail"))return n;if(Ce.includes(n.tagName))return Pt(n);let r=Vs(n);return r||document.getElementById("top-content")}function Vs(t){let e=t.previousElementSibling;for(;e;){if(Ce.includes(e.tagName))return Pt(e);e=e.previousElementSibling}let n=t.parentNode;for(;n;){for(e=n.previousElementSibling;e;){if(Ce.includes(e.tagName))return Pt(e);e=e.previousElementSibling}n=n.parentNode}return null}function Pt(t){let e=document.createElement("div"),n=[t],r=t;for(;(r=r.nextSibling)&&!(Ce.includes(r.tagName)&&r.tagName<=t.tagName);)n.push(r);return e.append(...n),e}function Ot(t){return new URLSearchParams(window.location.search).get(t)}function It(t){return fetch(t).then(e=>e.ok).catch(()=>!1)}function he(t){return!t||t.trim()===""}function Zn(t,e){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{n=null,t(...i)},e)}}function Ne(){return document.head.querySelector("meta[name=project][content]").content}function De(){return document.documentElement.classList.contains("apple-os")}function E(t,e,n){let r=document.createElement(t);for(let i in e)e[i]!=null&&r.setAttribute(i,e[i]);return n&&r.replaceChildren(...n),r}if(Gn&&A){let t=He(!0);if(t){document.body.classList.add("preview"),document.getElementById("content").replaceChildren(...t.childNodes);let e=document.getElementsByTagName("a:not([target=_blank]");for(let n of e)n.setAttribute("target","_parent");window.scrollTo(0,0),document.body.style.position="fixed",setTimeout(er),window.addEventListener("resize",er)}}function er(){let t={type:"preview",contentHeight:document.getElementById("content").parentElement.offsetHeight};window.parent.postMessage(t,"*")}var ie={plain:"plain",function:"function",module:"module"},$s=[{href:"typespecs.html#basic-types",hint:{kind:ie.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:ie.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:ie.plain,description:"Built-in type"}}],Be={cancelHintFetching:null};function tr(t){if(rr(t))return!0;let e=/#.*\//;return t.includes("#")&&!e.test(t)?!1:t.includes(".html")}function nr(t){let e=rr(t);return e?Promise.resolve(e):Us(t)}function rr(t){let e=$s.find(n=>t.includes(n.href));return e?e.hint:null}function Us(t){let e=t.replace(".html",".html?hint=true");return new Promise((n,r)=>{let i=document.createElement("iframe");i.setAttribute("src",e),i.style.display="none";function s(a){let{href:l,hint:u}=a.data;e===l&&(o(),n(u))}Be.cancelHintFetching=()=>{o(),r(new Error("cancelled"))};function o(){i.remove(),window.removeEventListener("message",s),Be.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(i)})}function ir(){Be.cancelHintFetching&&Be.cancelHintFetching()}function sr(t){let n=t.querySelector("h1").textContent,r=t.querySelector(".docstring > p"),i=r?r.innerHTML:"";return{kind:ie.function,title:n.trim(),description:i.trim()}}function or(t){let n=t.querySelector("h1 > span").textContent,r=t.querySelector("#moduledoc p"),i=r?r.innerHTML:"";return{kind:ie.module,title:n.trim(),description:i.trim()}}if(Kn&&A){let t=He(),e=t?sr(t):["modules","tasks"].includes(Me())?or(p(".content-inner")):null;if(e){let n={hint:{...e,version:Ne()},href:window.location.href};window.parent.postMessage(n,"*")}p(".content-inner")?.replaceChildren()}var At="ex_doc:settings",ar="dark",Ct="system",Rt="dark",Mt="light";var js={tooltips:!0,theme:null,livebookUrl:null},Ht=class{constructor(){this._subscribers=[],this._settings=js,this._loadSettings()}get(){return this._settings}update(e){let n=this._settings;this._settings={...this._settings,...e},this._subscribers.forEach(r=>r(this._settings,n)),this._storeSettings()}getAndSubscribe(e){this._subscribers.push(e),e(this._settings)}_loadSettings(){try{let e=localStorage.getItem(At);if(e){let n=JSON.parse(e);this._settings={...this._settings,...n}}this._loadSettingsLegacy()}catch(e){console.error(`Failed to load settings: ${e}`)}}_storeSettings(){try{this._storeSettingsLegacy(),localStorage.setItem(At,JSON.stringify(this._settings))}catch(e){console.error(`Failed to persist settings: ${e}`)}}_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"))}},H=new Ht;var lr=!1,Qe=null,J=null;function ur(t){lr||(lr=!0,J=document.getElementById("toast"),J?.addEventListener("click",()=>{clearTimeout(Qe),J.classList.remove("show")})),J&&(clearTimeout(Qe),J.innerText=t,J.classList.add("show"),Qe=setTimeout(()=>{J.classList.remove("show"),Qe=setTimeout(function(){J.innerText=""},1e3)},5e3))}var Nt=[Ct,Rt,Mt],cr=window.matchMedia("(prefers-color-scheme: dark)");H.getAndSubscribe(dr);cr.addEventListener("change",dr);function dr(){let t=qe(),e=t===Rt||t!==Mt&&cr.matches;document.body.classList.toggle(ar,e)}function hr(){let t=Nt[Nt.indexOf(qe())+1]||Nt[0];H.update({theme:t}),ur(`Set theme to "${t}"`)}function qe(){return new URLSearchParams(window.location.search).get("theme")||H.get().theme||Ct}var Sr=Y(vr());var Bt="sidebar_state",Qt="closed",yr="open",wr="sidebar_width";var Ve="sidebar-open",$e="sidebar-transition";var br=!1;function Er(){if(br)return;br=!0;let t=document.getElementById("sidebar-list-nav");if(!t)return;let e=Me(),n={extras:t.dataset.extras||"Pages",modules:"Modules",tasks:'Mix Tasks'};Object.entries(n).forEach(([r,i])=>{let s=Ae()[r];if(!s?.length)return;let o=`${r}-list-tab-button`,a=`${r}-tab-panel`,l=r===e,u=E("button",{id:o,role:"tab",tabindex:l?0:-1,"aria-selected":l||void 0,"aria-controls":a});u.innerHTML=i,u.addEventListener("keydown",ho),u.addEventListener("click",fo),t.appendChild(E("li",{},[u]));let c=E("ul",{class:"full-list"});c.addEventListener("click",po);let d=E("div",{id:a,class:"sidebar-tabpanel",role:"tabpanel","aria-labelledby":o,hidden:l?void 0:""},[c]);document.getElementById("sidebar").appendChild(d);let h="",f,m;c.replaceChildren(...s.flatMap(g=>{let v=[],w=Array.isArray(g.headers),x=w?void 0:"no";return g.group!==h&&(v.push(E("li",{class:"group",translate:x},[g.group])),h=g.group,f=void 0),g.nested_context&&g.nested_context!==f?(f=g.nested_context,m!==f&&v.push(E("li",{class:"nesting-context",translate:"no","aria-hidden":!0},[f]))):m=g.title,v.push(E("li",{},[E("a",{href:`${g.id}.html`,translate:x},[g.nested_title||g.title]),...Ft(`node-${g.id}-headers`,w?uo(g):co(g))])),v}))}),window.addEventListener("hashchange",qt),window.addEventListener("swup:page:view",qt),qt(),requestAnimationFrame(xr)}function Ft(t,e){return e.length?[E("button",{"aria-label":"expand","aria-expanded":!1,"aria-controls":t}),E("ul",{id:t},e)]:[]}function uo(t){return t.headers.map(({id:e,anchor:n})=>E("li",{},[E("a",{href:`${t.id}.html#${n}`},[e])]))}function co(t){let e=[];return t.sections?.length&&e.push(E("li",{},[E("a",{href:`${t.id}.html#content`},["Sections"]),...Ft(`${t.id}-sections-list`,t.sections.map(({id:n,anchor:r})=>E("li",{},[E("a",{href:`${t.id}.html#${r}`},[n])])))])),t.nodeGroups&&(e.push(E("li",{},[E("a",{href:`${t.id}.html#summary`},["Summary"])])),e.push(...t.nodeGroups.map(({key:n,name:r,nodes:i})=>E("li",{},[E("a",{href:`${t.id}.html#${n}`},[r]),...Ft(`node-${t.id}-group-${n}-list`,i.map(({anchor:s,title:o,id:a})=>E("li",{},[E("a",{href:`${t.id}.html#${s}`,title:o,translate:"no"},[a])])))])))),e}function Vt(t){let e=document.getElementById("sidebar-list-nav").querySelector("[aria-selected]");e!==t&&(e&&(e.removeAttribute("aria-selected"),e.setAttribute("tabindex","-1"),document.getElementById(e.getAttribute("aria-controls")).setAttribute("hidden","hidden")),t.setAttribute("aria-selected","true"),t.setAttribute("tabindex","0"),document.getElementById(t.getAttribute("aria-controls")).removeAttribute("hidden"))}function xr(){p("#sidebar [role=tabpanel]:not([hidden]) a[aria-selected]")?.scrollIntoView()}function qt(){let t=document.getElementById("sidebar"),{pathname:e,hash:n}=window.location,r=e.split("/").pop().replace(/\.html$/,"")+".html",i=t.querySelector(`li a[href="${r+n}"]`)||t.querySelector(`li a[href="${r}"]`);if(!i)return;t.querySelectorAll(".full-list a[aria-selected]").forEach(o=>{o.removeAttribute("aria-selected")}),t.querySelectorAll(".full-list button[aria-expanded=true]").forEach(o=>{o.setAttribute("aria-expanded",!1)});let s=i.parentElement;for(;s;){if(s.tagName==="LI"){let o=s.firstChild;o.setAttribute("aria-selected",o.getAttribute("href")===r?"page":"true");let a=o.nextSibling;a?.tagName==="BUTTON"&&a.setAttribute("aria-expanded",!0)}else if(s.role==="tabpanel"){s.hasAttribute("hidden")&&Vt(document.getElementById(s.getAttribute("aria-labelledby")));break}s=s.parentElement}}function ho(t){if(!["ArrowRight","ArrowLeft"].includes(t.key))return;let e=Array.from(M('#sidebar-list-nav [role="tab"]')),r=e.indexOf(t.currentTarget)+(t.key==="ArrowRight"?1:-1),i=e.at(r%e.length);Vt(i),i.focus()}function fo(t){Vt(t.currentTarget),xr()}function po(t){let e=t.target;e.tagName==="BUTTON"&&e.setAttribute("aria-expanded",e.getAttribute("aria-expanded")==="false")}var go=300,_r=".sidebar-toggle",Lr=window.matchMedia(`screen and (max-width: ${768}px)`);if(!A){$t(),window.addEventListener("swup:page:view",$t);let t=document.getElementById("sidebar"),e=p(_r);e.addEventListener("click",Ue),document.body.addEventListener("click",i=>{Lr.matches&&Tr()&&!t.contains(i.target)&&!e.contains(i.target)&&Ue()});let n=window.innerWidth;window.addEventListener("resize",(0,Sr.default)(()=>{n!==window.innerWidth&&(n=window.innerWidth,$t())},100));let r=new ResizeObserver(([i])=>{if(!i)return;let s=i.contentRect.width;sessionStorage.setItem(wr,s),document.body.style.setProperty("--sidebarWidth",`${s}px`)});t.addEventListener("mousedown",()=>r.observe(t)),t.addEventListener("mouseup",()=>r.unobserve(t))}function $t(){let e=sessionStorage.getItem(Bt)!==Qt&&!Lr.matches;Or(e)}function Ue(){let t=!Tr();return sessionStorage.setItem(Bt,t?yr:Qt),Ir(t)}function Tr(){return document.body.classList.contains(Ve)}function Pr(){return document.body.classList.contains(Ve)&&!document.body.classList.contains($e)}function Or(t){t&&Er(),document.body.classList.toggle(Ve,t),p(_r).setAttribute("aria-expanded",t?"true":"false")}var kr;function Ir(t){return new Promise(e=>{document.body.classList.add($e),document.body.scrollTop,Or(t),clearTimeout(kr),kr=setTimeout(()=>{document.body.classList.remove($e),e()},go)})}function Ar(){return Ir(!0)}var wi=Y(ae());var cn=Y(ae());cn.registerHelper("isArray",function(t,e){return Array.isArray(t)?e.fn(this):e.inverse(this)});cn.registerHelper("isNonEmptyArray",function(t,e){return Array.isArray(t)&&t.length>0?e.fn(this):e.inverse(this)});var bi=wi.template({1:function(t,e,n,r,i){var s,o,a=e??(t.nullContext||{}),l=t.hooks.helperMissing,u="function",c=t.escapeExpression,d=t.lookupProperty||function(h,f){if(Object.prototype.hasOwnProperty.call(h,f))return h[f]};return' +`},2:function(t,e,n,r,i){return" selected disabled"},4:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return` +`},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o=e??(t.nullContext||{}),a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return`
+ +`+((s=a(n,"if").call(o,e!=null?a(e,"latestVersion"):e,{name:"if",hash:{},fn:t.program(4,i,0),inverse:t.noop,data:i,loc:{start:{line:13,column:2},end:{line:20,column:9}}}))!=null?s:"")+`
+`},useData:!0});var za=".sidebar-projectVersion",Ei=".sidebar-projectVersionsDropdown";if(!A){let t=Yn(),e=p(za);if(t.length>0||!e){let n=e.textContent.trim(),i=(t.some(u=>u.version===n)?t:[{version:n,url:"#"},...t]).map(u=>({...u,isCurrentVersion:u.version===n})),s=t.find(u=>u.latest),o=s?.version!==n?s?.url:null;e.innerHTML=bi({nodes:i,latestVersion:o});let a=p(Ei);a.addEventListener("change",Ka),Ga(a);let l=p(".sidebar-staleVersion a");l&&l.addEventListener("click",Ya)}}function Ga(t){let e=document.createElement("span");e.style.visibility="hidden",e.style.position="absolute",e.style.whiteSpace="nowrap",e.style.font=window.getComputedStyle(t).font,e.textContent=t.options[t.selectedIndex].text,document.body.appendChild(e),t.style.width=`${e.offsetWidth+20}px`,document.body.removeChild(e)}function Ka(t){let e=t.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,r=`${e}/${n}`;It(r).then(i=>{i?window.location.href=r:window.location.href=e})}function Ya(t){let e=this.href,n=window.location.pathname.split("/").pop()+window.location.hash,r=`${e}/${n}`;t.preventDefault(),It(r).then(i=>{i?window.location.href=r:window.location.href=e})}function dn(){let t=p(Ei);t&&(t.focus(),t.addEventListener("keydown",e=>{(e.key==="Escape"||e.key==="v")&&(e.preventDefault(),t.blur())}),navigator.userActivation.isActive&&"showPicker"in HTMLSelectElement.prototype&&t.showPicker())}var Ja="content",Xa="tabs-open",Za="tabs-close",el="H3",tl="tabset";window.addEventListener("swup:page:view",ki);ki();function ki(){let t=[],e=[],n=document.createNodeIterator(document.getElementById(Ja),NodeFilter.SHOW_COMMENT,i=>i.nodeValue.trim()===Xa?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT),r;for(;r=n.nextNode();){let i=[];t.push([r,i]);let s,o=r;for(;o=o.nextSibling;)if(o.nodeName===el){s=[];let a=o.querySelector(".text")?.childNodes||o.childNodes;i.push([a,s]),e.push(o)}else if(o.nodeName==="#comment"&&o.nodeValue.trim()===Za){e.push(o);break}else s&&s.push(o)}t.forEach(([i,s],o)=>{let a=E("div",{class:tl});i.parentNode.replaceChild(a,i);let l=E("div",{role:"tablist",class:"tabset-tablist"});a.appendChild(l),s.forEach(([u,c],d)=>{let h=d===0,f=`tab-${o}-${d}`,m=`tabpanel-${o}-${d}`,g=E("button",{role:"tab",id:f,class:"tabset-tab",tabindex:h?0:-1,"aria-selected":h,"aria-controls":m},u);g.addEventListener("click",nl),g.addEventListener("keydown",rl),l.appendChild(g);let v=E("div",{role:"tabpanel",id:m,class:"tabset-panel",hidden:h?void 0:"",tabindex:h?0:-1,"aria-labelledby":f},c);a.appendChild(v)})}),e.forEach(i=>{i.parentNode.removeChild(i)})}function nl(t){Si(t.currentTarget)}function rl(t){if(xi[t.code]){t.preventDefault();let e=[...t.currentTarget.parentNode.childNodes],n=e.indexOf(t.currentTarget),r=xi[t.code](n,e.length);Si(e.at(r%e.length))}}var xi={ArrowLeft:t=>t-1,ArrowRight:t=>t+1,Home:()=>0,End:(t,e)=>e-1};function Si(t){let e=t.parentNode.querySelector("[aria-selected=true]");if(e===t)return;e.setAttribute("aria-selected","false"),e.tabIndex=-1,t.setAttribute("aria-selected","true"),t.tabIndex=0,t.focus();let n=document.getElementById(e.getAttribute("aria-controls"));n.setAttribute("hidden",""),n.tabIndex=-1;let r=document.getElementById(t.getAttribute("aria-controls"));r.removeAttribute("hidden"),r.tabIndex=0}window.addEventListener("swup:page:view",_i);_i();function _i(){let t=window.location.pathname.replace(/(\.html)?$/,".livemd"),e=encodeURIComponent(new URL(t,window.location.href).toString());H.getAndSubscribe(({livebookUrl:n})=>{let r=n?`${n}/import?url=${e}`:`https://livebook.dev/run?url=${e}`;for(let i of M(".livebook-badge"))i.href=r})}var il="hll";window.addEventListener("swup:page:view",Ti);Ti();function Ti(){M("[data-group-id]").forEach(t=>{t.addEventListener("mouseenter",Li),t.addEventListener("mouseleave",Li)})}function Li(t){let e=t.currentTarget,n=t.type==="mouseenter",r=e.getAttribute("data-group-id");e.parentElement.querySelectorAll(`[data-group-id="${r}"]`).forEach(i=>{i.classList.toggle(il,n)})}var W={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function Oi(t,e=8){if(he(t))return[];let n=Ae(),r=[...hn(n.modules,t,W.module,"module"),...sl(n.modules,t,W.moduleChild),...hn(n.tasks,t,W.mixTask,"mix task"),...hn(n.extras,t,W.extra,"page"),...fn(n.modules,t,W.section,"module"),...fn(n.tasks,t,W.section,"mix task"),...fn(n.extras,t,W.section,"page")].filter(i=>i!==null);return hl(r).slice(0,e)}function hn(t,e,n,r){return t.map(i=>i.searchData?null:al(i,e,n,r))}function sl(t,e,n){return t.filter(r=>r.nodeGroups).flatMap(r=>r.nodeGroups.flatMap(({key:i,nodes:s})=>{let o=dl(i);return s.map(a=>ll(a,r.id,e,n,o)||cl(a,r.id,e,n,o))}))}function fn(t,e,n,r){return t.flatMap(i=>ol(i).map(s=>ul(i,s,e,n,r)))}function ol(t){return t.searchData?t.searchData:(t.sections||[]).concat(t.headers||[])}function al(t,e,n,r){return ut(t.title,e)?{link:`${t.id}.html`,title:ht(t.title,e),description:null,matchQuality:ct(t.title,e),deprecated:t.deprecated,labels:[r],category:n}:null}function ll(t,e,n,r,i){return ut(t.id,n)?{link:`${e}.html#${t.anchor}`,title:ht(t.id,n),labels:[i],description:e,matchQuality:ct(t.id,n),deprecated:t.deprecated,category:r}:null}function ul(t,e,n,r,i){if(!Ii(e.id,n))return null;let s;return e.anchor===""?s=`${t.id}.html`:s=`${t.id}.html#${e.anchor}`,{link:s,title:ht(e.id,n),description:t.title,matchQuality:ct(e.id,n),labels:e.labels||[i,"section"],category:r}}function cl(t,e,n,r,i){let s=`${e}.${t.id}`,o=`${e}:${t.id}`,a,l;if(ut(s,n))a=s,l=/\./g;else if(ut(o,n))a=o,l=/:/g;else return null;let u=n.replace(l," ");return Ii(t.id,u)?{link:`${e}.html#${t.anchor}`,title:ht(t.id,u),label:i,description:e,matchQuality:ct(a,n),deprecated:t.deprecated,category:r}:null}function dl(t){switch(t){case"callbacks":return"callback";case"types":return"type";default:return"function"}}function hl(t){return t.slice().sort((e,n)=>e.matchQuality!==n.matchQuality?n.matchQuality-e.matchQuality:Pi(e.category)-Pi(n.category))}function Pi(t){switch(t){case W.module:return 1;case W.moduleChild:return 2;case W.mixTask:return 3;default:return 4}}function Ii(t,e){return dt(e).some(r=>Ai(t,r))}function ut(t,e){return dt(e).every(r=>Ai(t,r))}function Ai(t,e){return t.toLowerCase().includes(e.toLowerCase())}function ct(t,e){let n=dt(e),i=n.map(o=>o.length).reduce((o,a)=>o+a,0)/t.length,s=fl(t,n[0])?1:0;return i+s}function fl(t,e){return t.toLowerCase().startsWith(e.toLowerCase())}function dt(t){return t.trim().split(/\s+/)}function ht(t,e){let n=dt(e).sort((r,i)=>i.length-r.length);return lt(t,n)}function lt(t,e){if(e.length===0)return t;let[n,...r]=e,i=t.match(new RegExp(`(.*)(${Xn(n)})(.*)`,"i"));if(i){let[,s,o,a]=i;return lt(s,e)+""+Re(o)+""+lt(a,e)}else return lt(t,r)}var Ci=Y(ae());var Ri=Ci.template({1:function(t,e,n,r,i){var s,o,a=e??(t.nullContext||{}),l=t.hooks.helperMissing,u="function",c=t.escapeExpression,d=t.lookupProperty||function(h,f){if(Object.prototype.hasOwnProperty.call(h,f))return h[f]};return' +
+`+((s=d(n,"if").call(a,e!=null?d(e,"deprecated"):e,{name:"if",hash:{},fn:t.program(2,i,0),inverse:t.program(4,i,0),data:i,loc:{start:{line:16,column:10},end:{line:20,column:17}}}))!=null?s:"")+` +`+((s=d(n,"each").call(a,e!=null?d(e,"labels"):e,{name:"each",hash:{},fn:t.program(6,i,0),inverse:t.noop,data:i,loc:{start:{line:22,column:10},end:{line:24,column:19}}}))!=null?s:"")+`
+ +
+
+ +
+
+ +`+((s=d(n,"if").call(a,e!=null?d(e,"description"):e,{name:"if",hash:{},fn:t.program(8,i,0),inverse:t.noop,data:i,loc:{start:{line:39,column:8},end:{line:43,column:15}}}))!=null?s:"")+`
+`},2:function(t,e,n,r,i){var s,o,a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return' '+((s=(o=(o=a(n,"title")||(e!=null?a(e,"title"):e))!=null?o:t.hooks.helperMissing,typeof o=="function"?o.call(e??(t.nullContext||{}),{name:"title",hash:{},data:i,loc:{start:{line:17,column:49},end:{line:17,column:60}}}):o))!=null?s:"")+` +`},4:function(t,e,n,r,i){var s,o,a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return' '+((s=(o=(o=a(n,"title")||(e!=null?a(e,"title"):e))!=null?o:t.hooks.helperMissing,typeof o=="function"?o.call(e??(t.nullContext||{}),{name:"title",hash:{},data:i,loc:{start:{line:19,column:46},end:{line:19,column:57}}}):o))!=null?s:"")+` +`},6:function(t,e,n,r,i){return' '+t.escapeExpression(t.lambda(e,e))+` +`},8:function(t,e,n,r,i){var s,o,a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return`
+ `+((s=(o=(o=a(n,"description")||(e!=null?a(e,"description"):e))!=null?o:t.hooks.helperMissing,typeof o=="function"?o.call(e??(t.nullContext||{}),{name:"description",hash:{},data:i,loc:{start:{line:41,column:10},end:{line:41,column:27}}}):o))!=null?s:"")+` +
+`},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o,a=e??(t.nullContext||{}),l=t.lookupProperty||function(u,c){if(Object.prototype.hasOwnProperty.call(u,c))return u[c]};return`
+
+
+
+ + Autocompletion results for "`+t.escapeExpression((o=(o=l(n,"term")||(e!=null?l(e,"term"):e))!=null?o:t.hooks.helperMissing,typeof o=="function"?o.call(a,{name:"term",hash:{},data:i,loc:{start:{line:6,column:55},end:{line:6,column:63}}}):o))+`" + + + Press RETURN for full-text search, TAB for previews + +
+
+`+((s=l(n,"each").call(a,e!=null?l(e,"suggestions"):e,{name:"each",hash:{},fn:t.program(1,i,0),inverse:t.noop,data:i,loc:{start:{line:13,column:6},end:{line:45,column:15}}}))!=null?s:"")+`
+
+
+`},useData:!0});var pe=".autocomplete",pt=".autocomplete-suggestions",ft=".autocomplete-suggestion",C={autocompleteSuggestions:[],previewOpen:!1,selectedIdx:-1};function pl(){p(pe).classList.add("shown")}function pn(){p(pe).classList.remove("shown")}function Mi(){return p(pe).classList.contains("shown")}function mn(t){C.autocompleteSuggestions=Oi(t),C.selectedIdx=-1,he(t)?pn():(ml({term:t,suggestions:C.autocompleteSuggestions}),mt(0),pl())}function ml({term:t,suggestions:e}){let n=Ri({suggestions:e,term:t}),r=p(pe);r.innerHTML=n}function gn(){return C.selectedIdx===-1?null:C.autocompleteSuggestions[C.selectedIdx]}function mt(t){Ni(gl(t))}function Hi(t){if(t.data.type==="preview"){let{contentHeight:e}=t.data,n=p(".autocomplete-preview");n&&(n.style.height=`${e+32}px`,n.classList.remove("loading"))}}function Ni(t){C.selectedIdx=t;let e=p(pt),n=p(`${ft}.selected`),r=p(`${ft}[data-index="${C.selectedIdx}"]`);if(n&&n.classList.remove("selected"),r){if(C.previewOpen){Bi(),window.addEventListener("message",Hi),e.classList.add("previewing");let i=document.createElement("div");i.classList.add("autocomplete-preview"),i.classList.add("loading");let s=r.href.replace(".html",`.html?preview=true&theme=${qe()}`),o=document.createElement("iframe");o.setAttribute("src",s),i.appendChild(document.createElement("div")),i.appendChild(document.createElement("span")),i.appendChild(o),r.parentNode.insertBefore(i,r.nextSibling)}r.classList.add("selected"),r.scrollIntoView({block:"nearest"})}else e&&(e.scrollTop=0)}function Di(){C.previewOpen?gt():vn()}function gt(){C.previewOpen=!1;let t=p(pt);t&&t.classList.remove("previewing"),Bi()}function vn(t){C.previewOpen=!0,t?t=t.closest(ft):t=p(`${ft}[data-index="${C.selectedIdx}"]`),t&&Ni(parseInt(t.dataset.index))}function Bi(){let t=p(".autocomplete-preview");t&&(t.remove(),window.removeEventListener("message",Hi))}function gl(t){let e=C.autocompleteSuggestions.length+1;return(C.selectedIdx+t+1+e)%e-1}var ke="form.search-bar input",vl="form.search-bar .search-close-button";A||(window.addEventListener("swup:page:view",Qi),Qi());function Qi(){yl(),window.onTogglePreviewClick=function(t,e){t.preventDefault(),t.stopImmediatePropagation(),wn(),e?vn(t.target):gt()}}function Vi(t){let e=p(ke);e.value=t}function wn(){let t=p(ke);document.body.classList.add("search-focused"),t.focus()}function yl(){let t=p(ke);if(document.querySelector('meta[name="exdoc:autocomplete"][content="off"]'))return t.addEventListener("keydown",e=>{e.key==="Enter"&&qi(e)}),!0;t.addEventListener("keydown",e=>{let n=De();e.key==="Escape"?(vt(),t.blur()):e.key==="Enter"?qi(e):e.key==="ArrowUp"||n&&e.ctrlKey&&e.key==="p"?(mt(-1),e.preventDefault()):e.key==="ArrowDown"||n&&e.ctrlKey&&e.key==="n"?(mt(1),e.preventDefault()):e.key==="Tab"&&gn()!==null&&(Di(),e.preventDefault())}),t.addEventListener("input",e=>{mn(e.target.value)}),t.addEventListener("focus",e=>{document.body.classList.contains("search-focused")||(document.body.classList.add("search-focused"),mn(e.target.value))}),t.addEventListener("blur",e=>{let n=e.relatedTarget,r=p(pt);if(n&&r&&r.contains(n))return setTimeout(()=>{Mi()&&t.focus()},1e3),null;yt()}),p(pe).addEventListener("click",e=>{e.shiftKey||e.ctrlKey?t.focus():(vt(),yt())}),p(vl).addEventListener("click",e=>{vt(),yt()})}function qi(t){let e=p(ke),n=t.shiftKey||t.ctrlKey,r=gn();t.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(e.value)}`)}s.click(),n||(vt(),yt())}function vt(){let t=p(ke);t.value=""}function yt(){gt(),document.body.classList.remove("search-focused"),pn()}var yn,Fi=2;window.addEventListener("scroll",function(){let t=window.scrollY;if(yn!==void 0){let e=t-yn;t===0||e>Fi?document.body.classList.remove("scroll-sticky"):t>0&&-e>Fi&&document.body.classList.add("scroll-sticky")}yn=Math.max(0,t)},!1);var $i=Y(ae());var Ui=$i.template({1:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
+ `+t.escapeExpression(t.lambda((s=e!=null?o(e,"hint"):e)!=null?o(s,"description"):s,e))+` +
+`},3:function(t,e,n,r,i){var s,o=t.lambda,a=t.escapeExpression,l=t.lookupProperty||function(u,c){if(Object.prototype.hasOwnProperty.call(u,c))return u[c]};return`
+

+ `+a(o((s=e!=null?l(e,"hint"):e)!=null?l(s,"title"):s,e))+` +
`+a(o((s=e!=null?l(e,"hint"):e)!=null?l(s,"version"):s,e))+`
+

+
+`+((s=l(n,"if").call(e??(t.nullContext||{}),(s=e!=null?l(e,"hint"):e)!=null?l(s,"description"):s,{name:"if",hash:{},fn:t.program(4,i,0),inverse:t.noop,data:i,loc:{start:{line:12,column:2},end:{line:16,column:9}}}))!=null?s:"")},4:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
+ `+((s=t.lambda((s=e!=null?o(e,"hint"):e)!=null?o(s,"description"):s,e))!=null?s:"")+` +
+`},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"isPlain"):e,{name:"if",hash:{},fn:t.program(1,i,0),inverse:t.program(3,i,0),data:i,loc:{start:{line:1,column:0},end:{line:17,column:7}}}))!=null?s:""},useData:!0});var wl='
',bl=".content a:not([data-no-tooltip])",bn=".tooltip",ji=".tooltip .tooltip-body",Wi="body .content-inner",El="#content",zi="tooltip-shown",Se=10,xl=Se*4,kl=768,Sl=450,_l=100,le={currentLinkElement:null,hoverDelayTimeout:null};window.addEventListener("swup:page:view",Gi);Gi();function Gi(){M(bl).forEach(t=>{Ll(t)&&(t.addEventListener("mouseenter",Pl),t.addEventListener("mouseleave",Il))})}function Ll(t){return!(Tl(t.href)||!tr(t.href))}function Tl(t){let e=t.replace(El,"");return window.location.href.split("#")[0]===e}function Pl(t){if(window.innerWidth{nr(e.href).then(Ol).catch(()=>{})},_l)}function Ol(t){let e=Ui({isPlain:t.kind===ie.plain,hint:t}),n=p(ji);n||(p(Wi).insertAdjacentHTML("beforeend",wl),n=p(ji)),n.innerHTML=e,Al(),p(bn).classList.add(zi)}function Il(){le.currentLinkElement&&(clearTimeout(le.hoverDelayTimeout),ir(),le.currentLinkElement=null,p(bn)?.classList.remove(zi))}function Al(){if(!le.currentLinkElement)return;let t=p(bn),e=le.currentLinkElement.getBoundingClientRect(),n=p(Wi).getBoundingClientRect(),r=t.getBoundingClientRect(),i=Cl(e,n);if(e.left+r.width+Se code:first-child):not(:has(.copy-button))").forEach(t=>{if(!En){let r=document.createElement("div");r.innerHTML=Ki,En=r.firstChild}let e=En.cloneNode(!0);t.appendChild(e);let n;e.addEventListener("click",()=>{clearTimeout(n);let r=Array.from(t.querySelectorAll("code > *:not(.unselectable)")).map(i=>i.textContent).join("");navigator.clipboard.writeText(r),e.classList.add("clicked"),e.disabled=!0,n=setTimeout(()=>{e.classList.remove("clicked"),e.disabled=!1},3e3)})})}var V=Y(Zi());var es=Y(ae());var ts=es.template({1:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return" Search results for "+t.escapeExpression((s=(s=o(n,"value")||(e!=null?o(e,"value"):e))!=null?s:t.hooks.helperMissing,typeof s=="function"?s.call(e??(t.nullContext||{}),{name:"value",hash:{},data:i,loc:{start:{line:3,column:27},end:{line:3,column:36}}}):s))+` +`},3:function(t,e,n,r,i){return` Invalid search +`},5:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"each").call(e??(t.nullContext||{}),e!=null?o(e,"results"):e,{name:"each",hash:{},fn:t.program(6,i,0),inverse:t.noop,data:i,loc:{start:{line:10,column:2},end:{line:21,column:11}}}))!=null?s:""},6:function(t,e,n,r,i){var s,o=t.lambda,a=t.escapeExpression,l=t.lookupProperty||function(u,c){if(Object.prototype.hasOwnProperty.call(u,c))return u[c]};return`
+

+ + `+a(o(e!=null?l(e,"title"):e,e))+" ("+a(o(e!=null?l(e,"type"):e,e))+`) + +

+`+((s=l(n,"each").call(e??(t.nullContext||{}),e!=null?l(e,"excerpts"):e,{name:"each",hash:{},fn:t.program(7,i,0),inverse:t.noop,data:i,loc:{start:{line:17,column:8},end:{line:19,column:17}}}))!=null?s:"")+`
+`},7:function(t,e,n,r,i){var s;return'

'+((s=t.lambda(e,e))!=null?s:"")+`

+`},9:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return((s=(o(n,"isArray")||e&&o(e,"isArray")||t.hooks.helperMissing).call(e??(t.nullContext||{}),e!=null?o(e,"results"):e,{name:"isArray",hash:{},fn:t.program(10,i,0),inverse:t.program(12,i,0),data:i,loc:{start:{line:23,column:2},end:{line:29,column:14}}}))!=null?s:"")+` +

The search functionality is full-text based. Here are some tips:

+ +
    +
  • Multiple words (such as foo bar) are searched as OR
  • +
  • Use * anywhere (such as fo*) as wildcard
  • +
  • Use + before a word (such as +foo) to make its presence required
  • +
  • Use - before a word (such as -foo) to make its absence required
  • +
  • Use : to search on a particular field (such as field:word). The available fields are title, doc and type
  • +
  • Use WORD^NUMBER (such as foo^2) to boost the given word
  • +
  • Use WORD~NUMBER (such as foo~2) to do a search with edit distance on word
  • +
+ +

To quickly go to a module, type, or function, use the autocompletion feature in the sidebar search.

+`},10:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return"

Sorry, we couldn't find anything for "+t.escapeExpression((s=(s=o(n,"value")||(e!=null?o(e,"value"):e))!=null?s:t.hooks.helperMissing,typeof s=="function"?s.call(e??(t.nullContext||{}),{name:"value",hash:{},data:i,loc:{start:{line:24,column:48},end:{line:24,column:57}}}):s))+`.

+`},12:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"value"):e,{name:"if",hash:{},fn:t.program(13,i,0),inverse:t.program(15,i,0),data:i,loc:{start:{line:25,column:2},end:{line:29,column:2}}}))!=null?s:""},13:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return"

Invalid search: "+t.escapeExpression((s=(s=o(n,"errorMessage")||(e!=null?o(e,"errorMessage"):e))!=null?s:t.hooks.helperMissing,typeof s=="function"?s.call(e??(t.nullContext||{}),{name:"errorMessage",hash:{},data:i,loc:{start:{line:26,column:23},end:{line:26,column:39}}}):s))+`.

+`},15:function(t,e,n,r,i){return`

Please type something into the search bar to perform a search.

+ `},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o=e??(t.nullContext||{}),a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return`

+`+((s=a(n,"if").call(o,e!=null?a(e,"value"):e,{name:"if",hash:{},fn:t.program(1,i,0),inverse:t.program(3,i,0),data:i,loc:{start:{line:2,column:2},end:{line:6,column:9}}}))!=null?s:"")+`

+ +`+((s=(a(n,"isNonEmptyArray")||e&&a(e,"isNonEmptyArray")||t.hooks.helperMissing).call(o,e!=null?a(e,"results"):e,{name:"isNonEmptyArray",hash:{},fn:t.program(5,i,0),inverse:t.program(9,i,0),data:i,loc:{start:{line:9,column:0},end:{line:44,column:20}}}))!=null?s:"")},useData:!0});var wt=80,Rl="#search";V.default.tokenizer.separator=/\s+/;V.default.QueryLexer.termSeparator=/\s+/;V.default.Pipeline.registerFunction(ss,"docTokenSplitter");V.default.Pipeline.registerFunction(os,"docTrimmer");window.addEventListener("swup:page:view",rs);rs();function rs(){let t=window.location.pathname;if(t.endsWith("/search.html")||t.endsWith("/search")){let e=Ot("q"),n=Ot("type");Ml(e,n)}}async function Ml(t,e){if(he(t))xn({value:t});else{Vi(t);try{let n=[],r=Jn();["related","latest"].includes(e)&&r.length>0?n=await Nl(t,e,r):n=await Hl(t),xn({value:t,results:n})}catch(n){xn({value:t,errorMessage:n.message})}}}async function Hl(t){let e=await Dl(),n=t.replaceAll(/(\B|\\):/g,"\\:");return zl(e.search(n))}async function Nl(t,e,n){let r=n;e==="latest"&&(r=n.slice(0,1));let i=r.map(l=>`package:=${l.name}-${l.version}`).join(" || "),s=new URLSearchParams;s.set("q",t),s.set("query_by","title,doc"),s.set("filter_by",i);let a=await(await fetch(`https://search.hexdocs.pm/?${s.toString()}`)).json();return Array.isArray(a.hits)?a.hits.map(l=>{let[u,c]=l.document.package.split("-"),d=l.document.doc,h=[d],f={},m=`https://hexdocs.pm/${u}/${c}/${l.document.ref}`,g=l.document.title,v=l.document.type;return{doc:d,excerpts:h,metadata:f,ref:m,title:g,type:v}}):[]}function xn({value:t,results:e,errorMessage:n}){let r=p(Rl),i=ts({value:t,results:e,errorMessage:n});r.innerHTML=i}async function Dl(){let t=await Bl();if(t)return t;let e=Ul();return Ql(e),e}async function Bl(){try{let t=sessionStorage.getItem(is());if(t){let e=await Fl(t);return V.default.Index.load(e)}else return null}catch(t){return console.error("Failed to load index: ",t),null}}async function Ql(t){try{let e=await ql(t);sessionStorage.setItem(is(),e)}catch(e){console.error("Failed to save index: ",e)}}async function ql(t){let e=new Blob([JSON.stringify(t)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),r=await(await new Response(e).blob()).arrayBuffer();return Vl(r)}async function Fl(t){let e=new Blob([$l(t)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(e).text();return JSON.parse(n)}function Vl(t){let e="",n=new Uint8Array(t),r=n.byteLength;for(let i=0;i{this.add(t)})})}function jl(t){t.pipeline.before(V.default.stemmer,ss)}function ss(t){let e=[t],n=/\/\d+$/,r=/\:|\./,i=t.toString();if(i.replace(/^[.,;?!]+|[.,;]+$/g,""),i.startsWith("`")&&i.endsWith("`")&&(i=i.slice(1,-1)),n.test(i)){let o=t.toString().replace(n,"");e.push(t.clone().update(()=>o));let a=o.split(r);if(a.length>1){for(let u of a)e.push(t.clone().update(()=>u));let l=t.toString().split(r);e.push(t.clone().update(()=>l[l.length-1]))}i=a[a.length-1]}else i.startsWith("@")?(i=i.substring(1),e.push(t.clone().update(()=>i))):i.startsWith(":")&&(i=i.substring(1),e.push(t.clone().update(()=>i)));let s=i.split(/\_|\-/);if(s.length>1)for(let o of s)e.push(t.clone().update(()=>o));return e}function Wl(t){t.pipeline.before(V.default.stemmer,os)}function os(t){return t.update(function(e){return e.replace(/^[^@:\w]+/,"").replace(/[^\?\!\w]+$/,"")})}function zl(t){return t.filter(e=>ns(e.ref)).map(e=>{let n=ns(e.ref),r=e.matchData.metadata;return{...n,metadata:r,excerpts:Gl(n,r)}})}function ns(t){return searchData.items.find(e=>e.ref===t)||null}function Gl(t,e){let{doc:n}=t,i=Object.keys(e).filter(s=>"doc"in e[s]).map(s=>e[s].doc.position.map(([o,a])=>Kl(n,o,a))).reduce((s,o)=>s.concat(o),[]);return i.length===0?[n.slice(0,wt*2)+(wt*20?"...":"",t.slice(r,e),""+Re(t.slice(e,e+n))+"",t.slice(e+n,i),i{t.key==="Escape"&&ue()}),N.querySelector(".modal-close").addEventListener("click",ue),N.addEventListener("click",t=>{t.target===N&&ue()}))}function ls(t){if(!Sn)if(N.contains(t.target))kn=t.target;else{Sn=!0;let e=N.querySelectorAll(Yl);kn===e[0]?e[e.length-1].focus():e[0].focus(),Sn=!1,kn=document.activeElement}}function bt({title:t,body:e}){Jl(),_n=document.activeElement,document.addEventListener("focus",ls,!0),N.querySelector(".modal-title").innerHTML=t,N.querySelector(".modal-body").innerHTML=e,N.classList.add("shown"),N.focus()}function ue(){N?.classList.remove("shown"),document.removeEventListener("focus",ls,!0),_n?.focus(),_n=null}function us(){return Boolean(N?.classList.contains("shown"))}var cs='
';var Xl="https://hexdocs.pm/%%",Zl="https://www.erlang.org/doc/apps/%%",eu="https://hex.pm/api/packages?search=name:%%*",tu=".display-quick-switch",fs="#quick-switch-input",ps="#quick-switch-results",nu=300,ru=9,ms=["erts","asn1","common_test","compiler","crypto","debugger","dialyzer","diameter","edoc","eldap","erl_interface","et","eunit","ftp","inets","jinterface","kernel","megaco","mnesia","observer","odbc","os_mon","parsetools","public_key","reltool","runtime_tools","sasl","snmp","ssh","ssl","stdlib","syntax_tools","tftp","tools","wx","xmerl"],iu=["elixir","eex","ex_unit","hex","iex","logger","mix"].concat(ms).map(t=>({name:t})),gs=2,B={autocompleteResults:[],selectedIdx:null};A||(window.addEventListener("swup:page:view",ds),ds());function ds(){M(tu).forEach(t=>{t.addEventListener("click",Tn)})}function su(t){if(t.key==="Enter"){let e=t.target.value;au(e),t.preventDefault()}else t.key==="ArrowUp"?(hs(-1),t.preventDefault()):t.key==="ArrowDown"&&(hs(1),t.preventDefault())}function ou(t){let e=t.target.value;if(e.lengthn.json()).then(n=>{Array.isArray(n)&&(B.autocompleteResults=du(t,n),B.selectedIdx=null,p(fs).value.length>=gs&&cu(B.autocompleteResults))})}function cu(t){p(ps).replaceChildren(...t.map(({name:e},n)=>{let r=E("div",{class:"quick-switch-result","data-index":n},[e]);return r.addEventListener("click",()=>Ln(e)),r}))}function du(t,e){return iu.concat(e).filter(n=>n.name.toLowerCase().includes(t.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,ru)}function hs(t){B.selectedIdx=hu(t);let e=p(".quick-switch-result.selected"),n=p(`.quick-switch-result[data-index="${B.selectedIdx}"]`);e&&e.classList.remove("selected"),n&&n.classList.add("selected")}function hu(t){let e=B.autocompleteResults.length;if(B.selectedIdx===null){if(t>=0)return 0;if(t<0)return e-1}return(B.selectedIdx+t+e)%e}var fu="#settings-modal-content",In=[{key:"c",description:"Toggle sidebar",action:Ue},{key:"n",description:"Cycle themes",action:hr},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:Pn},{key:"/",action:Pn},{key:"k",hasModifier:!0,action:Pn},{key:"v",description:"Open/focus version select",action:gu},{key:"g",description:"Go to package docs",displayAs:"g",action:Tn},{key:"?",displayAs:"?",description:"Bring up this modal",action:vu}],On={shortcutBeingPressed:null};A||(document.addEventListener("keydown",pu),document.addEventListener("keyup",mu));function pu(t){if(On.shortcutBeingPressed||t.target.matches("input, select, textarea"))return;let e=In.find(n=>n.hasModifier?De()&&t.metaKey||t.ctrlKey?n.key===t.key:!1:t.ctrlKey||t.metaKey||t.altKey?!1:n.key===t.key);e&&(On.shortcutBeingPressed=e,t.preventDefault(),e.action(t))}function mu(t){On.shortcutBeingPressed=null}function Pn(t){ue(),wn()}function gu(){ue(),Pr()?dn():Ar().then(dn)}function vu(){yu()?ue():An()}function yu(){return us()&&p(fu)}var vs=Y(ae());var ys=vs.template({1:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"description"):e,{name:"if",hash:{},fn:t.program(2,i,0),inverse:t.noop,data:i,loc:{start:{line:40,column:6},end:{line:53,column:13}}}))!=null?s:""},2:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
+
+ `+t.escapeExpression(t.lambda(e!=null?o(e,"description"):e,e))+` +
+
+`+((s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"displayAs"):e,{name:"if",hash:{},fn:t.program(3,i,0),inverse:t.program(5,i,0),data:i,loc:{start:{line:46,column:12},end:{line:50,column:19}}}))!=null?s:"")+`
+
+`},3:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return" "+((s=t.lambda(e!=null?o(e,"displayAs"):e,e))!=null?s:"")+` +`},5:function(t,e,n,r,i){var s=t.lookupProperty||function(o,a){if(Object.prototype.hasOwnProperty.call(o,a))return o[a]};return" "+t.escapeExpression(t.lambda(e!=null?s(e,"key"):e,e))+` +`},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
+
+ + + + +
+ +
+`},useData:!0});var wu=".display-settings",bu="#settings-modal-content",Cn="#modal-settings-tab",Rn="#modal-keyboard-shortcuts-tab",bs="#settings-content",Es="#keyboard-shortcuts-content",Eu=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];window.addEventListener("swup:page:view",xs);xs();function xs(){M(wu).forEach(t=>{t.addEventListener("click",An)})}function ws(){p(Rn).classList.remove("active"),p(Cn).classList.add("active"),p(bs).classList.remove("hidden"),p(Es).classList.add("hidden")}function xu(){p(Rn).classList.add("active"),p(Cn).classList.remove("active"),p(Es).classList.remove("hidden"),p(bs).classList.add("hidden")}function An(){bt({title:Eu.map(({id:s,title:o})=>``).join(""),body:ys({shortcuts:In})});let t=p(bu),e=t.querySelector('[name="theme"]'),n=t.querySelector('[name="tooltips"]'),r=t.querySelector('[name="direct_livebook_url"]'),i=t.querySelector('[name="livebook_url"]');H.getAndSubscribe(s=>{e.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)}),e.addEventListener("change",s=>{H.update({theme:s.target.value})}),n.addEventListener("change",s=>{H.update({tooltips:s.target.checked})}),r.addEventListener("change",s=>{let o=s.target.checked?i.value:null;H.update({livebookUrl:o})}),i.addEventListener("input",s=>{H.update({livebookUrl:s.target.value})}),p(Cn).addEventListener("click",s=>{ws()}),p(Rn).addEventListener("click",s=>{xu()}),ws()}var Mn=new WeakMap;function Hn(t,e,n,r){if(!t&&!Mn.has(e))return!1;let i=Mn.get(e)??new WeakMap;Mn.set(e,i);let s=i.get(n)??new Set;i.set(n,s);let o=s.has(r);return t?s.add(r):s.delete(r),o&&t}function ku(t,e){let n=t.target;if(n instanceof Text&&(n=n.parentElement),n instanceof Element&&t.currentTarget instanceof Element){let r=n.closest(e);if(r&&t.currentTarget.contains(r))return r}}function Su(t,e,n,r={}){let{signal:i,base:s=document}=r;if(i?.aborted)return;let{once:o,...a}=r,l=s instanceof Document?s.documentElement:s,u=Boolean(typeof r=="object"?r.capture:r),c=f=>{let m=ku(f,String(t));if(m){let g=Object.assign(f,{delegateTarget:m});n.call(l,g),o&&(l.removeEventListener(e,c,a),Hn(!1,l,n,d))}},d=JSON.stringify({selector:t,type:e,capture:u});Hn(!0,l,n,d)||l.addEventListener(e,c,a),i?.addEventListener("abort",()=>{Hn(!1,l,n,d)})}var Et=Su;function P(){return P=Object.assign?Object.assign.bind():function(t){for(var e=1;eString(t).toLowerCase().replace(/[\s/_.]+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+|-+$/g,"")||e||"",Le=({hash:t}={})=>window.location.pathname+window.location.search+(t?window.location.hash:""),_u=(t,e={})=>{let n=P({url:t=t||Le({hash:!0}),random:Math.random(),source:"swup"},e);window.history.pushState(n,"",t)},_e=(t=null,e={})=>{t=t||Le({hash:!0});let n=P({},window.history.state||{},{url:t,random:Math.random(),source:"swup"},e);window.history.replaceState(n,"",t)},Lu=(t,e,n,r)=>{let i=new AbortController;return r=P({},r,{signal:i.signal}),Et(t,e,n,r),{destroy:()=>i.abort()}},O=class extends URL{constructor(e,n=document.baseURI){super(e.toString(),n),Object.setPrototypeOf(this,O.prototype)}get url(){return this.pathname+this.search}static fromElement(e){let n=e.getAttribute("href")||e.getAttribute("xlink:href")||"";return new O(n)}static fromUrl(e){return new O(e)}};var me=class extends Error{constructor(e,n){super(e),this.url=void 0,this.status=void 0,this.aborted=void 0,this.timedOut=void 0,this.name="FetchError",this.url=n.url,this.status=n.status,this.aborted=n.aborted||!1,this.timedOut=n.timedOut||!1}};async function Tu(t,e={}){var n;t=O.fromUrl(t).url;let{visit:r=this.visit}=e,i=P({},this.options.requestHeaders,e.headers),s=(n=e.timeout)!=null?n:this.options.timeout,o=new AbortController,{signal:a}=o;e=P({},e,{headers:i,signal:a});let l,u=!1,c=null;s&&s>0&&(c=setTimeout(()=>{u=!0,o.abort("timeout")},s));try{l=await this.hooks.call("fetch:request",r,{url:t,options:e},(v,{url:w,options:x})=>fetch(w,x)),c&&clearTimeout(c)}catch(v){throw u?(this.hooks.call("fetch:timeout",r,{url:t}),new me(`Request timed out: ${t}`,{url:t,timedOut:u})):v?.name==="AbortError"||a.aborted?new me(`Request aborted: ${t}`,{url:t,aborted:!0}):v}let{status:d,url:h}=l,f=await l.text();if(d===500)throw this.hooks.call("fetch:error",r,{status:d,response:l,url:h}),new me(`Server error: ${h}`,{status:d,url:h});if(!f)throw new me(`Empty response: ${h}`,{status:d,url:h});let{url:m}=O.fromUrl(h),g={url:m,html:f};return!r.cache.write||e.method&&e.method!=="GET"||t!==m||this.cache.set(g.url,g),g}var Dn=class{constructor(e){this.swup=void 0,this.pages=new Map,this.swup=e}get size(){return this.pages.size}get all(){let e=new Map;return this.pages.forEach((n,r)=>{e.set(r,P({},n))}),e}has(e){return this.pages.has(this.resolve(e))}get(e){let n=this.pages.get(this.resolve(e));return n&&P({},n)}set(e,n){n=P({},n,{url:e=this.resolve(e)}),this.pages.set(e,n),this.swup.hooks.callSync("cache:set",void 0,{page:n})}update(e,n){e=this.resolve(e);let r=P({},this.get(e),n,{url:e});this.pages.set(e,r)}delete(e){this.pages.delete(this.resolve(e))}clear(){this.pages.clear(),this.swup.hooks.callSync("cache:clear",void 0,void 0)}prune(e){this.pages.forEach((n,r)=>{e(r,n)&&this.delete(r)})}resolve(e){let{url:n}=O.fromUrl(e);return this.swup.resolveUrl(n)}},Bn=(t,e=document)=>e.querySelector(t),Fn=(t,e=document)=>Array.from(e.querySelectorAll(t)),Ts=()=>new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})});function Ps(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function Pu(t,e=[]){return new Promise((n,r)=>{let i=t(...e);Ps(i)?i.then(n,r):n(i)})}function ks(t,e){let n=t?.closest(`[${e}]`);return n!=null&&n.hasAttribute(e)?n?.getAttribute(e)||!0:void 0}var Qn=class{constructor(e){this.swup=void 0,this.swupClasses=["to-","is-changing","is-rendering","is-popstate","is-animating","is-leaving"],this.swup=e}get selectors(){let{scope:e}=this.swup.visit.animation;return e==="containers"?this.swup.visit.containers:e==="html"?["html"]:Array.isArray(e)?e:[]}get selector(){return this.selectors.join(",")}get targets(){return this.selector.trim()?Fn(this.selector):[]}add(...e){this.targets.forEach(n=>n.classList.add(...e))}remove(...e){this.targets.forEach(n=>n.classList.remove(...e))}clear(){this.targets.forEach(e=>{let n=e.className.split(" ").filter(r=>this.isSwupClass(r));e.classList.remove(...n)})}isSwupClass(e){return this.swupClasses.some(n=>e.startsWith(n))}},St=class{constructor(e,n){this.id=void 0,this.state=void 0,this.from=void 0,this.to=void 0,this.containers=void 0,this.animation=void 0,this.trigger=void 0,this.cache=void 0,this.history=void 0,this.scroll=void 0,this.meta=void 0;let{to:r,from:i,hash:s,el:o,event:a}=n;this.id=Math.random(),this.state=1,this.from={url:i??e.location.url,hash:e.location.hash},this.to={url:r,hash:s},this.containers=e.options.containers,this.animation={animate:!0,wait:!1,name:void 0,native:e.options.native,scope:e.options.animationScope,selector:e.options.animationSelector},this.trigger={el:o,event:a},this.cache={read:e.options.cache,write:e.options.cache},this.history={action:"push",popstate:!1,direction:void 0},this.scroll={reset:!0,target:void 0},this.meta={}}advance(e){this.state=7}};function Ou(t){return new St(this,t)}var qn=class{constructor(e){this.swup=void 0,this.registry=new Map,this.hooks=["animation:out:start","animation:out:await","animation:out:end","animation:in:start","animation:in:await","animation:in:end","animation:skip","cache:clear","cache:set","content:replace","content:scroll","enable","disable","fetch:request","fetch:error","fetch:timeout","history:popstate","link:click","link:self","link:anchor","link:newtab","page:load","page:view","scroll:top","scroll:anchor","visit:start","visit:transition","visit:abort","visit:end"],this.swup=e,this.init()}init(){this.hooks.forEach(e=>this.create(e))}create(e){this.registry.has(e)||this.registry.set(e,new Map)}exists(e){return this.registry.has(e)}get(e){let n=this.registry.get(e);if(n)return n;console.error(`Unknown hook '${e}'`)}clear(){this.registry.forEach(e=>e.clear())}on(e,n,r={}){let i=this.get(e);if(!i)return console.warn(`Hook '${e}' not found.`),()=>{};let s=P({},r,{id:i.size+1,hook:e,handler:n});return i.set(n,s),()=>this.off(e,n)}before(e,n,r={}){return this.on(e,n,P({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,P({},r,{replace:!0}))}once(e,n,r={}){return this.on(e,n,P({},r,{once:!0}))}off(e,n){let r=this.get(e);r&&n?r.delete(n)||console.warn(`Handler for hook '${e}' not found.`):r&&r.clear()}async call(e,n,r,i){let[s,o,a]=this.parseCallArgs(e,n,r,i),{before:l,handler:u,after:c}=this.getHandlers(e,a);await this.run(l,s,o);let[d]=await this.run(u,s,o,!0);return await this.run(c,s,o),this.dispatchDomEvent(e,s,o),d}callSync(e,n,r,i){let[s,o,a]=this.parseCallArgs(e,n,r,i),{before:l,handler:u,after:c}=this.getHandlers(e,a);this.runSync(l,s,o);let[d]=this.runSync(u,s,o,!0);return this.runSync(c,s,o),this.dispatchDomEvent(e,s,o),d}parseCallArgs(e,n,r,i){return n instanceof St||typeof n!="object"&&typeof r!="function"?[n,r,i]:[void 0,n,r]}async run(e,n=this.swup.visit,r,i=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:l,once:u}of e)if(n==null||!n.done){u&&this.off(o,a);try{let c=await Pu(a,[n,r,l]);s.push(c)}catch(c){if(i)throw c;console.error(`Error in hook '${o}':`,c)}}return s}runSync(e,n=this.swup.visit,r,i=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:l,once:u}of e)if(n==null||!n.done){u&&this.off(o,a);try{let c=a(n,r,l);s.push(c),Ps(c)&&console.warn(`Swup will not await Promises in handler for synchronous hook '${o}'.`)}catch(c){if(i)throw c;console.error(`Error in hook '${o}':`,c)}}return s}getHandlers(e,n){let r=this.get(e);if(!r)return{found:!1,before:[],handler:[],after:[],replaced:!1};let i=Array.from(r.values()),s=this.sortRegistrations,o=i.filter(({before:d,replace:h})=>d&&!h).sort(s),a=i.filter(({replace:d})=>d).filter(d=>!0).sort(s),l=i.filter(({before:d,replace:h})=>!d&&!h).sort(s),u=a.length>0,c=[];if(n&&(c=[{id:0,hook:e,handler:n}],u)){let d=a.length-1,{handler:h,once:f}=a[d],m=g=>{let v=a[g-1];return v?(w,x)=>v.handler(w,x,m(g-1)):n};c=[{id:0,hook:e,once:f,handler:h,defaultHandler:m(d)}]}return{found:!0,before:o,handler:c,after:l,replaced:u}}sortRegistrations(e,n){var r,i;return((r=e.priority)!=null?r:0)-((i=n.priority)!=null?i:0)||e.id-n.id||0}dispatchDomEvent(e,n,r){if(n!=null&&n.done)return;let i={hook:e,args:r,visit:n||this.swup.visit};document.dispatchEvent(new CustomEvent("swup:any",{detail:i,bubbles:!0})),document.dispatchEvent(new CustomEvent(`swup:${e}`,{detail:i,bubbles:!0}))}parseName(e){let[n,...r]=e.split(".");return[n,r.reduce((i,s)=>P({},i,{[s]:!0}),{})]}},Iu=t=>{if(t&&t.charAt(0)==="#"&&(t=t.substring(1)),!t)return null;let e=decodeURIComponent(t),n=document.getElementById(t)||document.getElementById(e)||Bn(`a[name='${CSS.escape(t)}']`)||Bn(`a[name='${CSS.escape(e)}']`);return n||t!=="top"||(n=document.body),n},xt="transition",Nn="animation";async function Au({selector:t,elements:e}){if(t===!1&&!e)return;let n=[];if(e)n=Array.from(e);else if(t&&(n=Fn(t,document.body),!n.length))return void console.warn(`[swup] No elements found matching animationSelector \`${t}\``);let r=n.map(i=>function(s){let{type:o,timeout:a,propCount:l}=function(u){let c=window.getComputedStyle(u),d=kt(c,`${xt}Delay`),h=kt(c,`${xt}Duration`),f=Ss(d,h),m=kt(c,`${Nn}Delay`),g=kt(c,`${Nn}Duration`),v=Ss(m,g),w=Math.max(f,v),x=w>0?f>v?xt:Nn:null;return{type:x,timeout:w,propCount:x?x===xt?h.length:g.length:0}}(s);return!(!o||!a)&&new Promise(u=>{let c=`${o}end`,d=performance.now(),h=0,f=()=>{s.removeEventListener(c,m),u()},m=g=>{g.target===s&&((performance.now()-d)/1e3=l&&f())};setTimeout(()=>{h0?await Promise.all(r):t&&console.warn(`[swup] No CSS animation duration defined on elements matching \`${t}\``)}function kt(t,e){return(t[e]||"").split(", ")}function Ss(t,e){for(;t.length_s(n)+_s(t[r])))}function _s(t){return 1e3*parseFloat(t)}function Cu(t,e={},n={}){if(typeof t!="string")throw new Error("swup.navigate() requires a URL parameter");if(this.shouldIgnoreVisit(t,{el:n.el,event:n.event}))return void window.location.assign(t);let{url:r,hash:i}=O.fromUrl(t),s=this.createVisit(P({},n,{to:r,hash:i}));this.performNavigation(s,e)}async function Ru(t,e={}){if(this.navigating){if(this.visit.state>=6)return t.state=2,void(this.onVisitEnd=()=>this.performNavigation(t,e));await this.hooks.call("visit:abort",this.visit,void 0),delete this.visit.to.document,this.visit.state=8}this.navigating=!0,this.visit=t;let{el:n}=t.trigger;e.referrer=e.referrer||this.location.url,e.animate===!1&&(t.animation.animate=!1),t.animation.animate||this.classes.clear();let r=e.history||ks(n,"data-swup-history");typeof r=="string"&&["push","replace"].includes(r)&&(t.history.action=r);let i=e.animation||ks(n,"data-swup-animation");var s,o;typeof i=="string"&&(t.animation.name=i),t.meta=e.meta||{},typeof e.cache=="object"?(t.cache.read=(s=e.cache.read)!=null?s:t.cache.read,t.cache.write=(o=e.cache.write)!=null?o:t.cache.write):e.cache!==void 0&&(t.cache={read:!!e.cache,write:!!e.cache}),delete e.cache;try{await this.hooks.call("visit:start",t,void 0),t.state=3;let a=this.hooks.call("page:load",t,{options:e},async(u,c)=>{let d;return u.cache.read&&(d=this.cache.get(u.to.url)),c.page=d||await this.fetchPage(u.to.url,c.options),c.cache=!!d,c.page});a.then(({html:u})=>{t.advance(5),t.to.html=u,t.to.document=new DOMParser().parseFromString(u,"text/html")});let l=t.to.url+t.to.hash;if(t.history.popstate||(t.history.action==="replace"||t.to.url===this.location.url?_e(l):(this.currentHistoryIndex++,_u(l,{index:this.currentHistoryIndex}))),this.location=O.fromUrl(l),t.history.popstate&&this.classes.add("is-popstate"),t.animation.name&&this.classes.add(`to-${Ls(t.animation.name)}`),t.animation.wait&&await a,t.done||(await this.hooks.call("visit:transition",t,void 0,async()=>{if(!t.animation.animate)return await this.hooks.call("animation:skip",void 0),void await this.renderPage(t,await a);t.advance(4),await this.animatePageOut(t),t.animation.native&&document.startViewTransition?await document.startViewTransition(async()=>await this.renderPage(t,await a)).finished:await this.renderPage(t,await a),await this.animatePageIn(t)}),t.done))return;await this.hooks.call("visit:end",t,void 0,()=>this.classes.clear()),t.state=7,this.navigating=!1,this.onVisitEnd&&(this.onVisitEnd(),this.onVisitEnd=void 0)}catch(a){if(!a||a!=null&&a.aborted)return void(t.state=8);t.state=9,console.error(a),this.options.skipPopStateHandling=()=>(window.location.assign(t.to.url+t.to.hash),!0),window.history.back()}finally{delete t.to.document}}var Mu=async function(t){await this.hooks.call("animation:out:start",t,void 0,()=>{this.classes.add("is-changing","is-animating","is-leaving")}),await this.hooks.call("animation:out:await",t,{skip:!1},(e,{skip:n})=>{if(!n)return this.awaitAnimations({selector:e.animation.selector})}),await this.hooks.call("animation:out:end",t,void 0)},Hu=function(t){var e;let n=t.to.document;if(!n)return!1;let r=((e=n.querySelector("title"))==null?void 0:e.innerText)||"";document.title=r;let i=Fn('[data-swup-persist]:not([data-swup-persist=""])'),s=t.containers.map(o=>{let a=document.querySelector(o),l=n.querySelector(o);return a&&l?(a.replaceWith(l.cloneNode(!0)),!0):(a||console.warn(`[swup] Container missing in current document: ${o}`),l||console.warn(`[swup] Container missing in incoming document: ${o}`),!1)}).filter(Boolean);return i.forEach(o=>{let a=o.getAttribute("data-swup-persist"),l=Bn(`[data-swup-persist="${a}"]`);l&&l!==o&&l.replaceWith(o)}),s.length===t.containers.length},Nu=function(t){let e={behavior:"auto"},{target:n,reset:r}=t.scroll,i=n??t.to.hash,s=!1;return i&&(s=this.hooks.callSync("scroll:anchor",t,{hash:i,options:e},(o,{hash:a,options:l})=>{let u=this.getAnchorElement(a);return u&&u.scrollIntoView(l),!!u})),r&&!s&&(s=this.hooks.callSync("scroll:top",t,{options:e},(o,{options:a})=>(window.scrollTo(P({top:0,left:0},a)),!0))),s},Du=async function(t){if(t.done)return;let e=this.hooks.call("animation:in:await",t,{skip:!1},(n,{skip:r})=>{if(!r)return this.awaitAnimations({selector:n.animation.selector})});await Ts(),await this.hooks.call("animation:in:start",t,void 0,()=>{this.classes.remove("is-animating")}),await e,await this.hooks.call("animation:in:end",t,void 0)},Bu=async function(t,e){if(t.done)return;t.advance(6);let{url:n}=e;this.isSameResolvedUrl(Le(),n)||(_e(n),this.location=O.fromUrl(n),t.to.url=this.location.url,t.to.hash=this.location.hash),await this.hooks.call("content:replace",t,{page:e},(r,{})=>{if(this.classes.remove("is-leaving"),r.animation.animate&&this.classes.add("is-rendering"),!this.replaceContent(r))throw new Error("[swup] Container mismatch, aborting");r.animation.animate&&(this.classes.add("is-changing","is-animating","is-rendering"),r.animation.name&&this.classes.add(`to-${Ls(r.animation.name)}`))}),await this.hooks.call("content:scroll",t,void 0,()=>this.scrollToContent(t)),await this.hooks.call("page:view",t,{url:this.location.url,title:document.title})},Qu=function(t){var e;if(e=t,Boolean(e?.isSwupPlugin)){if(t.swup=this,!t._checkRequirements||t._checkRequirements())return t._beforeMount&&t._beforeMount(),t.mount(),this.plugins.push(t),this.plugins}else console.error("Not a swup plugin instance",t)};function qu(t){let e=this.findPlugin(t);if(e)return e.unmount(),e._afterUnmount&&e._afterUnmount(),this.plugins=this.plugins.filter(n=>n!==e),this.plugins;console.error("No such plugin",e)}function Fu(t){return this.plugins.find(e=>e===t||e.name===t||e.name===`Swup${String(t)}`)}function Vu(t){if(typeof this.options.resolveUrl!="function")return console.warn("[swup] options.resolveUrl expects a callback function."),t;let e=this.options.resolveUrl(t);return e&&typeof e=="string"?e.startsWith("//")||e.startsWith("http")?(console.warn("[swup] options.resolveUrl needs to return a relative url"),t):e:(console.warn("[swup] options.resolveUrl needs to return a url"),t)}function $u(t,e){return this.resolveUrl(t)===this.resolveUrl(e)}var Uu={animateHistoryBrowsing:!1,animationSelector:'[class*="transition-"]',animationScope:"html",cache:!0,containers:["#swup"],hooks:{},ignoreVisit:(t,{el:e}={})=>!(e==null||!e.closest("[data-no-swup]")),linkSelector:"a[href]",linkToSelf:"scroll",native:!1,plugins:[],resolveUrl:t=>t,requestHeaders:{"X-Requested-With":"swup",Accept:"text/html, application/xhtml+xml"},skipPopStateHandling:t=>{var e;return((e=t.state)==null?void 0:e.source)!=="swup"},timeout:0},_t=class{get currentPageUrl(){return this.location.url}constructor(e={}){var n,r;this.version="4.8.1",this.options=void 0,this.defaults=Uu,this.plugins=[],this.visit=void 0,this.cache=void 0,this.hooks=void 0,this.classes=void 0,this.location=O.fromUrl(window.location.href),this.currentHistoryIndex=void 0,this.clickDelegate=void 0,this.navigating=!1,this.onVisitEnd=void 0,this.use=Qu,this.unuse=qu,this.findPlugin=Fu,this.log=()=>{},this.navigate=Cu,this.performNavigation=Ru,this.createVisit=Ou,this.delegateEvent=Lu,this.fetchPage=Tu,this.awaitAnimations=Au,this.renderPage=Bu,this.replaceContent=Hu,this.animatePageIn=Du,this.animatePageOut=Mu,this.scrollToContent=Nu,this.getAnchorElement=Iu,this.getCurrentUrl=Le,this.resolveUrl=Vu,this.isSameResolvedUrl=$u,this.options=P({},this.defaults,e),this.handleLinkClick=this.handleLinkClick.bind(this),this.handlePopState=this.handlePopState.bind(this),this.cache=new Dn(this),this.classes=new Qn(this),this.hooks=new qn(this),this.visit=this.createVisit({to:""}),this.currentHistoryIndex=(n=(r=window.history.state)==null?void 0:r.index)!=null?n:1,this.enable()}async enable(){var e;let{linkSelector:n}=this.options;this.clickDelegate=this.delegateEvent(n,"click",this.handleLinkClick),window.addEventListener("popstate",this.handlePopState),this.options.animateHistoryBrowsing&&(window.history.scrollRestoration="manual"),this.options.native=this.options.native&&!!document.startViewTransition,this.options.plugins.forEach(r=>this.use(r));for(let[r,i]of Object.entries(this.options.hooks)){let[s,o]=this.hooks.parseName(r);this.hooks.on(s,i,o)}((e=window.history.state)==null?void 0:e.source)!=="swup"&&_e(null,{index:this.currentHistoryIndex}),await Ts(),await this.hooks.call("enable",void 0,void 0,()=>{let r=document.documentElement;r.classList.add("swup-enabled"),r.classList.toggle("swup-native",this.options.native)})}async destroy(){this.clickDelegate.destroy(),window.removeEventListener("popstate",this.handlePopState),this.cache.clear(),this.options.plugins.forEach(e=>this.unuse(e)),await this.hooks.call("disable",void 0,void 0,()=>{let e=document.documentElement;e.classList.remove("swup-enabled"),e.classList.remove("swup-native")}),this.hooks.clear()}shouldIgnoreVisit(e,{el:n,event:r}={}){let{origin:i,url:s,hash:o}=O.fromUrl(e);return i!==window.location.origin||!(!n||!this.triggerWillOpenNewWindow(n))||!!this.options.ignoreVisit(s+o,{el:n,event:r})}handleLinkClick(e){let n=e.delegateTarget,{href:r,url:i,hash:s}=O.fromElement(n);if(this.shouldIgnoreVisit(r,{el:n,event:e}))return;if(this.navigating&&i===this.visit.to.url)return void e.preventDefault();let o=this.createVisit({to:i,hash:s,el:n,event:e});e.metaKey||e.ctrlKey||e.shiftKey||e.altKey?this.hooks.callSync("link:newtab",o,{href:r}):e.button===0&&this.hooks.callSync("link:click",o,{el:n,event:e},()=>{var a;let l=(a=o.from.url)!=null?a:"";e.preventDefault(),i&&i!==l?this.isSameResolvedUrl(i,l)||this.performNavigation(o):s?this.hooks.callSync("link:anchor",o,{hash:s},()=>{_e(i+s),this.scrollToContent(o)}):this.hooks.callSync("link:self",o,void 0,()=>{this.options.linkToSelf==="navigate"?this.performNavigation(o):(_e(i),this.scrollToContent(o))})})}handlePopState(e){var n,r,i,s;let o=(n=(r=e.state)==null?void 0:r.url)!=null?n:window.location.href;if(this.options.skipPopStateHandling(e)||this.isSameResolvedUrl(Le(),this.location.url))return;let{url:a,hash:l}=O.fromUrl(o),u=this.createVisit({to:a,hash:l,event:e});u.history.popstate=!0;let c=(i=(s=e.state)==null?void 0:s.index)!=null?i:0;c&&c!==this.currentHistoryIndex&&(u.history.direction=c-this.currentHistoryIndex>0?"forwards":"backwards",this.currentHistoryIndex=c),u.animation.animate=!1,u.scroll.reset=!1,u.scroll.target=!1,this.options.animateHistoryBrowsing&&(u.animation.animate=!0,u.scroll.reset=!0),this.hooks.callSync("history:popstate",u,{event:e},()=>{this.performNavigation(u)})}triggerWillOpenNewWindow(e){return!!e.matches('[download], [target="_blank"]')}};function Te(){return Te=Object.assign?Object.assign.bind():function(t){for(var e=1;eString(t).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join("."),ge=class{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEach(([e,n])=>{if(!function(r,i,s){let o=function(a,l){var u;if(a==="swup")return(u=l.version)!=null?u:"";{var c;let d=l.findPlugin(a);return(c=d?.version)!=null?c:""}}(r,s);return!!o&&((a,l)=>l.every(u=>{let[,c,d]=u.match(/^([\D]+)?(.*)$/)||[];var h,f;return((m,g)=>{let v={"":w=>w===0,">":w=>w>0,">=":w=>w>=0,"<":w=>w<0,"<=":w=>w<=0};return(v[g]||v[""])(m)})((f=d,h=Os(h=a),f=Os(f),h.localeCompare(f,void 0,{numeric:!0})),c||">=")}))(o,i)}(e,n=Array.isArray(n)?n:[n],this.swup)){let r=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${r}`)}}),!0}on(e,n,r={}){var i;n=!(i=n).name.startsWith("bound ")||i.hasOwnProperty("prototype")?n.bind(this):n;let s=this.swup.hooks.on(e,n,r);return this.handlersToUnregister.push(s),s}once(e,n,r={}){return this.on(e,n,Te({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,Te({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,Te({},r,{replace:!0}))}off(e,n){return this.swup.hooks.off(e,n)}};(function(){if(!(typeof window>"u"||typeof document>"u"||typeof HTMLElement>"u")){var t=!1;try{var e=document.createElement("div");e.addEventListener("focus",function(s){s.preventDefault(),s.stopPropagation()},!0),e.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&typeof navigator.userAgent<"u"&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return t=!1;t=!0}}))}catch{}if(HTMLElement.prototype.nativeFocus===void 0&&!t){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var n=function(s){for(var o=s.parentNode,a=[],l=document.scrollingElement||document.documentElement;o&&o!==l;)(o.offsetHeightn.replace(`{${r}}`,e[r]||""),t||"")}var $n=class{constructor(){var e;this.id="swup-announcer",this.style="position:absolute;top:0;left:0;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap;word-wrap:normal;width:1px;height:1px;",this.region=void 0,this.region=(e=this.getRegion())!=null?e:this.createRegion()}getRegion(){return document.getElementById(this.id)}createRegion(){let e=function(n){let r=document.createElement("template");return r.innerHTML=n,r.content.children[0]}(`

`);return document.body.appendChild(e),e}announce(e,n=0){return new Promise(r=>{setTimeout(()=>{this.region.textContent===e&&(e=`${e}.`),this.region.textContent="",this.region.textContent=e,r()},n)})}};function As(t){let e;if(e=typeof t=="string"?document.querySelector(t):t,!(e instanceof HTMLElement))return;let n=e.getAttribute("tabindex");e.setAttribute("tabindex","-1"),e.focus({preventScroll:!0}),n!==null&&e.setAttribute("tabindex",n)}var Lt=class extends ge{constructor(e={}){super(),this.name="SwupA11yPlugin",this.requires={swup:">=4"},this.defaults={headingSelector:"h1",respectReducedMotion:!0,autofocus:!1,announcements:{visit:"Navigated to: {title}",url:"New page at {url}"}},this.options=void 0,this.announcer=void 0,this.announcementDelay=100,this.rootSelector="body",this.handleAnchorScroll=(n,{hash:r})=>{let i=this.swup.getAnchorElement(r);i instanceof HTMLElement&&As(i)},this.options=Vn({},this.defaults,e),this.announcer=new $n}mount(){this.swup.hooks.create("content:announce"),this.swup.hooks.create("content:focus"),this.before("visit:start",this.prepareVisit),this.on("visit:start",this.markAsBusy),this.on("visit:end",this.unmarkAsBusy),this.on("visit:end",this.focusContent),this.on("visit:end",this.announceContent),this.on("scroll:anchor",this.handleAnchorScroll),this.before("visit:start",this.disableAnimations),this.before("link:self",this.disableAnimations),this.before("link:anchor",this.disableAnimations),this.swup.announce=this.announce.bind(this)}unmount(){this.swup.announce=void 0}async announce(e){await this.announcer.announce(e)}markAsBusy(){document.documentElement.setAttribute("aria-busy","true")}unmarkAsBusy(){document.documentElement.removeAttribute("aria-busy")}prepareVisit(e){e.a11y={announce:void 0,focus:this.rootSelector}}announceContent(e){this.swup.hooks.callSync("content:announce",e,void 0,n=>{n.a11y.announce===void 0&&(n.a11y.announce=this.getPageAnnouncement()),n.a11y.announce&&this.announcer.announce(n.a11y.announce,this.announcementDelay)})}focusContent(e){this.swup.hooks.callSync("content:focus",e,void 0,n=>{n.a11y.focus&&(this.options.autofocus&&function(){let r=function(){let i=document.querySelector("body [autofocus]");if(i&&!i.closest('[inert], [aria-disabled], [aria-hidden="true"]'))return i}();return!!r&&(r!==document.activeElement&&r.focus(),!0)}()===!0||As(n.a11y.focus))})}getPageAnnouncement(){let{headingSelector:e,announcements:n}=this.options;return function({headingSelector:r="h1",announcements:i={}}){var s,o;let a=document.documentElement.lang||"*",{href:l,url:u,pathname:c}=O.fromUrl(window.location.href),d=(s=(o=i[a])!=null?o:i["*"])!=null?s:i;if(typeof d!="object")return;let h=document.querySelector(r);h||console.warn(`SwupA11yPlugin: No main heading (${r}) found on new page`);let f=h?.getAttribute("aria-label")||h?.textContent||document.title||Is(d.url,{href:l,url:u,path:c});return Is(d.visit,{title:f,href:l,url:u,path:c})}({headingSelector:e,announcements:n})}disableAnimations(e){this.options.respectReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(e.animation.animate=!1,e.scroll.animate=!1)}};function Un(){return Un=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let a=Math.random()*this.trickleValue;this.setValue(this.value+a)},e!==void 0&&(this.className=String(e)),n!==void 0&&(this.styleAttr=String(n)),r!==void 0&&(this.animationDuration=Number(r)),i!==void 0&&(this.minValue=Number(i)),s!==void 0&&(this.initialValue=Number(s)),o!==void 0&&(this.trickleValue=Number(o)),this.styleElement=this.createStyleElement(),this.progressElement=this.createProgressElement()}get defaultStyles(){return` + .${this.className} { + position: fixed; + display: block; + top: 0; + left: 0; + width: 100%; + height: 3px; + background-color: black; + z-index: 9999; + transition: + transform ${this.animationDuration}ms ease-out, + opacity ${this.animationDuration/2}ms ${this.animationDuration/2}ms ease-in; + transform: translate3d(0, 0, 0) scaleX(var(--progress, 0)); + transform-origin: 0; + } + `}show(){this.visible||(this.visible=!0,this.installStyleElement(),this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=Math.min(1,Math.max(this.minValue,e)),this.refresh()}installStyleElement(){document.head.prepend(this.styleElement)}installProgressElement(){this.progressElement.style.setProperty("--progress",String(0)),this.progressElement.style.opacity="1",document.body.prepend(this.progressElement),this.progressElement.scrollTop=0,this.setValue(Math.random()*this.initialValue)}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,1.5*this.animationDuration)}uninstallProgressElement(){this.progressElement.remove()}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,this.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.setProperty("--progress",String(this.value))})}createStyleElement(){let e=document.createElement("style");return this.styleAttr.split(" ").forEach(n=>e.setAttribute(n,"")),e.textContent=this.defaultStyles,e}createProgressElement(){let e=document.createElement("div");return e.className=this.className,e.setAttribute("aria-hidden","true"),e}},Tt=class extends ge{constructor(e={}){super(),this.name="SwupProgressPlugin",this.defaults={className:"swup-progress-bar",delay:300,transition:300,minValue:.1,initialValue:.25,finishAnimation:!0},this.options=void 0,this.progressBar=void 0,this.showProgressBarTimeout=void 0,this.hideProgressBarTimeout=void 0,this.options=Un({},this.defaults,e);let{className:n,minValue:r,initialValue:i,transition:s}=this.options;this.progressBar=new jn({className:n,minValue:r,initialValue:i,animationDuration:s})}mount(){this.on("visit:start",this.startShowingProgress),this.on("page:view",this.stopShowingProgress)}startShowingProgress(){this.progressBar.setValue(0),this.showProgressBarAfterDelay()}stopShowingProgress(){this.progressBar.setValue(1),this.options.finishAnimation?this.finishAnimationAndHideProgressBar():this.hideProgressBar()}showProgressBar(){this.cancelHideProgressBarTimeout(),this.progressBar.show()}showProgressBarAfterDelay(){this.cancelShowProgressBarTimeout(),this.cancelHideProgressBarTimeout(),this.showProgressBarTimeout=window.setTimeout(this.showProgressBar.bind(this),this.options.delay)}hideProgressBar(){this.cancelShowProgressBarTimeout(),this.progressBar.hide()}finishAnimationAndHideProgressBar(){this.cancelShowProgressBarTimeout(),this.hideProgressBarTimeout=window.setTimeout(this.hideProgressBar.bind(this),this.options.transition)}cancelShowProgressBarTimeout(){window.clearTimeout(this.showProgressBarTimeout),delete this.showProgressBarTimeout}cancelHideProgressBarTimeout(){window.clearTimeout(this.hideProgressBarTimeout),delete this.hideProgressBarTimeout}};!A&&window.location.protocol!=="file:"&&new _t({animationSelector:!1,containers:["#main"],ignoreVisit:t=>{let e=t.split("#")[0];return e===window.location.pathname||e===window.location.pathname+".html"},linkSelector:'a[href]:not([href^="/"]):not([href^="http"])',plugins:[new Lt,new Tt({delay:500})]});})(); +/*! 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 + *) +*/ From c24dbc758e293d11b1ebeb232b0b18ad7427f1bb Mon Sep 17 00:00:00 2001 From: James Harton Date: Fri, 31 Jan 2025 09:06:25 +1300 Subject: [PATCH 2/5] improvement: shorten package filter. --- assets/js/search-page.js | 4 ++-- formatters/html/dist/{html-XTJIJCYG.js => html-3VPR65AO.js} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename formatters/html/dist/{html-XTJIJCYG.js => html-3VPR65AO.js} (93%) diff --git a/assets/js/search-page.js b/assets/js/search-page.js index 1ab40b3f5..8cdbd8d49 100644 --- a/assets/js/search-page.js +++ b/assets/js/search-page.js @@ -71,12 +71,12 @@ async function remoteSearch (value, queryType, searchNodes) { filterNodes = searchNodes.slice(0, 1) } - const filters = filterNodes.map(node => `package:=${node.name}-${node.version}`).join(' || ') + const filters = filterNodes.map(node => `${node.name}-${node.version}`).join(',') const params = new URLSearchParams() params.set('q', value) params.set('query_by', 'title,doc') - params.set('filter_by', filters) + params.set('filter_by', `package:=[${filters}]`) const response = await fetch(`https://search.hexdocs.pm/?${params.toString()}`) const payload = await response.json() diff --git a/formatters/html/dist/html-XTJIJCYG.js b/formatters/html/dist/html-3VPR65AO.js similarity index 93% rename from formatters/html/dist/html-XTJIJCYG.js rename to formatters/html/dist/html-3VPR65AO.js index 15021520e..1e92775a0 100644 --- a/formatters/html/dist/html-XTJIJCYG.js +++ b/formatters/html/dist/html-3VPR65AO.js @@ -101,7 +101,7 @@ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-contr `},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o=e??(t.nullContext||{}),a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return`

`+((s=a(n,"if").call(o,e!=null?a(e,"value"):e,{name:"if",hash:{},fn:t.program(1,i,0),inverse:t.program(3,i,0),data:i,loc:{start:{line:2,column:2},end:{line:6,column:9}}}))!=null?s:"")+`

-`+((s=(a(n,"isNonEmptyArray")||e&&a(e,"isNonEmptyArray")||t.hooks.helperMissing).call(o,e!=null?a(e,"results"):e,{name:"isNonEmptyArray",hash:{},fn:t.program(5,i,0),inverse:t.program(9,i,0),data:i,loc:{start:{line:9,column:0},end:{line:44,column:20}}}))!=null?s:"")},useData:!0});var wt=80,Rl="#search";V.default.tokenizer.separator=/\s+/;V.default.QueryLexer.termSeparator=/\s+/;V.default.Pipeline.registerFunction(ss,"docTokenSplitter");V.default.Pipeline.registerFunction(os,"docTrimmer");window.addEventListener("swup:page:view",rs);rs();function rs(){let t=window.location.pathname;if(t.endsWith("/search.html")||t.endsWith("/search")){let e=Ot("q"),n=Ot("type");Ml(e,n)}}async function Ml(t,e){if(he(t))xn({value:t});else{Vi(t);try{let n=[],r=Jn();["related","latest"].includes(e)&&r.length>0?n=await Nl(t,e,r):n=await Hl(t),xn({value:t,results:n})}catch(n){xn({value:t,errorMessage:n.message})}}}async function Hl(t){let e=await Dl(),n=t.replaceAll(/(\B|\\):/g,"\\:");return zl(e.search(n))}async function Nl(t,e,n){let r=n;e==="latest"&&(r=n.slice(0,1));let i=r.map(l=>`package:=${l.name}-${l.version}`).join(" || "),s=new URLSearchParams;s.set("q",t),s.set("query_by","title,doc"),s.set("filter_by",i);let a=await(await fetch(`https://search.hexdocs.pm/?${s.toString()}`)).json();return Array.isArray(a.hits)?a.hits.map(l=>{let[u,c]=l.document.package.split("-"),d=l.document.doc,h=[d],f={},m=`https://hexdocs.pm/${u}/${c}/${l.document.ref}`,g=l.document.title,v=l.document.type;return{doc:d,excerpts:h,metadata:f,ref:m,title:g,type:v}}):[]}function xn({value:t,results:e,errorMessage:n}){let r=p(Rl),i=ts({value:t,results:e,errorMessage:n});r.innerHTML=i}async function Dl(){let t=await Bl();if(t)return t;let e=Ul();return Ql(e),e}async function Bl(){try{let t=sessionStorage.getItem(is());if(t){let e=await Fl(t);return V.default.Index.load(e)}else return null}catch(t){return console.error("Failed to load index: ",t),null}}async function Ql(t){try{let e=await ql(t);sessionStorage.setItem(is(),e)}catch(e){console.error("Failed to save index: ",e)}}async function ql(t){let e=new Blob([JSON.stringify(t)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),r=await(await new Response(e).blob()).arrayBuffer();return Vl(r)}async function Fl(t){let e=new Blob([$l(t)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(e).text();return JSON.parse(n)}function Vl(t){let e="",n=new Uint8Array(t),r=n.byteLength;for(let i=0;i{this.add(t)})})}function jl(t){t.pipeline.before(V.default.stemmer,ss)}function ss(t){let e=[t],n=/\/\d+$/,r=/\:|\./,i=t.toString();if(i.replace(/^[.,;?!]+|[.,;]+$/g,""),i.startsWith("`")&&i.endsWith("`")&&(i=i.slice(1,-1)),n.test(i)){let o=t.toString().replace(n,"");e.push(t.clone().update(()=>o));let a=o.split(r);if(a.length>1){for(let u of a)e.push(t.clone().update(()=>u));let l=t.toString().split(r);e.push(t.clone().update(()=>l[l.length-1]))}i=a[a.length-1]}else i.startsWith("@")?(i=i.substring(1),e.push(t.clone().update(()=>i))):i.startsWith(":")&&(i=i.substring(1),e.push(t.clone().update(()=>i)));let s=i.split(/\_|\-/);if(s.length>1)for(let o of s)e.push(t.clone().update(()=>o));return e}function Wl(t){t.pipeline.before(V.default.stemmer,os)}function os(t){return t.update(function(e){return e.replace(/^[^@:\w]+/,"").replace(/[^\?\!\w]+$/,"")})}function zl(t){return t.filter(e=>ns(e.ref)).map(e=>{let n=ns(e.ref),r=e.matchData.metadata;return{...n,metadata:r,excerpts:Gl(n,r)}})}function ns(t){return searchData.items.find(e=>e.ref===t)||null}function Gl(t,e){let{doc:n}=t,i=Object.keys(e).filter(s=>"doc"in e[s]).map(s=>e[s].doc.position.map(([o,a])=>Kl(n,o,a))).reduce((s,o)=>s.concat(o),[]);return i.length===0?[n.slice(0,wt*2)+(wt*20?"...":"",t.slice(r,e),""+Re(t.slice(e,e+n))+"",t.slice(e+n,i),i{t.key==="Escape"&&ue()}),N.querySelector(".modal-close").addEventListener("click",ue),N.addEventListener("click",t=>{t.target===N&&ue()}))}function ls(t){if(!Sn)if(N.contains(t.target))kn=t.target;else{Sn=!0;let e=N.querySelectorAll(Yl);kn===e[0]?e[e.length-1].focus():e[0].focus(),Sn=!1,kn=document.activeElement}}function bt({title:t,body:e}){Jl(),_n=document.activeElement,document.addEventListener("focus",ls,!0),N.querySelector(".modal-title").innerHTML=t,N.querySelector(".modal-body").innerHTML=e,N.classList.add("shown"),N.focus()}function ue(){N?.classList.remove("shown"),document.removeEventListener("focus",ls,!0),_n?.focus(),_n=null}function us(){return Boolean(N?.classList.contains("shown"))}var cs='
';var Xl="https://hexdocs.pm/%%",Zl="https://www.erlang.org/doc/apps/%%",eu="https://hex.pm/api/packages?search=name:%%*",tu=".display-quick-switch",fs="#quick-switch-input",ps="#quick-switch-results",nu=300,ru=9,ms=["erts","asn1","common_test","compiler","crypto","debugger","dialyzer","diameter","edoc","eldap","erl_interface","et","eunit","ftp","inets","jinterface","kernel","megaco","mnesia","observer","odbc","os_mon","parsetools","public_key","reltool","runtime_tools","sasl","snmp","ssh","ssl","stdlib","syntax_tools","tftp","tools","wx","xmerl"],iu=["elixir","eex","ex_unit","hex","iex","logger","mix"].concat(ms).map(t=>({name:t})),gs=2,B={autocompleteResults:[],selectedIdx:null};A||(window.addEventListener("swup:page:view",ds),ds());function ds(){M(tu).forEach(t=>{t.addEventListener("click",Tn)})}function su(t){if(t.key==="Enter"){let e=t.target.value;au(e),t.preventDefault()}else t.key==="ArrowUp"?(hs(-1),t.preventDefault()):t.key==="ArrowDown"&&(hs(1),t.preventDefault())}function ou(t){let e=t.target.value;if(e.lengthn.json()).then(n=>{Array.isArray(n)&&(B.autocompleteResults=du(t,n),B.selectedIdx=null,p(fs).value.length>=gs&&cu(B.autocompleteResults))})}function cu(t){p(ps).replaceChildren(...t.map(({name:e},n)=>{let r=E("div",{class:"quick-switch-result","data-index":n},[e]);return r.addEventListener("click",()=>Ln(e)),r}))}function du(t,e){return iu.concat(e).filter(n=>n.name.toLowerCase().includes(t.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,ru)}function hs(t){B.selectedIdx=hu(t);let e=p(".quick-switch-result.selected"),n=p(`.quick-switch-result[data-index="${B.selectedIdx}"]`);e&&e.classList.remove("selected"),n&&n.classList.add("selected")}function hu(t){let e=B.autocompleteResults.length;if(B.selectedIdx===null){if(t>=0)return 0;if(t<0)return e-1}return(B.selectedIdx+t+e)%e}var fu="#settings-modal-content",In=[{key:"c",description:"Toggle sidebar",action:Ue},{key:"n",description:"Cycle themes",action:hr},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:Pn},{key:"/",action:Pn},{key:"k",hasModifier:!0,action:Pn},{key:"v",description:"Open/focus version select",action:gu},{key:"g",description:"Go to package docs",displayAs:"g",action:Tn},{key:"?",displayAs:"?",description:"Bring up this modal",action:vu}],On={shortcutBeingPressed:null};A||(document.addEventListener("keydown",pu),document.addEventListener("keyup",mu));function pu(t){if(On.shortcutBeingPressed||t.target.matches("input, select, textarea"))return;let e=In.find(n=>n.hasModifier?De()&&t.metaKey||t.ctrlKey?n.key===t.key:!1:t.ctrlKey||t.metaKey||t.altKey?!1:n.key===t.key);e&&(On.shortcutBeingPressed=e,t.preventDefault(),e.action(t))}function mu(t){On.shortcutBeingPressed=null}function Pn(t){ue(),wn()}function gu(){ue(),Pr()?dn():Ar().then(dn)}function vu(){yu()?ue():An()}function yu(){return us()&&p(fu)}var vs=Y(ae());var ys=vs.template({1:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"description"):e,{name:"if",hash:{},fn:t.program(2,i,0),inverse:t.noop,data:i,loc:{start:{line:40,column:6},end:{line:53,column:13}}}))!=null?s:""},2:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
+`+((s=(a(n,"isNonEmptyArray")||e&&a(e,"isNonEmptyArray")||t.hooks.helperMissing).call(o,e!=null?a(e,"results"):e,{name:"isNonEmptyArray",hash:{},fn:t.program(5,i,0),inverse:t.program(9,i,0),data:i,loc:{start:{line:9,column:0},end:{line:44,column:20}}}))!=null?s:"")},useData:!0});var wt=80,Rl="#search";V.default.tokenizer.separator=/\s+/;V.default.QueryLexer.termSeparator=/\s+/;V.default.Pipeline.registerFunction(ss,"docTokenSplitter");V.default.Pipeline.registerFunction(os,"docTrimmer");window.addEventListener("swup:page:view",rs);rs();function rs(){let t=window.location.pathname;if(t.endsWith("/search.html")||t.endsWith("/search")){let e=Ot("q"),n=Ot("type");Ml(e,n)}}async function Ml(t,e){if(he(t))xn({value:t});else{Vi(t);try{let n=[],r=Jn();["related","latest"].includes(e)&&r.length>0?n=await Nl(t,e,r):n=await Hl(t),xn({value:t,results:n})}catch(n){xn({value:t,errorMessage:n.message})}}}async function Hl(t){let e=await Dl(),n=t.replaceAll(/(\B|\\):/g,"\\:");return zl(e.search(n))}async function Nl(t,e,n){let r=n;e==="latest"&&(r=n.slice(0,1));let i=r.map(l=>`${l.name}-${l.version}`).join(","),s=new URLSearchParams;s.set("q",t),s.set("query_by","title,doc"),s.set("filter_by",`package:=[${i}]`);let a=await(await fetch(`https://search.hexdocs.pm/?${s.toString()}`)).json();return Array.isArray(a.hits)?a.hits.map(l=>{let[u,c]=l.document.package.split("-"),d=l.document.doc,h=[d],f={},m=`https://hexdocs.pm/${u}/${c}/${l.document.ref}`,g=l.document.title,v=l.document.type;return{doc:d,excerpts:h,metadata:f,ref:m,title:g,type:v}}):[]}function xn({value:t,results:e,errorMessage:n}){let r=p(Rl),i=ts({value:t,results:e,errorMessage:n});r.innerHTML=i}async function Dl(){let t=await Bl();if(t)return t;let e=Ul();return Ql(e),e}async function Bl(){try{let t=sessionStorage.getItem(is());if(t){let e=await Fl(t);return V.default.Index.load(e)}else return null}catch(t){return console.error("Failed to load index: ",t),null}}async function Ql(t){try{let e=await ql(t);sessionStorage.setItem(is(),e)}catch(e){console.error("Failed to save index: ",e)}}async function ql(t){let e=new Blob([JSON.stringify(t)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),r=await(await new Response(e).blob()).arrayBuffer();return Vl(r)}async function Fl(t){let e=new Blob([$l(t)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(e).text();return JSON.parse(n)}function Vl(t){let e="",n=new Uint8Array(t),r=n.byteLength;for(let i=0;i{this.add(t)})})}function jl(t){t.pipeline.before(V.default.stemmer,ss)}function ss(t){let e=[t],n=/\/\d+$/,r=/\:|\./,i=t.toString();if(i.replace(/^[.,;?!]+|[.,;]+$/g,""),i.startsWith("`")&&i.endsWith("`")&&(i=i.slice(1,-1)),n.test(i)){let o=t.toString().replace(n,"");e.push(t.clone().update(()=>o));let a=o.split(r);if(a.length>1){for(let u of a)e.push(t.clone().update(()=>u));let l=t.toString().split(r);e.push(t.clone().update(()=>l[l.length-1]))}i=a[a.length-1]}else i.startsWith("@")?(i=i.substring(1),e.push(t.clone().update(()=>i))):i.startsWith(":")&&(i=i.substring(1),e.push(t.clone().update(()=>i)));let s=i.split(/\_|\-/);if(s.length>1)for(let o of s)e.push(t.clone().update(()=>o));return e}function Wl(t){t.pipeline.before(V.default.stemmer,os)}function os(t){return t.update(function(e){return e.replace(/^[^@:\w]+/,"").replace(/[^\?\!\w]+$/,"")})}function zl(t){return t.filter(e=>ns(e.ref)).map(e=>{let n=ns(e.ref),r=e.matchData.metadata;return{...n,metadata:r,excerpts:Gl(n,r)}})}function ns(t){return searchData.items.find(e=>e.ref===t)||null}function Gl(t,e){let{doc:n}=t,i=Object.keys(e).filter(s=>"doc"in e[s]).map(s=>e[s].doc.position.map(([o,a])=>Kl(n,o,a))).reduce((s,o)=>s.concat(o),[]);return i.length===0?[n.slice(0,wt*2)+(wt*20?"...":"",t.slice(r,e),""+Re(t.slice(e,e+n))+"",t.slice(e+n,i),i{t.key==="Escape"&&ue()}),N.querySelector(".modal-close").addEventListener("click",ue),N.addEventListener("click",t=>{t.target===N&&ue()}))}function ls(t){if(!Sn)if(N.contains(t.target))kn=t.target;else{Sn=!0;let e=N.querySelectorAll(Yl);kn===e[0]?e[e.length-1].focus():e[0].focus(),Sn=!1,kn=document.activeElement}}function bt({title:t,body:e}){Jl(),_n=document.activeElement,document.addEventListener("focus",ls,!0),N.querySelector(".modal-title").innerHTML=t,N.querySelector(".modal-body").innerHTML=e,N.classList.add("shown"),N.focus()}function ue(){N?.classList.remove("shown"),document.removeEventListener("focus",ls,!0),_n?.focus(),_n=null}function us(){return Boolean(N?.classList.contains("shown"))}var cs='
';var Xl="https://hexdocs.pm/%%",Zl="https://www.erlang.org/doc/apps/%%",eu="https://hex.pm/api/packages?search=name:%%*",tu=".display-quick-switch",fs="#quick-switch-input",ps="#quick-switch-results",nu=300,ru=9,ms=["erts","asn1","common_test","compiler","crypto","debugger","dialyzer","diameter","edoc","eldap","erl_interface","et","eunit","ftp","inets","jinterface","kernel","megaco","mnesia","observer","odbc","os_mon","parsetools","public_key","reltool","runtime_tools","sasl","snmp","ssh","ssl","stdlib","syntax_tools","tftp","tools","wx","xmerl"],iu=["elixir","eex","ex_unit","hex","iex","logger","mix"].concat(ms).map(t=>({name:t})),gs=2,B={autocompleteResults:[],selectedIdx:null};A||(window.addEventListener("swup:page:view",ds),ds());function ds(){M(tu).forEach(t=>{t.addEventListener("click",Tn)})}function su(t){if(t.key==="Enter"){let e=t.target.value;au(e),t.preventDefault()}else t.key==="ArrowUp"?(hs(-1),t.preventDefault()):t.key==="ArrowDown"&&(hs(1),t.preventDefault())}function ou(t){let e=t.target.value;if(e.lengthn.json()).then(n=>{Array.isArray(n)&&(B.autocompleteResults=du(t,n),B.selectedIdx=null,p(fs).value.length>=gs&&cu(B.autocompleteResults))})}function cu(t){p(ps).replaceChildren(...t.map(({name:e},n)=>{let r=E("div",{class:"quick-switch-result","data-index":n},[e]);return r.addEventListener("click",()=>Ln(e)),r}))}function du(t,e){return iu.concat(e).filter(n=>n.name.toLowerCase().includes(t.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,ru)}function hs(t){B.selectedIdx=hu(t);let e=p(".quick-switch-result.selected"),n=p(`.quick-switch-result[data-index="${B.selectedIdx}"]`);e&&e.classList.remove("selected"),n&&n.classList.add("selected")}function hu(t){let e=B.autocompleteResults.length;if(B.selectedIdx===null){if(t>=0)return 0;if(t<0)return e-1}return(B.selectedIdx+t+e)%e}var fu="#settings-modal-content",In=[{key:"c",description:"Toggle sidebar",action:Ue},{key:"n",description:"Cycle themes",action:hr},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:Pn},{key:"/",action:Pn},{key:"k",hasModifier:!0,action:Pn},{key:"v",description:"Open/focus version select",action:gu},{key:"g",description:"Go to package docs",displayAs:"g",action:Tn},{key:"?",displayAs:"?",description:"Bring up this modal",action:vu}],On={shortcutBeingPressed:null};A||(document.addEventListener("keydown",pu),document.addEventListener("keyup",mu));function pu(t){if(On.shortcutBeingPressed||t.target.matches("input, select, textarea"))return;let e=In.find(n=>n.hasModifier?De()&&t.metaKey||t.ctrlKey?n.key===t.key:!1:t.ctrlKey||t.metaKey||t.altKey?!1:n.key===t.key);e&&(On.shortcutBeingPressed=e,t.preventDefault(),e.action(t))}function mu(t){On.shortcutBeingPressed=null}function Pn(t){ue(),wn()}function gu(){ue(),Pr()?dn():Ar().then(dn)}function vu(){yu()?ue():An()}function yu(){return us()&&p(fu)}var vs=Y(ae());var ys=vs.template({1:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"description"):e,{name:"if",hash:{},fn:t.program(2,i,0),inverse:t.noop,data:i,loc:{start:{line:40,column:6},end:{line:53,column:13}}}))!=null?s:""},2:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
`+t.escapeExpression(t.lambda(e!=null?o(e,"description"):e,e))+`
From 26f72321bbfc64f1ca41089dec34202b01225be6 Mon Sep 17 00:00:00 2001 From: James Harton Date: Fri, 31 Jan 2025 09:44:40 +1300 Subject: [PATCH 3/5] improvement: Use existing match highlighter for search matches. --- assets/js/autocomplete/suggestions.js | 27 +-- assets/js/highlighter.js | 34 +++ assets/js/search-page.js | 47 ++-- formatters/html/dist/html-3VPR65AO.js | 223 ------------------ .../{html-6XHBGSGW.js => html-XEWS3Q4M.js} | 22 +- 5 files changed, 71 insertions(+), 282 deletions(-) create mode 100644 assets/js/highlighter.js delete mode 100644 formatters/html/dist/html-3VPR65AO.js rename formatters/html/dist/{html-6XHBGSGW.js => html-XEWS3Q4M.js} (60%) diff --git a/assets/js/autocomplete/suggestions.js b/assets/js/autocomplete/suggestions.js index e21777227..71fc04dbb 100644 --- a/assets/js/autocomplete/suggestions.js +++ b/assets/js/autocomplete/suggestions.js @@ -1,5 +1,6 @@ import { getSidebarNodes } from '../globals' -import { escapeRegexModifiers, escapeHtmlEntities, isBlank } from '../helpers' +import { isBlank } from '../helpers' +import { highlightMatches } from '../highlighter' /** * @typedef Suggestion @@ -285,27 +286,3 @@ function startsWith (text, subtext) { function tokenize (query) { return query.trim().split(/\s+/) } - -/** - * Returns an HTML string highlighting the individual tokens from the query string. - */ -function highlightMatches (text, query) { - // Sort terms length, so that the longest are highlighted first. - const terms = tokenize(query).sort((term1, term2) => term2.length - term1.length) - return highlightTerms(text, terms) -} - -function highlightTerms (text, terms) { - if (terms.length === 0) return text - - const [firstTerm, ...otherTerms] = terms - const match = text.match(new RegExp(`(.*)(${escapeRegexModifiers(firstTerm)})(.*)`, 'i')) - - if (match) { - const [, before, matching, after] = match - // Note: this has exponential complexity, but we expect just a few terms, so that's fine. - return highlightTerms(before, terms) + '' + escapeHtmlEntities(matching) + '' + highlightTerms(after, terms) - } else { - return highlightTerms(text, otherTerms) - } -} diff --git a/assets/js/highlighter.js b/assets/js/highlighter.js new file mode 100644 index 000000000..feebb160d --- /dev/null +++ b/assets/js/highlighter.js @@ -0,0 +1,34 @@ +import { escapeRegexModifiers, escapeHtmlEntities } from './helpers' + +/** + * Returns an HTML string highlighting the individual tokens from the query string. + */ +export function highlightMatches (text, query, opts = {}) { + // Sort terms length, so that the longest are highlighted first. + if (typeof query === 'string') { + query = query.split(/\s+/) + } + const terms = query.sort((term1, term2) => term2.length - term1.length) + return highlightTerms(text, terms, opts) +} + +function highlightTerms (text, terms, opts) { + if (terms.length === 0) return text + + let flags = 'i' + + if (opts.multiline) { + flags = 'is' + } + + const [firstTerm, ...otherTerms] = terms + const match = text.match(new RegExp(`(.*)(${escapeRegexModifiers(firstTerm)})(.*)`, flags)) + + if (match) { + const [, before, matching, after] = match + // Note: this has exponential complexity, but we expect just a few terms, so that's fine. + return highlightTerms(before, terms, opts) + '' + escapeHtmlEntities(matching) + '' + highlightTerms(after, terms, opts) + } else { + return highlightTerms(text, otherTerms, opts) + } +} diff --git a/assets/js/search-page.js b/assets/js/search-page.js index 8cdbd8d49..51158639c 100644 --- a/assets/js/search-page.js +++ b/assets/js/search-page.js @@ -5,6 +5,7 @@ import { qs, escapeHtmlEntities, isBlank, getQueryParamByName, getProjectNameAnd import { setSearchInputValue } from './search-bar' import searchResultsTemplate from './handlebars/templates/search-results.handlebars' import { getSearchNodes } from './globals' +import { highlightMatches } from './highlighter' const EXCERPT_RADIUS = 80 const SEARCH_CONTAINER_SELECTOR = '#search' @@ -23,7 +24,7 @@ lunr.Pipeline.registerFunction(docTrimmerFunction, 'docTrimmer') window.addEventListener('exdoc:loaded', initialize) -function initialize () { +function initialize() { const pathname = window.location.pathname if (pathname.endsWith('/search.html') || pathname.endsWith('/search')) { const query = getQueryParamByName('q') @@ -32,7 +33,7 @@ function initialize () { } } -async function search (value, queryType) { +async function search(value, queryType) { if (isBlank(value)) { renderResults({ value }) } else { @@ -55,7 +56,7 @@ async function search (value, queryType) { } } -async function localSearch (value) { +async function localSearch(value) { const index = await getIndex() // We cannot match on atoms :foo because that would be considered @@ -64,7 +65,7 @@ async function localSearch (value) { return searchResultsToDecoratedSearchItems(index.search(fixedValue)) } -async function remoteSearch (value, queryType, searchNodes) { +async function remoteSearch(value, queryType, searchNodes) { let filterNodes = searchNodes if (queryType === 'latest') { @@ -85,7 +86,7 @@ async function remoteSearch (value, queryType, searchNodes) { return payload.hits.map(result => { const [packageName, packageVersion] = result.document.package.split('-') - const doc = result.document.doc + const doc = highlightMatches(result.document.doc, value, { multiline: true }) const excerpts = [doc] const metadata = {} const ref = `https://hexdocs.pm/${packageName}/${packageVersion}/${result.document.ref}` @@ -106,13 +107,13 @@ async function remoteSearch (value, queryType, searchNodes) { } } -function renderResults ({ value, results, errorMessage }) { +function renderResults({ value, results, errorMessage }) { const searchContainer = qs(SEARCH_CONTAINER_SELECTOR) const resultsHtml = searchResultsTemplate({ value, results, errorMessage }) searchContainer.innerHTML = resultsHtml } -async function getIndex () { +async function getIndex() { const cachedIndex = await loadIndex() if (cachedIndex) { return cachedIndex } @@ -121,7 +122,7 @@ async function getIndex () { return index } -async function loadIndex () { +async function loadIndex() { try { const serializedIndex = sessionStorage.getItem(indexStorageKey()) if (serializedIndex) { @@ -136,7 +137,7 @@ async function loadIndex () { } } -async function saveIndex (index) { +async function saveIndex(index) { try { const serializedIndex = await compress(index) sessionStorage.setItem(indexStorageKey(), serializedIndex) @@ -145,7 +146,7 @@ async function saveIndex (index) { } } -async function compress (index) { +async function compress(index) { const stream = new Blob([JSON.stringify(index)], { type: 'application/json' }).stream().pipeThrough(new window.CompressionStream('gzip')) @@ -155,7 +156,7 @@ async function compress (index) { return b64encode(buffer) } -async function decompress (index) { +async function decompress(index) { const stream = new Blob([b64decode(index)], { type: 'application/json' }).stream().pipeThrough(new window.DecompressionStream('gzip')) @@ -164,7 +165,7 @@ async function decompress (index) { return JSON.parse(blob) } -function b64encode (buffer) { +function b64encode(buffer) { let binary = '' const bytes = new Uint8Array(buffer) const len = bytes.byteLength @@ -174,7 +175,7 @@ function b64encode (buffer) { return window.btoa(binary) } -function b64decode (str) { +function b64decode(str) { const binaryString = window.atob(str) const len = binaryString.length const bytes = new Uint8Array(new ArrayBuffer(len)) @@ -184,11 +185,11 @@ function b64decode (str) { return bytes } -function indexStorageKey () { +function indexStorageKey() { return `idv5:${getProjectNameAndVersion()}` } -function createIndex () { +function createIndex() { return lunr(function () { this.ref('ref') this.field('title', { boost: 3 }) @@ -206,11 +207,11 @@ function createIndex () { }) } -function docTokenSplitter (builder) { +function docTokenSplitter(builder) { builder.pipeline.before(lunr.stemmer, docTokenFunction) } -function docTokenFunction (token) { +function docTokenFunction(token) { // If we have something with an arity, we split on : . to make partial // matches easier. We split only when tokenizing, not when searching. // Below we use ExDoc.Markdown.to_ast/2 as an example. @@ -274,11 +275,11 @@ function docTokenFunction (token) { return tokens } -function docTrimmer (builder) { +function docTrimmer(builder) { builder.pipeline.before(lunr.stemmer, docTrimmerFunction) } -function docTrimmerFunction (token) { +function docTrimmerFunction(token) { // Preserve @ and : at the beginning of tokens, // and ? and ! at the end of tokens. It needs to // be done before stemming, otherwise search and @@ -288,7 +289,7 @@ function docTrimmerFunction (token) { }) } -function searchResultsToDecoratedSearchItems (results) { +function searchResultsToDecoratedSearchItems(results) { return results // If the docs are regenerated without changing its version, // a reference may have been doc'ed false in the code but @@ -305,11 +306,11 @@ function searchResultsToDecoratedSearchItems (results) { }) } -function getSearchItemByRef (ref) { +function getSearchItemByRef(ref) { return searchData.items.find(searchItem => searchItem.ref === ref) || null } -function getExcerpts (searchItem, metadata) { +function getExcerpts(searchItem, metadata) { const { doc } = searchItem const searchTerms = Object.keys(metadata) @@ -330,7 +331,7 @@ function getExcerpts (searchItem, metadata) { return excerpts.slice(0, 1) } -function excerpt (doc, sliceStart, sliceLength) { +function excerpt(doc, sliceStart, sliceLength) { const startPos = Math.max(sliceStart - EXCERPT_RADIUS, 0) const endPos = Math.min(sliceStart + sliceLength + EXCERPT_RADIUS, doc.length) return [ diff --git a/formatters/html/dist/html-3VPR65AO.js b/formatters/html/dist/html-3VPR65AO.js deleted file mode 100644 index 1e92775a0..000000000 --- a/formatters/html/dist/html-3VPR65AO.js +++ /dev/null @@ -1,223 +0,0 @@ -(()=>{var Ns=Object.create;var Wn=Object.defineProperty;var Ds=Object.getOwnPropertyDescriptor;var Bs=Object.getOwnPropertyNames;var Qs=Object.getPrototypeOf,qs=Object.prototype.hasOwnProperty;var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fs=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Bs(e))!qs.call(t,i)&&i!==n&&Wn(t,i,{get:()=>e[i],enumerable:!(r=Ds(e,i))||r.enumerable});return t};var Y=(t,e,n)=>(n=t!=null?Ns(Qs(t)):{},Fs(e||!t||!t.__esModule?Wn(n,"default",{value:t,enumerable:!0}):n,t));var vr=_((lc,gr)=>{var mr="Expected a function",fr=NaN,Ws="[object Symbol]",zs=/^\s+|\s+$/g,Gs=/^[-+]0x[0-9a-f]+$/i,Ks=/^0b[01]+$/i,Ys=/^0o[0-7]+$/i,Js=parseInt,Xs=typeof global=="object"&&global&&global.Object===Object&&global,Zs=typeof self=="object"&&self&&self.Object===Object&&self,eo=Xs||Zs||Function("return this")(),to=Object.prototype,no=to.toString,ro=Math.max,io=Math.min,Dt=function(){return eo.Date.now()};function so(t,e,n){var r,i,s,o,a,l,u=0,c=!1,d=!1,h=!0;if(typeof t!="function")throw new TypeError(mr);e=pr(e)||0,Fe(n)&&(c=!!n.leading,d="maxWait"in n,s=d?ro(pr(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function f(S){var R=r,U=i;return r=i=void 0,u=S,o=t.apply(U,R),o}function m(S){return u=S,a=setTimeout(w,e),c?f(S):o}function g(S){var R=S-l,U=S-u,ee=e-R;return d?io(ee,s-U):ee}function v(S){var R=S-l,U=S-u;return l===void 0||R>=e||R<0||d&&U>=s}function w(){var S=Dt();if(v(S))return x(S);a=setTimeout(w,g(S))}function x(S){return a=void 0,h&&r?f(S):(r=i=void 0,o)}function I(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function q(){return a===void 0?o:x(Dt())}function $(){var S=Dt(),R=v(S);if(r=arguments,i=this,l=S,R){if(a===void 0)return m(l);if(d)return a=setTimeout(w,e),f(l)}return a===void 0&&(a=setTimeout(w,e)),o}return $.cancel=I,$.flush=q,$}function oo(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(mr);return Fe(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),so(t,e,{leading:r,maxWait:e,trailing:i})}function Fe(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function ao(t){return!!t&&typeof t=="object"}function lo(t){return typeof t=="symbol"||ao(t)&&no.call(t)==Ws}function pr(t){if(typeof t=="number")return t;if(lo(t))return fr;if(Fe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Fe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(zs,"");var n=Ks.test(t);return n||Ys.test(t)?Js(t.slice(2),n?2:8):Gs.test(t)?fr:+t}gr.exports=oo});var F=_(D=>{"use strict";D.__esModule=!0;D.extend=Cr;D.indexOf=Eo;D.escapeExpression=xo;D.isEmpty=ko;D.createFrame=So;D.blockParams=_o;D.appendContextPath=Lo;var vo={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},yo=/[&<>"'`=]/g,wo=/[&<>"'`=]/;function bo(t){return vo[t]}function Cr(t){for(var e=1;e{"use strict";je.__esModule=!0;var Wt=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function zt(t,e){var n=e&&e.loc,r=void 0,i=void 0,s=void 0,o=void 0;n&&(r=n.start.line,i=n.end.line,s=n.start.column,o=n.end.column,t+=" - "+r+":"+s);for(var a=Error.prototype.constructor.call(this,t),l=0;l{"use strict";We.__esModule=!0;var Gt=F();We.default=function(t){t.registerHelper("blockHelperMissing",function(e,n){var r=n.inverse,i=n.fn;if(e===!0)return i(this);if(e===!1||e==null)return r(this);if(Gt.isArray(e))return e.length>0?(n.ids&&(n.ids=[n.name]),t.helpers.each(e,n)):r(this);if(n.data&&n.ids){var s=Gt.createFrame(n.data);s.contextPath=Gt.appendContextPath(n.data.contextPath,n.name),n={data:s}}return i(e,n)})};Hr.exports=We.default});var Br=_((ze,Dr)=>{"use strict";ze.__esModule=!0;function To(t){return t&&t.__esModule?t:{default:t}}var we=F(),Po=X(),Oo=To(Po);ze.default=function(t){t.registerHelper("each",function(e,n){if(!n)throw new Oo.default("Must pass iterator to #each");var r=n.fn,i=n.inverse,s=0,o="",a=void 0,l=void 0;n.data&&n.ids&&(l=we.appendContextPath(n.data.contextPath,n.ids[0])+"."),we.isFunction(e)&&(e=e.call(this)),n.data&&(a=we.createFrame(n.data));function u(m,g,v){a&&(a.key=m,a.index=g,a.first=g===0,a.last=!!v,l&&(a.contextPath=l+m)),o=o+r(e[m],{data:a,blockParams:we.blockParams([e[m],m],[l+m,null])})}if(e&&typeof e=="object")if(we.isArray(e))for(var c=e.length;s{"use strict";Ge.__esModule=!0;function Io(t){return t&&t.__esModule?t:{default:t}}var Ao=X(),Co=Io(Ao);Ge.default=function(t){t.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new Co.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};Qr.exports=Ge.default});var Ur=_((Ke,$r)=>{"use strict";Ke.__esModule=!0;function Ro(t){return t&&t.__esModule?t:{default:t}}var Fr=F(),Mo=X(),Vr=Ro(Mo);Ke.default=function(t){t.registerHelper("if",function(e,n){if(arguments.length!=2)throw new Vr.default("#if requires exactly one argument");return Fr.isFunction(e)&&(e=e.call(this)),!n.hash.includeZero&&!e||Fr.isEmpty(e)?n.inverse(this):n.fn(this)}),t.registerHelper("unless",function(e,n){if(arguments.length!=2)throw new Vr.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:n.inverse,inverse:n.fn,hash:n.hash})})};$r.exports=Ke.default});var Wr=_((Ye,jr)=>{"use strict";Ye.__esModule=!0;Ye.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],n=arguments[arguments.length-1],r=0;r{"use strict";Je.__esModule=!0;Je.default=function(t){t.registerHelper("lookup",function(e,n,r){return e&&r.lookupProperty(e,n)})};zr.exports=Je.default});var Yr=_((Xe,Kr)=>{"use strict";Xe.__esModule=!0;function Ho(t){return t&&t.__esModule?t:{default:t}}var be=F(),No=X(),Do=Ho(No);Xe.default=function(t){t.registerHelper("with",function(e,n){if(arguments.length!=2)throw new Do.default("#with requires exactly one argument");be.isFunction(e)&&(e=e.call(this));var r=n.fn;if(be.isEmpty(e))return n.inverse(this);var i=n.data;return n.data&&n.ids&&(i=be.createFrame(n.data),i.contextPath=be.appendContextPath(n.data.contextPath,n.ids[0])),r(e,{data:i,blockParams:be.blockParams([e],[i&&i.contextPath])})})};Kr.exports=Xe.default});var Kt=_(Ze=>{"use strict";Ze.__esModule=!0;Ze.registerDefaultHelpers=Xo;Ze.moveHelperToHooks=Zo;function se(t){return t&&t.__esModule?t:{default:t}}var Bo=Nr(),Qo=se(Bo),qo=Br(),Fo=se(qo),Vo=qr(),$o=se(Vo),Uo=Ur(),jo=se(Uo),Wo=Wr(),zo=se(Wo),Go=Gr(),Ko=se(Go),Yo=Yr(),Jo=se(Yo);function Xo(t){Qo.default(t),Fo.default(t),$o.default(t),jo.default(t),zo.default(t),Ko.default(t),Jo.default(t)}function Zo(t,e,n){t.helpers[e]&&(t.hooks[e]=t.helpers[e],n||delete t.helpers[e])}});var Xr=_((et,Jr)=>{"use strict";et.__esModule=!0;var ea=F();et.default=function(t){t.registerDecorator("inline",function(e,n,r,i){var s=e;return n.partials||(n.partials={},s=function(o,a){var l=r.partials;r.partials=ea.extend({},l,n.partials);var u=e(o,a);return r.partials=l,u}),n.partials[i.args[0]]=i.fn,s})};Jr.exports=et.default});var Zr=_(Yt=>{"use strict";Yt.__esModule=!0;Yt.registerDefaultDecorators=ia;function ta(t){return t&&t.__esModule?t:{default:t}}var na=Xr(),ra=ta(na);function ia(t){ra.default(t)}});var Jt=_((tt,ei)=>{"use strict";tt.__esModule=!0;var sa=F(),fe={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var n=sa.indexOf(fe.methodMap,e.toLowerCase());n>=0?e=n:e=parseInt(e,10)}return e},log:function(e){if(e=fe.lookupLevel(e),typeof console<"u"&&fe.lookupLevel(fe.level)<=e){var n=fe.methodMap[e];console[n]||(n="log");for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s{"use strict";Xt.__esModule=!0;Xt.createNewLookupObject=aa;var oa=F();function aa(){for(var t=arguments.length,e=Array(t),n=0;n{"use strict";Ee.__esModule=!0;Ee.createProtoAccessControl=da;Ee.resultIsAllowed=ha;Ee.resetLoggedProperties=pa;function la(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var ni=ti(),ua=Jt(),ca=la(ua),nt=Object.create(null);function da(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var n=Object.create(null);return n.__proto__=!1,{properties:{whitelist:ni.createNewLookupObject(n,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:ni.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}}function ha(t,e,n){return ri(typeof t=="function"?e.methods:e.properties,n)}function ri(t,e){return t.whitelist[e]!==void 0?t.whitelist[e]===!0:t.defaultValue!==void 0?t.defaultValue:(fa(e),!1)}function fa(t){nt[t]!==!0&&(nt[t]=!0,ca.log("error",'Handlebars: Access has been denied to resolve the property "'+t+`" because it is not an "own property" of its parent. -You can add a runtime option to disable the check or this warning: -See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function pa(){Object.keys(nt).forEach(function(t){delete nt[t]})}});var rn=_(j=>{"use strict";j.__esModule=!0;j.HandlebarsEnvironment=nn;function ii(t){return t&&t.__esModule?t:{default:t}}var oe=F(),ma=X(),en=ii(ma),ga=Kt(),va=Zr(),ya=Jt(),rt=ii(ya),wa=Zt(),ba="4.7.7";j.VERSION=ba;var Ea=8;j.COMPILER_REVISION=Ea;var xa=7;j.LAST_COMPATIBLE_COMPILER_REVISION=xa;var ka={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};j.REVISION_CHANGES=ka;var tn="[object Object]";function nn(t,e,n){this.helpers=t||{},this.partials=e||{},this.decorators=n||{},ga.registerDefaultHelpers(this),va.registerDefaultDecorators(this)}nn.prototype={constructor:nn,logger:rt.default,log:rt.default.log,registerHelper:function(e,n){if(oe.toString.call(e)===tn){if(n)throw new en.default("Arg not supported with multiple helpers");oe.extend(this.helpers,e)}else this.helpers[e]=n},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,n){if(oe.toString.call(e)===tn)oe.extend(this.partials,e);else{if(typeof n>"u")throw new en.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=n}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,n){if(oe.toString.call(e)===tn){if(n)throw new en.default("Arg not supported with multiple decorators");oe.extend(this.decorators,e)}else this.decorators[e]=n},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){wa.resetLoggedProperties()}};var Sa=rt.default.log;j.log=Sa;j.createFrame=oe.createFrame;j.logger=rt.default});var oi=_((it,si)=>{"use strict";it.__esModule=!0;function sn(t){this.string=t}sn.prototype.toString=sn.prototype.toHTML=function(){return""+this.string};it.default=sn;si.exports=it.default});var ai=_(on=>{"use strict";on.__esModule=!0;on.wrapHelper=_a;function _a(t,e){if(typeof t!="function")return t;var n=function(){var i=arguments[arguments.length-1];return arguments[arguments.length-1]=e(i),t.apply(this,arguments)};return n}});var hi=_(Z=>{"use strict";Z.__esModule=!0;Z.checkRevision=Aa;Z.template=Ca;Z.wrapProgram=st;Z.resolvePartial=Ra;Z.invokePartial=Ma;Z.noop=ci;function La(t){return t&&t.__esModule?t:{default:t}}function Ta(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var Pa=F(),z=Ta(Pa),Oa=X(),G=La(Oa),K=rn(),li=Kt(),Ia=ai(),ui=Zt();function Aa(t){var e=t&&t[0]||1,n=K.COMPILER_REVISION;if(!(e>=K.LAST_COMPATIBLE_COMPILER_REVISION&&e<=K.COMPILER_REVISION))if(e{"use strict";ot.__esModule=!0;ot.default=function(t){var e=typeof global<"u"?global:window,n=e.Handlebars;t.noConflict=function(){return e.Handlebars===t&&(e.Handlebars=n),t}};fi.exports=ot.default});var ae=_((at,yi)=>{"use strict";at.__esModule=!0;function ln(t){return t&&t.__esModule?t:{default:t}}function un(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var Ba=rn(),mi=un(Ba),Qa=oi(),qa=ln(Qa),Fa=X(),Va=ln(Fa),$a=F(),an=un($a),Ua=hi(),gi=un(Ua),ja=pi(),Wa=ln(ja);function vi(){var t=new mi.HandlebarsEnvironment;return an.extend(t,mi),t.SafeString=qa.default,t.Exception=Va.default,t.Utils=an,t.escapeExpression=an.escapeExpression,t.VM=gi,t.template=function(e){return gi.template(e,t)},t}var xe=vi();xe.create=vi;Wa.default(xe);xe.default=xe;at.default=xe;yi.exports=at.default});var Zi=_((Ji,Xi)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var c=t.utils.clone(n)||{};c.position=[a,u],c.index=s.length,s.push(new t.Token(r.slice(a,o),c))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?c+=2:a==l&&(n+=r[u+1]*i[c+1],u+=2,c+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=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 t.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 t.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 t.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 c=s.str.charAt(0),d=s.str.charAt(1),h;d in s.node.edges?h=s.node.edges[d]:(h=new t.TokenSet,s.node.edges[d]=h),s.str.length==1&&(h.final=!0),i.push({node:h,editsRemaining:s.editsRemaining-1,str:c+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;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()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.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=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.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 t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof Ji=="object"?Xi.exports=n():e.lunr=n()}(this,function(){return t})})()});var zn=new URLSearchParams(window.location.search),A=window.self!==window.parent,Gn=zn.has("preview"),Kn=zn.has("hint");function Ae(){return window.sidebarNodes||{}}function Yn(){return window.versionNodes||[]}function Jn(){return window.searchNodes||[]}var p=document.querySelector.bind(document),M=document.querySelectorAll.bind(document);function Xn(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Re(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function Me(){return document.getElementById("main").dataset.type}var Ce=["H1","H2","H3","H4","H5","H6"];function He(t=!1){let e=window.location.hash.replace(/^#/,"");if(!e)return t?document.getElementById("top-content"):null;let n=document.getElementById(e);if(!n)return null;if(n.matches(".detail"))return n;if(Ce.includes(n.tagName))return Pt(n);let r=Vs(n);return r||document.getElementById("top-content")}function Vs(t){let e=t.previousElementSibling;for(;e;){if(Ce.includes(e.tagName))return Pt(e);e=e.previousElementSibling}let n=t.parentNode;for(;n;){for(e=n.previousElementSibling;e;){if(Ce.includes(e.tagName))return Pt(e);e=e.previousElementSibling}n=n.parentNode}return null}function Pt(t){let e=document.createElement("div"),n=[t],r=t;for(;(r=r.nextSibling)&&!(Ce.includes(r.tagName)&&r.tagName<=t.tagName);)n.push(r);return e.append(...n),e}function Ot(t){return new URLSearchParams(window.location.search).get(t)}function It(t){return fetch(t).then(e=>e.ok).catch(()=>!1)}function he(t){return!t||t.trim()===""}function Zn(t,e){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{n=null,t(...i)},e)}}function Ne(){return document.head.querySelector("meta[name=project][content]").content}function De(){return document.documentElement.classList.contains("apple-os")}function E(t,e,n){let r=document.createElement(t);for(let i in e)e[i]!=null&&r.setAttribute(i,e[i]);return n&&r.replaceChildren(...n),r}if(Gn&&A){let t=He(!0);if(t){document.body.classList.add("preview"),document.getElementById("content").replaceChildren(...t.childNodes);let e=document.getElementsByTagName("a:not([target=_blank]");for(let n of e)n.setAttribute("target","_parent");window.scrollTo(0,0),document.body.style.position="fixed",setTimeout(er),window.addEventListener("resize",er)}}function er(){let t={type:"preview",contentHeight:document.getElementById("content").parentElement.offsetHeight};window.parent.postMessage(t,"*")}var ie={plain:"plain",function:"function",module:"module"},$s=[{href:"typespecs.html#basic-types",hint:{kind:ie.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:ie.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:ie.plain,description:"Built-in type"}}],Be={cancelHintFetching:null};function tr(t){if(rr(t))return!0;let e=/#.*\//;return t.includes("#")&&!e.test(t)?!1:t.includes(".html")}function nr(t){let e=rr(t);return e?Promise.resolve(e):Us(t)}function rr(t){let e=$s.find(n=>t.includes(n.href));return e?e.hint:null}function Us(t){let e=t.replace(".html",".html?hint=true");return new Promise((n,r)=>{let i=document.createElement("iframe");i.setAttribute("src",e),i.style.display="none";function s(a){let{href:l,hint:u}=a.data;e===l&&(o(),n(u))}Be.cancelHintFetching=()=>{o(),r(new Error("cancelled"))};function o(){i.remove(),window.removeEventListener("message",s),Be.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(i)})}function ir(){Be.cancelHintFetching&&Be.cancelHintFetching()}function sr(t){let n=t.querySelector("h1").textContent,r=t.querySelector(".docstring > p"),i=r?r.innerHTML:"";return{kind:ie.function,title:n.trim(),description:i.trim()}}function or(t){let n=t.querySelector("h1 > span").textContent,r=t.querySelector("#moduledoc p"),i=r?r.innerHTML:"";return{kind:ie.module,title:n.trim(),description:i.trim()}}if(Kn&&A){let t=He(),e=t?sr(t):["modules","tasks"].includes(Me())?or(p(".content-inner")):null;if(e){let n={hint:{...e,version:Ne()},href:window.location.href};window.parent.postMessage(n,"*")}p(".content-inner")?.replaceChildren()}var At="ex_doc:settings",ar="dark",Ct="system",Rt="dark",Mt="light";var js={tooltips:!0,theme:null,livebookUrl:null},Ht=class{constructor(){this._subscribers=[],this._settings=js,this._loadSettings()}get(){return this._settings}update(e){let n=this._settings;this._settings={...this._settings,...e},this._subscribers.forEach(r=>r(this._settings,n)),this._storeSettings()}getAndSubscribe(e){this._subscribers.push(e),e(this._settings)}_loadSettings(){try{let e=localStorage.getItem(At);if(e){let n=JSON.parse(e);this._settings={...this._settings,...n}}this._loadSettingsLegacy()}catch(e){console.error(`Failed to load settings: ${e}`)}}_storeSettings(){try{this._storeSettingsLegacy(),localStorage.setItem(At,JSON.stringify(this._settings))}catch(e){console.error(`Failed to persist settings: ${e}`)}}_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"))}},H=new Ht;var lr=!1,Qe=null,J=null;function ur(t){lr||(lr=!0,J=document.getElementById("toast"),J?.addEventListener("click",()=>{clearTimeout(Qe),J.classList.remove("show")})),J&&(clearTimeout(Qe),J.innerText=t,J.classList.add("show"),Qe=setTimeout(()=>{J.classList.remove("show"),Qe=setTimeout(function(){J.innerText=""},1e3)},5e3))}var Nt=[Ct,Rt,Mt],cr=window.matchMedia("(prefers-color-scheme: dark)");H.getAndSubscribe(dr);cr.addEventListener("change",dr);function dr(){let t=qe(),e=t===Rt||t!==Mt&&cr.matches;document.body.classList.toggle(ar,e)}function hr(){let t=Nt[Nt.indexOf(qe())+1]||Nt[0];H.update({theme:t}),ur(`Set theme to "${t}"`)}function qe(){return new URLSearchParams(window.location.search).get("theme")||H.get().theme||Ct}var Sr=Y(vr());var Bt="sidebar_state",Qt="closed",yr="open",wr="sidebar_width";var Ve="sidebar-open",$e="sidebar-transition";var br=!1;function Er(){if(br)return;br=!0;let t=document.getElementById("sidebar-list-nav");if(!t)return;let e=Me(),n={extras:t.dataset.extras||"Pages",modules:"Modules",tasks:'Mix Tasks'};Object.entries(n).forEach(([r,i])=>{let s=Ae()[r];if(!s?.length)return;let o=`${r}-list-tab-button`,a=`${r}-tab-panel`,l=r===e,u=E("button",{id:o,role:"tab",tabindex:l?0:-1,"aria-selected":l||void 0,"aria-controls":a});u.innerHTML=i,u.addEventListener("keydown",ho),u.addEventListener("click",fo),t.appendChild(E("li",{},[u]));let c=E("ul",{class:"full-list"});c.addEventListener("click",po);let d=E("div",{id:a,class:"sidebar-tabpanel",role:"tabpanel","aria-labelledby":o,hidden:l?void 0:""},[c]);document.getElementById("sidebar").appendChild(d);let h="",f,m;c.replaceChildren(...s.flatMap(g=>{let v=[],w=Array.isArray(g.headers),x=w?void 0:"no";return g.group!==h&&(v.push(E("li",{class:"group",translate:x},[g.group])),h=g.group,f=void 0),g.nested_context&&g.nested_context!==f?(f=g.nested_context,m!==f&&v.push(E("li",{class:"nesting-context",translate:"no","aria-hidden":!0},[f]))):m=g.title,v.push(E("li",{},[E("a",{href:`${g.id}.html`,translate:x},[g.nested_title||g.title]),...Ft(`node-${g.id}-headers`,w?uo(g):co(g))])),v}))}),window.addEventListener("hashchange",qt),window.addEventListener("swup:page:view",qt),qt(),requestAnimationFrame(xr)}function Ft(t,e){return e.length?[E("button",{"aria-label":"expand","aria-expanded":!1,"aria-controls":t}),E("ul",{id:t},e)]:[]}function uo(t){return t.headers.map(({id:e,anchor:n})=>E("li",{},[E("a",{href:`${t.id}.html#${n}`},[e])]))}function co(t){let e=[];return t.sections?.length&&e.push(E("li",{},[E("a",{href:`${t.id}.html#content`},["Sections"]),...Ft(`${t.id}-sections-list`,t.sections.map(({id:n,anchor:r})=>E("li",{},[E("a",{href:`${t.id}.html#${r}`},[n])])))])),t.nodeGroups&&(e.push(E("li",{},[E("a",{href:`${t.id}.html#summary`},["Summary"])])),e.push(...t.nodeGroups.map(({key:n,name:r,nodes:i})=>E("li",{},[E("a",{href:`${t.id}.html#${n}`},[r]),...Ft(`node-${t.id}-group-${n}-list`,i.map(({anchor:s,title:o,id:a})=>E("li",{},[E("a",{href:`${t.id}.html#${s}`,title:o,translate:"no"},[a])])))])))),e}function Vt(t){let e=document.getElementById("sidebar-list-nav").querySelector("[aria-selected]");e!==t&&(e&&(e.removeAttribute("aria-selected"),e.setAttribute("tabindex","-1"),document.getElementById(e.getAttribute("aria-controls")).setAttribute("hidden","hidden")),t.setAttribute("aria-selected","true"),t.setAttribute("tabindex","0"),document.getElementById(t.getAttribute("aria-controls")).removeAttribute("hidden"))}function xr(){p("#sidebar [role=tabpanel]:not([hidden]) a[aria-selected]")?.scrollIntoView()}function qt(){let t=document.getElementById("sidebar"),{pathname:e,hash:n}=window.location,r=e.split("/").pop().replace(/\.html$/,"")+".html",i=t.querySelector(`li a[href="${r+n}"]`)||t.querySelector(`li a[href="${r}"]`);if(!i)return;t.querySelectorAll(".full-list a[aria-selected]").forEach(o=>{o.removeAttribute("aria-selected")}),t.querySelectorAll(".full-list button[aria-expanded=true]").forEach(o=>{o.setAttribute("aria-expanded",!1)});let s=i.parentElement;for(;s;){if(s.tagName==="LI"){let o=s.firstChild;o.setAttribute("aria-selected",o.getAttribute("href")===r?"page":"true");let a=o.nextSibling;a?.tagName==="BUTTON"&&a.setAttribute("aria-expanded",!0)}else if(s.role==="tabpanel"){s.hasAttribute("hidden")&&Vt(document.getElementById(s.getAttribute("aria-labelledby")));break}s=s.parentElement}}function ho(t){if(!["ArrowRight","ArrowLeft"].includes(t.key))return;let e=Array.from(M('#sidebar-list-nav [role="tab"]')),r=e.indexOf(t.currentTarget)+(t.key==="ArrowRight"?1:-1),i=e.at(r%e.length);Vt(i),i.focus()}function fo(t){Vt(t.currentTarget),xr()}function po(t){let e=t.target;e.tagName==="BUTTON"&&e.setAttribute("aria-expanded",e.getAttribute("aria-expanded")==="false")}var go=300,_r=".sidebar-toggle",Lr=window.matchMedia(`screen and (max-width: ${768}px)`);if(!A){$t(),window.addEventListener("swup:page:view",$t);let t=document.getElementById("sidebar"),e=p(_r);e.addEventListener("click",Ue),document.body.addEventListener("click",i=>{Lr.matches&&Tr()&&!t.contains(i.target)&&!e.contains(i.target)&&Ue()});let n=window.innerWidth;window.addEventListener("resize",(0,Sr.default)(()=>{n!==window.innerWidth&&(n=window.innerWidth,$t())},100));let r=new ResizeObserver(([i])=>{if(!i)return;let s=i.contentRect.width;sessionStorage.setItem(wr,s),document.body.style.setProperty("--sidebarWidth",`${s}px`)});t.addEventListener("mousedown",()=>r.observe(t)),t.addEventListener("mouseup",()=>r.unobserve(t))}function $t(){let e=sessionStorage.getItem(Bt)!==Qt&&!Lr.matches;Or(e)}function Ue(){let t=!Tr();return sessionStorage.setItem(Bt,t?yr:Qt),Ir(t)}function Tr(){return document.body.classList.contains(Ve)}function Pr(){return document.body.classList.contains(Ve)&&!document.body.classList.contains($e)}function Or(t){t&&Er(),document.body.classList.toggle(Ve,t),p(_r).setAttribute("aria-expanded",t?"true":"false")}var kr;function Ir(t){return new Promise(e=>{document.body.classList.add($e),document.body.scrollTop,Or(t),clearTimeout(kr),kr=setTimeout(()=>{document.body.classList.remove($e),e()},go)})}function Ar(){return Ir(!0)}var wi=Y(ae());var cn=Y(ae());cn.registerHelper("isArray",function(t,e){return Array.isArray(t)?e.fn(this):e.inverse(this)});cn.registerHelper("isNonEmptyArray",function(t,e){return Array.isArray(t)&&t.length>0?e.fn(this):e.inverse(this)});var bi=wi.template({1:function(t,e,n,r,i){var s,o,a=e??(t.nullContext||{}),l=t.hooks.helperMissing,u="function",c=t.escapeExpression,d=t.lookupProperty||function(h,f){if(Object.prototype.hasOwnProperty.call(h,f))return h[f]};return' -`},2:function(t,e,n,r,i){return" selected disabled"},4:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return` -`},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o=e??(t.nullContext||{}),a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return`
- -`+((s=a(n,"if").call(o,e!=null?a(e,"latestVersion"):e,{name:"if",hash:{},fn:t.program(4,i,0),inverse:t.noop,data:i,loc:{start:{line:13,column:2},end:{line:20,column:9}}}))!=null?s:"")+`
-`},useData:!0});var za=".sidebar-projectVersion",Ei=".sidebar-projectVersionsDropdown";if(!A){let t=Yn(),e=p(za);if(t.length>0||!e){let n=e.textContent.trim(),i=(t.some(u=>u.version===n)?t:[{version:n,url:"#"},...t]).map(u=>({...u,isCurrentVersion:u.version===n})),s=t.find(u=>u.latest),o=s?.version!==n?s?.url:null;e.innerHTML=bi({nodes:i,latestVersion:o});let a=p(Ei);a.addEventListener("change",Ka),Ga(a);let l=p(".sidebar-staleVersion a");l&&l.addEventListener("click",Ya)}}function Ga(t){let e=document.createElement("span");e.style.visibility="hidden",e.style.position="absolute",e.style.whiteSpace="nowrap",e.style.font=window.getComputedStyle(t).font,e.textContent=t.options[t.selectedIndex].text,document.body.appendChild(e),t.style.width=`${e.offsetWidth+20}px`,document.body.removeChild(e)}function Ka(t){let e=t.target.value,n=window.location.pathname.split("/").pop()+window.location.hash,r=`${e}/${n}`;It(r).then(i=>{i?window.location.href=r:window.location.href=e})}function Ya(t){let e=this.href,n=window.location.pathname.split("/").pop()+window.location.hash,r=`${e}/${n}`;t.preventDefault(),It(r).then(i=>{i?window.location.href=r:window.location.href=e})}function dn(){let t=p(Ei);t&&(t.focus(),t.addEventListener("keydown",e=>{(e.key==="Escape"||e.key==="v")&&(e.preventDefault(),t.blur())}),navigator.userActivation.isActive&&"showPicker"in HTMLSelectElement.prototype&&t.showPicker())}var Ja="content",Xa="tabs-open",Za="tabs-close",el="H3",tl="tabset";window.addEventListener("swup:page:view",ki);ki();function ki(){let t=[],e=[],n=document.createNodeIterator(document.getElementById(Ja),NodeFilter.SHOW_COMMENT,i=>i.nodeValue.trim()===Xa?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT),r;for(;r=n.nextNode();){let i=[];t.push([r,i]);let s,o=r;for(;o=o.nextSibling;)if(o.nodeName===el){s=[];let a=o.querySelector(".text")?.childNodes||o.childNodes;i.push([a,s]),e.push(o)}else if(o.nodeName==="#comment"&&o.nodeValue.trim()===Za){e.push(o);break}else s&&s.push(o)}t.forEach(([i,s],o)=>{let a=E("div",{class:tl});i.parentNode.replaceChild(a,i);let l=E("div",{role:"tablist",class:"tabset-tablist"});a.appendChild(l),s.forEach(([u,c],d)=>{let h=d===0,f=`tab-${o}-${d}`,m=`tabpanel-${o}-${d}`,g=E("button",{role:"tab",id:f,class:"tabset-tab",tabindex:h?0:-1,"aria-selected":h,"aria-controls":m},u);g.addEventListener("click",nl),g.addEventListener("keydown",rl),l.appendChild(g);let v=E("div",{role:"tabpanel",id:m,class:"tabset-panel",hidden:h?void 0:"",tabindex:h?0:-1,"aria-labelledby":f},c);a.appendChild(v)})}),e.forEach(i=>{i.parentNode.removeChild(i)})}function nl(t){Si(t.currentTarget)}function rl(t){if(xi[t.code]){t.preventDefault();let e=[...t.currentTarget.parentNode.childNodes],n=e.indexOf(t.currentTarget),r=xi[t.code](n,e.length);Si(e.at(r%e.length))}}var xi={ArrowLeft:t=>t-1,ArrowRight:t=>t+1,Home:()=>0,End:(t,e)=>e-1};function Si(t){let e=t.parentNode.querySelector("[aria-selected=true]");if(e===t)return;e.setAttribute("aria-selected","false"),e.tabIndex=-1,t.setAttribute("aria-selected","true"),t.tabIndex=0,t.focus();let n=document.getElementById(e.getAttribute("aria-controls"));n.setAttribute("hidden",""),n.tabIndex=-1;let r=document.getElementById(t.getAttribute("aria-controls"));r.removeAttribute("hidden"),r.tabIndex=0}window.addEventListener("swup:page:view",_i);_i();function _i(){let t=window.location.pathname.replace(/(\.html)?$/,".livemd"),e=encodeURIComponent(new URL(t,window.location.href).toString());H.getAndSubscribe(({livebookUrl:n})=>{let r=n?`${n}/import?url=${e}`:`https://livebook.dev/run?url=${e}`;for(let i of M(".livebook-badge"))i.href=r})}var il="hll";window.addEventListener("swup:page:view",Ti);Ti();function Ti(){M("[data-group-id]").forEach(t=>{t.addEventListener("mouseenter",Li),t.addEventListener("mouseleave",Li)})}function Li(t){let e=t.currentTarget,n=t.type==="mouseenter",r=e.getAttribute("data-group-id");e.parentElement.querySelectorAll(`[data-group-id="${r}"]`).forEach(i=>{i.classList.toggle(il,n)})}var W={module:"module",moduleChild:"module-child",mixTask:"mix-task",extra:"extra",section:"section"};function Oi(t,e=8){if(he(t))return[];let n=Ae(),r=[...hn(n.modules,t,W.module,"module"),...sl(n.modules,t,W.moduleChild),...hn(n.tasks,t,W.mixTask,"mix task"),...hn(n.extras,t,W.extra,"page"),...fn(n.modules,t,W.section,"module"),...fn(n.tasks,t,W.section,"mix task"),...fn(n.extras,t,W.section,"page")].filter(i=>i!==null);return hl(r).slice(0,e)}function hn(t,e,n,r){return t.map(i=>i.searchData?null:al(i,e,n,r))}function sl(t,e,n){return t.filter(r=>r.nodeGroups).flatMap(r=>r.nodeGroups.flatMap(({key:i,nodes:s})=>{let o=dl(i);return s.map(a=>ll(a,r.id,e,n,o)||cl(a,r.id,e,n,o))}))}function fn(t,e,n,r){return t.flatMap(i=>ol(i).map(s=>ul(i,s,e,n,r)))}function ol(t){return t.searchData?t.searchData:(t.sections||[]).concat(t.headers||[])}function al(t,e,n,r){return ut(t.title,e)?{link:`${t.id}.html`,title:ht(t.title,e),description:null,matchQuality:ct(t.title,e),deprecated:t.deprecated,labels:[r],category:n}:null}function ll(t,e,n,r,i){return ut(t.id,n)?{link:`${e}.html#${t.anchor}`,title:ht(t.id,n),labels:[i],description:e,matchQuality:ct(t.id,n),deprecated:t.deprecated,category:r}:null}function ul(t,e,n,r,i){if(!Ii(e.id,n))return null;let s;return e.anchor===""?s=`${t.id}.html`:s=`${t.id}.html#${e.anchor}`,{link:s,title:ht(e.id,n),description:t.title,matchQuality:ct(e.id,n),labels:e.labels||[i,"section"],category:r}}function cl(t,e,n,r,i){let s=`${e}.${t.id}`,o=`${e}:${t.id}`,a,l;if(ut(s,n))a=s,l=/\./g;else if(ut(o,n))a=o,l=/:/g;else return null;let u=n.replace(l," ");return Ii(t.id,u)?{link:`${e}.html#${t.anchor}`,title:ht(t.id,u),label:i,description:e,matchQuality:ct(a,n),deprecated:t.deprecated,category:r}:null}function dl(t){switch(t){case"callbacks":return"callback";case"types":return"type";default:return"function"}}function hl(t){return t.slice().sort((e,n)=>e.matchQuality!==n.matchQuality?n.matchQuality-e.matchQuality:Pi(e.category)-Pi(n.category))}function Pi(t){switch(t){case W.module:return 1;case W.moduleChild:return 2;case W.mixTask:return 3;default:return 4}}function Ii(t,e){return dt(e).some(r=>Ai(t,r))}function ut(t,e){return dt(e).every(r=>Ai(t,r))}function Ai(t,e){return t.toLowerCase().includes(e.toLowerCase())}function ct(t,e){let n=dt(e),i=n.map(o=>o.length).reduce((o,a)=>o+a,0)/t.length,s=fl(t,n[0])?1:0;return i+s}function fl(t,e){return t.toLowerCase().startsWith(e.toLowerCase())}function dt(t){return t.trim().split(/\s+/)}function ht(t,e){let n=dt(e).sort((r,i)=>i.length-r.length);return lt(t,n)}function lt(t,e){if(e.length===0)return t;let[n,...r]=e,i=t.match(new RegExp(`(.*)(${Xn(n)})(.*)`,"i"));if(i){let[,s,o,a]=i;return lt(s,e)+""+Re(o)+""+lt(a,e)}else return lt(t,r)}var Ci=Y(ae());var Ri=Ci.template({1:function(t,e,n,r,i){var s,o,a=e??(t.nullContext||{}),l=t.hooks.helperMissing,u="function",c=t.escapeExpression,d=t.lookupProperty||function(h,f){if(Object.prototype.hasOwnProperty.call(h,f))return h[f]};return' -
-`+((s=d(n,"if").call(a,e!=null?d(e,"deprecated"):e,{name:"if",hash:{},fn:t.program(2,i,0),inverse:t.program(4,i,0),data:i,loc:{start:{line:16,column:10},end:{line:20,column:17}}}))!=null?s:"")+` -`+((s=d(n,"each").call(a,e!=null?d(e,"labels"):e,{name:"each",hash:{},fn:t.program(6,i,0),inverse:t.noop,data:i,loc:{start:{line:22,column:10},end:{line:24,column:19}}}))!=null?s:"")+`
- -
-
- -
-
- -`+((s=d(n,"if").call(a,e!=null?d(e,"description"):e,{name:"if",hash:{},fn:t.program(8,i,0),inverse:t.noop,data:i,loc:{start:{line:39,column:8},end:{line:43,column:15}}}))!=null?s:"")+`
-`},2:function(t,e,n,r,i){var s,o,a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return' '+((s=(o=(o=a(n,"title")||(e!=null?a(e,"title"):e))!=null?o:t.hooks.helperMissing,typeof o=="function"?o.call(e??(t.nullContext||{}),{name:"title",hash:{},data:i,loc:{start:{line:17,column:49},end:{line:17,column:60}}}):o))!=null?s:"")+` -`},4:function(t,e,n,r,i){var s,o,a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return' '+((s=(o=(o=a(n,"title")||(e!=null?a(e,"title"):e))!=null?o:t.hooks.helperMissing,typeof o=="function"?o.call(e??(t.nullContext||{}),{name:"title",hash:{},data:i,loc:{start:{line:19,column:46},end:{line:19,column:57}}}):o))!=null?s:"")+` -`},6:function(t,e,n,r,i){return' '+t.escapeExpression(t.lambda(e,e))+` -`},8:function(t,e,n,r,i){var s,o,a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return`
- `+((s=(o=(o=a(n,"description")||(e!=null?a(e,"description"):e))!=null?o:t.hooks.helperMissing,typeof o=="function"?o.call(e??(t.nullContext||{}),{name:"description",hash:{},data:i,loc:{start:{line:41,column:10},end:{line:41,column:27}}}):o))!=null?s:"")+` -
-`},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o,a=e??(t.nullContext||{}),l=t.lookupProperty||function(u,c){if(Object.prototype.hasOwnProperty.call(u,c))return u[c]};return`
-
-
-
- - Autocompletion results for "`+t.escapeExpression((o=(o=l(n,"term")||(e!=null?l(e,"term"):e))!=null?o:t.hooks.helperMissing,typeof o=="function"?o.call(a,{name:"term",hash:{},data:i,loc:{start:{line:6,column:55},end:{line:6,column:63}}}):o))+`" - - - Press RETURN for full-text search, TAB for previews - -
-
-`+((s=l(n,"each").call(a,e!=null?l(e,"suggestions"):e,{name:"each",hash:{},fn:t.program(1,i,0),inverse:t.noop,data:i,loc:{start:{line:13,column:6},end:{line:45,column:15}}}))!=null?s:"")+`
-
-
-`},useData:!0});var pe=".autocomplete",pt=".autocomplete-suggestions",ft=".autocomplete-suggestion",C={autocompleteSuggestions:[],previewOpen:!1,selectedIdx:-1};function pl(){p(pe).classList.add("shown")}function pn(){p(pe).classList.remove("shown")}function Mi(){return p(pe).classList.contains("shown")}function mn(t){C.autocompleteSuggestions=Oi(t),C.selectedIdx=-1,he(t)?pn():(ml({term:t,suggestions:C.autocompleteSuggestions}),mt(0),pl())}function ml({term:t,suggestions:e}){let n=Ri({suggestions:e,term:t}),r=p(pe);r.innerHTML=n}function gn(){return C.selectedIdx===-1?null:C.autocompleteSuggestions[C.selectedIdx]}function mt(t){Ni(gl(t))}function Hi(t){if(t.data.type==="preview"){let{contentHeight:e}=t.data,n=p(".autocomplete-preview");n&&(n.style.height=`${e+32}px`,n.classList.remove("loading"))}}function Ni(t){C.selectedIdx=t;let e=p(pt),n=p(`${ft}.selected`),r=p(`${ft}[data-index="${C.selectedIdx}"]`);if(n&&n.classList.remove("selected"),r){if(C.previewOpen){Bi(),window.addEventListener("message",Hi),e.classList.add("previewing");let i=document.createElement("div");i.classList.add("autocomplete-preview"),i.classList.add("loading");let s=r.href.replace(".html",`.html?preview=true&theme=${qe()}`),o=document.createElement("iframe");o.setAttribute("src",s),i.appendChild(document.createElement("div")),i.appendChild(document.createElement("span")),i.appendChild(o),r.parentNode.insertBefore(i,r.nextSibling)}r.classList.add("selected"),r.scrollIntoView({block:"nearest"})}else e&&(e.scrollTop=0)}function Di(){C.previewOpen?gt():vn()}function gt(){C.previewOpen=!1;let t=p(pt);t&&t.classList.remove("previewing"),Bi()}function vn(t){C.previewOpen=!0,t?t=t.closest(ft):t=p(`${ft}[data-index="${C.selectedIdx}"]`),t&&Ni(parseInt(t.dataset.index))}function Bi(){let t=p(".autocomplete-preview");t&&(t.remove(),window.removeEventListener("message",Hi))}function gl(t){let e=C.autocompleteSuggestions.length+1;return(C.selectedIdx+t+1+e)%e-1}var ke="form.search-bar input",vl="form.search-bar .search-close-button";A||(window.addEventListener("swup:page:view",Qi),Qi());function Qi(){yl(),window.onTogglePreviewClick=function(t,e){t.preventDefault(),t.stopImmediatePropagation(),wn(),e?vn(t.target):gt()}}function Vi(t){let e=p(ke);e.value=t}function wn(){let t=p(ke);document.body.classList.add("search-focused"),t.focus()}function yl(){let t=p(ke);if(document.querySelector('meta[name="exdoc:autocomplete"][content="off"]'))return t.addEventListener("keydown",e=>{e.key==="Enter"&&qi(e)}),!0;t.addEventListener("keydown",e=>{let n=De();e.key==="Escape"?(vt(),t.blur()):e.key==="Enter"?qi(e):e.key==="ArrowUp"||n&&e.ctrlKey&&e.key==="p"?(mt(-1),e.preventDefault()):e.key==="ArrowDown"||n&&e.ctrlKey&&e.key==="n"?(mt(1),e.preventDefault()):e.key==="Tab"&&gn()!==null&&(Di(),e.preventDefault())}),t.addEventListener("input",e=>{mn(e.target.value)}),t.addEventListener("focus",e=>{document.body.classList.contains("search-focused")||(document.body.classList.add("search-focused"),mn(e.target.value))}),t.addEventListener("blur",e=>{let n=e.relatedTarget,r=p(pt);if(n&&r&&r.contains(n))return setTimeout(()=>{Mi()&&t.focus()},1e3),null;yt()}),p(pe).addEventListener("click",e=>{e.shiftKey||e.ctrlKey?t.focus():(vt(),yt())}),p(vl).addEventListener("click",e=>{vt(),yt()})}function qi(t){let e=p(ke),n=t.shiftKey||t.ctrlKey,r=gn();t.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(e.value)}`)}s.click(),n||(vt(),yt())}function vt(){let t=p(ke);t.value=""}function yt(){gt(),document.body.classList.remove("search-focused"),pn()}var yn,Fi=2;window.addEventListener("scroll",function(){let t=window.scrollY;if(yn!==void 0){let e=t-yn;t===0||e>Fi?document.body.classList.remove("scroll-sticky"):t>0&&-e>Fi&&document.body.classList.add("scroll-sticky")}yn=Math.max(0,t)},!1);var $i=Y(ae());var Ui=$i.template({1:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
- `+t.escapeExpression(t.lambda((s=e!=null?o(e,"hint"):e)!=null?o(s,"description"):s,e))+` -
-`},3:function(t,e,n,r,i){var s,o=t.lambda,a=t.escapeExpression,l=t.lookupProperty||function(u,c){if(Object.prototype.hasOwnProperty.call(u,c))return u[c]};return`
-

- `+a(o((s=e!=null?l(e,"hint"):e)!=null?l(s,"title"):s,e))+` -
`+a(o((s=e!=null?l(e,"hint"):e)!=null?l(s,"version"):s,e))+`
-

-
-`+((s=l(n,"if").call(e??(t.nullContext||{}),(s=e!=null?l(e,"hint"):e)!=null?l(s,"description"):s,{name:"if",hash:{},fn:t.program(4,i,0),inverse:t.noop,data:i,loc:{start:{line:12,column:2},end:{line:16,column:9}}}))!=null?s:"")},4:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
- `+((s=t.lambda((s=e!=null?o(e,"hint"):e)!=null?o(s,"description"):s,e))!=null?s:"")+` -
-`},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"isPlain"):e,{name:"if",hash:{},fn:t.program(1,i,0),inverse:t.program(3,i,0),data:i,loc:{start:{line:1,column:0},end:{line:17,column:7}}}))!=null?s:""},useData:!0});var wl='
',bl=".content a:not([data-no-tooltip])",bn=".tooltip",ji=".tooltip .tooltip-body",Wi="body .content-inner",El="#content",zi="tooltip-shown",Se=10,xl=Se*4,kl=768,Sl=450,_l=100,le={currentLinkElement:null,hoverDelayTimeout:null};window.addEventListener("swup:page:view",Gi);Gi();function Gi(){M(bl).forEach(t=>{Ll(t)&&(t.addEventListener("mouseenter",Pl),t.addEventListener("mouseleave",Il))})}function Ll(t){return!(Tl(t.href)||!tr(t.href))}function Tl(t){let e=t.replace(El,"");return window.location.href.split("#")[0]===e}function Pl(t){if(window.innerWidth{nr(e.href).then(Ol).catch(()=>{})},_l)}function Ol(t){let e=Ui({isPlain:t.kind===ie.plain,hint:t}),n=p(ji);n||(p(Wi).insertAdjacentHTML("beforeend",wl),n=p(ji)),n.innerHTML=e,Al(),p(bn).classList.add(zi)}function Il(){le.currentLinkElement&&(clearTimeout(le.hoverDelayTimeout),ir(),le.currentLinkElement=null,p(bn)?.classList.remove(zi))}function Al(){if(!le.currentLinkElement)return;let t=p(bn),e=le.currentLinkElement.getBoundingClientRect(),n=p(Wi).getBoundingClientRect(),r=t.getBoundingClientRect(),i=Cl(e,n);if(e.left+r.width+Se code:first-child):not(:has(.copy-button))").forEach(t=>{if(!En){let r=document.createElement("div");r.innerHTML=Ki,En=r.firstChild}let e=En.cloneNode(!0);t.appendChild(e);let n;e.addEventListener("click",()=>{clearTimeout(n);let r=Array.from(t.querySelectorAll("code > *:not(.unselectable)")).map(i=>i.textContent).join("");navigator.clipboard.writeText(r),e.classList.add("clicked"),e.disabled=!0,n=setTimeout(()=>{e.classList.remove("clicked"),e.disabled=!1},3e3)})})}var V=Y(Zi());var es=Y(ae());var ts=es.template({1:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return" Search results for "+t.escapeExpression((s=(s=o(n,"value")||(e!=null?o(e,"value"):e))!=null?s:t.hooks.helperMissing,typeof s=="function"?s.call(e??(t.nullContext||{}),{name:"value",hash:{},data:i,loc:{start:{line:3,column:27},end:{line:3,column:36}}}):s))+` -`},3:function(t,e,n,r,i){return` Invalid search -`},5:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"each").call(e??(t.nullContext||{}),e!=null?o(e,"results"):e,{name:"each",hash:{},fn:t.program(6,i,0),inverse:t.noop,data:i,loc:{start:{line:10,column:2},end:{line:21,column:11}}}))!=null?s:""},6:function(t,e,n,r,i){var s,o=t.lambda,a=t.escapeExpression,l=t.lookupProperty||function(u,c){if(Object.prototype.hasOwnProperty.call(u,c))return u[c]};return`
-

- - `+a(o(e!=null?l(e,"title"):e,e))+" ("+a(o(e!=null?l(e,"type"):e,e))+`) - -

-`+((s=l(n,"each").call(e??(t.nullContext||{}),e!=null?l(e,"excerpts"):e,{name:"each",hash:{},fn:t.program(7,i,0),inverse:t.noop,data:i,loc:{start:{line:17,column:8},end:{line:19,column:17}}}))!=null?s:"")+`
-`},7:function(t,e,n,r,i){var s;return'

'+((s=t.lambda(e,e))!=null?s:"")+`

-`},9:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return((s=(o(n,"isArray")||e&&o(e,"isArray")||t.hooks.helperMissing).call(e??(t.nullContext||{}),e!=null?o(e,"results"):e,{name:"isArray",hash:{},fn:t.program(10,i,0),inverse:t.program(12,i,0),data:i,loc:{start:{line:23,column:2},end:{line:29,column:14}}}))!=null?s:"")+` -

The search functionality is full-text based. Here are some tips:

- -
    -
  • Multiple words (such as foo bar) are searched as OR
  • -
  • Use * anywhere (such as fo*) as wildcard
  • -
  • Use + before a word (such as +foo) to make its presence required
  • -
  • Use - before a word (such as -foo) to make its absence required
  • -
  • Use : to search on a particular field (such as field:word). The available fields are title, doc and type
  • -
  • Use WORD^NUMBER (such as foo^2) to boost the given word
  • -
  • Use WORD~NUMBER (such as foo~2) to do a search with edit distance on word
  • -
- -

To quickly go to a module, type, or function, use the autocompletion feature in the sidebar search.

-`},10:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return"

Sorry, we couldn't find anything for "+t.escapeExpression((s=(s=o(n,"value")||(e!=null?o(e,"value"):e))!=null?s:t.hooks.helperMissing,typeof s=="function"?s.call(e??(t.nullContext||{}),{name:"value",hash:{},data:i,loc:{start:{line:24,column:48},end:{line:24,column:57}}}):s))+`.

-`},12:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"value"):e,{name:"if",hash:{},fn:t.program(13,i,0),inverse:t.program(15,i,0),data:i,loc:{start:{line:25,column:2},end:{line:29,column:2}}}))!=null?s:""},13:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return"

Invalid search: "+t.escapeExpression((s=(s=o(n,"errorMessage")||(e!=null?o(e,"errorMessage"):e))!=null?s:t.hooks.helperMissing,typeof s=="function"?s.call(e??(t.nullContext||{}),{name:"errorMessage",hash:{},data:i,loc:{start:{line:26,column:23},end:{line:26,column:39}}}):s))+`.

-`},15:function(t,e,n,r,i){return`

Please type something into the search bar to perform a search.

- `},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o=e??(t.nullContext||{}),a=t.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return`

-`+((s=a(n,"if").call(o,e!=null?a(e,"value"):e,{name:"if",hash:{},fn:t.program(1,i,0),inverse:t.program(3,i,0),data:i,loc:{start:{line:2,column:2},end:{line:6,column:9}}}))!=null?s:"")+`

- -`+((s=(a(n,"isNonEmptyArray")||e&&a(e,"isNonEmptyArray")||t.hooks.helperMissing).call(o,e!=null?a(e,"results"):e,{name:"isNonEmptyArray",hash:{},fn:t.program(5,i,0),inverse:t.program(9,i,0),data:i,loc:{start:{line:9,column:0},end:{line:44,column:20}}}))!=null?s:"")},useData:!0});var wt=80,Rl="#search";V.default.tokenizer.separator=/\s+/;V.default.QueryLexer.termSeparator=/\s+/;V.default.Pipeline.registerFunction(ss,"docTokenSplitter");V.default.Pipeline.registerFunction(os,"docTrimmer");window.addEventListener("swup:page:view",rs);rs();function rs(){let t=window.location.pathname;if(t.endsWith("/search.html")||t.endsWith("/search")){let e=Ot("q"),n=Ot("type");Ml(e,n)}}async function Ml(t,e){if(he(t))xn({value:t});else{Vi(t);try{let n=[],r=Jn();["related","latest"].includes(e)&&r.length>0?n=await Nl(t,e,r):n=await Hl(t),xn({value:t,results:n})}catch(n){xn({value:t,errorMessage:n.message})}}}async function Hl(t){let e=await Dl(),n=t.replaceAll(/(\B|\\):/g,"\\:");return zl(e.search(n))}async function Nl(t,e,n){let r=n;e==="latest"&&(r=n.slice(0,1));let i=r.map(l=>`${l.name}-${l.version}`).join(","),s=new URLSearchParams;s.set("q",t),s.set("query_by","title,doc"),s.set("filter_by",`package:=[${i}]`);let a=await(await fetch(`https://search.hexdocs.pm/?${s.toString()}`)).json();return Array.isArray(a.hits)?a.hits.map(l=>{let[u,c]=l.document.package.split("-"),d=l.document.doc,h=[d],f={},m=`https://hexdocs.pm/${u}/${c}/${l.document.ref}`,g=l.document.title,v=l.document.type;return{doc:d,excerpts:h,metadata:f,ref:m,title:g,type:v}}):[]}function xn({value:t,results:e,errorMessage:n}){let r=p(Rl),i=ts({value:t,results:e,errorMessage:n});r.innerHTML=i}async function Dl(){let t=await Bl();if(t)return t;let e=Ul();return Ql(e),e}async function Bl(){try{let t=sessionStorage.getItem(is());if(t){let e=await Fl(t);return V.default.Index.load(e)}else return null}catch(t){return console.error("Failed to load index: ",t),null}}async function Ql(t){try{let e=await ql(t);sessionStorage.setItem(is(),e)}catch(e){console.error("Failed to save index: ",e)}}async function ql(t){let e=new Blob([JSON.stringify(t)],{type:"application/json"}).stream().pipeThrough(new window.CompressionStream("gzip")),r=await(await new Response(e).blob()).arrayBuffer();return Vl(r)}async function Fl(t){let e=new Blob([$l(t)],{type:"application/json"}).stream().pipeThrough(new window.DecompressionStream("gzip")),n=await new Response(e).text();return JSON.parse(n)}function Vl(t){let e="",n=new Uint8Array(t),r=n.byteLength;for(let i=0;i{this.add(t)})})}function jl(t){t.pipeline.before(V.default.stemmer,ss)}function ss(t){let e=[t],n=/\/\d+$/,r=/\:|\./,i=t.toString();if(i.replace(/^[.,;?!]+|[.,;]+$/g,""),i.startsWith("`")&&i.endsWith("`")&&(i=i.slice(1,-1)),n.test(i)){let o=t.toString().replace(n,"");e.push(t.clone().update(()=>o));let a=o.split(r);if(a.length>1){for(let u of a)e.push(t.clone().update(()=>u));let l=t.toString().split(r);e.push(t.clone().update(()=>l[l.length-1]))}i=a[a.length-1]}else i.startsWith("@")?(i=i.substring(1),e.push(t.clone().update(()=>i))):i.startsWith(":")&&(i=i.substring(1),e.push(t.clone().update(()=>i)));let s=i.split(/\_|\-/);if(s.length>1)for(let o of s)e.push(t.clone().update(()=>o));return e}function Wl(t){t.pipeline.before(V.default.stemmer,os)}function os(t){return t.update(function(e){return e.replace(/^[^@:\w]+/,"").replace(/[^\?\!\w]+$/,"")})}function zl(t){return t.filter(e=>ns(e.ref)).map(e=>{let n=ns(e.ref),r=e.matchData.metadata;return{...n,metadata:r,excerpts:Gl(n,r)}})}function ns(t){return searchData.items.find(e=>e.ref===t)||null}function Gl(t,e){let{doc:n}=t,i=Object.keys(e).filter(s=>"doc"in e[s]).map(s=>e[s].doc.position.map(([o,a])=>Kl(n,o,a))).reduce((s,o)=>s.concat(o),[]);return i.length===0?[n.slice(0,wt*2)+(wt*20?"...":"",t.slice(r,e),""+Re(t.slice(e,e+n))+"",t.slice(e+n,i),i{t.key==="Escape"&&ue()}),N.querySelector(".modal-close").addEventListener("click",ue),N.addEventListener("click",t=>{t.target===N&&ue()}))}function ls(t){if(!Sn)if(N.contains(t.target))kn=t.target;else{Sn=!0;let e=N.querySelectorAll(Yl);kn===e[0]?e[e.length-1].focus():e[0].focus(),Sn=!1,kn=document.activeElement}}function bt({title:t,body:e}){Jl(),_n=document.activeElement,document.addEventListener("focus",ls,!0),N.querySelector(".modal-title").innerHTML=t,N.querySelector(".modal-body").innerHTML=e,N.classList.add("shown"),N.focus()}function ue(){N?.classList.remove("shown"),document.removeEventListener("focus",ls,!0),_n?.focus(),_n=null}function us(){return Boolean(N?.classList.contains("shown"))}var cs='
';var Xl="https://hexdocs.pm/%%",Zl="https://www.erlang.org/doc/apps/%%",eu="https://hex.pm/api/packages?search=name:%%*",tu=".display-quick-switch",fs="#quick-switch-input",ps="#quick-switch-results",nu=300,ru=9,ms=["erts","asn1","common_test","compiler","crypto","debugger","dialyzer","diameter","edoc","eldap","erl_interface","et","eunit","ftp","inets","jinterface","kernel","megaco","mnesia","observer","odbc","os_mon","parsetools","public_key","reltool","runtime_tools","sasl","snmp","ssh","ssl","stdlib","syntax_tools","tftp","tools","wx","xmerl"],iu=["elixir","eex","ex_unit","hex","iex","logger","mix"].concat(ms).map(t=>({name:t})),gs=2,B={autocompleteResults:[],selectedIdx:null};A||(window.addEventListener("swup:page:view",ds),ds());function ds(){M(tu).forEach(t=>{t.addEventListener("click",Tn)})}function su(t){if(t.key==="Enter"){let e=t.target.value;au(e),t.preventDefault()}else t.key==="ArrowUp"?(hs(-1),t.preventDefault()):t.key==="ArrowDown"&&(hs(1),t.preventDefault())}function ou(t){let e=t.target.value;if(e.lengthn.json()).then(n=>{Array.isArray(n)&&(B.autocompleteResults=du(t,n),B.selectedIdx=null,p(fs).value.length>=gs&&cu(B.autocompleteResults))})}function cu(t){p(ps).replaceChildren(...t.map(({name:e},n)=>{let r=E("div",{class:"quick-switch-result","data-index":n},[e]);return r.addEventListener("click",()=>Ln(e)),r}))}function du(t,e){return iu.concat(e).filter(n=>n.name.toLowerCase().includes(t.toLowerCase())).filter(n=>n.releases===void 0||n.releases[0].has_docs===!0).slice(0,ru)}function hs(t){B.selectedIdx=hu(t);let e=p(".quick-switch-result.selected"),n=p(`.quick-switch-result[data-index="${B.selectedIdx}"]`);e&&e.classList.remove("selected"),n&&n.classList.add("selected")}function hu(t){let e=B.autocompleteResults.length;if(B.selectedIdx===null){if(t>=0)return 0;if(t<0)return e-1}return(B.selectedIdx+t+e)%e}var fu="#settings-modal-content",In=[{key:"c",description:"Toggle sidebar",action:Ue},{key:"n",description:"Cycle themes",action:hr},{key:"s",description:"Focus search bar",displayAs:"/ or s",action:Pn},{key:"/",action:Pn},{key:"k",hasModifier:!0,action:Pn},{key:"v",description:"Open/focus version select",action:gu},{key:"g",description:"Go to package docs",displayAs:"g",action:Tn},{key:"?",displayAs:"?",description:"Bring up this modal",action:vu}],On={shortcutBeingPressed:null};A||(document.addEventListener("keydown",pu),document.addEventListener("keyup",mu));function pu(t){if(On.shortcutBeingPressed||t.target.matches("input, select, textarea"))return;let e=In.find(n=>n.hasModifier?De()&&t.metaKey||t.ctrlKey?n.key===t.key:!1:t.ctrlKey||t.metaKey||t.altKey?!1:n.key===t.key);e&&(On.shortcutBeingPressed=e,t.preventDefault(),e.action(t))}function mu(t){On.shortcutBeingPressed=null}function Pn(t){ue(),wn()}function gu(){ue(),Pr()?dn():Ar().then(dn)}function vu(){yu()?ue():An()}function yu(){return us()&&p(fu)}var vs=Y(ae());var ys=vs.template({1:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return(s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"description"):e,{name:"if",hash:{},fn:t.program(2,i,0),inverse:t.noop,data:i,loc:{start:{line:40,column:6},end:{line:53,column:13}}}))!=null?s:""},2:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
-
- `+t.escapeExpression(t.lambda(e!=null?o(e,"description"):e,e))+` -
-
-`+((s=o(n,"if").call(e??(t.nullContext||{}),e!=null?o(e,"displayAs"):e,{name:"if",hash:{},fn:t.program(3,i,0),inverse:t.program(5,i,0),data:i,loc:{start:{line:46,column:12},end:{line:50,column:19}}}))!=null?s:"")+`
-
-`},3:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return" "+((s=t.lambda(e!=null?o(e,"displayAs"):e,e))!=null?s:"")+` -`},5:function(t,e,n,r,i){var s=t.lookupProperty||function(o,a){if(Object.prototype.hasOwnProperty.call(o,a))return o[a]};return" "+t.escapeExpression(t.lambda(e!=null?s(e,"key"):e,e))+` -`},compiler:[8,">= 4.3.0"],main:function(t,e,n,r,i){var s,o=t.lookupProperty||function(a,l){if(Object.prototype.hasOwnProperty.call(a,l))return a[l]};return`
-
- - - - -
- -
-`},useData:!0});var wu=".display-settings",bu="#settings-modal-content",Cn="#modal-settings-tab",Rn="#modal-keyboard-shortcuts-tab",bs="#settings-content",Es="#keyboard-shortcuts-content",Eu=[{title:"Settings",id:"modal-settings-tab"},{title:"Keyboard shortcuts",id:"modal-keyboard-shortcuts-tab"}];window.addEventListener("swup:page:view",xs);xs();function xs(){M(wu).forEach(t=>{t.addEventListener("click",An)})}function ws(){p(Rn).classList.remove("active"),p(Cn).classList.add("active"),p(bs).classList.remove("hidden"),p(Es).classList.add("hidden")}function xu(){p(Rn).classList.add("active"),p(Cn).classList.remove("active"),p(Es).classList.remove("hidden"),p(bs).classList.add("hidden")}function An(){bt({title:Eu.map(({id:s,title:o})=>``).join(""),body:ys({shortcuts:In})});let t=p(bu),e=t.querySelector('[name="theme"]'),n=t.querySelector('[name="tooltips"]'),r=t.querySelector('[name="direct_livebook_url"]'),i=t.querySelector('[name="livebook_url"]');H.getAndSubscribe(s=>{e.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)}),e.addEventListener("change",s=>{H.update({theme:s.target.value})}),n.addEventListener("change",s=>{H.update({tooltips:s.target.checked})}),r.addEventListener("change",s=>{let o=s.target.checked?i.value:null;H.update({livebookUrl:o})}),i.addEventListener("input",s=>{H.update({livebookUrl:s.target.value})}),p(Cn).addEventListener("click",s=>{ws()}),p(Rn).addEventListener("click",s=>{xu()}),ws()}var Mn=new WeakMap;function Hn(t,e,n,r){if(!t&&!Mn.has(e))return!1;let i=Mn.get(e)??new WeakMap;Mn.set(e,i);let s=i.get(n)??new Set;i.set(n,s);let o=s.has(r);return t?s.add(r):s.delete(r),o&&t}function ku(t,e){let n=t.target;if(n instanceof Text&&(n=n.parentElement),n instanceof Element&&t.currentTarget instanceof Element){let r=n.closest(e);if(r&&t.currentTarget.contains(r))return r}}function Su(t,e,n,r={}){let{signal:i,base:s=document}=r;if(i?.aborted)return;let{once:o,...a}=r,l=s instanceof Document?s.documentElement:s,u=Boolean(typeof r=="object"?r.capture:r),c=f=>{let m=ku(f,String(t));if(m){let g=Object.assign(f,{delegateTarget:m});n.call(l,g),o&&(l.removeEventListener(e,c,a),Hn(!1,l,n,d))}},d=JSON.stringify({selector:t,type:e,capture:u});Hn(!0,l,n,d)||l.addEventListener(e,c,a),i?.addEventListener("abort",()=>{Hn(!1,l,n,d)})}var Et=Su;function P(){return P=Object.assign?Object.assign.bind():function(t){for(var e=1;eString(t).toLowerCase().replace(/[\s/_.]+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+|-+$/g,"")||e||"",Le=({hash:t}={})=>window.location.pathname+window.location.search+(t?window.location.hash:""),_u=(t,e={})=>{let n=P({url:t=t||Le({hash:!0}),random:Math.random(),source:"swup"},e);window.history.pushState(n,"",t)},_e=(t=null,e={})=>{t=t||Le({hash:!0});let n=P({},window.history.state||{},{url:t,random:Math.random(),source:"swup"},e);window.history.replaceState(n,"",t)},Lu=(t,e,n,r)=>{let i=new AbortController;return r=P({},r,{signal:i.signal}),Et(t,e,n,r),{destroy:()=>i.abort()}},O=class extends URL{constructor(e,n=document.baseURI){super(e.toString(),n),Object.setPrototypeOf(this,O.prototype)}get url(){return this.pathname+this.search}static fromElement(e){let n=e.getAttribute("href")||e.getAttribute("xlink:href")||"";return new O(n)}static fromUrl(e){return new O(e)}};var me=class extends Error{constructor(e,n){super(e),this.url=void 0,this.status=void 0,this.aborted=void 0,this.timedOut=void 0,this.name="FetchError",this.url=n.url,this.status=n.status,this.aborted=n.aborted||!1,this.timedOut=n.timedOut||!1}};async function Tu(t,e={}){var n;t=O.fromUrl(t).url;let{visit:r=this.visit}=e,i=P({},this.options.requestHeaders,e.headers),s=(n=e.timeout)!=null?n:this.options.timeout,o=new AbortController,{signal:a}=o;e=P({},e,{headers:i,signal:a});let l,u=!1,c=null;s&&s>0&&(c=setTimeout(()=>{u=!0,o.abort("timeout")},s));try{l=await this.hooks.call("fetch:request",r,{url:t,options:e},(v,{url:w,options:x})=>fetch(w,x)),c&&clearTimeout(c)}catch(v){throw u?(this.hooks.call("fetch:timeout",r,{url:t}),new me(`Request timed out: ${t}`,{url:t,timedOut:u})):v?.name==="AbortError"||a.aborted?new me(`Request aborted: ${t}`,{url:t,aborted:!0}):v}let{status:d,url:h}=l,f=await l.text();if(d===500)throw this.hooks.call("fetch:error",r,{status:d,response:l,url:h}),new me(`Server error: ${h}`,{status:d,url:h});if(!f)throw new me(`Empty response: ${h}`,{status:d,url:h});let{url:m}=O.fromUrl(h),g={url:m,html:f};return!r.cache.write||e.method&&e.method!=="GET"||t!==m||this.cache.set(g.url,g),g}var Dn=class{constructor(e){this.swup=void 0,this.pages=new Map,this.swup=e}get size(){return this.pages.size}get all(){let e=new Map;return this.pages.forEach((n,r)=>{e.set(r,P({},n))}),e}has(e){return this.pages.has(this.resolve(e))}get(e){let n=this.pages.get(this.resolve(e));return n&&P({},n)}set(e,n){n=P({},n,{url:e=this.resolve(e)}),this.pages.set(e,n),this.swup.hooks.callSync("cache:set",void 0,{page:n})}update(e,n){e=this.resolve(e);let r=P({},this.get(e),n,{url:e});this.pages.set(e,r)}delete(e){this.pages.delete(this.resolve(e))}clear(){this.pages.clear(),this.swup.hooks.callSync("cache:clear",void 0,void 0)}prune(e){this.pages.forEach((n,r)=>{e(r,n)&&this.delete(r)})}resolve(e){let{url:n}=O.fromUrl(e);return this.swup.resolveUrl(n)}},Bn=(t,e=document)=>e.querySelector(t),Fn=(t,e=document)=>Array.from(e.querySelectorAll(t)),Ts=()=>new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})});function Ps(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function Pu(t,e=[]){return new Promise((n,r)=>{let i=t(...e);Ps(i)?i.then(n,r):n(i)})}function ks(t,e){let n=t?.closest(`[${e}]`);return n!=null&&n.hasAttribute(e)?n?.getAttribute(e)||!0:void 0}var Qn=class{constructor(e){this.swup=void 0,this.swupClasses=["to-","is-changing","is-rendering","is-popstate","is-animating","is-leaving"],this.swup=e}get selectors(){let{scope:e}=this.swup.visit.animation;return e==="containers"?this.swup.visit.containers:e==="html"?["html"]:Array.isArray(e)?e:[]}get selector(){return this.selectors.join(",")}get targets(){return this.selector.trim()?Fn(this.selector):[]}add(...e){this.targets.forEach(n=>n.classList.add(...e))}remove(...e){this.targets.forEach(n=>n.classList.remove(...e))}clear(){this.targets.forEach(e=>{let n=e.className.split(" ").filter(r=>this.isSwupClass(r));e.classList.remove(...n)})}isSwupClass(e){return this.swupClasses.some(n=>e.startsWith(n))}},St=class{constructor(e,n){this.id=void 0,this.state=void 0,this.from=void 0,this.to=void 0,this.containers=void 0,this.animation=void 0,this.trigger=void 0,this.cache=void 0,this.history=void 0,this.scroll=void 0,this.meta=void 0;let{to:r,from:i,hash:s,el:o,event:a}=n;this.id=Math.random(),this.state=1,this.from={url:i??e.location.url,hash:e.location.hash},this.to={url:r,hash:s},this.containers=e.options.containers,this.animation={animate:!0,wait:!1,name:void 0,native:e.options.native,scope:e.options.animationScope,selector:e.options.animationSelector},this.trigger={el:o,event:a},this.cache={read:e.options.cache,write:e.options.cache},this.history={action:"push",popstate:!1,direction:void 0},this.scroll={reset:!0,target:void 0},this.meta={}}advance(e){this.state=7}};function Ou(t){return new St(this,t)}var qn=class{constructor(e){this.swup=void 0,this.registry=new Map,this.hooks=["animation:out:start","animation:out:await","animation:out:end","animation:in:start","animation:in:await","animation:in:end","animation:skip","cache:clear","cache:set","content:replace","content:scroll","enable","disable","fetch:request","fetch:error","fetch:timeout","history:popstate","link:click","link:self","link:anchor","link:newtab","page:load","page:view","scroll:top","scroll:anchor","visit:start","visit:transition","visit:abort","visit:end"],this.swup=e,this.init()}init(){this.hooks.forEach(e=>this.create(e))}create(e){this.registry.has(e)||this.registry.set(e,new Map)}exists(e){return this.registry.has(e)}get(e){let n=this.registry.get(e);if(n)return n;console.error(`Unknown hook '${e}'`)}clear(){this.registry.forEach(e=>e.clear())}on(e,n,r={}){let i=this.get(e);if(!i)return console.warn(`Hook '${e}' not found.`),()=>{};let s=P({},r,{id:i.size+1,hook:e,handler:n});return i.set(n,s),()=>this.off(e,n)}before(e,n,r={}){return this.on(e,n,P({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,P({},r,{replace:!0}))}once(e,n,r={}){return this.on(e,n,P({},r,{once:!0}))}off(e,n){let r=this.get(e);r&&n?r.delete(n)||console.warn(`Handler for hook '${e}' not found.`):r&&r.clear()}async call(e,n,r,i){let[s,o,a]=this.parseCallArgs(e,n,r,i),{before:l,handler:u,after:c}=this.getHandlers(e,a);await this.run(l,s,o);let[d]=await this.run(u,s,o,!0);return await this.run(c,s,o),this.dispatchDomEvent(e,s,o),d}callSync(e,n,r,i){let[s,o,a]=this.parseCallArgs(e,n,r,i),{before:l,handler:u,after:c}=this.getHandlers(e,a);this.runSync(l,s,o);let[d]=this.runSync(u,s,o,!0);return this.runSync(c,s,o),this.dispatchDomEvent(e,s,o),d}parseCallArgs(e,n,r,i){return n instanceof St||typeof n!="object"&&typeof r!="function"?[n,r,i]:[void 0,n,r]}async run(e,n=this.swup.visit,r,i=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:l,once:u}of e)if(n==null||!n.done){u&&this.off(o,a);try{let c=await Pu(a,[n,r,l]);s.push(c)}catch(c){if(i)throw c;console.error(`Error in hook '${o}':`,c)}}return s}runSync(e,n=this.swup.visit,r,i=!1){let s=[];for(let{hook:o,handler:a,defaultHandler:l,once:u}of e)if(n==null||!n.done){u&&this.off(o,a);try{let c=a(n,r,l);s.push(c),Ps(c)&&console.warn(`Swup will not await Promises in handler for synchronous hook '${o}'.`)}catch(c){if(i)throw c;console.error(`Error in hook '${o}':`,c)}}return s}getHandlers(e,n){let r=this.get(e);if(!r)return{found:!1,before:[],handler:[],after:[],replaced:!1};let i=Array.from(r.values()),s=this.sortRegistrations,o=i.filter(({before:d,replace:h})=>d&&!h).sort(s),a=i.filter(({replace:d})=>d).filter(d=>!0).sort(s),l=i.filter(({before:d,replace:h})=>!d&&!h).sort(s),u=a.length>0,c=[];if(n&&(c=[{id:0,hook:e,handler:n}],u)){let d=a.length-1,{handler:h,once:f}=a[d],m=g=>{let v=a[g-1];return v?(w,x)=>v.handler(w,x,m(g-1)):n};c=[{id:0,hook:e,once:f,handler:h,defaultHandler:m(d)}]}return{found:!0,before:o,handler:c,after:l,replaced:u}}sortRegistrations(e,n){var r,i;return((r=e.priority)!=null?r:0)-((i=n.priority)!=null?i:0)||e.id-n.id||0}dispatchDomEvent(e,n,r){if(n!=null&&n.done)return;let i={hook:e,args:r,visit:n||this.swup.visit};document.dispatchEvent(new CustomEvent("swup:any",{detail:i,bubbles:!0})),document.dispatchEvent(new CustomEvent(`swup:${e}`,{detail:i,bubbles:!0}))}parseName(e){let[n,...r]=e.split(".");return[n,r.reduce((i,s)=>P({},i,{[s]:!0}),{})]}},Iu=t=>{if(t&&t.charAt(0)==="#"&&(t=t.substring(1)),!t)return null;let e=decodeURIComponent(t),n=document.getElementById(t)||document.getElementById(e)||Bn(`a[name='${CSS.escape(t)}']`)||Bn(`a[name='${CSS.escape(e)}']`);return n||t!=="top"||(n=document.body),n},xt="transition",Nn="animation";async function Au({selector:t,elements:e}){if(t===!1&&!e)return;let n=[];if(e)n=Array.from(e);else if(t&&(n=Fn(t,document.body),!n.length))return void console.warn(`[swup] No elements found matching animationSelector \`${t}\``);let r=n.map(i=>function(s){let{type:o,timeout:a,propCount:l}=function(u){let c=window.getComputedStyle(u),d=kt(c,`${xt}Delay`),h=kt(c,`${xt}Duration`),f=Ss(d,h),m=kt(c,`${Nn}Delay`),g=kt(c,`${Nn}Duration`),v=Ss(m,g),w=Math.max(f,v),x=w>0?f>v?xt:Nn:null;return{type:x,timeout:w,propCount:x?x===xt?h.length:g.length:0}}(s);return!(!o||!a)&&new Promise(u=>{let c=`${o}end`,d=performance.now(),h=0,f=()=>{s.removeEventListener(c,m),u()},m=g=>{g.target===s&&((performance.now()-d)/1e3=l&&f())};setTimeout(()=>{h0?await Promise.all(r):t&&console.warn(`[swup] No CSS animation duration defined on elements matching \`${t}\``)}function kt(t,e){return(t[e]||"").split(", ")}function Ss(t,e){for(;t.length_s(n)+_s(t[r])))}function _s(t){return 1e3*parseFloat(t)}function Cu(t,e={},n={}){if(typeof t!="string")throw new Error("swup.navigate() requires a URL parameter");if(this.shouldIgnoreVisit(t,{el:n.el,event:n.event}))return void window.location.assign(t);let{url:r,hash:i}=O.fromUrl(t),s=this.createVisit(P({},n,{to:r,hash:i}));this.performNavigation(s,e)}async function Ru(t,e={}){if(this.navigating){if(this.visit.state>=6)return t.state=2,void(this.onVisitEnd=()=>this.performNavigation(t,e));await this.hooks.call("visit:abort",this.visit,void 0),delete this.visit.to.document,this.visit.state=8}this.navigating=!0,this.visit=t;let{el:n}=t.trigger;e.referrer=e.referrer||this.location.url,e.animate===!1&&(t.animation.animate=!1),t.animation.animate||this.classes.clear();let r=e.history||ks(n,"data-swup-history");typeof r=="string"&&["push","replace"].includes(r)&&(t.history.action=r);let i=e.animation||ks(n,"data-swup-animation");var s,o;typeof i=="string"&&(t.animation.name=i),t.meta=e.meta||{},typeof e.cache=="object"?(t.cache.read=(s=e.cache.read)!=null?s:t.cache.read,t.cache.write=(o=e.cache.write)!=null?o:t.cache.write):e.cache!==void 0&&(t.cache={read:!!e.cache,write:!!e.cache}),delete e.cache;try{await this.hooks.call("visit:start",t,void 0),t.state=3;let a=this.hooks.call("page:load",t,{options:e},async(u,c)=>{let d;return u.cache.read&&(d=this.cache.get(u.to.url)),c.page=d||await this.fetchPage(u.to.url,c.options),c.cache=!!d,c.page});a.then(({html:u})=>{t.advance(5),t.to.html=u,t.to.document=new DOMParser().parseFromString(u,"text/html")});let l=t.to.url+t.to.hash;if(t.history.popstate||(t.history.action==="replace"||t.to.url===this.location.url?_e(l):(this.currentHistoryIndex++,_u(l,{index:this.currentHistoryIndex}))),this.location=O.fromUrl(l),t.history.popstate&&this.classes.add("is-popstate"),t.animation.name&&this.classes.add(`to-${Ls(t.animation.name)}`),t.animation.wait&&await a,t.done||(await this.hooks.call("visit:transition",t,void 0,async()=>{if(!t.animation.animate)return await this.hooks.call("animation:skip",void 0),void await this.renderPage(t,await a);t.advance(4),await this.animatePageOut(t),t.animation.native&&document.startViewTransition?await document.startViewTransition(async()=>await this.renderPage(t,await a)).finished:await this.renderPage(t,await a),await this.animatePageIn(t)}),t.done))return;await this.hooks.call("visit:end",t,void 0,()=>this.classes.clear()),t.state=7,this.navigating=!1,this.onVisitEnd&&(this.onVisitEnd(),this.onVisitEnd=void 0)}catch(a){if(!a||a!=null&&a.aborted)return void(t.state=8);t.state=9,console.error(a),this.options.skipPopStateHandling=()=>(window.location.assign(t.to.url+t.to.hash),!0),window.history.back()}finally{delete t.to.document}}var Mu=async function(t){await this.hooks.call("animation:out:start",t,void 0,()=>{this.classes.add("is-changing","is-animating","is-leaving")}),await this.hooks.call("animation:out:await",t,{skip:!1},(e,{skip:n})=>{if(!n)return this.awaitAnimations({selector:e.animation.selector})}),await this.hooks.call("animation:out:end",t,void 0)},Hu=function(t){var e;let n=t.to.document;if(!n)return!1;let r=((e=n.querySelector("title"))==null?void 0:e.innerText)||"";document.title=r;let i=Fn('[data-swup-persist]:not([data-swup-persist=""])'),s=t.containers.map(o=>{let a=document.querySelector(o),l=n.querySelector(o);return a&&l?(a.replaceWith(l.cloneNode(!0)),!0):(a||console.warn(`[swup] Container missing in current document: ${o}`),l||console.warn(`[swup] Container missing in incoming document: ${o}`),!1)}).filter(Boolean);return i.forEach(o=>{let a=o.getAttribute("data-swup-persist"),l=Bn(`[data-swup-persist="${a}"]`);l&&l!==o&&l.replaceWith(o)}),s.length===t.containers.length},Nu=function(t){let e={behavior:"auto"},{target:n,reset:r}=t.scroll,i=n??t.to.hash,s=!1;return i&&(s=this.hooks.callSync("scroll:anchor",t,{hash:i,options:e},(o,{hash:a,options:l})=>{let u=this.getAnchorElement(a);return u&&u.scrollIntoView(l),!!u})),r&&!s&&(s=this.hooks.callSync("scroll:top",t,{options:e},(o,{options:a})=>(window.scrollTo(P({top:0,left:0},a)),!0))),s},Du=async function(t){if(t.done)return;let e=this.hooks.call("animation:in:await",t,{skip:!1},(n,{skip:r})=>{if(!r)return this.awaitAnimations({selector:n.animation.selector})});await Ts(),await this.hooks.call("animation:in:start",t,void 0,()=>{this.classes.remove("is-animating")}),await e,await this.hooks.call("animation:in:end",t,void 0)},Bu=async function(t,e){if(t.done)return;t.advance(6);let{url:n}=e;this.isSameResolvedUrl(Le(),n)||(_e(n),this.location=O.fromUrl(n),t.to.url=this.location.url,t.to.hash=this.location.hash),await this.hooks.call("content:replace",t,{page:e},(r,{})=>{if(this.classes.remove("is-leaving"),r.animation.animate&&this.classes.add("is-rendering"),!this.replaceContent(r))throw new Error("[swup] Container mismatch, aborting");r.animation.animate&&(this.classes.add("is-changing","is-animating","is-rendering"),r.animation.name&&this.classes.add(`to-${Ls(r.animation.name)}`))}),await this.hooks.call("content:scroll",t,void 0,()=>this.scrollToContent(t)),await this.hooks.call("page:view",t,{url:this.location.url,title:document.title})},Qu=function(t){var e;if(e=t,Boolean(e?.isSwupPlugin)){if(t.swup=this,!t._checkRequirements||t._checkRequirements())return t._beforeMount&&t._beforeMount(),t.mount(),this.plugins.push(t),this.plugins}else console.error("Not a swup plugin instance",t)};function qu(t){let e=this.findPlugin(t);if(e)return e.unmount(),e._afterUnmount&&e._afterUnmount(),this.plugins=this.plugins.filter(n=>n!==e),this.plugins;console.error("No such plugin",e)}function Fu(t){return this.plugins.find(e=>e===t||e.name===t||e.name===`Swup${String(t)}`)}function Vu(t){if(typeof this.options.resolveUrl!="function")return console.warn("[swup] options.resolveUrl expects a callback function."),t;let e=this.options.resolveUrl(t);return e&&typeof e=="string"?e.startsWith("//")||e.startsWith("http")?(console.warn("[swup] options.resolveUrl needs to return a relative url"),t):e:(console.warn("[swup] options.resolveUrl needs to return a url"),t)}function $u(t,e){return this.resolveUrl(t)===this.resolveUrl(e)}var Uu={animateHistoryBrowsing:!1,animationSelector:'[class*="transition-"]',animationScope:"html",cache:!0,containers:["#swup"],hooks:{},ignoreVisit:(t,{el:e}={})=>!(e==null||!e.closest("[data-no-swup]")),linkSelector:"a[href]",linkToSelf:"scroll",native:!1,plugins:[],resolveUrl:t=>t,requestHeaders:{"X-Requested-With":"swup",Accept:"text/html, application/xhtml+xml"},skipPopStateHandling:t=>{var e;return((e=t.state)==null?void 0:e.source)!=="swup"},timeout:0},_t=class{get currentPageUrl(){return this.location.url}constructor(e={}){var n,r;this.version="4.8.1",this.options=void 0,this.defaults=Uu,this.plugins=[],this.visit=void 0,this.cache=void 0,this.hooks=void 0,this.classes=void 0,this.location=O.fromUrl(window.location.href),this.currentHistoryIndex=void 0,this.clickDelegate=void 0,this.navigating=!1,this.onVisitEnd=void 0,this.use=Qu,this.unuse=qu,this.findPlugin=Fu,this.log=()=>{},this.navigate=Cu,this.performNavigation=Ru,this.createVisit=Ou,this.delegateEvent=Lu,this.fetchPage=Tu,this.awaitAnimations=Au,this.renderPage=Bu,this.replaceContent=Hu,this.animatePageIn=Du,this.animatePageOut=Mu,this.scrollToContent=Nu,this.getAnchorElement=Iu,this.getCurrentUrl=Le,this.resolveUrl=Vu,this.isSameResolvedUrl=$u,this.options=P({},this.defaults,e),this.handleLinkClick=this.handleLinkClick.bind(this),this.handlePopState=this.handlePopState.bind(this),this.cache=new Dn(this),this.classes=new Qn(this),this.hooks=new qn(this),this.visit=this.createVisit({to:""}),this.currentHistoryIndex=(n=(r=window.history.state)==null?void 0:r.index)!=null?n:1,this.enable()}async enable(){var e;let{linkSelector:n}=this.options;this.clickDelegate=this.delegateEvent(n,"click",this.handleLinkClick),window.addEventListener("popstate",this.handlePopState),this.options.animateHistoryBrowsing&&(window.history.scrollRestoration="manual"),this.options.native=this.options.native&&!!document.startViewTransition,this.options.plugins.forEach(r=>this.use(r));for(let[r,i]of Object.entries(this.options.hooks)){let[s,o]=this.hooks.parseName(r);this.hooks.on(s,i,o)}((e=window.history.state)==null?void 0:e.source)!=="swup"&&_e(null,{index:this.currentHistoryIndex}),await Ts(),await this.hooks.call("enable",void 0,void 0,()=>{let r=document.documentElement;r.classList.add("swup-enabled"),r.classList.toggle("swup-native",this.options.native)})}async destroy(){this.clickDelegate.destroy(),window.removeEventListener("popstate",this.handlePopState),this.cache.clear(),this.options.plugins.forEach(e=>this.unuse(e)),await this.hooks.call("disable",void 0,void 0,()=>{let e=document.documentElement;e.classList.remove("swup-enabled"),e.classList.remove("swup-native")}),this.hooks.clear()}shouldIgnoreVisit(e,{el:n,event:r}={}){let{origin:i,url:s,hash:o}=O.fromUrl(e);return i!==window.location.origin||!(!n||!this.triggerWillOpenNewWindow(n))||!!this.options.ignoreVisit(s+o,{el:n,event:r})}handleLinkClick(e){let n=e.delegateTarget,{href:r,url:i,hash:s}=O.fromElement(n);if(this.shouldIgnoreVisit(r,{el:n,event:e}))return;if(this.navigating&&i===this.visit.to.url)return void e.preventDefault();let o=this.createVisit({to:i,hash:s,el:n,event:e});e.metaKey||e.ctrlKey||e.shiftKey||e.altKey?this.hooks.callSync("link:newtab",o,{href:r}):e.button===0&&this.hooks.callSync("link:click",o,{el:n,event:e},()=>{var a;let l=(a=o.from.url)!=null?a:"";e.preventDefault(),i&&i!==l?this.isSameResolvedUrl(i,l)||this.performNavigation(o):s?this.hooks.callSync("link:anchor",o,{hash:s},()=>{_e(i+s),this.scrollToContent(o)}):this.hooks.callSync("link:self",o,void 0,()=>{this.options.linkToSelf==="navigate"?this.performNavigation(o):(_e(i),this.scrollToContent(o))})})}handlePopState(e){var n,r,i,s;let o=(n=(r=e.state)==null?void 0:r.url)!=null?n:window.location.href;if(this.options.skipPopStateHandling(e)||this.isSameResolvedUrl(Le(),this.location.url))return;let{url:a,hash:l}=O.fromUrl(o),u=this.createVisit({to:a,hash:l,event:e});u.history.popstate=!0;let c=(i=(s=e.state)==null?void 0:s.index)!=null?i:0;c&&c!==this.currentHistoryIndex&&(u.history.direction=c-this.currentHistoryIndex>0?"forwards":"backwards",this.currentHistoryIndex=c),u.animation.animate=!1,u.scroll.reset=!1,u.scroll.target=!1,this.options.animateHistoryBrowsing&&(u.animation.animate=!0,u.scroll.reset=!0),this.hooks.callSync("history:popstate",u,{event:e},()=>{this.performNavigation(u)})}triggerWillOpenNewWindow(e){return!!e.matches('[download], [target="_blank"]')}};function Te(){return Te=Object.assign?Object.assign.bind():function(t){for(var e=1;eString(t).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join("."),ge=class{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return typeof this.requires!="object"||Object.entries(this.requires).forEach(([e,n])=>{if(!function(r,i,s){let o=function(a,l){var u;if(a==="swup")return(u=l.version)!=null?u:"";{var c;let d=l.findPlugin(a);return(c=d?.version)!=null?c:""}}(r,s);return!!o&&((a,l)=>l.every(u=>{let[,c,d]=u.match(/^([\D]+)?(.*)$/)||[];var h,f;return((m,g)=>{let v={"":w=>w===0,">":w=>w>0,">=":w=>w>=0,"<":w=>w<0,"<=":w=>w<=0};return(v[g]||v[""])(m)})((f=d,h=Os(h=a),f=Os(f),h.localeCompare(f,void 0,{numeric:!0})),c||">=")}))(o,i)}(e,n=Array.isArray(n)?n:[n],this.swup)){let r=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${r}`)}}),!0}on(e,n,r={}){var i;n=!(i=n).name.startsWith("bound ")||i.hasOwnProperty("prototype")?n.bind(this):n;let s=this.swup.hooks.on(e,n,r);return this.handlersToUnregister.push(s),s}once(e,n,r={}){return this.on(e,n,Te({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,Te({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,Te({},r,{replace:!0}))}off(e,n){return this.swup.hooks.off(e,n)}};(function(){if(!(typeof window>"u"||typeof document>"u"||typeof HTMLElement>"u")){var t=!1;try{var e=document.createElement("div");e.addEventListener("focus",function(s){s.preventDefault(),s.stopPropagation()},!0),e.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&typeof navigator.userAgent<"u"&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return t=!1;t=!0}}))}catch{}if(HTMLElement.prototype.nativeFocus===void 0&&!t){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var n=function(s){for(var o=s.parentNode,a=[],l=document.scrollingElement||document.documentElement;o&&o!==l;)(o.offsetHeightn.replace(`{${r}}`,e[r]||""),t||"")}var $n=class{constructor(){var e;this.id="swup-announcer",this.style="position:absolute;top:0;left:0;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap;word-wrap:normal;width:1px;height:1px;",this.region=void 0,this.region=(e=this.getRegion())!=null?e:this.createRegion()}getRegion(){return document.getElementById(this.id)}createRegion(){let e=function(n){let r=document.createElement("template");return r.innerHTML=n,r.content.children[0]}(`

`);return document.body.appendChild(e),e}announce(e,n=0){return new Promise(r=>{setTimeout(()=>{this.region.textContent===e&&(e=`${e}.`),this.region.textContent="",this.region.textContent=e,r()},n)})}};function As(t){let e;if(e=typeof t=="string"?document.querySelector(t):t,!(e instanceof HTMLElement))return;let n=e.getAttribute("tabindex");e.setAttribute("tabindex","-1"),e.focus({preventScroll:!0}),n!==null&&e.setAttribute("tabindex",n)}var Lt=class extends ge{constructor(e={}){super(),this.name="SwupA11yPlugin",this.requires={swup:">=4"},this.defaults={headingSelector:"h1",respectReducedMotion:!0,autofocus:!1,announcements:{visit:"Navigated to: {title}",url:"New page at {url}"}},this.options=void 0,this.announcer=void 0,this.announcementDelay=100,this.rootSelector="body",this.handleAnchorScroll=(n,{hash:r})=>{let i=this.swup.getAnchorElement(r);i instanceof HTMLElement&&As(i)},this.options=Vn({},this.defaults,e),this.announcer=new $n}mount(){this.swup.hooks.create("content:announce"),this.swup.hooks.create("content:focus"),this.before("visit:start",this.prepareVisit),this.on("visit:start",this.markAsBusy),this.on("visit:end",this.unmarkAsBusy),this.on("visit:end",this.focusContent),this.on("visit:end",this.announceContent),this.on("scroll:anchor",this.handleAnchorScroll),this.before("visit:start",this.disableAnimations),this.before("link:self",this.disableAnimations),this.before("link:anchor",this.disableAnimations),this.swup.announce=this.announce.bind(this)}unmount(){this.swup.announce=void 0}async announce(e){await this.announcer.announce(e)}markAsBusy(){document.documentElement.setAttribute("aria-busy","true")}unmarkAsBusy(){document.documentElement.removeAttribute("aria-busy")}prepareVisit(e){e.a11y={announce:void 0,focus:this.rootSelector}}announceContent(e){this.swup.hooks.callSync("content:announce",e,void 0,n=>{n.a11y.announce===void 0&&(n.a11y.announce=this.getPageAnnouncement()),n.a11y.announce&&this.announcer.announce(n.a11y.announce,this.announcementDelay)})}focusContent(e){this.swup.hooks.callSync("content:focus",e,void 0,n=>{n.a11y.focus&&(this.options.autofocus&&function(){let r=function(){let i=document.querySelector("body [autofocus]");if(i&&!i.closest('[inert], [aria-disabled], [aria-hidden="true"]'))return i}();return!!r&&(r!==document.activeElement&&r.focus(),!0)}()===!0||As(n.a11y.focus))})}getPageAnnouncement(){let{headingSelector:e,announcements:n}=this.options;return function({headingSelector:r="h1",announcements:i={}}){var s,o;let a=document.documentElement.lang||"*",{href:l,url:u,pathname:c}=O.fromUrl(window.location.href),d=(s=(o=i[a])!=null?o:i["*"])!=null?s:i;if(typeof d!="object")return;let h=document.querySelector(r);h||console.warn(`SwupA11yPlugin: No main heading (${r}) found on new page`);let f=h?.getAttribute("aria-label")||h?.textContent||document.title||Is(d.url,{href:l,url:u,path:c});return Is(d.visit,{title:f,href:l,url:u,path:c})}({headingSelector:e,announcements:n})}disableAnimations(e){this.options.respectReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(e.animation.animate=!1,e.scroll.animate=!1)}};function Un(){return Un=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let a=Math.random()*this.trickleValue;this.setValue(this.value+a)},e!==void 0&&(this.className=String(e)),n!==void 0&&(this.styleAttr=String(n)),r!==void 0&&(this.animationDuration=Number(r)),i!==void 0&&(this.minValue=Number(i)),s!==void 0&&(this.initialValue=Number(s)),o!==void 0&&(this.trickleValue=Number(o)),this.styleElement=this.createStyleElement(),this.progressElement=this.createProgressElement()}get defaultStyles(){return` - .${this.className} { - position: fixed; - display: block; - top: 0; - left: 0; - width: 100%; - height: 3px; - background-color: black; - z-index: 9999; - transition: - transform ${this.animationDuration}ms ease-out, - opacity ${this.animationDuration/2}ms ${this.animationDuration/2}ms ease-in; - transform: translate3d(0, 0, 0) scaleX(var(--progress, 0)); - transform-origin: 0; - } - `}show(){this.visible||(this.visible=!0,this.installStyleElement(),this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=Math.min(1,Math.max(this.minValue,e)),this.refresh()}installStyleElement(){document.head.prepend(this.styleElement)}installProgressElement(){this.progressElement.style.setProperty("--progress",String(0)),this.progressElement.style.opacity="1",document.body.prepend(this.progressElement),this.progressElement.scrollTop=0,this.setValue(Math.random()*this.initialValue)}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,1.5*this.animationDuration)}uninstallProgressElement(){this.progressElement.remove()}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,this.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.setProperty("--progress",String(this.value))})}createStyleElement(){let e=document.createElement("style");return this.styleAttr.split(" ").forEach(n=>e.setAttribute(n,"")),e.textContent=this.defaultStyles,e}createProgressElement(){let e=document.createElement("div");return e.className=this.className,e.setAttribute("aria-hidden","true"),e}},Tt=class extends ge{constructor(e={}){super(),this.name="SwupProgressPlugin",this.defaults={className:"swup-progress-bar",delay:300,transition:300,minValue:.1,initialValue:.25,finishAnimation:!0},this.options=void 0,this.progressBar=void 0,this.showProgressBarTimeout=void 0,this.hideProgressBarTimeout=void 0,this.options=Un({},this.defaults,e);let{className:n,minValue:r,initialValue:i,transition:s}=this.options;this.progressBar=new jn({className:n,minValue:r,initialValue:i,animationDuration:s})}mount(){this.on("visit:start",this.startShowingProgress),this.on("page:view",this.stopShowingProgress)}startShowingProgress(){this.progressBar.setValue(0),this.showProgressBarAfterDelay()}stopShowingProgress(){this.progressBar.setValue(1),this.options.finishAnimation?this.finishAnimationAndHideProgressBar():this.hideProgressBar()}showProgressBar(){this.cancelHideProgressBarTimeout(),this.progressBar.show()}showProgressBarAfterDelay(){this.cancelShowProgressBarTimeout(),this.cancelHideProgressBarTimeout(),this.showProgressBarTimeout=window.setTimeout(this.showProgressBar.bind(this),this.options.delay)}hideProgressBar(){this.cancelShowProgressBarTimeout(),this.progressBar.hide()}finishAnimationAndHideProgressBar(){this.cancelShowProgressBarTimeout(),this.hideProgressBarTimeout=window.setTimeout(this.hideProgressBar.bind(this),this.options.transition)}cancelShowProgressBarTimeout(){window.clearTimeout(this.showProgressBarTimeout),delete this.showProgressBarTimeout}cancelHideProgressBarTimeout(){window.clearTimeout(this.hideProgressBarTimeout),delete this.hideProgressBarTimeout}};!A&&window.location.protocol!=="file:"&&new _t({animationSelector:!1,containers:["#main"],ignoreVisit:t=>{let e=t.split("#")[0];return e===window.location.pathname||e===window.location.pathname+".html"},linkSelector:'a[href]:not([href^="/"]):not([href^="http"])',plugins:[new Lt,new Tt({delay:500})]});})(); -/*! 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-6XHBGSGW.js b/formatters/html/dist/html-XEWS3Q4M.js similarity index 60% rename from formatters/html/dist/html-6XHBGSGW.js rename to formatters/html/dist/html-XEWS3Q4M.js index 2fe49fee7..566e5115d 100644 --- a/formatters/html/dist/html-6XHBGSGW.js +++ b/formatters/html/dist/html-XEWS3Q4M.js @@ -1,9 +1,9 @@ -(()=>{var Ps=Object.create;var Wn=Object.defineProperty;var Os=Object.getOwnPropertyDescriptor;var Is=Object.getOwnPropertyNames;var As=Object.getPrototypeOf,Cs=Object.prototype.hasOwnProperty;var L=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Rs=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Is(e))!Cs.call(t,i)&&i!==n&&Wn(t,i,{get:()=>e[i],enumerable:!(r=Os(e,i))||r.enumerable});return t};var Y=(t,e,n)=>(n=t!=null?Ps(As(t)):{},Rs(e||!t||!t.__esModule?Wn(n,"default",{value:t,enumerable:!0}):n,t));var gr=L((lc,mr)=>{var pr="Expected a function",hr=NaN,Bs="[object Symbol]",Qs=/^\s+|\s+$/g,qs=/^[-+]0x[0-9a-f]+$/i,Fs=/^0b[01]+$/i,Vs=/^0o[0-7]+$/i,$s=parseInt,Us=typeof global=="object"&&global&&global.Object===Object&&global,js=typeof self=="object"&&self&&self.Object===Object&&self,Ws=Us||js||Function("return this")(),zs=Object.prototype,Gs=zs.toString,Ks=Math.max,Ys=Math.min,Bt=function(){return Ws.Date.now()};function Js(t,e,n){var r,i,s,o,a,l,u=0,c=!1,d=!1,h=!0;if(typeof t!="function")throw new TypeError(pr);e=fr(e)||0,Fe(n)&&(c=!!n.leading,d="maxWait"in n,s=d?Ks(fr(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function p(S){var R=r,U=i;return r=i=void 0,u=S,o=t.apply(U,R),o}function m(S){return u=S,a=setTimeout(w,e),c?p(S):o}function g(S){var R=S-l,U=S-u,ee=e-R;return d?Ys(ee,s-U):ee}function v(S){var R=S-l,U=S-u;return l===void 0||R>=e||R<0||d&&U>=s}function w(){var S=Bt();if(v(S))return x(S);a=setTimeout(w,g(S))}function x(S){return a=void 0,h&&r?p(S):(r=i=void 0,o)}function I(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function q(){return a===void 0?o:x(Bt())}function $(){var S=Bt(),R=v(S);if(r=arguments,i=this,l=S,R){if(a===void 0)return m(l);if(d)return a=setTimeout(w,e),p(l)}return a===void 0&&(a=setTimeout(w,e)),o}return $.cancel=I,$.flush=q,$}function Xs(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(pr);return Fe(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Js(t,e,{leading:r,maxWait:e,trailing:i})}function Fe(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Zs(t){return!!t&&typeof t=="object"}function eo(t){return typeof t=="symbol"||Zs(t)&&Gs.call(t)==Bs}function fr(t){if(typeof t=="number")return t;if(eo(t))return hr;if(Fe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Fe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Qs,"");var n=Fs.test(t);return n||Vs.test(t)?$s(t.slice(2),n?2:8):qs.test(t)?hr:+t}mr.exports=Xs});var F=L(D=>{"use strict";D.__esModule=!0;D.extend=Cr;D.indexOf=fo;D.escapeExpression=po;D.isEmpty=mo;D.createFrame=go;D.blockParams=vo;D.appendContextPath=yo;var lo={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},uo=/[&<>"'`=]/g,co=/[&<>"'`=]/;function ho(t){return lo[t]}function Cr(t){for(var e=1;e{"use strict";je.__esModule=!0;var Wt=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function zt(t,e){var n=e&&e.loc,r=void 0,i=void 0,s=void 0,o=void 0;n&&(r=n.start.line,i=n.end.line,s=n.start.column,o=n.end.column,t+=" - "+r+":"+s);for(var a=Error.prototype.constructor.call(this,t),l=0;l{"use strict";We.__esModule=!0;var Gt=F();We.default=function(t){t.registerHelper("blockHelperMissing",function(e,n){var r=n.inverse,i=n.fn;if(e===!0)return i(this);if(e===!1||e==null)return r(this);if(Gt.isArray(e))return e.length>0?(n.ids&&(n.ids=[n.name]),t.helpers.each(e,n)):r(this);if(n.data&&n.ids){var s=Gt.createFrame(n.data);s.contextPath=Gt.appendContextPath(n.data.contextPath,n.name),n={data:s}}return i(e,n)})};Hr.exports=We.default});var Br=L((ze,Dr)=>{"use strict";ze.__esModule=!0;function wo(t){return t&&t.__esModule?t:{default:t}}var we=F(),bo=X(),Eo=wo(bo);ze.default=function(t){t.registerHelper("each",function(e,n){if(!n)throw new Eo.default("Must pass iterator to #each");var r=n.fn,i=n.inverse,s=0,o="",a=void 0,l=void 0;n.data&&n.ids&&(l=we.appendContextPath(n.data.contextPath,n.ids[0])+"."),we.isFunction(e)&&(e=e.call(this)),n.data&&(a=we.createFrame(n.data));function u(m,g,v){a&&(a.key=m,a.index=g,a.first=g===0,a.last=!!v,l&&(a.contextPath=l+m)),o=o+r(e[m],{data:a,blockParams:we.blockParams([e[m],m],[l+m,null])})}if(e&&typeof e=="object")if(we.isArray(e))for(var c=e.length;s{"use strict";Ge.__esModule=!0;function xo(t){return t&&t.__esModule?t:{default:t}}var ko=X(),So=xo(ko);Ge.default=function(t){t.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new So.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};Qr.exports=Ge.default});var Ur=L((Ke,$r)=>{"use strict";Ke.__esModule=!0;function Lo(t){return t&&t.__esModule?t:{default:t}}var Fr=F(),To=X(),Vr=Lo(To);Ke.default=function(t){t.registerHelper("if",function(e,n){if(arguments.length!=2)throw new Vr.default("#if requires exactly one argument");return Fr.isFunction(e)&&(e=e.call(this)),!n.hash.includeZero&&!e||Fr.isEmpty(e)?n.inverse(this):n.fn(this)}),t.registerHelper("unless",function(e,n){if(arguments.length!=2)throw new Vr.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:n.inverse,inverse:n.fn,hash:n.hash})})};$r.exports=Ke.default});var Wr=L((Ye,jr)=>{"use strict";Ye.__esModule=!0;Ye.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],n=arguments[arguments.length-1],r=0;r{"use strict";Je.__esModule=!0;Je.default=function(t){t.registerHelper("lookup",function(e,n,r){return e&&r.lookupProperty(e,n)})};zr.exports=Je.default});var Yr=L((Xe,Kr)=>{"use strict";Xe.__esModule=!0;function _o(t){return t&&t.__esModule?t:{default:t}}var be=F(),Po=X(),Oo=_o(Po);Xe.default=function(t){t.registerHelper("with",function(e,n){if(arguments.length!=2)throw new Oo.default("#with requires exactly one argument");be.isFunction(e)&&(e=e.call(this));var r=n.fn;if(be.isEmpty(e))return n.inverse(this);var i=n.data;return n.data&&n.ids&&(i=be.createFrame(n.data),i.contextPath=be.appendContextPath(n.data.contextPath,n.ids[0])),r(e,{data:i,blockParams:be.blockParams([e],[i&&i.contextPath])})})};Kr.exports=Xe.default});var Kt=L(Ze=>{"use strict";Ze.__esModule=!0;Ze.registerDefaultHelpers=Uo;Ze.moveHelperToHooks=jo;function se(t){return t&&t.__esModule?t:{default:t}}var Io=Nr(),Ao=se(Io),Co=Br(),Ro=se(Co),Mo=qr(),Ho=se(Mo),No=Ur(),Do=se(No),Bo=Wr(),Qo=se(Bo),qo=Gr(),Fo=se(qo),Vo=Yr(),$o=se(Vo);function Uo(t){Ao.default(t),Ro.default(t),Ho.default(t),Do.default(t),Qo.default(t),Fo.default(t),$o.default(t)}function jo(t,e,n){t.helpers[e]&&(t.hooks[e]=t.helpers[e],n||delete t.helpers[e])}});var Xr=L((et,Jr)=>{"use strict";et.__esModule=!0;var Wo=F();et.default=function(t){t.registerDecorator("inline",function(e,n,r,i){var s=e;return n.partials||(n.partials={},s=function(o,a){var l=r.partials;r.partials=Wo.extend({},l,n.partials);var u=e(o,a);return r.partials=l,u}),n.partials[i.args[0]]=i.fn,s})};Jr.exports=et.default});var Zr=L(Yt=>{"use strict";Yt.__esModule=!0;Yt.registerDefaultDecorators=Yo;function zo(t){return t&&t.__esModule?t:{default:t}}var Go=Xr(),Ko=zo(Go);function Yo(t){Ko.default(t)}});var Jt=L((tt,ei)=>{"use strict";tt.__esModule=!0;var Jo=F(),fe={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var n=Jo.indexOf(fe.methodMap,e.toLowerCase());n>=0?e=n:e=parseInt(e,10)}return e},log:function(e){if(e=fe.lookupLevel(e),typeof console<"u"&&fe.lookupLevel(fe.level)<=e){var n=fe.methodMap[e];console[n]||(n="log");for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s{"use strict";Xt.__esModule=!0;Xt.createNewLookupObject=Zo;var Xo=F();function Zo(){for(var t=arguments.length,e=Array(t),n=0;n{"use strict";Ee.__esModule=!0;Ee.createProtoAccessControl=ra;Ee.resultIsAllowed=ia;Ee.resetLoggedProperties=oa;function ea(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var ni=ti(),ta=Jt(),na=ea(ta),nt=Object.create(null);function ra(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var n=Object.create(null);return n.__proto__=!1,{properties:{whitelist:ni.createNewLookupObject(n,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:ni.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}}function ia(t,e,n){return ri(typeof t=="function"?e.methods:e.properties,n)}function ri(t,e){return t.whitelist[e]!==void 0?t.whitelist[e]===!0:t.defaultValue!==void 0?t.defaultValue:(sa(e),!1)}function sa(t){nt[t]!==!0&&(nt[t]=!0,na.log("error",'Handlebars: Access has been denied to resolve the property "'+t+`" because it is not an "own property" of its parent. +(()=>{var Os=Object.create;var zn=Object.defineProperty;var Is=Object.getOwnPropertyDescriptor;var As=Object.getOwnPropertyNames;var Cs=Object.getPrototypeOf,Rs=Object.prototype.hasOwnProperty;var L=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ms=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of As(e))!Rs.call(t,i)&&i!==n&&zn(t,i,{get:()=>e[i],enumerable:!(r=Is(e,i))||r.enumerable});return t};var Y=(t,e,n)=>(n=t!=null?Os(Cs(t)):{},Ms(e||!t||!t.__esModule?zn(n,"default",{value:t,enumerable:!0}):n,t));var vr=L((dc,gr)=>{var mr="Expected a function",fr=NaN,Qs="[object Symbol]",Fs=/^\s+|\s+$/g,qs=/^[-+]0x[0-9a-f]+$/i,Vs=/^0b[01]+$/i,$s=/^0o[0-7]+$/i,Us=parseInt,js=typeof global=="object"&&global&&global.Object===Object&&global,Ws=typeof self=="object"&&self&&self.Object===Object&&self,zs=js||Ws||Function("return this")(),Gs=Object.prototype,Ks=Gs.toString,Ys=Math.max,Js=Math.min,Bt=function(){return zs.Date.now()};function Xs(t,e,n){var r,i,s,o,a,l,u=0,c=!1,d=!1,h=!0;if(typeof t!="function")throw new TypeError(mr);e=pr(e)||0,Ve(n)&&(c=!!n.leading,d="maxWait"in n,s=d?Ys(pr(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function f(S){var R=r,U=i;return r=i=void 0,u=S,o=t.apply(U,R),o}function m(S){return u=S,a=setTimeout(w,e),c?f(S):o}function g(S){var R=S-l,U=S-u,ee=e-R;return d?Js(ee,s-U):ee}function v(S){var R=S-l,U=S-u;return l===void 0||R>=e||R<0||d&&U>=s}function w(){var S=Bt();if(v(S))return x(S);a=setTimeout(w,g(S))}function x(S){return a=void 0,h&&r?f(S):(r=i=void 0,o)}function I(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function F(){return a===void 0?o:x(Bt())}function $(){var S=Bt(),R=v(S);if(r=arguments,i=this,l=S,R){if(a===void 0)return m(l);if(d)return a=setTimeout(w,e),f(l)}return a===void 0&&(a=setTimeout(w,e)),o}return $.cancel=I,$.flush=F,$}function Zs(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(mr);return Ve(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Xs(t,e,{leading:r,maxWait:e,trailing:i})}function Ve(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function eo(t){return!!t&&typeof t=="object"}function to(t){return typeof t=="symbol"||eo(t)&&Ks.call(t)==Qs}function pr(t){if(typeof t=="number")return t;if(to(t))return fr;if(Ve(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ve(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Fs,"");var n=Vs.test(t);return n||$s.test(t)?Us(t.slice(2),n?2:8):qs.test(t)?fr:+t}gr.exports=Zs});var q=L(D=>{"use strict";D.__esModule=!0;D.extend=Rr;D.indexOf=po;D.escapeExpression=mo;D.isEmpty=go;D.createFrame=vo;D.blockParams=yo;D.appendContextPath=wo;var uo={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},co=/[&<>"'`=]/g,ho=/[&<>"'`=]/;function fo(t){return uo[t]}function Rr(t){for(var e=1;e{"use strict";We.__esModule=!0;var Wt=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function zt(t,e){var n=e&&e.loc,r=void 0,i=void 0,s=void 0,o=void 0;n&&(r=n.start.line,i=n.end.line,s=n.start.column,o=n.end.column,t+=" - "+r+":"+s);for(var a=Error.prototype.constructor.call(this,t),l=0;l{"use strict";ze.__esModule=!0;var Gt=q();ze.default=function(t){t.registerHelper("blockHelperMissing",function(e,n){var r=n.inverse,i=n.fn;if(e===!0)return i(this);if(e===!1||e==null)return r(this);if(Gt.isArray(e))return e.length>0?(n.ids&&(n.ids=[n.name]),t.helpers.each(e,n)):r(this);if(n.data&&n.ids){var s=Gt.createFrame(n.data);s.contextPath=Gt.appendContextPath(n.data.contextPath,n.name),n={data:s}}return i(e,n)})};Nr.exports=ze.default});var Qr=L((Ge,Br)=>{"use strict";Ge.__esModule=!0;function bo(t){return t&&t.__esModule?t:{default:t}}var be=q(),Eo=X(),xo=bo(Eo);Ge.default=function(t){t.registerHelper("each",function(e,n){if(!n)throw new xo.default("Must pass iterator to #each");var r=n.fn,i=n.inverse,s=0,o="",a=void 0,l=void 0;n.data&&n.ids&&(l=be.appendContextPath(n.data.contextPath,n.ids[0])+"."),be.isFunction(e)&&(e=e.call(this)),n.data&&(a=be.createFrame(n.data));function u(m,g,v){a&&(a.key=m,a.index=g,a.first=g===0,a.last=!!v,l&&(a.contextPath=l+m)),o=o+r(e[m],{data:a,blockParams:be.blockParams([e[m],m],[l+m,null])})}if(e&&typeof e=="object")if(be.isArray(e))for(var c=e.length;s{"use strict";Ke.__esModule=!0;function ko(t){return t&&t.__esModule?t:{default:t}}var So=X(),Lo=ko(So);Ke.default=function(t){t.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new Lo.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};Fr.exports=Ke.default});var jr=L((Ye,Ur)=>{"use strict";Ye.__esModule=!0;function _o(t){return t&&t.__esModule?t:{default:t}}var Vr=q(),To=X(),$r=_o(To);Ye.default=function(t){t.registerHelper("if",function(e,n){if(arguments.length!=2)throw new $r.default("#if requires exactly one argument");return Vr.isFunction(e)&&(e=e.call(this)),!n.hash.includeZero&&!e||Vr.isEmpty(e)?n.inverse(this):n.fn(this)}),t.registerHelper("unless",function(e,n){if(arguments.length!=2)throw new $r.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:n.inverse,inverse:n.fn,hash:n.hash})})};Ur.exports=Ye.default});var zr=L((Je,Wr)=>{"use strict";Je.__esModule=!0;Je.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],n=arguments[arguments.length-1],r=0;r{"use strict";Xe.__esModule=!0;Xe.default=function(t){t.registerHelper("lookup",function(e,n,r){return e&&r.lookupProperty(e,n)})};Gr.exports=Xe.default});var Jr=L((Ze,Yr)=>{"use strict";Ze.__esModule=!0;function Po(t){return t&&t.__esModule?t:{default:t}}var Ee=q(),Oo=X(),Io=Po(Oo);Ze.default=function(t){t.registerHelper("with",function(e,n){if(arguments.length!=2)throw new Io.default("#with requires exactly one argument");Ee.isFunction(e)&&(e=e.call(this));var r=n.fn;if(Ee.isEmpty(e))return n.inverse(this);var i=n.data;return n.data&&n.ids&&(i=Ee.createFrame(n.data),i.contextPath=Ee.appendContextPath(n.data.contextPath,n.ids[0])),r(e,{data:i,blockParams:Ee.blockParams([e],[i&&i.contextPath])})})};Yr.exports=Ze.default});var Kt=L(et=>{"use strict";et.__esModule=!0;et.registerDefaultHelpers=jo;et.moveHelperToHooks=Wo;function se(t){return t&&t.__esModule?t:{default:t}}var Ao=Dr(),Co=se(Ao),Ro=Qr(),Mo=se(Ro),Ho=qr(),No=se(Ho),Do=jr(),Bo=se(Do),Qo=zr(),Fo=se(Qo),qo=Kr(),Vo=se(qo),$o=Jr(),Uo=se($o);function jo(t){Co.default(t),Mo.default(t),No.default(t),Bo.default(t),Fo.default(t),Vo.default(t),Uo.default(t)}function Wo(t,e,n){t.helpers[e]&&(t.hooks[e]=t.helpers[e],n||delete t.helpers[e])}});var Zr=L((tt,Xr)=>{"use strict";tt.__esModule=!0;var zo=q();tt.default=function(t){t.registerDecorator("inline",function(e,n,r,i){var s=e;return n.partials||(n.partials={},s=function(o,a){var l=r.partials;r.partials=zo.extend({},l,n.partials);var u=e(o,a);return r.partials=l,u}),n.partials[i.args[0]]=i.fn,s})};Xr.exports=tt.default});var ei=L(Yt=>{"use strict";Yt.__esModule=!0;Yt.registerDefaultDecorators=Jo;function Go(t){return t&&t.__esModule?t:{default:t}}var Ko=Zr(),Yo=Go(Ko);function Jo(t){Yo.default(t)}});var Jt=L((nt,ti)=>{"use strict";nt.__esModule=!0;var Xo=q(),pe={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var n=Xo.indexOf(pe.methodMap,e.toLowerCase());n>=0?e=n:e=parseInt(e,10)}return e},log:function(e){if(e=pe.lookupLevel(e),typeof console<"u"&&pe.lookupLevel(pe.level)<=e){var n=pe.methodMap[e];console[n]||(n="log");for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s{"use strict";Xt.__esModule=!0;Xt.createNewLookupObject=ea;var Zo=q();function ea(){for(var t=arguments.length,e=Array(t),n=0;n{"use strict";xe.__esModule=!0;xe.createProtoAccessControl=ia;xe.resultIsAllowed=sa;xe.resetLoggedProperties=aa;function ta(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var ri=ni(),na=Jt(),ra=ta(na),rt=Object.create(null);function ia(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var n=Object.create(null);return n.__proto__=!1,{properties:{whitelist:ri.createNewLookupObject(n,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:ri.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}}function sa(t,e,n){return ii(typeof t=="function"?e.methods:e.properties,n)}function ii(t,e){return t.whitelist[e]!==void 0?t.whitelist[e]===!0:t.defaultValue!==void 0?t.defaultValue:(oa(e),!1)}function oa(t){rt[t]!==!0&&(rt[t]=!0,ra.log("error",'Handlebars: Access has been denied to resolve the property "'+t+`" because it is not an "own property" of its parent. You can add a runtime option to disable the check or this warning: -See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function oa(){Object.keys(nt).forEach(function(t){delete nt[t]})}});var rn=L(j=>{"use strict";j.__esModule=!0;j.HandlebarsEnvironment=nn;function ii(t){return t&&t.__esModule?t:{default:t}}var oe=F(),aa=X(),en=ii(aa),la=Kt(),ua=Zr(),ca=Jt(),rt=ii(ca),da=Zt(),ha="4.7.7";j.VERSION=ha;var fa=8;j.COMPILER_REVISION=fa;var pa=7;j.LAST_COMPATIBLE_COMPILER_REVISION=pa;var ma={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};j.REVISION_CHANGES=ma;var tn="[object Object]";function nn(t,e,n){this.helpers=t||{},this.partials=e||{},this.decorators=n||{},la.registerDefaultHelpers(this),ua.registerDefaultDecorators(this)}nn.prototype={constructor:nn,logger:rt.default,log:rt.default.log,registerHelper:function(e,n){if(oe.toString.call(e)===tn){if(n)throw new en.default("Arg not supported with multiple helpers");oe.extend(this.helpers,e)}else this.helpers[e]=n},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,n){if(oe.toString.call(e)===tn)oe.extend(this.partials,e);else{if(typeof n>"u")throw new en.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=n}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,n){if(oe.toString.call(e)===tn){if(n)throw new en.default("Arg not supported with multiple decorators");oe.extend(this.decorators,e)}else this.decorators[e]=n},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){da.resetLoggedProperties()}};var ga=rt.default.log;j.log=ga;j.createFrame=oe.createFrame;j.logger=rt.default});var oi=L((it,si)=>{"use strict";it.__esModule=!0;function sn(t){this.string=t}sn.prototype.toString=sn.prototype.toHTML=function(){return""+this.string};it.default=sn;si.exports=it.default});var ai=L(on=>{"use strict";on.__esModule=!0;on.wrapHelper=va;function va(t,e){if(typeof t!="function")return t;var n=function(){var i=arguments[arguments.length-1];return arguments[arguments.length-1]=e(i),t.apply(this,arguments)};return n}});var hi=L(Z=>{"use strict";Z.__esModule=!0;Z.checkRevision=ka;Z.template=Sa;Z.wrapProgram=st;Z.resolvePartial=La;Z.invokePartial=Ta;Z.noop=ci;function ya(t){return t&&t.__esModule?t:{default:t}}function wa(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var ba=F(),z=wa(ba),Ea=X(),G=ya(Ea),K=rn(),li=Kt(),xa=ai(),ui=Zt();function ka(t){var e=t&&t[0]||1,n=K.COMPILER_REVISION;if(!(e>=K.LAST_COMPATIBLE_COMPILER_REVISION&&e<=K.COMPILER_REVISION))if(e{"use strict";ot.__esModule=!0;ot.default=function(t){var e=typeof global<"u"?global:window,n=e.Handlebars;t.noConflict=function(){return e.Handlebars===t&&(e.Handlebars=n),t}};fi.exports=ot.default});var ae=L((at,yi)=>{"use strict";at.__esModule=!0;function ln(t){return t&&t.__esModule?t:{default:t}}function un(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var Ia=rn(),mi=un(Ia),Aa=oi(),Ca=ln(Aa),Ra=X(),Ma=ln(Ra),Ha=F(),an=un(Ha),Na=hi(),gi=un(Na),Da=pi(),Ba=ln(Da);function vi(){var t=new mi.HandlebarsEnvironment;return an.extend(t,mi),t.SafeString=Ca.default,t.Exception=Ma.default,t.Utils=an,t.escapeExpression=an.escapeExpression,t.VM=gi,t.template=function(e){return gi.template(e,t)},t}var xe=vi();xe.create=vi;Ba.default(xe);xe.default=xe;at.default=xe;yi.exports=at.default});var zi=L((ji,Wi)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var c=t.utils.clone(n)||{};c.position=[a,u],c.index=s.length,s.push(new t.Token(r.slice(a,o),c))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?c+=2:a==l&&(n+=r[u+1]*i[c+1],u+=2,c+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=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 t.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 t.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 t.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 c=s.str.charAt(0),d=s.str.charAt(1),h;d in s.node.edges?h=s.node.edges[d]:(h=new t.TokenSet,s.node.edges[d]=h),s.str.length==1&&(h.final=!0),i.push({node:h,editsRemaining:s.editsRemaining-1,str:c+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;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()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.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=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.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 t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ji=="object"?Wi.exports=n():e.lunr=n()}(this,function(){return t})})()});var zn=new URLSearchParams(window.location.search),Gn=window.self!==window.parent,Pt=Gn&&zn.has("preview"),Ot=Gn&&zn.has("hint"),A=Pt||Ot;function Ae(){return window.sidebarNodes||{}}function Kn(){return window.versionNodes||[]}var f=document.querySelector.bind(document),M=document.querySelectorAll.bind(document);function Yn(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Re(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function Me(){return document.getElementById("main").dataset.type}var Ce=["H1","H2","H3","H4","H5","H6"];function He(t=!1){let e=window.location.hash.replace(/^#/,"");if(!e)return t?document.getElementById("top-content"):null;let n=document.getElementById(e);if(!n)return null;if(n.matches(".detail"))return n;if(Ce.includes(n.tagName))return It(n);let r=Ms(n);return r||document.getElementById("top-content")}function Ms(t){let e=t.previousElementSibling;for(;e;){if(Ce.includes(e.tagName))return It(e);e=e.previousElementSibling}let n=t.parentNode;for(;n;){for(e=n.previousElementSibling;e;){if(Ce.includes(e.tagName))return It(e);e=e.previousElementSibling}n=n.parentNode}return null}function It(t){let e=document.createElement("div"),n=[t],r=t;for(;(r=r.nextSibling)&&!(Ce.includes(r.tagName)&&r.tagName<=t.tagName);)n.push(r);return e.append(...n),e}function Jn(t){return new URLSearchParams(window.location.search).get(t)}function At(t){return fetch(t).then(e=>e.ok).catch(()=>!1)}function he(t){return!t||t.trim()===""}function Xn(t,e){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{n=null,t(...i)},e)}}function Ne(){return document.head.querySelector("meta[name=project][content]").content}function De(){return document.documentElement.classList.contains("apple-os")}function E(t,e,n){let r=document.createElement(t);for(let i in e)e[i]!=null&&r.setAttribute(i,e[i]);return n&&r.replaceChildren(...n),r}if(Pt&&A){let t=He(!0);if(t){document.body.classList.add("preview"),document.getElementById("content").replaceChildren(...t.childNodes);let e=document.getElementsByTagName("a:not([target=_blank]");for(let n of e)n.setAttribute("target","_parent");window.scrollTo(0,0),document.body.style.position="fixed",setTimeout(Zn),window.addEventListener("resize",Zn)}}function Zn(){let t={type:"preview",contentHeight:document.getElementById("content").parentElement.offsetHeight};window.parent.postMessage(t,"*")}var ie={plain:"plain",function:"function",module:"module"},Hs=[{href:"typespecs.html#basic-types",hint:{kind:ie.plain,description:"Basic type"}},{href:"typespecs.html#literals",hint:{kind:ie.plain,description:"Literal"}},{href:"typespecs.html#built-in-types",hint:{kind:ie.plain,description:"Built-in type"}}],Be={cancelHintFetching:null};function er(t){if(nr(t))return!0;let e=/#.*\//;return t.includes("#")&&!e.test(t)?!1:t.includes(".html")}function tr(t){let e=nr(t);return e?Promise.resolve(e):Ns(t)}function nr(t){let e=Hs.find(n=>t.includes(n.href));return e?e.hint:null}function Ns(t){let e=t.replace(".html",".html?hint=true");return new Promise((n,r)=>{let i=document.createElement("iframe");i.setAttribute("src",e),i.style.display="none";function s(a){let{href:l,hint:u}=a.data;e===l&&(o(),n(u))}Be.cancelHintFetching=()=>{o(),r(new Error("cancelled"))};function o(){i.remove(),window.removeEventListener("message",s),Be.cancelHintFetching=null}window.addEventListener("message",s),document.body.appendChild(i)})}function rr(){Be.cancelHintFetching&&Be.cancelHintFetching()}function ir(t){let n=t.querySelector("h1").textContent,r=t.querySelector(".docstring > p"),i=r?r.innerHTML:"";return{kind:ie.function,title:n.trim(),description:i.trim()}}function sr(t){let n=t.querySelector("h1 > span").textContent,r=t.querySelector("#moduledoc p"),i=r?r.innerHTML:"";return{kind:ie.module,title:n.trim(),description:i.trim()}}if(Ot&&A){let t=He(),e=t?ir(t):["modules","tasks"].includes(Me())?sr(f(".content-inner")):null;if(e){let n={hint:{...e,version:Ne()},href:window.location.href};window.parent.postMessage(n,"*")}f(".content-inner")?.replaceChildren()}var Ct="ex_doc:settings",or="dark",Rt="system",Mt="dark",Ht="light";var Ds={tooltips:!0,theme:null,livebookUrl:null},Nt=class{constructor(){this._subscribers=[],this._settings=Ds,this._loadSettings()}get(){return this._settings}update(e){let n=this._settings;this._settings={...this._settings,...e},this._subscribers.forEach(r=>r(this._settings,n)),this._storeSettings()}getAndSubscribe(e){this._subscribers.push(e),e(this._settings)}_loadSettings(){try{let e=localStorage.getItem(Ct);if(e){let n=JSON.parse(e);this._settings={...this._settings,...n}}this._loadSettingsLegacy()}catch(e){console.error(`Failed to load settings: ${e}`)}}_storeSettings(){try{this._storeSettingsLegacy(),localStorage.setItem(Ct,JSON.stringify(this._settings))}catch(e){console.error(`Failed to persist settings: ${e}`)}}_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"))}},H=new Nt;var ar=!1,Qe=null,J=null;function lr(t){ar||(ar=!0,J=document.getElementById("toast"),J?.addEventListener("click",()=>{clearTimeout(Qe),J.classList.remove("show")})),J&&(clearTimeout(Qe),J.innerText=t,J.classList.add("show"),Qe=setTimeout(()=>{J.classList.remove("show"),Qe=setTimeout(function(){J.innerText=""},1e3)},5e3))}var Dt=[Rt,Mt,Ht],ur=window.matchMedia("(prefers-color-scheme: dark)");H.getAndSubscribe(cr);ur.addEventListener("change",cr);function cr(){let t=qe(),e=t===Mt||t!==Ht&&ur.matches;document.body.classList.toggle(or,e)}function dr(){let t=Dt[Dt.indexOf(qe())+1]||Dt[0];H.update({theme:t}),lr(`Set theme to "${t}"`)}function qe(){return new URLSearchParams(window.location.search).get("theme")||H.get().theme||Rt}var Sr=Y(gr());var Qt="sidebar_state",qt="closed",vr="open",yr="sidebar_width";var Ve="sidebar-open",$e="sidebar-transition";var wr=!1;function br(){if(wr)return;wr=!0;let t=document.getElementById("sidebar-list-nav");if(!t)return;let e=Me(),n={extras:t.dataset.extras||"Pages",modules:"Modules",tasks:'Mix Tasks'};Object.entries(n).forEach(([r,i])=>{let s=Ae()[r];if(!s?.length)return;let o=`${r}-list-tab-button`,a=`${r}-tab-panel`,l=r===e,u=E("button",{id:o,role:"tab",tabindex:l?0:-1,"aria-selected":l||void 0,"aria-controls":a});u.innerHTML=i,u.addEventListener("keydown",ro),u.addEventListener("click",io),t.appendChild(E("li",{},[u]));let c=E("ul",{class:"full-list"});c.addEventListener("click",so);let d=E("div",{id:a,class:"sidebar-tabpanel",role:"tabpanel","aria-labelledby":o,hidden:l?void 0:""},[c]);document.getElementById("sidebar").appendChild(d);let h="",p,m;c.replaceChildren(...s.flatMap(g=>{let v=[],w=Array.isArray(g.headers),x=w?void 0:"no";return g.group!==h&&(v.push(E("li",{class:"group",translate:x},[g.group])),h=g.group,p=void 0),g.nested_context&&g.nested_context!==p?(p=g.nested_context,m!==p&&v.push(E("li",{class:"nesting-context",translate:"no","aria-hidden":!0},[p]))):m=g.title,v.push(E("li",{},[E("a",{href:`${g.id}.html`,translate:x},[g.nested_title||g.title]),...Vt(`node-${g.id}-headers`,w?to(g):no(g))])),v}))}),Ft(),requestAnimationFrame(Er),window.addEventListener("hashchange",Ft),window.addEventListener("exdoc:loaded",Ft)}function Vt(t,e){return e.length?[E("button",{"aria-label":"expand","aria-expanded":!1,"aria-controls":t}),E("ul",{id:t},e)]:[]}function to(t){return t.headers.map(({id:e,anchor:n})=>E("li",{},[E("a",{href:`${t.id}.html#${n}`},[e])]))}function no(t){let e=[];return t.sections?.length&&e.push(E("li",{},[E("a",{href:`${t.id}.html#content`},["Sections"]),...Vt(`${t.id}-sections-list`,t.sections.map(({id:n,anchor:r})=>E("li",{},[E("a",{href:`${t.id}.html#${r}`},[n])])))])),t.nodeGroups&&(e.push(E("li",{},[E("a",{href:`${t.id}.html#summary`},["Summary"])])),e.push(...t.nodeGroups.map(({key:n,name:r,nodes:i})=>E("li",{},[E("a",{href:`${t.id}.html#${n}`},[r]),...Vt(`node-${t.id}-group-${n}-list`,i.map(({anchor:s,title:o,id:a})=>E("li",{},[E("a",{href:`${t.id}.html#${s}`,title:o,translate:"no"},[a])])))])))),e}function $t(t){let e=document.getElementById("sidebar-list-nav").querySelector("[aria-selected]");e!==t&&(e&&(e.removeAttribute("aria-selected"),e.setAttribute("tabindex","-1"),document.getElementById(e.getAttribute("aria-controls")).setAttribute("hidden","hidden")),t.setAttribute("aria-selected","true"),t.setAttribute("tabindex","0"),document.getElementById(t.getAttribute("aria-controls")).removeAttribute("hidden"))}function Er(){f("#sidebar [role=tabpanel]:not([hidden]) a[aria-selected]")?.scrollIntoView()}function Ft(){let t=document.getElementById("sidebar"),{pathname:e,hash:n}=window.location,r=e.split("/").pop().replace(/\.html$/,"")+".html",i=t.querySelector(`li a[href="${r+n}"]`)||t.querySelector(`li a[href="${r}"]`);if(!i)return;t.querySelectorAll(".full-list a[aria-selected]").forEach(o=>{o.removeAttribute("aria-selected")}),t.querySelectorAll(".full-list button[aria-expanded=true]").forEach(o=>{o.setAttribute("aria-expanded",!1)});let s=i.parentElement;for(;s;){if(s.tagName==="LI"){let o=s.firstChild;o.setAttribute("aria-selected",o.getAttribute("href")===r?"page":"true");let a=o.nextSibling;a?.tagName==="BUTTON"&&a.setAttribute("aria-expanded",!0)}else if(s.role==="tabpanel"){s.hasAttribute("hidden")&&$t(document.getElementById(s.getAttribute("aria-labelledby")));break}s=s.parentElement}}function ro(t){if(!["ArrowRight","ArrowLeft"].includes(t.key))return;let e=Array.from(M('#sidebar-list-nav [role="tab"]')),r=e.indexOf(t.currentTarget)+(t.key==="ArrowRight"?1:-1),i=e.at(r%e.length);$t(i),i.focus()}function io(t){$t(t.currentTarget),Er()}function so(t){let e=t.target;e.tagName==="BUTTON"&&e.setAttribute("aria-expanded",e.getAttribute("aria-expanded")==="false")}var ao=300,Lr=".sidebar-toggle",Tr=window.matchMedia(`screen and (max-width: ${768}px)`);if(!A){window.addEventListener("exdoc:loaded",xr);let t=document.getElementById("sidebar"),e=f(Lr);e.addEventListener("click",Ue),document.body.addEventListener("click",i=>{Tr.matches&&_r()&&!t.contains(i.target)&&!e.contains(i.target)&&Ue()});let n=window.innerWidth;window.addEventListener("resize",(0,Sr.default)(()=>{n!==window.innerWidth&&(n=window.innerWidth,xr())},100));let r=new ResizeObserver(([i])=>{if(!i)return;let s=i.contentRect.width;sessionStorage.setItem(yr,s),document.body.style.setProperty("--sidebarWidth",`${s}px`)});t.addEventListener("mousedown",()=>r.observe(t)),t.addEventListener("mouseup",()=>r.unobserve(t))}function xr(){let e=sessionStorage.getItem(Qt)!==qt&&!Tr.matches;Or(e)}function Ue(){let t=!_r();return sessionStorage.setItem(Qt,t?vr:qt),Ir(t)}function _r(){return document.body.classList.contains(Ve)}function Pr(){return document.body.classList.contains(Ve)&&!document.body.classList.contains($e)}function Or(t){t&&br(),document.body.classList.toggle(Ve,t),f(Lr).setAttribute("aria-expanded",t?"true":"false")}var kr;function Ir(t){return new Promise(e=>{document.body.classList.add($e),document.body.scrollTop,Or(t),clearTimeout(kr),kr=setTimeout(()=>{document.body.classList.remove($e),e()},ao)})}function Ar(){return Ir(!0)}var wi=Y(ae());var cn=Y(ae());cn.registerHelper("isArray",function(t,e){return Array.isArray(t)?e.fn(this):e.inverse(this)});cn.registerHelper("isNonEmptyArray",function(t,e){return Array.isArray(t)&&t.length>0?e.fn(this):e.inverse(this)});var bi=wi.template({1:function(t,e,n,r,i){var s,o,a=e??(t.nullContext||{}),l=t.hooks.helperMissing,u="function",c=t.escapeExpression,d=t.lookupProperty||function(h,p){if(Object.prototype.hasOwnProperty.call(h,p))return h[p]};return'