e=this,t=function(){"use strict";function V(e,t){var n,s=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)),s}function h(e){for(var t,n=1;ne.length)&&(t=e.length);for(var n=0,s=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,e=new Map,t=Math.pow(10,s);return{get:function(s){if(o=s.match(Q).length,e.has(o))return e.get(o);var o,a=1/Math.pow(o,.5*n),i=parseFloat(Math.round(a*t)/t);return e.set(o,i),i},clear:function(){e.clear()}}}f=function(){function i(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=n.getFn,a=void 0===s?e.getFn:s,o=n.fieldNormWeight,r=void 0===o?e.fieldNormWeight:o;t(this,i),this.norm=X(r,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}return n(i,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=e,this._keysMap={},e.forEach(function(e,n){t._keysMap[e.id]=n})}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,o(this.docs[0])?this.docs.forEach(function(t,n){e._addString(t,n)}):this.docs.forEach(function(t,n){e._addObject(t,n)}),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();o(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},i=o.getFn,r=void 0===i?e.getFn:i,a=o.fieldNormWeight,c=void 0===a?e.fieldNormWeight:a,s=new f({getFn:r,fieldNormWeight:c});return s.setKeys(t.map(A)),s.setSources(n),s.create(),s}function m(t){var o,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=n.errors,h=void 0===d?0:d,i=n.currentLocation,u=void 0===i?0:i,a=n.expectedLocation,f=void 0===a?0:a,r=n.distance,c=void 0===r?e.distance:r,l=n.ignoreLocation,m=void 0===l?e.ignoreLocation:l,s=h/t.length;return m?s:(o=Math.abs(f-u),c?s+o/c:o?1:s)}function G(){for(var o,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.minMatchCharLength,i=[],t=-1,a=-1,n=0,c=s.length;n=r&&i.push([t,a]),t=-1);return s[n-1]&&n-t>=r&&i.push([t,n-1]),i}l=32;function Y(e){for(var s,n={},t=0,o=e.length;t1&&void 0!==arguments[1]?arguments[1]:{},v=o.location,E=void 0===v?e.location:v,h=o.threshold,C=void 0===h?e.threshold:h,u=o.distance,x=void 0===u?e.distance:u,m=o.includeMatches,O=void 0===m?e.includeMatches:m,p=o.findAllMatches,_=void 0===p?e.findAllMatches:p,j=o.minMatchCharLength,y=void 0===j?e.minMatchCharLength:j,d=o.isCaseSensitive,b=void 0===d?e.isCaseSensitive:d,g=o.ignoreLocation,w=void 0===g?e.ignoreLocation:g;if(t(this,s),this.options={location:E,threshold:C,distance:x,includeMatches:O,findAllMatches:_,minMatchCharLength:y,isCaseSensitive:b,ignoreLocation:w},this.pattern=b?n:n.toLowerCase(),this.chunks=[],this.pattern.length)if(r=function(e,t){A.chunks.push({pattern:e,alphabet:Y(e),startIndex:t})},i=this.pattern.length,i>l){for(var a=0,f=i%l,k=i-f;a3&&void 0!==arguments[3]?arguments[3]:{},F=c.location,V=void 0===F?e.location:F,R=c.distance,b=void 0===R?e.distance:R,T=c.threshold,U=void 0===T?e.threshold:T,N=c.findAllMatches,$=void 0===N?e.findAllMatches:N,B=c.minMatchCharLength,z=void 0===B?e.minMatchCharLength:B,D=c.includeMatches,L=void 0===D?e.includeMatches:D,H=c.ignoreLocation,y=void 0===H?e.ignoreLocation:H;if(n.length>l)throw new Error(oe(l));for(var _,d=n.length,g=t.length,i=Math.max(0,Math.min(V,g)),h=U,f=i,O=z>1||L,S=O?Array(g):[];(_=t.indexOf(n,f))>-1;)if(I=m(n,{currentLocation:_,expectedLocation:i,distance:b,ignoreLocation:y}),h=Math.min(I,h),f=_+d,O)for(x=0;x=P;o-=1)if(v=o-1,A=s[t.charAt(v)],O&&(S[v]=+!!A),u[o]=(u[o+1]<<1|1)&A,r&&(u[o]|=(C[o+1]|C[o])<<1|1|C[o+1]),u[o]&W&&(k=m(n,{errors:r,currentLocation:v,expectedLocation:i,distance:b,ignoreLocation:y}))<=h){if(h=k,(f=v)<=i)break;P=Math.max(1,2*i-f)}if(m(n,{errors:r+1,currentLocation:i,expectedLocation:i,distance:b,ignoreLocation:y})>h)break;C=u}return w={isMatch:f>=0,score:Math.max(.001,k)},O&&(M=G(S,z),M.length?L&&(w.indices=M):w.isMatch=!1),w}(t,w,b,{location:v+y,distance:g,threshold:j,findAllMatches:h,minMatchCharLength:f,includeMatches:i,ignoreLocation:p}),u=o.isMatch,_=o.score,a=o.indices;u&&(s=!0),c+=_,u&&a&&(r=[].concat(d(r),d(a)))}),o={isMatch:s,score:s?c/this.chunks.length:1},s&&i&&(o.indices=r),o}}]),s}(),i=function(){function e(n){t(this,e),this.pattern=n}return n(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return I(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return I(e,this.singleRegex)}}]),e}();function I(e,t){var n=e.match(t);return n?n[1]:null}var i,l,u,f,y,ge=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),s}(i),ne=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),s}(i),W=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),s}(i),U=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),s}(i),K=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),s}(i),q=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),s}(i),P=function(s){r(o,s);var i=c(o);function o(n){var f,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=s.location,w=void 0===r?e.location:r,l=s.threshold,j=void 0===l?e.threshold:l,u=s.distance,v=void 0===u?e.distance:u,m=s.includeMatches,p=void 0===m?e.includeMatches:m,a=s.findAllMatches,g=void 0===a?e.findAllMatches:a,h=s.minMatchCharLength,b=void 0===h?e.minMatchCharLength:h,d=s.isCaseSensitive,_=void 0===d?e.isCaseSensitive:d,c=s.ignoreLocation,O=void 0===c?e.ignoreLocation:c;return t(this,o),(f=i.call(this,n))._bitapSearch=new y(n,{location:w,threshold:j,distance:v,includeMatches:p,findAllMatches:g,minMatchCharLength:b,isCaseSensitive:_,ignoreLocation:O}),f}return n(o,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),o}(i),L=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){for(var t,o,n=0,s=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,s.push([t,n-1]);return o=!!s.length,{isMatch:o,score:o?0:1,indices:s}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),s}(i),_=[ge,L,W,U,q,K,ne,P],F=_.length,Z=/ +(?=(?:[^"]*"[^"]*")*[^"]*$)/;function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map(function(e){for(var i,a,c,l,d=e.trim().split(Z).filter(function(e){return e&&!!e.trim()}),s=[],o=0,h=d.length;o1&&void 0!==arguments[1]?arguments[1]:{},a=o.isCaseSensitive,h=void 0===a?e.isCaseSensitive:a,r=o.includeMatches,j=void 0===r?e.includeMatches:r,l=o.minMatchCharLength,v=void 0===l?e.minMatchCharLength:l,u=o.ignoreLocation,f=void 0===u?e.ignoreLocation:u,m=o.findAllMatches,p=void 0===m?e.findAllMatches:m,i=o.location,g=void 0===i?e.location:i,d=o.threshold,b=void 0===d?e.threshold:d,c=o.distance,y=void 0===c?e.distance:c;t(this,s),this.query=null,this.options={isCaseSensitive:h,includeMatches:j,minMatchCharLength:v,findAllMatches:p,ignoreLocation:f,location:g,threshold:b,distance:y},this.pattern=h?n:n.toLowerCase(),this.query=J(this.pattern,this.options)}return n(s,[{key:"searchIn",value:function(e){if(o=this.query,!o)return{isMatch:!1,score:1};u=this.options,i=u.includeMatches,e=u.isCaseSensitive?e:e.toLowerCase();for(var s,o,i,l,u,h,m,p,n=0,t=[],a=0,r=0,v=o.length;r-1&&(n.refIndex=e.idx),t.matches.push(n)}})}function fe(e,t){t.score=e.score}function pe(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.includeMatches,r=void 0===i?e.includeMatches:i,a=o.includeScore,c=void 0===a?e.includeScore:a,s=[];return r&&s.push(me),c&&s.push(fe),t.map(function(e){var t=e.idx,o={item:n[t],refIndex:t};return s.length&&s.forEach(function(t){t(e,o)}),o})}return u=function(){function i(n){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;t(this,i),this.options=h(h({},e),s),this.options.useExtendedSearch,this._keyStore=new se(this.options.keys),this.setCollection(n,o)}return n(i,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof f))throw new Error("Incorrect 'index' type");this._myIndex=t||D(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){s(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},n=[],e=0,s=this._docs.length;e1&&void 0!==arguments[1]?arguments[1]:{},i=a.limit,s=void 0===i?-1:i,t=this.options,r=t.includeMatches,c=t.includeScore,l=t.shouldSort,d=t.sortFn,u=t.ignoreFieldNorm,n=o(e)?o(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return he(n,{ignoreFieldNorm:u}),l&&n.sort(d),N(s)&&s>-1&&(n=n.slice(0,s)),pe(n,this._docs,{includeMatches:r,includeScore:c})}},{key:"_searchStringList",value:function(e){var n=C(e,this.options),o=this._myIndex.records,t=[];return o.forEach(function(e){var o=e.v,a=e.i,r=e.n;if(s(o)){var i=n.searchIn(o),c=i.isMatch,l=i.score,d=i.indices;c&&t.push({item:o,idx:a,matches:[{score:l,value:o,norm:r,indices:d}]})}}),t}},{key:"_searchLogical",value:function(e){var n=this,r=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,s=void 0===n||n,i=function e(n){var r,c,d,u,i=Object.keys(n),l=le(n);if(!l&&i.length>1&&!w(n))return e(R(n));if(de(n)){if(r=l?n[M]:i[0],c=l?n[re]:n[r],!o(c))throw new Error(ae(r));return d={keyId:E(r),pattern:c},s&&(d.searcher=C(c,t)),d}return u={children:[],operator:i[0]},i.forEach(function(t){var s=n[t];a(s)&&s.forEach(function(t){u.children.push(e(t))})}),u};return w(e)||(e=R(e)),i(e)}(e,this.options),c=function e(t,s,o){if(!t.children){var i,l=t.keyId,u=t.searcher,a=n._findMatches({key:n._keyStore.get(l),value:n._myIndex.getValueForItemAtKeyId(s,l),searcher:u});return a&&a.length?[{idx:o,item:s,matches:a}]:[]}for(var r=[],c=0,h=t.children.length;c1&&void 0!==arguments[1]?arguments[1]:{},i=s.getFn,a=void 0===i?e.getFn:i,o=s.fieldNormWeight,r=void 0===o?e.fieldNormWeight:o,c=t.keys,l=t.records,n=new f({getFn:a,fieldNormWeight:r});return n.setKeys(c),n.setIndexRecords(l),n},u.config=e,function(){p.push.apply(p,arguments)}(te),u},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t();var e,t,fuse,showButton=document.getElementById("search-button"),scriptBundle,copyText,copiedText,hideButton=document.getElementById("close-search-button"),wrapper=document.getElementById("search-wrapper"),modal=document.getElementById("search-modal"),input=document.getElementById("search-query"),output=document.getElementById("search-results"),first=output.firstChild,last=output.lastChild,searchVisible=!1,indexed=!1,hasResults=!1;showButton.addEventListener("click",displaySearch),hideButton.addEventListener("click",hideSearch),wrapper.addEventListener("click",hideSearch),modal.addEventListener("click",function(e){return e.stopPropagation(),e.stopImmediatePropagation(),!1}),document.addEventListener("keydown",function(e){e.key=="/"&&(searchVisible||(e.preventDefault(),displaySearch())),e.key=="Escape"&&hideSearch(),e.key=="ArrowDown"&&searchVisible&&hasResults&&(e.preventDefault(),document.activeElement==input?first.focus():document.activeElement==last?last.focus():document.activeElement.parentElement.nextSibling.firstElementChild.focus()),e.key=="ArrowUp"&&searchVisible&&hasResults&&(e.preventDefault(),document.activeElement==input?input.focus():document.activeElement==first?input.focus():document.activeElement.parentElement.previousSibling.firstElementChild.focus())}),input.onkeyup=function(){executeQuery(this.value)};function displaySearch(){indexed||buildIndex(),searchVisible||(document.body.style.overflow="hidden",wrapper.style.visibility="visible",input.focus(),searchVisible=!0)}function hideSearch(){searchVisible&&(document.body.style.overflow="visible",wrapper.style.visibility="hidden",input.value="",output.innerHTML="",document.activeElement.blur(),searchVisible=!1)}function fetchJSON(e,t){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState===4&&n.status===200){var e=JSON.parse(n.responseText);t&&t(e)}},n.open("GET",e),n.send()}function buildIndex(){var e=wrapper.getAttribute("data-url"),e=e.replace(/\/?$/,"/");fetchJSON(e+"index.json",function(e){var t={shouldSort:!0,ignoreLocation:!0,threshold:0,includeMatches:!0,keys:[{name:"title",weight:.8},{name:"section",weight:.2},{name:"summary",weight:.6},{name:"content",weight:.4}]};fuse=new Fuse(e,t),indexed=!0})}function executeQuery(e){let n=fuse.search(e),t="";n.length>0?(n.forEach(function(e){t=t+`
  • ${e.item.title}
    ${e.item.section}·${e.item.date}
    ${e.item.summary}
  • `}),hasResults=!0):(t="",hasResults=!1),output.innerHTML=t,n.length>0&&(first=output.firstChild.firstElementChild,last=output.lastChild.firstElementChild)}scriptBundle=document.getElementById("script-bundle"),copyText=scriptBundle?scriptBundle.getAttribute("data-copy"):"Copy",copiedText=scriptBundle?scriptBundle.getAttribute("data-copied"):"Copied";function createCopyButton(e){const t=document.createElement("button");t.className="copy-button",t.type="button",t.ariaLabel=copyText,t.innerText=copyText,t.addEventListener("click",()=>copyCodeToClipboard(t,e)),addCopyButtonToDom(t,e)}async function copyCodeToClipboard(e,t){const n=t.querySelector(":last-child > .chroma > code").innerText;try{result=await navigator.permissions.query({name:"clipboard-write"}),result.state=="granted"||result.state=="prompt"?await navigator.clipboard.writeText(n):copyCodeBlockExecCommand(n,t)}catch{copyCodeBlockExecCommand(n,t)}finally{codeWasCopied(e)}}function copyCodeBlockExecCommand(e,t){const n=document.createElement("textArea");n.contentEditable="true",n.readOnly="false",n.className="copy-textarea",n.value=e,t.insertBefore(n,t.firstChild);const s=document.createRange();s.selectNodeContents(n);const o=window.getSelection();o.removeAllRanges(),o.addRange(s),n.setSelectionRange(0,999999),document.execCommand("copy"),t.removeChild(n)}function codeWasCopied(e){e.blur(),e.innerText=copiedText,setTimeout(function(){e.innerText=copyText},2e3)}function addCopyButtonToDom(e,t){t.insertBefore(e,t.firstChild);const n=document.createElement("div");n.className="highlight-wrapper",t.parentNode.insertBefore(n,t),n.appendChild(t)}window.addEventListener("DOMContentLoaded",e=>{document.querySelectorAll(".highlight").forEach(e=>createCopyButton(e))})