e=this,t=function(){"use strict";function V(t,s){var e,n=Object.keys(t);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(t),s&&(e=e.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,e)),n}function h(n){for(var e,t=1;tn.length)&&(e=n.length);for(var t=0,s=new Array(e);t0&&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(i){if(s=i.match(Q).length,e.has(s))return e.get(s);var s,a=1/Math.pow(s,.5*n),o=parseFloat(Math.round(a*t)/t);return e.set(s,o),o},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(t){this.records.splice(t,1);for(var e=t,n=this.size();e2&&void 0!==arguments[2]?arguments[2]:{},s=n.getFn,a=void 0===s?e.getFn:s,o=n.fieldNormWeight,r=void 0===o?e.fieldNormWeight:o,t=new f({getFn:a,fieldNormWeight:r});return t.setKeys(i.map(A)),t.setSources(c),t.create(),t}function m(f){var s,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.errors,m=void 0===i?0:i,a=t.currentLocation,u=void 0===a?0:a,c=t.expectedLocation,d=void 0===c?0:c,l=t.distance,o=void 0===l?e.distance:l,r=t.ignoreLocation,h=void 0===r?e.ignoreLocation:r,n=m/f.length;return h?n:(s=Math.abs(d-u),o?n+s/o:s?1:n)}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(s){for(var n,t={},e=0,o=s.length;e1&&void 0!==arguments[1]?arguments[1]:{},h=n.location,C=void 0===h?e.location:h,d=n.threshold,x=void 0===d?e.threshold:d,u=n.distance,O=void 0===u?e.distance:u,m=n.includeMatches,_=void 0===m?e.includeMatches:m,p=n.findAllMatches,A=void 0===p?e.findAllMatches:p,v=n.minMatchCharLength,y=void 0===v?e.minMatchCharLength:v,c=n.isCaseSensitive,b=void 0===c?e.isCaseSensitive:c,f=n.ignoreLocation,w=void 0===f?e.ignoreLocation:f;if(t(this,s),this.options={location:C,threshold:x,distance:O,includeMatches:_,findAllMatches:A,minMatchCharLength:y,isCaseSensitive:b,ignoreLocation:w},this.pattern=b?j:j.toLowerCase(),this.chunks=[],this.pattern.length)if(i=function(e,t){E.chunks.push({pattern:e,alphabet:Y(e),startIndex:t})},o=this.pattern.length,o>l){for(var a=0,g=o%l,k=o-g;a3&&void 0!==arguments[3]?arguments[3]:{},R=i.location,V=void 0===R?e.location:R,L=i.distance,g=void 0===L?e.distance:L,N=i.threshold,$=void 0===N?e.threshold:N,I=i.findAllMatches,B=void 0===I?e.findAllMatches:I,D=i.minMatchCharLength,z=void 0===D?e.minMatchCharLength:D,T=i.includeMatches,F=void 0===T?e.includeMatches:T,H=i.ignoreLocation,y=void 0===H?e.ignoreLocation:H;if(a.length>l)throw new Error(eo(l));for(var _,u=a.length,p=k.length,n=Math.max(0,Math.min(V,p)),c=$,d=n,v=z>1||F,A=v?Array(p):[];(_=k.indexOf(a,d))>-1;)if(M=m(a,{currentLocation:_,expectedLocation:n,distance:g,ignoreLocation:y}),c=Math.min(M,c),d=_+u,v)for(w=0;w=P;t-=1)if(h=t-1,C=W[k.charAt(h)],v&&(A[h]=+!!C),r[t]=(r[t+1]<<1|1)&C,o&&(r[t]|=(b[t+1]|b[t])<<1|1|b[t+1]),r[t]&U&&(x=m(a,{errors:o,currentLocation:h,expectedLocation:n,distance:g,ignoreLocation:y}))<=c){if(c=x,(d=h)<=n)break;P=Math.max(1,2*n-d)}if(m(a,{errors:o+1,currentLocation:n,expectedLocation:n,distance:g,ignoreLocation:y})>c)break;b=r}return j={isMatch:d>=0,score:Math.max(.001,x)},v&&(E=G(A,z),E.length?F&&(j.indices=E):j.isMatch=!1),j}(n,w,g,{location:b+y,distance:v,threshold:j,findAllMatches:h,minMatchCharLength:f,includeMatches:i,ignoreLocation:p}),u=a.isMatch,_=a.score,r=a.indices;u&&(s=!0),c+=_,u&&r&&(o=[].concat(d(o),d(r)))}),r={isMatch:s,score:s?c/this.chunks.length:1},s&&i&&(r.indices=o),r}}]),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(t,n){var e=t.match(n);return e?e[1]:null}var i,l,u,f,y,e3=function(s){r(e,s);var o=c(e);function e(n){return t(this,e),o.call(this,n)}return n(e,[{key:"search",value:function(t){var e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),e}(i),en=function(s){r(e,s);var o=c(e);function e(n){return t(this,e),o.call(this,n)}return n(e,[{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/^!(.*)$/}}]),e}(i),W=function(s){r(e,s);var o=c(e);function e(n){return t(this,e),o.call(this,n)}return n(e,[{key:"search",value:function(t){var e=t.startsWith(this.pattern);return{isMatch:e,score:e?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/^\^(.*)$/}}]),e}(i),U=function(s){r(e,s);var o=c(e);function e(n){return t(this,e),o.call(this,n)}return n(e,[{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/^!\^(.*)$/}}]),e}(i),K=function(s){r(e,s);var o=c(e);function e(n){return t(this,e),o.call(this,n)}return n(e,[{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/^(.*)\$$/}}]),e}(i),q=function(s){r(e,s);var o=c(e);function e(n){return t(this,e),o.call(this,n)}return n(e,[{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/^!(.*)\$$/}}]),e}(i),P=function(o){r(s,o);var i=c(s);function s(f){var a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.location,w=void 0===r?e.location:r,l=n.threshold,j=void 0===l?e.threshold:l,u=n.distance,v=void 0===u?e.distance:u,m=n.includeMatches,p=void 0===m?e.includeMatches:m,o=n.findAllMatches,g=void 0===o?e.findAllMatches:o,h=n.minMatchCharLength,b=void 0===h?e.minMatchCharLength:h,d=n.isCaseSensitive,_=void 0===d?e.isCaseSensitive:d,c=n.ignoreLocation,O=void 0===c?e.ignoreLocation:c;return t(this,s),(a=i.call(this,f))._bitapSearch=new y(f,{location:w,threshold:j,distance:v,includeMatches:p,findAllMatches:g,minMatchCharLength:b,isCaseSensitive:_,ignoreLocation:O}),a}return n(s,[{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/^(.*)$/}}]),s}(i),L=function(s){r(e,s);var o=c(e);function e(n){return t(this,e),o.call(this,n)}return n(e,[{key:"search",value:function(o){for(var e,s,t=0,n=[],i=this.pattern.length;(e=o.indexOf(this.pattern,t))>-1;)t=e+i,n.push([e,t-1]);return s=!!n.length,{isMatch:s,score:s?0:1,indices:n}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),e}(i),_=[e3,L,W,U,q,K,en,P],F=_.length,Z=/ +(?=(?:[^"]*"[^"]*")*[^"]*$)/;function J(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.split("|").map(function(u){for(var i,a,r,c,l=u.trim().split(Z).filter(function(e){return e&&!!e.trim()}),s=[],o=0,h=l.length;o1&&void 0!==arguments[1]?arguments[1]:{},i=n.isCaseSensitive,a=void 0===i?e.isCaseSensitive:i,r=n.includeMatches,j=void 0===r?e.includeMatches:r,l=n.minMatchCharLength,v=void 0===l?e.minMatchCharLength:l,u=n.ignoreLocation,f=void 0===u?e.ignoreLocation:u,m=n.findAllMatches,p=void 0===m?e.findAllMatches:m,o=n.location,g=void 0===o?e.location:o,d=n.threshold,b=void 0===d?e.threshold:d,c=n.distance,y=void 0===c?e.distance:c;t(this,s),this.query=null,this.options={isCaseSensitive:a,includeMatches:j,minMatchCharLength:v,findAllMatches:p,ignoreLocation:f,location:g,threshold:b,distance:y},this.pattern=a?h:h.toLowerCase(),this.query=J(this.pattern,this.options)}return n(s,[{key:"searchIn",value:function(o){if(s=this.query,!s)return{isMatch:!1,score:1};i=this.options,l=i.includeMatches,o=i.isCaseSensitive?o:o.toLowerCase();for(var n,s,i,l,u,h,m,p,t=0,e=[],a=0,r=0,v=s.length;r-1&&(n.refIndex=t.idx),e.matches.push(n)}})}function e0(e,t){t.score=e.score}function e2(i,c){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=n.includeMatches,a=void 0===s?e.includeMatches:s,o=n.includeScore,r=void 0===o?e.includeScore:o,t=[];return a&&t.push(e4),r&&t.push(e0),i.map(function(e){var n=e.idx,s={item:c[n],refIndex:n};return t.length&&t.forEach(function(t){t(e,s)}),s})}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 es(this.options.keys),this.setCollection(n,o)}return n(i,[{key:"setCollection",value:function(t,e){if(this._docs=t,e&&!(e instanceof f))throw new Error("Incorrect 'index' type");this._myIndex=e||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,e=this.options,r=e.includeMatches,c=e.includeScore,l=e.shouldSort,d=e.sortFn,u=e.ignoreFieldNorm,t=o(n)?o(this._docs[0])?this._searchStringList(n):this._searchObjectList(n):this._searchLogical(n);return e1(t,{ignoreFieldNorm:u}),l&&t.sort(d),N(s)&&s>-1&&(t=t.slice(0,s)),e2(t,this._docs,{includeMatches:r,includeScore:c})}},{key:"_searchStringList",value:function(t){var n=C(t,this.options),o=this._myIndex.records,e=[];return o.forEach(function(o){var t=o.v,a=o.i,r=o.n;if(s(t)){var i=n.searchIn(t),c=i.isMatch,l=i.score,d=i.indices;c&&e.push({item:t,idx:a,matches:[{score:l,value:t,norm:r,indices:d}]})}}),e}},{key:"_searchLogical",value:function(l){var t=this,i=function(e,n){var t=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,s=void 0===t||t,i=function u(e){var i,r,c,d,t=Object.keys(e),l=el(e);if(!l&&t.length>1&&!w(e))return u(R(e));if(ed(e)){if(i=l?e[M]:t[0],r=l?e[er]:e[i],!o(r))throw new Error(ea(i));return c={keyId:E(i),pattern:r},s&&(c.searcher=C(r,n)),c}return d={children:[],operator:t[0]},t.forEach(function(n){var t=e[n];a(t)&&t.forEach(function(e){d.children.push(u(e))})}),d};return w(e)||(e=R(e)),i(e)}(l,this.options),r=function u(e,s,r){if(!e.children){var o,c=e.keyId,l=e.searcher,n=t._findMatches({key:t._keyStore.get(c),value:t._myIndex.getValueForItemAtKeyId(s,c),searcher:l});return n&&n.length?[{idx:r,item:s,matches:n}]:[]}for(var i=[],a=0,h=e.children.length;a1&&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=n.keys,l=n.records,t=new f({getFn:a,fieldNormWeight:r});return t.setKeys(c),t.setIndexRecords(l),t},u.config=e,function(){p.push.apply(p,arguments)}(et),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(n,t){var e=new XMLHttpRequest;e.onreadystatechange=function(){if(e.readyState===4&&e.status===200){var n=JSON.parse(e.responseText);t&&t(n)}},e.open("GET",n),e.send()}function buildIndex(){var e=wrapper.getAttribute("data-url");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(n){let t=fuse.search(n),e="";t.length>0?(t.forEach(function(t){e=e+`
  • ${t.item.title}
    ${t.item.section}·${t.item.date}
    ${t.item.summary}
  • `}),hasResults=!0):(e="",hasResults=!1),output.innerHTML=e,t.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(t){const e=document.createElement("button");e.className="copy-button",e.type="button",e.ariaLabel=copyText,e.innerText=copyText,e.addEventListener("click",()=>copyCodeToClipboard(e,t)),addCopyButtonToDom(e,t)}async function copyCodeToClipboard(n,e){const t=e.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(t):copyCodeBlockExecCommand(t,e)}catch(n){copyCodeBlockExecCommand(t,e)}finally{codeWasCopied(n)}}function copyCodeBlockExecCommand(o,t){const e=document.createElement("textArea");e.contentEditable="true",e.readOnly="false",e.className="copy-textarea",e.value=o,t.insertBefore(e,t.firstChild);const n=document.createRange();n.selectNodeContents(e);const s=window.getSelection();s.removeAllRanges(),s.addRange(n),e.setSelectionRange(0,999999),document.execCommand("copy"),t.removeChild(e)}function codeWasCopied(e){e.blur(),e.innerText=copiedText,setTimeout(function(){e.innerText=copyText},2e3)}function addCopyButtonToDom(n,e){e.insertBefore(n,e.firstChild);const t=document.createElement("div");t.className="highlight-wrapper",e.parentNode.insertBefore(t,e),t.appendChild(e)}window.addEventListener("DOMContentLoaded",e=>{document.querySelectorAll(".highlight").forEach(e=>createCopyButton(e))})