@dogsbay/ssg 0.2.0-beta.129 → 0.2.0-beta.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package/THIRD-PARTY-NOTICES.txt +5 -5
- package/dist/package/browser.mjs +243 -111
- package/dist/package/chunks/{prebuilt-css-default-MOOPVBZ5.mjs → prebuilt-css-default-GJIN3VOR.mjs} +38 -2
- package/dist/package/chunks/{prebuilt-css-mintlify-HAG54PAM.mjs → prebuilt-css-mintlify-SKWKD2KB.mjs} +38 -2
- package/dist/package/client.mjs +35 -8
- package/dist/package/css.mjs +165 -3
- package/dist/package/types/core/build.d.ts +78 -0
- package/dist/package/types/core/dev.d.ts +19 -2
- package/dist/package/types/core/diagrams.d.ts +4 -2
- package/dist/package/types/package/browser.d.ts +1 -1
- package/package.json +29 -29
package/dist/package/browser.mjs
CHANGED
|
@@ -939,7 +939,7 @@ import { parseMeta as parseMeta3 } from "@dogsbay/types";
|
|
|
939
939
|
import { directoryChildren, hasChildLinks, navKey, realizeChildLinks } from "@dogsbay/serialize-core";
|
|
940
940
|
|
|
941
941
|
// src/generated/assets.ts
|
|
942
|
-
var CLIENT_JS = '/*! dogsbay-ssg site client (Apache-2.0). Third-party notices: THIRD-PARTY-NOTICES.txt */\n"use strict";(()=>{var bn=Object.defineProperty;var vn=(i,t,e)=>t in i?bn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var h=(i,t,e)=>vn(i,typeof t!="symbol"?t+"":t,e);var z=class extends HTMLElement{constructor(){super(...arguments);h(this,"_initialized",!1);h(this,"_deferred",!1)}connectedCallback(){if(!this._initialized&&!this.firstElementChild&&typeof document<"u"&&document.readyState==="loading"){this._deferred||(this._deferred=!0,document.addEventListener("DOMContentLoaded",()=>{this._deferred=!1,this.isConnected&&this.connectedCallback()},{once:!0}));return}this._initialized||(this.setup(),this._initialized=!0),this.connect()}disconnectedCallback(){this.disconnect()}setup(){}connect(){}disconnect(){}},yn={"db-tabs":"block","db-accordion":"block","db-collapsible":"block","db-details-sheet":"block","db-card":"block","db-steps":"block","db-code-block":"block","db-link-button":"inline-block","db-dialog":"contents","db-popover":"inline-block","db-tooltip":"inline-block","db-select":"inline-block","db-combobox":"block","db-nav-tree":"block","db-toc":"block"},De="dogsbay-elements-display";function N(){if(typeof document>"u"||document.getElementById(De))return;let i=Object.entries(yn).map(([e,n])=>`:where(${e}){display:${n}}`).join(""),t=document.createElement("style");t.id=De,t.textContent=i,document.head.prepend(t)}function wn(i){return i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"}function gt(i,t,e){let n=t;do n+=e?-1:1;while(n>=0&&n<i.length&&wn(i[n]));return n}var Dt=class{constructor(i,t,e={}){h(this,"container");h(this,"itemSelector");h(this,"opts");h(this,"keydownHandler",null);h(this,"active",!1);this.container=i,this.itemSelector=t,this.opts={orientation:e.orientation??"horizontal",loop:e.loop??!0,homeEnd:e.homeEnd??!0,onHighlightedIndexChange:e.onHighlightedIndexChange??(()=>{})}}getItems(){return Array.from(this.container.querySelectorAll(this.itemSelector))}isForwardKey(i,t){let{orientation:e}=this.opts;return(e==="horizontal"||e==="both")&&i===(t?"ArrowLeft":"ArrowRight")||(e==="vertical"||e==="both")&&i==="ArrowDown"}isBackwardKey(i,t){let{orientation:e}=this.opts;return(e==="horizontal"||e==="both")&&i===(t?"ArrowRight":"ArrowLeft")||(e==="vertical"||e==="both")&&i==="ArrowUp"}activate(){this.active||(this.active=!0,this.keydownHandler=i=>{let t=this.getItems();if(t.length===0||i.ctrlKey||i.altKey||i.metaKey)return;let e=getComputedStyle(this.container).direction==="rtl",n=t.indexOf(document.activeElement);if(n===-1)return;let s=null;this.isForwardKey(i.key,e)?(s=gt(t,n,!1),s>=t.length&&(s=this.opts.loop?gt(t,-1,!1):n)):this.isBackwardKey(i.key,e)?(s=gt(t,n,!0),s<0&&(s=this.opts.loop?gt(t,t.length,!0):n)):this.opts.homeEnd&&i.key==="Home"?s=gt(t,-1,!1):this.opts.homeEnd&&i.key==="End"&&(s=gt(t,t.length,!0)),s!==null&&(s<0||s>=t.length||s!==n&&(i.preventDefault(),t[n].setAttribute("tabindex","-1"),t[s].setAttribute("tabindex","0"),t[s].focus(),this.opts.onHighlightedIndexChange(s)))},this.container.addEventListener("keydown",this.keydownHandler))}deactivate(){this.active&&(this.active=!1,this.keydownHandler&&(this.container.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null))}setActiveIndex(i,t){i.forEach((e,n)=>{e.setAttribute("tabindex",n===t?"0":"-1")})}isActive(){return this.active}};var En=0;function Re(i){return`${i}-${++En}`}var Ie=class extends z{constructor(){super(...arguments);h(this,"list");h(this,"triggers",[]);h(this,"panels",[]);h(this,"nav",null);h(this,"value","");h(this,"syncKey",null);h(this,"orientation","horizontal");h(this,"handleClick",t=>{let e=t.target.closest("[data-part=\'trigger\']");if(!e||e.hasAttribute("disabled"))return;let n=e.dataset.value;n&&this.select(n)});h(this,"handleStorage",t=>{if(!this.syncKey||t.key!==`db-tabs-sync:${this.syncKey}`)return;let e=t.newValue;e&&this.value!==e&&this.has(e)&&this.select(e)});h(this,"handleSyncEvent",(t=>{let e=t.detail.value;e&&this.value!==e&&this.has(e)&&this.select(e)}))}has(t){return this.triggers.some(e=>e.dataset.value===t)}own(t){return Array.from(this.querySelectorAll(t)).filter(e=>e.closest("db-tabs")===this)}setup(){var o;let t=this.own("[data-part=\'list\']")[0]??null;if(!t)return;this.list=t,this.triggers=this.own("[data-part=\'trigger\']"),this.panels=this.own("[data-part=\'content\']"),this.orientation=this.getAttribute("orientation")||"horizontal",this.syncKey=this.getAttribute("sync-key")||null,t.setAttribute("role","tablist"),t.setAttribute("aria-orientation",this.orientation),this.triggers.forEach(r=>{let a=r.dataset.value;r.setAttribute("role","tab");let l=r.id||Re("db-tab");r.id=l;let c=this.panels.find(d=>d.dataset.value===a);if(c){c.setAttribute("role","tabpanel");let d=c.id||Re("db-tabpanel");c.id=d,r.setAttribute("aria-controls",d),c.setAttribute("aria-labelledby",l)}}),this.nav=new Dt(t,"[data-part=\'trigger\']",{orientation:this.orientation,loop:!0,homeEnd:!0,onHighlightedIndexChange:()=>{var l;let r=document.activeElement,a=(l=r==null?void 0:r.dataset)==null?void 0:l.value;a&&this.select(a)}}),this.nav.activate();let n=this.getAttribute("default-value")||((o=this.triggers[0])==null?void 0:o.dataset.value)||"";if(this.syncKey){let r=localStorage.getItem(`db-tabs-sync:${this.syncKey}`);r&&this.triggers.some(a=>a.dataset.value===r)&&(n=r)}let s=window.location.hash.slice(1);s&&this.triggers.some(r=>r.dataset.value===s)&&(n=s),this.select(n)}connect(){var t;(t=this.list)==null||t.addEventListener("click",this.handleClick),this.syncKey&&(window.addEventListener("storage",this.handleStorage),document.addEventListener(`db-tabs-sync:${this.syncKey}`,this.handleSyncEvent))}disconnect(){var t;(t=this.list)==null||t.removeEventListener("click",this.handleClick),this.syncKey&&(window.removeEventListener("storage",this.handleStorage),document.removeEventListener(`db-tabs-sync:${this.syncKey}`,this.handleSyncEvent))}select(t){this.value!==t&&(this.value=t,this.triggers.forEach(e=>{let n=e.dataset.value===t;e.setAttribute("aria-selected",String(n)),e.setAttribute("tabindex",n?"0":"-1"),n?e.setAttribute("data-state","active"):e.removeAttribute("data-state")}),this.panels.forEach(e=>{let n=e.dataset.value===t;e.hidden=!n,n?(e.setAttribute("data-state","active"),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0")):e.removeAttribute("data-state")}),this.syncKey&&(localStorage.setItem(`db-tabs-sync:${this.syncKey}`,t),document.dispatchEvent(new CustomEvent(`db-tabs-sync:${this.syncKey}`,{detail:{value:t,source:this}}))),this.dispatchEvent(new CustomEvent("db-tabs:change",{detail:{value:t},bubbles:!0})))}};N();customElements.get("db-tabs")||customElements.define("db-tabs",Ie);var xn=0;function An(i){return`${i}-${++xn}`}var Me=class{constructor(i,t,e={}){h(this,"trigger");h(this,"content");h(this,"_open",!1);h(this,"opts");this.trigger=i,this.content=t,this.opts=e;let n=An("base-collapsible");i.id||(i.id=`${n}-trigger`),t.id||(t.id=`${n}-content`),i.setAttribute("aria-controls",t.id),t.setAttribute("aria-labelledby",i.id),t.setAttribute("role","region"),i.setAttribute("aria-expanded","false"),i.addEventListener("click",()=>{i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"||this.toggle()})}get isOpen(){return this._open}toggle(){this._open?this.collapse():this.expand()}expand(){var i,t;this._open||(this._open=!0,this.trigger.setAttribute("aria-expanded","true"),this.content.hidden=!1,this.content.setAttribute("data-state","open"),(t=(i=this.opts).onToggle)==null||t.call(i,!0))}collapse(){var i,t;this._open&&(this._open=!1,this.trigger.setAttribute("aria-expanded","false"),this.content.hidden=!0,this.content.removeAttribute("data-state"),(t=(i=this.opts).onToggle)==null||t.call(i,!1))}};var He=class extends z{constructor(){super(...arguments);h(this,"items",[]);h(this,"nav",null);h(this,"openValues",new Set);h(this,"type","single")}setup(){this.type=this.getAttribute("type")||"single";let t=this.getAttribute("default-value")||"",e=t?t.split(","):[],n=Array.from(this.querySelectorAll("[data-part=\'item\']"));this.items=n.map(s=>{let o=s.querySelector("[data-part=\'trigger\']"),r=s.querySelector("[data-part=\'content\']");if(!o||!r)return null;let a=s.dataset.value||"",l=s.hasAttribute("data-disabled");l&&(o.setAttribute("disabled",""),o.setAttribute("aria-disabled","true"));let c=new Me(o,r,{onToggle:d=>{d?this.onItemExpanded(a):this.onItemCollapsed(a)}});return{el:s,value:a,collapsible:c,disabled:l}}).filter(Boolean),this.nav=new Dt(this,"[data-part=\'trigger\']",{orientation:"vertical",loop:!0,homeEnd:!0}),this.nav.activate(),this.items.forEach((s,o)=>{s.collapsible.trigger.setAttribute("tabindex",o===0?"0":"-1")}),e.forEach(s=>{let o=this.items.find(r=>r.value===s&&!r.disabled);o&&o.collapsible.expand()})}onItemExpanded(t){if(this.type==="single"){for(let n of this.openValues)if(n!==t){let s=this.items.find(o=>o.value===n);s&&s.collapsible.collapse()}}this.openValues.add(t);let e=this.items.find(n=>n.value===t);e&&e.el.setAttribute("data-state","open"),this.dispatchEvent(new CustomEvent("db-accordion:change",{detail:{value:t,open:!0,openValues:[...this.openValues]},bubbles:!0}))}onItemCollapsed(t){this.openValues.delete(t);let e=this.items.find(n=>n.value===t);e&&e.el.removeAttribute("data-state"),this.dispatchEvent(new CustomEvent("db-accordion:change",{detail:{value:t,open:!1,openValues:[...this.openValues]},bubbles:!0}))}};N();customElements.get("db-accordion")||customElements.define("db-accordion",He);var Sn=0;function F(i){return`${i}-${++Sn}`}function et(i,t){let e=i.localName;return Array.from(i.querySelectorAll(t)).filter(n=>n.closest(e)===i)}function $(i,t){return et(i,t)[0]??null}function bt(i){if(!i||!i.hasAttribute("data-as-child"))return i;let t=i.firstElementChild;if(!t)return i;let e=i.getAttribute("data-part");return e&&t.setAttribute("data-part",e),t}function W(i){return i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"||i.getAttribute("data-disabled")==="true"}function ze(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype.showPopover=="function"}function vt(i){if(i.hidden=!1,!ze())return"inline";i.hasAttribute("popover")||i.setAttribute("popover","manual"),i.style.inset="auto",i.style.margin="0";try{i.matches(":popover-open")||i.showPopover()}catch{return"inline"}return"top-layer"}function yt(i){if(ze())try{i.matches(":popover-open")&&i.hidePopover()}catch{}i.hidden=!0}var Cn=\'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]\';function Ne(i){return Array.from(i.querySelectorAll(Cn)).filter(t=>!t.closest("[hidden]")&&!W(t))}function _e(i,t){let e=typeof i.getAnimations=="function"?i.getAnimations():[];if(!e.length)return t();Promise.all(e.map(n=>n.finished)).then(t,t)}function wt(i){try{return decodeURIComponent(i)}catch{return i}}var Fe=class extends z{constructor(){super(...arguments);h(this,"details",null);h(this,"summary",null);h(this,"dialog",null);h(this,"body",null);h(this,"source",null);h(this,"moved",[]);h(this,"handledHash",null);h(this,"onSummaryClick",t=>{var n,s;let e=t.target;e&&e!==this.summary&&((s=(n=e.closest)==null?void 0:n.call(e,"a[href], button, input, select, textarea, label"))==null?void 0:s.closest("summary"))===this.summary||(t.preventDefault(),this.show())});h(this,"onDialogClick",t=>{let e=this.dialog;if(!e||t.target!==e)return;let n=e.getBoundingClientRect();!(t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom)&&(t.clientX!==0||t.clientY!==0)&&e.close()});h(this,"onDialogClose",()=>this.restore());h(this,"onDocClick",t=>{var o,r;if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=(r=(o=t.target)==null?void 0:o.closest)==null?void 0:r.call(o,"a[href]");if(!e||!this.details||this.open||e.hasAttribute("download")||e.target&&e.target!=="_self")return;let n=new URL(e.href,location.href);if(!n.hash||n.hash!==location.hash||n.pathname!==location.pathname||n.search!==location.search)return;let s=document.getElementById(wt(n.hash.slice(1)));if(!(!s||!this.details.contains(s))){for(let a of this.details.querySelectorAll("db-details-sheet"))a.handledHash=null;this.show(s)}});h(this,"onHash",()=>{this.handledHash=null,this.openForHash()})}get open(){var t;return!!((t=this.dialog)!=null&&t.open)}setup(){var d;let t=Array.from(this.children).find(u=>u.tagName==="DETAILS")??null,e=t?Array.from(t.children).find(u=>u.tagName==="SUMMARY")??null:null,n=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function";if(!t||!e||!n)return;for(let u of Array.from(t.children))u.getAttribute("role")==="status"&&u.setAttribute("aria-live","off");this.details=t,this.summary=e,t.open=!1,Ln();let s=(((d=e.querySelector("[data-part=\'title\']"))==null?void 0:d.textContent)??e.textContent??"").trim(),o=document.createElement("dialog");o.className="db-sheet",o.id=F("db-sheet");let r=document.createElement("h2");r.className="db-sheet-title",r.id=F("db-sheet-title"),r.textContent=s,o.setAttribute("aria-labelledby",r.id);let a=document.createElement("button");a.type="button",a.className="db-sheet-close",a.setAttribute("aria-label",this.getAttribute("close-label")||"Close"),a.innerHTML=\'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\',a.addEventListener("click",()=>o.close());let l=document.createElement("div");l.className="db-sheet-header",l.append(r,a);let c=document.createElement("div");c.className="db-sheet-body",o.append(l,c),this.append(o),this.dialog=o,this.body=c,e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-controls",o.id),e.setAttribute("aria-expanded","false"),this.setAttribute("data-state","closed")}connect(){this.dialog&&(this.summary.addEventListener("click",this.onSummaryClick),this.dialog.addEventListener("click",this.onDialogClick),this.dialog.addEventListener("close",this.onDialogClose),window.addEventListener("hashchange",this.onHash),document.addEventListener("click",this.onDocClick),queueMicrotask(()=>this.isConnected&&this.openForHash()))}disconnect(){this.dialog&&(this.dialog.open&&this.dialog.close(),this.restore(!1),this.summary.removeEventListener("click",this.onSummaryClick),this.dialog.removeEventListener("click",this.onDialogClick),this.dialog.removeEventListener("close",this.onDialogClose),window.removeEventListener("hashchange",this.onHash),document.removeEventListener("click",this.onDocClick))}show(t){var l;let{dialog:e,details:n,body:s}=this;if(!e||!n||!s||e.open)return;let o=Array.from(n.childNodes).filter(c=>c!==this.summary),r=o.filter(c=>c.nodeType===Node.ELEMENT_NODE),a=r.length===1&&o.every(c=>{var d;return c===r[0]||!((d=c.textContent)!=null&&d.trim())})?r[0]:null;this.source=a??n,this.moved=a?Array.from(a.childNodes):o,s.append(...this.moved),e.showModal(),this.summary.setAttribute("aria-expanded","true"),this.setAttribute("data-state","open"),t&&t!==n&&((l=t.scrollIntoView)==null||l.call(t,{block:"start"})),this.dispatchEvent(new CustomEvent("db-details-sheet:open",{bubbles:!0}))}close(){var t;(t=this.dialog)==null||t.close()}restore(t=!0){var e,n;this.source&&(this.source.append(...this.moved),this.source=null,this.moved=[],this.summary.setAttribute("aria-expanded","false"),this.setAttribute("data-state","closed"),t&&this.isConnected&&((n=(e=this.summary).checkVisibility)==null?void 0:n.call(e))!==!1&&this.summary.focus(),this.dispatchEvent(new CustomEvent("db-details-sheet:close",{bubbles:!0})))}openForHash(){let t=wt(location.hash.slice(1));if(!t||!this.details||this.handledHash===location.hash||(this.handledHash=location.hash,this.open))return;let e=document.getElementById(t);e&&this.details.contains(e)&&this.show(e)}},Pe="dogsbay-details-sheet";function Ln(){if(document.getElementById(Pe))return;let i=document.createElement("style");i.id=Pe,i.textContent=["dialog.db-sheet{position:fixed;inset:0 0 0 auto;margin:0;height:100dvh;max-height:none;width:min(32rem,100vw);max-width:100vw;padding:0;border:0;border-left:1px solid var(--border);background:var(--background);color:var(--foreground);box-shadow:0 10px 15px -3px rgb(0 0 0/.1),0 4px 6px -4px rgb(0 0 0/.1);flex-direction:column}","dialog.db-sheet[open]{display:flex}","dialog.db-sheet::backdrop{background:rgb(0 0 0/.6)}",".db-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.5rem;border-bottom:1px solid var(--border)}","dialog.db-sheet h2.db-sheet-title{margin:0;padding:0;border:0;font-size:1.125rem;line-height:1.75rem;font-weight:600;scroll-margin:0}",".db-sheet-close{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;border-radius:.375rem;background:transparent;color:var(--muted-foreground);cursor:pointer}",".db-sheet-close:hover{background:var(--accent,var(--muted));color:var(--foreground)}",".db-sheet-close:focus-visible{outline:2px solid var(--ring);outline-offset:2px}",".db-sheet-body{flex:1;overflow-y:auto;padding:1.5rem;font-size:.875rem;line-height:1.625}","dialog.db-sheet .db-sheet-body>:first-child{margin-top:0}","html:has(dialog.db-sheet[open]){overflow:hidden}","db-details-sheet>details>summary>span:last-child{transform:rotate(-90deg)}","@media (prefers-reduced-motion:no-preference){dialog.db-sheet[open]{animation:db-sheet-in .2s ease-out}dialog.db-sheet[open]::backdrop{animation:db-sheet-fade .2s ease-out}}","@keyframes db-sheet-in{from{transform:translateX(100%)}}","@keyframes db-sheet-fade{from{opacity:0}}"].join(""),document.head.append(i)}N();customElements.get("db-details-sheet")||customElements.define("db-details-sheet",Fe);var $e=class extends z{constructor(){super(...arguments);h(this,"copyBtn",null);h(this,"copyIcon",null);h(this,"checkIcon",null);h(this,"liveRegion",null);h(this,"resetTimeout",null);h(this,"handleCopy",async()=>{let t=this.getCopyText();if(t)try{await navigator.clipboard.writeText(t),this.showCopiedFeedback(),this.dispatchEvent(new CustomEvent("db-code-block:copied",{detail:{text:t},bubbles:!0}))}catch{}})}setup(){this.copyBtn=this.querySelector("[data-part=\'copy\']"),this.copyIcon=this.querySelector("[data-part=\'copy-icon\']"),this.checkIcon=this.querySelector("[data-part=\'check-icon\']"),this.copyBtn&&!this.copyBtn.hasAttribute("aria-label")&&this.copyBtn.setAttribute("aria-label","Copy code"),this.liveRegion=document.createElement("span"),this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("role","status"),this.liveRegion.className="sr-only",this.liveRegion.style.position="absolute",this.liveRegion.style.width="1px",this.liveRegion.style.height="1px",this.liveRegion.style.overflow="hidden",this.liveRegion.style.clip="rect(0, 0, 0, 0)",this.liveRegion.style.whiteSpace="nowrap",this.appendChild(this.liveRegion)}connect(){var t;(t=this.copyBtn)==null||t.addEventListener("click",this.handleCopy)}disconnect(){var t;(t=this.copyBtn)==null||t.removeEventListener("click",this.handleCopy),this.clearResetTimeout()}getCopyText(){let t=this.getAttribute("data-copy-text");if(t)return t;let e=this.querySelector("[data-part=\'code\'] code");if(e)return e.textContent??"";let n=this.querySelector("[data-part=\'code\']");return(n==null?void 0:n.textContent)??""}showCopiedFeedback(){this.clearResetTimeout(),this.copyIcon&&(this.copyIcon.hidden=!0),this.checkIcon&&(this.checkIcon.hidden=!1),this.setAttribute("data-state","copied"),this.liveRegion&&(this.liveRegion.textContent="Copied!"),this.resetTimeout=setTimeout(()=>{this.copyIcon&&(this.copyIcon.hidden=!1),this.checkIcon&&(this.checkIcon.hidden=!0),this.removeAttribute("data-state"),this.liveRegion&&(this.liveRegion.textContent=""),this.resetTimeout=null},2e3)}clearResetTimeout(){this.resetTimeout!==null&&(clearTimeout(this.resetTimeout),this.resetTimeout=null)}};N();customElements.get("db-code-block")||customElements.define("db-code-block",$e);var Be=class extends z{constructor(){super(...arguments);h(this,"navData",null);h(this,"onClick",t=>{let e=t.target.closest("[data-part=\'toggle\']");if(!e||e.closest("db-nav-tree")!==this)return;let n=e.closest("[data-part=\'item\']");n&&this.toggle(n)});h(this,"onKey",t=>{var c,d;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;let e=document.activeElement;if(!e||!this.contains(e))return;let n=this.visibleRows(),s=e.closest("[data-part=\'row\']"),o=s?n.indexOf(s):-1;if(o<0)return;let r=s.closest("[data-part=\'item\']"),a=!!this.groupOf(r),l=u=>{var f;u&&(t.preventDefault(),(f=this.primary(u))==null||f.focus())};switch(t.key){case"ArrowDown":return l(n[o+1]);case"ArrowUp":return l(n[o-1]);case"Home":return l(n[0]);case"End":return l(n[n.length-1]);case"ArrowRight":if(!a)return;t.preventDefault(),this.isOpen(r)?l(this.visibleRows()[o+1]):this.setOpen(r,!0);return;case"ArrowLeft":{if(t.preventDefault(),a&&this.isOpen(r))return this.setOpen(r,!1);let u=(c=r.parentElement)==null?void 0:c.closest("[data-part=\'item\']");if(u&&this.contains(u)){let f=u.querySelector(":scope > [data-part=\'row\']");f&&((d=this.primary(f))==null||d.focus())}return}}})}setup(){for(let t of et(this,"[data-part=\'item\']"))this.prepareItem(t)}connect(){this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKey);for(let t of et(this,"[data-part=\'group\'][data-lazy]")){let e=t.closest("[data-part=\'item\']");e&&this.isOpen(e)&&this.fill(t)}this.hasAttribute("scroll-current")&&requestAnimationFrame(()=>this.revealCurrent())}disconnect(){this.removeEventListener("click",this.onClick),this.removeEventListener("keydown",this.onKey)}prepareItem(t){let e=this.groupOf(t),n=t.querySelector(":scope > [data-part=\'row\'] > [data-part=\'toggle\']");if(!e||!n)return;e.id||(e.id=F("db-nav-group")),n.setAttribute("aria-controls",e.id),n instanceof HTMLButtonElement&&!n.hasAttribute("type")&&(n.type="button");let s=n.getAttribute("aria-expanded")==="true"||t.getAttribute("data-state")==="open";this.apply(t,s)}groupOf(t){return t.querySelector(":scope > [data-part=\'group\']")}toggleOf(t){return t.querySelector(":scope > [data-part=\'row\'] > [data-part=\'toggle\']")}primary(t){return t.querySelector(":scope > [data-part=\'link\']")??t.querySelector(":scope > [data-part=\'toggle\']")}visibleRows(){return et(this,"[data-part=\'row\']").filter(t=>!t.closest("[hidden]"))}isOpen(t){return t.getAttribute("data-state")==="open"}toggle(t){this.setOpen(t,!this.isOpen(t))}setOpen(t,e){let n=this.groupOf(t);!n||this.isOpen(t)===e||(e&&n.hasAttribute("data-lazy")&&this.fill(n),this.apply(t,e),this.dispatchEvent(new CustomEvent("db-nav-tree:toggle",{detail:{item:t,open:e},bubbles:!0})))}apply(t,e){let n=this.groupOf(t),s=this.toggleOf(t);n&&(n.hidden=!e),s==null||s.setAttribute("aria-expanded",String(e)),t.setAttribute("data-state",e?"open":"closed")}revealCurrent(){var o;let t=this.querySelector("[aria-current=\'page\']");if(!t)return;for(let r=t.closest("[data-part=\'item\']");r&&this.contains(r);r=((o=r.parentElement)==null?void 0:o.closest("[data-part=\'item\']"))??null)this.groupOf(r)&&!this.groupOf(r).contains(t)||this.groupOf(r)&&this.setOpen(r,!0);let e=Tn(this);if(!e)return;let n=t.getBoundingClientRect(),s=e.getBoundingClientRect();(n.top<s.top||n.bottom>s.bottom)&&(e.scrollTop+=n.top-s.top-s.height/2+n.height/2)}data(){if(this.navData)return this.navData;let t=this.getAttribute("data-source"),e=t?globalThis[t]:void 0;return Array.isArray(e)?e:null}fill(t){let e=this.data(),n=t.dataset.path;if(!e||n==null)return;let s=e,o;for(let r of n.split(".").map(Number))o=s==null?void 0:s[r],s=o==null?void 0:o[2];o!=null&&o[2]&&(t.replaceChildren(...this.build(o[2],n)),t.removeAttribute("data-lazy"))}build(t,e){let n=this.getAttribute("base")??"",s=this.getAttribute("toggle-label")??"Toggle {label}",o=location.href.split("#")[0];return t.map(([r,a,l,c],d)=>{let u=`${e}.${d}`,f=document.createElement("li");f.setAttribute("data-part","item"),f.style.setProperty("--db-level",String(u.split(".").length-1));let m=document.createElement("div");m.setAttribute("data-part","row"),f.appendChild(m);let p=(a==null?void 0:a.replace(/[\\u0000-\\u0020]/g,""))??"";a!=null&&/^[a-z][a-z0-9+.-]*:/i.test(p)&&!/^(?:https?|mailto):/i.test(p)&&(a=null);let b=a!=null&&/^[a-z][a-z0-9+.-]*:|^\\/\\//i.test(p),g=null;if(l!=null&&l.length){if(g=document.createElement("button"),g.type="button",g.setAttribute("data-part","toggle"),g.setAttribute("aria-expanded","false"),a!=null)g.setAttribute("aria-label",s.replace("{label}",()=>r));else{let w=document.createElement("span");w.setAttribute("data-part","label"),w.textContent=r,g.appendChild(w)}g.insertAdjacentHTML("beforeend",kn)}let y=this.getAttribute("toggle-position")==="end";if(g&&!y&&m.appendChild(g),a!=null){let w=document.createElement("a");w.setAttribute("data-part","link"),w.textContent=r,w.href=b?a:n+a,b&&(w.rel="noopener"),!c&&w.href.split("#")[0]===o&&w.setAttribute("aria-current","page"),m.appendChild(w)}if(a==null&&!(l!=null&&l.length)){let w=document.createElement("span");w.setAttribute("data-part","label"),w.textContent=r,m.appendChild(w)}if(g&&y&&m.appendChild(g),l!=null&&l.length){let w=document.createElement("ul");w.setAttribute("data-part","group"),w.dataset.lazy="",w.dataset.path=u,w.hidden=!0,f.setAttribute("data-state","closed"),f.appendChild(w),this.prepareItem(f)}return f})}},kn=\'<svg data-part="chevron" viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false"><path d="m9 18 6-6-6-6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>\';function Tn(i){for(let t=i.parentElement;t;t=t.parentElement){let e=getComputedStyle(t).overflowY;if((e==="auto"||e==="scroll")&&t.scrollHeight>t.clientHeight)return t}return null}N();customElements.get("db-nav-tree")||customElements.define("db-nav-tree",Be);var Ke=class extends z{constructor(){super(...arguments);h(this,"links",[]);h(this,"headings",[]);h(this,"observer",null);h(this,"active",null);h(this,"onScroll",()=>{let t=document.documentElement;window.innerHeight+window.scrollY>=t.scrollHeight-2&&this.headings.length&&this.setActive(this.headings[this.headings.length-1].id)});h(this,"onHash",()=>{let t=wt(location.hash.slice(1));t&&this.headings.some(e=>e.id===t)&&this.setActive(t)})}slugOf(t){return t.getAttribute("data-toc-slug")??wt(t.getAttribute("href").slice(1))}setup(){this.links=Array.from(this.querySelectorAll("a[href^=\'#\'], a[data-toc-link]"))}connect(){var e;if(this.headings=this.links.map(n=>document.getElementById(this.slugOf(n))).filter(n=>!!n),!this.headings.length)return;let t=Number(this.getAttribute("offset")??80);typeof IntersectionObserver<"u"&&(this.observer=new IntersectionObserver(n=>{var o;let s=n.find(r=>r.isIntersecting);if(s)return this.setActive(s.target.id);this.setActive(((o=this.lastAbove(t))==null?void 0:o.id)??null)},{rootMargin:`-${t}px 0px -70% 0px`,threshold:0}),this.headings.forEach(n=>this.observer.observe(n))),window.addEventListener("hashchange",this.onHash),window.addEventListener("scroll",this.onScroll,{passive:!0}),this.setActive(((e=this.lastAbove(t))==null?void 0:e.id)??this.headings[0].id)}disconnect(){var t;(t=this.observer)==null||t.disconnect(),this.observer=null,window.removeEventListener("hashchange",this.onHash),window.removeEventListener("scroll",this.onScroll)}lastAbove(t){let e=null;for(let n of this.headings)n.getBoundingClientRect().top<=t+20&&(e=n);return e}setActive(t){if(!(!t||t===this.active)){this.active=t;for(let e of this.links)this.slugOf(e)===t?(e.setAttribute("aria-current","location"),e.setAttribute("data-active","")):(e.removeAttribute("aria-current"),e.removeAttribute("data-active"));this.dispatchEvent(new CustomEvent("db-toc:change",{detail:{id:t},bubbles:!0}))}}};N();customElements.get("db-toc")||customElements.define("db-toc",Ke);var On=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",\'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)\',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],re=On.join(","),je=typeof Element>"u",Rt=je?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qt=!je&&Element.prototype.getRootNode?function(i){var t;return i==null||(t=i.getRootNode)===null||t===void 0?void 0:t.call(i)}:function(i){return i==null?void 0:i.ownerDocument},Wt=function(t,e){var n;e===void 0&&(e=!0);var s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),o=s===""||s==="true",r=o||e&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Wt(t.parentNode));return r},Dn=function(t){var e,n=t==null||(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"contenteditable");return n===""||n==="true"},Rn=function(t,e,n){if(Wt(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(re));return e&&Rt.call(t,re)&&s.unshift(t),s=s.filter(n),s},ae=function(t,e,n){for(var s=[],o=Array.from(t);o.length;){var r=o.shift();if(!Wt(r,!1))if(r.tagName==="SLOT"){var a=r.assignedElements(),l=a.length?a:r.children,c=ae(l,!0,n);n.flatten?s.push.apply(s,c):s.push({scopeParent:r,candidates:c})}else{var d=Rt.call(r,re);d&&n.filter(r)&&(e||!t.includes(r))&&s.push(r);var u=r.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(r),f=!Wt(u,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(r));if(u&&f){var m=ae(u===!0?r.children:u.children,!0,n);n.flatten?s.push.apply(s,m):s.push({scopeParent:r,candidates:m})}else o.unshift.apply(o,r.children)}}return s},Ve=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ye=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Dn(t))&&!Ve(t)?0:t.tabIndex},In=function(t,e){var n=Ye(t);return n<0&&e&&!Ve(t)?0:n},Mn=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},Ue=function(t){return t.tagName==="INPUT"},Hn=function(t){return Ue(t)&&t.type==="hidden"},zn=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return e},Nn=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]},_n=function(t){if(!t.name)return!0;var e=t.form||qt(t),n=function(a){return e.querySelectorAll(\'input[type="radio"][name="\'+a+\'"]\')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=n(window.CSS.escape(t.name));else try{s=n(t.name)}catch(r){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",r.message),!1}var o=Nn(s,t.form);return!o||o===t},Pn=function(t){return Ue(t)&&t.type==="radio"},Fn=function(t){return Pn(t)&&!_n(t)},$n=function(t){var e,n=t&&qt(t),s=(e=n)===null||e===void 0?void 0:e.host,o=!1;if(n&&n!==t){var r,a,l;for(o=!!((r=s)!==null&&r!==void 0&&(a=r.ownerDocument)!==null&&a!==void 0&&a.contains(s)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&s;){var c,d,u;n=qt(s),s=(c=n)===null||c===void 0?void 0:c.host,o=!!((d=s)!==null&&d!==void 0&&(u=d.ownerDocument)!==null&&u!==void 0&&u.contains(s))}}return o},qe=function(t){var e=t.getBoundingClientRect(),n=e.width,s=e.height;return n===0&&s===0},Bn=function(t,e){var n=e.displayCheck,s=e.getShadowRoot;if(n==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}var r=getComputedStyle(t),a=r.visibility;if(a==="hidden"||a==="collapse")return!0;var l=Rt.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(Rt.call(c,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof s=="function"){for(var d=t;t;){var u=t.parentElement,f=qt(t);if(u&&!u.shadowRoot&&s(u)===!0)return qe(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=d}if($n(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return qe(t);return!1},Kn=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var n=0;n<e.children.length;n++){var s=e.children.item(n);if(s.tagName==="LEGEND")return Rt.call(e,"fieldset[disabled] *")?!0:!s.contains(t)}return!0}e=e.parentElement}return!1},qn=function(t,e){return!(e.disabled||Hn(e)||Bn(e,t)||zn(e)||Kn(e))},We=function(t,e){return!(Fn(e)||Ye(e)<0||!qn(t,e))},Wn=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},Xe=function(t){var e=[],n=[];return t.forEach(function(s,o){var r=!!s.scopeParent,a=r?s.scopeParent:s,l=In(a,r),c=r?Xe(s.candidates):a;l===0?r?e.push.apply(e,c):e.push(a):n.push({documentOrder:o,tabIndex:l,item:s,isScope:r,content:c})}),n.sort(Mn).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(e)},le=function(t,e){e=e||{};var n;return e.getShadowRoot?n=ae([t],e.includeContainer,{filter:We.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:Wn}):n=Rn(t,e.includeContainer,We.bind(null,e)),Xe(n)};var ce=class{constructor(i,t={}){h(this,"root");h(this,"opts");h(this,"previouslyFocused",null);h(this,"keydownHandler",null);h(this,"active",!1);this.root=i,this.opts={initialFocus:t.initialFocus??"first",returnFocus:t.returnFocus??!0}}activate(){this.active||(this.active=!0,this.previouslyFocused=document.activeElement,this.keydownHandler=i=>{if(i.key!=="Tab")return;let t=le(this.root);if(t.length===0){i.preventDefault();return}let e=t[0],n=t[t.length-1];i.shiftKey?document.activeElement===e&&(n.focus(),i.preventDefault()):document.activeElement===n&&(e.focus(),i.preventDefault())},document.addEventListener("keydown",this.keydownHandler),requestAnimationFrame(()=>{var t;if(!this.active)return;let i=le(this.root);this.opts.initialFocus instanceof HTMLElement&&this.root.contains(this.opts.initialFocus)?this.opts.initialFocus.focus():this.opts.initialFocus==="container"?(this.root.hasAttribute("tabindex")||this.root.setAttribute("tabindex","-1"),this.root.focus()):(t=i[0])==null||t.focus()}))}deactivate(){this.active&&(this.active=!1,this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null),this.opts.returnFocus&&this.previouslyFocused&&document.contains(this.previouslyFocused)&&this.previouslyFocused.focus(),this.previouslyFocused=null)}isActive(){return this.active}};var B,rt=(B=class{static activate(){if(B.count++,B.count>1)return;let t=window.innerWidth-document.documentElement.clientWidth;B.originalStyles={overflow:document.body.style.overflow,paddingRight:document.body.style.paddingRight},document.body.style.overflow="hidden",t>0&&(document.body.style.paddingRight=`${t}px`)}static deactivate(){B.count=Math.max(0,B.count-1),!(B.count>0)&&B.originalStyles&&(document.body.style.overflow=B.originalStyles.overflow,document.body.style.paddingRight=B.originalStyles.paddingRight,B.originalStyles=null)}static reset(){B.count=0,B.originalStyles=null}},h(B,"count",0),h(B,"originalStyles",null),B);var Q=[];function jn(i){if(i.key!=="Escape"||Q.length===0)return;let t=Q[Q.length-1];t.escapePrevented||(i.preventDefault(),i.stopPropagation(),t.opts.onDismiss("escape-key"))}var Ge=!1;function Vn(){Ge||(Ge=!0,document.addEventListener("keydown",jn))}var at=class{constructor(i,t){h(this,"root");h(this,"opts");h(this,"outsideHandler",null);h(this,"active",!1);h(this,"frameId",null);h(this,"escapePrevented",!1);this.root=i,this.opts={onDismiss:t.onDismiss,escapeKey:t.escapeKey??!0,outsidePress:t.outsidePress??!0}}activate(){this.active||(this.active=!0,this.opts.escapeKey&&(Vn(),Q.push(this)),this.opts.outsidePress&&(this.outsideHandler=i=>{if(Q.length>0&&Q[Q.length-1]!==this)return;let t=i.target;if(this.root.contains(t))return;let e=this.root.id;if(e){let s=document.querySelector(`[aria-controls="${e}"]`);if(s!=null&&s.contains(t))return}let n=this.root.getAttribute("aria-labelledby");if(n){let s=document.getElementById(n);if(s!=null&&s.contains(t))return}typeof this.opts.outsidePress=="function"&&!this.opts.outsidePress(i)||this.opts.onDismiss("outside-press")},this.frameId=requestAnimationFrame(()=>{this.frameId=null,this.outsideHandler&&document.addEventListener("pointerdown",this.outsideHandler)})))}deactivate(){if(!this.active)return;this.active=!1;let i=Q.indexOf(this);i!==-1&&Q.splice(i,1),this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null),this.outsideHandler&&(document.removeEventListener("pointerdown",this.outsideHandler),this.outsideHandler=null)}isActive(){return this.active}};function de(i){let t=[],e=i;for(;e&&e!==document.body;){let n=e.parentElement;if(!n)break;for(let s=0;s<n.children.length;s++){let o=n.children[s];if(o===e||o.contains(i))continue;let r=o.tagName;if(r==="SCRIPT"||r==="STYLE"||r==="LINK")continue;let a=o.getAttribute("aria-hidden");a!=="true"&&(t.push({el:o,prev:a}),o.setAttribute("aria-hidden","true"))}e=n}return()=>{for(let{el:n,prev:s}of t)s===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",s)}}var Ze=class extends z{constructor(){super(...arguments);h(this,"content",null);h(this,"backdrop",null);h(this,"trigger",null);h(this,"native",!1);h(this,"_open",!1);h(this,"openedBy",null);h(this,"focusTrap",null);h(this,"dismiss",null);h(this,"cleanupInert",null);h(this,"onTriggerClick",t=>{t.preventDefault(),this.toggle(t.currentTarget)});h(this,"onHostClick",t=>{let e=t.target.closest("[data-part=\'close\']");e&&e.closest("db-dialog")===this&&this.close("close-press")});h(this,"onDocumentClick",t=>{var s,o,r;let e=(o=(s=t.target).closest)==null?void 0:o.call(s,"[data-dialog-for]");if(!e||e===this.trigger)return;let n=e.getAttribute("data-dialog-for");n&&(n===this.id||n===((r=this.content)==null?void 0:r.id))&&(t.preventDefault(),this.toggle(e))});h(this,"onCancel",t=>{t.preventDefault(),this.dismissible&&this.close("escape-key")});h(this,"onNativeClick",t=>{if(!this.dismissible||t.target!==this.content||!this.content)return;let e=this.content.getBoundingClientRect();!(t.clientX>=e.left&&t.clientX<=e.right&&t.clientY>=e.top&&t.clientY<=e.bottom)&&(t.clientX!==0||t.clientY!==0)&&this.close("outside-press")});h(this,"onNativeClose",()=>{this._open&&this.finishClose("close-press")})}get open(){return this._open}get dismissible(){return this.getAttribute("dismissible")!=="false"}setup(){if(this.content=$(this,"[data-part=\'content\']"),!this.content)return;this.native=typeof HTMLDialogElement<"u"&&this.content instanceof HTMLDialogElement&&typeof this.content.showModal=="function",this.backdrop=$(this,"[data-part=\'backdrop\']"),this.trigger=bt($(this,"[data-part=\'trigger\']"));let t=this.content;t.id||(t.id=F("db-dialog")),this.native||(t.setAttribute("role",t.getAttribute("role")||"dialog"),t.setAttribute("aria-modal","true"),t.hidden=!this.hasAttribute("open"),this.backdrop&&(this.backdrop.hidden=!0));let e=t.querySelector("[data-part=\'title\']");e&&!t.hasAttribute("aria-labelledby")&&!t.hasAttribute("aria-label")&&(e.id||(e.id=F("db-dialog-title")),t.setAttribute("aria-labelledby",e.id));let n=t.querySelector("[data-part=\'description\']");n&&!t.hasAttribute("aria-describedby")&&(n.id||(n.id=F("db-dialog-desc")),t.setAttribute("aria-describedby",n.id));for(let s of this.triggers())this.prepareTrigger(s);this.setState("closed"),this.native||(this.focusTrap=new ce(t),this.dismiss=new at(t,{onDismiss:s=>this.dismissible&&this.close(s)}))}connect(){var t;this.content&&((t=this.trigger)==null||t.addEventListener("click",this.onTriggerClick),this.addEventListener("click",this.onHostClick),document.addEventListener("click",this.onDocumentClick),this.native&&(this.content.addEventListener("cancel",this.onCancel),this.content.addEventListener("click",this.onNativeClick),this.content.addEventListener("close",this.onNativeClose)),queueMicrotask(()=>{if(this.isConnected){for(let e of this.triggers())e.hasAttribute("aria-controls")||this.prepareTrigger(e);this.hasAttribute("open")&&!this._open&&this.show()}}))}disconnect(){var t;(t=this.trigger)==null||t.removeEventListener("click",this.onTriggerClick),this.removeEventListener("click",this.onHostClick),document.removeEventListener("click",this.onDocumentClick),this.content&&this.native&&(this.content.removeEventListener("cancel",this.onCancel),this.content.removeEventListener("click",this.onNativeClick),this.content.removeEventListener("close",this.onNativeClose)),this._open&&this.finishClose("api",!1)}triggers(){var n;let t=this.trigger?[this.trigger]:[],e=[this.id,(n=this.content)==null?void 0:n.id].filter(Boolean);for(let s of e)document.querySelectorAll(`[data-dialog-for="${CSS.escape(s)}"]`).forEach(o=>t.push(o));return t}prepareTrigger(t){t.hasAttribute("aria-haspopup")||t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-controls",this.content.id),t.setAttribute("aria-expanded","false")}setState(t){var e,n;this.setAttribute("data-state",t),(e=this.content)==null||e.setAttribute("data-state",t),(n=this.backdrop)==null||n.setAttribute("data-state",t)}toggle(t){this._open?this.close("trigger-press"):this.show(t)}show(t){var n,s;let e=this.content;if(!(!e||this._open)){this._open=!0,this.openedBy=t??document.activeElement??this.trigger;for(let o of this.triggers())this.prepareTrigger(o),o.setAttribute("aria-expanded","true");if(rt.activate(),this.native){let o=e;o.open||o.showModal()}else e.hidden=!1,this.backdrop&&(this.backdrop.hidden=!1),this.cleanupInert=de(e),(n=this.focusTrap)==null||n.activate(),(s=this.dismiss)==null||s.activate();this.setState("open"),this.dispatchEvent(new CustomEvent("db-dialog:open",{bubbles:!0}))}}close(t="api"){this._open&&this.finishClose(t)}finishClose(t,e=!0){var o,r,a;let n=this.content;this._open=!1,this.setState("closed");for(let l of this.triggers())l.setAttribute("aria-expanded","false");if(rt.deactivate(),this.native){let l=n;l.open&&l.close()}else(o=this.dismiss)==null||o.deactivate(),(r=this.focusTrap)==null||r.deactivate(),(a=this.cleanupInert)==null||a.call(this),this.cleanupInert=null,_e(n,()=>{this._open||(n.hidden=!0,this.backdrop&&(this.backdrop.hidden=!0))});let s=this.openedBy;this.openedBy=null,e&&s&&document.contains(s)&&s.focus(),this.dispatchEvent(new CustomEvent("db-dialog:close",{detail:{reason:t},bubbles:!0}))}};N();customElements.get("db-dialog")||customElements.define("db-dialog",Ze);var Qe=class extends z{constructor(){super(...arguments);h(this,"input",null);h(this,"listbox",null);h(this,"empty",null);h(this,"_open",!1);h(this,"highlighted",null);h(this,"observer",null);h(this,"base",F("db-combobox"));h(this,"optionSeq",0);h(this,"onInput",()=>{this.filtering?this.filter(this.input.value):this.show()});h(this,"onFocus",()=>{(this.hasAttribute("open-on-focus")||this.filtering&&this.input.value)&&(this.filtering?this.filter(this.input.value):this.show())});h(this,"onKey",t=>{let e=this.visible(),n=this.highlighted?e.indexOf(this.highlighted):-1;switch(t.key){case"ArrowDown":t.preventDefault(),this._open||this.show(),e.length&&this.highlight(e[n<0?0:Math.min(n+1,e.length-1)]);break;case"ArrowUp":t.preventDefault(),this._open||this.show(),e.length&&this.highlight(e[n<0?e.length-1:Math.max(n-1,0)]);break;case"Home":case"End":this._open&&this.highlighted&&e.length&&(t.preventDefault(),this.highlight(t.key==="Home"?e[0]:e[e.length-1]));break;case"Enter":this._open&&this.highlighted&&(t.preventDefault(),this.choose(this.highlighted));break;case"Escape":this._open&&!this.inline?(t.preventDefault(),t.stopPropagation(),this.hide()):this.input.value&&(t.preventDefault(),t.stopPropagation(),this.input.value="",this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.hide());break;case"Tab":this.inline||this.hide();break}});h(this,"onListClick",t=>{let e=t.target.closest("[data-part=\'option\']");if(!e||e.closest("db-combobox")!==this||W(e))return;let n=t.target.closest("a[href]");!this.choose(e,!n)&&n&&t.preventDefault()});h(this,"onListPointer",t=>{let e=t.target.closest("[data-part=\'option\']");e&&e.closest("db-combobox")===this&&!W(e)&&!e.hidden&&this.highlight(e)});h(this,"onListDown",t=>t.preventDefault());h(this,"onDocDown",t=>{this._open&&!this.inline&&!this.contains(t.target)&&this.hide()})}get open(){return this._open}get inline(){return this.hasAttribute("inline")}get filtering(){return(this.getAttribute("filter")??"contains")!=="none"}options(){return this.listbox?Array.from(this.listbox.querySelectorAll("[data-part=\'option\']")).filter(t=>t.closest("db-combobox")===this):[]}visible(){return this.options().filter(t=>!t.hidden&&!W(t))}setup(){if(this.input=$(this,"[data-part=\'input\']"),this.listbox=$(this,"[data-part=\'listbox\']"),this.empty=$(this,"[data-part=\'empty\']"),!this.input||!this.listbox)return;let{input:t,listbox:e}=this;e.id||(e.id=`${this.base}-listbox`),e.setAttribute("role","listbox"),t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-controls",e.id),t.setAttribute("autocomplete","off"),this.inline||(e.hidden=!0),this.prepareOptions(),this.syncExpanded()}prepareOptions(){this.options().forEach(t=>{t.id||(t.id=`${this.base}-option-${++this.optionSeq}`),t.setAttribute("role","option"),t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.matches("a[href], button")&&t.setAttribute("tabindex","-1"),t.querySelectorAll("a, button").forEach(e=>e.setAttribute("tabindex","-1")),t.parentElement&&t.parentElement!==this.listbox&&t.parentElement.localName==="li"&&!t.parentElement.hasAttribute("role")&&t.parentElement.setAttribute("role","none")})}connect(){let{input:t,listbox:e}=this;!t||!e||(t.addEventListener("input",this.onInput),t.addEventListener("focus",this.onFocus),t.addEventListener("keydown",this.onKey),e.addEventListener("click",this.onListClick),e.addEventListener("pointermove",this.onListPointer),e.addEventListener("mousedown",this.onListDown),document.addEventListener("pointerdown",this.onDocDown),typeof MutationObserver<"u"&&(this.observer=new MutationObserver(()=>this.onOptionsChanged()),this.observer.observe(e,{childList:!0,subtree:!0})))}disconnect(){var n;let{input:t,listbox:e}=this;t==null||t.removeEventListener("input",this.onInput),t==null||t.removeEventListener("focus",this.onFocus),t==null||t.removeEventListener("keydown",this.onKey),e==null||e.removeEventListener("click",this.onListClick),e==null||e.removeEventListener("pointermove",this.onListPointer),e==null||e.removeEventListener("mousedown",this.onListDown),document.removeEventListener("pointerdown",this.onDocDown),(n=this.observer)==null||n.disconnect(),this.observer=null}refresh(){this.onOptionsChanged()}onOptionsChanged(){this.prepareOptions(),this.highlighted&&!this.options().includes(this.highlighted)&&this.clearHighlight();let t=this.visible();this.filtering||(t.length||this.inline?this.show():this.hide(),t.length&&!this.highlighted&&!this.hasAttribute("no-autohighlight")&&this.highlight(t[0])),this.syncExpanded(),this.dispatchEvent(new CustomEvent("db-combobox:update",{detail:{count:t.length},bubbles:!0}))}filter(t){let e=t.toLowerCase().trim(),n=0;for(let o of this.options()){let r=!e||(o.textContent??"").toLowerCase().includes(e)||(o.dataset.value??"").toLowerCase().includes(e);o.hidden=!r,r&&n++}this.empty&&(this.empty.hidden=n>0||!e),this.clearHighlight(),n||e&&this.empty?this.show():this.hide();let s=this.visible();s.length&&!this.hasAttribute("no-autohighlight")&&this.highlight(s[0]),this.dispatchEvent(new CustomEvent("db-combobox:update",{detail:{count:n},bubbles:!0}))}syncExpanded(){if(!this.input)return;let t=this.inline?this.visible().length>0:this._open;this.input.setAttribute("aria-expanded",String(t)),this.setAttribute("data-state",t?"open":"closed")}show(){if(!this.listbox||this._open)return this.syncExpanded();this._open=!0,this.listbox.hidden=!1,this.syncExpanded()}hide(){if(this.listbox){if(this.clearHighlight(),!this._open)return this.syncExpanded();this._open=!1,this.inline||(this.listbox.hidden=!0),this.syncExpanded()}}highlight(t){var e,n,s;this.input&&((e=this.highlighted)==null||e.removeAttribute("data-highlighted"),(n=this.highlighted)==null||n.setAttribute("aria-selected","false"),this.highlighted=t,t.setAttribute("data-highlighted",""),t.setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",t.id),(s=t.scrollIntoView)==null||s.call(t,{block:"nearest"}))}clearHighlight(){var t,e,n;(t=this.highlighted)==null||t.removeAttribute("data-highlighted"),(e=this.highlighted)==null||e.setAttribute("aria-selected","false"),this.highlighted=null,(n=this.input)==null||n.removeAttribute("aria-activedescendant")}choose(t,e=!0){var a;let n=t.dataset.value??"",s=((a=t.textContent)==null?void 0:a.trim())??n,o=new CustomEvent("db-combobox:select",{detail:{value:n,text:s,option:t},bubbles:!0,cancelable:!0});if(!this.dispatchEvent(o))return!1;let r=t.matches("a[href]")?t:t.querySelector("a[href]");return r?(e&&r.click(),!0):(this.input&&(this.input.value=t.getAttribute("data-label")??s),this.inline||this.hide(),this.dispatchEvent(new CustomEvent("db-combobox:change",{detail:{value:n,text:s},bubbles:!0})),!0)}};N();customElements.get("db-combobox")||customElements.define("db-combobox",Qe);var it=Math.min,j=Math.max,Mt=Math.round,Ht=Math.floor,U=i=>({x:i,y:i}),Yn={left:"right",right:"left",bottom:"top",top:"bottom"};function ei(i,t,e){return j(i,it(t,e))}function Et(i,t){return typeof i=="function"?i(t):i}function nt(i){return i.split("-")[0]}function xt(i){return i.split("-")[1]}function ue(i){return i==="x"?"y":"x"}function he(i){return i==="y"?"height":"width"}function X(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function fe(i){return ue(X(i))}function ii(i,t,e){e===void 0&&(e=!1);let n=xt(i),s=fe(i),o=he(s),r=s==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=It(r)),[r,It(r)]}function ni(i){let t=It(i);return[jt(i),t,jt(t)]}function jt(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Je=["left","right"],ti=["right","left"],Un=["top","bottom"],Xn=["bottom","top"];function Gn(i,t,e){switch(i){case"top":case"bottom":return e?t?ti:Je:t?Je:ti;case"left":case"right":return t?Un:Xn;default:return[]}}function si(i,t,e,n){let s=xt(i),o=Gn(nt(i),e==="start",n);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(jt)))),o}function It(i){let t=nt(i);return Yn[t]+i.slice(t.length)}function Zn(i){var t,e,n,s;return{top:(t=i.top)!=null?t:0,right:(e=i.right)!=null?e:0,bottom:(n=i.bottom)!=null?n:0,left:(s=i.left)!=null?s:0}}function oi(i){return typeof i!="number"?Zn(i):{top:i,right:i,bottom:i,left:i}}function lt(i){let{x:t,y:e,width:n,height:s}=i;return{width:n,height:s,top:e,left:t,right:t+n,bottom:e+s,x:t,y:e}}function ri(i,t,e){let{reference:n,floating:s}=i,o=X(t),r=fe(t),a=he(r),l=nt(t),c=o==="y",d=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2,m;switch(l){case"top":m={x:d,y:n.y-s.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-s.width,y:u};break;default:m={x:n.x,y:n.y}}let p=xt(t);return p&&(m[r]+=f*(p==="end"?1:-1)*(e&&c?-1:1)),m}async function ai(i,t){var e;t===void 0&&(t={});let{x:n,y:s,platform:o,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:m=0}=Et(t,i),p=oi(m),g=a[f?u==="floating"?"reference":"floating":u],y=lt(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(g)))==null||e?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),w=u==="floating"?{x:n,y:s,width:r.floating.width,height:r.floating.height}:r.reference,L=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),R=await(o.isElement==null?void 0:o.isElement(L))&&await(o.getScale==null?void 0:o.getScale(L))||{x:1,y:1},M=lt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:L,strategy:l}):w);return{top:(y.top-M.top+p.top)/R.y,bottom:(M.bottom-y.bottom+p.bottom)/R.y,left:(y.left-M.left+p.left)/R.x,right:(M.right-y.right+p.right)/R.x}}var Qn=50,li=async(i,t,e)=>{let{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:ai},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:s}),{x:d,y:u}=ri(c,n,l),f=n,m=0,p={};for(let b=0;b<o.length;b++){let g=o[b];if(!g)continue;let{name:y,fn:w}=g,{x:L,y:R,data:M,reset:H}=await w({x:d,y:u,initialPlacement:n,placement:f,strategy:s,middlewareData:p,rects:c,platform:a,elements:{reference:i,floating:t}});d=L??d,u=R??u,p[y]={...p[y],...M},H&&m<Qn&&(m++,typeof H=="object"&&(H.placement&&(f=H.placement),H.rects&&(c=H.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:s}):H.rects),{x:d,y:u}=ri(c,f,l)),b=-1)}return{x:d,y:u,placement:f,strategy:s,middlewareData:p}};var ci=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=!0,...g}=Et(i,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};let y=nt(s),w=X(a),L=nt(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),M=f||(L||!b?[It(a)]:ni(a)),H=p!=="none";!f&&H&&M.push(...si(a,b,p,R));let O=[a,...M],v=await l.detectOverflow(t,g),K=[],I=((n=o.flip)==null?void 0:n.overflows)||[];if(d&&K.push(v[y]),u){let C=ii(s,r,R);K.push(v[C[0]],v[C[1]])}if(I=[...I,{placement:s,overflows:K}],!K.every(C=>C<=0)){var S,x;let C=(((S=o.flip)==null?void 0:S.index)||0)+1,T=O[C];if(T&&(!(u==="alignment"?w!==X(T):!1)||I.every(D=>X(D.placement)===w?D.overflows[0]>0:!0)))return{data:{index:C,overflows:I},reset:{placement:T}};let A=(x=I.filter(k=>k.overflows[0]<=0).sort((k,D)=>k.overflows[1]-D.overflows[1])[0])==null?void 0:x.placement;if(!A)switch(m){case"bestFit":{var E;let k=(E=I.filter(D=>{if(H){let _=X(D.placement);return _===w||_==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(_=>_>0).reduce((_,P)=>_+P,0)]).sort((D,_)=>D[1]-_[1])[0])==null?void 0:E[0];k&&(A=k);break}case"initialPlacement":A=a;break}if(s!==A)return{reset:{placement:A}}}return{}}}};var Jn=new Set(["left","top"]);async function ts(i,t){let{placement:e,platform:n,elements:s}=i,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=nt(e),a=xt(e),l=X(e)==="y",c=Jn.has(r)?-1:1,d=o&&l?-1:1,u=Et(t,i),{mainAxis:f,crossAxis:m,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof p=="number"&&(m=a==="end"?p*-1:p),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}var di=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(t){var e,n;let{x:s,y:o,placement:r,middlewareData:a}=t,l=await ts(t,i);return r===((e=a.offset)==null?void 0:e.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},ui=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(t){let{x:e,y:n,placement:s,platform:o}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x:L,y:R}=w;return{x:L,y:R}}},...c}=Et(i,t),d={x:e,y:n},u=await o.detectOverflow(t,c),f=X(s),m=ue(f),p=d[m],b=d[f],g=(w,L)=>ei(L+u[w==="y"?"top":"left"],L,L-u[w==="y"?"bottom":"right"]);r&&(p=g(m,p)),a&&(b=g(f,b));let y=l.fn({...t,[m]:p,[f]:b});return{...y,data:{x:y.x-e,y:y.y-n,enabled:{[m]:r,[f]:a}}}}}};var hi=function(i){return i===void 0&&(i={}),{name:"size",options:i,async fn(t){let{placement:e,rects:n,platform:s,elements:o}=t,{apply:r=()=>{},...a}=Et(i,t),l=await s.detectOverflow(t,a),c=nt(e),d=xt(e),u=X(e)==="y",{width:f,height:m}=n.floating,p,b;c==="top"||c==="bottom"?(p=c,b=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(b=c,p=d==="end"?"top":"bottom");let g=m-l.top-l.bottom,y=f-l.left-l.right,w=it(m-l[p],g),L=it(f-l[b],y),R=t.middlewareData.shift,M=!R,H=w,O=L;R!=null&&R.enabled.x&&(O=y),R!=null&&R.enabled.y&&(H=g),M&&!d&&(u?O=f-2*j(l.left,l.right):H=m-2*j(l.top,l.bottom)),await r({...t,availableWidth:O,availableHeight:H});let v=await s.getDimensions(o.floating);return f!==v.width||m!==v.height?{reset:{rects:!0}}:{}}}};function Vt(){return typeof window<"u"}function dt(i){return mi(i)?(i.nodeName||"").toLowerCase():"#document"}function q(i){var t;return(i==null||(t=i.ownerDocument)==null?void 0:t.defaultView)||window}function G(i){var t;return(t=(mi(i)?i.ownerDocument:i.document)||window.document)==null?void 0:t.documentElement}function mi(i){return Vt()?i instanceof Node||i instanceof q(i).Node:!1}function V(i){return Vt()?i instanceof Element||i instanceof q(i).Element:!1}function J(i){return Vt()?i instanceof HTMLElement||i instanceof q(i).HTMLElement:!1}function fi(i){return!Vt()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof q(i).ShadowRoot}function zt(i){let{overflow:t,overflowX:e,overflowY:n,display:s}=Y(i);return/auto|scroll|overlay|hidden|clip/.test(t+n+e)&&s!=="inline"&&s!=="contents"}function pi(i){return/^(table|td|th)$/.test(dt(i))}function Nt(i){try{if(i.matches(":popover-open"))return!0}catch{}try{return i.matches(":modal")}catch{return!1}}var es=/transform|translate|scale|rotate|perspective|filter/,is=/paint|layout|strict|content/,ct=i=>!!i&&i!=="none",me;function Yt(i){let t=V(i)?Y(i):i;return ct(t.transform)||ct(t.translate)||ct(t.scale)||ct(t.rotate)||ct(t.perspective)||!Ut()&&(ct(t.backdropFilter)||ct(t.filter))||es.test(t.willChange||"")||is.test(t.contain||"")}function gi(i){let t=st(i);for(;J(t)&&!St(t);){if(Yt(t))return t;if(Nt(t))return null;t=st(t)}return null}function Ut(){return me==null&&(me=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),me}function St(i){return/^(html|body|#document)$/.test(dt(i))}function Y(i){return q(i).getComputedStyle(i)}function _t(i){return V(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function st(i){if(dt(i)==="html")return i;let t=i.assignedSlot||i.parentNode||fi(i)&&i.host||G(i);return fi(t)?t.host:t}function bi(i){let t=st(i);return St(t)?(i.ownerDocument||i).body:J(t)&&zt(t)?t:bi(t)}function At(i,t,e){var n;t===void 0&&(t=[]),e===void 0&&(e=!0);let s=bi(i),o=s===((n=i.ownerDocument)==null?void 0:n.body),r=q(s);if(o){let a=Xt(r);return t.concat(r,r.visualViewport||[],zt(s)?s:[],a&&e?At(a):[])}else return t.concat(s,At(s,[],e))}function Xt(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function wi(i){let t=Y(i),e=parseFloat(t.width)||0,n=parseFloat(t.height)||0,s=J(i),o=s?i.offsetWidth:e,r=s?i.offsetHeight:n,a=Mt(e)!==o||Mt(n)!==r;return a&&(e=o,n=r),{width:e,height:n,$:a}}function ge(i){return V(i)?i:i.contextElement}function Ct(i){let t=ge(i);if(!J(t))return U(1);let e=t.getBoundingClientRect(),{width:n,height:s,$:o}=wi(t),r=(o?Mt(e.width):e.width)/n,a=(o?Mt(e.height):e.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var ns=U(0);function Ei(i){let t=q(i);return!Ut()||!t.visualViewport?ns:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ss(i,t,e){return t===void 0&&(t=!1),!!e&&t&&e===q(i)}function ut(i,t,e,n){t===void 0&&(t=!1),e===void 0&&(e=!1);let s=i.getBoundingClientRect(),o=ge(i),r=U(1);t&&(n?V(n)&&(r=Ct(n)):r=Ct(i));let a=ss(o,e,n)?Ei(o):U(0),l=(s.left+a.x)/r.x,c=(s.top+a.y)/r.y,d=s.width/r.x,u=s.height/r.y;if(o&&n){let f=q(o),m=V(n)?q(n):n,p=f,b=Xt(p);for(;b&&m!==p;){let g=Ct(b),y=b.getBoundingClientRect(),w=Y(b),L=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*g.x,R=y.top+(b.clientTop+parseFloat(w.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,u*=g.y,l+=L,c+=R,p=q(b),b=Xt(p)}}return lt({width:d,height:u,x:l,y:c})}function Gt(i,t){let e=_t(i).scrollLeft;return t?t.left+e:ut(G(i)).left+e}function xi(i,t){let e=i.getBoundingClientRect(),n=e.left+t.scrollLeft-Gt(i,e),s=e.top+t.scrollTop;return{x:n,y:s}}function os(i){let{elements:t,rect:e,offsetParent:n,strategy:s}=i,o=s==="fixed",r=G(n),a=t?Nt(t.floating):!1;if(n===r||a&&o)return e;let l={scrollLeft:0,scrollTop:0},c=U(1),d=U(0),u=J(n);if((u||!o)&&((dt(n)!=="body"||zt(r))&&(l=_t(n)),u)){let m=ut(n);c=Ct(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}let f=r&&!u&&!o?xi(r,l):U(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:e.y*c.y-l.scrollTop*c.y+d.y+f.y}}function rs(i){return i.getClientRects?Array.from(i.getClientRects()):[]}function as(i){let t=_t(i),e=i.ownerDocument.body,n=j(i.scrollWidth,i.clientWidth,e.scrollWidth,e.clientWidth),s=j(i.scrollHeight,i.clientHeight,e.scrollHeight,e.clientHeight),o=-t.scrollLeft+Gt(i),r=-t.scrollTop;return Y(e).direction==="rtl"&&(o+=j(i.clientWidth,e.clientWidth)-n),{width:n,height:s,x:o,y:r}}var ls=25;function cs(i,t,e){e===void 0&&(e="viewport");let n=e==="layoutViewport",s=q(i),o=G(i),r=s.visualViewport,a=o.clientWidth,l=o.clientHeight,c=0,d=0;if(r){let f=!Ut()||t==="fixed";n?f||(c=-r.offsetLeft,d=-r.offsetTop):(a=r.width,l=r.height,f&&(c=r.offsetLeft,d=r.offsetTop))}if(Gt(o)<=0){let f=o.ownerDocument,m=f.body,p=getComputedStyle(m),b=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(o.clientWidth-m.clientWidth-b),y=getComputedStyle(o).scrollbarGutter==="stable both-edges"?g/2:g;y<=ls&&(a-=y)}return{width:a,height:l,x:c,y:d}}function ds(i,t){let e=ut(i,!0,t==="fixed"),n=e.top+i.clientTop,s=e.left+i.clientLeft,o=Ct(i),r=i.clientWidth*o.x,a=i.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:r,height:a,x:l,y:c}}function vi(i,t,e){let n;if(t==="viewport"||t==="layoutViewport")n=cs(i,e,t);else if(t==="document")n=as(G(i));else if(V(t))n=ds(t,e);else{let s=Ei(i);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return lt(n)}function us(i,t){let e=t.get(i);if(e)return e;let n=At(i,[],!1).filter(a=>V(a)&&dt(a)!=="body"),s=null,o=Y(i).position==="fixed",r=o?st(i):i;for(;V(r)&&!St(r);){let a=Y(r),l=Yt(r),c=s?s.position:o?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?n=n.filter(u=>u!==r):s=a,r=st(r)}return t.set(i,n),n}function hs(i){let{element:t,boundary:e,rootBoundary:n,strategy:s}=i,r=[...e==="clippingAncestors"?Nt(t)?[]:us(t,this._c):[].concat(e),n],a=vi(t,r[0],s),l=a.top,c=a.right,d=a.bottom,u=a.left;for(let f=1;f<r.length;f++){let m=vi(t,r[f],s);l=j(m.top,l),c=it(m.right,c),d=it(m.bottom,d),u=j(m.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function fs(i){let{width:t,height:e}=wi(i);return{width:t,height:e}}function ms(i,t,e){let n=J(t),s=G(t),o=e==="fixed",r=ut(i,!0,o,t),a={scrollLeft:0,scrollTop:0},l=U(0);if((n||!o)&&((dt(t)!=="body"||zt(s))&&(a=_t(t)),n)){let f=ut(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}!n&&s&&(l.x=Gt(s));let c=s&&!n&&!o?xi(s,a):U(0),d=r.left+a.scrollLeft-l.x-c.x,u=r.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:r.width,height:r.height}}function pe(i){return Y(i).position==="static"}function yi(i,t){if(!J(i)||Y(i).position==="fixed")return null;if(t)return t(i);let e=i.offsetParent;return G(i)===e&&(e=e.ownerDocument.body),e}function Ai(i,t){let e=q(i);if(Nt(i))return e;if(!J(i)){let s=st(i);for(;s&&!St(s);){if(V(s)&&!pe(s))return s;s=st(s)}return e}let n=yi(i,t);for(;n&&pi(n)&&pe(n);)n=yi(n,t);return n&&St(n)&&pe(n)&&!Yt(n)?e:n||gi(i)||e}var ps=async function(i){let t=this.getOffsetParent||Ai,e=this.getDimensions,n=await e(i.floating);return{reference:ms(i.reference,await t(i.floating),i.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function gs(i){return Y(i).direction==="rtl"}var bs={convertOffsetParentRelativeRectToViewportRelativeRect:os,getDocumentElement:G,getClippingRect:hs,getOffsetParent:Ai,getElementRects:ps,getClientRects:rs,getDimensions:fs,getScale:Ct,isElement:V,isRTL:gs};function Si(i,t){return i.x===t.x&&i.y===t.y&&i.width===t.width&&i.height===t.height}function vs(i,t,e){let n=null,s,o=G(i);function r(){var d;clearTimeout(s),(d=n)==null||d.disconnect(),n=null}function a(d,u){d===void 0&&(d=!1),u===void 0&&(u=1),r();let f=i.getBoundingClientRect(),{left:m,top:p,width:b,height:g}=f;if(d||t(),!b||!g)return;let y=Ht(p),w=Ht(o.clientWidth-(m+b)),L=Ht(o.clientHeight-(p+g)),R=Ht(m),H={rootMargin:-y+"px "+-w+"px "+-L+"px "+-R+"px",threshold:j(0,it(1,u))||1},O=!0;function v(K){let I=K[0].intersectionRatio;if(!Si(f,i.getBoundingClientRect()))return a();if(I!==u){if(!O)return a();I?a(!1,I):s=setTimeout(()=>{a(!1,1e-7)},1e3)}O=!1}try{n=new IntersectionObserver(v,{...H,root:o.ownerDocument})}catch{n=new IntersectionObserver(v,H)}n.observe(i)}let l=q(i),c=()=>a(e);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),r()}}function Ci(i,t,e,n){n===void 0&&(n={});let{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=ge(i),d=s||o?[...c?At(c):[],...t?At(t):[]]:[];d.forEach(y=>{s&&y.addEventListener("scroll",e),o&&y.addEventListener("resize",e)});let u=c&&a?vs(c,e,o):null,f=-1,m=null;r&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var L;(L=m)==null||L.observe(t)})),e()}),c&&!l&&m.observe(c),t&&m.observe(t));let p,b=l?ut(i):null;l&&g();function g(){let y=ut(i);b&&!Si(b,y)&&e(),b=y,p=requestAnimationFrame(g)}return e(),()=>{var y;d.forEach(w=>{s&&w.removeEventListener("scroll",e),o&&w.removeEventListener("resize",e)}),u==null||u(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(p)}}var Li=di;var ki=ui,Ti=ci,Oi=hi;var Di=(i,t,e)=>{let n=new Map,s=e??{},o={...bs,...s.platform,_c:n};return li(i,t,{...s,platform:o})};function ht(i,t,e={}){let{placement:n="bottom-start",strategy:s="absolute",offset:o=4,flip:r=!0,shift:a=!0,padding:l=8,matchWidth:c=!1}=e,d=[Li(o),...r?[Ti({padding:l})]:[],...a?[ki({padding:l})]:[],...c?[Oi({apply({rects:f}){Object.assign(t.style,{width:`${f.reference.width}px`})}})]:[]];return t.style.position=s,Ci(i,t,async()=>{let f=await Di(i,t,{placement:n,strategy:s,middleware:d});Object.assign(t.style,{left:`${f.x}px`,top:`${f.y}px`});let m=f.placement.split("-")[0];t.setAttribute("data-side",m)})}var be=class{constructor(i){h(this,"opts");h(this,"buffer","");h(this,"timerId",null);h(this,"timeout");this.opts=i,this.timeout=i.timeout??1e3}handle(i){if(i.length!==1)return!1;this.timerId!==null&&clearTimeout(this.timerId),this.buffer+=i.toLowerCase(),this.timerId=setTimeout(()=>{this.buffer="",this.timerId=null},this.timeout);let t=this.opts.getItemCount();for(let e=0;e<t;e++)if(this.opts.getItemText(e).toLowerCase().startsWith(this.buffer))return this.opts.onMatch(e),!0;return!0}reset(){this.buffer="",this.timerId!==null&&(clearTimeout(this.timerId),this.timerId=null)}};var Ri=class extends z{constructor(){super(...arguments);h(this,"trigger",null);h(this,"content",null);h(this,"valueEl",null);h(this,"items",[]);h(this,"nativeSelect",null);h(this,"hiddenInput",null);h(this,"labelEl",null);h(this,"onLabelClick",t=>{var e;t.target.closest("[data-part=\'trigger\']")||(t.preventDefault(),(e=this.trigger)==null||e.focus())});h(this,"dismiss",null);h(this,"typeahead",null);h(this,"cleanupFloating",null);h(this,"_open",!1);h(this,"_value","");h(this,"highlighted",-1);h(this,"syncing",!1);h(this,"onNativeChange",()=>{this.syncing||this.refresh()});h(this,"onFormReset",()=>setTimeout(()=>this.refresh()));h(this,"onTriggerClick",()=>{this.isDisabled||(this._open?this.close():this.show())});h(this,"onTriggerKeyUp",t=>{t.key===" "&&t.preventDefault()});h(this,"onTriggerKey",t=>{var o,r;if(this.isDisabled)return;let e=this.enabled();if(!this._open){if(t.key==="ArrowDown"||t.key==="ArrowUp"||t.key==="Enter"||t.key===" "||t.altKey&&t.key==="ArrowDown")t.preventDefault(),this.show(),t.key==="ArrowUp"&&e.length&&this.highlight(this.items.indexOf(e[e.length-1]));else if(t.key==="Home"||t.key==="End"){t.preventDefault(),this.show();let a=t.key==="Home"?e[0]:e[e.length-1];a&&this.highlight(this.items.indexOf(a))}else t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&((o=this.typeahead)==null||o.handle(t.key));return}if(!e.length)return;let n=this.highlighted>=0?e.indexOf(this.items[this.highlighted]):-1,s=a=>{t.preventDefault(),this.highlight(this.items.indexOf(e[a]))};switch(t.key){case"ArrowDown":return s(Math.min(n+1,e.length-1));case"ArrowUp":return t.altKey?(t.preventDefault(),this.highlighted>=0&&this.select(this.items[this.highlighted]),this.close()):s(Math.max(n-1,0));case"Home":return s(0);case"End":return s(e.length-1);case"PageDown":return s(Math.min(n+10,e.length-1));case"PageUp":return s(Math.max(n-10,0));case"Enter":case" ":return t.preventDefault(),this.highlighted>=0&&this.select(this.items[this.highlighted]),this.close();case"Tab":return this.highlighted>=0&&this.select(this.items[this.highlighted]),this.close(!1);default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&((r=this.typeahead)==null||r.handle(t.key))}});h(this,"onListClick",t=>{let e=t.target.closest("[data-part=\'item\']");!e||!this.items.includes(e)||W(e)||(this.select(e),this.close())});h(this,"onListPointer",t=>{let e=t.target.closest("[data-part=\'item\']");e&&this.items.includes(e)&&!W(e)&&this.highlight(this.items.indexOf(e))});h(this,"preventBlur",t=>t.preventDefault())}get open(){return this._open}get value(){return this._value}set value(t){let e=this.items.find(n=>n.dataset.value===t);e&&this.select(e,!1)}get isDisabled(){var t;return this.hasAttribute("disabled")||!!((t=this.nativeSelect)!=null&&t.disabled)}refresh(){var n;let t=this.nativeSelect;if(!t)return;let e=this.items.find(s=>s.dataset.value===t.value);e&&this.select(e,!1),(n=this.trigger)==null||n.setAttribute("aria-disabled",String(this.isDisabled))}enabled(){return this.items.filter(t=>!W(t))}setup(){var a,l;if(this.nativeSelect=$(this,"select"),this.nativeSelect&&!$(this,"[data-part=\'trigger\']")&&this.buildFromNative(this.nativeSelect),this.trigger=$(this,"[data-part=\'trigger\']"),this.content=$(this,"[data-part=\'content\']"),this.valueEl=$(this,"[data-part=\'value\']"),!this.trigger||!this.content)return;let{trigger:t,content:e}=this;this.items=et(this,"[data-part=\'item\']");let n=F("db-select");e.id||(e.id=`${n}-listbox`),e.setAttribute("role","listbox"),e.hidden=!0,t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","listbox"),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-controls",e.id),t instanceof HTMLButtonElement&&!t.hasAttribute("type")&&(t.type="button"),this.isDisabled&&t.setAttribute("aria-disabled","true"),this.items.forEach((c,d)=>{c.id||(c.id=`${n}-item-${d}`),c.setAttribute("role","option"),c.setAttribute("aria-selected","false")}),et(this,"[data-part=\'group\']").forEach(c=>{c.setAttribute("role","group");let d=c.querySelector("[data-part=\'label\']");d&&(d.id||(d.id=F("db-select-label")),c.setAttribute("aria-labelledby",d.id))});let s=this.getAttribute("name");s&&!this.nativeSelect&&(this.hiddenInput=document.createElement("input"),this.hiddenInput.type="hidden",this.hiddenInput.name=s,this.hasAttribute("required")&&(this.hiddenInput.required=!0),this.appendChild(this.hiddenInput)),this.typeahead=new be({getItemCount:()=>this.enabled().length,getItemText:c=>{var d,u;return((u=(d=this.enabled()[c])==null?void 0:d.textContent)==null?void 0:u.trim())??""},onMatch:c=>{let d=this.enabled()[c];d&&(this._open?this.highlight(this.items.indexOf(d)):this.select(d))}}),this.dismiss=new at(e,{onDismiss:c=>this.close(c!=="outside-press")});let o=((a=this.nativeSelect)==null?void 0:a.value)??this.getAttribute("default-value")??"",r=this.items.find(c=>c.dataset.value===o);r&&W(r)?this.valueEl&&(this.valueEl.textContent=((l=r.textContent)==null?void 0:l.trim())??"",this.valueEl.setAttribute("data-placeholder","")):r&&this.select(r,!1),this.setState("closed")}buildFromNative(t){let e=document.createElement("button");e.type="button",e.setAttribute("data-part","trigger"),e.className="db-select-trigger";let n=t.getAttribute("aria-label"),s=t.getAttribute("aria-labelledby"),o=!s&&t.id?document.querySelector(`label[for="${CSS.escape(t.id)}"]`):null;o&&(s=o.id||(o.id=F("db-select-for"))),n&&e.setAttribute("aria-label",n),s&&e.setAttribute("aria-labelledby",s);let r=t.closest("label");if(r){if(this.labelEl=r,!n&&!s){let u=Array.from(r.childNodes).filter(f=>!(f instanceof Element&&(f===t||f.contains(t)||f.localName==="db-select"))).map(f=>f.textContent??"").join(" ").replace(/\\s+/g," ").trim();u&&e.setAttribute("aria-label",u)}}else o&&(this.labelEl=o);let a=document.createElement("span");a.setAttribute("data-part","value"),a.className="db-select-value";let l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("viewBox","0 0 24 24"),l.setAttribute("aria-hidden","true"),l.setAttribute("class","db-select-chevron"),l.innerHTML=\'<path d="m6 9 6 6 6-6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\',e.append(a,l);let c=document.createElement("div");c.setAttribute("data-part","content"),c.className="db-select-content";let d=(u,f)=>{let m=document.createElement("div");m.setAttribute("data-part","item"),m.className="db-select-item",m.dataset.value=u.value;for(let[p,b]of Object.entries(u.dataset))b!=null&&(m.dataset[p]=b);u.disabled&&m.setAttribute("aria-disabled","true"),m.textContent=u.textContent??u.value,f.appendChild(m)};for(let u of Array.from(t.children))if(u instanceof HTMLOptGroupElement){let f=document.createElement("div");f.setAttribute("data-part","group");let m=document.createElement("div");m.setAttribute("data-part","label"),m.className="db-select-label",m.textContent=u.label,f.appendChild(m);for(let p of Array.from(u.children))p instanceof HTMLOptionElement&&d(p,f);c.appendChild(f)}else u instanceof HTMLOptionElement&&d(u,c);t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true"),this.append(e,c)}connect(){var t,e,n,s,o,r,a,l,c,d;(t=this.trigger)==null||t.addEventListener("click",this.onTriggerClick),(e=this.trigger)==null||e.addEventListener("keydown",this.onTriggerKey),(n=this.trigger)==null||n.addEventListener("keyup",this.onTriggerKeyUp),(s=this.nativeSelect)==null||s.addEventListener("change",this.onNativeChange),(r=(o=this.nativeSelect)==null?void 0:o.form)==null||r.addEventListener("reset",this.onFormReset),(a=this.labelEl)==null||a.addEventListener("click",this.onLabelClick),(l=this.content)==null||l.addEventListener("click",this.onListClick),(c=this.content)==null||c.addEventListener("pointermove",this.onListPointer),(d=this.content)==null||d.addEventListener("mousedown",this.preventBlur)}disconnect(){var t,e,n,s,o,r,a,l,c,d;(t=this.trigger)==null||t.removeEventListener("click",this.onTriggerClick),(e=this.trigger)==null||e.removeEventListener("keydown",this.onTriggerKey),(n=this.trigger)==null||n.removeEventListener("keyup",this.onTriggerKeyUp),(s=this.nativeSelect)==null||s.removeEventListener("change",this.onNativeChange),(r=(o=this.nativeSelect)==null?void 0:o.form)==null||r.removeEventListener("reset",this.onFormReset),(a=this.labelEl)==null||a.removeEventListener("click",this.onLabelClick),(l=this.content)==null||l.removeEventListener("click",this.onListClick),(c=this.content)==null||c.removeEventListener("pointermove",this.onListPointer),(d=this.content)==null||d.removeEventListener("mousedown",this.preventBlur),this._open&&this.close(!1)}setState(t){var e;this.setAttribute("data-state",t),(e=this.content)==null||e.setAttribute("data-state",t)}show(){var r,a;let{trigger:t,content:e}=this;if(!t||!e||this._open)return;this._open=!0;let n=vt(e);this.setState("open"),t.setAttribute("aria-expanded","true"),this.cleanupFloating=ht(t,e,{placement:"bottom-start",offset:4,matchWidth:!this.hasAttribute("auto-width"),strategy:n==="top-layer"?"fixed":"absolute"});let o=this.items.find(l=>l.dataset.value===this._value&&!W(l))??this.enabled()[0];o&&this.highlight(this.items.indexOf(o)),(r=this.dismiss)==null||r.activate(),(a=this.typeahead)==null||a.reset(),t.focus()}close(t=!0){var s,o,r;let{trigger:e,content:n}=this;!e||!n||!this._open||(this._open=!1,(s=this.dismiss)==null||s.deactivate(),(o=this.cleanupFloating)==null||o.call(this),this.cleanupFloating=null,yt(n),this.setState("closed"),e.setAttribute("aria-expanded","false"),e.removeAttribute("aria-activedescendant"),this.items.forEach(a=>a.removeAttribute("data-highlighted")),this.highlighted=-1,(r=this.typeahead)==null||r.reset(),t&&e.focus())}highlight(t){var r;let e=this.items[t],n=this.content;if(!e||!n||!this.trigger)return;this.highlighted>=0&&((r=this.items[this.highlighted])==null||r.removeAttribute("data-highlighted")),this.highlighted=t,e.setAttribute("data-highlighted",""),this.trigger.setAttribute("aria-activedescendant",e.id);let s=e.offsetTop,o=s+e.offsetHeight;s<n.scrollTop?n.scrollTop=s:o>n.scrollTop+n.clientHeight&&(n.scrollTop=o-n.clientHeight)}select(t,e=!0){var o;if(W(t))return;let n=t.dataset.value??"",s=n!==this._value;this._value=n;for(let r of this.items){let a=r===t;r.setAttribute("aria-selected",String(a)),a?r.setAttribute("data-state","checked"):r.removeAttribute("data-state")}if(this.valueEl&&(this.valueEl.textContent=((o=t.textContent)==null?void 0:o.trim())??"",this.valueEl.removeAttribute("data-placeholder")),this.hiddenInput&&(this.hiddenInput.value=n),!e||!s){this.nativeSelect&&(this.nativeSelect.value=n);return}if(this.nativeSelect){this.nativeSelect.value=n,this.syncing=!0;try{this.nativeSelect.dispatchEvent(new Event("input",{bubbles:!0})),this.nativeSelect.dispatchEvent(new Event("change",{bubbles:!0}))}finally{this.syncing=!1}}this.dispatchEvent(new CustomEvent("db-select:change",{detail:{value:n},bubbles:!0}))}};N();customElements.get("db-select")||customElements.define("db-select",Ri);var Ii=class extends z{constructor(){super(...arguments);h(this,"trigger",null);h(this,"content",null);h(this,"dismiss",null);h(this,"cleanupFloating",null);h(this,"_open",!1);h(this,"onTriggerClick",()=>this.toggle());h(this,"onContentClick",t=>{let e=t.target.closest("[data-part=\'close\']");e&&e.closest("db-popover")===this&&this.close("close-press")})}get open(){return this._open}setup(){var e;if(this.trigger=bt($(this,"[data-part=\'trigger\']")),this.content=$(this,"[data-part=\'content\']"),!this.trigger||!this.content)return;let t=this.content;t.id||(t.id=F("db-popover")),t.hasAttribute("role")||t.setAttribute("role","dialog"),!t.hasAttribute("aria-labelledby")&&!t.hasAttribute("aria-label")&&((e=this.trigger).id||(e.id=F("db-popover-trigger")),t.setAttribute("aria-labelledby",this.trigger.id)),t.hidden=!0,this.trigger.setAttribute("aria-haspopup","dialog"),this.trigger.setAttribute("aria-controls",t.id),this.trigger.setAttribute("aria-expanded","false"),this.setState("closed"),this.dismiss=new at(t,{onDismiss:n=>this.close(n)})}connect(){var t,e;(t=this.trigger)==null||t.addEventListener("click",this.onTriggerClick),(e=this.content)==null||e.addEventListener("click",this.onContentClick)}disconnect(){var t,e;(t=this.trigger)==null||t.removeEventListener("click",this.onTriggerClick),(e=this.content)==null||e.removeEventListener("click",this.onContentClick),this._open&&this.close("api")}setState(t){var e;this.setAttribute("data-state",t),(e=this.content)==null||e.setAttribute("data-state",t)}placement(){var s,o;let t=this.getAttribute("placement");if(t)return t;let e=((s=this.content)==null?void 0:s.dataset.side)||"bottom",n=((o=this.content)==null?void 0:o.dataset.align)||"center";return`${e}${n!=="center"?`-${n}`:""}`}toggle(){this._open?this.close("trigger-press"):this.show()}show(){var s;let{trigger:t,content:e}=this;if(!t||!e||this._open)return;this._open=!0;let n=vt(e);this.setState("open"),t.setAttribute("aria-expanded","true"),this.cleanupFloating=ht(t,e,{placement:this.placement(),offset:Number(this.getAttribute("offset")??8),strategy:n==="top-layer"?"fixed":"absolute"}),(s=this.dismiss)==null||s.activate(),this.hasAttribute("no-autofocus")||requestAnimationFrame(()=>{this._open&&(Ne(e)[0]??e).focus({preventScroll:!0})}),this.dispatchEvent(new CustomEvent("db-popover:open",{bubbles:!0}))}close(t="api"){var o,r;let{trigger:e,content:n}=this;if(!e||!n||!this._open)return;this._open=!1,(o=this.dismiss)==null||o.deactivate(),(r=this.cleanupFloating)==null||r.call(this),this.cleanupFloating=null;let s=n.contains(document.activeElement);yt(n),this.setState("closed"),e.setAttribute("aria-expanded","false"),t!=="outside-press"&&(s||t==="escape-key"||t==="close-press")&&e.focus(),this.dispatchEvent(new CustomEvent("db-popover:close",{detail:{reason:t},bubbles:!0}))}};N();customElements.get("db-popover")||customElements.define("db-popover",Ii);var Mi=class extends z{constructor(){super(...arguments);h(this,"trigger",null);h(this,"content",null);h(this,"cleanupFloating",null);h(this,"showTimer",null);h(this,"hideTimer",null);h(this,"_open",!1);h(this,"onEnter",t=>{t.pointerType!=="touch"&&(this.clearTimers(),this._open||(this.showTimer=setTimeout(()=>this.show(),this.num("delay",200))))});h(this,"onLeave",t=>{t.pointerType!=="touch"&&(this.clearTimers(),this.hideTimer=setTimeout(()=>this.hide(),this.num("close-delay",100)))});h(this,"onContentEnter",()=>this.clearTimers());h(this,"onFocus",()=>{let t=!0;try{t=this.trigger.matches(":focus-visible")}catch{}t&&(this.clearTimers(),this.show())});h(this,"onBlur",()=>this.hide());h(this,"onPress",()=>this.hide());h(this,"onKey",t=>{t.key==="Escape"&&this._open&&(t.preventDefault(),t.stopImmediatePropagation(),this.hide())})}get open(){return this._open}num(t,e){let n=Number(this.getAttribute(t));return Number.isFinite(n)&&this.hasAttribute(t)?n:e}setup(){var e;if(this.trigger=bt($(this,"[data-part=\'trigger\']")),this.content=$(this,"[data-part=\'content\']"),!this.trigger||!this.content)return;(e=this.content).id||(e.id=F("db-tooltip")),this.content.setAttribute("role","tooltip"),this.content.hidden=!0;let t=(this.trigger.getAttribute("aria-describedby")??"").split(/\\s+/).filter(Boolean);t.includes(this.content.id)||this.trigger.setAttribute("aria-describedby",[...t,this.content.id].join(" ")),this.setState("closed")}connect(){let{trigger:t,content:e}=this;!t||!e||(t.addEventListener("pointerenter",this.onEnter),t.addEventListener("pointerleave",this.onLeave),t.addEventListener("focus",this.onFocus),t.addEventListener("blur",this.onBlur),t.addEventListener("pointerdown",this.onPress),e.addEventListener("pointerenter",this.onContentEnter),e.addEventListener("pointerleave",this.onLeave))}disconnect(){let{trigger:t,content:e}=this;t==null||t.removeEventListener("pointerenter",this.onEnter),t==null||t.removeEventListener("pointerleave",this.onLeave),t==null||t.removeEventListener("focus",this.onFocus),t==null||t.removeEventListener("blur",this.onBlur),t==null||t.removeEventListener("pointerdown",this.onPress),e==null||e.removeEventListener("pointerenter",this.onContentEnter),e==null||e.removeEventListener("pointerleave",this.onLeave),this.hide()}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.showTimer=this.hideTimer=null}setState(t){var e;this.setAttribute("data-state",t),(e=this.content)==null||e.setAttribute("data-state",t)}show(){let{trigger:t,content:e}=this;if(!t||!e||this._open)return;this._open=!0,this.clearTimers();let n=vt(e);this.setState("open"),this.cleanupFloating=ht(t,e,{placement:this.getAttribute("placement")||e.dataset.side||"top",offset:8,strategy:n==="top-layer"?"fixed":"absolute"}),document.addEventListener("keydown",this.onKey,!0),this.dispatchEvent(new CustomEvent("db-tooltip:open",{bubbles:!0}))}hide(){var t;this.clearTimers(),!(!this._open||!this.content)&&(this._open=!1,document.removeEventListener("keydown",this.onKey,!0),(t=this.cleanupFloating)==null||t.call(this),this.cleanupFloating=null,yt(this.content),this.setState("closed"),this.dispatchEvent(new CustomEvent("db-tooltip:close",{bubbles:!0})))}};N();customElements.get("db-tooltip")||customElements.define("db-tooltip",Mi);var Hi="sidebar_state",ys="b",ws=768,Pt=new WeakMap;function Es(i){try{return localStorage.getItem(i)}catch{return null}}function xs(i,t){try{localStorage.setItem(i,t)}catch{}}function we(i){if(Pt.has(i))return;let t=i.querySelector("[data-component=\'sidebar\']");if(!t)return;let e=t.dataset.collapsible||"offcanvas",n=t.dataset.side||"left",s=t.dataset.defaultOpen!=="false",o=Es(Hi),r=o!==null?o==="true":s,a=t.querySelector("[data-sidebar-desktop]"),l=t.querySelector("[data-sidebar-mobile]"),c=t.querySelector("[data-sidebar-mobile-backdrop]"),d=window.matchMedia(`(max-width: ${ws-1}px)`),u={provider:i,sidebar:t,desktopSidebar:a,mobileSidebar:l,mobileBackdrop:c,collapsible:e,side:n,open:r,openMobile:!1,isMobile:d.matches,mediaQuery:d};Pt.set(i,u),zi(u);let f=b=>{u.isMobile=b.matches,!b.matches&&u.openMobile&&ft(i)};d.addEventListener("change",f);let m=b=>{b.key===ys&&(b.metaKey||b.ctrlKey)?(b.preventDefault(),ve(i)):b.key==="Escape"&&u.openMobile&&(b.preventDefault(),ft(i))};document.addEventListener("keydown",m),As(i,u),c&&c.addEventListener("click",()=>{ft(i)});let p=t.querySelector("[data-part=\'rail\']");p&&p.addEventListener("click",()=>{ve(i)})}function As(i,t){i.querySelectorAll("[data-part=\'sidebar-trigger\']").forEach(e=>{e.addEventListener("click",()=>{ve(i)})})}function ve(i){let t=Pt.get(i);t&&(t.isMobile?t.openMobile?ft(i):Ss(i):(t.open=!t.open,zi(t),xs(Hi,String(t.open))))}function zi(i){let t=i.open?"expanded":"collapsed";i.provider.setAttribute("data-state",t),i.sidebar.setAttribute("data-state",t),i.desktopSidebar&&(i.desktopSidebar.setAttribute("data-state",t),i.open?i.desktopSidebar.setAttribute("data-collapsible",""):i.desktopSidebar.setAttribute("data-collapsible",i.collapsible))}function Ss(i){var n;let t=Pt.get(i);if(!t||t.openMobile||!t.mobileSidebar)return;t.openMobile=!0;let e=(n=t.desktopSidebar)==null?void 0:n.querySelector("[data-sidebar=\'sidebar-inner\']");if(e)for(;e.firstChild;)t.mobileSidebar.appendChild(e.firstChild);t.mobileSidebar.hidden=!1,t.mobileSidebar.setAttribute("data-state","open"),t.mobileBackdrop&&(t.mobileBackdrop.hidden=!1),rt.activate(),requestAnimationFrame(()=>{var o;let s=(o=t.mobileSidebar)==null?void 0:o.querySelector(\'a, button, [tabindex]:not([tabindex="-1"])\');s==null||s.focus()})}function ft(i){var s;let t=Pt.get(i);if(!t||!t.openMobile||!t.mobileSidebar)return;t.openMobile=!1;let e=(s=t.desktopSidebar)==null?void 0:s.querySelector("[data-sidebar=\'sidebar-inner\']");if(e&&t.mobileSidebar)for(;t.mobileSidebar.firstChild;)e.appendChild(t.mobileSidebar.firstChild);t.mobileSidebar.setAttribute("data-state","closed"),t.mobileSidebar.hidden=!0,t.mobileBackdrop&&(t.mobileBackdrop.hidden=!0),rt.deactivate();let n=t.provider.querySelector("[data-part=\'sidebar-trigger\']");n==null||n.focus()}function ye(){document.querySelectorAll("[data-component=\'sidebar-provider\']").forEach(i=>{we(i)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ye):ye();document.addEventListener("astro:page-load",ye);var Zt={docs:"docs.js",shard:i=>`t-${i}.js`,fragment:i=>`f-${i}.js`},Qt={docs:"docs",shard:i=>i,fragment:i=>`frag:${i}`};var Cs={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},Ls={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},ks="[^aeiou]",xe="[aeiouy]",ot="("+ks+"[^aeiouy]*)",te="("+xe+"[aeiou]*)",Ee=new RegExp("^"+ot+"?"+te+ot),Ts=new RegExp("^"+ot+"?"+te+ot+te+"?$"),Jt=new RegExp("^"+ot+"?("+te+ot+"){2,}"),Ni=new RegExp("^"+ot+"?"+xe),_i=new RegExp("^"+ot+xe+"[^aeiouwxy]$"),Os=/ll$/,Ds=/^(.+?)e$/,Rs=/^(.+?)y$/,Is=/^(.+?(s|t))(ion)$/,Ms=/^(.+?)(ed|ing)$/,Hs=/(at|bl|iz)$/,zs=/^(.+?)eed$/,Ns=/^.+?[^s]s$/,_s=/^.+?(ss|i)es$/,Ps=/([^aeiouylsz])\\1$/,Fs=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,$s=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,Bs=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;function Pi(i){let t=String(i).toLowerCase();if(t.length<3)return t;let e=!1;t.codePointAt(0)===121&&(e=!0,t="Y"+t.slice(1)),_s.test(t)?t=t.slice(0,-2):Ns.test(t)&&(t=t.slice(0,-1));let n;return(n=zs.exec(t))?Ee.test(n[1])&&(t=t.slice(0,-1)):(n=Ms.exec(t))&&Ni.test(n[1])&&(t=n[1],Hs.test(t)?t+="e":Ps.test(t)?t=t.slice(0,-1):_i.test(t)&&(t+="e")),(n=Rs.exec(t))&&Ni.test(n[1])&&(t=n[1]+"i"),(n=Fs.exec(t))&&Ee.test(n[1])&&(t=n[1]+Cs[n[2]]),(n=$s.exec(t))&&Ee.test(n[1])&&(t=n[1]+Ls[n[2]]),(n=Bs.exec(t))?Jt.test(n[1])&&(t=n[1]):(n=Is.exec(t))&&Jt.test(n[1])&&(t=n[1]),(n=Ds.exec(t))&&(Jt.test(n[1])||Ts.test(n[1])&&!_i.test(n[1]))&&(t=n[1]),Os.test(t)&&Jt.test(t)&&(t=t.slice(0,-1)),e&&(t="y"+t.slice(1)),t}var Fi=new Set("a an and are as at be by for from has have in is it its of on or that the this to was were will with you your can not".split(" ")),Ks=/[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}]/u,Ft;function qs(i){if(Ft===void 0)try{Ft=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"word"}):null}catch{Ft=null}if(Ft)return[...Ft.segment(i)].filter(n=>n.isWordLike).map(n=>n.segment);let t=[...i];if(t.length<2)return t;let e=[];for(let n=0;n<t.length-1;n++)e.push(t[n]+t[n+1]);return e}function mt(i){let t=[];for(let e of i.toLowerCase().normalize("NFKD").replace(/[\u0300-\u036F]/g,"").normalize("NFC").matchAll(/[\\p{L}\\p{N}][\\p{L}\\p{N}_.-]*[\\p{L}\\p{N}]|[\\p{L}\\p{N}]/gu)){let n=e[0],s=n.split(/[._-]+/).filter(Boolean);if(s.length>1&&t.push(n),s.length>1&&!/[._]/.test(n)){let o=s.join("");o.length>=3&&!Fi.has(o)&&t.push(o)}for(let o of s)Ks.test(o)?t.push(...qs(o)):o.length>=2&&!Fi.has(o)&&t.push(o)}return t}function Ae(i,t){let e="";for(let n of i.slice(0,t))e+=/[a-z0-9]/.test(n)?n:`_${n.codePointAt(0).toString(16)}_`;return e}function $t(i){if(!(!i||!/^en(-|$)/i.test(i)))return t=>/^[a-z]{3,}$/.test(t)?Pi(t):t}function Lt(i){let t=[],e=[],n=[],s=!1,o={tag:[],section:[]},r={tag:[],section:[]},a=[...i.matchAll(new RegExp(\'(?<!\\\\S)(-?)(tag|section):(?:"([^"]*)"?|(\\\\S*))|(-?)"([^"]*)"?|(\\\\S+)\',"gi"))].map(u=>{var f;return{facetNeg:u[1]==="-",facet:(f=u[2])==null?void 0:f.toLowerCase(),value:u[3]??u[4],neg:u[5],phrase:u[6],word:u[7]}}),l=!1,c=!1;for(let[u,f]of a.entries()){if(f.facet){let H=ji(f.value??"");H&&(f.facetNeg?r:o)[f.facet].push(H);continue}let m=f.word;if(m==="OR"){c=t.length>0,s=!0;continue}if(m==="NOT"){l=!0,s=!0;continue}if(m==="AND"){s=!0;continue}let p=f.phrase!==void 0,b=l||f.neg==="-"||(m==null?void 0:m.startsWith("-"))&&m.length>1;l=!1;let g=p?f.phrase:b&&(m!=null&&m.startsWith("-"))?m.slice(1):m,y=[...new Set(mt(g))];if(!y.length){c=!1;continue}if(b){e.push(p?y:[y[0]]),s=!0,c=!1;continue}if(p){c=!1,s=!0,y.length>1&&n.push(mt(g).join(" "));for(let H of y)t.push({terms:[H],prefix:!1,exact:!0});continue}let w=u===a.length-1&&!/\\s$/.test(i);if(c){t[t.length-1].terms.push(y[0]);for(let H of y.slice(1))t.push({terms:[H],prefix:!1});c=!1;continue}let L=y[0],R=/[._-]/.test(L),M=L.replace(/-/g,"");for(let[H,O]of y.entries())t.push({terms:[O],prefix:w&&O.length>=2&&(H===y.length-1||R&&(O===L||O===M))})}let d=[...new Set(t.flatMap(u=>u.terms))];return{groups:t,not:e,phrases:n,strict:s,highlight:d,filters:o,notFilters:r}}async function Ws(i,t){let e=await t.meta(),n=typeof i=="string"?Lt(i):i,s=new Set;for(let c of n.not){let d;for(let u of c){let[f]=Wi(u,e),m=f?await t.shard(f):void 0,p=m&&Object.hasOwn(m,u)?m[u]:[],b=new Set;for(let g=0;g<p.length;g+=2)(!d||d.has(p[g]))&&b.add(p[g]);d=b}for(let u of d??[])s.add(u)}let o=Ys(n,e);if(!n.groups.length){if(!o)return[];let c=[];return e.docs.forEach(([d,u,f],m)=>o(m)&&!s.has(m)&&c.push({id:m,title:d,url:u,section:e.sections[f]??"",score:1})),c}let r=[];for(let c of n.groups)r.push(await Us(c,e,t));let a=c=>{let d=new Map,u=new Map;for(let m of r)for(let[p,b]of m)d.set(p,(d.get(p)??0)+b),u.set(p,(u.get(p)??0)+1);let f=[];for(let[m,p]of d){if(s.has(m)||o&&!o(m)||c==="and"&&u.get(m)!==r.length)continue;let[b,g,y]=e.docs[m];f.push({id:m,title:b,url:g,section:e.sections[y]??"",score:p*(u.get(m)/r.length)})}return f.sort((m,p)=>p.score-m.score)},l=a("and");return l.length||n.strict?l:a("or")}var Z={prefix:.6,stem:.4,titleAll:1.5,titleExact:2,headingAll:1.4,headingExact:1.8,phrase:1.5,typo:.3};function js(i,t){if(i===t)return!1;if(i.length===t.length){let o=[];for(let r=0;r<i.length&&o.length<=2;r++)i[r]!==t[r]&&o.push(r);return o.length===1?!0:o.length===2&&o[1]===o[0]+1&&i[o[0]]===t[o[1]]&&i[o[1]]===t[o[0]]}let[e,n]=i.length<t.length?[i,t]:[t,i];if(n.length-e.length!==1)return!1;let s=0;for(;s<e.length&&e[s]===n[s];)s++;return e.slice(s)===n.slice(s+1)}function Wi(i,t,e=!1){let n=Vs(t);for(let o=Math.min(i.length,Bi);o>=1;o--){let r=Ae(i,o);if(n.has(r))return!e||o<i.length?[r]:[r,...t.shards.filter(a=>a.length>r.length&&a.startsWith(r)).slice(0,10)]}let s=Ae(i,Math.min(i.length,Bi));return e?t.shards.filter(o=>o.startsWith(s)).slice(0,10):[]}var Bi=3,Ki=new WeakMap;function Vs(i){let t=Ki.get(i);return t||Ki.set(i,t=new Set(i.shards)),t}function ji(i){return i.replace(/"/g,"").trim().toLowerCase()}function Ys(i,t){let{tag:e,section:n}=i.filters,s=i.notFilters??{tag:[],section:[]};if(!e.length&&!n.length&&!s.tag.length&&!s.section.length)return;let o=(d,u)=>new Set(d.flatMap((f,m)=>u.includes(ji(f))?[m]:[])),r=o(t.sections,n),a=o(t.tags??[],e),l=o(t.sections,s.section),c=o(t.tags??[],s.tag);return d=>{let u=t.docs[d],f=u[3]??[];return!(n.length&&!r.has(u[2])||e.length&&!f.some(m=>a.has(m))||l.has(u[2])||f.some(m=>c.has(m)))}}async function Us(i,t,e){i.corrected=void 0;let n=$t(t.lang),s=new Map,o=new Map;for(let d of i.terms)for(let u of Wi(d,t,i.prefix)){let f=await e.shard(u);if(!f)continue;let m=(y,w)=>{w>(s.get(y)??0)&&(s.set(y,w),o.set(y,f))};Object.hasOwn(f,d)&&m(d,1);let p=n==null?void 0:n(d),b=p?p.slice(0,Math.max(3,p.length-1)):void 0,g=0;for(let y in f)y!==d&&(i.prefix&&y.startsWith(d)&&g++<200&&m(y,Z.prefix),p&&b&&y.startsWith(b)&&n(y)===p&&m(y,Z.stem));if(!s.size&&!i.exact&&d.length>=4&&!/[._-]/.test(d))for(let y in f)Math.abs(y.length-d.length)<=1&&js(d,y)&&m(y,Z.typo)}[...s.values()].some(d=>d===Z.typo)&&(i.corrected=[...s].filter(([,d])=>d===Z.typo).map(([d])=>d));let r=[...s].map(([d,u])=>[o.get(d)[d],u]),a=new Set;for(let[d]of r)for(let u=0;u<d.length;u+=2)a.add(d[u]);let l=Math.log(1+(t.count-a.size+.5)/(a.size+.5)),c=new Map;for(let[d,u]of r)for(let f=0;f<d.length;f+=2)c.set(d[f],Math.max(c.get(d[f])??0,d[f+1]*u*l));return c}async function Vi(i,t){var o;let e=await t.meta(),n=[...new Set(i.map(r=>Math.floor(r.id/e.block)))],s=new Map;await Promise.all(n.map(async r=>s.set(r,await t.fragment(r))));for(let r of i)r.fragment??(r.fragment=(o=s.get(Math.floor(r.id/e.block)))==null?void 0:o[r.id%e.block])}async function Xs(i,t,e,n=10){let s=t.slice(0,n);await Vi(s,e);let o=i.groups,r=$t((await e.meta()).lang),a=(l,c)=>c.terms.some(d=>l===d||c.prefix&&l.startsWith(d)||r!==void 0&&r(l)===r(d))||(c.corrected??[]).includes(l);for(let l of s){let[c,d]=l.fragment??["",[]],u=mt(l.title),f=1;o.length&&o.every(p=>u.some(b=>a(b,p)))&&(f=qi(u,o,a)?Z.titleExact:Z.titleAll);let m=[];for(let[p,b]of d){let g=mt(p);!o.length||!o.every(y=>g.some(w=>a(w,y)))||(m.push([p,b]),f=Math.max(f,qi(g,o,a)?Z.headingExact:Z.headingAll))}if(l.sections=m.slice(0,3),i.phrases.length){let p=[l.title,c,...d.map(([b])=>b)].map(b=>mt(b).join(" ")).join(" \\0 ");i.phrases.every(b=>p.includes(b))&&(f*=Z.phrase)}l.score*=f}return s.sort((l,c)=>c.score-l.score),[...s,...t.slice(n)]}async function Yi(i,t,e){await Vi(t,e);let n=$t((await e.meta()).lang),s=(o,r)=>r.terms.some(a=>o===a||r.prefix&&o.startsWith(a)||n!==void 0&&n(o)===n(a))||(r.corrected??[]).includes(o);for(let o of t)!o.fragment||o.sections||(o.sections=o.fragment[1].filter(([r])=>{let a=mt(r);return i.groups.length>0&&i.groups.every(l=>a.some(c=>s(c,l)))}).slice(0,3))}function qi(i,t,e){return i.every(n=>t.some(s=>e(n,s)))&&t.every(n=>i.some(s=>e(s,n)))}async function Ui(i,t,e=10){let n=Lt(i),s=$t((await t.meta()).lang);s&&(n.highlight=[...new Set([...n.highlight,...n.highlight.map(s).filter(r=>r.length>=3)])]);let o=await Ws(n,t);return n.highlight=[...new Set([...n.highlight,...n.groups.flatMap(r=>r.corrected??[])])],{parsed:n,results:await Xs(n,o,t,e)}}function Xi(i,t,e=globalThis){let n=new Map,s=e.__DOGSBAY_SEARCH__??{q:[],load(){}};for(let[l,c]of s.q)n.set(l,c);s.q=[],s.load=(l,c)=>void n.set(l,c),e.__DOGSBAY_SEARCH__=s;let o=async(l,c)=>(n.has(l)||await t(i+c),n.get(l)),r,a={meta:()=>r??(r=o(Qt.docs,Zt.docs).then(l=>{if(!l||l.format!==4)throw new Error(`search index format ${(l==null?void 0:l.format)??"missing"}, expected ${4}: rebuild the site`);return l})),shard:async l=>(await a.meta()).shards.includes(l)?o(Qt.shard(l),Zt.shard(l)):void 0,fragment:l=>o(Qt.fragment(l),Zt.fragment(l))};return a}function Gi(i){let t,e=new URL(i||"./",location.href).pathname;return async n=>{t??(t=import(new URL(`${i}pagefind/pagefind.js`,location.href).href).catch(d=>{throw t=void 0,d}));let s=n.replace(new RegExp(\'(?<!\\\\S)-?(tag|section):("[^"]*"?|\\\\S*)\',"gi")," ").trim(),o=s?await(await t).search(s):null,r=(o==null?void 0:o.results)??[],a=async(d,u)=>{let f=await d.data(),m=f.url.startsWith(e)?f.url.slice(e.length):f.url.replace(/^\\/+/,""),p=(f.sub_results??[]).map(b=>[b.title,b.url.split("#")[1]??""]).filter(([,b])=>b);return{id:u,title:f.meta.title??m,url:m,section:"",score:r.length-u,fragment:[Gs(f.excerpt),p],sections:p.slice(0,3)}},l=await Promise.all(r.slice(0,10).map(a)),c=Promise.all(r.slice(10,30).map((d,u)=>a(d,u+10)));return c.catch(()=>{}),{results:l,more:c,total:r.length,highlight:Lt(n).highlight}}}function Gs(i){return new DOMParser().parseFromString(i,"text/html").body.textContent??""}function Zi(i){let{signal:t}=i,e=document.getElementById("db-search");if(!e)return;let n=e.querySelector("[data-db-search-input]"),s=e.querySelector("[data-part=\'listbox\']"),o=e.querySelector("[data-db-search-status]"),r=o.textContent??"",a=Xi(`${i.unitRoot}_dogsbay/search/`,i.loadScript,window),l=document.body.dataset.search??"builtin",c=location.protocol!=="file:",d=l==="pagefind"||l==="both"&&c?Gi(i.unitRoot):void 0,u=l==="pagefind"&&!c;e.addEventListener("db-dialog:open",()=>{n.focus(),n.select(),u?o.textContent=s.dataset.needsServer??"":d||a.meta().catch(()=>o.textContent="Search index could not be loaded.")},{signal:t}),document.addEventListener("keydown",S=>{let x=S.target.closest("input, textarea, select, [contenteditable]");(S.key==="/"&&!x||S.key.toLowerCase()==="k"&&(S.metaKey||S.ctrlKey))&&(S.preventDefault(),e.open?n.focus():e.show())},{signal:t}),s.addEventListener("click",S=>{S.target.closest("a")&&e.close("api")},{signal:t});let f=0,m,p;n.addEventListener("input",()=>{clearTimeout(p),p=setTimeout(()=>void y(++f),80)},{signal:t});let b=new Map,g=typeof IntersectionObserver=="function"?new IntersectionObserver(S=>{var x;for(let E of S)E.isIntersecting&&((x=b.get(E.target))==null||x(),b.delete(E.target),g.unobserve(E.target))}):void 0,y=async S=>{let x=n.value.trim();if(!x){g==null||g.disconnect(),b.clear(),w.hidden=!0,s.replaceChildren(),o.textContent=r;return}if(!u)try{if(d){let E=await d(x);if(S!==f)return;O(x,E.results,E.highlight,E.total);let C=await E.more;S===f&&C.length&&v(x,C,E.highlight)}else{let E=await Ui(x,a);if(S!==f)return;m=E.parsed,O(x,E.results.slice(0,30),E.parsed.highlight,E.results.length,E.results)}}catch{S===f&&(o.textContent="Search index could not be loaded.")}},w=document.createElement("div");w.setAttribute("role","group"),w.setAttribute("aria-label",s.dataset.filterSection??"Filter by section"),w.className="flex flex-wrap gap-1 px-3 pb-2",w.hidden=!0,s.before(w),t==null||t.addEventListener("abort",()=>{clearTimeout(p),f++,g==null||g.disconnect(),b.clear(),w.remove()});let L=S=>S.replace(/"/g,""),R=S=>`section:"${L(S)}"`,M,H=(S,x)=>{let E=new Map;for(let k of x)k.section&&E.set(k.section,(E.get(k.section)??0)+1);let C=[...S.matchAll(/section:"([^"]*)"/gi)].map(k=>k[1].toLowerCase()),T=k=>C.includes(L(k).toLowerCase()),A=[...E].sort((k,D)=>D[1]-k[1]).slice(0,6).map(([k])=>k);for(let k of C)A.some(D=>L(D).toLowerCase()===k)||A.push(k);w.replaceChildren(...A.length>1||C.length?A.map(k=>{let D=document.createElement("button");D.type="button";let _=T(k);return D.setAttribute("aria-pressed",String(_)),D.className="rounded-full border px-2.5 py-0.5 text-xs hover:bg-accent aria-pressed:bg-primary aria-pressed:text-primary-foreground",D.textContent=k,D.addEventListener("click",()=>{let P=R(k),tt=n.value.replace(new RegExp(`\\\\s*section:"${L(k).replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}"`,"i"),"").trim();n.value=_?tt:`${tt} ${P}`.trim(),M=k,n.dispatchEvent(new Event("input",{bubbles:!0}))},{signal:t}),D}):[]),w.hidden=!w.childElementCount,M!==void 0&&(([...w.querySelectorAll("button")].find(D=>D.textContent===M)??n).focus(),M=void 0)},O=(S,x,E,C,T=x)=>{g==null||g.disconnect(),b.clear(),H(S,T),s.replaceChildren(...K(S,x,E)),o.textContent=C?`${C} result${C===1?"":"s"}`:`${s.dataset.noResults} \\u201C${S}\\u201D`},v=(S,x,E)=>s.append(...K(S,x,E)),K=(S,x,E)=>{let C=[];for(let T of x){let A=I(T.url,E,"block rounded-md p-3 hover:bg-accent"),k=document.createElement("div");if(k.className="font-medium",k.append(...Se(T.title,E)),A.a.appendChild(k),T.section){let P=document.createElement("div");P.className="text-xs text-muted-foreground",P.textContent=T.section,A.a.appendChild(P)}let D=document.createElement("div");D.className="mt-1 line-clamp-2 text-xs text-muted-foreground",A.a.appendChild(D),C.push(A.li);let _=()=>T.fragment?(T.fragment[0]&&D.replaceChildren(...Se(T.fragment[0],E)),(T.sections??[]).map(([P,tt])=>{let Bt=I(`${T.url}#${tt}`,E,"ml-4 block rounded-md border-l px-3 py-1.5 text-sm hover:bg-accent");return Bt.a.append(...Se(P,E)),Bt.li})):[];if(T.fragment)C.push(..._());else if(g){let P=m??Lt(S);b.set(A.li,()=>void Yi(P,[T],a).then(()=>A.li.after(..._()),()=>{})),g.observe(A.li)}}return C},I=(S,x,E)=>{let C=document.createElement("li");C.setAttribute("role","none"),C.className="mb-1";let T=document.createElement("a");return T.setAttribute("data-part","option"),T.dataset.value=S,T.href=Zs(i.unitRoot+S,x),T.tabIndex=-1,T.className=E,C.appendChild(T),{li:C,a:T}}}function Zs(i,t){if(!t.length)return i;let e=i.indexOf("#"),[n,s]=e<0?[i,""]:[i.slice(0,e),i.slice(e)];return`${n}${n.includes("?")?"&":"?"}h=${encodeURIComponent(t.join(" "))}${s}`}function Se(i,t){if(!t.length)return[document.createTextNode(i)];let e=new RegExp(`(${t.map(n=>n.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")).join("|")})`,"gi");return i.split(e).map((n,s)=>{if(s%2===0)return document.createTextNode(n);let o=document.createElement("mark");return o.textContent=n,o})}var Qi=/[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}]/u;function Ji(i){var b;let t;try{t=(new URLSearchParams(location.search).get("h")??"").split(/\\s+/).filter(g=>g.length>0)}catch{return}let e=document.querySelector("#db-content article")??document.querySelector("#db-content");if(!t.length||!e)return;let n=g=>g.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&"),s=[...t].sort((g,y)=>y.length-g.length),o=s.filter(g=>Qi.test(g)).map(n),r=s.filter(g=>!Qi.test(g)).map(n),a=[r.length?`(?<![\\\\p{L}\\\\p{N}])(?:${r.join("|")})`:"",o.length?`(?:${o.join("|")})`:""].filter(Boolean),l=new RegExp(`(${a.join("|")})`,"giu"),c=[],d=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:g=>{var y;return(y=g.parentElement)!=null&&y.closest("script, style, mark, button, [aria-hidden=\'true\']")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),u=[];for(let g=d.nextNode();g;g=d.nextNode())u.push(g);for(let g of u){if(c.length>=500)break;let y=g.data;if(l.lastIndex=0,!l.test(y))continue;l.lastIndex=0;let w=document.createDocumentFragment(),L=0;for(let R of y.matchAll(l)){w.append(y.slice(L,R.index));let M=document.createElement("mark");M.className="db-search-hl",M.textContent=R[0],w.append(M),c.push(M),L=R.index+R[0].length}w.append(y.slice(L)),g.replaceWith(w)}if(Qs(),!c.length)return;let f=((b=document.querySelector("[data-clear-highlights]"))==null?void 0:b.dataset.clearHighlights)??"Clear highlights",m=document.createElement("div");m.className="not-prose mb-4";let p=document.createElement("button");p.type="button",p.className="inline-flex h-8 items-center rounded-md border px-3 text-sm hover:bg-accent",p.textContent=f,p.addEventListener("click",()=>{var g;for(let y of c)y.replaceWith(document.createTextNode(y.textContent??""));e.normalize(),m.remove(),(g=document.getElementById("db-content"))==null||g.focus({preventScroll:!0})},{signal:i}),m.append(p),e.prepend(m),location.hash||c[0].scrollIntoView({block:"center"})}function Qs(){try{let i=new URL(location.href);i.searchParams.delete("h"),history.replaceState(history.state,"",i.toString())}catch{}}var pt=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},ee=function(t){return t.tagName==="IMG"},Js=function(t){return NodeList.prototype.isPrototypeOf(t)},ie=function(t){return t&&t.nodeType===1},tn=function(t){var e=t.currentSrc||t.src;return e.substr(-4).toLowerCase()===".svg"},en=function(t){try{return Array.isArray(t)?t.filter(ee):Js(t)?[].slice.call(t).filter(ee):ie(t)?[t].filter(ee):typeof t=="string"?[].slice.call(document.querySelectorAll(t)).filter(ee):[]}catch{throw new TypeError(`The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList or an array.\nSee: https://github.com/francoischalifour/medium-zoom`)}},to=function(t){var e=document.createElement("div");return e.classList.add("medium-zoom-overlay"),e.style.background=t,e},eo=function(t){var e=t.getBoundingClientRect(),n=e.top,s=e.left,o=e.width,r=e.height,a=t.cloneNode(),l=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,c=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return a.removeAttribute("id"),a.style.position="absolute",a.style.top=n+l+"px",a.style.left=s+c+"px",a.style.width=o+"px",a.style.height=r+"px",a.style.transform="",a},kt=function(t,e){var n=pt({bubbles:!1,cancelable:!1,detail:void 0},e);if(typeof window.CustomEvent=="function")return new CustomEvent(t,n);var s=document.createEvent("CustomEvent");return s.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),s},io=function i(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=window.Promise||function(x){function E(){}x(E,E)},s=function(x){var E=x.target;if(E===K){p();return}L.indexOf(E)!==-1&&b({target:E})},o=function(){if(!(M||!v.original)){var x=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(H-x)>O.scrollOffset&&setTimeout(p,150)}},r=function(x){var E=x.key||x.keyCode;(E==="Escape"||E==="Esc"||E===27)&&p()},a=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=x;if(x.background&&(K.style.background=x.background),x.container&&x.container instanceof Object&&(E.container=pt({},O.container,x.container)),x.template){var C=ie(x.template)?x.template:document.querySelector(x.template);E.template=C}return O=pt({},O,E),L.forEach(function(T){T.dispatchEvent(kt("medium-zoom:update",{detail:{zoom:I}}))}),I},l=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return i(pt({},O,x))},c=function(){for(var x=arguments.length,E=Array(x),C=0;C<x;C++)E[C]=arguments[C];var T=E.reduce(function(A,k){return[].concat(A,en(k))},[]);return T.filter(function(A){return L.indexOf(A)===-1}).forEach(function(A){L.push(A),A.classList.add("medium-zoom-image")}),R.forEach(function(A){var k=A.type,D=A.listener,_=A.options;T.forEach(function(P){P.addEventListener(k,D,_)})}),I},d=function(){for(var x=arguments.length,E=Array(x),C=0;C<x;C++)E[C]=arguments[C];v.zoomed&&p();var T=E.length>0?E.reduce(function(A,k){return[].concat(A,en(k))},[]):L;return T.forEach(function(A){A.classList.remove("medium-zoom-image"),A.dispatchEvent(kt("medium-zoom:detach",{detail:{zoom:I}}))}),L=L.filter(function(A){return T.indexOf(A)===-1}),I},u=function(x,E){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return L.forEach(function(T){T.addEventListener("medium-zoom:"+x,E,C)}),R.push({type:"medium-zoom:"+x,listener:E,options:C}),I},f=function(x,E){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return L.forEach(function(T){T.removeEventListener("medium-zoom:"+x,E,C)}),R=R.filter(function(T){return!(T.type==="medium-zoom:"+x&&T.listener.toString()===E.toString())}),I},m=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=x.target,C=function(){var A={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},k=void 0,D=void 0;if(O.container)if(O.container instanceof Object)A=pt({},A,O.container),k=A.width-A.left-A.right-O.margin*2,D=A.height-A.top-A.bottom-O.margin*2;else{var _=ie(O.container)?O.container:document.querySelector(O.container),P=_.getBoundingClientRect(),tt=P.width,Bt=P.height,an=P.left,ln=P.top;A=pt({},A,{width:tt,height:Bt,left:an,top:ln})}k=k||A.width-O.margin*2,D=D||A.height-O.margin*2;var Ot=v.zoomedHd||v.original,cn=tn(Ot)?k:Ot.naturalWidth||k,dn=tn(Ot)?D:Ot.naturalHeight||D,Kt=Ot.getBoundingClientRect(),un=Kt.top,hn=Kt.left,ne=Kt.width,se=Kt.height,fn=Math.min(Math.max(ne,cn),k)/ne,mn=Math.min(Math.max(se,dn),D)/se,oe=Math.min(fn,mn),pn=(-hn+(k-ne)/2+O.margin+A.left)/oe,gn=(-un+(D-se)/2+O.margin+A.top)/oe,Oe="scale("+oe+") translate3d("+pn+"px, "+gn+"px, 0)";v.zoomed.style.transform=Oe,v.zoomedHd&&(v.zoomedHd.style.transform=Oe)};return new n(function(T){if(E&&L.indexOf(E)===-1){T(I);return}var A=function tt(){M=!1,v.zoomed.removeEventListener("transitionend",tt),v.original.dispatchEvent(kt("medium-zoom:opened",{detail:{zoom:I}})),T(I)};if(v.zoomed){T(I);return}if(E)v.original=E;else if(L.length>0){var k=L;v.original=k[0]}else{T(I);return}if(v.original.dispatchEvent(kt("medium-zoom:open",{detail:{zoom:I}})),H=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,M=!0,v.zoomed=eo(v.original),document.body.appendChild(K),O.template){var D=ie(O.template)?O.template:document.querySelector(O.template);v.template=document.createElement("div"),v.template.appendChild(D.content.cloneNode(!0)),document.body.appendChild(v.template)}if(v.original.parentElement&&v.original.parentElement.tagName==="PICTURE"&&v.original.currentSrc&&(v.zoomed.src=v.original.currentSrc),document.body.appendChild(v.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),v.original.classList.add("medium-zoom-image--hidden"),v.zoomed.classList.add("medium-zoom-image--opened"),v.zoomed.addEventListener("click",p),v.zoomed.addEventListener("transitionend",A),v.original.getAttribute("data-zoom-src")){v.zoomedHd=v.zoomed.cloneNode(),v.zoomedHd.removeAttribute("srcset"),v.zoomedHd.removeAttribute("sizes"),v.zoomedHd.removeAttribute("loading"),v.zoomedHd.src=v.zoomed.getAttribute("data-zoom-src"),v.zoomedHd.onerror=function(){clearInterval(_),console.warn("Unable to reach the zoom image target "+v.zoomedHd.src),v.zoomedHd=null,C()};var _=setInterval(function(){v.zoomedHd.complete&&(clearInterval(_),v.zoomedHd.classList.add("medium-zoom-image--opened"),v.zoomedHd.addEventListener("click",p),document.body.appendChild(v.zoomedHd),C())},10)}else if(v.original.hasAttribute("srcset")){v.zoomedHd=v.zoomed.cloneNode(),v.zoomedHd.removeAttribute("sizes"),v.zoomedHd.removeAttribute("loading");var P=v.zoomedHd.addEventListener("load",function(){v.zoomedHd.removeEventListener("load",P),v.zoomedHd.classList.add("medium-zoom-image--opened"),v.zoomedHd.addEventListener("click",p),document.body.appendChild(v.zoomedHd),C()})}else C()})},p=function(){return new n(function(x){if(M||!v.original){x(I);return}var E=function C(){v.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(v.zoomed),v.zoomedHd&&document.body.removeChild(v.zoomedHd),document.body.removeChild(K),v.zoomed.classList.remove("medium-zoom-image--opened"),v.template&&document.body.removeChild(v.template),M=!1,v.zoomed.removeEventListener("transitionend",C),v.original.dispatchEvent(kt("medium-zoom:closed",{detail:{zoom:I}})),v.original=null,v.zoomed=null,v.zoomedHd=null,v.template=null,x(I)};M=!0,document.body.classList.remove("medium-zoom--opened"),v.zoomed.style.transform="",v.zoomedHd&&(v.zoomedHd.style.transform=""),v.template&&(v.template.style.transition="opacity 150ms",v.template.style.opacity=0),v.original.dispatchEvent(kt("medium-zoom:close",{detail:{zoom:I}})),v.zoomed.addEventListener("transitionend",E)})},b=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=x.target;return v.original?p():m({target:E})},g=function(){return O},y=function(){return L},w=function(){return v.original},L=[],R=[],M=!1,H=0,O=e,v={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(t)==="[object Object]"?O=t:(t||typeof t=="string")&&c(t),O=pt({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},O);var K=to(O.background);document.addEventListener("click",s),document.addEventListener("keyup",r),document.addEventListener("scroll",o),window.addEventListener("resize",p);var I={open:m,close:p,toggle:b,update:a,clone:l,attach:c,detach:d,on:u,off:f,getOptions:g,getImages:y,getZoomedImage:w};return I};function no(i,t){t===void 0&&(t={});var e=t.insertAt;if(!(!i||typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",e==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i))}}var so=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";no(so);var nn=io;var oo;function sn(i){let t=document.body.dataset.imageZoom;if(!t)return;let e;try{e=JSON.parse(t)}catch{return}let n=[...document.querySelectorAll(\'img[data-zoomable="true"]\')];if(!n.length)return;let s=oo??(oo=nn());s.update(e),s.attach(...n),i==null||i.addEventListener("abort",()=>{s.close(),s.detach(...n)});let o={signal:i},r=!1,a=l=>l.key==="Enter"||l.key===" ";for(let l of n)l.alt&&(l.tabIndex=0,l.addEventListener("keydown",c=>{a(c)&&(c.preventDefault(),r=!0,s.open({target:l}))},o),l.addEventListener("medium-zoom:opened",()=>{let c=document.querySelector(".medium-zoom-image--opened");!r||!c||(c.tabIndex=-1,c.addEventListener("keydown",d=>{a(d)&&(d.preventDefault(),s.close())}),c.focus())},o),l.addEventListener("medium-zoom:closed",()=>{r&&l.focus(),r=!1},o))}function Ce(i){return!/^[\\x00-\\x20]*([a-z][a-z0-9+.-]*:|[\\\\/])/i.test(i.replace(/[\\t\\n\\r]/g,""))}var Le=new Map;function rn(i){let t=Le.get(i);return t||(t=new Promise((e,n)=>{let s=document.createElement("script");s.src=i,s.onload=()=>e(),s.onerror=()=>{Le.delete(i),n(new Error(`could not load ${i}`))},document.head.appendChild(s)}),Le.set(i,t)),t}function ro(i){document.querySelectorAll("[data-component=\'theme-toggle\']").forEach(t=>{let e=()=>t.setAttribute("aria-pressed",String(document.documentElement.classList.contains("dark")));e(),t.addEventListener("click",()=>{let n=!document.documentElement.classList.contains("dark");document.documentElement.classList.toggle("dark",n);try{localStorage.setItem("theme",n?"dark":"light")}catch{}e()},{signal:i})})}function ao(i){document.addEventListener("click",async t=>{var s,o,r,a;let e=t.target.closest("[data-copy-markdown]");if(!e)return;let n=(((s=document.getElementById("db-page-markdown"))==null?void 0:s.textContent)??"").replace(/<\\\\\\/(script)/gi,"</$1").replace(/<\\\\!--/g,"<!--");try{await navigator.clipboard.writeText(n);let l=(o=e.dataset).label??(o.label=e.textContent??"");e.textContent="Copied",clearTimeout(Number(e.dataset.timer)),e.dataset.timer=String(setTimeout(()=>e.textContent=l,1500))}catch{}(a=(r=e.closest("db-popover"))==null?void 0:r.close)==null||a.call(r,"close-press")},{signal:i})}function lo(i,t){let e=document.body.dataset.page??"index.html";document.querySelectorAll("select[data-db-switch]").forEach(n=>{n.addEventListener("change",async()=>{var a;let s=n.selectedOptions[0],o=(s==null?void 0:s.dataset.prefix)??"",r=n.value;if(!(!Ce(r)||!Ce(o)))try{let l=o?`${i}${o}/`:i;await rn(`${l}_dogsbay/pages.js`);let c=(a=window.__DOGSBAY_PAGES__)==null?void 0:a[o];location.href=c&&!c.includes(e)?`${l}index.html`:r}catch{location.href=r}},{signal:t})})}function co(i){document.addEventListener("click",t=>{var n;let e=t.target.closest("a.db-anchor");!e||location.protocol==="file:"||(n=navigator.clipboard)==null||n.writeText(e.href).catch(()=>{})},{signal:i})}var ke=new Set;function on(){for(let i of ke)i.isConnected||ft(i)}function uo(){document.querySelectorAll("[data-component=\'sidebar-provider\']").forEach(i=>{we(i),ke.add(i)}),document.removeEventListener("keydown",on),document.addEventListener("keydown",on)}var Tt;function Te(i={}){Tt==null||Tt.unmount();let t=new AbortController,{signal:e}=t,n=document.body,s=n.dataset.unitRoot??"",o=n.dataset.siteRoot??"";i.nav!==void 0&&(window.__DOGSBAY_NAV__=i.nav),uo(),i.theme!==!1&&ro(e),ao(e),i.switchers!==!1&&lo(o,e),co(e),i.search!==!1&&Zi({unitRoot:s,loadScript:rn,signal:e}),Ji(e),sn(e);let r={unmount(){if(!e.aborted){t.abort();for(let a of ke)ft(a);Tt===r&&(Tt=void 0)}}};return Tt=r}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Te()):Te();})();\n';
|
|
942
|
+
var CLIENT_JS = '/*! dogsbay-ssg site client (Apache-2.0). Third-party notices: THIRD-PARTY-NOTICES.txt */\n"use strict";(()=>{var vn=Object.defineProperty;var yn=(i,t,e)=>t in i?vn(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var h=(i,t,e)=>yn(i,typeof t!="symbol"?t+"":t,e);var z=class extends HTMLElement{constructor(){super(...arguments);h(this,"_initialized",!1);h(this,"_deferred",!1)}connectedCallback(){if(!this._initialized&&!this.firstElementChild&&typeof document<"u"&&document.readyState==="loading"){this._deferred||(this._deferred=!0,document.addEventListener("DOMContentLoaded",()=>{this._deferred=!1,this.isConnected&&this.connectedCallback()},{once:!0}));return}this._initialized||(this.setup(),this._initialized=!0),this.connect()}disconnectedCallback(){this.disconnect()}setup(){}connect(){}disconnect(){}},wn={"db-tabs":"block","db-accordion":"block","db-collapsible":"block","db-details-sheet":"block","db-card":"block","db-steps":"block","db-code-block":"block","db-link-button":"inline-block","db-dialog":"contents","db-popover":"inline-block","db-tooltip":"inline-block","db-select":"inline-block","db-combobox":"block","db-nav-tree":"block","db-toc":"block"},Ie="dogsbay-elements-display";function N(){if(typeof document>"u"||document.getElementById(Ie))return;let i=Object.entries(wn).map(([e,n])=>`:where(${e}){display:${n}}`).join(""),t=document.createElement("style");t.id=Ie,t.textContent=i,document.head.prepend(t)}function En(i){return i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"}function gt(i,t,e){let n=t;do n+=e?-1:1;while(n>=0&&n<i.length&&En(i[n]));return n}var Dt=class{constructor(i,t,e={}){h(this,"container");h(this,"itemSelector");h(this,"opts");h(this,"keydownHandler",null);h(this,"active",!1);this.container=i,this.itemSelector=t,this.opts={orientation:e.orientation??"horizontal",loop:e.loop??!0,homeEnd:e.homeEnd??!0,onHighlightedIndexChange:e.onHighlightedIndexChange??(()=>{})}}getItems(){return Array.from(this.container.querySelectorAll(this.itemSelector))}isForwardKey(i,t){let{orientation:e}=this.opts;return(e==="horizontal"||e==="both")&&i===(t?"ArrowLeft":"ArrowRight")||(e==="vertical"||e==="both")&&i==="ArrowDown"}isBackwardKey(i,t){let{orientation:e}=this.opts;return(e==="horizontal"||e==="both")&&i===(t?"ArrowRight":"ArrowLeft")||(e==="vertical"||e==="both")&&i==="ArrowUp"}activate(){this.active||(this.active=!0,this.keydownHandler=i=>{let t=this.getItems();if(t.length===0||i.ctrlKey||i.altKey||i.metaKey)return;let e=getComputedStyle(this.container).direction==="rtl",n=t.indexOf(document.activeElement);if(n===-1)return;let s=null;this.isForwardKey(i.key,e)?(s=gt(t,n,!1),s>=t.length&&(s=this.opts.loop?gt(t,-1,!1):n)):this.isBackwardKey(i.key,e)?(s=gt(t,n,!0),s<0&&(s=this.opts.loop?gt(t,t.length,!0):n)):this.opts.homeEnd&&i.key==="Home"?s=gt(t,-1,!1):this.opts.homeEnd&&i.key==="End"&&(s=gt(t,t.length,!0)),s!==null&&(s<0||s>=t.length||s!==n&&(i.preventDefault(),t[n].setAttribute("tabindex","-1"),t[s].setAttribute("tabindex","0"),t[s].focus(),this.opts.onHighlightedIndexChange(s)))},this.container.addEventListener("keydown",this.keydownHandler))}deactivate(){this.active&&(this.active=!1,this.keydownHandler&&(this.container.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null))}setActiveIndex(i,t){i.forEach((e,n)=>{e.setAttribute("tabindex",n===t?"0":"-1")})}isActive(){return this.active}};var xn=0;function Me(i){return`${i}-${++xn}`}var He=class extends z{constructor(){super(...arguments);h(this,"list");h(this,"triggers",[]);h(this,"panels",[]);h(this,"nav",null);h(this,"value","");h(this,"syncKey",null);h(this,"orientation","horizontal");h(this,"handleClick",t=>{let e=t.target.closest("[data-part=\'trigger\']");if(!e||e.hasAttribute("disabled"))return;let n=e.dataset.value;n&&this.select(n)});h(this,"handleStorage",t=>{if(!this.syncKey||t.key!==`db-tabs-sync:${this.syncKey}`)return;let e=t.newValue;e&&this.value!==e&&this.has(e)&&this.select(e)});h(this,"handleSyncEvent",(t=>{let e=t.detail.value;e&&this.value!==e&&this.has(e)&&this.select(e)}))}has(t){return this.triggers.some(e=>e.dataset.value===t)}own(t){return Array.from(this.querySelectorAll(t)).filter(e=>e.closest("db-tabs")===this)}setup(){var o;let t=this.own("[data-part=\'list\']")[0]??null;if(!t)return;this.list=t,this.triggers=this.own("[data-part=\'trigger\']"),this.panels=this.own("[data-part=\'content\']"),this.orientation=this.getAttribute("orientation")||"horizontal",this.syncKey=this.getAttribute("sync-key")||null,t.setAttribute("role","tablist"),t.setAttribute("aria-orientation",this.orientation),this.triggers.forEach(r=>{let a=r.dataset.value;r.setAttribute("role","tab");let l=r.id||Me("db-tab");r.id=l;let c=this.panels.find(d=>d.dataset.value===a);if(c){c.setAttribute("role","tabpanel");let d=c.id||Me("db-tabpanel");c.id=d,r.setAttribute("aria-controls",d),c.setAttribute("aria-labelledby",l)}}),this.nav=new Dt(t,"[data-part=\'trigger\']",{orientation:this.orientation,loop:!0,homeEnd:!0,onHighlightedIndexChange:()=>{var l;let r=document.activeElement,a=(l=r==null?void 0:r.dataset)==null?void 0:l.value;a&&this.select(a)}}),this.nav.activate();let n=this.getAttribute("default-value")||((o=this.triggers[0])==null?void 0:o.dataset.value)||"";if(this.syncKey){let r=localStorage.getItem(`db-tabs-sync:${this.syncKey}`);r&&this.triggers.some(a=>a.dataset.value===r)&&(n=r)}let s=window.location.hash.slice(1);s&&this.triggers.some(r=>r.dataset.value===s)&&(n=s),this.select(n)}connect(){var t;(t=this.list)==null||t.addEventListener("click",this.handleClick),this.syncKey&&(window.addEventListener("storage",this.handleStorage),document.addEventListener(`db-tabs-sync:${this.syncKey}`,this.handleSyncEvent))}disconnect(){var t;(t=this.list)==null||t.removeEventListener("click",this.handleClick),this.syncKey&&(window.removeEventListener("storage",this.handleStorage),document.removeEventListener(`db-tabs-sync:${this.syncKey}`,this.handleSyncEvent))}select(t){this.value!==t&&(this.value=t,this.triggers.forEach(e=>{let n=e.dataset.value===t;e.setAttribute("aria-selected",String(n)),e.setAttribute("tabindex",n?"0":"-1"),n?e.setAttribute("data-state","active"):e.removeAttribute("data-state")}),this.panels.forEach(e=>{let n=e.dataset.value===t;e.hidden=!n,n?(e.setAttribute("data-state","active"),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0")):e.removeAttribute("data-state")}),this.syncKey&&(localStorage.setItem(`db-tabs-sync:${this.syncKey}`,t),document.dispatchEvent(new CustomEvent(`db-tabs-sync:${this.syncKey}`,{detail:{value:t,source:this}}))),this.dispatchEvent(new CustomEvent("db-tabs:change",{detail:{value:t},bubbles:!0})))}};N();customElements.get("db-tabs")||customElements.define("db-tabs",He);var An=0;function Sn(i){return`${i}-${++An}`}var ze=class{constructor(i,t,e={}){h(this,"trigger");h(this,"content");h(this,"_open",!1);h(this,"opts");this.trigger=i,this.content=t,this.opts=e;let n=Sn("base-collapsible");i.id||(i.id=`${n}-trigger`),t.id||(t.id=`${n}-content`),i.setAttribute("aria-controls",t.id),t.setAttribute("aria-labelledby",i.id),t.setAttribute("role","region"),i.setAttribute("aria-expanded","false"),i.addEventListener("click",()=>{i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"||this.toggle()})}get isOpen(){return this._open}toggle(){this._open?this.collapse():this.expand()}expand(){var i,t;this._open||(this._open=!0,this.trigger.setAttribute("aria-expanded","true"),this.content.hidden=!1,this.content.setAttribute("data-state","open"),(t=(i=this.opts).onToggle)==null||t.call(i,!0))}collapse(){var i,t;this._open&&(this._open=!1,this.trigger.setAttribute("aria-expanded","false"),this.content.hidden=!0,this.content.removeAttribute("data-state"),(t=(i=this.opts).onToggle)==null||t.call(i,!1))}};var Ne=class extends z{constructor(){super(...arguments);h(this,"items",[]);h(this,"nav",null);h(this,"openValues",new Set);h(this,"type","single")}setup(){this.type=this.getAttribute("type")||"single";let t=this.getAttribute("default-value")||"",e=t?t.split(","):[],n=Array.from(this.querySelectorAll("[data-part=\'item\']"));this.items=n.map(s=>{let o=s.querySelector("[data-part=\'trigger\']"),r=s.querySelector("[data-part=\'content\']");if(!o||!r)return null;let a=s.dataset.value||"",l=s.hasAttribute("data-disabled");l&&(o.setAttribute("disabled",""),o.setAttribute("aria-disabled","true"));let c=new ze(o,r,{onToggle:d=>{d?this.onItemExpanded(a):this.onItemCollapsed(a)}});return{el:s,value:a,collapsible:c,disabled:l}}).filter(Boolean),this.nav=new Dt(this,"[data-part=\'trigger\']",{orientation:"vertical",loop:!0,homeEnd:!0}),this.nav.activate(),this.items.forEach((s,o)=>{s.collapsible.trigger.setAttribute("tabindex",o===0?"0":"-1")}),e.forEach(s=>{let o=this.items.find(r=>r.value===s&&!r.disabled);o&&o.collapsible.expand()})}onItemExpanded(t){if(this.type==="single"){for(let n of this.openValues)if(n!==t){let s=this.items.find(o=>o.value===n);s&&s.collapsible.collapse()}}this.openValues.add(t);let e=this.items.find(n=>n.value===t);e&&e.el.setAttribute("data-state","open"),this.dispatchEvent(new CustomEvent("db-accordion:change",{detail:{value:t,open:!0,openValues:[...this.openValues]},bubbles:!0}))}onItemCollapsed(t){this.openValues.delete(t);let e=this.items.find(n=>n.value===t);e&&e.el.removeAttribute("data-state"),this.dispatchEvent(new CustomEvent("db-accordion:change",{detail:{value:t,open:!1,openValues:[...this.openValues]},bubbles:!0}))}};N();customElements.get("db-accordion")||customElements.define("db-accordion",Ne);var Cn=0;function F(i){return`${i}-${++Cn}`}function et(i,t){let e=i.localName;return Array.from(i.querySelectorAll(t)).filter(n=>n.closest(e)===i)}function $(i,t){return et(i,t)[0]??null}function bt(i){if(!i||!i.hasAttribute("data-as-child"))return i;let t=i.firstElementChild;if(!t)return i;let e=i.getAttribute("data-part");return e&&t.setAttribute("data-part",e),t}function W(i){return i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"||i.getAttribute("data-disabled")==="true"}function _e(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype.showPopover=="function"}function vt(i){if(i.hidden=!1,!_e())return"inline";i.hasAttribute("popover")||i.setAttribute("popover","manual"),i.style.inset="auto",i.style.margin="0";try{i.matches(":popover-open")||i.showPopover()}catch{return"inline"}return"top-layer"}function yt(i){if(_e())try{i.matches(":popover-open")&&i.hidePopover()}catch{}i.hidden=!0}var Ln=\'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]\';function Pe(i){return Array.from(i.querySelectorAll(Ln)).filter(t=>!t.closest("[hidden]")&&!W(t))}function Fe(i,t){let e=typeof i.getAnimations=="function"?i.getAnimations():[];if(!e.length)return t();Promise.all(e.map(n=>n.finished)).then(t,t)}function wt(i){try{return decodeURIComponent(i)}catch{return i}}var Be=class extends z{constructor(){super(...arguments);h(this,"details",null);h(this,"summary",null);h(this,"dialog",null);h(this,"body",null);h(this,"source",null);h(this,"moved",[]);h(this,"handledHash",null);h(this,"onSummaryClick",t=>{var n,s;let e=t.target;e&&e!==this.summary&&((s=(n=e.closest)==null?void 0:n.call(e,"a[href], button, input, select, textarea, label"))==null?void 0:s.closest("summary"))===this.summary||(t.preventDefault(),this.show())});h(this,"onDialogClick",t=>{let e=this.dialog;if(!e||t.target!==e)return;let n=e.getBoundingClientRect();!(t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom)&&(t.clientX!==0||t.clientY!==0)&&e.close()});h(this,"onDialogClose",()=>this.restore());h(this,"onDocClick",t=>{var o,r;if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=(r=(o=t.target)==null?void 0:o.closest)==null?void 0:r.call(o,"a[href]");if(!e||!this.details||this.open||e.hasAttribute("download")||e.target&&e.target!=="_self")return;let n=new URL(e.href,location.href);if(!n.hash||n.hash!==location.hash||n.pathname!==location.pathname||n.search!==location.search)return;let s=document.getElementById(wt(n.hash.slice(1)));if(!(!s||!this.details.contains(s))){for(let a of this.details.querySelectorAll("db-details-sheet"))a.handledHash=null;this.show(s)}});h(this,"onHash",()=>{this.handledHash=null,this.openForHash()})}get open(){var t;return!!((t=this.dialog)!=null&&t.open)}setup(){var d;let t=Array.from(this.children).find(u=>u.tagName==="DETAILS")??null,e=t?Array.from(t.children).find(u=>u.tagName==="SUMMARY")??null:null,n=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function";if(!t||!e||!n)return;for(let u of Array.from(t.children))u.getAttribute("role")==="status"&&u.setAttribute("aria-live","off");this.details=t,this.summary=e,t.open=!1,kn();let s=(((d=e.querySelector("[data-part=\'title\']"))==null?void 0:d.textContent)??e.textContent??"").trim(),o=document.createElement("dialog");o.className="db-sheet",o.id=F("db-sheet");let r=document.createElement("h2");r.className="db-sheet-title",r.id=F("db-sheet-title"),r.textContent=s,o.setAttribute("aria-labelledby",r.id);let a=document.createElement("button");a.type="button",a.className="db-sheet-close",a.setAttribute("aria-label",this.getAttribute("close-label")||"Close"),a.innerHTML=\'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\',a.addEventListener("click",()=>o.close());let l=document.createElement("div");l.className="db-sheet-header",l.append(r,a);let c=document.createElement("div");c.className="db-sheet-body",o.append(l,c),this.append(o),this.dialog=o,this.body=c,e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-controls",o.id),e.setAttribute("aria-expanded","false"),this.setAttribute("data-state","closed")}connect(){this.dialog&&(this.summary.addEventListener("click",this.onSummaryClick),this.dialog.addEventListener("click",this.onDialogClick),this.dialog.addEventListener("close",this.onDialogClose),window.addEventListener("hashchange",this.onHash),document.addEventListener("click",this.onDocClick),queueMicrotask(()=>this.isConnected&&this.openForHash()))}disconnect(){this.dialog&&(this.dialog.open&&this.dialog.close(),this.restore(!1),this.summary.removeEventListener("click",this.onSummaryClick),this.dialog.removeEventListener("click",this.onDialogClick),this.dialog.removeEventListener("close",this.onDialogClose),window.removeEventListener("hashchange",this.onHash),document.removeEventListener("click",this.onDocClick))}show(t){var l;let{dialog:e,details:n,body:s}=this;if(!e||!n||!s||e.open)return;let o=Array.from(n.childNodes).filter(c=>c!==this.summary),r=o.filter(c=>c.nodeType===Node.ELEMENT_NODE),a=r.length===1&&o.every(c=>{var d;return c===r[0]||!((d=c.textContent)!=null&&d.trim())})?r[0]:null;this.source=a??n,this.moved=a?Array.from(a.childNodes):o,s.append(...this.moved),e.showModal(),this.summary.setAttribute("aria-expanded","true"),this.setAttribute("data-state","open"),t&&t!==n&&((l=t.scrollIntoView)==null||l.call(t,{block:"start"})),this.dispatchEvent(new CustomEvent("db-details-sheet:open",{bubbles:!0}))}close(){var t;(t=this.dialog)==null||t.close()}restore(t=!0){var e,n;this.source&&(this.source.append(...this.moved),this.source=null,this.moved=[],this.summary.setAttribute("aria-expanded","false"),this.setAttribute("data-state","closed"),t&&this.isConnected&&((n=(e=this.summary).checkVisibility)==null?void 0:n.call(e))!==!1&&this.summary.focus(),this.dispatchEvent(new CustomEvent("db-details-sheet:close",{bubbles:!0})))}openForHash(){let t=wt(location.hash.slice(1));if(!t||!this.details||this.handledHash===location.hash||(this.handledHash=location.hash,this.open))return;let e=document.getElementById(t);e&&this.details.contains(e)&&this.show(e)}},$e="dogsbay-details-sheet";function kn(){if(document.getElementById($e))return;let i=document.createElement("style");i.id=$e,i.textContent=["dialog.db-sheet{position:fixed;inset:0 0 0 auto;margin:0;height:100dvh;max-height:none;width:min(32rem,100vw);max-width:100vw;padding:0;border:0;border-left:1px solid var(--border);background:var(--background);color:var(--foreground);box-shadow:0 10px 15px -3px rgb(0 0 0/.1),0 4px 6px -4px rgb(0 0 0/.1);flex-direction:column}","dialog.db-sheet[open]{display:flex}","dialog.db-sheet::backdrop{background:rgb(0 0 0/.6)}",".db-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.5rem;border-bottom:1px solid var(--border)}","dialog.db-sheet h2.db-sheet-title{margin:0;padding:0;border:0;font-size:1.125rem;line-height:1.75rem;font-weight:600;scroll-margin:0}",".db-sheet-close{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;border-radius:.375rem;background:transparent;color:var(--muted-foreground);cursor:pointer}",".db-sheet-close:hover{background:var(--accent,var(--muted));color:var(--foreground)}",".db-sheet-close:focus-visible{outline:2px solid var(--ring);outline-offset:2px}",".db-sheet-body{flex:1;overflow-y:auto;padding:1.5rem;font-size:.875rem;line-height:1.625}","dialog.db-sheet .db-sheet-body>:first-child{margin-top:0}","html:has(dialog.db-sheet[open]){overflow:hidden}","db-details-sheet>details>summary>span:last-child{transform:rotate(-90deg)}","@media (prefers-reduced-motion:no-preference){dialog.db-sheet[open]{animation:db-sheet-in .2s ease-out}dialog.db-sheet[open]::backdrop{animation:db-sheet-fade .2s ease-out}}","@keyframes db-sheet-in{from{transform:translateX(100%)}}","@keyframes db-sheet-fade{from{opacity:0}}"].join(""),document.head.append(i)}N();customElements.get("db-details-sheet")||customElements.define("db-details-sheet",Be);var qe=class extends z{constructor(){super(...arguments);h(this,"copyBtn",null);h(this,"copyIcon",null);h(this,"checkIcon",null);h(this,"liveRegion",null);h(this,"resetTimeout",null);h(this,"handleCopy",async()=>{let t=this.getCopyText();if(t)try{await navigator.clipboard.writeText(t),this.showCopiedFeedback(),this.dispatchEvent(new CustomEvent("db-code-block:copied",{detail:{text:t},bubbles:!0}))}catch{}})}setup(){this.copyBtn=this.querySelector("[data-part=\'copy\']"),this.copyIcon=this.querySelector("[data-part=\'copy-icon\']"),this.checkIcon=this.querySelector("[data-part=\'check-icon\']"),this.copyBtn&&!this.copyBtn.hasAttribute("aria-label")&&this.copyBtn.setAttribute("aria-label","Copy code"),this.liveRegion=document.createElement("span"),this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("role","status"),this.liveRegion.className="sr-only",this.liveRegion.style.position="absolute",this.liveRegion.style.width="1px",this.liveRegion.style.height="1px",this.liveRegion.style.overflow="hidden",this.liveRegion.style.clip="rect(0, 0, 0, 0)",this.liveRegion.style.whiteSpace="nowrap",this.appendChild(this.liveRegion)}connect(){var t;(t=this.copyBtn)==null||t.addEventListener("click",this.handleCopy)}disconnect(){var t;(t=this.copyBtn)==null||t.removeEventListener("click",this.handleCopy),this.clearResetTimeout()}getCopyText(){let t=this.getAttribute("data-copy-text");if(t)return t;let e=this.querySelector("[data-part=\'code\'] code");if(e)return e.textContent??"";let n=this.querySelector("[data-part=\'code\']");return(n==null?void 0:n.textContent)??""}showCopiedFeedback(){this.clearResetTimeout(),this.copyIcon&&(this.copyIcon.hidden=!0),this.checkIcon&&(this.checkIcon.hidden=!1),this.setAttribute("data-state","copied"),this.liveRegion&&(this.liveRegion.textContent="Copied!"),this.resetTimeout=setTimeout(()=>{this.copyIcon&&(this.copyIcon.hidden=!1),this.checkIcon&&(this.checkIcon.hidden=!0),this.removeAttribute("data-state"),this.liveRegion&&(this.liveRegion.textContent=""),this.resetTimeout=null},2e3)}clearResetTimeout(){this.resetTimeout!==null&&(clearTimeout(this.resetTimeout),this.resetTimeout=null)}};N();customElements.get("db-code-block")||customElements.define("db-code-block",qe);var Ke=class extends z{constructor(){super(...arguments);h(this,"navData",null);h(this,"onClick",t=>{let e=t.target.closest("[data-part=\'toggle\']");if(!e||e.closest("db-nav-tree")!==this)return;let n=e.closest("[data-part=\'item\']");n&&this.toggle(n)});h(this,"onKey",t=>{var c,d;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;let e=document.activeElement;if(!e||!this.contains(e))return;let n=this.visibleRows(),s=e.closest("[data-part=\'row\']"),o=s?n.indexOf(s):-1;if(o<0)return;let r=s.closest("[data-part=\'item\']"),a=!!this.groupOf(r),l=u=>{var f;u&&(t.preventDefault(),(f=this.primary(u))==null||f.focus())};switch(t.key){case"ArrowDown":return l(n[o+1]);case"ArrowUp":return l(n[o-1]);case"Home":return l(n[0]);case"End":return l(n[n.length-1]);case"ArrowRight":if(!a)return;t.preventDefault(),this.isOpen(r)?l(this.visibleRows()[o+1]):this.setOpen(r,!0);return;case"ArrowLeft":{if(t.preventDefault(),a&&this.isOpen(r))return this.setOpen(r,!1);let u=(c=r.parentElement)==null?void 0:c.closest("[data-part=\'item\']");if(u&&this.contains(u)){let f=u.querySelector(":scope > [data-part=\'row\']");f&&((d=this.primary(f))==null||d.focus())}return}}})}setup(){for(let t of et(this,"[data-part=\'item\']"))this.prepareItem(t)}connect(){this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKey);for(let t of et(this,"[data-part=\'group\'][data-lazy]")){let e=t.closest("[data-part=\'item\']");e&&this.isOpen(e)&&this.fill(t)}this.hasAttribute("scroll-current")&&requestAnimationFrame(()=>this.revealCurrent())}disconnect(){this.removeEventListener("click",this.onClick),this.removeEventListener("keydown",this.onKey)}prepareItem(t){let e=this.groupOf(t),n=t.querySelector(":scope > [data-part=\'row\'] > [data-part=\'toggle\']");if(!e||!n)return;e.id||(e.id=F("db-nav-group")),n.setAttribute("aria-controls",e.id),n instanceof HTMLButtonElement&&!n.hasAttribute("type")&&(n.type="button");let s=n.getAttribute("aria-expanded")==="true"||t.getAttribute("data-state")==="open";this.apply(t,s)}groupOf(t){return t.querySelector(":scope > [data-part=\'group\']")}toggleOf(t){return t.querySelector(":scope > [data-part=\'row\'] > [data-part=\'toggle\']")}primary(t){return t.querySelector(":scope > [data-part=\'link\']")??t.querySelector(":scope > [data-part=\'toggle\']")}visibleRows(){return et(this,"[data-part=\'row\']").filter(t=>!t.closest("[hidden]"))}isOpen(t){return t.getAttribute("data-state")==="open"}toggle(t){this.setOpen(t,!this.isOpen(t))}setOpen(t,e){let n=this.groupOf(t);!n||this.isOpen(t)===e||(e&&n.hasAttribute("data-lazy")&&this.fill(n),this.apply(t,e),this.dispatchEvent(new CustomEvent("db-nav-tree:toggle",{detail:{item:t,open:e},bubbles:!0})))}apply(t,e){let n=this.groupOf(t),s=this.toggleOf(t);n&&(n.hidden=!e),s==null||s.setAttribute("aria-expanded",String(e)),t.setAttribute("data-state",e?"open":"closed")}revealCurrent(){var o;let t=this.querySelector("[aria-current=\'page\']");if(!t)return;for(let r=t.closest("[data-part=\'item\']");r&&this.contains(r);r=((o=r.parentElement)==null?void 0:o.closest("[data-part=\'item\']"))??null)this.groupOf(r)&&!this.groupOf(r).contains(t)||this.groupOf(r)&&this.setOpen(r,!0);let e=On(this);if(!e)return;let n=t.getBoundingClientRect(),s=e.getBoundingClientRect();(n.top<s.top||n.bottom>s.bottom)&&(e.scrollTop+=n.top-s.top-s.height/2+n.height/2)}data(){if(this.navData)return this.navData;let t=this.getAttribute("data-source"),e=t?globalThis[t]:void 0;return Array.isArray(e)?e:null}fill(t){let e=this.data(),n=t.dataset.path;if(!e||n==null)return;let s=e,o;for(let r of n.split(".").map(Number))o=s==null?void 0:s[r],s=o==null?void 0:o[2];o!=null&&o[2]&&(t.replaceChildren(...this.build(o[2],n)),t.removeAttribute("data-lazy"))}build(t,e){let n=this.getAttribute("base")??"",s=this.getAttribute("toggle-label")??"Toggle {label}",o=location.href.split("#")[0];return t.map(([r,a,l,c],d)=>{let u=`${e}.${d}`,f=document.createElement("li");f.setAttribute("data-part","item"),f.style.setProperty("--db-level",String(u.split(".").length-1));let m=document.createElement("div");m.setAttribute("data-part","row"),f.appendChild(m);let p=(a==null?void 0:a.replace(/[\\u0000-\\u0020]/g,""))??"";a!=null&&/^[a-z][a-z0-9+.-]*:/i.test(p)&&!/^(?:https?|mailto):/i.test(p)&&(a=null);let b=a!=null&&/^[a-z][a-z0-9+.-]*:|^\\/\\//i.test(p),g=null;if(l!=null&&l.length){if(g=document.createElement("button"),g.type="button",g.setAttribute("data-part","toggle"),g.setAttribute("aria-expanded","false"),a!=null)g.setAttribute("aria-label",s.replace("{label}",()=>r));else{let w=document.createElement("span");w.setAttribute("data-part","label"),w.textContent=r,g.appendChild(w)}g.insertAdjacentHTML("beforeend",Tn)}let y=this.getAttribute("toggle-position")==="end";if(g&&!y&&m.appendChild(g),a!=null){let w=document.createElement("a");w.setAttribute("data-part","link"),w.textContent=r,w.href=b?a:n+a,b&&(w.rel="noopener"),!c&&w.href.split("#")[0]===o&&w.setAttribute("aria-current","page"),m.appendChild(w)}if(a==null&&!(l!=null&&l.length)){let w=document.createElement("span");w.setAttribute("data-part","label"),w.textContent=r,m.appendChild(w)}if(g&&y&&m.appendChild(g),l!=null&&l.length){let w=document.createElement("ul");w.setAttribute("data-part","group"),w.dataset.lazy="",w.dataset.path=u,w.hidden=!0,f.setAttribute("data-state","closed"),f.appendChild(w),this.prepareItem(f)}return f})}},Tn=\'<svg data-part="chevron" viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false"><path d="m9 18 6-6-6-6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>\';function On(i){for(let t=i.parentElement;t;t=t.parentElement){let e=getComputedStyle(t).overflowY;if((e==="auto"||e==="scroll")&&t.scrollHeight>t.clientHeight)return t}return null}N();customElements.get("db-nav-tree")||customElements.define("db-nav-tree",Ke);var We=class extends z{constructor(){super(...arguments);h(this,"links",[]);h(this,"headings",[]);h(this,"observer",null);h(this,"active",null);h(this,"onScroll",()=>{let t=document.documentElement;window.innerHeight+window.scrollY>=t.scrollHeight-2&&this.headings.length&&this.setActive(this.headings[this.headings.length-1].id)});h(this,"onHash",()=>{let t=wt(location.hash.slice(1));t&&this.headings.some(e=>e.id===t)&&this.setActive(t)})}slugOf(t){return t.getAttribute("data-toc-slug")??wt(t.getAttribute("href").slice(1))}setup(){this.links=Array.from(this.querySelectorAll("a[href^=\'#\'], a[data-toc-link]"))}connect(){var e;if(this.headings=this.links.map(n=>document.getElementById(this.slugOf(n))).filter(n=>!!n),!this.headings.length)return;let t=Number(this.getAttribute("offset")??80);typeof IntersectionObserver<"u"&&(this.observer=new IntersectionObserver(n=>{var o;let s=n.find(r=>r.isIntersecting);if(s)return this.setActive(s.target.id);this.setActive(((o=this.lastAbove(t))==null?void 0:o.id)??null)},{rootMargin:`-${t}px 0px -70% 0px`,threshold:0}),this.headings.forEach(n=>this.observer.observe(n))),window.addEventListener("hashchange",this.onHash),window.addEventListener("scroll",this.onScroll,{passive:!0}),this.setActive(((e=this.lastAbove(t))==null?void 0:e.id)??this.headings[0].id)}disconnect(){var t;(t=this.observer)==null||t.disconnect(),this.observer=null,window.removeEventListener("hashchange",this.onHash),window.removeEventListener("scroll",this.onScroll)}lastAbove(t){let e=null;for(let n of this.headings)n.getBoundingClientRect().top<=t+20&&(e=n);return e}setActive(t){if(!(!t||t===this.active)){this.active=t;for(let e of this.links)this.slugOf(e)===t?(e.setAttribute("aria-current","location"),e.setAttribute("data-active","")):(e.removeAttribute("aria-current"),e.removeAttribute("data-active"));this.dispatchEvent(new CustomEvent("db-toc:change",{detail:{id:t},bubbles:!0}))}}};N();customElements.get("db-toc")||customElements.define("db-toc",We);var Dn=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",\'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)\',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ce=Dn.join(","),Ye=typeof Element>"u",Rt=Ye?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Wt=!Ye&&Element.prototype.getRootNode?function(i){var t;return i==null||(t=i.getRootNode)===null||t===void 0?void 0:t.call(i)}:function(i){return i==null?void 0:i.ownerDocument},jt=function(t,e){var n;e===void 0&&(e=!0);var s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),o=s===""||s==="true",r=o||e&&t&&(typeof t.closest=="function"?t.closest("[inert]"):jt(t.parentNode));return r},Rn=function(t){var e,n=t==null||(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"contenteditable");return n===""||n==="true"},In=function(t,e,n){if(jt(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(ce));return e&&Rt.call(t,ce)&&s.unshift(t),s=s.filter(n),s},de=function(t,e,n){for(var s=[],o=Array.from(t);o.length;){var r=o.shift();if(!jt(r,!1))if(r.tagName==="SLOT"){var a=r.assignedElements(),l=a.length?a:r.children,c=de(l,!0,n);n.flatten?s.push.apply(s,c):s.push({scopeParent:r,candidates:c})}else{var d=Rt.call(r,ce);d&&n.filter(r)&&(e||!t.includes(r))&&s.push(r);var u=r.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(r),f=!jt(u,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(r));if(u&&f){var m=de(u===!0?r.children:u.children,!0,n);n.flatten?s.push.apply(s,m):s.push({scopeParent:r,candidates:m})}else o.unshift.apply(o,r.children)}}return s},Ue=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Xe=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Rn(t))&&!Ue(t)?0:t.tabIndex},Mn=function(t,e){var n=Xe(t);return n<0&&e&&!Ue(t)?0:n},Hn=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},Ge=function(t){return t.tagName==="INPUT"},zn=function(t){return Ge(t)&&t.type==="hidden"},Nn=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return e},_n=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]},Pn=function(t){if(!t.name)return!0;var e=t.form||Wt(t),n=function(a){return e.querySelectorAll(\'input[type="radio"][name="\'+a+\'"]\')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=n(window.CSS.escape(t.name));else try{s=n(t.name)}catch(r){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",r.message),!1}var o=_n(s,t.form);return!o||o===t},Fn=function(t){return Ge(t)&&t.type==="radio"},$n=function(t){return Fn(t)&&!Pn(t)},Bn=function(t){var e,n=t&&Wt(t),s=(e=n)===null||e===void 0?void 0:e.host,o=!1;if(n&&n!==t){var r,a,l;for(o=!!((r=s)!==null&&r!==void 0&&(a=r.ownerDocument)!==null&&a!==void 0&&a.contains(s)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&s;){var c,d,u;n=Wt(s),s=(c=n)===null||c===void 0?void 0:c.host,o=!!((d=s)!==null&&d!==void 0&&(u=d.ownerDocument)!==null&&u!==void 0&&u.contains(s))}}return o},je=function(t){var e=t.getBoundingClientRect(),n=e.width,s=e.height;return n===0&&s===0},qn=function(t,e){var n=e.displayCheck,s=e.getShadowRoot;if(n==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}var r=getComputedStyle(t),a=r.visibility;if(a==="hidden"||a==="collapse")return!0;var l=Rt.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(Rt.call(c,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof s=="function"){for(var d=t;t;){var u=t.parentElement,f=Wt(t);if(u&&!u.shadowRoot&&s(u)===!0)return je(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=d}if(Bn(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return je(t);return!1},Kn=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var n=0;n<e.children.length;n++){var s=e.children.item(n);if(s.tagName==="LEGEND")return Rt.call(e,"fieldset[disabled] *")?!0:!s.contains(t)}return!0}e=e.parentElement}return!1},Wn=function(t,e){return!(e.disabled||zn(e)||qn(e,t)||Nn(e)||Kn(e))},Ve=function(t,e){return!($n(e)||Xe(e)<0||!Wn(t,e))},jn=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},Ze=function(t){var e=[],n=[];return t.forEach(function(s,o){var r=!!s.scopeParent,a=r?s.scopeParent:s,l=Mn(a,r),c=r?Ze(s.candidates):a;l===0?r?e.push.apply(e,c):e.push(a):n.push({documentOrder:o,tabIndex:l,item:s,isScope:r,content:c})}),n.sort(Hn).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(e)},ue=function(t,e){e=e||{};var n;return e.getShadowRoot?n=de([t],e.includeContainer,{filter:Ve.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:jn}):n=In(t,e.includeContainer,Ve.bind(null,e)),Ze(n)};var he=class{constructor(i,t={}){h(this,"root");h(this,"opts");h(this,"previouslyFocused",null);h(this,"keydownHandler",null);h(this,"active",!1);this.root=i,this.opts={initialFocus:t.initialFocus??"first",returnFocus:t.returnFocus??!0}}activate(){this.active||(this.active=!0,this.previouslyFocused=document.activeElement,this.keydownHandler=i=>{if(i.key!=="Tab")return;let t=ue(this.root);if(t.length===0){i.preventDefault();return}let e=t[0],n=t[t.length-1];i.shiftKey?document.activeElement===e&&(n.focus(),i.preventDefault()):document.activeElement===n&&(e.focus(),i.preventDefault())},document.addEventListener("keydown",this.keydownHandler),requestAnimationFrame(()=>{var t;if(!this.active)return;let i=ue(this.root);this.opts.initialFocus instanceof HTMLElement&&this.root.contains(this.opts.initialFocus)?this.opts.initialFocus.focus():this.opts.initialFocus==="container"?(this.root.hasAttribute("tabindex")||this.root.setAttribute("tabindex","-1"),this.root.focus()):(t=i[0])==null||t.focus()}))}deactivate(){this.active&&(this.active=!1,this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null),this.opts.returnFocus&&this.previouslyFocused&&document.contains(this.previouslyFocused)&&this.previouslyFocused.focus(),this.previouslyFocused=null)}isActive(){return this.active}};var B,at=(B=class{static activate(){if(B.count++,B.count>1)return;let t=window.innerWidth-document.documentElement.clientWidth;B.originalStyles={overflow:document.body.style.overflow,paddingRight:document.body.style.paddingRight},document.body.style.overflow="hidden",t>0&&(document.body.style.paddingRight=`${t}px`)}static deactivate(){B.count=Math.max(0,B.count-1),!(B.count>0)&&B.originalStyles&&(document.body.style.overflow=B.originalStyles.overflow,document.body.style.paddingRight=B.originalStyles.paddingRight,B.originalStyles=null)}static reset(){B.count=0,B.originalStyles=null}},h(B,"count",0),h(B,"originalStyles",null),B);var Q=[];function Vn(i){if(i.key!=="Escape"||Q.length===0)return;let t=Q[Q.length-1];t.escapePrevented||(i.preventDefault(),i.stopPropagation(),t.opts.onDismiss("escape-key"))}var Qe=!1;function Yn(){Qe||(Qe=!0,document.addEventListener("keydown",Vn))}var lt=class{constructor(i,t){h(this,"root");h(this,"opts");h(this,"outsideHandler",null);h(this,"active",!1);h(this,"frameId",null);h(this,"escapePrevented",!1);this.root=i,this.opts={onDismiss:t.onDismiss,escapeKey:t.escapeKey??!0,outsidePress:t.outsidePress??!0}}activate(){this.active||(this.active=!0,this.opts.escapeKey&&(Yn(),Q.push(this)),this.opts.outsidePress&&(this.outsideHandler=i=>{if(Q.length>0&&Q[Q.length-1]!==this)return;let t=i.target;if(this.root.contains(t))return;let e=this.root.id;if(e){let s=document.querySelector(`[aria-controls="${e}"]`);if(s!=null&&s.contains(t))return}let n=this.root.getAttribute("aria-labelledby");if(n){let s=document.getElementById(n);if(s!=null&&s.contains(t))return}typeof this.opts.outsidePress=="function"&&!this.opts.outsidePress(i)||this.opts.onDismiss("outside-press")},this.frameId=requestAnimationFrame(()=>{this.frameId=null,this.outsideHandler&&document.addEventListener("pointerdown",this.outsideHandler)})))}deactivate(){if(!this.active)return;this.active=!1;let i=Q.indexOf(this);i!==-1&&Q.splice(i,1),this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null),this.outsideHandler&&(document.removeEventListener("pointerdown",this.outsideHandler),this.outsideHandler=null)}isActive(){return this.active}};function fe(i){let t=[],e=i;for(;e&&e!==document.body;){let n=e.parentElement;if(!n)break;for(let s=0;s<n.children.length;s++){let o=n.children[s];if(o===e||o.contains(i))continue;let r=o.tagName;if(r==="SCRIPT"||r==="STYLE"||r==="LINK")continue;let a=o.getAttribute("aria-hidden");a!=="true"&&(t.push({el:o,prev:a}),o.setAttribute("aria-hidden","true"))}e=n}return()=>{for(let{el:n,prev:s}of t)s===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",s)}}var Je=class extends z{constructor(){super(...arguments);h(this,"content",null);h(this,"backdrop",null);h(this,"trigger",null);h(this,"native",!1);h(this,"_open",!1);h(this,"openedBy",null);h(this,"focusTrap",null);h(this,"dismiss",null);h(this,"cleanupInert",null);h(this,"onTriggerClick",t=>{t.preventDefault(),this.toggle(t.currentTarget)});h(this,"onHostClick",t=>{let e=t.target.closest("[data-part=\'close\']");e&&e.closest("db-dialog")===this&&this.close("close-press")});h(this,"onDocumentClick",t=>{var s,o,r;let e=(o=(s=t.target).closest)==null?void 0:o.call(s,"[data-dialog-for]");if(!e||e===this.trigger)return;let n=e.getAttribute("data-dialog-for");n&&(n===this.id||n===((r=this.content)==null?void 0:r.id))&&(t.preventDefault(),this.toggle(e))});h(this,"onCancel",t=>{t.preventDefault(),this.dismissible&&this.close("escape-key")});h(this,"onNativeClick",t=>{if(!this.dismissible||t.target!==this.content||!this.content)return;let e=this.content.getBoundingClientRect();!(t.clientX>=e.left&&t.clientX<=e.right&&t.clientY>=e.top&&t.clientY<=e.bottom)&&(t.clientX!==0||t.clientY!==0)&&this.close("outside-press")});h(this,"onNativeClose",()=>{this._open&&this.finishClose("close-press")})}get open(){return this._open}get dismissible(){return this.getAttribute("dismissible")!=="false"}setup(){if(this.content=$(this,"[data-part=\'content\']"),!this.content)return;this.native=typeof HTMLDialogElement<"u"&&this.content instanceof HTMLDialogElement&&typeof this.content.showModal=="function",this.backdrop=$(this,"[data-part=\'backdrop\']"),this.trigger=bt($(this,"[data-part=\'trigger\']"));let t=this.content;t.id||(t.id=F("db-dialog")),this.native||(t.setAttribute("role",t.getAttribute("role")||"dialog"),t.setAttribute("aria-modal","true"),t.hidden=!this.hasAttribute("open"),this.backdrop&&(this.backdrop.hidden=!0));let e=t.querySelector("[data-part=\'title\']");e&&!t.hasAttribute("aria-labelledby")&&!t.hasAttribute("aria-label")&&(e.id||(e.id=F("db-dialog-title")),t.setAttribute("aria-labelledby",e.id));let n=t.querySelector("[data-part=\'description\']");n&&!t.hasAttribute("aria-describedby")&&(n.id||(n.id=F("db-dialog-desc")),t.setAttribute("aria-describedby",n.id));for(let s of this.triggers())this.prepareTrigger(s);this.setState("closed"),this.native||(this.focusTrap=new he(t),this.dismiss=new lt(t,{onDismiss:s=>this.dismissible&&this.close(s)}))}connect(){var t;this.content&&((t=this.trigger)==null||t.addEventListener("click",this.onTriggerClick),this.addEventListener("click",this.onHostClick),document.addEventListener("click",this.onDocumentClick),this.native&&(this.content.addEventListener("cancel",this.onCancel),this.content.addEventListener("click",this.onNativeClick),this.content.addEventListener("close",this.onNativeClose)),queueMicrotask(()=>{if(this.isConnected){for(let e of this.triggers())e.hasAttribute("aria-controls")||this.prepareTrigger(e);this.hasAttribute("open")&&!this._open&&this.show()}}))}disconnect(){var t;(t=this.trigger)==null||t.removeEventListener("click",this.onTriggerClick),this.removeEventListener("click",this.onHostClick),document.removeEventListener("click",this.onDocumentClick),this.content&&this.native&&(this.content.removeEventListener("cancel",this.onCancel),this.content.removeEventListener("click",this.onNativeClick),this.content.removeEventListener("close",this.onNativeClose)),this._open&&this.finishClose("api",!1)}triggers(){var n;let t=this.trigger?[this.trigger]:[],e=[this.id,(n=this.content)==null?void 0:n.id].filter(Boolean);for(let s of e)document.querySelectorAll(`[data-dialog-for="${CSS.escape(s)}"]`).forEach(o=>t.push(o));return t}prepareTrigger(t){t.hasAttribute("aria-haspopup")||t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-controls",this.content.id),t.setAttribute("aria-expanded","false")}setState(t){var e,n;this.setAttribute("data-state",t),(e=this.content)==null||e.setAttribute("data-state",t),(n=this.backdrop)==null||n.setAttribute("data-state",t)}toggle(t){this._open?this.close("trigger-press"):this.show(t)}show(t){var n,s;let e=this.content;if(!(!e||this._open)){this._open=!0,this.openedBy=t??document.activeElement??this.trigger;for(let o of this.triggers())this.prepareTrigger(o),o.setAttribute("aria-expanded","true");if(at.activate(),this.native){let o=e;o.open||o.showModal()}else e.hidden=!1,this.backdrop&&(this.backdrop.hidden=!1),this.cleanupInert=fe(e),(n=this.focusTrap)==null||n.activate(),(s=this.dismiss)==null||s.activate();this.setState("open"),this.dispatchEvent(new CustomEvent("db-dialog:open",{bubbles:!0}))}}close(t="api"){this._open&&this.finishClose(t)}finishClose(t,e=!0){var o,r,a;let n=this.content;this._open=!1,this.setState("closed");for(let l of this.triggers())l.setAttribute("aria-expanded","false");if(at.deactivate(),this.native){let l=n;l.open&&l.close()}else(o=this.dismiss)==null||o.deactivate(),(r=this.focusTrap)==null||r.deactivate(),(a=this.cleanupInert)==null||a.call(this),this.cleanupInert=null,Fe(n,()=>{this._open||(n.hidden=!0,this.backdrop&&(this.backdrop.hidden=!0))});let s=this.openedBy;this.openedBy=null,e&&s&&document.contains(s)&&s.focus(),this.dispatchEvent(new CustomEvent("db-dialog:close",{detail:{reason:t},bubbles:!0}))}};N();customElements.get("db-dialog")||customElements.define("db-dialog",Je);var ti=class extends z{constructor(){super(...arguments);h(this,"input",null);h(this,"listbox",null);h(this,"empty",null);h(this,"_open",!1);h(this,"highlighted",null);h(this,"observer",null);h(this,"base",F("db-combobox"));h(this,"optionSeq",0);h(this,"onInput",()=>{this.filtering?this.filter(this.input.value):this.show()});h(this,"onFocus",()=>{(this.hasAttribute("open-on-focus")||this.filtering&&this.input.value)&&(this.filtering?this.filter(this.input.value):this.show())});h(this,"onKey",t=>{let e=this.visible(),n=this.highlighted?e.indexOf(this.highlighted):-1;switch(t.key){case"ArrowDown":t.preventDefault(),this._open||this.show(),e.length&&this.highlight(e[n<0?0:Math.min(n+1,e.length-1)]);break;case"ArrowUp":t.preventDefault(),this._open||this.show(),e.length&&this.highlight(e[n<0?e.length-1:Math.max(n-1,0)]);break;case"Home":case"End":this._open&&this.highlighted&&e.length&&(t.preventDefault(),this.highlight(t.key==="Home"?e[0]:e[e.length-1]));break;case"Enter":this._open&&this.highlighted&&(t.preventDefault(),this.choose(this.highlighted));break;case"Escape":this._open&&!this.inline?(t.preventDefault(),t.stopPropagation(),this.hide()):this.input.value&&(t.preventDefault(),t.stopPropagation(),this.input.value="",this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.hide());break;case"Tab":this.inline||this.hide();break}});h(this,"onListClick",t=>{let e=t.target.closest("[data-part=\'option\']");if(!e||e.closest("db-combobox")!==this||W(e))return;let n=t.target.closest("a[href]");!this.choose(e,!n)&&n&&t.preventDefault()});h(this,"onListPointer",t=>{let e=t.target.closest("[data-part=\'option\']");e&&e.closest("db-combobox")===this&&!W(e)&&!e.hidden&&this.highlight(e)});h(this,"onListDown",t=>t.preventDefault());h(this,"onDocDown",t=>{this._open&&!this.inline&&!this.contains(t.target)&&this.hide()})}get open(){return this._open}get inline(){return this.hasAttribute("inline")}get filtering(){return(this.getAttribute("filter")??"contains")!=="none"}options(){return this.listbox?Array.from(this.listbox.querySelectorAll("[data-part=\'option\']")).filter(t=>t.closest("db-combobox")===this):[]}visible(){return this.options().filter(t=>!t.hidden&&!W(t))}setup(){if(this.input=$(this,"[data-part=\'input\']"),this.listbox=$(this,"[data-part=\'listbox\']"),this.empty=$(this,"[data-part=\'empty\']"),!this.input||!this.listbox)return;let{input:t,listbox:e}=this;e.id||(e.id=`${this.base}-listbox`),e.setAttribute("role","listbox"),t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-controls",e.id),t.setAttribute("autocomplete","off"),this.inline||(e.hidden=!0),this.prepareOptions(),this.syncExpanded()}prepareOptions(){this.options().forEach(t=>{t.id||(t.id=`${this.base}-option-${++this.optionSeq}`),t.setAttribute("role","option"),t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.matches("a[href], button")&&t.setAttribute("tabindex","-1"),t.querySelectorAll("a, button").forEach(e=>e.setAttribute("tabindex","-1")),t.parentElement&&t.parentElement!==this.listbox&&t.parentElement.localName==="li"&&!t.parentElement.hasAttribute("role")&&t.parentElement.setAttribute("role","none")})}connect(){let{input:t,listbox:e}=this;!t||!e||(t.addEventListener("input",this.onInput),t.addEventListener("focus",this.onFocus),t.addEventListener("keydown",this.onKey),e.addEventListener("click",this.onListClick),e.addEventListener("pointermove",this.onListPointer),e.addEventListener("mousedown",this.onListDown),document.addEventListener("pointerdown",this.onDocDown),typeof MutationObserver<"u"&&(this.observer=new MutationObserver(()=>this.onOptionsChanged()),this.observer.observe(e,{childList:!0,subtree:!0})))}disconnect(){var n;let{input:t,listbox:e}=this;t==null||t.removeEventListener("input",this.onInput),t==null||t.removeEventListener("focus",this.onFocus),t==null||t.removeEventListener("keydown",this.onKey),e==null||e.removeEventListener("click",this.onListClick),e==null||e.removeEventListener("pointermove",this.onListPointer),e==null||e.removeEventListener("mousedown",this.onListDown),document.removeEventListener("pointerdown",this.onDocDown),(n=this.observer)==null||n.disconnect(),this.observer=null}refresh(){this.onOptionsChanged()}onOptionsChanged(){this.prepareOptions(),this.highlighted&&!this.options().includes(this.highlighted)&&this.clearHighlight();let t=this.visible();this.filtering||(t.length||this.inline?this.show():this.hide(),t.length&&!this.highlighted&&!this.hasAttribute("no-autohighlight")&&this.highlight(t[0])),this.syncExpanded(),this.dispatchEvent(new CustomEvent("db-combobox:update",{detail:{count:t.length},bubbles:!0}))}filter(t){let e=t.toLowerCase().trim(),n=0;for(let o of this.options()){let r=!e||(o.textContent??"").toLowerCase().includes(e)||(o.dataset.value??"").toLowerCase().includes(e);o.hidden=!r,r&&n++}this.empty&&(this.empty.hidden=n>0||!e),this.clearHighlight(),n||e&&this.empty?this.show():this.hide();let s=this.visible();s.length&&!this.hasAttribute("no-autohighlight")&&this.highlight(s[0]),this.dispatchEvent(new CustomEvent("db-combobox:update",{detail:{count:n},bubbles:!0}))}syncExpanded(){if(!this.input)return;let t=this.inline?this.visible().length>0:this._open;this.input.setAttribute("aria-expanded",String(t)),this.setAttribute("data-state",t?"open":"closed")}show(){if(!this.listbox||this._open)return this.syncExpanded();this._open=!0,this.listbox.hidden=!1,this.syncExpanded()}hide(){if(this.listbox){if(this.clearHighlight(),!this._open)return this.syncExpanded();this._open=!1,this.inline||(this.listbox.hidden=!0),this.syncExpanded()}}highlight(t){var e,n,s;this.input&&((e=this.highlighted)==null||e.removeAttribute("data-highlighted"),(n=this.highlighted)==null||n.setAttribute("aria-selected","false"),this.highlighted=t,t.setAttribute("data-highlighted",""),t.setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",t.id),(s=t.scrollIntoView)==null||s.call(t,{block:"nearest"}))}clearHighlight(){var t,e,n;(t=this.highlighted)==null||t.removeAttribute("data-highlighted"),(e=this.highlighted)==null||e.setAttribute("aria-selected","false"),this.highlighted=null,(n=this.input)==null||n.removeAttribute("aria-activedescendant")}choose(t,e=!0){var a;let n=t.dataset.value??"",s=((a=t.textContent)==null?void 0:a.trim())??n,o=new CustomEvent("db-combobox:select",{detail:{value:n,text:s,option:t},bubbles:!0,cancelable:!0});if(!this.dispatchEvent(o))return!1;let r=t.matches("a[href]")?t:t.querySelector("a[href]");return r?(e&&r.click(),!0):(this.input&&(this.input.value=t.getAttribute("data-label")??s),this.inline||this.hide(),this.dispatchEvent(new CustomEvent("db-combobox:change",{detail:{value:n,text:s},bubbles:!0})),!0)}};N();customElements.get("db-combobox")||customElements.define("db-combobox",ti);var it=Math.min,j=Math.max,Mt=Math.round,Ht=Math.floor,U=i=>({x:i,y:i}),Un={left:"right",right:"left",bottom:"top",top:"bottom"};function ni(i,t,e){return j(i,it(t,e))}function Et(i,t){return typeof i=="function"?i(t):i}function nt(i){return i.split("-")[0]}function xt(i){return i.split("-")[1]}function me(i){return i==="x"?"y":"x"}function pe(i){return i==="y"?"height":"width"}function X(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function ge(i){return me(X(i))}function si(i,t,e){e===void 0&&(e=!1);let n=xt(i),s=ge(i),o=pe(s),r=s==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=It(r)),[r,It(r)]}function oi(i){let t=It(i);return[Vt(i),t,Vt(t)]}function Vt(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var ei=["left","right"],ii=["right","left"],Xn=["top","bottom"],Gn=["bottom","top"];function Zn(i,t,e){switch(i){case"top":case"bottom":return e?t?ii:ei:t?ei:ii;case"left":case"right":return t?Xn:Gn;default:return[]}}function ri(i,t,e,n){let s=xt(i),o=Zn(nt(i),e==="start",n);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(Vt)))),o}function It(i){let t=nt(i);return Un[t]+i.slice(t.length)}function Qn(i){var t,e,n,s;return{top:(t=i.top)!=null?t:0,right:(e=i.right)!=null?e:0,bottom:(n=i.bottom)!=null?n:0,left:(s=i.left)!=null?s:0}}function ai(i){return typeof i!="number"?Qn(i):{top:i,right:i,bottom:i,left:i}}function ct(i){let{x:t,y:e,width:n,height:s}=i;return{width:n,height:s,top:e,left:t,right:t+n,bottom:e+s,x:t,y:e}}function li(i,t,e){let{reference:n,floating:s}=i,o=X(t),r=ge(t),a=pe(r),l=nt(t),c=o==="y",d=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2,m;switch(l){case"top":m={x:d,y:n.y-s.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-s.width,y:u};break;default:m={x:n.x,y:n.y}}let p=xt(t);return p&&(m[r]+=f*(p==="end"?1:-1)*(e&&c?-1:1)),m}async function ci(i,t){var e;t===void 0&&(t={});let{x:n,y:s,platform:o,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:m=0}=Et(t,i),p=ai(m),g=a[f?u==="floating"?"reference":"floating":u],y=ct(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(g)))==null||e?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),w=u==="floating"?{x:n,y:s,width:r.floating.width,height:r.floating.height}:r.reference,L=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),R=await(o.isElement==null?void 0:o.isElement(L))&&await(o.getScale==null?void 0:o.getScale(L))||{x:1,y:1},M=ct(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:L,strategy:l}):w);return{top:(y.top-M.top+p.top)/R.y,bottom:(M.bottom-y.bottom+p.bottom)/R.y,left:(y.left-M.left+p.left)/R.x,right:(M.right-y.right+p.right)/R.x}}var Jn=50,di=async(i,t,e)=>{let{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:ci},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:s}),{x:d,y:u}=li(c,n,l),f=n,m=0,p={};for(let b=0;b<o.length;b++){let g=o[b];if(!g)continue;let{name:y,fn:w}=g,{x:L,y:R,data:M,reset:H}=await w({x:d,y:u,initialPlacement:n,placement:f,strategy:s,middlewareData:p,rects:c,platform:a,elements:{reference:i,floating:t}});d=L??d,u=R??u,p[y]={...p[y],...M},H&&m<Jn&&(m++,typeof H=="object"&&(H.placement&&(f=H.placement),H.rects&&(c=H.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:s}):H.rects),{x:d,y:u}=li(c,f,l)),b=-1)}return{x:d,y:u,placement:f,strategy:s,middlewareData:p}};var ui=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=!0,...g}=Et(i,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};let y=nt(s),w=X(a),L=nt(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),M=f||(L||!b?[It(a)]:oi(a)),H=p!=="none";!f&&H&&M.push(...ri(a,b,p,R));let O=[a,...M],v=await l.detectOverflow(t,g),q=[],I=((n=o.flip)==null?void 0:n.overflows)||[];if(d&&q.push(v[y]),u){let C=si(s,r,R);q.push(v[C[0]],v[C[1]])}if(I=[...I,{placement:s,overflows:q}],!q.every(C=>C<=0)){var S,x;let C=(((S=o.flip)==null?void 0:S.index)||0)+1,T=O[C];if(T&&(!(u==="alignment"?w!==X(T):!1)||I.every(D=>X(D.placement)===w?D.overflows[0]>0:!0)))return{data:{index:C,overflows:I},reset:{placement:T}};let A=(x=I.filter(k=>k.overflows[0]<=0).sort((k,D)=>k.overflows[1]-D.overflows[1])[0])==null?void 0:x.placement;if(!A)switch(m){case"bestFit":{var E;let k=(E=I.filter(D=>{if(H){let _=X(D.placement);return _===w||_==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(_=>_>0).reduce((_,P)=>_+P,0)]).sort((D,_)=>D[1]-_[1])[0])==null?void 0:E[0];k&&(A=k);break}case"initialPlacement":A=a;break}if(s!==A)return{reset:{placement:A}}}return{}}}};var ts=new Set(["left","top"]);async function es(i,t){let{placement:e,platform:n,elements:s}=i,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=nt(e),a=xt(e),l=X(e)==="y",c=ts.has(r)?-1:1,d=o&&l?-1:1,u=Et(t,i),{mainAxis:f,crossAxis:m,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof p=="number"&&(m=a==="end"?p*-1:p),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}var hi=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(t){var e,n;let{x:s,y:o,placement:r,middlewareData:a}=t,l=await es(t,i);return r===((e=a.offset)==null?void 0:e.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},fi=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(t){let{x:e,y:n,placement:s,platform:o}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x:L,y:R}=w;return{x:L,y:R}}},...c}=Et(i,t),d={x:e,y:n},u=await o.detectOverflow(t,c),f=X(s),m=me(f),p=d[m],b=d[f],g=(w,L)=>ni(L+u[w==="y"?"top":"left"],L,L-u[w==="y"?"bottom":"right"]);r&&(p=g(m,p)),a&&(b=g(f,b));let y=l.fn({...t,[m]:p,[f]:b});return{...y,data:{x:y.x-e,y:y.y-n,enabled:{[m]:r,[f]:a}}}}}};var mi=function(i){return i===void 0&&(i={}),{name:"size",options:i,async fn(t){let{placement:e,rects:n,platform:s,elements:o}=t,{apply:r=()=>{},...a}=Et(i,t),l=await s.detectOverflow(t,a),c=nt(e),d=xt(e),u=X(e)==="y",{width:f,height:m}=n.floating,p,b;c==="top"||c==="bottom"?(p=c,b=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(b=c,p=d==="end"?"top":"bottom");let g=m-l.top-l.bottom,y=f-l.left-l.right,w=it(m-l[p],g),L=it(f-l[b],y),R=t.middlewareData.shift,M=!R,H=w,O=L;R!=null&&R.enabled.x&&(O=y),R!=null&&R.enabled.y&&(H=g),M&&!d&&(u?O=f-2*j(l.left,l.right):H=m-2*j(l.top,l.bottom)),await r({...t,availableWidth:O,availableHeight:H});let v=await s.getDimensions(o.floating);return f!==v.width||m!==v.height?{reset:{rects:!0}}:{}}}};function Yt(){return typeof window<"u"}function ut(i){return gi(i)?(i.nodeName||"").toLowerCase():"#document"}function K(i){var t;return(i==null||(t=i.ownerDocument)==null?void 0:t.defaultView)||window}function G(i){var t;return(t=(gi(i)?i.ownerDocument:i.document)||window.document)==null?void 0:t.documentElement}function gi(i){return Yt()?i instanceof Node||i instanceof K(i).Node:!1}function V(i){return Yt()?i instanceof Element||i instanceof K(i).Element:!1}function J(i){return Yt()?i instanceof HTMLElement||i instanceof K(i).HTMLElement:!1}function pi(i){return!Yt()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof K(i).ShadowRoot}function zt(i){let{overflow:t,overflowX:e,overflowY:n,display:s}=Y(i);return/auto|scroll|overlay|hidden|clip/.test(t+n+e)&&s!=="inline"&&s!=="contents"}function bi(i){return/^(table|td|th)$/.test(ut(i))}function Nt(i){try{if(i.matches(":popover-open"))return!0}catch{}try{return i.matches(":modal")}catch{return!1}}var is=/transform|translate|scale|rotate|perspective|filter/,ns=/paint|layout|strict|content/,dt=i=>!!i&&i!=="none",be;function Ut(i){let t=V(i)?Y(i):i;return dt(t.transform)||dt(t.translate)||dt(t.scale)||dt(t.rotate)||dt(t.perspective)||!Xt()&&(dt(t.backdropFilter)||dt(t.filter))||is.test(t.willChange||"")||ns.test(t.contain||"")}function vi(i){let t=st(i);for(;J(t)&&!St(t);){if(Ut(t))return t;if(Nt(t))return null;t=st(t)}return null}function Xt(){return be==null&&(be=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),be}function St(i){return/^(html|body|#document)$/.test(ut(i))}function Y(i){return K(i).getComputedStyle(i)}function _t(i){return V(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function st(i){if(ut(i)==="html")return i;let t=i.assignedSlot||i.parentNode||pi(i)&&i.host||G(i);return pi(t)?t.host:t}function yi(i){let t=st(i);return St(t)?(i.ownerDocument||i).body:J(t)&&zt(t)?t:yi(t)}function At(i,t,e){var n;t===void 0&&(t=[]),e===void 0&&(e=!0);let s=yi(i),o=s===((n=i.ownerDocument)==null?void 0:n.body),r=K(s);if(o){let a=Gt(r);return t.concat(r,r.visualViewport||[],zt(s)?s:[],a&&e?At(a):[])}else return t.concat(s,At(s,[],e))}function Gt(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function xi(i){let t=Y(i),e=parseFloat(t.width)||0,n=parseFloat(t.height)||0,s=J(i),o=s?i.offsetWidth:e,r=s?i.offsetHeight:n,a=Mt(e)!==o||Mt(n)!==r;return a&&(e=o,n=r),{width:e,height:n,$:a}}function ye(i){return V(i)?i:i.contextElement}function Ct(i){let t=ye(i);if(!J(t))return U(1);let e=t.getBoundingClientRect(),{width:n,height:s,$:o}=xi(t),r=(o?Mt(e.width):e.width)/n,a=(o?Mt(e.height):e.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var ss=U(0);function Ai(i){let t=K(i);return!Xt()||!t.visualViewport?ss:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function os(i,t,e){return t===void 0&&(t=!1),!!e&&t&&e===K(i)}function ht(i,t,e,n){t===void 0&&(t=!1),e===void 0&&(e=!1);let s=i.getBoundingClientRect(),o=ye(i),r=U(1);t&&(n?V(n)&&(r=Ct(n)):r=Ct(i));let a=os(o,e,n)?Ai(o):U(0),l=(s.left+a.x)/r.x,c=(s.top+a.y)/r.y,d=s.width/r.x,u=s.height/r.y;if(o&&n){let f=K(o),m=V(n)?K(n):n,p=f,b=Gt(p);for(;b&&m!==p;){let g=Ct(b),y=b.getBoundingClientRect(),w=Y(b),L=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*g.x,R=y.top+(b.clientTop+parseFloat(w.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,u*=g.y,l+=L,c+=R,p=K(b),b=Gt(p)}}return ct({width:d,height:u,x:l,y:c})}function Zt(i,t){let e=_t(i).scrollLeft;return t?t.left+e:ht(G(i)).left+e}function Si(i,t){let e=i.getBoundingClientRect(),n=e.left+t.scrollLeft-Zt(i,e),s=e.top+t.scrollTop;return{x:n,y:s}}function rs(i){let{elements:t,rect:e,offsetParent:n,strategy:s}=i,o=s==="fixed",r=G(n),a=t?Nt(t.floating):!1;if(n===r||a&&o)return e;let l={scrollLeft:0,scrollTop:0},c=U(1),d=U(0),u=J(n);if((u||!o)&&((ut(n)!=="body"||zt(r))&&(l=_t(n)),u)){let m=ht(n);c=Ct(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}let f=r&&!u&&!o?Si(r,l):U(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:e.y*c.y-l.scrollTop*c.y+d.y+f.y}}function as(i){return i.getClientRects?Array.from(i.getClientRects()):[]}function ls(i){let t=_t(i),e=i.ownerDocument.body,n=j(i.scrollWidth,i.clientWidth,e.scrollWidth,e.clientWidth),s=j(i.scrollHeight,i.clientHeight,e.scrollHeight,e.clientHeight),o=-t.scrollLeft+Zt(i),r=-t.scrollTop;return Y(e).direction==="rtl"&&(o+=j(i.clientWidth,e.clientWidth)-n),{width:n,height:s,x:o,y:r}}var cs=25;function ds(i,t,e){e===void 0&&(e="viewport");let n=e==="layoutViewport",s=K(i),o=G(i),r=s.visualViewport,a=o.clientWidth,l=o.clientHeight,c=0,d=0;if(r){let f=!Xt()||t==="fixed";n?f||(c=-r.offsetLeft,d=-r.offsetTop):(a=r.width,l=r.height,f&&(c=r.offsetLeft,d=r.offsetTop))}if(Zt(o)<=0){let f=o.ownerDocument,m=f.body,p=getComputedStyle(m),b=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(o.clientWidth-m.clientWidth-b),y=getComputedStyle(o).scrollbarGutter==="stable both-edges"?g/2:g;y<=cs&&(a-=y)}return{width:a,height:l,x:c,y:d}}function us(i,t){let e=ht(i,!0,t==="fixed"),n=e.top+i.clientTop,s=e.left+i.clientLeft,o=Ct(i),r=i.clientWidth*o.x,a=i.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:r,height:a,x:l,y:c}}function wi(i,t,e){let n;if(t==="viewport"||t==="layoutViewport")n=ds(i,e,t);else if(t==="document")n=ls(G(i));else if(V(t))n=us(t,e);else{let s=Ai(i);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ct(n)}function hs(i,t){let e=t.get(i);if(e)return e;let n=At(i,[],!1).filter(a=>V(a)&&ut(a)!=="body"),s=null,o=Y(i).position==="fixed",r=o?st(i):i;for(;V(r)&&!St(r);){let a=Y(r),l=Ut(r),c=s?s.position:o?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?n=n.filter(u=>u!==r):s=a,r=st(r)}return t.set(i,n),n}function fs(i){let{element:t,boundary:e,rootBoundary:n,strategy:s}=i,r=[...e==="clippingAncestors"?Nt(t)?[]:hs(t,this._c):[].concat(e),n],a=wi(t,r[0],s),l=a.top,c=a.right,d=a.bottom,u=a.left;for(let f=1;f<r.length;f++){let m=wi(t,r[f],s);l=j(m.top,l),c=it(m.right,c),d=it(m.bottom,d),u=j(m.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function ms(i){let{width:t,height:e}=xi(i);return{width:t,height:e}}function ps(i,t,e){let n=J(t),s=G(t),o=e==="fixed",r=ht(i,!0,o,t),a={scrollLeft:0,scrollTop:0},l=U(0);if((n||!o)&&((ut(t)!=="body"||zt(s))&&(a=_t(t)),n)){let f=ht(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}!n&&s&&(l.x=Zt(s));let c=s&&!n&&!o?Si(s,a):U(0),d=r.left+a.scrollLeft-l.x-c.x,u=r.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:r.width,height:r.height}}function ve(i){return Y(i).position==="static"}function Ei(i,t){if(!J(i)||Y(i).position==="fixed")return null;if(t)return t(i);let e=i.offsetParent;return G(i)===e&&(e=e.ownerDocument.body),e}function Ci(i,t){let e=K(i);if(Nt(i))return e;if(!J(i)){let s=st(i);for(;s&&!St(s);){if(V(s)&&!ve(s))return s;s=st(s)}return e}let n=Ei(i,t);for(;n&&bi(n)&&ve(n);)n=Ei(n,t);return n&&St(n)&&ve(n)&&!Ut(n)?e:n||vi(i)||e}var gs=async function(i){let t=this.getOffsetParent||Ci,e=this.getDimensions,n=await e(i.floating);return{reference:ps(i.reference,await t(i.floating),i.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bs(i){return Y(i).direction==="rtl"}var vs={convertOffsetParentRelativeRectToViewportRelativeRect:rs,getDocumentElement:G,getClippingRect:fs,getOffsetParent:Ci,getElementRects:gs,getClientRects:as,getDimensions:ms,getScale:Ct,isElement:V,isRTL:bs};function Li(i,t){return i.x===t.x&&i.y===t.y&&i.width===t.width&&i.height===t.height}function ys(i,t,e){let n=null,s,o=G(i);function r(){var d;clearTimeout(s),(d=n)==null||d.disconnect(),n=null}function a(d,u){d===void 0&&(d=!1),u===void 0&&(u=1),r();let f=i.getBoundingClientRect(),{left:m,top:p,width:b,height:g}=f;if(d||t(),!b||!g)return;let y=Ht(p),w=Ht(o.clientWidth-(m+b)),L=Ht(o.clientHeight-(p+g)),R=Ht(m),H={rootMargin:-y+"px "+-w+"px "+-L+"px "+-R+"px",threshold:j(0,it(1,u))||1},O=!0;function v(q){let I=q[0].intersectionRatio;if(!Li(f,i.getBoundingClientRect()))return a();if(I!==u){if(!O)return a();I?a(!1,I):s=setTimeout(()=>{a(!1,1e-7)},1e3)}O=!1}try{n=new IntersectionObserver(v,{...H,root:o.ownerDocument})}catch{n=new IntersectionObserver(v,H)}n.observe(i)}let l=K(i),c=()=>a(e);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),r()}}function ki(i,t,e,n){n===void 0&&(n={});let{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=ye(i),d=s||o?[...c?At(c):[],...t?At(t):[]]:[];d.forEach(y=>{s&&y.addEventListener("scroll",e),o&&y.addEventListener("resize",e)});let u=c&&a?ys(c,e,o):null,f=-1,m=null;r&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var L;(L=m)==null||L.observe(t)})),e()}),c&&!l&&m.observe(c),t&&m.observe(t));let p,b=l?ht(i):null;l&&g();function g(){let y=ht(i);b&&!Li(b,y)&&e(),b=y,p=requestAnimationFrame(g)}return e(),()=>{var y;d.forEach(w=>{s&&w.removeEventListener("scroll",e),o&&w.removeEventListener("resize",e)}),u==null||u(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(p)}}var Ti=hi;var Oi=fi,Di=ui,Ri=mi;var Ii=(i,t,e)=>{let n=new Map,s=e??{},o={...vs,...s.platform,_c:n};return di(i,t,{...s,platform:o})};function ft(i,t,e={}){let{placement:n="bottom-start",strategy:s="absolute",offset:o=4,flip:r=!0,shift:a=!0,padding:l=8,matchWidth:c=!1}=e,d=[Ti(o),...r?[Di({padding:l})]:[],...a?[Oi({padding:l})]:[],...c?[Ri({apply({rects:f}){Object.assign(t.style,{width:`${f.reference.width}px`})}})]:[]];return t.style.position=s,ki(i,t,async()=>{let f=await Ii(i,t,{placement:n,strategy:s,middleware:d});Object.assign(t.style,{left:`${f.x}px`,top:`${f.y}px`});let m=f.placement.split("-")[0];t.setAttribute("data-side",m)})}var we=class{constructor(i){h(this,"opts");h(this,"buffer","");h(this,"timerId",null);h(this,"timeout");this.opts=i,this.timeout=i.timeout??1e3}handle(i){if(i.length!==1)return!1;this.timerId!==null&&clearTimeout(this.timerId),this.buffer+=i.toLowerCase(),this.timerId=setTimeout(()=>{this.buffer="",this.timerId=null},this.timeout);let t=this.opts.getItemCount();for(let e=0;e<t;e++)if(this.opts.getItemText(e).toLowerCase().startsWith(this.buffer))return this.opts.onMatch(e),!0;return!0}reset(){this.buffer="",this.timerId!==null&&(clearTimeout(this.timerId),this.timerId=null)}};var Mi=class extends z{constructor(){super(...arguments);h(this,"trigger",null);h(this,"content",null);h(this,"valueEl",null);h(this,"items",[]);h(this,"nativeSelect",null);h(this,"hiddenInput",null);h(this,"labelEl",null);h(this,"onLabelClick",t=>{var e;t.target.closest("[data-part=\'trigger\']")||(t.preventDefault(),(e=this.trigger)==null||e.focus())});h(this,"dismiss",null);h(this,"typeahead",null);h(this,"cleanupFloating",null);h(this,"_open",!1);h(this,"_value","");h(this,"highlighted",-1);h(this,"syncing",!1);h(this,"onNativeChange",()=>{this.syncing||this.refresh()});h(this,"onFormReset",()=>setTimeout(()=>this.refresh()));h(this,"onTriggerClick",()=>{this.isDisabled||(this._open?this.close():this.show())});h(this,"onTriggerKeyUp",t=>{t.key===" "&&t.preventDefault()});h(this,"onTriggerKey",t=>{var o,r;if(this.isDisabled)return;let e=this.enabled();if(!this._open){if(t.key==="ArrowDown"||t.key==="ArrowUp"||t.key==="Enter"||t.key===" "||t.altKey&&t.key==="ArrowDown")t.preventDefault(),this.show(),t.key==="ArrowUp"&&e.length&&this.highlight(this.items.indexOf(e[e.length-1]));else if(t.key==="Home"||t.key==="End"){t.preventDefault(),this.show();let a=t.key==="Home"?e[0]:e[e.length-1];a&&this.highlight(this.items.indexOf(a))}else t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&((o=this.typeahead)==null||o.handle(t.key));return}if(!e.length)return;let n=this.highlighted>=0?e.indexOf(this.items[this.highlighted]):-1,s=a=>{t.preventDefault(),this.highlight(this.items.indexOf(e[a]))};switch(t.key){case"ArrowDown":return s(Math.min(n+1,e.length-1));case"ArrowUp":return t.altKey?(t.preventDefault(),this.highlighted>=0&&this.select(this.items[this.highlighted]),this.close()):s(Math.max(n-1,0));case"Home":return s(0);case"End":return s(e.length-1);case"PageDown":return s(Math.min(n+10,e.length-1));case"PageUp":return s(Math.max(n-10,0));case"Enter":case" ":return t.preventDefault(),this.highlighted>=0&&this.select(this.items[this.highlighted]),this.close();case"Tab":return this.highlighted>=0&&this.select(this.items[this.highlighted]),this.close(!1);default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&((r=this.typeahead)==null||r.handle(t.key))}});h(this,"onListClick",t=>{let e=t.target.closest("[data-part=\'item\']");!e||!this.items.includes(e)||W(e)||(this.select(e),this.close())});h(this,"onListPointer",t=>{let e=t.target.closest("[data-part=\'item\']");e&&this.items.includes(e)&&!W(e)&&this.highlight(this.items.indexOf(e))});h(this,"preventBlur",t=>t.preventDefault())}get open(){return this._open}get value(){return this._value}set value(t){let e=this.items.find(n=>n.dataset.value===t);e&&this.select(e,!1)}get isDisabled(){var t;return this.hasAttribute("disabled")||!!((t=this.nativeSelect)!=null&&t.disabled)}refresh(){var n;let t=this.nativeSelect;if(!t)return;let e=this.items.find(s=>s.dataset.value===t.value);e&&this.select(e,!1),(n=this.trigger)==null||n.setAttribute("aria-disabled",String(this.isDisabled))}enabled(){return this.items.filter(t=>!W(t))}setup(){var a,l;if(this.nativeSelect=$(this,"select"),this.nativeSelect&&!$(this,"[data-part=\'trigger\']")&&this.buildFromNative(this.nativeSelect),this.trigger=$(this,"[data-part=\'trigger\']"),this.content=$(this,"[data-part=\'content\']"),this.valueEl=$(this,"[data-part=\'value\']"),!this.trigger||!this.content)return;let{trigger:t,content:e}=this;this.items=et(this,"[data-part=\'item\']");let n=F("db-select");e.id||(e.id=`${n}-listbox`),e.setAttribute("role","listbox"),e.hidden=!0,t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","listbox"),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-controls",e.id),t instanceof HTMLButtonElement&&!t.hasAttribute("type")&&(t.type="button"),this.isDisabled&&t.setAttribute("aria-disabled","true"),this.items.forEach((c,d)=>{c.id||(c.id=`${n}-item-${d}`),c.setAttribute("role","option"),c.setAttribute("aria-selected","false")}),et(this,"[data-part=\'group\']").forEach(c=>{c.setAttribute("role","group");let d=c.querySelector("[data-part=\'label\']");d&&(d.id||(d.id=F("db-select-label")),c.setAttribute("aria-labelledby",d.id))});let s=this.getAttribute("name");s&&!this.nativeSelect&&(this.hiddenInput=document.createElement("input"),this.hiddenInput.type="hidden",this.hiddenInput.name=s,this.hasAttribute("required")&&(this.hiddenInput.required=!0),this.appendChild(this.hiddenInput)),this.typeahead=new we({getItemCount:()=>this.enabled().length,getItemText:c=>{var d,u;return((u=(d=this.enabled()[c])==null?void 0:d.textContent)==null?void 0:u.trim())??""},onMatch:c=>{let d=this.enabled()[c];d&&(this._open?this.highlight(this.items.indexOf(d)):this.select(d))}}),this.dismiss=new lt(e,{onDismiss:c=>this.close(c!=="outside-press")});let o=((a=this.nativeSelect)==null?void 0:a.value)??this.getAttribute("default-value")??"",r=this.items.find(c=>c.dataset.value===o);r&&W(r)?this.valueEl&&(this.valueEl.textContent=((l=r.textContent)==null?void 0:l.trim())??"",this.valueEl.setAttribute("data-placeholder","")):r&&this.select(r,!1),this.setState("closed")}buildFromNative(t){let e=document.createElement("button");e.type="button",e.setAttribute("data-part","trigger"),e.className="db-select-trigger";let n=t.getAttribute("aria-label"),s=t.getAttribute("aria-labelledby"),o=!s&&t.id?document.querySelector(`label[for="${CSS.escape(t.id)}"]`):null;o&&(s=o.id||(o.id=F("db-select-for"))),n&&e.setAttribute("aria-label",n),s&&e.setAttribute("aria-labelledby",s);let r=t.closest("label");if(r){if(this.labelEl=r,!n&&!s){let u=Array.from(r.childNodes).filter(f=>!(f instanceof Element&&(f===t||f.contains(t)||f.localName==="db-select"))).map(f=>f.textContent??"").join(" ").replace(/\\s+/g," ").trim();u&&e.setAttribute("aria-label",u)}}else o&&(this.labelEl=o);let a=document.createElement("span");a.setAttribute("data-part","value"),a.className="db-select-value";let l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("viewBox","0 0 24 24"),l.setAttribute("aria-hidden","true"),l.setAttribute("class","db-select-chevron"),l.innerHTML=\'<path d="m6 9 6 6 6-6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\',e.append(a,l);let c=document.createElement("div");c.setAttribute("data-part","content"),c.className="db-select-content";let d=(u,f)=>{let m=document.createElement("div");m.setAttribute("data-part","item"),m.className="db-select-item",m.dataset.value=u.value;for(let[p,b]of Object.entries(u.dataset))b!=null&&(m.dataset[p]=b);u.disabled&&m.setAttribute("aria-disabled","true"),m.textContent=u.textContent??u.value,f.appendChild(m)};for(let u of Array.from(t.children))if(u instanceof HTMLOptGroupElement){let f=document.createElement("div");f.setAttribute("data-part","group");let m=document.createElement("div");m.setAttribute("data-part","label"),m.className="db-select-label",m.textContent=u.label,f.appendChild(m);for(let p of Array.from(u.children))p instanceof HTMLOptionElement&&d(p,f);c.appendChild(f)}else u instanceof HTMLOptionElement&&d(u,c);t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true"),this.append(e,c)}connect(){var t,e,n,s,o,r,a,l,c,d;(t=this.trigger)==null||t.addEventListener("click",this.onTriggerClick),(e=this.trigger)==null||e.addEventListener("keydown",this.onTriggerKey),(n=this.trigger)==null||n.addEventListener("keyup",this.onTriggerKeyUp),(s=this.nativeSelect)==null||s.addEventListener("change",this.onNativeChange),(r=(o=this.nativeSelect)==null?void 0:o.form)==null||r.addEventListener("reset",this.onFormReset),(a=this.labelEl)==null||a.addEventListener("click",this.onLabelClick),(l=this.content)==null||l.addEventListener("click",this.onListClick),(c=this.content)==null||c.addEventListener("pointermove",this.onListPointer),(d=this.content)==null||d.addEventListener("mousedown",this.preventBlur)}disconnect(){var t,e,n,s,o,r,a,l,c,d;(t=this.trigger)==null||t.removeEventListener("click",this.onTriggerClick),(e=this.trigger)==null||e.removeEventListener("keydown",this.onTriggerKey),(n=this.trigger)==null||n.removeEventListener("keyup",this.onTriggerKeyUp),(s=this.nativeSelect)==null||s.removeEventListener("change",this.onNativeChange),(r=(o=this.nativeSelect)==null?void 0:o.form)==null||r.removeEventListener("reset",this.onFormReset),(a=this.labelEl)==null||a.removeEventListener("click",this.onLabelClick),(l=this.content)==null||l.removeEventListener("click",this.onListClick),(c=this.content)==null||c.removeEventListener("pointermove",this.onListPointer),(d=this.content)==null||d.removeEventListener("mousedown",this.preventBlur),this._open&&this.close(!1)}setState(t){var e;this.setAttribute("data-state",t),(e=this.content)==null||e.setAttribute("data-state",t)}show(){var r,a;let{trigger:t,content:e}=this;if(!t||!e||this._open)return;this._open=!0;let n=vt(e);this.setState("open"),t.setAttribute("aria-expanded","true"),this.cleanupFloating=ft(t,e,{placement:"bottom-start",offset:4,matchWidth:!this.hasAttribute("auto-width"),strategy:n==="top-layer"?"fixed":"absolute"});let o=this.items.find(l=>l.dataset.value===this._value&&!W(l))??this.enabled()[0];o&&this.highlight(this.items.indexOf(o)),(r=this.dismiss)==null||r.activate(),(a=this.typeahead)==null||a.reset(),t.focus()}close(t=!0){var s,o,r;let{trigger:e,content:n}=this;!e||!n||!this._open||(this._open=!1,(s=this.dismiss)==null||s.deactivate(),(o=this.cleanupFloating)==null||o.call(this),this.cleanupFloating=null,yt(n),this.setState("closed"),e.setAttribute("aria-expanded","false"),e.removeAttribute("aria-activedescendant"),this.items.forEach(a=>a.removeAttribute("data-highlighted")),this.highlighted=-1,(r=this.typeahead)==null||r.reset(),t&&e.focus())}highlight(t){var r;let e=this.items[t],n=this.content;if(!e||!n||!this.trigger)return;this.highlighted>=0&&((r=this.items[this.highlighted])==null||r.removeAttribute("data-highlighted")),this.highlighted=t,e.setAttribute("data-highlighted",""),this.trigger.setAttribute("aria-activedescendant",e.id);let s=e.offsetTop,o=s+e.offsetHeight;s<n.scrollTop?n.scrollTop=s:o>n.scrollTop+n.clientHeight&&(n.scrollTop=o-n.clientHeight)}select(t,e=!0){var o;if(W(t))return;let n=t.dataset.value??"",s=n!==this._value;this._value=n;for(let r of this.items){let a=r===t;r.setAttribute("aria-selected",String(a)),a?r.setAttribute("data-state","checked"):r.removeAttribute("data-state")}if(this.valueEl&&(this.valueEl.textContent=((o=t.textContent)==null?void 0:o.trim())??"",this.valueEl.removeAttribute("data-placeholder")),this.hiddenInput&&(this.hiddenInput.value=n),!e||!s){this.nativeSelect&&(this.nativeSelect.value=n);return}if(this.nativeSelect){this.nativeSelect.value=n,this.syncing=!0;try{this.nativeSelect.dispatchEvent(new Event("input",{bubbles:!0})),this.nativeSelect.dispatchEvent(new Event("change",{bubbles:!0}))}finally{this.syncing=!1}}this.dispatchEvent(new CustomEvent("db-select:change",{detail:{value:n},bubbles:!0}))}};N();customElements.get("db-select")||customElements.define("db-select",Mi);var Hi=class extends z{constructor(){super(...arguments);h(this,"trigger",null);h(this,"content",null);h(this,"dismiss",null);h(this,"cleanupFloating",null);h(this,"_open",!1);h(this,"onTriggerClick",()=>this.toggle());h(this,"onContentClick",t=>{let e=t.target.closest("[data-part=\'close\']");e&&e.closest("db-popover")===this&&this.close("close-press")})}get open(){return this._open}setup(){var e;if(this.trigger=bt($(this,"[data-part=\'trigger\']")),this.content=$(this,"[data-part=\'content\']"),!this.trigger||!this.content)return;let t=this.content;t.id||(t.id=F("db-popover")),t.hasAttribute("role")||t.setAttribute("role","dialog"),!t.hasAttribute("aria-labelledby")&&!t.hasAttribute("aria-label")&&((e=this.trigger).id||(e.id=F("db-popover-trigger")),t.setAttribute("aria-labelledby",this.trigger.id)),t.hidden=!0,this.trigger.setAttribute("aria-haspopup","dialog"),this.trigger.setAttribute("aria-controls",t.id),this.trigger.setAttribute("aria-expanded","false"),this.setState("closed"),this.dismiss=new lt(t,{onDismiss:n=>this.close(n)})}connect(){var t,e;(t=this.trigger)==null||t.addEventListener("click",this.onTriggerClick),(e=this.content)==null||e.addEventListener("click",this.onContentClick)}disconnect(){var t,e;(t=this.trigger)==null||t.removeEventListener("click",this.onTriggerClick),(e=this.content)==null||e.removeEventListener("click",this.onContentClick),this._open&&this.close("api")}setState(t){var e;this.setAttribute("data-state",t),(e=this.content)==null||e.setAttribute("data-state",t)}placement(){var s,o;let t=this.getAttribute("placement");if(t)return t;let e=((s=this.content)==null?void 0:s.dataset.side)||"bottom",n=((o=this.content)==null?void 0:o.dataset.align)||"center";return`${e}${n!=="center"?`-${n}`:""}`}toggle(){this._open?this.close("trigger-press"):this.show()}show(){var s;let{trigger:t,content:e}=this;if(!t||!e||this._open)return;this._open=!0;let n=vt(e);this.setState("open"),t.setAttribute("aria-expanded","true"),this.cleanupFloating=ft(t,e,{placement:this.placement(),offset:Number(this.getAttribute("offset")??8),strategy:n==="top-layer"?"fixed":"absolute"}),(s=this.dismiss)==null||s.activate(),this.hasAttribute("no-autofocus")||requestAnimationFrame(()=>{this._open&&(Pe(e)[0]??e).focus({preventScroll:!0})}),this.dispatchEvent(new CustomEvent("db-popover:open",{bubbles:!0}))}close(t="api"){var o,r;let{trigger:e,content:n}=this;if(!e||!n||!this._open)return;this._open=!1,(o=this.dismiss)==null||o.deactivate(),(r=this.cleanupFloating)==null||r.call(this),this.cleanupFloating=null;let s=n.contains(document.activeElement);yt(n),this.setState("closed"),e.setAttribute("aria-expanded","false"),t!=="outside-press"&&(s||t==="escape-key"||t==="close-press")&&e.focus(),this.dispatchEvent(new CustomEvent("db-popover:close",{detail:{reason:t},bubbles:!0}))}};N();customElements.get("db-popover")||customElements.define("db-popover",Hi);var zi=class extends z{constructor(){super(...arguments);h(this,"trigger",null);h(this,"content",null);h(this,"cleanupFloating",null);h(this,"showTimer",null);h(this,"hideTimer",null);h(this,"_open",!1);h(this,"onEnter",t=>{t.pointerType!=="touch"&&(this.clearTimers(),this._open||(this.showTimer=setTimeout(()=>this.show(),this.num("delay",200))))});h(this,"onLeave",t=>{t.pointerType!=="touch"&&(this.clearTimers(),this.hideTimer=setTimeout(()=>this.hide(),this.num("close-delay",100)))});h(this,"onContentEnter",()=>this.clearTimers());h(this,"onFocus",()=>{let t=!0;try{t=this.trigger.matches(":focus-visible")}catch{}t&&(this.clearTimers(),this.show())});h(this,"onBlur",()=>this.hide());h(this,"onPress",()=>this.hide());h(this,"onKey",t=>{t.key==="Escape"&&this._open&&(t.preventDefault(),t.stopImmediatePropagation(),this.hide())})}get open(){return this._open}num(t,e){let n=Number(this.getAttribute(t));return Number.isFinite(n)&&this.hasAttribute(t)?n:e}setup(){var e;if(this.trigger=bt($(this,"[data-part=\'trigger\']")),this.content=$(this,"[data-part=\'content\']"),!this.trigger||!this.content)return;(e=this.content).id||(e.id=F("db-tooltip")),this.content.setAttribute("role","tooltip"),this.content.hidden=!0;let t=(this.trigger.getAttribute("aria-describedby")??"").split(/\\s+/).filter(Boolean);t.includes(this.content.id)||this.trigger.setAttribute("aria-describedby",[...t,this.content.id].join(" ")),this.setState("closed")}connect(){let{trigger:t,content:e}=this;!t||!e||(t.addEventListener("pointerenter",this.onEnter),t.addEventListener("pointerleave",this.onLeave),t.addEventListener("focus",this.onFocus),t.addEventListener("blur",this.onBlur),t.addEventListener("pointerdown",this.onPress),e.addEventListener("pointerenter",this.onContentEnter),e.addEventListener("pointerleave",this.onLeave))}disconnect(){let{trigger:t,content:e}=this;t==null||t.removeEventListener("pointerenter",this.onEnter),t==null||t.removeEventListener("pointerleave",this.onLeave),t==null||t.removeEventListener("focus",this.onFocus),t==null||t.removeEventListener("blur",this.onBlur),t==null||t.removeEventListener("pointerdown",this.onPress),e==null||e.removeEventListener("pointerenter",this.onContentEnter),e==null||e.removeEventListener("pointerleave",this.onLeave),this.hide()}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.showTimer=this.hideTimer=null}setState(t){var e;this.setAttribute("data-state",t),(e=this.content)==null||e.setAttribute("data-state",t)}show(){let{trigger:t,content:e}=this;if(!t||!e||this._open)return;this._open=!0,this.clearTimers();let n=vt(e);this.setState("open"),this.cleanupFloating=ft(t,e,{placement:this.getAttribute("placement")||e.dataset.side||"top",offset:8,strategy:n==="top-layer"?"fixed":"absolute"}),document.addEventListener("keydown",this.onKey,!0),this.dispatchEvent(new CustomEvent("db-tooltip:open",{bubbles:!0}))}hide(){var t;this.clearTimers(),!(!this._open||!this.content)&&(this._open=!1,document.removeEventListener("keydown",this.onKey,!0),(t=this.cleanupFloating)==null||t.call(this),this.cleanupFloating=null,yt(this.content),this.setState("closed"),this.dispatchEvent(new CustomEvent("db-tooltip:close",{bubbles:!0})))}};N();customElements.get("db-tooltip")||customElements.define("db-tooltip",zi);var Ni="sidebar_state",ws="b",Es=768,Pt=new WeakMap;function xs(i){try{return localStorage.getItem(i)}catch{return null}}function As(i,t){try{localStorage.setItem(i,t)}catch{}}function Ae(i){if(Pt.has(i))return;let t=i.querySelector("[data-component=\'sidebar\']");if(!t)return;let e=t.dataset.collapsible||"offcanvas",n=t.dataset.side||"left",s=t.dataset.defaultOpen!=="false",o=xs(Ni),r=o!==null?o==="true":s,a=t.querySelector("[data-sidebar-desktop]"),l=t.querySelector("[data-sidebar-mobile]"),c=t.querySelector("[data-sidebar-mobile-backdrop]"),d=window.matchMedia(`(max-width: ${Es-1}px)`),u={provider:i,sidebar:t,desktopSidebar:a,mobileSidebar:l,mobileBackdrop:c,collapsible:e,side:n,open:r,openMobile:!1,isMobile:d.matches,mediaQuery:d};Pt.set(i,u),_i(u);let f=b=>{u.isMobile=b.matches,!b.matches&&u.openMobile&&ot(i)};d.addEventListener("change",f);let m=b=>{b.key===ws&&(b.metaKey||b.ctrlKey)?(b.preventDefault(),Ee(i)):b.key==="Escape"&&u.openMobile&&(b.preventDefault(),ot(i))};document.addEventListener("keydown",m),Ss(i,u),c&&c.addEventListener("click",()=>{ot(i)});let p=t.querySelector("[data-part=\'rail\']");p&&p.addEventListener("click",()=>{Ee(i)})}function Ss(i,t){i.querySelectorAll("[data-part=\'sidebar-trigger\']").forEach(e=>{e.addEventListener("click",()=>{Ee(i)})})}function Ee(i){let t=Pt.get(i);t&&(t.isMobile?t.openMobile?ot(i):Cs(i):(t.open=!t.open,_i(t),As(Ni,String(t.open))))}function _i(i){let t=i.open?"expanded":"collapsed";i.provider.setAttribute("data-state",t),i.sidebar.setAttribute("data-state",t),i.desktopSidebar&&(i.desktopSidebar.setAttribute("data-state",t),i.open?i.desktopSidebar.setAttribute("data-collapsible",""):i.desktopSidebar.setAttribute("data-collapsible",i.collapsible))}function Cs(i){var n;let t=Pt.get(i);if(!t||t.openMobile||!t.mobileSidebar)return;t.openMobile=!0;let e=(n=t.desktopSidebar)==null?void 0:n.querySelector("[data-sidebar=\'sidebar-inner\']");if(e)for(;e.firstChild;)t.mobileSidebar.appendChild(e.firstChild);t.mobileSidebar.hidden=!1,t.mobileSidebar.setAttribute("data-state","open"),t.mobileBackdrop&&(t.mobileBackdrop.hidden=!1),at.activate(),requestAnimationFrame(()=>{var o;let s=(o=t.mobileSidebar)==null?void 0:o.querySelector(\'a, button, [tabindex]:not([tabindex="-1"])\');s==null||s.focus()})}function ot(i){var s;let t=Pt.get(i);if(!t||!t.openMobile||!t.mobileSidebar)return;t.openMobile=!1;let e=(s=t.desktopSidebar)==null?void 0:s.querySelector("[data-sidebar=\'sidebar-inner\']");if(e&&t.mobileSidebar)for(;t.mobileSidebar.firstChild;)e.appendChild(t.mobileSidebar.firstChild);t.mobileSidebar.setAttribute("data-state","closed"),t.mobileSidebar.hidden=!0,t.mobileBackdrop&&(t.mobileBackdrop.hidden=!0),at.deactivate();let n=t.provider.querySelector("[data-part=\'sidebar-trigger\']");n==null||n.focus()}function xe(){document.querySelectorAll("[data-component=\'sidebar-provider\']").forEach(i=>{Ae(i)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",xe):xe();document.addEventListener("astro:page-load",xe);var Qt={docs:"docs.js",shard:i=>`t-${i}.js`,fragment:i=>`f-${i}.js`},Jt={docs:"docs",shard:i=>i,fragment:i=>`frag:${i}`};var Ls={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},ks={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},Ts="[^aeiou]",Ce="[aeiouy]",rt="("+Ts+"[^aeiouy]*)",ee="("+Ce+"[aeiou]*)",Se=new RegExp("^"+rt+"?"+ee+rt),Os=new RegExp("^"+rt+"?"+ee+rt+ee+"?$"),te=new RegExp("^"+rt+"?("+ee+rt+"){2,}"),Pi=new RegExp("^"+rt+"?"+Ce),Fi=new RegExp("^"+rt+Ce+"[^aeiouwxy]$"),Ds=/ll$/,Rs=/^(.+?)e$/,Is=/^(.+?)y$/,Ms=/^(.+?(s|t))(ion)$/,Hs=/^(.+?)(ed|ing)$/,zs=/(at|bl|iz)$/,Ns=/^(.+?)eed$/,_s=/^.+?[^s]s$/,Ps=/^.+?(ss|i)es$/,Fs=/([^aeiouylsz])\\1$/,$s=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,Bs=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,qs=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;function $i(i){let t=String(i).toLowerCase();if(t.length<3)return t;let e=!1;t.codePointAt(0)===121&&(e=!0,t="Y"+t.slice(1)),Ps.test(t)?t=t.slice(0,-2):_s.test(t)&&(t=t.slice(0,-1));let n;return(n=Ns.exec(t))?Se.test(n[1])&&(t=t.slice(0,-1)):(n=Hs.exec(t))&&Pi.test(n[1])&&(t=n[1],zs.test(t)?t+="e":Fs.test(t)?t=t.slice(0,-1):Fi.test(t)&&(t+="e")),(n=Is.exec(t))&&Pi.test(n[1])&&(t=n[1]+"i"),(n=$s.exec(t))&&Se.test(n[1])&&(t=n[1]+Ls[n[2]]),(n=Bs.exec(t))&&Se.test(n[1])&&(t=n[1]+ks[n[2]]),(n=qs.exec(t))?te.test(n[1])&&(t=n[1]):(n=Ms.exec(t))&&te.test(n[1])&&(t=n[1]),(n=Rs.exec(t))&&(te.test(n[1])||Os.test(n[1])&&!Fi.test(n[1]))&&(t=n[1]),Ds.test(t)&&te.test(t)&&(t=t.slice(0,-1)),e&&(t="y"+t.slice(1)),t}var Bi=new Set("a an and are as at be by for from has have in is it its of on or that the this to was were will with you your can not".split(" ")),Ks=/[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}]/u,Ft;function Ws(i){if(Ft===void 0)try{Ft=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"word"}):null}catch{Ft=null}if(Ft)return[...Ft.segment(i)].filter(n=>n.isWordLike).map(n=>n.segment);let t=[...i];if(t.length<2)return t;let e=[];for(let n=0;n<t.length-1;n++)e.push(t[n]+t[n+1]);return e}function mt(i){let t=[];for(let e of i.toLowerCase().normalize("NFKD").replace(/[\u0300-\u036F]/g,"").normalize("NFC").matchAll(/[\\p{L}\\p{N}][\\p{L}\\p{N}_.-]*[\\p{L}\\p{N}]|[\\p{L}\\p{N}]/gu)){let n=e[0],s=n.split(/[._-]+/).filter(Boolean);if(s.length>1&&t.push(n),s.length>1&&!/[._]/.test(n)){let o=s.join("");o.length>=3&&!Bi.has(o)&&t.push(o)}for(let o of s)Ks.test(o)?t.push(...Ws(o)):o.length>=2&&!Bi.has(o)&&t.push(o)}return t}function Le(i,t){let e="";for(let n of i.slice(0,t))e+=/[a-z0-9]/.test(n)?n:`_${n.codePointAt(0).toString(16)}_`;return e}function $t(i){if(!(!i||!/^en(-|$)/i.test(i)))return t=>/^[a-z]{3,}$/.test(t)?$i(t):t}function Lt(i){let t=[],e=[],n=[],s=!1,o={tag:[],section:[]},r={tag:[],section:[]},a=[...i.matchAll(new RegExp(\'(?<!\\\\S)(-?)(tag|section):(?:"([^"]*)"?|(\\\\S*))|(-?)"([^"]*)"?|(\\\\S+)\',"gi"))].map(u=>{var f;return{facetNeg:u[1]==="-",facet:(f=u[2])==null?void 0:f.toLowerCase(),value:u[3]??u[4],neg:u[5],phrase:u[6],word:u[7]}}),l=!1,c=!1;for(let[u,f]of a.entries()){if(f.facet){let H=Yi(f.value??"");H&&(f.facetNeg?r:o)[f.facet].push(H);continue}let m=f.word;if(m==="OR"){c=t.length>0,s=!0;continue}if(m==="NOT"){l=!0,s=!0;continue}if(m==="AND"){s=!0;continue}let p=f.phrase!==void 0,b=l||f.neg==="-"||(m==null?void 0:m.startsWith("-"))&&m.length>1;l=!1;let g=p?f.phrase:b&&(m!=null&&m.startsWith("-"))?m.slice(1):m,y=[...new Set(mt(g))];if(!y.length){c=!1;continue}if(b){e.push(p?y:[y[0]]),s=!0,c=!1;continue}if(p){c=!1,s=!0,y.length>1&&n.push(mt(g).join(" "));for(let H of y)t.push({terms:[H],prefix:!1,exact:!0});continue}let w=u===a.length-1&&!/\\s$/.test(i);if(c){t[t.length-1].terms.push(y[0]);for(let H of y.slice(1))t.push({terms:[H],prefix:!1});c=!1;continue}let L=y[0],R=/[._-]/.test(L),M=L.replace(/-/g,"");for(let[H,O]of y.entries())t.push({terms:[O],prefix:w&&O.length>=2&&(H===y.length-1||R&&(O===L||O===M))})}let d=[...new Set(t.flatMap(u=>u.terms))];return{groups:t,not:e,phrases:n,strict:s,highlight:d,filters:o,notFilters:r}}async function js(i,t){let e=await t.meta(),n=typeof i=="string"?Lt(i):i,s=new Set;for(let c of n.not){let d;for(let u of c){let[f]=Vi(u,e),m=f?await t.shard(f):void 0,p=m&&Object.hasOwn(m,u)?m[u]:[],b=new Set;for(let g=0;g<p.length;g+=2)(!d||d.has(p[g]))&&b.add(p[g]);d=b}for(let u of d??[])s.add(u)}let o=Us(n,e);if(!n.groups.length){if(!o)return[];let c=[];return e.docs.forEach(([d,u,f],m)=>o(m)&&!s.has(m)&&c.push({id:m,title:d,url:u,section:e.sections[f]??"",score:1})),c}let r=[];for(let c of n.groups)r.push(await Xs(c,e,t));let a=c=>{let d=new Map,u=new Map;for(let m of r)for(let[p,b]of m)d.set(p,(d.get(p)??0)+b),u.set(p,(u.get(p)??0)+1);let f=[];for(let[m,p]of d){if(s.has(m)||o&&!o(m)||c==="and"&&u.get(m)!==r.length)continue;let[b,g,y]=e.docs[m];f.push({id:m,title:b,url:g,section:e.sections[y]??"",score:p*(u.get(m)/r.length)})}return f.sort((m,p)=>p.score-m.score)},l=a("and");return l.length||n.strict?l:a("or")}var Z={prefix:.6,stem:.4,titleAll:1.5,titleExact:2,headingAll:1.4,headingExact:1.8,phrase:1.5,typo:.3};function Vs(i,t){if(i===t)return!1;if(i.length===t.length){let o=[];for(let r=0;r<i.length&&o.length<=2;r++)i[r]!==t[r]&&o.push(r);return o.length===1?!0:o.length===2&&o[1]===o[0]+1&&i[o[0]]===t[o[1]]&&i[o[1]]===t[o[0]]}let[e,n]=i.length<t.length?[i,t]:[t,i];if(n.length-e.length!==1)return!1;let s=0;for(;s<e.length&&e[s]===n[s];)s++;return e.slice(s)===n.slice(s+1)}function Vi(i,t,e=!1){let n=Ys(t);for(let o=Math.min(i.length,Ki);o>=1;o--){let r=Le(i,o);if(n.has(r))return!e||o<i.length?[r]:[r,...t.shards.filter(a=>a.length>r.length&&a.startsWith(r)).slice(0,10)]}let s=Le(i,Math.min(i.length,Ki));return e?t.shards.filter(o=>o.startsWith(s)).slice(0,10):[]}var Ki=3,Wi=new WeakMap;function Ys(i){let t=Wi.get(i);return t||Wi.set(i,t=new Set(i.shards)),t}function Yi(i){return i.replace(/"/g,"").trim().toLowerCase()}function Us(i,t){let{tag:e,section:n}=i.filters,s=i.notFilters??{tag:[],section:[]};if(!e.length&&!n.length&&!s.tag.length&&!s.section.length)return;let o=(d,u)=>new Set(d.flatMap((f,m)=>u.includes(Yi(f))?[m]:[])),r=o(t.sections,n),a=o(t.tags??[],e),l=o(t.sections,s.section),c=o(t.tags??[],s.tag);return d=>{let u=t.docs[d],f=u[3]??[];return!(n.length&&!r.has(u[2])||e.length&&!f.some(m=>a.has(m))||l.has(u[2])||f.some(m=>c.has(m)))}}async function Xs(i,t,e){i.corrected=void 0;let n=$t(t.lang),s=new Map,o=new Map;for(let d of i.terms)for(let u of Vi(d,t,i.prefix)){let f=await e.shard(u);if(!f)continue;let m=(y,w)=>{w>(s.get(y)??0)&&(s.set(y,w),o.set(y,f))};Object.hasOwn(f,d)&&m(d,1);let p=n==null?void 0:n(d),b=p?p.slice(0,Math.max(3,p.length-1)):void 0,g=0;for(let y in f)y!==d&&(i.prefix&&y.startsWith(d)&&g++<200&&m(y,Z.prefix),p&&b&&y.startsWith(b)&&n(y)===p&&m(y,Z.stem));if(!s.size&&!i.exact&&d.length>=4&&!/[._-]/.test(d))for(let y in f)Math.abs(y.length-d.length)<=1&&Vs(d,y)&&m(y,Z.typo)}[...s.values()].some(d=>d===Z.typo)&&(i.corrected=[...s].filter(([,d])=>d===Z.typo).map(([d])=>d));let r=[...s].map(([d,u])=>[o.get(d)[d],u]),a=new Set;for(let[d]of r)for(let u=0;u<d.length;u+=2)a.add(d[u]);let l=Math.log(1+(t.count-a.size+.5)/(a.size+.5)),c=new Map;for(let[d,u]of r)for(let f=0;f<d.length;f+=2)c.set(d[f],Math.max(c.get(d[f])??0,d[f+1]*u*l));return c}async function Ui(i,t){var o;let e=await t.meta(),n=[...new Set(i.map(r=>Math.floor(r.id/e.block)))],s=new Map;await Promise.all(n.map(async r=>s.set(r,await t.fragment(r))));for(let r of i)r.fragment??(r.fragment=(o=s.get(Math.floor(r.id/e.block)))==null?void 0:o[r.id%e.block])}async function Gs(i,t,e,n=10){let s=t.slice(0,n);await Ui(s,e);let o=i.groups,r=$t((await e.meta()).lang),a=(l,c)=>c.terms.some(d=>l===d||c.prefix&&l.startsWith(d)||r!==void 0&&r(l)===r(d))||(c.corrected??[]).includes(l);for(let l of s){let[c,d]=l.fragment??["",[]],u=mt(l.title),f=1;o.length&&o.every(p=>u.some(b=>a(b,p)))&&(f=ji(u,o,a)?Z.titleExact:Z.titleAll);let m=[];for(let[p,b]of d){let g=mt(p);!o.length||!o.every(y=>g.some(w=>a(w,y)))||(m.push([p,b]),f=Math.max(f,ji(g,o,a)?Z.headingExact:Z.headingAll))}if(l.sections=m.slice(0,3),i.phrases.length){let p=[l.title,c,...d.map(([b])=>b)].map(b=>mt(b).join(" ")).join(" \\0 ");i.phrases.every(b=>p.includes(b))&&(f*=Z.phrase)}l.score*=f}return s.sort((l,c)=>c.score-l.score),[...s,...t.slice(n)]}async function Xi(i,t,e){await Ui(t,e);let n=$t((await e.meta()).lang),s=(o,r)=>r.terms.some(a=>o===a||r.prefix&&o.startsWith(a)||n!==void 0&&n(o)===n(a))||(r.corrected??[]).includes(o);for(let o of t)!o.fragment||o.sections||(o.sections=o.fragment[1].filter(([r])=>{let a=mt(r);return i.groups.length>0&&i.groups.every(l=>a.some(c=>s(c,l)))}).slice(0,3))}function ji(i,t,e){return i.every(n=>t.some(s=>e(n,s)))&&t.every(n=>i.some(s=>e(s,n)))}async function Gi(i,t,e=10){let n=Lt(i),s=$t((await t.meta()).lang);s&&(n.highlight=[...new Set([...n.highlight,...n.highlight.map(s).filter(r=>r.length>=3)])]);let o=await js(n,t);return n.highlight=[...new Set([...n.highlight,...n.groups.flatMap(r=>r.corrected??[])])],{parsed:n,results:await Gs(n,o,t,e)}}function Zi(i,t,e=globalThis){let n=new Map,s=e.__DOGSBAY_SEARCH__??{q:[],load(){}};for(let[l,c]of s.q)n.set(l,c);s.q=[],s.load=(l,c)=>void n.set(l,c),e.__DOGSBAY_SEARCH__=s;let o=async(l,c)=>(n.has(l)||await t(i+c),n.get(l)),r,a={meta:()=>r??(r=o(Jt.docs,Qt.docs).then(l=>{if(!l||l.format!==4)throw new Error(`search index format ${(l==null?void 0:l.format)??"missing"}, expected ${4}: rebuild the site`);return l})),shard:async l=>(await a.meta()).shards.includes(l)?o(Jt.shard(l),Qt.shard(l)):void 0,fragment:l=>o(Jt.fragment(l),Qt.fragment(l))};return a}function Qi(i){let t,e=new URL(i||"./",location.href).pathname;return async n=>{t??(t=import(new URL(`${i}pagefind/pagefind.js`,location.href).href).catch(d=>{throw t=void 0,d}));let s=n.replace(new RegExp(\'(?<!\\\\S)-?(tag|section):("[^"]*"?|\\\\S*)\',"gi")," ").trim(),o=s?await(await t).search(s):null,r=(o==null?void 0:o.results)??[],a=async(d,u)=>{let f=await d.data(),m=f.url.startsWith(e)?f.url.slice(e.length):f.url.replace(/^\\/+/,""),p=(f.sub_results??[]).map(b=>[b.title,b.url.split("#")[1]??""]).filter(([,b])=>b);return{id:u,title:f.meta.title??m,url:m,section:"",score:r.length-u,fragment:[Zs(f.excerpt),p],sections:p.slice(0,3)}},l=await Promise.all(r.slice(0,10).map(a)),c=Promise.all(r.slice(10,30).map((d,u)=>a(d,u+10)));return c.catch(()=>{}),{results:l,more:c,total:r.length,highlight:Lt(n).highlight}}}function Zs(i){return new DOMParser().parseFromString(i,"text/html").body.textContent??""}function Ji(i){let{signal:t}=i,e=document.getElementById("db-search");if(!e)return;let n=e.querySelector("[data-db-search-input]"),s=e.querySelector("[data-part=\'listbox\']"),o=e.querySelector("[data-db-search-status]"),r=o.textContent??"",a=Zi(`${i.unitRoot}_dogsbay/search/`,i.loadScript,window),l=document.body.dataset.search??"builtin",c=location.protocol!=="file:",d=l==="pagefind"||l==="both"&&c?Qi(i.unitRoot):void 0,u=l==="pagefind"&&!c;e.addEventListener("db-dialog:open",()=>{n.focus(),n.select(),u?o.textContent=s.dataset.needsServer??"":d||a.meta().catch(()=>o.textContent="Search index could not be loaded.")},{signal:t}),document.addEventListener("keydown",S=>{let x=S.target.closest("input, textarea, select, [contenteditable]");(S.key==="/"&&!x||S.key.toLowerCase()==="k"&&(S.metaKey||S.ctrlKey))&&(S.preventDefault(),e.open?n.focus():e.show())},{signal:t}),s.addEventListener("click",S=>{S.target.closest("a")&&e.close("api")},{signal:t});let f=0,m,p;n.addEventListener("input",()=>{clearTimeout(p),p=setTimeout(()=>void y(++f),80)},{signal:t});let b=new Map,g=typeof IntersectionObserver=="function"?new IntersectionObserver(S=>{var x;for(let E of S)E.isIntersecting&&((x=b.get(E.target))==null||x(),b.delete(E.target),g.unobserve(E.target))}):void 0,y=async S=>{let x=n.value.trim();if(!x){g==null||g.disconnect(),b.clear(),w.hidden=!0,s.replaceChildren(),o.textContent=r;return}if(!u)try{if(d){let E=await d(x);if(S!==f)return;O(x,E.results,E.highlight,E.total);let C=await E.more;S===f&&C.length&&v(x,C,E.highlight)}else{let E=await Gi(x,a);if(S!==f)return;m=E.parsed,O(x,E.results.slice(0,30),E.parsed.highlight,E.results.length,E.results)}}catch{S===f&&(o.textContent="Search index could not be loaded.")}},w=document.createElement("div");w.setAttribute("role","group"),w.setAttribute("aria-label",s.dataset.filterSection??"Filter by section"),w.className="flex flex-wrap gap-1 px-3 pb-2",w.hidden=!0,s.before(w),t==null||t.addEventListener("abort",()=>{clearTimeout(p),f++,g==null||g.disconnect(),b.clear(),w.remove()});let L=S=>S.replace(/"/g,""),R=S=>`section:"${L(S)}"`,M,H=(S,x)=>{let E=new Map;for(let k of x)k.section&&E.set(k.section,(E.get(k.section)??0)+1);let C=[...S.matchAll(/section:"([^"]*)"/gi)].map(k=>k[1].toLowerCase()),T=k=>C.includes(L(k).toLowerCase()),A=[...E].sort((k,D)=>D[1]-k[1]).slice(0,6).map(([k])=>k);for(let k of C)A.some(D=>L(D).toLowerCase()===k)||A.push(k);w.replaceChildren(...A.length>1||C.length?A.map(k=>{let D=document.createElement("button");D.type="button";let _=T(k);return D.setAttribute("aria-pressed",String(_)),D.className="rounded-full border px-2.5 py-0.5 text-xs hover:bg-accent aria-pressed:bg-primary aria-pressed:text-primary-foreground",D.textContent=k,D.addEventListener("click",()=>{let P=R(k),tt=n.value.replace(new RegExp(`\\\\s*section:"${L(k).replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}"`,"i"),"").trim();n.value=_?tt:`${tt} ${P}`.trim(),M=k,n.dispatchEvent(new Event("input",{bubbles:!0}))},{signal:t}),D}):[]),w.hidden=!w.childElementCount,M!==void 0&&(([...w.querySelectorAll("button")].find(D=>D.textContent===M)??n).focus(),M=void 0)},O=(S,x,E,C,T=x)=>{g==null||g.disconnect(),b.clear(),H(S,T),s.replaceChildren(...q(S,x,E)),o.textContent=C?`${C} result${C===1?"":"s"}`:`${s.dataset.noResults} \\u201C${S}\\u201D`},v=(S,x,E)=>s.append(...q(S,x,E)),q=(S,x,E)=>{let C=[];for(let T of x){let A=I(T.url,E,"block rounded-md p-3 hover:bg-accent"),k=document.createElement("div");if(k.className="font-medium",k.append(...ke(T.title,E)),A.a.appendChild(k),T.section){let P=document.createElement("div");P.className="text-xs text-muted-foreground",P.textContent=T.section,A.a.appendChild(P)}let D=document.createElement("div");D.className="mt-1 line-clamp-2 text-xs text-muted-foreground",A.a.appendChild(D),C.push(A.li);let _=()=>T.fragment?(T.fragment[0]&&D.replaceChildren(...ke(T.fragment[0],E)),(T.sections??[]).map(([P,tt])=>{let qt=I(`${T.url}#${tt}`,E,"ml-4 block rounded-md border-l px-3 py-1.5 text-sm hover:bg-accent");return qt.a.append(...ke(P,E)),qt.li})):[];if(T.fragment)C.push(..._());else if(g){let P=m??Lt(S);b.set(A.li,()=>void Xi(P,[T],a).then(()=>A.li.after(..._()),()=>{})),g.observe(A.li)}}return C},I=(S,x,E)=>{let C=document.createElement("li");C.setAttribute("role","none"),C.className="mb-1";let T=document.createElement("a");return T.setAttribute("data-part","option"),T.dataset.value=S,T.href=Qs(i.unitRoot+S,x),T.tabIndex=-1,T.className=E,C.appendChild(T),{li:C,a:T}}}function Qs(i,t){if(!t.length)return i;let e=i.indexOf("#"),[n,s]=e<0?[i,""]:[i.slice(0,e),i.slice(e)];return`${n}${n.includes("?")?"&":"?"}h=${encodeURIComponent(t.join(" "))}${s}`}function ke(i,t){if(!t.length)return[document.createTextNode(i)];let e=new RegExp(`(${t.map(n=>n.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")).join("|")})`,"gi");return i.split(e).map((n,s)=>{if(s%2===0)return document.createTextNode(n);let o=document.createElement("mark");return o.textContent=n,o})}var tn=/[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}]/u;function en(i){var b;let t;try{t=(new URLSearchParams(location.search).get("h")??"").split(/\\s+/).filter(g=>g.length>0)}catch{return}let e=document.querySelector("#db-content article")??document.querySelector("#db-content");if(!t.length||!e)return;let n=g=>g.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&"),s=[...t].sort((g,y)=>y.length-g.length),o=s.filter(g=>tn.test(g)).map(n),r=s.filter(g=>!tn.test(g)).map(n),a=[r.length?`(?<![\\\\p{L}\\\\p{N}])(?:${r.join("|")})`:"",o.length?`(?:${o.join("|")})`:""].filter(Boolean),l=new RegExp(`(${a.join("|")})`,"giu"),c=[],d=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:g=>{var y;return(y=g.parentElement)!=null&&y.closest("script, style, mark, button, [aria-hidden=\'true\']")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),u=[];for(let g=d.nextNode();g;g=d.nextNode())u.push(g);for(let g of u){if(c.length>=500)break;let y=g.data;if(l.lastIndex=0,!l.test(y))continue;l.lastIndex=0;let w=document.createDocumentFragment(),L=0;for(let R of y.matchAll(l)){w.append(y.slice(L,R.index));let M=document.createElement("mark");M.className="db-search-hl",M.textContent=R[0],w.append(M),c.push(M),L=R.index+R[0].length}w.append(y.slice(L)),g.replaceWith(w)}if(Js(),!c.length)return;let f=((b=document.querySelector("[data-clear-highlights]"))==null?void 0:b.dataset.clearHighlights)??"Clear highlights",m=document.createElement("div");m.className="not-prose mb-4";let p=document.createElement("button");p.type="button",p.className="inline-flex h-8 items-center rounded-md border px-3 text-sm hover:bg-accent",p.textContent=f,p.addEventListener("click",()=>{var g;for(let y of c)y.replaceWith(document.createTextNode(y.textContent??""));e.normalize(),m.remove(),(g=document.getElementById("db-content"))==null||g.focus({preventScroll:!0})},{signal:i}),m.append(p),e.prepend(m),location.hash||c[0].scrollIntoView({block:"center"})}function Js(){try{let i=new URL(location.href);i.searchParams.delete("h"),history.replaceState(history.state,"",i.toString())}catch{}}var pt=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},ie=function(t){return t.tagName==="IMG"},to=function(t){return NodeList.prototype.isPrototypeOf(t)},ne=function(t){return t&&t.nodeType===1},nn=function(t){var e=t.currentSrc||t.src;return e.substr(-4).toLowerCase()===".svg"},sn=function(t){try{return Array.isArray(t)?t.filter(ie):to(t)?[].slice.call(t).filter(ie):ne(t)?[t].filter(ie):typeof t=="string"?[].slice.call(document.querySelectorAll(t)).filter(ie):[]}catch{throw new TypeError(`The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList or an array.\nSee: https://github.com/francoischalifour/medium-zoom`)}},eo=function(t){var e=document.createElement("div");return e.classList.add("medium-zoom-overlay"),e.style.background=t,e},io=function(t){var e=t.getBoundingClientRect(),n=e.top,s=e.left,o=e.width,r=e.height,a=t.cloneNode(),l=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,c=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return a.removeAttribute("id"),a.style.position="absolute",a.style.top=n+l+"px",a.style.left=s+c+"px",a.style.width=o+"px",a.style.height=r+"px",a.style.transform="",a},kt=function(t,e){var n=pt({bubbles:!1,cancelable:!1,detail:void 0},e);if(typeof window.CustomEvent=="function")return new CustomEvent(t,n);var s=document.createEvent("CustomEvent");return s.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),s},no=function i(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=window.Promise||function(x){function E(){}x(E,E)},s=function(x){var E=x.target;if(E===q){p();return}L.indexOf(E)!==-1&&b({target:E})},o=function(){if(!(M||!v.original)){var x=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(H-x)>O.scrollOffset&&setTimeout(p,150)}},r=function(x){var E=x.key||x.keyCode;(E==="Escape"||E==="Esc"||E===27)&&p()},a=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=x;if(x.background&&(q.style.background=x.background),x.container&&x.container instanceof Object&&(E.container=pt({},O.container,x.container)),x.template){var C=ne(x.template)?x.template:document.querySelector(x.template);E.template=C}return O=pt({},O,E),L.forEach(function(T){T.dispatchEvent(kt("medium-zoom:update",{detail:{zoom:I}}))}),I},l=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return i(pt({},O,x))},c=function(){for(var x=arguments.length,E=Array(x),C=0;C<x;C++)E[C]=arguments[C];var T=E.reduce(function(A,k){return[].concat(A,sn(k))},[]);return T.filter(function(A){return L.indexOf(A)===-1}).forEach(function(A){L.push(A),A.classList.add("medium-zoom-image")}),R.forEach(function(A){var k=A.type,D=A.listener,_=A.options;T.forEach(function(P){P.addEventListener(k,D,_)})}),I},d=function(){for(var x=arguments.length,E=Array(x),C=0;C<x;C++)E[C]=arguments[C];v.zoomed&&p();var T=E.length>0?E.reduce(function(A,k){return[].concat(A,sn(k))},[]):L;return T.forEach(function(A){A.classList.remove("medium-zoom-image"),A.dispatchEvent(kt("medium-zoom:detach",{detail:{zoom:I}}))}),L=L.filter(function(A){return T.indexOf(A)===-1}),I},u=function(x,E){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return L.forEach(function(T){T.addEventListener("medium-zoom:"+x,E,C)}),R.push({type:"medium-zoom:"+x,listener:E,options:C}),I},f=function(x,E){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return L.forEach(function(T){T.removeEventListener("medium-zoom:"+x,E,C)}),R=R.filter(function(T){return!(T.type==="medium-zoom:"+x&&T.listener.toString()===E.toString())}),I},m=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=x.target,C=function(){var A={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},k=void 0,D=void 0;if(O.container)if(O.container instanceof Object)A=pt({},A,O.container),k=A.width-A.left-A.right-O.margin*2,D=A.height-A.top-A.bottom-O.margin*2;else{var _=ne(O.container)?O.container:document.querySelector(O.container),P=_.getBoundingClientRect(),tt=P.width,qt=P.height,ln=P.left,cn=P.top;A=pt({},A,{width:tt,height:qt,left:ln,top:cn})}k=k||A.width-O.margin*2,D=D||A.height-O.margin*2;var Ot=v.zoomedHd||v.original,dn=nn(Ot)?k:Ot.naturalWidth||k,un=nn(Ot)?D:Ot.naturalHeight||D,Kt=Ot.getBoundingClientRect(),hn=Kt.top,fn=Kt.left,re=Kt.width,ae=Kt.height,mn=Math.min(Math.max(re,dn),k)/re,pn=Math.min(Math.max(ae,un),D)/ae,le=Math.min(mn,pn),gn=(-fn+(k-re)/2+O.margin+A.left)/le,bn=(-hn+(D-ae)/2+O.margin+A.top)/le,Re="scale("+le+") translate3d("+gn+"px, "+bn+"px, 0)";v.zoomed.style.transform=Re,v.zoomedHd&&(v.zoomedHd.style.transform=Re)};return new n(function(T){if(E&&L.indexOf(E)===-1){T(I);return}var A=function tt(){M=!1,v.zoomed.removeEventListener("transitionend",tt),v.original.dispatchEvent(kt("medium-zoom:opened",{detail:{zoom:I}})),T(I)};if(v.zoomed){T(I);return}if(E)v.original=E;else if(L.length>0){var k=L;v.original=k[0]}else{T(I);return}if(v.original.dispatchEvent(kt("medium-zoom:open",{detail:{zoom:I}})),H=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,M=!0,v.zoomed=io(v.original),document.body.appendChild(q),O.template){var D=ne(O.template)?O.template:document.querySelector(O.template);v.template=document.createElement("div"),v.template.appendChild(D.content.cloneNode(!0)),document.body.appendChild(v.template)}if(v.original.parentElement&&v.original.parentElement.tagName==="PICTURE"&&v.original.currentSrc&&(v.zoomed.src=v.original.currentSrc),document.body.appendChild(v.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),v.original.classList.add("medium-zoom-image--hidden"),v.zoomed.classList.add("medium-zoom-image--opened"),v.zoomed.addEventListener("click",p),v.zoomed.addEventListener("transitionend",A),v.original.getAttribute("data-zoom-src")){v.zoomedHd=v.zoomed.cloneNode(),v.zoomedHd.removeAttribute("srcset"),v.zoomedHd.removeAttribute("sizes"),v.zoomedHd.removeAttribute("loading"),v.zoomedHd.src=v.zoomed.getAttribute("data-zoom-src"),v.zoomedHd.onerror=function(){clearInterval(_),console.warn("Unable to reach the zoom image target "+v.zoomedHd.src),v.zoomedHd=null,C()};var _=setInterval(function(){v.zoomedHd.complete&&(clearInterval(_),v.zoomedHd.classList.add("medium-zoom-image--opened"),v.zoomedHd.addEventListener("click",p),document.body.appendChild(v.zoomedHd),C())},10)}else if(v.original.hasAttribute("srcset")){v.zoomedHd=v.zoomed.cloneNode(),v.zoomedHd.removeAttribute("sizes"),v.zoomedHd.removeAttribute("loading");var P=v.zoomedHd.addEventListener("load",function(){v.zoomedHd.removeEventListener("load",P),v.zoomedHd.classList.add("medium-zoom-image--opened"),v.zoomedHd.addEventListener("click",p),document.body.appendChild(v.zoomedHd),C()})}else C()})},p=function(){return new n(function(x){if(M||!v.original){x(I);return}var E=function C(){v.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(v.zoomed),v.zoomedHd&&document.body.removeChild(v.zoomedHd),document.body.removeChild(q),v.zoomed.classList.remove("medium-zoom-image--opened"),v.template&&document.body.removeChild(v.template),M=!1,v.zoomed.removeEventListener("transitionend",C),v.original.dispatchEvent(kt("medium-zoom:closed",{detail:{zoom:I}})),v.original=null,v.zoomed=null,v.zoomedHd=null,v.template=null,x(I)};M=!0,document.body.classList.remove("medium-zoom--opened"),v.zoomed.style.transform="",v.zoomedHd&&(v.zoomedHd.style.transform=""),v.template&&(v.template.style.transition="opacity 150ms",v.template.style.opacity=0),v.original.dispatchEvent(kt("medium-zoom:close",{detail:{zoom:I}})),v.zoomed.addEventListener("transitionend",E)})},b=function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=x.target;return v.original?p():m({target:E})},g=function(){return O},y=function(){return L},w=function(){return v.original},L=[],R=[],M=!1,H=0,O=e,v={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(t)==="[object Object]"?O=t:(t||typeof t=="string")&&c(t),O=pt({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},O);var q=eo(O.background);document.addEventListener("click",s),document.addEventListener("keyup",r),document.addEventListener("scroll",o),window.addEventListener("resize",p);var I={open:m,close:p,toggle:b,update:a,clone:l,attach:c,detach:d,on:u,off:f,getOptions:g,getImages:y,getZoomedImage:w};return I};function so(i,t){t===void 0&&(t={});var e=t.insertAt;if(!(!i||typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",e==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i))}}var oo=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";so(oo);var on=no;var ro;function rn(i){let t=document.body.dataset.imageZoom;if(!t)return;let e;try{e=JSON.parse(t)}catch{return}let n=[...document.querySelectorAll(\'img[data-zoomable="true"]\')];if(!n.length)return;let s=ro??(ro=on());s.update(e),s.attach(...n),i==null||i.addEventListener("abort",()=>{s.close(),s.detach(...n)});let o={signal:i},r=!1,a=l=>l.key==="Enter"||l.key===" ";for(let l of n)l.alt&&(l.tabIndex=0,l.addEventListener("keydown",c=>{a(c)&&(c.preventDefault(),r=!0,s.open({target:l}))},o),l.addEventListener("medium-zoom:opened",()=>{let c=document.querySelector(".medium-zoom-image--opened");!r||!c||(c.tabIndex=-1,c.addEventListener("keydown",d=>{a(d)&&(d.preventDefault(),s.close())}),c.focus())},o),l.addEventListener("medium-zoom:closed",()=>{r&&l.focus(),r=!1},o))}function Te(i){return!/^[\\x00-\\x20]*([a-z][a-z0-9+.-]*:|[\\\\/])/i.test(i.replace(/[\\t\\n\\r]/g,""))}var Oe=new Map;function an(i){let t=Oe.get(i);return t||(t=new Promise((e,n)=>{let s=document.createElement("script");s.src=i,s.onload=()=>e(),s.onerror=()=>{Oe.delete(i),n(new Error(`could not load ${i}`))},document.head.appendChild(s)}),Oe.set(i,t)),t}function ao(i){document.querySelectorAll("[data-component=\'theme-toggle\']").forEach(t=>{let e=()=>t.setAttribute("aria-pressed",String(document.documentElement.classList.contains("dark")));e(),t.addEventListener("click",()=>{let n=!document.documentElement.classList.contains("dark");document.documentElement.classList.toggle("dark",n);try{localStorage.setItem("theme",n?"dark":"light")}catch{}e()},{signal:i})})}function lo(i){document.addEventListener("click",async t=>{var s,o,r,a;let e=t.target.closest("[data-copy-markdown]");if(!e)return;let n=(((s=document.getElementById("db-page-markdown"))==null?void 0:s.textContent)??"").replace(/<\\\\\\/(script)/gi,"</$1").replace(/<\\\\!--/g,"<!--");try{await navigator.clipboard.writeText(n);let l=(o=e.dataset).label??(o.label=e.textContent??"");e.textContent="Copied",clearTimeout(Number(e.dataset.timer)),e.dataset.timer=String(setTimeout(()=>e.textContent=l,1500))}catch{}(a=(r=e.closest("db-popover"))==null?void 0:r.close)==null||a.call(r,"close-press")},{signal:i})}function co(i,t){let e=document.body.dataset.page??"index.html";document.querySelectorAll("select[data-db-switch]").forEach(n=>{n.addEventListener("change",async()=>{var a;let s=n.selectedOptions[0],o=(s==null?void 0:s.dataset.prefix)??"",r=n.value;if(!(!Te(r)||!Te(o)))try{let l=o?`${i}${o}/`:i;await an(`${l}_dogsbay/pages.js`);let c=(a=window.__DOGSBAY_PAGES__)==null?void 0:a[o];location.href=c&&!c.includes(e)?`${l}index.html`:r}catch{location.href=r}},{signal:t})})}function uo(i){document.addEventListener("click",t=>{var n;let e=t.target.closest("a.db-anchor");!e||location.protocol==="file:"||(n=navigator.clipboard)==null||n.writeText(e.href).catch(()=>{})},{signal:i})}var Bt=new Map,oe=new Set;function se(){for(let[i,t]of Bt)i.isConnected||(ot(i),t.abort(),Bt.delete(i));for(let i of oe)i.isConnected||ot(i)}function ho(i,t){let e=EventTarget.prototype,n=e.addEventListener,s=0;e.addEventListener=function(o,r,a){s++;let l=typeof a=="object"?a.signal:void 0;n.call(this,o,r,typeof a=="object"?{...a,signal:l?AbortSignal.any([l,i]):i}:{capture:a===!0,signal:i})};try{t()}finally{e.addEventListener=n}return s}function fo(){se(),document.querySelectorAll("[data-component=\'sidebar-provider\']").forEach(i=>{if(Bt.has(i)||oe.has(i))return;let t=new AbortController;ho(t.signal,()=>Ae(i))?Bt.set(i,t):i.querySelector("[data-component=\'sidebar\']")&&oe.add(i)}),document.removeEventListener("keydown",se),document.addEventListener("keydown",se)}var Tt;function De(i={}){Tt==null||Tt.unmount();let t=new AbortController,{signal:e}=t,n=document.body,s=n.dataset.unitRoot??"",o=n.dataset.siteRoot??"";i.nav!==void 0&&(window.__DOGSBAY_NAV__=i.nav),fo(),i.theme!==!1&&ao(e),lo(e),i.switchers!==!1&&co(o,e),uo(e),i.search!==!1&&Ji({unitRoot:s,loadScript:an,signal:e}),en(e),rn(e);let r={unmount(){if(!e.aborted){t.abort();for(let a of[...Bt.keys(),...oe])ot(a);se(),Tt===r&&(Tt=void 0)}}};return Tt=r}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>De()):De();})();\n';
|
|
943
943
|
var THEME_TEMPLATES = { "layouts/blank.html": '{# A page without the sidebar or table of contents: landing pages, splash pages, 404. -#}\n<!doctype html>\n<html lang="{{ page.lang }}" dir="{{ page.dir }}">\n<head>\n{% include "partials/head.html" %}\n</head>\n<body class="bg-background text-foreground antialiased" data-unit-root="{{ paths.unit }}" data-site-root="{{ paths.site }}" data-prefix="{{ page.prefix }}" data-page="{{ page.out }}"{{ bodyAttrs }}>\n{{ skipLink }}\n<div class="relative flex min-h-svh w-full flex-col bg-background">\n{% include "partials/header.html" %}\n<main id="db-content" class="min-w-0 flex-1 px-6 py-8 outline-none lg:px-12" tabindex="-1">\n<div class="mx-auto {{ widthClass }}">\n{{ banner }}{{ h1 }}{{ byline }}{{ lede }}{{ hero }}{{ metaStrip }}\n<article class="docs-prose">\n{{ content }}\n</article>\n{% include "partials/footer.html" %}\n</div>\n</main>\n</div>\n{{ searchDialog }}\n{{ scripts }}\n</body>\n</html>\n', "layouts/docs.html": '{# The docs layout: a port of @dogsbay/docs-layout DocsLayout.astro. -#}\n<!doctype html>\n<html lang="{{ page.lang }}" dir="{{ page.dir }}">\n<head>\n{% include "partials/head.html" %}\n</head>\n<body class="bg-background text-foreground antialiased" data-unit-root="{{ paths.unit }}" data-site-root="{{ paths.site }}" data-prefix="{{ page.prefix }}" data-page="{{ page.out }}"{{ bodyAttrs }}>\n{{ skipLink }}\n<div class="group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar" data-component="sidebar-provider" style="--sidebar-width: 16rem; --sidebar-width-icon: 3rem;">\n{{ sidebar }}\n<div class="relative flex w-full min-w-0 flex-1 flex-col bg-background">\n{% include "partials/header.html" %}\n<div class="flex min-w-0">\n<main id="db-content" class="min-w-0 flex-1 px-6 py-8 outline-none lg:px-12" tabindex="-1">\n<div class="mx-auto {{ widthClass }}">\n{{ banner }}{{ breadcrumb }}{{ pageActionsInline }}{{ h1 }}{{ byline }}{{ lede }}{{ hero }}{{ metaStrip }}{{ tocTop }}\n<article class="docs-prose">\n{{ content }}\n</article>\n{% include "partials/footer.html" %}\n</div>\n</main>\n{{ tocRail }}\n</div>\n</div>\n</div>\n{{ searchDialog }}\n{{ scripts }}\n</body>\n</html>\n', "partials/blog-index.html": '{#- A blog index page (BlogIndex.astro): post cards, newest first, and links between index pages. Context: blog = {heading, posts: [{title, href, description, authors, date, datetime, minutes, hero}], newer, older (links or empty), pageLabel}, t. -#}\n<h1 class="text-3xl font-bold tracking-tight mb-8">{{ blog.heading }}</h1>\n{%- if not blog.posts %}\n<p class="text-muted-foreground">{{ t("noPosts") }}</p>\n{%- endif %}\n<ul class="not-prose grid list-none grid-cols-1 items-stretch gap-6 p-0 sm:grid-cols-2 lg:grid-cols-3" data-blog-index>\n{%- for post in blog.posts %}\n<li class="m-0 p-0"><a href="{{ post.href }}" class="group block h-full rounded-lg no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"><div class="rounded-lg border bg-card text-card-foreground shadow-sm flex h-full flex-col gap-3 p-5 transition-colors group-hover:border-ring">\n{%- if post.hero %}<img src="{{ post.hero }}" alt="" class="aspect-[16/9] w-full rounded-md border border-border object-cover" loading="lazy" decoding="async">{% endif -%}\n<h2 class="text-lg font-semibold leading-snug tracking-tight text-foreground group-hover:underline">{{ post.title }}</h2>\n<div class="flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground" data-pagefind-ignore>\n{%- if post.authors %}<span class="font-medium text-foreground">{{ post.authors }}</span>{% endif -%}\n{%- if post.authors and post.date %}<span aria-hidden="true">·</span>{% endif -%}\n{%- if post.date %}<time datetime="{{ post.datetime }}">{{ post.date }}</time>{% endif -%}\n{%- if post.authors or post.date %}<span aria-hidden="true">·</span>{% endif -%}\n<span>{{ post.minutes }}</span></div>\n{%- if post.description %}<p class="m-0 text-sm leading-relaxed text-muted-foreground">{{ post.description }}</p>{% endif -%}\n</div></a></li>\n{%- endfor %}\n</ul>\n{%- if blog.newer or blog.older %}\n<nav class="not-prose mt-12 flex items-center justify-between" aria-label="{{ t("blogPages") }}">\n{%- if blog.newer %}<a href="{{ blog.newer }}" class="text-sm text-foreground no-underline hover:underline" rel="prev">← {{ t("newerPosts") }}</a>{% else %}<span></span>{% endif -%}\n<span class="text-sm text-muted-foreground">{{ blog.pageLabel }}</span>\n{%- if blog.older %}<a href="{{ blog.older }}" class="text-sm text-foreground no-underline hover:underline" rel="next">{{ t("olderPosts") }} →</a>{% else %}<span></span>{% endif -%}\n</nav>\n{%- endif %}\n', "partials/breadcrumb.html": `{#- Breadcrumb trail (hidden below two items). Context: breadcrumbs = [{label, href?}], t. -#}
|
|
944
944
|
{%- if breadcrumbs | length >= 2 -%}
|
|
945
945
|
<nav aria-label="{{ t("breadcrumb") }}" class="mb-4 text-sm text-muted-foreground"><ol class="m-0 flex list-none flex-wrap gap-1.5 p-0">
|
|
@@ -1062,35 +1062,35 @@ var THEME_TEMPLATES = { "layouts/blank.html": '{# A page without the sidebar or
|
|
|
1062
1062
|
{%- endif %}
|
|
1063
1063
|
</section>
|
|
1064
1064
|
`, "partials/toc-popover.html": '{#- Table of contents in a header popover. -#}\n{%- set toc_label = t("toc") -%}\n{%- set toc_title = "" -%}\n<details class="dba-toc-popover relative" data-toc-popover><summary class="cursor-pointer list-none rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-foreground">{{ toc_label }}</summary><div class="absolute right-0 z-50 mt-1 max-h-[70vh] w-64 overflow-y-auto rounded-md border bg-background p-3 shadow-md">\n{%- include "partials/toc.html" -%}\n</div></details>\n', "partials/toc-rail.html": '{#- Table of contents in a right-hand rail, with a visible title. -#}\n{%- set toc_label = t("toc") -%}\n{%- set toc_title = toc_label -%}\n<div class="sticky top-12 hidden h-[calc(100vh-3rem)] w-56 shrink-0 overflow-y-auto border-l p-4 lg:block">\n{%- include "partials/toc.html" -%}\n</div>\n', "partials/toc-top.html": '{#- Table of contents above the content, collapsed. -#}\n{%- set toc_label = t("toc") -%}\n{%- set toc_title = "" -%}\n<details class="dba-toc-top not-prose mb-6 rounded-md border" data-toc-top><summary class="cursor-pointer list-none px-3 py-2 text-sm font-medium text-muted-foreground">{{ toc_label }}</summary><div class="border-t px-3 py-2">\n{%- include "partials/toc.html" -%}\n</div></details>\n', "partials/toc.html": '{#- The table-of-contents link list (DocsToc.astro), shared by toc-top, toc-rail and toc-popover.\n Context: headings = [{depth, id, text}], toc_label (aria-label), toc_title (visible heading, may be empty). -#}\n<db-toc offset="64"><nav class="text-sm" aria-label="{{ toc_label }}">\n{%- if toc_title %}<div class="text-xs font-semibold uppercase text-muted-foreground" aria-hidden="true">{{ toc_title }}</div>{% endif -%}\n<ul class="mt-2 space-y-1">\n{%- for h in headings -%}\n<li><a href="#{{ h.id }}" data-toc-link data-toc-slug="{{ h.id }}" class="block py-0.5 text-muted-foreground transition-colors hover:text-foreground data-[active]:font-medium data-[active]:text-foreground" style="padding-left:{{ (h.depth - 2) * 0.75 }}rem">{{ h.text }}</a></li>\n{%- endfor -%}\n</ul></nav></db-toc>\n{#- An included partial keeps its final newline (keepTrailingNewline); this strips it, since toc-top/rail/popover place the list inline. -#}\n' };
|
|
1065
|
-
var CLIENT_CANDIDATES = ['""', '"&"', '"\\\\$&")).join("|")})', '"\\\\$&")}"', '"s"}', "#db-content", "([^", "(here", "(index.ts)", "./", "./elements.js", "./highlight.js", "./image-zoom.js", "./mount.js", "./pagefind.js", "./search.js", "./targets.js", ".medium-zoom-image--opened", "/g,", "<!--", "</", "</$1", "<\\/", "<db-combobox", "<db-dialog", "<script>", "===", "=>", "?h=<terms>", "?|\\S*)/gi,", "@dogsbay/elements/db-accordion", "@dogsbay/elements/db-code-block", "@dogsbay/elements/db-combobox", "@dogsbay/elements/db-details-sheet", "@dogsbay/elements/db-dialog", "@dogsbay/elements/db-nav-tree", "@dogsbay/elements/db-popover", "@dogsbay/elements/db-select", "@dogsbay/elements/db-tabs", "@dogsbay/elements/db-toc", "@dogsbay/elements/db-tooltip", "@dogsbay/search/query", "@dogsbay/ssg/client", "@dogsbay/ui
|
|
1065
|
+
var CLIENT_CANDIDATES = ['""', '"&"', '"\\\\$&")).join("|")})', '"\\\\$&")}"', '"s"}', "#db-content", "([^", "(here", "(index.ts)", "./", "./elements.js", "./highlight.js", "./image-zoom.js", "./mount.js", "./pagefind.js", "./search.js", "./targets.js", ".medium-zoom-image--opened", "/g,", "<!--", "</", "</$1", "<\\/", "<db-combobox", "<db-dialog", "<script>", "===", "=>", "?h=<terms>", "?|\\S*)/gi,", "@dogsbay/elements/db-accordion", "@dogsbay/elements/db-code-block", "@dogsbay/elements/db-combobox", "@dogsbay/elements/db-details-sheet", "@dogsbay/elements/db-dialog", "@dogsbay/elements/db-nav-tree", "@dogsbay/elements/db-popover", "@dogsbay/elements/db-select", "@dogsbay/elements/db-tabs", "@dogsbay/elements/db-toc", "@dogsbay/elements/db-tooltip", "@dogsbay/search/query", "@dogsbay/ssg/client", "@dogsbay/ui/sidebar/sidebar.ts", "Clear", "Copied", "DOMContentLoaded", "Enter", "Filter", "Search", "[^", "[aria-hidden='true']", "[contenteditable]", "[data-clear-highlights]", "[data-component='sidebar']", "[data-component='sidebar-provider']", "[data-component='theme-toggle']", "[data-copy-markdown]", "[data-db-search-input]", "[data-db-search-status]", "[data-part='listbox']", "\\\\$&", "_dogsbay", "_dogsbay/nav.js", "a.db-anchor", "abort", "api", "aria-label", "aria-pressed", "aria-pressed:bg-primary", "aria-pressed:text-primary-foreground", "article", "be", "block", "border", "border-l", "both", "builtin", "button", "button,", "by", "center", "change", "click", "close-press", "could", "dark", "data", "data-part", "db-content", "db-dialog:open", "db-page-markdown", "db-popover", "db-search", "db-search-hl", "div", "file:", 'filter="none"', "flex", "flex-wrap", "fn", "folder", "font-medium", "fullNavLimit", "function", "gap-1", "gi", "giu", "group", "h-8", "highlights", "host", "hover:bg-accent", "https:", 'id="db-search">', 'img[data-zoomable="true"]', "index", "index.html", "inline-flex", "inline>", "input", "input,", "inst", "installing", "items-center", "javascript:", "keydown", "li", "light", "line-clamp-2", "load", "loaded.", "loading", "loads.", "mark", "mark,", "mb-1", "mb-4", "medium-zoom", "medium-zoom:closed", "medium-zoom:opened", "ml-4", "mount()", "mounts", "mt-1", "none", "not", "not-prose", "object", "once", "option", "own", "p-3", "page", "page.html#id", "page.html?h=terms#id", "pagefind", "pb-2", "puts", "px-2.5", "px-3", "py-0.5", "py-1.5", "readDataScript:", "role", "rounded-full", "rounded-md", "script", "script,", "section", "select,", "select[data-db-switch]", "signal", "ssg.search:", "style,", "text-muted-foreground", "text-sm", "text-xs", "text/html", "textarea,", "that", "the", "theme", "true", "unit", "unmount()", "when", "window.__DOGSBAY_NAV__"];
|
|
1066
1066
|
var SITE_NOTICES = `Third-party software in this site's _dogsbay/ files (dogsbay.js, site.css) and pages
|
|
1067
1067
|
|
|
1068
1068
|
========================================================================
|
|
1069
|
-
@dogsbay/elements@0.2.0-beta.
|
|
1069
|
+
@dogsbay/elements@0.2.0-beta.132 (MIT)
|
|
1070
1070
|
https://github.com/dogsbay/dogsbay.git
|
|
1071
1071
|
|
|
1072
1072
|
Licensed under MIT; the package ships no licence file.
|
|
1073
1073
|
|
|
1074
1074
|
========================================================================
|
|
1075
|
-
@dogsbay/primitives@0.2.0-beta.
|
|
1075
|
+
@dogsbay/primitives@0.2.0-beta.132 (MIT)
|
|
1076
1076
|
https://github.com/dogsbay/dogsbay.git
|
|
1077
1077
|
|
|
1078
1078
|
Licensed under MIT; the package ships no licence file.
|
|
1079
1079
|
|
|
1080
1080
|
========================================================================
|
|
1081
|
-
@dogsbay/render-html@0.2.0-beta.
|
|
1081
|
+
@dogsbay/render-html@0.2.0-beta.132 (MIT)
|
|
1082
1082
|
https://github.com/dogsbay/dogsbay.git
|
|
1083
1083
|
|
|
1084
1084
|
Licensed under MIT; the package ships no licence file.
|
|
1085
1085
|
|
|
1086
1086
|
========================================================================
|
|
1087
|
-
@dogsbay/search@0.2.0-beta.
|
|
1087
|
+
@dogsbay/search@0.2.0-beta.132 (MIT)
|
|
1088
1088
|
https://github.com/dogsbay/dogsbay.git
|
|
1089
1089
|
|
|
1090
1090
|
Licensed under MIT; the package ships no licence file.
|
|
1091
1091
|
|
|
1092
1092
|
========================================================================
|
|
1093
|
-
@dogsbay/ui@0.2.0-beta.
|
|
1093
|
+
@dogsbay/ui@0.2.0-beta.132 (MIT)
|
|
1094
1094
|
https://github.com/dogsbay/dogsbay.git
|
|
1095
1095
|
|
|
1096
1096
|
Licensed under MIT; the package ships no licence file.
|
|
@@ -2296,10 +2296,14 @@ var EN = {
|
|
|
2296
2296
|
olderPosts: "Older posts",
|
|
2297
2297
|
newerPosts: "Newer posts",
|
|
2298
2298
|
pageOf: "Page {n} of {total}",
|
|
2299
|
-
collapseAll: "Collapse all"
|
|
2299
|
+
collapseAll: "Collapse all",
|
|
2300
|
+
collapsedLine: "1 collapsed line",
|
|
2301
|
+
collapsedLines: "{n} collapsed lines"
|
|
2300
2302
|
};
|
|
2301
2303
|
var FR = {
|
|
2302
2304
|
lastUpdated: "Derni\xE8re mise \xE0 jour : {date}",
|
|
2305
|
+
collapsedLine: "1 ligne masqu\xE9e",
|
|
2306
|
+
collapsedLines: "{n} lignes masqu\xE9es",
|
|
2303
2307
|
anchor: "Lien vers cette section",
|
|
2304
2308
|
toggleSection: "Afficher ou masquer {label}",
|
|
2305
2309
|
searchResults: "R\xE9sultats de recherche",
|
|
@@ -2326,6 +2330,8 @@ var FR = {
|
|
|
2326
2330
|
};
|
|
2327
2331
|
var DE = {
|
|
2328
2332
|
lastUpdated: "Zuletzt aktualisiert: {date}",
|
|
2333
|
+
collapsedLine: "1 ausgeblendete Zeile",
|
|
2334
|
+
collapsedLines: "{n} ausgeblendete Zeilen",
|
|
2329
2335
|
anchor: "Link zu diesem Abschnitt",
|
|
2330
2336
|
toggleSection: "{label} ein- oder ausblenden",
|
|
2331
2337
|
searchResults: "Suchergebnisse",
|
|
@@ -2352,6 +2358,8 @@ var DE = {
|
|
|
2352
2358
|
};
|
|
2353
2359
|
var ES = {
|
|
2354
2360
|
lastUpdated: "\xDAltima actualizaci\xF3n: {date}",
|
|
2361
|
+
collapsedLine: "1 l\xEDnea oculta",
|
|
2362
|
+
collapsedLines: "{n} l\xEDneas ocultas",
|
|
2355
2363
|
anchor: "Enlace a esta secci\xF3n",
|
|
2356
2364
|
toggleSection: "Mostrar u ocultar {label}",
|
|
2357
2365
|
searchResults: "Resultados de b\xFAsqueda",
|
|
@@ -2378,6 +2386,8 @@ var ES = {
|
|
|
2378
2386
|
};
|
|
2379
2387
|
var JA = {
|
|
2380
2388
|
lastUpdated: "\u6700\u7D42\u66F4\u65B0: {date}",
|
|
2389
|
+
collapsedLine: "1 \u884C\u3092\u6298\u308A\u305F\u305F\u307F\u4E2D",
|
|
2390
|
+
collapsedLines: "{n} \u884C\u3092\u6298\u308A\u305F\u305F\u307F\u4E2D",
|
|
2381
2391
|
anchor: "\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3078\u306E\u30EA\u30F3\u30AF",
|
|
2382
2392
|
toggleSection: "{label}\u3092\u958B\u9589",
|
|
2383
2393
|
searchResults: "\u691C\u7D22\u7D50\u679C",
|
|
@@ -2802,12 +2812,12 @@ var DiagramStore = class {
|
|
|
2802
2812
|
else {
|
|
2803
2813
|
const error = typeof r.error === "string" && r.error ? r.error : "the renderer returned no SVG";
|
|
2804
2814
|
this.put(code, { error });
|
|
2805
|
-
warn(
|
|
2815
|
+
warn(`a diagram was left as code: ${error.split("\n")[0].slice(0, 160)}`, file);
|
|
2806
2816
|
}
|
|
2807
2817
|
}
|
|
2808
2818
|
for (const [, [code, file]] of byId) {
|
|
2809
2819
|
this.put(code, { error: "no result" });
|
|
2810
|
-
warn(
|
|
2820
|
+
warn("a diagram was left as code: the renderer returned no result for it", file);
|
|
2811
2821
|
}
|
|
2812
2822
|
}
|
|
2813
2823
|
};
|
|
@@ -2827,6 +2837,35 @@ async function siteCssBuilder(input) {
|
|
|
2827
2837
|
return input.css ?? (await import("./chunks/tailwind-fallback-KPRFHW3C.mjs")).buildSiteCss;
|
|
2828
2838
|
}
|
|
2829
2839
|
var SITE_FILES = /* @__PURE__ */ new Set(["robots.txt", "_headers", "_redirects", "sitemap-index.xml"]);
|
|
2840
|
+
function reporter(warnings, problems) {
|
|
2841
|
+
return (code, text, at = {}) => {
|
|
2842
|
+
const t = detach(text);
|
|
2843
|
+
warnings.push(t);
|
|
2844
|
+
const message = at.message !== void 0 ? detach(at.message) : t.replace(/^\[[^\]]*\] /, "");
|
|
2845
|
+
problems.push({ code, ...at, ...at.file !== void 0 ? { file: detach(at.file) } : {}, message, text: t });
|
|
2846
|
+
};
|
|
2847
|
+
}
|
|
2848
|
+
function linedDiagnostics(found, raw, body, parsed) {
|
|
2849
|
+
if (!found.length) return [];
|
|
2850
|
+
const offset = raw.slice(0, raw.length - body.length).split("\n").length - 1;
|
|
2851
|
+
const LINE = /\bline (\d+)/g;
|
|
2852
|
+
const shifted = (m) => m.replace(LINE, (_, n) => `line ${Number(n) + offset}`);
|
|
2853
|
+
const named = (d) => d.name === void 0 ? {} : { name: detach(d.name) };
|
|
2854
|
+
const lined = (d) => ({ code: d.code, message: detach(shifted(d.message)), line: d.line + offset, ...named(d) });
|
|
2855
|
+
if (parsed === body) return found.map(lined);
|
|
2856
|
+
let asWritten;
|
|
2857
|
+
try {
|
|
2858
|
+
asWritten = dogsbayMdToTree(body, { diagnostics: true }).diagnostics ?? [];
|
|
2859
|
+
} catch {
|
|
2860
|
+
asWritten = [];
|
|
2861
|
+
}
|
|
2862
|
+
const key = (d) => `${d.code}\0${d.message.replace(LINE, "line #")}`;
|
|
2863
|
+
return found.map((d) => {
|
|
2864
|
+
const i = asWritten.findIndex((w) => key(w) === key(d));
|
|
2865
|
+
if (i >= 0) return lined(asWritten.splice(i, 1)[0]);
|
|
2866
|
+
return { code: d.code, message: detach(d.message.replace(LINE, "line $1 of the page after templating")), ...named(d) };
|
|
2867
|
+
});
|
|
2868
|
+
}
|
|
2830
2869
|
var decoder = new TextDecoder();
|
|
2831
2870
|
async function readText(c) {
|
|
2832
2871
|
if (typeof c === "string") return c;
|
|
@@ -2839,6 +2878,17 @@ function forSink(c) {
|
|
|
2839
2878
|
if (c.path) return { ref: true, path: c.path, read: async () => new TextEncoder().encode(await c.read()) };
|
|
2840
2879
|
return Promise.resolve(c.read());
|
|
2841
2880
|
}
|
|
2881
|
+
var copiedPath = (p) => {
|
|
2882
|
+
const segs = p.split("/");
|
|
2883
|
+
return segs.every((s, i) => !s.startsWith(".") || s === ".gitbook" && i < segs.length - 1);
|
|
2884
|
+
};
|
|
2885
|
+
async function assetVerdict(p, c, untrusted, sanitizing) {
|
|
2886
|
+
if (untrusted) {
|
|
2887
|
+
const name = p.slice(p.lastIndexOf("/") + 1);
|
|
2888
|
+
return HOST_FILES.has(name) || !PASSIVE_FILE.test(p) || /\.svg$/i.test(p) && !passiveSvg(await readText(c)) ? "untrusted" : "copy";
|
|
2889
|
+
}
|
|
2890
|
+
return sanitizing && ACTIVE_FILE.test(p) ? "active" : "copy";
|
|
2891
|
+
}
|
|
2842
2892
|
var NAV_FILES = ["nav.yml", "nav.yaml", "nav.json"];
|
|
2843
2893
|
var SKIP_FILES = /* @__PURE__ */ new Set([...NAV_FILES, "dogsbay.config.yml", "dogsbay.config.yaml", ".DS_Store"]);
|
|
2844
2894
|
function fmKey(src) {
|
|
@@ -2855,7 +2905,7 @@ function frontMatterCopy(fm) {
|
|
|
2855
2905
|
}
|
|
2856
2906
|
}
|
|
2857
2907
|
function rebuildUnitLazy(ctx, unit) {
|
|
2858
|
-
return buildUnit(unit, ctx.allUnits, ctx.cfg, ctx.input, ctx.highlighter, ctx.emit, ctx.
|
|
2908
|
+
return buildUnit(unit, ctx.allUnits, ctx.cfg, ctx.input, ctx.highlighter, ctx.emit, ctx.report, ctx.phase, ctx.theme.templates, ctx.state, { lazy: true, diagnostics: ctx.diagnostics });
|
|
2859
2909
|
}
|
|
2860
2910
|
async function build(input, hooks = {}) {
|
|
2861
2911
|
const t0 = now();
|
|
@@ -2872,7 +2922,7 @@ async function build(input, hooks = {}) {
|
|
|
2872
2922
|
let classes = new Set(CLIENT_CANDIDATES);
|
|
2873
2923
|
const emit = async (p, raw) => {
|
|
2874
2924
|
if (p.split("/").some((s) => s === ".." || s === "." || s === "") || p.startsWith("/")) {
|
|
2875
|
-
|
|
2925
|
+
report("site", `[site] ${p} is not a path inside the site, so it is not written`);
|
|
2876
2926
|
return;
|
|
2877
2927
|
}
|
|
2878
2928
|
state.written.add(p);
|
|
@@ -2882,8 +2932,11 @@ async function build(input, hooks = {}) {
|
|
|
2882
2932
|
else out.set(p, isRef(c) ? await c.read() : isStream(c) ? await joinStream(c) : c);
|
|
2883
2933
|
};
|
|
2884
2934
|
const theme = await loadTheme(input.files, cfg, input.untrusted ? ignored : void 0);
|
|
2885
|
-
const warnings =
|
|
2886
|
-
|
|
2935
|
+
const warnings = [];
|
|
2936
|
+
const problems = [];
|
|
2937
|
+
const report = reporter(warnings, problems);
|
|
2938
|
+
for (const m of ignored) report("untrusted", `[untrusted] ${m}`);
|
|
2939
|
+
for (const p of cfg.unsupportedPlugins) report("plugins", `[plugins] ${p} is an Astro-pipeline plugin; dogsbay-ssg ignores it`);
|
|
2887
2940
|
const highlighter = input.highlighter ?? await (await import("@dogsbay/highlight")).createHighlighter({ cacheChars: input.highlightCacheChars });
|
|
2888
2941
|
const buildCss = await siteCssBuilder(input);
|
|
2889
2942
|
phase.init = now() - t0;
|
|
@@ -2893,7 +2946,7 @@ async function build(input, hooks = {}) {
|
|
|
2893
2946
|
for (const r of cfg.redirects) {
|
|
2894
2947
|
const from = sitePath(r.from, cfg.basePath);
|
|
2895
2948
|
if (!from) {
|
|
2896
|
-
|
|
2949
|
+
report("redirects", `[redirects] "${r.from}" is the site root, which cannot redirect; ignored`);
|
|
2897
2950
|
continue;
|
|
2898
2951
|
}
|
|
2899
2952
|
state.redirects.push({
|
|
@@ -2906,14 +2959,14 @@ async function build(input, hooks = {}) {
|
|
|
2906
2959
|
});
|
|
2907
2960
|
}
|
|
2908
2961
|
let frontMatterOf = frontMatterCache(readText);
|
|
2909
|
-
state.canonical = await defaultTables(cfg, allUnits, units, input.files, readText, (m) =>
|
|
2962
|
+
state.canonical = await defaultTables(cfg, allUnits, units, input.files, readText, (m) => report("canonical", m), frontMatterOf);
|
|
2910
2963
|
if (siteBase(cfg)) state.languages = await languageTables(cfg, allUnits, units, input.files, readText, frontMatterOf);
|
|
2911
2964
|
const translations = await translationTables(cfg, allUnits, input.files, readText, input.includeDrafts === true, frontMatterOf);
|
|
2912
2965
|
frontMatterOf = void 0;
|
|
2913
|
-
hooks.context?.({ cfg, allUnits, input, highlighter, emit, warnings, phase, theme, state });
|
|
2966
|
+
hooks.context?.({ cfg, allUnits, input, highlighter, emit, warnings, problems, report, phase, theme, state, diagnostics: hooks.diagnostics });
|
|
2914
2967
|
for (const unit of units) {
|
|
2915
2968
|
classes = new Set(CLIENT_CANDIDATES);
|
|
2916
|
-
const r = await buildUnit(unit, allUnits, cfg, input, highlighter, emit,
|
|
2969
|
+
const r = await buildUnit(unit, allUnits, cfg, input, highlighter, emit, report, phase, theme.templates, state, { keep: hooks.keep, lazy: hooks.lazy, diagnostics: hooks.diagnostics });
|
|
2917
2970
|
hooks.unitBuilt?.(unit, r, classes);
|
|
2918
2971
|
pages += r.pages;
|
|
2919
2972
|
assets += r.assets;
|
|
@@ -2921,7 +2974,7 @@ async function build(input, hooks = {}) {
|
|
|
2921
2974
|
try {
|
|
2922
2975
|
await emit(`${unit.prefix ? unit.prefix + "/" : ""}_dogsbay/site.css`, await buildCss({ theme: cfg.theme, themeCss: theme.themeCss, extra: theme.extraCss, candidates: classes }));
|
|
2923
2976
|
} catch (e) {
|
|
2924
|
-
|
|
2977
|
+
report("css", `[css] could not build the stylesheet for ${unit.prefix || "/"}: ${e.message}`, { unit: unit.prefix || "/" });
|
|
2925
2978
|
}
|
|
2926
2979
|
phase.css = (phase.css ?? 0) + now() - tCss;
|
|
2927
2980
|
}
|
|
@@ -2950,7 +3003,7 @@ async function build(input, hooks = {}) {
|
|
|
2950
3003
|
);
|
|
2951
3004
|
const def = defaultUnit(allUnits, cfg);
|
|
2952
3005
|
const tSite = now();
|
|
2953
|
-
await emitSiteFiles(cfg, allUnits, units, def, state, emit,
|
|
3006
|
+
await emitSiteFiles(cfg, allUnits, units, def, state, emit, report, input.onRedirects);
|
|
2954
3007
|
phase.site = (phase.site ?? 0) + now() - tSite;
|
|
2955
3008
|
if (def && def.prefix) {
|
|
2956
3009
|
await emit("index.html", redirectPage(`${def.prefix}/index.html`, cfg.name));
|
|
@@ -2963,6 +3016,7 @@ async function build(input, hooks = {}) {
|
|
|
2963
3016
|
return {
|
|
2964
3017
|
files: out,
|
|
2965
3018
|
warnings,
|
|
3019
|
+
problems,
|
|
2966
3020
|
config: cfg,
|
|
2967
3021
|
stats: { pages, assets, units: units.length, ms: Math.round(now() - t0), msByPhase: roundAll(phase), highlightCache: highlighter.cacheStats() }
|
|
2968
3022
|
};
|
|
@@ -2998,10 +3052,10 @@ function checkRootVersion(allUnits, files) {
|
|
|
2998
3052
|
}
|
|
2999
3053
|
}
|
|
3000
3054
|
}
|
|
3001
|
-
async function emitSiteFiles(cfg, all, built, def, state, emit,
|
|
3055
|
+
async function emitSiteFiles(cfg, all, built, def, state, emit, report, onRedirects) {
|
|
3002
3056
|
const defPrefix = def?.prefix ?? "";
|
|
3003
3057
|
const put = async (p, content) => {
|
|
3004
|
-
if (state.supplied.has(p))
|
|
3058
|
+
if (state.supplied.has(p)) report("site", `[site] ${p} comes from the content, so the generated one is not written`);
|
|
3005
3059
|
else await emit(p, content);
|
|
3006
3060
|
};
|
|
3007
3061
|
await put("robots.txt", buildRobotsTxt(cfg, defPrefix));
|
|
@@ -3010,7 +3064,7 @@ async function emitSiteFiles(cfg, all, built, def, state, emit, warnings, onRedi
|
|
|
3010
3064
|
const maps = all.flatMap((u) => state.sitemaps.get(u.prefix) ?? [[u.prefix, "sitemap-0.xml"].filter(Boolean).join("/")]);
|
|
3011
3065
|
await put("sitemap-index.xml", buildSitemapIndex(cfg, maps));
|
|
3012
3066
|
} else if (cfg.url) {
|
|
3013
|
-
|
|
3067
|
+
report("config", `[site] site.url "${cfg.url}" has no http:// or https://, so canonical links, the sitemap and absolute llms.txt links are left out`);
|
|
3014
3068
|
}
|
|
3015
3069
|
if (!state.redirects.length) return;
|
|
3016
3070
|
const known = (p) => {
|
|
@@ -3019,7 +3073,7 @@ async function emitSiteFiles(cfg, all, built, def, state, emit, warnings, onRedi
|
|
|
3019
3073
|
};
|
|
3020
3074
|
const inputs = state.redirects.filter((r) => known(r.from));
|
|
3021
3075
|
const { rules, warnings: w } = collectRedirects(inputs, (p) => state.pageOut.get(p), known);
|
|
3022
|
-
for (const m of w)
|
|
3076
|
+
for (const m of w) report("redirects", `[redirects] ${m}`);
|
|
3023
3077
|
onRedirects?.(rules);
|
|
3024
3078
|
for (const r of rules) await emit(stubFile(r), renderRedirectPage(r, cfg));
|
|
3025
3079
|
if (cfg.deployTarget === "cloudflare-workers" && rules.length) await put("_redirects", renderRedirectsFile(rules, cfg));
|
|
@@ -3045,7 +3099,7 @@ function mayHaveMath(v, inProps = false) {
|
|
|
3045
3099
|
for (const k in o) if (mayHaveMath(o[k], inProps || k === "props")) return true;
|
|
3046
3100
|
return false;
|
|
3047
3101
|
}
|
|
3048
|
-
async function buildUnit(unit, allUnits, cfg, input, highlighter, emit,
|
|
3102
|
+
async function buildUnit(unit, allUnits, cfg, input, highlighter, emit, report, phase, templates, state, mode = {}) {
|
|
3049
3103
|
let t = now();
|
|
3050
3104
|
const root = sourceRoot(unit.source);
|
|
3051
3105
|
const viewFrom = /* @__PURE__ */ new Map();
|
|
@@ -3071,7 +3125,11 @@ async function buildUnit(unit, allUnits, cfg, input, highlighter, emit, warnings
|
|
|
3071
3125
|
const mounts = [cfg.basePath, ...cfg.linkPrefixes ?? []].filter(Boolean);
|
|
3072
3126
|
const prefix = unit.prefix ? unit.prefix + "/" : "";
|
|
3073
3127
|
const label = unit.prefix || "/";
|
|
3074
|
-
const warn = (m) =>
|
|
3128
|
+
const warn = (code, m, at = {}) => report(code, `[${label}] ${m}`, { unit: label, ...at, message: at.message ?? m });
|
|
3129
|
+
const warnFile = (code, shown, file, m, line) => warn(code, `${shown}: ${m}`, { file, message: m, ...line ? { line } : {} });
|
|
3130
|
+
const warnPage = (info, code, m, line) => warnFile(code, where(info), srcOf(info), m, line);
|
|
3131
|
+
const navFileAt = () => navProjectFiles.length === 1 ? { file: navProjectFiles[0] } : {};
|
|
3132
|
+
const diagramWarn = (m, file) => file ? warnFile("diagram", file, abs(file), m) : warn("diagram", m);
|
|
3075
3133
|
let math;
|
|
3076
3134
|
const files = /* @__PURE__ */ new Map();
|
|
3077
3135
|
if (unit.members.length === 1) {
|
|
@@ -3090,7 +3148,7 @@ async function buildUnit(unit, allUnits, cfg, input, highlighter, emit, warnings
|
|
|
3090
3148
|
from.set(at.path, k);
|
|
3091
3149
|
files.set(at.path, v);
|
|
3092
3150
|
}
|
|
3093
|
-
if (shadowed.length) warn(`${shadowed.length} file(s) of the main source are in a folder named like a source's namespace, which is that source's: ${shadowed.slice(0, 5).join(", ")}${shadowed.length > 5 ? ", \u2026" : ""}`);
|
|
3151
|
+
if (shadowed.length) warn("sources", `${shadowed.length} file(s) of the main source are in a folder named like a source's namespace, which is that source's: ${shadowed.slice(0, 5).join(", ")}${shadowed.length > 5 ? ", \u2026" : ""}`);
|
|
3094
3152
|
}
|
|
3095
3153
|
const cache = new TextCache(input.textCacheChars ?? 8e6);
|
|
3096
3154
|
const read = async (p) => {
|
|
@@ -3204,21 +3262,21 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3204
3262
|
continue;
|
|
3205
3263
|
}
|
|
3206
3264
|
if (fm.aliases !== void 0) {
|
|
3207
|
-
if (!Array.isArray(fm.aliases) || fm.aliases.some((a) => typeof a !== "string"))
|
|
3265
|
+
if (!Array.isArray(fm.aliases) || fm.aliases.some((a) => typeof a !== "string")) warnFile("front-matter", p, abs(p), "aliases must be a list of paths");
|
|
3208
3266
|
else
|
|
3209
3267
|
for (const a of fm.aliases) {
|
|
3210
3268
|
const from = target(a);
|
|
3211
3269
|
if (!from || isExternal(from)) continue;
|
|
3212
3270
|
const owner = unitOfPath(allUnits, from);
|
|
3213
3271
|
if (owner && owner !== unit) {
|
|
3214
|
-
|
|
3272
|
+
warnFile("alias", p, abs(p), `alias ${a} is in ${owner.prefix}/, another unit's folder; ignored`);
|
|
3215
3273
|
continue;
|
|
3216
3274
|
}
|
|
3217
3275
|
state.redirects.push({ from: detach(from), to: inUnit(slug), status: 301, origin: "aliases", declaredBy: `${label}:${p}` });
|
|
3218
3276
|
}
|
|
3219
3277
|
}
|
|
3220
3278
|
if (infos.has(slug)) {
|
|
3221
|
-
warn(`two sources map to the page "${slug || "/"}"; keeping ${srcOf(infos.get(slug))}, ignoring ${abs(p)}
|
|
3279
|
+
warn("duplicate-page", `two sources map to the page "${slug || "/"}"; keeping ${srcOf(infos.get(slug))}, ignoring ${abs(p)}`, { file: abs(p) });
|
|
3222
3280
|
continue;
|
|
3223
3281
|
}
|
|
3224
3282
|
infos.set(slug, {
|
|
@@ -3235,18 +3293,16 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3235
3293
|
taxonomies?.add(slug, fm);
|
|
3236
3294
|
blog?.add(slug, infos.get(slug).title, fm);
|
|
3237
3295
|
if (mode.keep || mode.lazy) frontMatter.set(p, fmKey(src));
|
|
3238
|
-
} else if (!SKIP_FILES.has(memberRel(p)) &&
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
else assetPaths.add(p);
|
|
3243
|
-
} else if (sanitizing && ACTIVE_FILE.test(p)) activeFiles.push(p);
|
|
3296
|
+
} else if (!SKIP_FILES.has(memberRel(p)) && copiedPath(p)) {
|
|
3297
|
+
const verdict = await assetVerdict(p, c, input.untrusted === true, sanitizing);
|
|
3298
|
+
if (verdict === "untrusted") untrustedFiles.push(p);
|
|
3299
|
+
else if (verdict === "active") activeFiles.push(p);
|
|
3244
3300
|
else assetPaths.add(p);
|
|
3245
3301
|
}
|
|
3246
3302
|
}
|
|
3247
3303
|
const some = (l) => `${l.slice(0, 5).join(", ")}${l.length > 5 ? ", \u2026" : ""}`;
|
|
3248
|
-
if (activeFiles.length) warn(`content.html is sanitize, so ${activeFiles.length} HTML, XML or script file(s) are not copied: ${some(activeFiles)}`);
|
|
3249
|
-
if (untrustedFiles.length)
|
|
3304
|
+
if (activeFiles.length) warn("html", `content.html is sanitize, so ${activeFiles.length} HTML, XML or script file(s) are not copied: ${some(activeFiles)}`);
|
|
3305
|
+
if (untrustedFiles.length) report("untrusted", `[untrusted] ${untrustedFiles.length} file(s) not copied: only images, fonts, media, stylesheets, documents and data are, and no SVG that runs script or host configuration (_headers, _redirects): ${some(untrustedFiles)}`);
|
|
3250
3306
|
const specNavs = /* @__PURE__ */ new Map();
|
|
3251
3307
|
const combinedPrefix = [...urlPathOf(cfg.url), ...cfg.basePath.split("/").filter(Boolean)];
|
|
3252
3308
|
for (const m of unit.members) {
|
|
@@ -3257,7 +3313,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3257
3313
|
};
|
|
3258
3314
|
const spec = await specFileOf(m.source.path, (p) => input.files.has(p), readProject);
|
|
3259
3315
|
if (!spec) {
|
|
3260
|
-
warn(`${m.source.path}: no OpenAPI spec there (a .yaml, .yml or .json file, or a folder holding openapi.*, swagger.* or spec.*)`);
|
|
3316
|
+
warn("openapi", `${m.source.path}: no OpenAPI spec there (a .yaml, .yml or .json file, or a folder holding openapi.*, swagger.* or spec.*)`);
|
|
3261
3317
|
continue;
|
|
3262
3318
|
}
|
|
3263
3319
|
const ns = m.namespace;
|
|
@@ -3265,14 +3321,14 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3265
3321
|
const reserved = [...segs, ...combinedPrefix.slice(0, 1), ...globalPrefixes];
|
|
3266
3322
|
const got = await openApiSourcePages(readProject, spec, reserved);
|
|
3267
3323
|
if ("error" in got) {
|
|
3268
|
-
|
|
3324
|
+
warnFile("openapi", m.source.path, spec, got.error);
|
|
3269
3325
|
continue;
|
|
3270
3326
|
}
|
|
3271
3327
|
const limit = input.openApiChars ?? 8e6;
|
|
3272
3328
|
for (const page of got.pages) {
|
|
3273
3329
|
const slug = prefixSlug(segs, page.slug === "index" ? "" : page.slug);
|
|
3274
3330
|
if (infos.has(slug)) {
|
|
3275
|
-
warn(`two sources map to the page "${slug || "/"}"; keeping ${srcOf(infos.get(slug))}, ignoring ${spec}'s
|
|
3331
|
+
warn("duplicate-page", `two sources map to the page "${slug || "/"}"; keeping ${srcOf(infos.get(slug))}, ignoring ${spec}'s`, { file: spec });
|
|
3276
3332
|
continue;
|
|
3277
3333
|
}
|
|
3278
3334
|
const isIndex = page.slug === "index" || got.pages.some((q) => q.slug.startsWith(page.slug + "/"));
|
|
@@ -3280,7 +3336,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3280
3336
|
if (ns) rewriteContentRefs(tree, segs, globalPrefixes);
|
|
3281
3337
|
const size = boundedSize(tree, limit);
|
|
3282
3338
|
if (typeof size !== "number") {
|
|
3283
|
-
|
|
3339
|
+
warnFile("openapi", spec, spec, `the page ${slug || "/"} ${size === "cycle" ? "has a cyclic example or schema, which cannot be shown" : `is too large to build (over ${Math.round(limit / 1e6 * 10) / 10}M characters)`}`);
|
|
3284
3340
|
tree = [{ type: "heading", props: { level: 1 }, inline: [{ type: "text", text: page.title }] }, { type: "paragraph", inline: [{ type: "text", text: "This page of the API reference is too large to show." }] }];
|
|
3285
3341
|
}
|
|
3286
3342
|
infos.set(slug, {
|
|
@@ -3294,7 +3350,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3294
3350
|
}
|
|
3295
3351
|
specNavs.set(ns, specNav(got.nav, segs));
|
|
3296
3352
|
const strays = [...infos.values()].filter((i) => !i.virtual && ns && (i.slug === ns || i.slug.startsWith(ns + "/")));
|
|
3297
|
-
if (strays.length) warn(`${strays.length} page(s) are in the folder of the OpenAPI source "${ns}", and are left out of the nav: ${strays.slice(0, 5).map(srcOf).join(", ")}${strays.length > 5 ? ", \u2026" : ""}`);
|
|
3353
|
+
if (strays.length) warn("openapi", `${strays.length} page(s) are in the folder of the OpenAPI source "${ns}", and are left out of the nav: ${strays.slice(0, 5).map(srcOf).join(", ")}${strays.length > 5 ? ", \u2026" : ""}`);
|
|
3298
3354
|
}
|
|
3299
3355
|
const labelFor = (slug) => infos.get(slug)?.title;
|
|
3300
3356
|
const memberNav = async (ns) => {
|
|
@@ -3308,9 +3364,13 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3308
3364
|
if (!file) return { nav: fromPages() };
|
|
3309
3365
|
try {
|
|
3310
3366
|
const text = await read(file);
|
|
3311
|
-
return { nav: file.endsWith(".json") ? prefixNav(parseNavJson(text, (slug) => labelFor(ns ? prefixSlug([ns], slug) : slug)), ns) : parseNavYaml(text, labelFor, ns), file };
|
|
3367
|
+
return { nav: file.endsWith(".json") ? prefixNav(parseNavJson(text, (slug) => labelFor(ns ? prefixSlug([ns], slug) : slug)), ns) : parseNavYaml(text, labelFor, ns), file, project: abs(file) };
|
|
3312
3368
|
} catch (e) {
|
|
3313
|
-
|
|
3369
|
+
const mark = e.mark;
|
|
3370
|
+
warn("nav", `could not read ${file}: ${e.message}; using the directory layout`, {
|
|
3371
|
+
file: abs(file),
|
|
3372
|
+
...typeof mark?.line === "number" ? { line: mark.line + 1, column: (mark.column ?? 0) + 1 } : {}
|
|
3373
|
+
});
|
|
3314
3374
|
return { nav: fromPages() };
|
|
3315
3375
|
}
|
|
3316
3376
|
};
|
|
@@ -3318,14 +3378,15 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3318
3378
|
const path = src.nav;
|
|
3319
3379
|
const nsLabel = (slug) => labelFor(ns ? prefixSlug([ns], slug) : slug);
|
|
3320
3380
|
const map = topicMaps.get(path);
|
|
3321
|
-
if (map) return { nav: prefixNav(parseNavJson(JSON.stringify(map.entries), nsLabel), ns), file: path, files: map.maps };
|
|
3381
|
+
if (map) return { nav: prefixNav(parseNavJson(JSON.stringify(map.entries), nsLabel), ns), file: path, project: path, files: map.maps };
|
|
3322
3382
|
const c = input.files.get(path);
|
|
3323
3383
|
const text = c == null ? void 0 : await readText(c);
|
|
3324
3384
|
if (text === void 0) throw new ConfigError(`content.sources (${src.path}): its nav file ${path} does not exist`);
|
|
3325
|
-
return { nav: path.endsWith(".json") ? prefixNav(parseNavJson(text, nsLabel), ns) : parseNavYaml(text, labelFor, ns), file: path, files: [path] };
|
|
3385
|
+
return { nav: path.endsWith(".json") ? prefixNav(parseNavJson(text, nsLabel), ns) : parseNavYaml(text, labelFor, ns), file: path, project: path, files: [path] };
|
|
3326
3386
|
};
|
|
3327
3387
|
let nav = [];
|
|
3328
3388
|
const navFiles = [];
|
|
3389
|
+
const navProjectFiles = [];
|
|
3329
3390
|
for (const m of unit.members) {
|
|
3330
3391
|
if (m.source.from === "openapi") {
|
|
3331
3392
|
const items = specNavs.get(m.namespace) ?? [];
|
|
@@ -3336,6 +3397,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3336
3397
|
}
|
|
3337
3398
|
const got = await memberNav(m.namespace);
|
|
3338
3399
|
if (got.file) navFiles.push(got.file);
|
|
3400
|
+
if (got.project) navProjectFiles.push(got.project);
|
|
3339
3401
|
const group = namespaceNavGroup(m.namespace || void 0, got.nav);
|
|
3340
3402
|
if (!group) nav.push(...got.nav);
|
|
3341
3403
|
else nav.push({ label: group.label, children: group.children, ...infos.has(m.namespace) ? { slug: m.namespace } : {} });
|
|
@@ -3343,7 +3405,10 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3343
3405
|
const { order, trail } = indexNav(nav);
|
|
3344
3406
|
const refusedNav = (nodes) => {
|
|
3345
3407
|
for (const n of nodes) {
|
|
3346
|
-
if (n.refused)
|
|
3408
|
+
if (n.refused) {
|
|
3409
|
+
const m = `refused the script link "${n.refused.slice(0, 80)}" in the nav entry "${n.label}"`;
|
|
3410
|
+
warn("nav", `${navFiles.join(", ")}: ${m}`, { ...navFileAt(), message: m });
|
|
3411
|
+
}
|
|
3347
3412
|
refusedNav(n.children);
|
|
3348
3413
|
}
|
|
3349
3414
|
};
|
|
@@ -3351,7 +3416,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3351
3416
|
const childLinkNav = (nodes) => nodes.map((n) => ({ label: n.label, href: n.slug != null ? `/${n.slug}` : n.href, children: childLinkNav(n.children) }));
|
|
3352
3417
|
let childLinkItems;
|
|
3353
3418
|
let childLinkDirs;
|
|
3354
|
-
for (const s of order) if (!infos.has(s) && !stubTargets.has(s)) warn(`nav entry "${s}" has no page
|
|
3419
|
+
for (const s of order) if (!infos.has(s) && !stubTargets.has(s)) warn("nav", `nav entry "${s}" has no page`, navFileAt());
|
|
3355
3420
|
if (cfg.routablesFrom === "nav") {
|
|
3356
3421
|
const keep = new Set(order);
|
|
3357
3422
|
for (const s of [...infos.keys()]) if (s !== "" && !keep.has(s)) infos.delete(s);
|
|
@@ -3366,7 +3431,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3366
3431
|
if (!scriptUrl3(stub.to, "link")) n.href = stub.to;
|
|
3367
3432
|
else {
|
|
3368
3433
|
n.refused = stub.to;
|
|
3369
|
-
warn(`nav entry "${n.label}": refused the script link "${stub.to.slice(0, 80)}" (its page's redirect)`);
|
|
3434
|
+
warn("nav", `nav entry "${n.label}": refused the script link "${stub.to.slice(0, 80)}" (its page's redirect)`);
|
|
3370
3435
|
}
|
|
3371
3436
|
} else if (stub) {
|
|
3372
3437
|
const p = unit.prefix ? stub.to === unit.prefix ? "" : stub.to.startsWith(unit.prefix + "/") ? stub.to.slice(unit.prefix.length + 1) : void 0 : stub.to;
|
|
@@ -3374,7 +3439,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3374
3439
|
n.slug = p;
|
|
3375
3440
|
n.alias = true;
|
|
3376
3441
|
if (stub.fragment) n.fragment = stub.fragment;
|
|
3377
|
-
} else warn(`nav entry "${from}" redirects to /${stub.to}, which is not a page of this build; it keeps its label without a link`);
|
|
3442
|
+
} else warn("nav", `nav entry "${from}" redirects to /${stub.to}, which is not a page of this build; it keeps its label without a link`);
|
|
3378
3443
|
}
|
|
3379
3444
|
}
|
|
3380
3445
|
dropMissing(n.children);
|
|
@@ -3383,7 +3448,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3383
3448
|
dropMissing(nav);
|
|
3384
3449
|
const blogIndex = cfg.blog?.path;
|
|
3385
3450
|
const replaced = blogIndex === "" ? "" : void 0;
|
|
3386
|
-
if (blogIndex && infos.has(blogIndex)) warn(`the page ${infos.get(blogIndex).source} and the blog index both serve /${blogIndex} on hosts that drop .html; rename one`);
|
|
3451
|
+
if (blogIndex && infos.has(blogIndex)) warn("duplicate-page", `the page ${infos.get(blogIndex).source} and the blog index both serve /${blogIndex} on hosts that drop .html; rename one`);
|
|
3387
3452
|
const posts = blog?.ordered((s) => infos.has(s) && s !== replaced) ?? [];
|
|
3388
3453
|
const postNeighbours = adjacency(posts);
|
|
3389
3454
|
const pageRefs = /* @__PURE__ */ new Map();
|
|
@@ -3411,7 +3476,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3411
3476
|
if (diagrams) {
|
|
3412
3477
|
t = now();
|
|
3413
3478
|
const live = new Set([...infos.values()].map((i) => i.source));
|
|
3414
|
-
await diagrams.flush(
|
|
3479
|
+
await diagrams.flush(diagramWarn, (file) => live.has(file));
|
|
3415
3480
|
phase.diagrams = (phase.diagrams ?? 0) + now() - t;
|
|
3416
3481
|
}
|
|
3417
3482
|
let done = 0;
|
|
@@ -3423,12 +3488,13 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3423
3488
|
const brokenCounts = /* @__PURE__ */ new Map();
|
|
3424
3489
|
const prepare = async (info) => {
|
|
3425
3490
|
const warned = [];
|
|
3426
|
-
const warn2 = (m) => warned.push(m);
|
|
3491
|
+
const warn2 = (code, m, line) => warned.push([code, m, line]);
|
|
3492
|
+
let diagnostics;
|
|
3427
3493
|
let t2 = now();
|
|
3428
3494
|
if (info.virtual) {
|
|
3429
3495
|
const tree2 = structuredClone(info.virtual.tree);
|
|
3430
3496
|
const markdown2 = cfg.mdMirror ? treeToDogsbayMd(tree2) : "";
|
|
3431
|
-
return { raw: markdown2, fm: { title: info.title }, bodySrc: markdown2, pre: { text: markdown2 }, tree: tree2, warned, markdown: markdown2 };
|
|
3497
|
+
return { raw: markdown2, fm: { title: info.title }, bodySrc: markdown2, pre: { text: markdown2 }, tree: tree2, warned, markdown: markdown2, diagnostics };
|
|
3432
3498
|
}
|
|
3433
3499
|
const raw = await read(info.source);
|
|
3434
3500
|
let fm = {};
|
|
@@ -3437,17 +3503,28 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3437
3503
|
const sp = splitFrontmatter2(raw);
|
|
3438
3504
|
fm = sp.data ?? {};
|
|
3439
3505
|
bodySrc = sp.content;
|
|
3440
|
-
} catch {
|
|
3506
|
+
} catch (e) {
|
|
3507
|
+
const err = e;
|
|
3508
|
+
const line = typeof err.mark?.line === "number" ? err.mark.line + 1 : void 0;
|
|
3509
|
+
const reason = err.reason || err.message.split("\n")[0];
|
|
3510
|
+
warn2("front-matter", `front matter does not parse${line ? ` (line ${line})` : ""}: ${reason}`, line);
|
|
3511
|
+
if (mode.diagnostics) diagnostics = [{ code: "front-matter", message: detach(`front matter does not parse: ${reason}`), ...line ? { line } : {} }];
|
|
3441
3512
|
}
|
|
3442
3513
|
const pre = templatesOf(info.source).isTemplatePage(fm) ? { text: await templatesOf(info.source).render(bodySrc, info.source, fm, { firstLine: raw.slice(0, raw.length - bodySrc.length).split("\n").length }) } : await preprocess(bodySrc, info.source, attributesOf(info.source), includesFor(info.source), cfg.undefinedRefs);
|
|
3443
|
-
if (pre.error)
|
|
3514
|
+
if (pre.error) {
|
|
3515
|
+
warn2("template", `template error: ${pre.error}`);
|
|
3516
|
+
if (mode.diagnostics) (diagnostics ??= []).push({ code: "template", message: detach(`template error: ${pre.error}`) });
|
|
3517
|
+
}
|
|
3444
3518
|
phase.template = (phase.template ?? 0) + now() - t2;
|
|
3445
3519
|
t2 = now();
|
|
3446
3520
|
let tree;
|
|
3447
3521
|
try {
|
|
3448
|
-
|
|
3522
|
+
const parsed = dogsbayMdToTree(pre.text, mode.diagnostics ? { diagnostics: true } : void 0);
|
|
3523
|
+
tree = parsed.tree;
|
|
3524
|
+
if (mode.diagnostics) (diagnostics ??= []).push(...linedDiagnostics(parsed.diagnostics ?? [], raw, bodySrc, pre.text));
|
|
3449
3525
|
} catch (e) {
|
|
3450
|
-
warn2(
|
|
3526
|
+
warn2("parse", `parse error: ${e.message}`);
|
|
3527
|
+
if (mode.diagnostics) (diagnostics ??= []).push({ code: "parse", message: detach(`parse error: ${e.message}`) });
|
|
3451
3528
|
tree = [{ type: "html", html: `<pre>${esc3(pre.text)}</pre>` }];
|
|
3452
3529
|
}
|
|
3453
3530
|
phase.parse = (phase.parse ?? 0) + now() - t2;
|
|
@@ -3456,11 +3533,11 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3456
3533
|
t2 = now();
|
|
3457
3534
|
const unresolved = await resolvePlaceholders(tree, resolvers, { source: info.source, read, has: hasContent, scope: scoped(info.source) });
|
|
3458
3535
|
if (unresolved) {
|
|
3459
|
-
for (const m of unresolved) warn2(
|
|
3536
|
+
for (const m of unresolved) warn2("placeholder", m);
|
|
3460
3537
|
phase.resolve = (phase.resolve ?? 0) + now() - t2;
|
|
3461
3538
|
}
|
|
3462
3539
|
const markdown = (unresolved || ns) && cfg.mdMirror ? treeToDogsbayMd(tree) : pre.text;
|
|
3463
|
-
return { raw, fm, bodySrc, pre, tree, warned, markdown };
|
|
3540
|
+
return { raw, fm, bodySrc, pre, tree, warned, markdown, diagnostics };
|
|
3464
3541
|
};
|
|
3465
3542
|
const AHEAD = 24;
|
|
3466
3543
|
const renderAhead = async (all, pool) => {
|
|
@@ -3516,7 +3593,8 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3516
3593
|
const isReplaced = replaced != null && info.slug === replaced;
|
|
3517
3594
|
if (isReplaced && !input.onPageBuilt) return;
|
|
3518
3595
|
const got = prepared ?? await prepare(info);
|
|
3519
|
-
for (const m of got.warned)
|
|
3596
|
+
for (const [code, m, line] of got.warned) warnPage(info, code, m, line);
|
|
3597
|
+
mode.diagnostics?.(srcOf(info), got.diagnostics ?? []);
|
|
3520
3598
|
const { raw, fm, bodySrc, pre, markdown } = got;
|
|
3521
3599
|
let tree = got.tree;
|
|
3522
3600
|
if (hasChildLinks(tree)) {
|
|
@@ -3543,11 +3621,11 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3543
3621
|
return ref ? hrefBetween(info.out, ref.out, cfg.linkStyle) : href;
|
|
3544
3622
|
}
|
|
3545
3623
|
});
|
|
3546
|
-
for (const e of r.empty)
|
|
3624
|
+
for (const e of r.empty) warnPage(info, "child-links", `child-links found no child pages under ${e}`);
|
|
3547
3625
|
}
|
|
3548
3626
|
if (diagrams && !isReplaced) {
|
|
3549
3627
|
t = now();
|
|
3550
|
-
await diagrams.ensure(diagramSources(tree).map(detach), info.source,
|
|
3628
|
+
await diagrams.ensure(diagramSources(tree).map(detach), info.source, diagramWarn);
|
|
3551
3629
|
phase.diagrams = (phase.diagrams ?? 0) + now() - t;
|
|
3552
3630
|
}
|
|
3553
3631
|
const removed = /* @__PURE__ */ new Set();
|
|
@@ -3590,16 +3668,16 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3590
3668
|
if (post) blog.setMinutes(info.slug, readingMinutes(`${txt.headings.join(" ")} ${txt.body}`.split(/\s+/).filter(Boolean).length));
|
|
3591
3669
|
let body = renderBlocks(tree, ctx);
|
|
3592
3670
|
const unloaded = (highlighter.cacheStats().unloaded ?? 0) - unloadedBefore;
|
|
3593
|
-
if (unloaded)
|
|
3671
|
+
if (unloaded) warnPage(info, "highlight", `${unloaded} code block(s) rendered without highlighting: their grammar was not loaded before the page rendered`);
|
|
3594
3672
|
const postHead = post ? postHeader(post, lang, t_, (src) => resolver.asset(src)) : void 0;
|
|
3595
3673
|
const navNode = trail.get(info.slug)?.at(-1);
|
|
3596
3674
|
if (navNode?.children.length && !hasProse(tree)) body += childLinks2(navNode.children, (s) => pageRefs.get(s), info.out, cfg.linkStyle, infos);
|
|
3597
3675
|
const layoutName = str(fm.layout) ?? (post ? "blank" : cfg.layout);
|
|
3598
3676
|
const tocMode = fm.toc === false ? "off" : ["top", "popover", "rail", "off"].includes(fm.toc) ? fm.toc : cfg.toc;
|
|
3599
|
-
for (const u of ctx.unknown)
|
|
3600
|
-
for (const u of ctx.unsafeUrls ?? [])
|
|
3601
|
-
for (const m of removed)
|
|
3602
|
-
for (const name of ctx.missingIcons ?? [])
|
|
3677
|
+
for (const u of ctx.unknown) warnPage(info, "unsupported-node", `unsupported node "${u}" rendered as a plain container`);
|
|
3678
|
+
for (const u of ctx.unsafeUrls ?? []) warnPage(info, "unsafe-url", `refused the unsafe URL "${u}"`);
|
|
3679
|
+
for (const m of removed) warnPage(info, "html", m);
|
|
3680
|
+
for (const name of ctx.missingIcons ?? []) warnPage(info, "icon", `unknown icon "${name}"${input.icons ? "" : " (only the built-in icons are available in this build)"}`);
|
|
3603
3681
|
if (ctx.usedMath) state.usedMath = true;
|
|
3604
3682
|
for (const b of resolver.broken) brokenCounts.has(b) ? brokenCounts.set(b, brokenCounts.get(b) + 1) : brokenCounts.set(detach(b), 1);
|
|
3605
3683
|
phase.render = (phase.render ?? 0) + now() - t;
|
|
@@ -3621,7 +3699,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3621
3699
|
self: pageUrl,
|
|
3622
3700
|
unitPage: (pfx, out) => absoluteUrl(cfg, pfx, servedPath(out, cfg.linkStyle))
|
|
3623
3701
|
});
|
|
3624
|
-
if (canon.warning)
|
|
3702
|
+
if (canon.warning) warnPage(info, "canonical", canon.warning);
|
|
3625
3703
|
const lastUpdated = lastUpdatedOf(fm);
|
|
3626
3704
|
const html = await composePage(
|
|
3627
3705
|
{
|
|
@@ -3736,7 +3814,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3736
3814
|
}
|
|
3737
3815
|
if (brokenCounts.size) {
|
|
3738
3816
|
const list = [...brokenCounts].sort((a, b) => b[1] - a[1]);
|
|
3739
|
-
warn(`${list.length} unresolved link target(s); top: ${list.slice(0, 10).map(([h, n]) => `${h} (${n})`).join(", ")}`);
|
|
3817
|
+
warn("link", `${list.length} unresolved link target(s); top: ${list.slice(0, 10).map(([h, n]) => `${h} (${n})`).join(", ")}`);
|
|
3740
3818
|
}
|
|
3741
3819
|
t = now();
|
|
3742
3820
|
const generatedOuts = await emitGenerated();
|
|
@@ -3822,7 +3900,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3822
3900
|
const before = new Map(brokenCounts);
|
|
3823
3901
|
await renderPage(info);
|
|
3824
3902
|
const broken = [...brokenCounts].filter(([h, n]) => (before.get(h) ?? 0) < n).map(([h]) => h);
|
|
3825
|
-
if (broken.length)
|
|
3903
|
+
if (broken.length) warnPage(info, "link", `unresolved link target(s): ${broken.slice(0, 10).join(", ")}`);
|
|
3826
3904
|
return true;
|
|
3827
3905
|
},
|
|
3828
3906
|
sameFrontMatter(source, text) {
|
|
@@ -3852,7 +3930,7 @@ ${marker}${title}${marker}`, path, attributesOf(path), includesFor(path), cfg.un
|
|
|
3852
3930
|
const partial = async (name, data) => String(await templates.region(`partials/${name}.html`, { t: callable2(([k]) => t_(String(k))), ...data }));
|
|
3853
3931
|
const page = async (out, title, body, o) => {
|
|
3854
3932
|
if (taken.has(out)) {
|
|
3855
|
-
warn(`${out} is a page from the content, so the generated page is not written`);
|
|
3933
|
+
warn("site", `${out} is a page from the content, so the generated page is not written`);
|
|
3856
3934
|
return;
|
|
3857
3935
|
}
|
|
3858
3936
|
const unitRoot = rootPrefix(out);
|
|
@@ -4373,34 +4451,55 @@ async function openDevSession(input, o = {}) {
|
|
|
4373
4451
|
let ctx;
|
|
4374
4452
|
let config;
|
|
4375
4453
|
let taken = 0;
|
|
4454
|
+
let takenProblems = 0;
|
|
4376
4455
|
let buildError;
|
|
4456
|
+
let buildProblem;
|
|
4457
|
+
let diagnosed = /* @__PURE__ */ new Map();
|
|
4458
|
+
const failed = (e) => {
|
|
4459
|
+
buildError = e.message || String(e);
|
|
4460
|
+
buildProblem = problemOf(e, buildError);
|
|
4461
|
+
};
|
|
4377
4462
|
const full = async () => {
|
|
4378
4463
|
const next = /* @__PURE__ */ new Map();
|
|
4379
4464
|
const nextUnits = /* @__PURE__ */ new Map();
|
|
4465
|
+
const nextDiagnosed = /* @__PURE__ */ new Map();
|
|
4380
4466
|
let nextCtx;
|
|
4381
4467
|
const sink = async (path, content) => {
|
|
4382
4468
|
next.set(path, isStream(content) ? await joinChunks(content.chunks()) : content);
|
|
4383
4469
|
};
|
|
4384
4470
|
const file = input.files.get("dogsbay.config.yml") ?? input.files.get("dogsbay.config.yaml");
|
|
4385
4471
|
const text = (file !== void 0 ? await textOf(file) : void 0) ?? input.configText ?? (typeof input.config === "string" ? input.config : void 0);
|
|
4386
|
-
const
|
|
4472
|
+
const name = input.files.has("dogsbay.config.yml") ? "dogsbay.config.yml" : input.files.has("dogsbay.config.yaml") ? "dogsbay.config.yaml" : void 0;
|
|
4473
|
+
let parsed;
|
|
4474
|
+
try {
|
|
4475
|
+
parsed = typeof input.config === "object" && file === void 0 ? input.config : parseConfig(text);
|
|
4476
|
+
} catch (e) {
|
|
4477
|
+
throw inConfig(e, name);
|
|
4478
|
+
}
|
|
4387
4479
|
const nextConfig = { ...parsed, llmsTxt: o.llms === true && parsed.llmsTxt, search: o.search === false ? false : parsed.search };
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4480
|
+
try {
|
|
4481
|
+
await build(
|
|
4482
|
+
// Drafts are shown while writing, as `dogsbay site dev` shows them.
|
|
4483
|
+
{ ...input, config: nextConfig, sink, includeDrafts: true },
|
|
4484
|
+
{
|
|
4485
|
+
keep: true,
|
|
4486
|
+
lazy: o.lazy,
|
|
4487
|
+
context: (c) => nextCtx = c,
|
|
4488
|
+
diagnostics: (f, list) => nextDiagnosed.set(f, list),
|
|
4489
|
+
// A copy: the build keeps adding the classes of pages it renders later to its own set.
|
|
4490
|
+
unitBuilt: (unit, handle, classes) => nextUnits.set(unit.prefix, { unit, handle, classes: new Set(classes) })
|
|
4491
|
+
}
|
|
4492
|
+
);
|
|
4493
|
+
} catch (e) {
|
|
4494
|
+
throw e instanceof ConfigError ? inConfig(e, name) : e;
|
|
4495
|
+
}
|
|
4399
4496
|
out = next;
|
|
4400
4497
|
units = nextUnits;
|
|
4401
4498
|
ctx = nextCtx;
|
|
4499
|
+
diagnosed = nextDiagnosed;
|
|
4402
4500
|
config = nextCtx?.cfg ?? nextConfig;
|
|
4403
4501
|
taken = 0;
|
|
4502
|
+
takenProblems = 0;
|
|
4404
4503
|
stale = /* @__PURE__ */ new Set();
|
|
4405
4504
|
if (o.lazy) for (const u of units.values()) for (const p of u.handle.pageOuts) stale.add(p);
|
|
4406
4505
|
};
|
|
@@ -4452,8 +4551,29 @@ async function openDevSession(input, o = {}) {
|
|
|
4452
4551
|
try {
|
|
4453
4552
|
await full();
|
|
4454
4553
|
} catch (e) {
|
|
4455
|
-
|
|
4554
|
+
failed(e);
|
|
4456
4555
|
}
|
|
4556
|
+
const get = async (path) => {
|
|
4557
|
+
if (stale.has(path)) {
|
|
4558
|
+
const u = [...units.values()].find((x) => x.handle.pageOuts.includes(path));
|
|
4559
|
+
if (u) {
|
|
4560
|
+
let p = rendering.get(path);
|
|
4561
|
+
if (!p) {
|
|
4562
|
+
p = renderStale(path, u).finally(() => rendering.delete(path));
|
|
4563
|
+
rendering.set(path, p);
|
|
4564
|
+
}
|
|
4565
|
+
await p;
|
|
4566
|
+
} else {
|
|
4567
|
+
stale.delete(path);
|
|
4568
|
+
}
|
|
4569
|
+
}
|
|
4570
|
+
const c = out.get(path);
|
|
4571
|
+
if (c === void 0) return void 0;
|
|
4572
|
+
if (isRef(c)) return await c.read();
|
|
4573
|
+
const lazy = await textOf(c);
|
|
4574
|
+
return lazy ?? c;
|
|
4575
|
+
};
|
|
4576
|
+
const pageFor = (source) => unitOf(source)?.handle.pageForSource(source);
|
|
4457
4577
|
return {
|
|
4458
4578
|
get config() {
|
|
4459
4579
|
return config;
|
|
@@ -4461,9 +4581,10 @@ async function openDevSession(input, o = {}) {
|
|
|
4461
4581
|
get buildError() {
|
|
4462
4582
|
return buildError;
|
|
4463
4583
|
},
|
|
4464
|
-
|
|
4465
|
-
return
|
|
4584
|
+
get buildProblem() {
|
|
4585
|
+
return buildProblem;
|
|
4466
4586
|
},
|
|
4587
|
+
pageFor,
|
|
4467
4588
|
sourceFor(path) {
|
|
4468
4589
|
return unitForSitePath(path)?.handle.sourceForPage(path);
|
|
4469
4590
|
},
|
|
@@ -4473,37 +4594,34 @@ async function openDevSession(input, o = {}) {
|
|
|
4473
4594
|
taken = all.length;
|
|
4474
4595
|
return fresh;
|
|
4475
4596
|
},
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
}
|
|
4597
|
+
takeProblems() {
|
|
4598
|
+
const all = ctx?.problems ?? [];
|
|
4599
|
+
const fresh = all.slice(takenProblems);
|
|
4600
|
+
takenProblems = all.length;
|
|
4601
|
+
return fresh;
|
|
4602
|
+
},
|
|
4603
|
+
async diagnostics(source) {
|
|
4604
|
+
const page = pageFor(source);
|
|
4605
|
+
if (page === void 0) return [];
|
|
4606
|
+
try {
|
|
4607
|
+
await get(page);
|
|
4608
|
+
} catch {
|
|
4489
4609
|
}
|
|
4490
|
-
|
|
4491
|
-
if (c === void 0) return void 0;
|
|
4492
|
-
if (isRef(c)) return await c.read();
|
|
4493
|
-
const lazy = await textOf(c);
|
|
4494
|
-
return lazy ?? c;
|
|
4610
|
+
return diagnosed.get(source) ?? [];
|
|
4495
4611
|
},
|
|
4612
|
+
get,
|
|
4496
4613
|
async change(paths) {
|
|
4497
4614
|
try {
|
|
4498
4615
|
if (buildError !== void 0) {
|
|
4499
4616
|
await full();
|
|
4500
4617
|
buildError = void 0;
|
|
4618
|
+
buildProblem = void 0;
|
|
4501
4619
|
return { css: true };
|
|
4502
4620
|
}
|
|
4503
4621
|
return await changeParts(paths);
|
|
4504
4622
|
} catch (e) {
|
|
4505
|
-
|
|
4506
|
-
|
|
4623
|
+
failed(e);
|
|
4624
|
+
return { css: false };
|
|
4507
4625
|
}
|
|
4508
4626
|
}
|
|
4509
4627
|
};
|
|
@@ -4536,7 +4654,10 @@ async function openDevSession(input, o = {}) {
|
|
|
4536
4654
|
lazy.add(u.unit.prefix);
|
|
4537
4655
|
} else {
|
|
4538
4656
|
const at = memberPath(u.unit, p)?.path ?? p.slice(sourceRoot(u.unit.source).length);
|
|
4539
|
-
|
|
4657
|
+
const key = u.unit.prefix ? `${u.unit.prefix}/${at}` : at;
|
|
4658
|
+
const sanitizing = (config.html ?? input.defaultHtml ?? "keep") === "sanitize";
|
|
4659
|
+
if (copiedPath(at) && await assetVerdict(at, content, input.untrusted === true, sanitizing) === "copy") out.set(key, content);
|
|
4660
|
+
else out.delete(key);
|
|
4540
4661
|
}
|
|
4541
4662
|
}
|
|
4542
4663
|
if (lazy.size) for (const s of ctx.state.stubs) out.delete(s);
|
|
@@ -4602,6 +4723,17 @@ async function joinChunks(chunks) {
|
|
|
4602
4723
|
for await (const c of chunks) s += c;
|
|
4603
4724
|
return s;
|
|
4604
4725
|
}
|
|
4726
|
+
function inConfig(e, file) {
|
|
4727
|
+
if (e && typeof e === "object") Object.assign(e, { inConfig: true }, file ? { configFile: file } : {});
|
|
4728
|
+
return e;
|
|
4729
|
+
}
|
|
4730
|
+
function problemOf(e, text) {
|
|
4731
|
+
const err = e ?? {};
|
|
4732
|
+
const config = err.inConfig === true || e instanceof ConfigError;
|
|
4733
|
+
const file = err.configFile;
|
|
4734
|
+
const at = typeof err.mark?.line === "number" ? { line: err.mark.line + 1, column: (err.mark.column ?? 0) + 1 } : {};
|
|
4735
|
+
return { code: config ? "config" : "build", ...file ? { file } : {}, ...at, message: err.reason || text.split("\n")[0], text };
|
|
4736
|
+
}
|
|
4605
4737
|
|
|
4606
4738
|
// src/core/merman.ts
|
|
4607
4739
|
var MAX_DIAGRAM_CHARS = 1e5;
|
|
@@ -4655,8 +4787,8 @@ function peleRenderer() {
|
|
|
4655
4787
|
// src/package/prebuilt.ts
|
|
4656
4788
|
import { minifyCss } from "@dogsbay/render-html/css-tools";
|
|
4657
4789
|
var SHEETS = {
|
|
4658
|
-
default: () => import("./chunks/prebuilt-css-default-
|
|
4659
|
-
mintlify: () => import("./chunks/prebuilt-css-mintlify-
|
|
4790
|
+
default: () => import("./chunks/prebuilt-css-default-GJIN3VOR.mjs"),
|
|
4791
|
+
mintlify: () => import("./chunks/prebuilt-css-mintlify-SKWKD2KB.mjs")
|
|
4660
4792
|
};
|
|
4661
4793
|
var prebuiltSiteCss = async (o) => {
|
|
4662
4794
|
const base = (await (SHEETS[o.theme] ?? SHEETS.default)()).CSS;
|