(function(){var zt='',Yt='';document.addEventListener("nav",()=>{let Zt=document.getElementsByTagName("pre");for(let It=0;It{yt.blur(),yt.innerHTML=Yt,setTimeout(()=>{yt.innerHTML=zt,yt.style.borderColor=""},2e3)},Wt=>console.error(Wt))};var Nt=Jt;let pt=Kt.innerText.replace(/\n\n/g,` `),yt=document.createElement("button");yt.className="clipboard-button",yt.type="button",yt.innerHTML=zt,yt.ariaLabel="Copy source",yt.addEventListener("click",Jt),window.addCleanup(()=>yt.removeEventListener("click",Jt)),Zt[It].prepend(yt)}}})})(),function(){var zt,Yt=new IntersectionObserver(pt=>{let yt=document.getElementById("explorer-ul");if(yt)for(let Wt of pt)Wt.isIntersecting?yt.classList.add("no-background"):yt.classList.remove("no-background")});function Zt(){this.classList.toggle("collapsed");let pt=this.nextElementSibling;pt&&(pt.classList.toggle("collapsed"),pt.style.maxHeight=pt.style.maxHeight==="0px"?pt.scrollHeight+"px":"0px")}function Nt(pt){pt.stopPropagation();let yt=pt.target;if(!yt)return;let Wt=yt.nodeName==="svg",Pt=Wt?yt.parentElement?.nextSibling:yt.parentElement?.parentElement?.nextElementSibling,ut=Wt?yt.nextElementSibling:yt.parentElement;if(!(Pt&&ut))return;Pt.classList.toggle("open");let Xt=Pt.classList.contains("open");Kt(Pt,!Xt);let At=ut.dataset.folderpath;Jt(zt,At);let gt=JSON.stringify(zt);localStorage.setItem("fileTree",gt)}function It(){let pt=document.getElementById("explorer");if(!pt)return;if(pt.dataset.behavior==="collapse")for(let At of document.getElementsByClassName("folder-button"))At.addEventListener("click",Nt),window.addCleanup(()=>At.removeEventListener("click",Nt));pt.addEventListener("click",Zt),window.addCleanup(()=>pt.removeEventListener("click",Zt));for(let At of document.getElementsByClassName("folder-icon"))At.addEventListener("click",Nt),window.addCleanup(()=>At.removeEventListener("click",Nt));let yt=localStorage.getItem("fileTree"),Wt=pt?.dataset.savestate==="true",Pt=yt&&Wt?JSON.parse(yt):[],ut=new Map(Pt.map(At=>[At.path,At.collapsed])),Xt=pt.dataset.tree?JSON.parse(pt.dataset.tree):[];zt=[];for(let{path:At,collapsed:gt}of Xt)zt.push({path:At,collapsed:ut.get(At)??gt});zt.map(At=>{let gt=document.querySelector(`[data-folderpath='${At.path}']`)?.parentElement?.nextElementSibling;gt&&Kt(gt,At.collapsed)})}window.addEventListener("resize",It),document.addEventListener("nav",()=>{It(),Yt.disconnect();let pt=document.getElementById("explorer-end");pt&&Yt.observe(pt)});function Kt(pt,yt){return yt?pt.classList.remove("open"):pt.classList.add("open")}function Jt(pt,yt){let Wt=pt.find(Pt=>Pt.path===yt);Wt&&(Wt.collapsed=!Wt.collapsed)}}(),function(){var zt=Object.create,Yt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Nt=Object.getOwnPropertyNames,It=Object.getPrototypeOf,Kt=Object.prototype.hasOwnProperty,Jt=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports),pt=(n,i,a,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of Nt(i))!Kt.call(n,l)&&l!==a&&Yt(n,l,{get:()=>i[l],enumerable:!(u=Zt(i,l))||u.enumerable});return n},yt=(n,i,a)=>(a=n!=null?zt(It(n)):{},pt(i||!n||!n.__esModule?Yt(a,"default",{value:n,enumerable:!0}):a,n)),Wt=Jt(()=>{}),Pt=Jt((n,i)=>{"use strict";i.exports=u;function a(h){return h instanceof Buffer?Buffer.from(h):new h.constructor(h.buffer.slice(),h.byteOffset,h.length)}function u(h){if(h=h||{},h.circles)return l(h);return h.proto?w:m;function y(k,A){for(var b=Object.keys(k),E=new Array(b.length),M=0;M=this.B&&(b||!A[S])){var h=we(E,u,M),y="";switch(this.G){case"full":if(2h;m--)if(m-h>=this.B){var w=we(E,u,M,l,h);y=S.substring(h,m),le(this,A,y,w,n,a)}break}case"reverse":if(1=this.B&&le(this,A,y,we(E,u,M,l,m),n,a);y=""}case"forward":if(1=this.B&&le(this,A,y,h,n,a);break}default:if(this.C&&(h=Math.min(h/this.C(i,S,M)|0,E-1)),le(this,A,S,h,n,a),b&&1=this.B&&!l[S]){l[S]=1;let q=this.l&&S>h;le(this,k,q?h:S,we(y+(u/2>y?0:1),u,M,m-1,w-1),n,a,q?S:h)}}}}}this.m||(this.register[n]=1)}}return this};function we(n,i,a,u,l){return a&&1=this.B&&!a[E])if(this.s||h||this.map[E])w[b++]=E,a[E]=1;else return u;n=w,l=n.length}if(!l)return u;i||(i=100),m=this.depth&&1=u))));E++);if(A){if(h)return O(w,u,0);i[i.length]=w;return}}return!a&&w}function O(n,i,a){return n=n.length===1?n[0]:[].concat.apply([],n),a||n.length>i?n.slice(a,a+i):n}function P(n,i,a,u){return a?(u=u&&i>a,n=(n=n[u?i:a])&&n[u?a:i]):n=n[i],n}ut.contain=function(n){return!!this.register[n]},ut.update=function(n,i){return this.remove(n).add(n,i)},ut.remove=function(n,i){let a=this.register[n];if(a){if(this.m)for(let u=0,l;u"u"&&(y=new Promise(k=>{h=k}));let m,w;switch(l||(l=0)){case 0:if(m="reg",this.m){w=gt();for(let k in this.register)w[k]=1}else w=this.register;break;case 1:m="cfg",w={doc:0,opt:this.s?1:0};break;case 2:m="map",w=this.map;break;case 3:m="ctx",w=this.h;break;default:typeof a>"u"&&h&&h();return}return Ne(n,i||this,a,m,u,l,w,h),y},ut.import=function(n,i){if(i)switch(jt(i)&&(i=JSON.parse(i)),n){case"cfg":this.s=!!i.opt;break;case"reg":this.m=!1,this.register=i;break;case"map":this.map=i;break;case"ctx":this.h=i}},He(oe.prototype);function X(n){n=n.data;var i=self._index;let a=n.args;var u=n.task;switch(u){case"init":u=n.options||{},n=n.factory,i=u.encode,u.cache=!1,i&&i.indexOf("function")===0&&(u.encode=Function("return "+i)()),n?(Function("return "+n)()(self),self._index=new self.FlexSearch.Index(u),delete self.FlexSearch):self._index=new oe(u);break;default:n=n.id,i=i[u].apply(i,a),postMessage(u==="search"?{id:n,msg:i}:{id:n})}}var nt=0;function K(n){if(!(this instanceof K))return new K(n);var i;n?qt(i=n.encode)&&(n.encode=i.toString()):n={},(i=(self||window)._factory)&&(i=i.toString());let a=typeof window>"u"&&self.exports,u=this;this.o=Et(i,a,n.worker),this.h=gt(),this.o&&(a?this.o.on("message",function(l){u.h[l.id](l.msg),delete u.h[l.id]}):this.o.onmessage=function(l){l=l.data,u.h[l.id](l.msg),delete u.h[l.id]},this.o.postMessage({task:"init",factory:i,options:n}))}Z("add"),Z("append"),Z("search"),Z("update"),Z("remove");function Z(n){K.prototype[n]=K.prototype[n+"Async"]=function(){let i=this,a=[].slice.call(arguments);var u=a[a.length-1];let l;return qt(u)&&(l=u,a.splice(a.length-1,1)),u=new Promise(function(h){setTimeout(function(){i.h[++nt]=h,i.o.postMessage({task:n,id:nt,args:a})})}),l?(u.then(l),this):u}}function Et(n,i,a){let u;try{u=i?new(Wt()).Worker(__dirname+"/node/node.js"):n?new Worker(URL.createObjectURL(new Blob(["onmessage="+X.toString()],{type:"text/javascript"}))):new Worker(jt(a)?a:"worker/worker.js",{type:"module"})}catch{}return u}function mt(n){if(!(this instanceof mt))return new mt(n);var i=n.document||n.doc||n,a;this.K=[],this.h=[],this.A=[],this.register=gt(),this.key=(a=i.key||i.id)&&it(a,this.A)||"id",this.m=Xt(n.fastupdate),this.C=(a=i.store)&&a!==!0&&[],this.store=a&>(),this.I=(a=i.tag)&&it(a,this.A),this.l=a&>(),this.cache=(a=n.cache)&&new Le(a),n.cache=!1,this.o=n.worker,this.async=!1,a=gt();let u=i.index||i.field||i;jt(u)&&(u=[u]);for(let l=0,h,y;li||a)&&(l=l.slice(a,a+i)),u&&(l=tt.call(this,l)),{tag:n,result:l}}function tt(n){let i=Array(n.length);for(let a=0,u;a"u"&&(y=new Promise(m=>{h=m})),l||(l=0),u||(u=0),un?.removeEventListener("click",a)),document.addEventListener("keydown",u),window.addCleanup(()=>document.removeEventListener("keydown",u))}function Ye(n){for(;n.firstChild;)n.removeChild(n.firstChild)}var Hn=Object.hasOwnProperty,hn=yt(Pt(),1),je=(0,hn.default)();function Ln(n){let i=gn(dn(n,"index"),!0);return i.length===0?"/":i}var pn=(n,i,a)=>{let u=new URL(n.getAttribute(i),a);n.setAttribute(i,u.pathname+u.hash)};function Nn(n,i){n.querySelectorAll('[href^="./"], [href^="../"]').forEach(a=>pn(a,"href",i)),n.querySelectorAll('[src^="./"], [src^="../"]').forEach(a=>pn(a,"src",i))}function On(n){let i=n.split("/").filter(a=>a!=="").slice(0,-1).map(a=>"..").join("/");return i.length===0&&(i="."),i}function Ke(n,i){return Fe(On(n),Ln(i))}function Fe(...n){return n.filter(i=>i!=="").join("/").replace(/\/\/+/g,"/")}function nn(n,i){return n===i||n.endsWith("/"+i)}function dn(n,i){return nn(n,i)&&(n=n.slice(0,-i.length)),n}function gn(n,i){return n.startsWith("/")&&(n=n.substring(1)),!i&&n.endsWith("/")&&(n=n.slice(0,-1)),n}var xe="basic",ne="",jn=n=>n.toLowerCase().split(/([^a-z]|[^\x00-\x7F])/),$e=new en.Document({charset:"latin:extra",encode:jn,document:{id:"id",tag:"tags",index:[{field:"title",tokenize:"forward"},{field:"content",tokenize:"forward"},{field:"tags",tokenize:"forward"}]}}),Cn=new DOMParser,mn=new Map,Ue=30,rn=8,yn=5,vn=n=>{let i=n.split(/\s+/).filter(u=>u.trim()!==""),a=i.length;if(a>1)for(let u=1;ul.length-u.length)};function wn(n,i,a){let u=vn(n),l=i.split(/\s+/).filter(w=>w!==""),h=0,y=l.length-1;if(a){let w=E=>u.some(M=>E.toLowerCase().startsWith(M.toLowerCase())),k=l.map(w),A=0,b=0;for(let E=0;ES+(q?1:0),0);M>=A&&(A=M,b=E)}h=Math.max(b-Ue,0),y=Math.min(h+2*Ue,l.length-1),l=l.slice(h,y)}let m=l.map(w=>{for(let k of u)if(w.toLowerCase().includes(k.toLowerCase())){let A=new RegExp(k.toLowerCase(),"gi");return w.replace(A,'$&')}return w}).join(" ");return`${h===0?"":"..."}${m}${y===l.length-1?"":"..."}`}function xn(n,i){let a=new DOMParser,u=vn(n),l=a.parseFromString(i.innerHTML,"text/html"),h=m=>{let w=document.createElement("span");return w.className="highlight",w.textContent=m,w},y=(m,w)=>{if(m.nodeType===Node.TEXT_NODE){let k=m.nodeValue??"",A=new RegExp(w.toLowerCase(),"gi"),b=k.match(A);if(!b||b.length===0)return;let E=document.createElement("span"),M=0;for(let S of b){let q=k.indexOf(S,M);E.appendChild(document.createTextNode(k.slice(M,q))),E.appendChild(h(S)),M=q+S.length}E.appendChild(document.createTextNode(k.slice(M))),m.parentNode?.replaceChild(E,m)}else if(m.nodeType===Node.ELEMENT_NODE){if(m.classList.contains("highlight"))return;Array.from(m.childNodes).forEach(k=>y(k,w))}};for(let m of u)y(l.body,m);return l.body}document.addEventListener("nav",async n=>{let i=n.detail.url,a=await fetchData,u=document.getElementById("search-container"),l=u?.closest(".sidebar"),h=document.getElementById("search-icon"),y=document.getElementById("search-bar"),m=document.getElementById("search-layout"),w=Object.keys(a),k=U=>{m?.querySelector(`#${U.id}`)===null&&m?.appendChild(U)},A=m?.dataset?.preview==="true",b,E,M=document.createElement("div");M.id="results-container",k(M),A&&(b=document.createElement("div"),b.id="preview-container",k(b));function S(){u?.classList.remove("active"),y&&(y.value=""),l&&(l.style.zIndex="unset"),M&&Ye(M),b&&Ye(b),m&&m.classList.remove("display-results"),xe="basic"}function q(U){xe=U,l&&(l.style.zIndex="1"),u?.classList.add("active"),y?.focus()}let F=null;async function et(U){if(U.key==="k"&&(U.ctrlKey||U.metaKey)&&!U.shiftKey){U.preventDefault(),u?.classList.contains("active")?S():q("basic");return}else if(U.shiftKey&&(U.ctrlKey||U.metaKey)&&U.key.toLowerCase()==="k"){U.preventDefault(),u?.classList.contains("active")?S():q("tags"),y&&(y.value="#");return}if(F&&F.classList.remove("focus"),!!u?.classList.contains("active")){if(U.key==="Enter")if(M?.contains(document.activeElement)){let Y=document.activeElement;if(Y.classList.contains("no-match"))return;await fe(Y),Y.click()}else{let Y=document.getElementsByClassName("result-card")[0];if(!Y||Y?.classList.contains("no-match"))return;await fe(Y),Y.click()}else if(U.key==="ArrowUp"||U.shiftKey&&U.key==="Tab"){if(U.preventDefault(),M?.contains(document.activeElement)){let Y=F||document.activeElement,dt=Y?.previousElementSibling;Y?.classList.remove("focus"),dt?.focus(),dt&&(F=dt),await fe(dt)}}else if((U.key==="ArrowDown"||U.key==="Tab")&&(U.preventDefault(),document.activeElement===y||F!==null)){let Y=F||document.getElementsByClassName("result-card")[0],dt=Y?.nextElementSibling;Y?.classList.remove("focus"),dt?.focus(),dt&&(F=dt),await fe(dt)}}}let ft=(U,Y)=>{let dt=w[Y];return{id:Y,slug:dt,title:xe==="tags"?a[dt].title:wn(U,a[dt].title??""),content:wn(U,a[dt].content??"",!0),tags:xt(U.substring(1),a[dt].tags)}};function xt(U,Y){return!Y||xe!=="tags"?[]:Y.map(dt=>dt.toLowerCase().includes(U.toLowerCase())?`
  • #${dt}

  • `:`
  • #${dt}

  • `).slice(0,yn)}function $t(U){return new URL(Ke(i,U),location.toString())}let ae=({slug:U,title:Y,content:dt,tags:kt})=>{let bt=kt.length>0?`
      ${kt.join("")}
    `:"",Dt=document.createElement("a");Dt.classList.add("result-card"),Dt.id=U,Dt.href=$t(U).toString(),Dt.innerHTML=`

    ${Y}

    ${bt}${A&&window.innerWidth>600?"":`

    ${dt}

    `}`,Dt.addEventListener("click",Ut=>{Ut.altKey||Ut.ctrlKey||Ut.metaKey||Ut.shiftKey||S()});let Vt=Ut=>{Ut.altKey||Ut.ctrlKey||Ut.metaKey||Ut.shiftKey||S()};async function me(Ut){if(!Ut.target)return;let Wn=Ut.target;await fe(Wn)}return Dt.addEventListener("mouseenter",me),window.addCleanup(()=>Dt.removeEventListener("mouseenter",me)),Dt.addEventListener("click",Vt),window.addCleanup(()=>Dt.removeEventListener("click",Vt)),Dt};async function re(U){if(M)if(Ye(M),U.length===0?M.innerHTML=`

    No results.

    Try another search term?

    `:M.append(...U.map(ae)),U.length===0&&b)Ye(b);else{let Y=M.firstElementChild;Y.classList.add("focus"),F=Y,await fe(Y)}}async function Lt(U){if(mn.has(U))return mn.get(U);let Y=$t(U).toString(),dt=await fetch(Y).then(kt=>kt.text()).then(kt=>{if(kt===void 0)throw new Error(`Could not fetch ${Y}`);let bt=Cn.parseFromString(kt??"","text/html");return Nn(bt,Y),[...bt.getElementsByClassName("popover-hint")]});return mn.set(U,dt),dt}async function fe(U){if(!m||!A||!U||!b)return;let Y=U.id,dt=await Lt(Y).then(kt=>kt.flatMap(bt=>[...xn(ne,bt).children]));E=document.createElement("div"),E.classList.add("preview-inner"),E.append(...dt),b.replaceChildren(E),[...b.querySelectorAll(".highlight")].sort((kt,bt)=>bt.innerHTML.length-kt.innerHTML.length)[0]?.scrollIntoView({block:"start"})}async function Qt(U){if(!m||!$e)return;ne=U.target.value,m.classList.toggle("display-results",ne!==""),xe=ne.startsWith("#")?"tags":"basic";let Y;if(xe==="tags"){ne=ne.substring(1).trim();let bt=ne.indexOf(" ");if(bt!=-1){let Dt=ne.substring(0,bt),Vt=ne.substring(bt+1).trim();Y=await $e.searchAsync({query:Vt,limit:Math.max(rn,1e4),index:["title","content"],tag:Dt});for(let me of Y)me.result=me.result.slice(0,rn);xe="basic",ne=Vt}else Y=await $e.searchAsync({query:ne,limit:rn,index:["tags"]})}else xe==="basic"&&(Y=await $e.searchAsync({query:ne,limit:rn,index:["title","content"]}));let dt=bt=>{let Dt=Y.filter(Vt=>Vt.field===bt);return Dt.length===0?[]:[...Dt[0].result]},kt=[...new Set([...dt("title"),...dt("content"),...dt("tags")])].map(bt=>ft(ne,bt));await re(kt)}document.addEventListener("keydown",et),window.addCleanup(()=>document.removeEventListener("keydown",et)),h?.addEventListener("click",()=>q("basic")),window.addCleanup(()=>h?.removeEventListener("click",()=>q("basic"))),y?.addEventListener("input",Qt),window.addCleanup(()=>y?.removeEventListener("input",Qt)),Sn(u,S),await p(a)});async function p(n){let i=0,a=[];for(let[u,l]of Object.entries(n))a.push($e.addAsync(i++,{id:i,slug:u,title:l.title,content:l.content,tags:l.tags}));return await Promise.all(a)}}(),function(){var zt=Object.create,Yt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Nt=Object.getOwnPropertyNames,It=Object.getPrototypeOf,Kt=Object.prototype.hasOwnProperty,Jt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),pt=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Nt(e))!Kt.call(t,s)&&s!==r&&Yt(t,s,{get:()=>e[s],enumerable:!(o=Zt(e,s))||o.enumerable});return t},yt=(t,e,r)=>(r=t!=null?zt(It(t)):{},pt(e||!t||!t.__esModule?Yt(r,"default",{value:t,enumerable:!0}):r,t)),Wt=Jt((t,e)=>{"use strict";e.exports=o;function r(c){return c instanceof Buffer?Buffer.from(c):new c.constructor(c.buffer.slice(),c.byteOffset,c.length)}function o(c){if(c=c||{},c.circles)return s(c);return c.proto?v:d;function f(g,x){for(var L=Object.keys(g),_=new Array(L.length),N=0;N{}};function ut(){for(var t=0,e=arguments.length,r={},o;t=0&&(o=r.slice(s+1),r=r.slice(0,s)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:o}})}Xt.prototype=ut.prototype={constructor:Xt,on:function(t,e){var r=this._,o=At(t+"",r),s,c=-1,f=o.length;if(arguments.length<2){for(;++c0)for(var r=new Array(s),o=0,s,c;o=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),qt.hasOwnProperty(e)?{space:qt[e],local:t}:t}function Te(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Ft&&e.documentElement.namespaceURI===Ft?e.createElement(t):e.createElementNS(r,t)}}function ke(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ye(t){var e=pe(t);return(e.local?ke:Te)(e)}function ve(){}function Ot(t){return t==null?ve:function(){return this.querySelector(t)}}function Ge(t){typeof t!="function"&&(t=Ot(t));for(var e=this._groups,r=e.length,o=new Array(r),s=0;s=rt&&(rt=I+1);!(G=B[rt])&&++rt=0;)(f=o[s])&&(c&&f.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(f,c),c=f);return this}function wt(t){t||(t=tt);function e(L,_){return L&&_?t(L.__data__,_.__data__):!L-!_}for(var r=this._groups,o=r.length,s=new Array(o),c=0;ce?1:t>=e?0:NaN}function Tt(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ce(){return Array.from(this)}function ee(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?Sn:typeof e=="function"?Hn:Ye)(t,e,r??"")):je(this.node(),t)}function je(t,e){return t.style.getPropertyValue(e)||en(t).getComputedStyle(t,null).getPropertyValue(e)}function Ln(t){return function(){delete this[t]}}function pn(t,e){return function(){this[t]=e}}function Nn(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function On(t,e){return arguments.length>1?this.each((e==null?Ln:typeof e=="function"?Nn:pn)(t,e)):this.node()[t]}function Ke(t){return t.trim().split(/^|\s+/)}function Fe(t){return t.classList||new nn(t)}function nn(t){this._node=t,this._names=Ke(t.getAttribute("class")||"")}nn.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function dn(t,e){for(var r=Fe(t),o=-1,s=e.length;++o=0&&(r=e.slice(o+1),e=e.slice(0,o)),{type:e,name:r}})}function S(t){return function(){var e=this.__on;if(e){for(var r=0,o=-1,s=e.length,c;r()=>t;function ur(t,{sourceEvent:e,subject:r,target:o,identifier:s,active:c,x:f,y:d,dx:v,dy:g,dispatch:x}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:f,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:x}})}ur.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function pi(t){return!t.ctrlKey&&!t.button}function di(){return this.parentNode}function gi(t,e){return e??{x:t.x,y:t.y}}function mi(){return navigator.maxTouchPoints||"ontouchstart"in this}function yi(){var t=pi,e=di,r=gi,o=mi,s={},c=jt("start","drag","end"),f=0,d,v,g,x,L=0;function _(D){D.on("mousedown.drag",N).filter(o).on("touchstart.drag",B).on("touchmove.drag",C,Dt).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function N(D,G){if(!(x||!t.call(this,D,G))){var ot=rt(this,e.call(this,D,G),D,G,"mouse");ot&&(Y(D.view).on("mousemove.drag",z,Vt).on("mouseup.drag",T,Vt),Wn(D.view),me(D),g=!1,d=D.clientX,v=D.clientY,ot("start",D))}}function z(D){if(Ut(D),!g){var G=D.clientX-d,ot=D.clientY-v;g=G*G+ot*ot>L}s.mouse("drag",D)}function T(D){Y(D.view).on("mousemove.drag mouseup.drag",null),Mr(D.view,g),Ut(D),s.mouse("end",D)}function B(D,G){if(t.call(this,D,G)){var ot=D.changedTouches,lt=e.call(this,D,G),St=ot.length,Bt,Rt;for(Bt=0;Bt>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Kn(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Kn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=wi.exec(t))?new he(e[1],e[2],e[3],1):(e=xi.exec(t))?new he(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=bi.exec(t))?Kn(e[1],e[2],e[3],e[4]):(e=_i.exec(t))?Kn(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ai.exec(t))?Tr(e[1],e[2]/100,e[3]/100,1):(e=Ei.exec(t))?Tr(e[1],e[2]/100,e[3]/100,e[4]):Lr.hasOwnProperty(t)?jr(Lr[t]):t==="transparent"?new he(NaN,NaN,NaN,0):null}function jr(t){return new he(t>>16&255,t>>8&255,t&255,1)}function Kn(t,e,r,o){return o<=0&&(t=e=r=NaN),new he(t,e,r,o)}function Si(t){return t instanceof Dn||(t=zn(t)),t?(t=t.rgb(),new he(t.r,t.g,t.b,t.opacity)):new he}function Fn(t,e,r,o){return arguments.length===1?Si(t):new he(t,e,r,o??1)}function he(t,e,r,o){this.r=+t,this.g=+e,this.b=+r,this.opacity=+o}lr(he,Fn,Sr(Dn,{brighter(t){return t=t==null?Yn:Math.pow(Yn,t),new he(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Tn:Math.pow(Tn,t),new he(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new he(on(this.r),on(this.g),on(this.b),Un(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Cr,formatHex:Cr,formatHex8:Li,formatRgb:Dr,toString:Dr}));function Cr(){return`#${an(this.r)}${an(this.g)}${an(this.b)}`}function Li(){return`#${an(this.r)}${an(this.g)}${an(this.b)}${an((isNaN(this.opacity)?1:this.opacity)*255)}`}function Dr(){let t=Un(this.opacity);return`${t===1?"rgb(":"rgba("}${on(this.r)}, ${on(this.g)}, ${on(this.b)}${t===1?")":`, ${t})`}`}function Un(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function on(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function an(t){return t=on(t),(t<16?"0":"")+t.toString(16)}function Tr(t,e,r,o){return o<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new be(t,e,r,o)}function Br(t){if(t instanceof be)return new be(t.h,t.s,t.l,t.opacity);if(t instanceof Dn||(t=zn(t)),!t)return new be;if(t instanceof be)return t;t=t.rgb();var e=t.r/255,r=t.g/255,o=t.b/255,s=Math.min(e,r,o),c=Math.max(e,r,o),f=NaN,d=c-s,v=(c+s)/2;return d?(e===c?f=(r-o)/d+(r0&&v<1?0:f,new be(f,d,v,t.opacity)}function Ni(t,e,r,o){return arguments.length===1?Br(t):new be(t,e,r,o??1)}function be(t,e,r,o){this.h=+t,this.s=+e,this.l=+r,this.opacity=+o}lr(be,Ni,Sr(Dn,{brighter(t){return t=t==null?Yn:Math.pow(Yn,t),new be(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Tn:Math.pow(Tn,t),new be(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,o=r+(r<.5?r:1-r)*e,s=2*r-o;return new he(cr(t>=240?t-240:t+120,s,o),cr(t,s,o),cr(t<120?t+240:t-120,s,o),this.opacity)},clamp(){return new be(zr(this.h),Jn(this.s),Jn(this.l),Un(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Un(this.opacity);return`${t===1?"hsl(":"hsla("}${zr(this.h)}, ${Jn(this.s)*100}%, ${Jn(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zr(t){return t=(t||0)%360,t<0?t+360:t}function Jn(t){return Math.max(0,Math.min(1,t||0))}function cr(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function Pr(t,e,r,o,s){var c=t*t,f=c*t;return((1-3*t+3*c-f)*e+(4-6*c+3*f)*r+(1+3*t+3*c-3*f)*o+f*s)/6}function Oi(t){var e=t.length-1;return function(r){var o=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),s=t[o],c=t[o+1],f=o>0?t[o-1]:2*s-c,d=o()=>t;function Ci(t,e){return function(r){return t+r*e}}function Di(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(o){return Math.pow(t+o*e,r)}}function Ti(t){return(t=+t)==1?qr:function(e,r){return r-e?Di(e,r,t):$r(isNaN(e)?r:e)}}function qr(t,e){var r=e-t;return r?Ci(t,r):$r(isNaN(t)?e:t)}var Rr=function t(e){var r=Ti(e);function o(s,c){var f=r((s=Fn(s)).r,(c=Fn(c)).r),d=r(s.g,c.g),v=r(s.b,c.b),g=qr(s.opacity,c.opacity);return function(x){return s.r=f(x),s.g=d(x),s.b=v(x),s.opacity=g(x),s+""}}return o.gamma=t,o}(1);function Ir(t){return function(e){var r=e.length,o=new Array(r),s=new Array(r),c=new Array(r),f,d;for(f=0;fr&&(c=e.slice(r,c),d[f]?d[f]+=c:d[++f]=c),(o=o[0])===(s=s[0])?d[f]?d[f]+=s:d[++f]=s:(d[++f]=null,v.push({i:f,x:Je(o,s)})),r=hr.lastIndex;return r180?x+=360:x-g>180&&(g+=360),_.push({i:L.push(s(L)+"rotate(",null,o)-2,x:Je(g,x)})):x&&L.push(s(L)+"rotate("+x+o)}function d(g,x,L,_){g!==x?_.push({i:L.push(s(L)+"skewX(",null,o)-2,x:Je(g,x)}):x&&L.push(s(L)+"skewX("+x+o)}function v(g,x,L,_,N,z){if(g!==L||x!==_){var T=N.push(s(N)+"scale(",null,",",null,")");z.push({i:T-4,x:Je(g,L)},{i:T-2,x:Je(x,_)})}else(L!==1||_!==1)&&N.push(s(N)+"scale("+L+","+_+")")}return function(g,x){var L=[],_=[];return g=t(g),x=t(x),c(g.translateX,g.translateY,x.translateX,x.translateY,L,_),f(g.rotate,x.rotate,L,_),d(g.skewX,x.skewX,L,_),v(g.scaleX,g.scaleY,x.scaleX,x.scaleY,L,_),g=x=null,function(N){for(var z=-1,T=_.length,B;++z=0&&t._call.call(void 0,e),t=t._next;--_n}function Fr(){sn=(Zn=Rn.now())+tr,_n=Pn=0;try{Ki()}finally{_n=0,Ui(),sn=0}}function Fi(){var t=Rn.now(),e=t-Zn;e>Yr&&(tr-=e,Zn=t)}function Ui(){for(var t,e=Qn,r,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:Qn=r);qn=t,mr(o)}function mr(t){if(!_n){Pn&&(Pn=clearTimeout(Pn));var e=t-sn;e>24?(t<1/0&&(Pn=setTimeout(Fr,t-Rn.now()-tr)),$n&&($n=clearInterval($n))):($n||(Zn=Rn.now(),$n=setInterval(Fi,Yr)),_n=1,Kr(Fr))}}function Ur(t,e,r){var o=new er;return e=e==null?0:+e,o.restart(s=>{o.stop(),t(s+e)},e,r),o}var Ji=jt("start","end","cancel","interrupt"),Gi=[],Jr=0,Gr=1,yr=2,nr=3,Qr=4,vr=5,rr=6;function ir(t,e,r,o,s,c){var f=t.__transition;if(!f)t.__transition={};else if(r in f)return;Qi(t,r,{name:e,index:o,group:s,on:Ji,tween:Gi,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Jr})}function wr(t,e){var r=_e(t,e);if(r.state>Jr)throw new Error("too late; already scheduled");return r}function De(t,e){var r=_e(t,e);if(r.state>nr)throw new Error("too late; already running");return r}function _e(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Qi(t,e,r){var o=t.__transition,s;o[e]=r,r.timer=gr(c,0,r.time);function c(g){r.state=Gr,r.timer.restart(f,r.delay,r.time),r.delay<=g&&f(g-r.delay)}function f(g){var x,L,_,N;if(r.state!==Gr)return v();for(x in o)if(N=o[x],N.name===r.name){if(N.state===nr)return Ur(f);N.state===Qr?(N.state=rr,N.timer.stop(),N.on.call("interrupt",t,t.__data__,N.index,N.group),delete o[x]):+xyr&&o.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function No(t,e,r){var o,s,c=Lo(e)?wr:De;return function(){var f=c(this,t),d=f.on;d!==o&&(s=(o=d).copy()).on(e,r),f.on=s}}function Oo(t,e){var r=this._id;return arguments.length<2?_e(this.node(),r).on.on(t):this.each(No(r,t,e))}function jo(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Co(){return this.on("end.remove",jo(this._id))}function Do(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Ot(t));for(var o=this._groups,s=o.length,c=new Array(s),f=0;f=(L=(d+g)/2))?d=L:g=L,(B=r>=(_=(v+x)/2))?v=_:x=_,s=c,!(c=c[C=B<<1|T]))return s[C]=f,t;if(N=+t._x.call(null,c.data),z=+t._y.call(null,c.data),e===N&&r===z)return f.next=c,s?s[C]=f:t._root=f,t;do s=s?s[C]=new Array(4):t._root=new Array(4),(T=e>=(L=(d+g)/2))?d=L:g=L,(B=r>=(_=(v+x)/2))?v=_:x=_;while((C=B<<1|T)===(I=(z>=_)<<1|N>=L));return s[I]=c,s[C]=f,t}function ua(t){var e,r,o=t.length,s,c,f=new Array(o),d=new Array(o),v=1/0,g=1/0,x=-1/0,L=-1/0;for(r=0;rx&&(x=s),cL&&(L=c));if(v>x||g>L)return this;for(this.cover(v,g).cover(x,L),r=0;rt||t>=s||o>e||e>=c;)switch(g=(ex||(d=z.y0)>L||(v=z.x1)=C)<<1|t>=B)&&(z=_[_.length-1],_[_.length-1]=_[_.length-1-T],_[_.length-1-T]=z)}else{var I=t-+this._x.call(null,N.data),rt=e-+this._y.call(null,N.data),D=I*I+rt*rt;if(D=(_=(f+v)/2))?f=_:v=_,(T=L>=(N=(d+g)/2))?d=N:g=N,e=r,!(r=r[B=T<<1|z]))return this;if(!r.length)break;(e[B+1&3]||e[B+2&3]||e[B+3&3])&&(o=e,C=B)}for(;r.data!==t;)if(s=r,!(r=r.next))return this;return(c=r.next)&&delete r.next,s?(c?s.next=c:delete s.next,this):e?(c?e[B]=c:delete e[B],(r=e[0]||e[1]||e[2]||e[3])&&r===(e[3]||e[2]||e[1]||e[0])&&!r.length&&(o?o[C]=r:this._root=r),this):(this._root=c,this)}function da(t){for(var e=0,r=t.length;e[e(G,ot,f),G])),D;for(B=0,d=new Array(C);B(t=(1664525*t+1013904223)%4294967296)/4294967296}function Ma(t){return t.x}function Sa(t){return t.y}var La=10,Na=Math.PI*(3-Math.sqrt(5));function Oa(t){var e,r=1,o=.001,s=1-Math.pow(o,1/300),c=0,f=.6,d=new Map,v=gr(L),g=jt("tick","end"),x=ka();t==null&&(t=[]);function L(){_(),g.call("tick",e),r1?(B==null?d.delete(T):d.set(T,z(B)),e):d.get(T)},find:function(T,B,C){var I=0,rt=t.length,D,G,ot,lt,St;for(C==null?C=1/0:C*=C,I=0;I1?(g.on(T,B),e):g.on(T)}}}function ja(){var t,e,r,o,s=In(-30),c,f=1,d=1/0,v=.81;function g(N){var z,T=t.length,B=ii(t,Ma,Sa).visitAfter(L);for(o=N,z=0;z=d)){(N.data!==e||N.next)&&(C===0&&(C=An(r),D+=C*C),I===0&&(I=An(r),D+=I*I),D()=>t;function Ca(t,{sourceEvent:e,target:r,transform:o,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:s}})}function Ie(t,e,r){this.k=t,this.x=e,this.y=r}Ie.prototype={constructor:Ie,scale:function(t){return t===1?this:new Ie(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Ie(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ar=new Ie(1,0,0);Da.prototype=Ie.prototype;function Da(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Ar;return t.__zoom}function Er(t){t.stopImmediatePropagation()}function Vn(t){t.preventDefault(),t.stopImmediatePropagation()}function Ta(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Ba(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function si(){return this.__zoom||Ar}function za(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Pa(){return navigator.maxTouchPoints||"ontouchstart"in this}function $a(t,e,r){var o=t.invertX(e[0][0])-r[0][0],s=t.invertX(e[1][0])-r[1][0],c=t.invertY(e[0][1])-r[0][1],f=t.invertY(e[1][1])-r[1][1];return t.translate(s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s),f>c?(c+f)/2:Math.min(0,c)||Math.max(0,f))}function qa(){var t=Ta,e=Ba,r=$a,o=za,s=Pa,c=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],d=250,v=Xi,g=jt("start","zoom","end"),x,L,_,N=500,z=150,T=0,B=10;function C(j){j.property("__zoom",si).on("wheel.zoom",St,{passive:!1}).on("mousedown.zoom",Bt).on("dblclick.zoom",Rt).filter(s).on("touchstart.zoom",ie).on("touchmove.zoom",un).on("touchend.zoom touchcancel.zoom",ln).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(j,J,R,Q){var st=j.selection?j.selection():j;st.property("__zoom",si),j!==st?G(j,J,R,Q):st.interrupt().each(function(){ot(this,arguments).event(Q).start().zoom(null,typeof J=="function"?J.apply(this,arguments):J).end()})},C.scaleBy=function(j,J,R,Q){C.scaleTo(j,function(){var st=this.__zoom.k,ct=typeof J=="function"?J.apply(this,arguments):J;return st*ct},R,Q)},C.scaleTo=function(j,J,R,Q){C.transform(j,function(){var st=e.apply(this,arguments),ct=this.__zoom,$=R==null?D(st):typeof R=="function"?R.apply(this,arguments):R,at=ct.invert($),ht=typeof J=="function"?J.apply(this,arguments):J;return r(rt(I(ct,ht),$,at),st,f)},R,Q)},C.translateBy=function(j,J,R,Q){C.transform(j,function(){return r(this.__zoom.translate(typeof J=="function"?J.apply(this,arguments):J,typeof R=="function"?R.apply(this,arguments):R),e.apply(this,arguments),f)},null,Q)},C.translateTo=function(j,J,R,Q,st){C.transform(j,function(){var ct=e.apply(this,arguments),$=this.__zoom,at=Q==null?D(ct):typeof Q=="function"?Q.apply(this,arguments):Q;return r(Ar.translate(at[0],at[1]).scale($.k).translate(typeof J=="function"?-J.apply(this,arguments):-J,typeof R=="function"?-R.apply(this,arguments):-R),ct,f)},Q,st)};function I(j,J){return J=Math.max(c[0],Math.min(c[1],J)),J===j.k?j:new Ie(J,j.x,j.y)}function rt(j,J,R){var Q=J[0]-R[0]*j.k,st=J[1]-R[1]*j.k;return Q===j.x&&st===j.y?j:new Ie(j.k,Q,st)}function D(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function G(j,J,R,Q){j.on("start.zoom",function(){ot(this,arguments).event(Q).start()}).on("interrupt.zoom end.zoom",function(){ot(this,arguments).event(Q).end()}).tween("zoom",function(){var st=this,ct=arguments,$=ot(st,ct).event(Q),at=e.apply(st,ct),ht=R==null?D(at):typeof R=="function"?R.apply(st,ct):R,Mt=Math.max(at[1][0]-at[0][0],at[1][1]-at[0][1]),_t=st.__zoom,Ht=typeof J=="function"?J.apply(st,ct):J,Ct=v(_t.invert(ht).concat(Mt/_t.k),Ht.invert(ht).concat(Mt/Ht.k));return function(Ae){if(Ae===1)Ae=Ht;else{var Ve=Ct(Ae),kr=Mt/Ve[2];Ae=new Ie(kr,ht[0]-Ve[0]*kr,ht[1]-Ve[1]*kr)}$.zoom(null,Ae)}})}function ot(j,J,R){return!R&&j.__zooming||new lt(j,J)}function lt(j,J){this.that=j,this.args=J,this.active=0,this.sourceEvent=null,this.extent=e.apply(j,J),this.taps=0}lt.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,J){return this.mouse&&j!=="mouse"&&(this.mouse[1]=J.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=J.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=J.invert(this.touch1[0])),this.that.__zoom=J,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var J=Y(this.that).datum();g.call(j,this.that,new Ca(j,{sourceEvent:this.sourceEvent,target:C,type:j,transform:this.that.__zoom,dispatch:g}),J)}};function St(j,...J){if(!t.apply(this,arguments))return;var R=ot(this,J).event(j),Q=this.__zoom,st=Math.max(c[0],Math.min(c[1],Q.k*Math.pow(2,o.apply(this,arguments)))),ct=kt(j);if(R.wheel)(R.mouse[0][0]!==ct[0]||R.mouse[0][1]!==ct[1])&&(R.mouse[1]=Q.invert(R.mouse[0]=ct)),clearTimeout(R.wheel);else{if(Q.k===st)return;R.mouse=[ct,Q.invert(ct)],or(this),R.start()}Vn(j),R.wheel=setTimeout($,z),R.zoom("mouse",r(rt(I(Q,st),R.mouse[0],R.mouse[1]),R.extent,f));function $(){R.wheel=null,R.end()}}function Bt(j,...J){if(_||!t.apply(this,arguments))return;var R=j.currentTarget,Q=ot(this,J,!0).event(j),st=Y(j.view).on("mousemove.zoom",ht,!0).on("mouseup.zoom",Mt,!0),ct=kt(j,R),$=j.clientX,at=j.clientY;Wn(j.view),Er(j),Q.mouse=[ct,this.__zoom.invert(ct)],or(this),Q.start();function ht(_t){if(Vn(_t),!Q.moved){var Ht=_t.clientX-$,Ct=_t.clientY-at;Q.moved=Ht*Ht+Ct*Ct>T}Q.event(_t).zoom("mouse",r(rt(Q.that.__zoom,Q.mouse[0]=kt(_t,R),Q.mouse[1]),Q.extent,f))}function Mt(_t){st.on("mousemove.zoom mouseup.zoom",null),Mr(_t.view,Q.moved),Vn(_t),Q.event(_t).end()}}function Rt(j,...J){if(t.apply(this,arguments)){var R=this.__zoom,Q=kt(j.changedTouches?j.changedTouches[0]:j,this),st=R.invert(Q),ct=R.k*(j.shiftKey?.5:2),$=r(rt(I(R,ct),Q,st),e.apply(this,J),f);Vn(j),d>0?Y(this).transition().duration(d).call(G,$,Q,j):Y(this).call(C.transform,$,Q,j)}}function ie(j,...J){if(t.apply(this,arguments)){var R=j.touches,Q=R.length,st=ot(this,J,j.changedTouches.length===Q).event(j),ct,$,at,ht;for(Er(j),$=0;$t?.removeEventListener("click",r)),document.addEventListener("keydown",o),window.addCleanup(()=>document.removeEventListener("keydown",o))}function ui(t){for(;t.firstChild;)t.removeChild(t.firstChild)}var is=Object.hasOwnProperty,Ia=yt(Wt(),1),os=(0,Ia.default)();function Va(t){return t.document.body.dataset.slug}function sr(t){let e=Fa(Ka(t,"index"),!0);return e.length===0?"/":e}function Ha(t){let e=t.split("/").filter(r=>r!=="").slice(0,-1).map(r=>"..").join("/");return e.length===0&&(e="."),e}function Wa(t,e){return Xa(Ha(t),sr(e))}function Xa(...t){return t.filter(e=>e!=="").join("/").replace(/\/\/+/g,"/")}function Ya(t,e){return t===e||t.endsWith("/"+e)}function Ka(t,e){return Ya(t,e)&&(t=t.slice(0,-e.length)),t}function Fa(t,e){return t.startsWith("/")&&(t=t.substring(1)),!e&&t.endsWith("/")&&(t=t.slice(0,-1)),t}var li="graph-visited";function ci(){return new Set(JSON.parse(localStorage.getItem(li)??"[]"))}function Ua(t){let e=ci();e.add(t),localStorage.setItem(li,JSON.stringify([...e]))}async function fi(t,e){let r=sr(e),o=ci(),s=document.getElementById(t);if(!s)return;ui(s);let{drag:c,zoom:f,depth:d,scale:v,repelForce:g,centerForce:x,linkDistance:L,fontSize:_,opacityScale:N,removeTags:z,showTags:T,focusOnHover:B}=JSON.parse(s.dataset.cfg),C=new Map(Object.entries(await fetchData).map(([$,at])=>[sr($),at])),I=[],rt=[],D=new Set(C.keys());for(let[$,at]of C.entries()){let ht=at.links??[];for(let Mt of ht)D.has(Mt)&&I.push({source:$,target:Mt});if(T){let Mt=at.tags.filter(_t=>!z.includes(_t)).map(_t=>sr("tags/"+_t));rt.push(...Mt.filter(_t=>!rt.includes(_t)));for(let _t of Mt)I.push({source:$,target:_t})}}let G=new Set,ot=[r,"__SENTINEL"];if(d>=0)for(;d>=0&&ot.length>0;){let $=ot.shift();if($==="__SENTINEL")d--,ot.push("__SENTINEL");else{G.add($);let at=I.filter(Mt=>Mt.source===$),ht=I.filter(Mt=>Mt.target===$);ot.push(...at.map(Mt=>Mt.target),...ht.map(Mt=>Mt.source))}}else D.forEach($=>G.add($)),T&&rt.forEach($=>G.add($));let lt={nodes:[...G].map($=>{let at=$.startsWith("tags/")?"#"+$.substring(5):C.get($)?.title??$;return{id:$,text:at,tags:C.get($)?.tags??[]}}),links:I.filter($=>G.has($.source)&&G.has($.target))},St=Oa(lt.nodes).force("charge",ja().strength(-100*g)).force("link",Ea(lt.links).id($=>$.id).distance(L)).force("center",aa().strength(x)),Bt=Math.max(s.offsetHeight,250),Rt=s.offsetWidth,ie=Y("#"+t).append("svg").attr("width",Rt).attr("height",Bt).attr("viewBox",[-Rt/2/v,-Bt/2/v,Rt/v,Bt/v]),un=ie.append("g").selectAll("line").data(lt.links).join("line").attr("class","link").attr("stroke","var(--lightgray)").attr("stroke-width",1),ln=ie.append("g").selectAll("g").data(lt.nodes).enter().append("g"),j=$=>$.id===r?"var(--secondary)":o.has($.id)||$.id.startsWith("tags/")?"var(--tertiary)":"var(--gray)",J=$=>{function at(Ht,Ct){Ht.active||$.alphaTarget(1).restart(),Ct.fx=Ct.x,Ct.fy=Ct.y}function ht(Ht,Ct){Ct.fx=Ht.x,Ct.fy=Ht.y}function Mt(Ht,Ct){Ht.active||$.alphaTarget(0),Ct.fx=null,Ct.fy=null}let _t=()=>{};return yi().on("start",c?at:_t).on("drag",c?ht:_t).on("end",c?Mt:_t)};function R($){let at=I.filter(ht=>ht.source.id===$.id||ht.target.id===$.id).length;return 2+Math.sqrt(at)}let Q=[],st=ln.append("circle").attr("class","node").attr("id",$=>$.id).attr("r",R).attr("fill",j).style("cursor","pointer").on("click",($,at)=>{let ht=Wa(e,at.id);window.spaNavigate(new URL(ht,window.location.toString()))}).on("mouseover",function($,at){let ht=at.id,Mt=bt(".link").filter(Ct=>Ct.source.id===ht||Ct.target.id===ht);B&&(Q=Mt.data().flatMap(Ct=>[Ct.source.id,Ct.target.id]),bt(".link").transition().duration(200).style("opacity",.2),bt(".node").filter(Ct=>!Q.includes(Ct.id)).transition().duration(200).style("opacity",.2)),Mt.transition().duration(200).attr("stroke","var(--gray)").attr("stroke-width",1);let _t=_*1.5,Ht=this.parentNode;Y(Ht).raise().select("text").transition().duration(200).attr("opacityOld",Y(Ht).select("text").style("opacity")).style("opacity",1).style("font-size",_t+"em")}).on("mouseleave",function($,at){B&&(bt(".link").transition().duration(200).style("opacity",1),bt(".node").transition().duration(200).style("opacity",1));let ht=at.id;bt(".link").filter(_t=>_t.source.id===ht||_t.target.id===ht).transition().duration(200).attr("stroke","var(--lightgray)");let Mt=this.parentNode;Y(Mt).select("text").transition().duration(200).style("opacity",Y(Mt).select("text").attr("opacityOld")).style("font-size",_+"em")}).call(J(St)),ct=ln.append("text").attr("dx",0).attr("dy",$=>-R($)+"px").attr("text-anchor","middle").text($=>$.text).style("opacity",(N-1)/3.75).style("pointer-events","none").style("font-size",_+"em").raise().call(J(St));f&&ie.call(qa().extent([[0,0],[Rt,Bt]]).scaleExtent([.25,4]).on("zoom",({transform:$})=>{un.attr("transform",$),st.attr("transform",$);let at=$.k*N,ht=Math.max((at-1)/3.75,0);ct.attr("transform",$).style("opacity",ht)})),St.on("tick",()=>{un.attr("x1",$=>$.source.x).attr("y1",$=>$.source.y).attr("x2",$=>$.target.x).attr("y2",$=>$.target.y),st.attr("cx",$=>$.x).attr("cy",$=>$.y),ct.attr("x",$=>$.x).attr("y",$=>$.y)})}function hi(){let t=Va(window),e=document.getElementById("global-graph-outer"),r=e?.closest(".sidebar");e?.classList.add("active"),r&&(r.style.zIndex="1"),fi("global-graph-container",t);function o(){e?.classList.remove("active");let s=document.getElementById("global-graph-container");r&&(r.style.zIndex="unset"),s&&ui(s)}Ra(e,o)}document.addEventListener("nav",async t=>{let e=t.detail.url;Ua(e),await fi("graph-container",e);let r=document.getElementById("global-graph-icon");r?.addEventListener("click",hi),window.addCleanup(()=>r?.removeEventListener("click",hi))})}(),function(){var zt=new IntersectionObserver(Nt=>{for(let It of Nt){let Kt=It.target.id,Jt=document.querySelector(`a[data-for="${Kt}"]`),pt=It.rootBounds?.height;pt&&Jt&&(It.boundingClientRect.yNt.removeEventListener("click",Yt))}}window.addEventListener("resize",Zt),document.addEventListener("nav",()=>{Zt(),zt.disconnect(),document.querySelectorAll("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").forEach(Nt=>zt.observe(Nt))})}(),function(){var zt=Object.create,Yt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Nt=Object.getOwnPropertyNames,It=Object.getPrototypeOf,Kt=Object.prototype.hasOwnProperty,Jt=(p,n)=>()=>(n||p((n={exports:{}}).exports,n),n.exports),pt=(p,n,i,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let u of Nt(n))!Kt.call(p,u)&&u!==i&&Yt(p,u,{get:()=>n[u],enumerable:!(a=Zt(n,u))||a.enumerable});return p},yt=(p,n,i)=>(i=p!=null?zt(It(p)):{},pt(n||!p||!p.__esModule?Yt(i,"default",{value:p,enumerable:!0}):i,p)),Wt=Jt((p,n)=>{"use strict";n.exports=a;function i(l){return l instanceof Buffer?Buffer.from(l):new l.constructor(l.buffer.slice(),l.byteOffset,l.length)}function a(l){if(l=l||{},l.circles)return u(l);return l.proto?m:y;function h(w,k){for(var A=Object.keys(w),b=new Array(A.length),E=0;E({x:p,y:p}),gt={left:"right",right:"left",bottom:"top",top:"bottom"},Ee={start:"end",end:"start"};function jt(p,n,i){return ut(p,Pt(n,i))}function Ft(p,n){return typeof p=="function"?p(n):p}function qt(p){return p.split("-")[0]}function pe(p){return p.split("-")[1]}function Te(p){return p==="x"?"y":"x"}function ke(p){return p==="y"?"height":"width"}function ye(p){return["top","bottom"].includes(qt(p))?"y":"x"}function ve(p){return Te(ye(p))}function Ot(p,n,i){i===void 0&&(i=!1);let a=pe(p),u=ve(p),l=ke(u),h=u==="x"?a===(i?"end":"start")?"right":"left":a==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(h=te(h)),[h,te(h)]}function Ge(p){let n=te(p);return[Me(p),n,Me(n)]}function Me(p){return p.replace(/start|end/g,n=>Ee[n])}function Qe(p,n,i){let a=["left","right"],u=["right","left"],l=["top","bottom"],h=["bottom","top"];switch(p){case"top":case"bottom":return i?n?u:a:n?a:u;case"left":case"right":return n?l:h;default:return[]}}function Se(p,n,i,a){let u=pe(p),l=Qe(qt(p),i==="start",a);return u&&(l=l.map(h=>h+"-"+u),n&&(l=l.concat(l.map(Me)))),l}function te(p){return p.replace(/left|right|bottom|top/g,n=>gt[n])}function He(p){return{top:0,right:0,bottom:0,left:0,...p}}function de(p){return typeof p!="number"?He(p):{top:p,right:p,bottom:p,left:p}}function Gt(p){return{...p,top:p.y,left:p.x,right:p.x+p.width,bottom:p.y+p.height}}function We(p,n,i){let{reference:a,floating:u}=p,l=ye(n),h=ve(n),y=ke(h),m=qt(n),w=l==="y",k=a.x+a.width/2-u.width/2,A=a.y+a.height/2-u.height/2,b=a[y]/2-u[y]/2,E;switch(m){case"top":E={x:k,y:a.y-u.height};break;case"bottom":E={x:k,y:a.y+a.height};break;case"right":E={x:a.x+a.width,y:A};break;case"left":E={x:a.x-u.width,y:A};break;default:E={x:a.x,y:a.y}}switch(pe(n)){case"start":E[h]-=b*(i&&w?-1:1);break;case"end":E[h]+=b*(i&&w?-1:1);break}return E}var Le=async(p,n,i)=>{let{placement:a="bottom",strategy:u="absolute",middleware:l=[],platform:h}=i,y=l.filter(Boolean),m=await(h.isRTL==null?void 0:h.isRTL(n)),w=await h.getElementRects({reference:p,floating:n,strategy:u}),{x:k,y:A}=We(w,a,m),b=a,E={},M=0;for(let S=0;SY<=0)){var fe,Qt;let Y=(((fe=l.flip)==null?void 0:fe.index)||0)+1,dt=$t[Y];if(dt)return{data:{index:Y,overflows:Lt},reset:{placement:dt}};let kt=(Qt=Lt.filter(bt=>bt.overflows[0]<=0).sort((bt,Dt)=>bt.overflows[1]-Dt.overflows[1])[0])==null?void 0:Qt.placement;if(!kt)switch(E){case"bestFit":{var U;let bt=(U=Lt.map(Dt=>[Dt.placement,Dt.overflows.filter(Vt=>Vt>0).reduce((Vt,me)=>Vt+me,0)]).sort((Dt,Vt)=>Dt[1]-Vt[1])[0])==null?void 0:U[0];bt&&(kt=bt);break}case"initialPlacement":kt=y;break}if(u!==kt)return{reset:{placement:kt}}}return{}}}};function Ne(p){let n=Pt(...p.map(l=>l.left)),i=Pt(...p.map(l=>l.top)),a=ut(...p.map(l=>l.right)),u=ut(...p.map(l=>l.bottom));return{x:n,y:i,width:a-n,height:u-i}}function oe(p){let n=p.slice().sort((u,l)=>u.y-l.y),i=[],a=null;for(let u=0;ua.height/2?i.push([l]):i[i.length-1].push(l),a=l}return i.map(u=>Gt(Ne(u)))}var we=function(p){return p===void 0&&(p={}),{name:"inline",options:p,async fn(n){let{placement:i,elements:a,rects:u,platform:l,strategy:h}=n,{padding:y=2,x:m,y:w}=Ft(p,n),k=Array.from(await(l.getClientRects==null?void 0:l.getClientRects(a.reference))||[]),A=oe(k),b=Gt(Ne(k)),E=de(y);function M(){if(A.length===2&&A[0].left>A[1].right&&m!=null&&w!=null)return A.find(q=>m>q.left-E.left&&mq.top-E.top&&w=2){if(ye(i)==="y"){let Qt=A[0],U=A[A.length-1],Y=qt(i)==="top",dt=Qt.top,kt=U.bottom,bt=Y?Qt.left:U.left,Dt=Y?Qt.right:U.right,Vt=Dt-bt,me=kt-dt;return{top:dt,bottom:kt,left:bt,right:Dt,width:Vt,height:me,x:bt,y:dt}}let q=qt(i)==="left",F=ut(...A.map(Qt=>Qt.right)),et=Pt(...A.map(Qt=>Qt.left)),ft=A.filter(Qt=>q?Qt.left===et:Qt.right===F),xt=ft[0].top,$t=ft[ft.length-1].bottom,ae=et,re=F,Lt=re-ae,fe=$t-xt;return{top:xt,bottom:$t,left:ae,right:re,width:Lt,height:fe,x:ae,y:xt}}return b}let S=await l.getElementRects({reference:{getBoundingClientRect:M},floating:a.floating,strategy:h});return u.reference.x!==S.reference.x||u.reference.y!==S.reference.y||u.reference.width!==S.reference.width||u.reference.height!==S.reference.height?{reset:{rects:S}}:{}}}},le=function(p){return p===void 0&&(p={}),{name:"shift",options:p,async fn(n){let{x:i,y:a,placement:u}=n,{mainAxis:l=!0,crossAxis:h=!1,limiter:y={fn:q=>{let{x:F,y:et}=q;return{x:F,y:et}}},...m}=Ft(p,n),w={x:i,y:a},k=await Be(n,m),A=ye(qt(u)),b=Te(A),E=w[b],M=w[A];if(l){let q=b==="y"?"top":"left",F=b==="y"?"bottom":"right",et=E+k[q],ft=E-k[F];E=jt(et,E,ft)}if(h){let q=A==="y"?"top":"left",F=A==="y"?"bottom":"right",et=M+k[q],ft=M-k[F];M=jt(et,M,ft)}let S=y.fn({...n,[b]:E,[A]:M});return{...S,data:{x:S.x-i,y:S.y-a}}}}};function ge(p){return V(p)?(p.nodeName||"").toLowerCase():"#document"}function O(p){var n;return(p==null||(n=p.ownerDocument)==null?void 0:n.defaultView)||window}function P(p){var n;return(n=(V(p)?p.ownerDocument:p.document)||window.document)==null?void 0:n.documentElement}function V(p){return p instanceof Node||p instanceof O(p).Node}function X(p){return p instanceof Element||p instanceof O(p).Element}function nt(p){return p instanceof HTMLElement||p instanceof O(p).HTMLElement}function K(p){return typeof ShadowRoot>"u"?!1:p instanceof ShadowRoot||p instanceof O(p).ShadowRoot}function Z(p){let{overflow:n,overflowX:i,overflowY:a,display:u}=H(p);return/auto|scroll|overlay|hidden|clip/.test(n+a+i)&&!["inline","contents"].includes(u)}function Et(p){return["table","td","th"].includes(ge(p))}function mt(p){let n=vt(),i=H(p);return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!n&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!n&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(a=>(i.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(i.contain||"").includes(a))}function it(p){let n=tt(p);for(;nt(n)&&!W(n);){if(mt(n))return n;n=tt(n)}return null}function vt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function W(p){return["html","body","#document"].includes(ge(p))}function H(p){return O(p).getComputedStyle(p)}function wt(p){return X(p)?{scrollLeft:p.scrollLeft,scrollTop:p.scrollTop}:{scrollLeft:p.pageXOffset,scrollTop:p.pageYOffset}}function tt(p){if(ge(p)==="html")return p;let n=p.assignedSlot||p.parentNode||K(p)&&p.host||P(p);return K(n)?n.host:n}function Tt(p){let n=tt(p);return W(n)?p.ownerDocument?p.ownerDocument.body:p.body:nt(n)&&Z(n)?n:Tt(n)}function ce(p,n,i){var a;n===void 0&&(n=[]),i===void 0&&(i=!0);let u=Tt(p),l=u===((a=p.ownerDocument)==null?void 0:a.body),h=O(u);return l?n.concat(h,h.visualViewport||[],Z(u)?u:[],h.frameElement&&i?ce(h.frameElement):[]):n.concat(u,ce(u,[],i))}function ee(p){let n=H(p),i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,u=nt(p),l=u?p.offsetWidth:i,h=u?p.offsetHeight:a,y=Xt(i)!==l||Xt(a)!==h;return y&&(i=l,a=h),{width:i,height:a,$:y}}function ze(p){return X(p)?p:p.contextElement}function Oe(p){let n=ze(p);if(!nt(n))return At(1);let i=n.getBoundingClientRect(),{width:a,height:u,$:l}=ee(n),h=(l?Xt(i.width):i.width)/a,y=(l?Xt(i.height):i.height)/u;return(!h||!Number.isFinite(h))&&(h=1),(!y||!Number.isFinite(y))&&(y=1),{x:h,y}}var cn=At(0);function Ze(p){let n=O(p);return!vt()||!n.visualViewport?cn:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function En(p,n,i){return n===void 0&&(n=!1),!i||n&&i!==O(p)?!1:n}function Pe(p,n,i,a){n===void 0&&(n=!1),i===void 0&&(i=!1);let u=p.getBoundingClientRect(),l=ze(p),h=At(1);n&&(a?X(a)&&(h=Oe(a)):h=Oe(p));let y=En(l,i,a)?Ze(l):At(0),m=(u.left+y.x)/h.x,w=(u.top+y.y)/h.y,k=u.width/h.x,A=u.height/h.y;if(l){let b=O(l),E=a&&X(a)?O(a):a,M=b,S=M.frameElement;for(;S&&a&&E!==M;){let q=Oe(S),F=S.getBoundingClientRect(),et=H(S),ft=F.left+(S.clientLeft+parseFloat(et.paddingLeft))*q.x,xt=F.top+(S.clientTop+parseFloat(et.paddingTop))*q.y;m*=q.x,w*=q.y,k*=q.x,A*=q.y,m+=ft,w+=xt,M=O(S),S=M.frameElement}}return Gt({width:k,height:A,x:m,y:w})}var fn=[":popover-open",":modal"];function tn(p){return fn.some(n=>{try{return p.matches(n)}catch{return!1}})}function kn(p){let{elements:n,rect:i,offsetParent:a,strategy:u}=p,l=u==="fixed",h=P(a),y=n?tn(n.floating):!1;if(a===h||y&&l)return i;let m={scrollLeft:0,scrollTop:0},w=At(1),k=At(0),A=nt(a);if((A||!A&&!l)&&((ge(a)!=="body"||Z(h))&&(m=wt(a)),nt(a))){let b=Pe(a);w=Oe(a),k.x=b.x+a.clientLeft,k.y=b.y+a.clientTop}return{width:i.width*w.x,height:i.height*w.y,x:i.x*w.x-m.scrollLeft*w.x+k.x,y:i.y*w.y-m.scrollTop*w.y+k.y}}function Mn(p){return Array.from(p.getClientRects())}function en(p){return Pe(P(p)).left+wt(p).scrollLeft}function Sn(p){let n=P(p),i=wt(p),a=p.ownerDocument.body,u=ut(n.scrollWidth,n.clientWidth,a.scrollWidth,a.clientWidth),l=ut(n.scrollHeight,n.clientHeight,a.scrollHeight,a.clientHeight),h=-i.scrollLeft+en(p),y=-i.scrollTop;return H(a).direction==="rtl"&&(h+=ut(n.clientWidth,a.clientWidth)-u),{width:u,height:l,x:h,y}}function Ye(p,n){let i=O(p),a=P(p),u=i.visualViewport,l=a.clientWidth,h=a.clientHeight,y=0,m=0;if(u){l=u.width,h=u.height;let w=vt();(!w||w&&n==="fixed")&&(y=u.offsetLeft,m=u.offsetTop)}return{width:l,height:h,x:y,y:m}}function Hn(p,n){let i=Pe(p,!0,n==="fixed"),a=i.top+p.clientTop,u=i.left+p.clientLeft,l=nt(p)?Oe(p):At(1),h=p.clientWidth*l.x,y=p.clientHeight*l.y,m=u*l.x,w=a*l.y;return{width:h,height:y,x:m,y:w}}function hn(p,n,i){let a;if(n==="viewport")a=Ye(p,i);else if(n==="document")a=Sn(P(p));else if(X(n))a=Hn(n,i);else{let u=Ze(p);a={...n,x:n.x-u.x,y:n.y-u.y}}return Gt(a)}function je(p,n){let i=tt(p);return i===n||!X(i)||W(i)?!1:H(i).position==="fixed"||je(i,n)}function Ln(p,n){let i=n.get(p);if(i)return i;let a=ce(p,[],!1).filter(y=>X(y)&&ge(y)!=="body"),u=null,l=H(p).position==="fixed",h=l?tt(p):p;for(;X(h)&&!W(h);){let y=H(h),m=mt(h);!m&&y.position==="fixed"&&(u=null),(l?!m&&!u:!m&&y.position==="static"&&u&&["absolute","fixed"].includes(u.position)||Z(h)&&!m&&je(p,h))?a=a.filter(w=>w!==h):u=y,h=tt(h)}return n.set(p,a),a}function pn(p){let{element:n,boundary:i,rootBoundary:a,strategy:u}=p,l=[...i==="clippingAncestors"?tn(n)?[]:Ln(n,this._c):[].concat(i),a],h=l[0],y=l.reduce((m,w)=>{let k=hn(n,w,u);return m.top=ut(k.top,m.top),m.right=Pt(k.right,m.right),m.bottom=Pt(k.bottom,m.bottom),m.left=ut(k.left,m.left),m},hn(n,h,u));return{width:y.right-y.left,height:y.bottom-y.top,x:y.left,y:y.top}}function Nn(p){let{width:n,height:i}=ee(p);return{width:n,height:i}}function On(p,n,i){let a=nt(n),u=P(n),l=i==="fixed",h=Pe(p,!0,l,n),y={scrollLeft:0,scrollTop:0},m=At(0);if(a||!a&&!l)if((ge(n)!=="body"||Z(u))&&(y=wt(n)),a){let A=Pe(n,!0,l,n);m.x=A.x+n.clientLeft,m.y=A.y+n.clientTop}else u&&(m.x=en(u));let w=h.left+y.scrollLeft-m.x,k=h.top+y.scrollTop-m.y;return{x:w,y:k,width:h.width,height:h.height}}function Ke(p){return H(p).position==="static"}function Fe(p,n){return!nt(p)||H(p).position==="fixed"?null:n?n(p):p.offsetParent}function nn(p,n){let i=O(p);if(tn(p))return i;if(!nt(p)){let u=tt(p);for(;u&&!W(u);){if(X(u)&&!Ke(u))return u;u=tt(u)}return i}let a=Fe(p,n);for(;a&&Et(a)&&Ke(a);)a=Fe(a,n);return a&&W(a)&&Ke(a)&&!mt(a)?i:a||it(p)||i}var dn=async function(p){let n=this.getOffsetParent||nn,i=this.getDimensions,a=await i(p.floating);return{reference:On(p.reference,await n(p.floating),p.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function gn(p){return H(p).direction==="rtl"}var xe={convertOffsetParentRelativeRectToViewportRelativeRect:kn,getDocumentElement:P,getClippingRect:pn,getOffsetParent:nn,getElementRects:dn,getClientRects:Mn,getDimensions:Nn,getScale:Oe,isElement:X,isRTL:gn},ne=le,jn=Xe,$e=we,Cn=(p,n,i)=>{let a=new Map,u={platform:xe,...i},l={...u.platform,_c:a};return Le(p,n,{...u,platform:l})},mn=Object.hasOwnProperty,Ue=yt(Wt(),1),rn=(0,Ue.default)(),yn=(p,n,i)=>{let a=new URL(p.getAttribute(n),i);p.setAttribute(n,a.pathname+a.hash)};function vn(p,n){p.querySelectorAll('[href^="./"], [href^="../"]').forEach(i=>yn(i,"href",n)),p.querySelectorAll('[src^="./"], [src^="../"]').forEach(i=>yn(i,"src",n))}var wn=new DOMParser;async function xn({clientX:p,clientY:n}){let i=this;if(i.dataset.noPopover==="true")return;async function a(M){let{x:S,y:q}=await Cn(i,M,{middleware:[$e({x:p,y:n}),ne(),jn()]});Object.assign(M.style,{left:`${S}px`,top:`${q}px`})}let u=()=>[...i.children].some(M=>M.classList.contains("popover"));if(u())return a(i.lastChild);let l=new URL(document.location.href);l.hash="",l.search="";let h=new URL(i.href),y=h.hash;h.hash="",h.search="";let m=await fetch(`${h}`).catch(M=>{console.error(M)});if(u()||!m)return;let[w]=m.headers.get("Content-Type").split(";"),[k,A]=w.split("/"),b=document.createElement("div");b.classList.add("popover");let E=document.createElement("div");switch(E.classList.add("popover-inner"),b.appendChild(E),E.dataset.contentType=w??void 0,k){case"image":let M=document.createElement("img");M.src=h.toString(),M.alt=h.pathname,E.appendChild(M);break;case"application":switch(A){case"pdf":let et=document.createElement("iframe");et.src=h.toString(),E.appendChild(et);break;default:break}break;default:let S=await m.text(),q=wn.parseFromString(S,"text/html");vn(q,h);let F=[...q.getElementsByClassName("popover-hint")];if(F.length===0)return;F.forEach(et=>E.appendChild(et))}if(a(b),i.appendChild(b),y!==""){let M=E.querySelector(y);M&&E.scroll({top:M.offsetTop-12,behavior:"instant"})}}document.addEventListener("nav",()=>{let p=[...document.getElementsByClassName("internal")];for(let n of p)n.addEventListener("mouseenter",xn),window.addCleanup(()=>n.removeEventListener("mouseenter",xn))})}(),function(){const zt=document.createElement("script");zt.src="plausible.nexae.net/js/script.manual.js",zt.setAttribute("data-domain",location.hostname),zt.defer=!0,document.head.appendChild(zt),window.plausible=window.plausible||function(){(window.plausible.q=window.plausible.q||[]).push(arguments)},document.addEventListener("nav",()=>{plausible("pageview")})}(),function(){var zt=Object.create,Yt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Nt=Object.getOwnPropertyNames,It=Object.getPrototypeOf,Kt=Object.prototype.hasOwnProperty,Jt=(O,P)=>()=>(P||O((P={exports:{}}).exports,P),P.exports),pt=(O,P,V,X)=>{if(P&&typeof P=="object"||typeof P=="function")for(let nt of Nt(P))!Kt.call(O,nt)&&nt!==V&&Yt(O,nt,{get:()=>P[nt],enumerable:!(X=Zt(P,nt))||X.enumerable});return O},yt=(O,P,V)=>(V=O!=null?zt(It(O)):{},pt(P||!O||!O.__esModule?Yt(V,"default",{value:O,enumerable:!0}):V,O)),Wt=Jt((O,P)=>{"use strict";P.exports=X;function V(K){return K instanceof Buffer?Buffer.from(K):new K.constructor(K.buffer.slice(),K.byteOffset,K.length)}function X(K){if(K=K||{},K.circles)return nt(K);return K.proto?mt:Et;function Z(it,vt){for(var W=Object.keys(it),H=new Array(W.length),wt=0;wt(P,V)=>P[`node${O}`]===V[`node${O}`],ut=Pt("Name"),Xt=Pt("Type"),At=Pt("Value");function gt(O,P){if(O.attributes.length===0&&P.attributes.length===0)return[];let V=[],X=new Map,nt=new Map;for(let K of O.attributes)X.set(K.name,K.value);for(let K of P.attributes){let Z=X.get(K.name);K.value===Z?X.delete(K.name):(typeof Z<"u"&&X.delete(K.name),nt.set(K.name,K.value))}for(let K of X.keys())V.push({type:5,name:K});for(let[K,Z]of nt.entries())V.push({type:4,name:K,value:Z});return V}function Ee(O,P=!0){let V=`${O.localName}`;for(let{name:X,value:nt}of O.attributes)P&&X.startsWith("data-")||(V+=`[${X}=${nt}]`);return V+=O.innerHTML,V}function jt(O){switch(O.tagName){case"BASE":case"TITLE":return O.localName;case"META":{if(O.hasAttribute("name"))return`meta[name="${O.getAttribute("name")}"]`;if(O.hasAttribute("property"))return`meta[name="${O.getAttribute("property")}"]`;break}case"LINK":{if(O.hasAttribute("rel")&&O.hasAttribute("href"))return`link[rel="${O.getAttribute("rel")}"][href="${O.getAttribute("href")}"]`;if(O.hasAttribute("href"))return`link[href="${O.getAttribute("href")}"]`;break}}return Ee(O)}function Ft(O){let[P,V=""]=O.split("?");return`${P}?t=${Date.now()}&${V.replace(/t=\d+/g,"")}`}function qt(O){if(O.nodeType===1&&O.hasAttribute("data-persist"))return O;if(O.nodeType===1&&O.localName==="script"){let P=document.createElement("script");for(let{name:V,value:X}of O.attributes)V==="src"&&(X=Ft(X)),P.setAttribute(V,X);return P.innerHTML=O.innerHTML,P}return O.cloneNode(!0)}function pe(O,P){if(O.children.length===0&&P.children.length===0)return[];let V=[],X=new Map,nt=new Map,K=new Map;for(let Z of O.children)X.set(jt(Z),Z);for(let Z of P.children){let Et=jt(Z),mt=X.get(Et);mt?Ee(Z,!1)!==Ee(mt,!1)&&nt.set(Et,qt(Z)):K.set(Et,qt(Z)),X.delete(Et)}for(let Z of O.childNodes){if(Z.nodeType===1){let Et=jt(Z);if(X.has(Et)){V.push({type:1});continue}else if(nt.has(Et)){let mt=nt.get(Et);V.push({type:3,attributes:gt(Z,mt),children:Te(Z,mt)});continue}}V.push(void 0)}for(let Z of K.values())V.push({type:0,node:qt(Z)});return V}function Te(O,P){let V=[],X=Math.max(O.childNodes.length,P.childNodes.length);for(let nt=0;ntve(X,Et,Z[mt])));return}}}function Ot(O,P){let V=ke(O,P);return ve(O,V)}var Ge=Object.hasOwnProperty,Me=yt(Wt(),1),Qe=(0,Me.default)();function Se(O){return O.document.body.dataset.slug}var te=(O,P,V)=>{let X=new URL(O.getAttribute(P),V);O.setAttribute(P,X.pathname+X.hash)};function He(O,P){O.querySelectorAll('[href^="./"], [href^="../"]').forEach(V=>te(V,"href",P)),O.querySelectorAll('[src^="./"], [src^="../"]').forEach(V=>te(V,"src",P))}var de=1,Gt=document.createElement("route-announcer"),We=O=>O?.nodeType===de,Le=O=>{try{let P=new URL(O);if(window.location.origin===P.origin)return!0}catch{}return!1},Be=O=>{let P=O.origin===window.location.origin,V=O.pathname===window.location.pathname;return P&&V},Xe=({target:O})=>{if(!We(O)||O.attributes.getNamedItem("target")?.value==="_blank")return;let P=O.closest("a");if(!P||"routerIgnore"in P.dataset)return;let{href:V}=P;if(Le(V))return{url:new URL(V),scroll:"routerNoscroll"in P.dataset?!1:void 0}};function Ne(O){let P=new CustomEvent("nav",{detail:{url:O}});document.dispatchEvent(P)}var oe=new Set;window.addCleanup=O=>oe.add(O);var we;async function le(O,P=!1){we=we||new DOMParser;let V=await fetch(`${O}`).then(K=>{if(K.headers.get("content-type")?.startsWith("text/html"))return K.text();window.location.assign(O)}).catch(()=>{window.location.assign(O)});if(!V)return;oe.forEach(K=>K()),oe.clear();let X=we.parseFromString(V,"text/html");He(X,O);let nt=X.querySelector("title")?.textContent;if(nt)document.title=nt;else{let K=document.querySelector("h1");nt=K?.innerText??K?.textContent??O.pathname}Gt.textContent!==nt&&(Gt.textContent=nt),Gt.dataset.persist="",X.body.appendChild(Gt),Ot(document.body,X.body),P||(O.hash?document.getElementById(decodeURIComponent(O.hash.substring(1)))?.scrollIntoView():window.scrollTo({top:0})),document.head.querySelectorAll(":not([spa-preserve])").forEach(K=>K.remove()),X.head.querySelectorAll(":not([spa-preserve])").forEach(K=>document.head.appendChild(K)),P||history.pushState({},"",O),Ne(Se(window)),delete Gt.dataset.persist}window.spaNavigate=le;function ge(){return typeof window<"u"&&(window.addEventListener("click",async O=>{let{url:P}=Xe(O)??{};if(!(!P||O.ctrlKey||O.metaKey)){if(O.preventDefault(),Be(P)&&P.hash){document.getElementById(decodeURIComponent(P.hash.substring(1)))?.scrollIntoView(),history.pushState({},"",P);return}try{le(P,!1)}catch{window.location.assign(P)}}}),window.addEventListener("popstate",O=>{let{url:P}=Xe(O)??{};if(!(window.location.hash&&window.location.pathname===P?.pathname))try{le(new URL(window.location.toString()),!0)}catch{window.location.reload()}})),new class{go(O){let P=new URL(O,window.location.toString());return le(P,!1)}back(){return window.history.back()}forward(){return window.history.forward()}}}if(ge(),Ne(Se(window)),!customElements.get("route-announcer")){let O={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};customElements.define("route-announcer",class extends HTMLElement{constructor(){super()}connectedCallback(){for(let[P,V]of Object.entries(O))this.setAttribute(P,V)}})}}();