@stacksjs/bunpress 0.2.30 → 0.2.32

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.
@@ -1,11 +1,15 @@
1
1
  // @bun
2
- import{$ as sQ,B as S,E as e,F as pQ,G as jJ,H as uQ,I as hQ,J as pJ,K as uJ,M as gQ,N as mQ,O as dQ,Q as cQ,Z as UJ,_ as lQ,aa as hJ,ba as F,ca as rQ,da as iQ,ea as oQ,z as kQ}from"./chunk-778jqyb6.js";import{fa as a,ga as NJ,ha as p,ia as bJ,ja as fJ,ka as xQ,la as vQ,na as CQ,oa as vJ,pa as bQ,qa as fQ}from"./chunk-gn1n2yxt.js";var{Glob:wQ,YAML:LQ}=globalThis.Bun;import{randomUUID as aQ}from"crypto";import{stat as OJ}from"fs/promises";import{join as JJ,resolve as n,sep as AQ}from"path";import t from"process";var{Glob:GZ}=globalThis.Bun;import{join as iJ,resolve as jZ}from"path";import UZ from"process";var XJ=new Map;function OZ(J,Z,Q){let $=Z.split("."),Y=J;for(let X=0;X<$.length-1;X++){let q=$[X];if(typeof Y[q]!=="object"||Y[q]===null)Y[q]={};Y=Y[q]}Y[$[$.length-1]]=Q}async function oJ(J,Z){let Q=Z?jZ(UZ.cwd(),Z):iJ(J,".data");if(XJ.has(Q))return XJ.get(Q);let $={};try{let Y=new GZ("**/*.json");for await(let X of Y.scan({cwd:Q,absolute:!1}))try{let q=await Bun.file(iJ(Q,X)).text(),z=X.replace(/\.json$/,"").replace(/[/\\]/g,".");OZ($,z,JSON.parse(q))}catch{}}catch{}return XJ.set(Q,$),$}function aJ(){XJ.clear()}import{createHighlighter as NZ,highlight as BZ,listLanguages as EZ}from"ts-syntax-highlighter";var r=null;function m0(){r=null}async function nJ(){if(r)return r;return r=await NZ({theme:"github-light",cache:!0}),r}var LJ=null;function tJ(){if(LJ)return LJ;let J=new Map;try{for(let Z of EZ()){J.set(Z.id.toLowerCase(),Z.id);for(let Q of Z.aliases??[])J.set(Q.toLowerCase(),Z.id)}}catch{}return LJ=J,J}var qJ={};function eJ(J){qJ={};for(let[Z,Q]of Object.entries(J??{}))qJ[Z.toLowerCase().trim()]=Q.toLowerCase().trim()}function JQ(J){let Z=J.toLowerCase().trim(),Q=qJ[Z]??Z;return tJ().get(Q)??Q}function QQ(J){let Z=J.toLowerCase().trim();return tJ().has(qJ[Z]??Z)}function zJ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function RZ(J,Z){let Q=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,$=[],Y;while((Y=Q.exec(Z))!==null){let z=Y[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;/g,"'");if(z)$.push({text:z,span:Y[0]})}if($.length===0)return Z;let X="",q=0;for(let z=0;z<$.length;z++){let{text:W,span:V}=$[z],K=J.indexOf(W,q);if(K===-1){X+=V;continue}if(K>q){let G=J.substring(q,K);if(/^\s+$/.test(G))X+=G}X+=V,q=K+W.length}return X}async function WJ(J,Z,Q="github-light"){let $=JQ(Z);if(!QQ($))return J.split(`
3
- `).map((X)=>`<span class="line">${zJ(X)}</span>`).join(`
2
+ import{$ as nQ,B as P,E as e,F as dQ,G as OJ,H as cQ,I as lQ,J as hJ,K as mJ,M as sQ,N as rQ,O as iQ,Q as oQ,Z as jJ,_ as aQ,aa as dJ,ba as F,ca as tQ,da as eQ,ea as JZ,z as fQ}from"./chunk-f5ycxw18.js";import{fa as a,ga as EJ,ha as p,ia as uJ,ja as gJ,ka as pQ,la as uQ,na as gQ,oa as fJ,pa as hQ,qa as mQ}from"./chunk-gn1n2yxt.js";var{Glob:PQ,YAML:SQ}=globalThis.Bun;import{randomUUID as QZ}from"crypto";import{stat as NJ}from"fs/promises";import{join as JJ,resolve as n,sep as kQ}from"path";import t from"process";var{Glob:EZ}=globalThis.Bun;import{join as tJ,resolve as RZ}from"path";import BZ from"process";var XJ=new Map;function FZ(J,Z,Q){let $=Z.split("."),Y=J;for(let X=0;X<$.length-1;X++){let z=$[X];if(typeof Y[z]!=="object"||Y[z]===null)Y[z]={};Y=Y[z]}Y[$[$.length-1]]=Q}async function eJ(J,Z){let Q=Z?RZ(BZ.cwd(),Z):tJ(J,".data");if(XJ.has(Q))return XJ.get(Q);let $={};try{let Y=new EZ("**/*.json");for await(let X of Y.scan({cwd:Q,absolute:!1}))try{let z=await Bun.file(tJ(Q,X)).text(),W=X.replace(/\.json$/,"").replace(/[/\\]/g,".");FZ($,W,JSON.parse(z))}catch{}}catch{}return XJ.set(Q,$),$}function JQ(){XJ.clear()}function QQ(J){return/(?:^|[\s>+~,(])(?:html)?\.dark(?![\w-])/.test(J)}function MZ(J){return IZ(J,",").map((Z)=>Z.trim()).filter((Z)=>Z&&QQ(Z)).map((Z)=>Z.replace(/^html\.dark(?![\w-])/,"html[data-theme-mode='auto']:not([data-bp-theme])").replace(/^\.dark(?![\w-])/,"html[data-theme-mode='auto']:not([data-bp-theme])").replace(/(?<=[\s>+~(])(?:html)?\.dark(?![\w-])/g,"html[data-theme-mode='auto']:not([data-bp-theme])")).join(`,
3
+ `)}function IZ(J,Z){let Q=[],$=0,Y=null,X=0;for(let z=0;z<J.length;z++){let W=J[z];if(Y){if(W==="\\")z++;else if(W===Y)Y=null;continue}if(W==='"'||W==="'"){Y=W;continue}if(W==="("||W==="["){$++;continue}if(W===")"||W==="]"){$--;continue}if(W===Z&&$===0)Q.push(J.slice(X,z)),X=z+1}return Q.push(J.slice(X)),Q}function DZ(J){let Z=[],Q=0,$=0;while(Q<J.length){let Y=J[Q];if(Y==="/"&&J[Q+1]==="*"){let X=J.indexOf("*/",Q+2);Q=X===-1?J.length:X+2;continue}if(Y==='"'||Y==="'"){let X=Y;Q++;while(Q<J.length&&J[Q]!==X){if(J[Q]==="\\")Q++;Q++}Q++;continue}if(Y==="{"){let X=1,z=Q+1;while(z<J.length&&X>0){let W=J[z];if(W==="/"&&J[z+1]==="*"){let q=J.indexOf("*/",z+2);z=q===-1?J.length:q+2;continue}if(W==='"'||W==="'"){let q=W;z++;while(z<J.length&&J[z]!==q){if(J[z]==="\\")z++;z++}z++;continue}if(W==="{")X++;else if(W==="}")X--;z++}if(X===0)Z.push({prelude:J.slice($,Q),body:J.slice(Q+1,z-1)});Q=z,$=Q;continue}if(Y===";"&&J.slice($,Q).trimStart().startsWith("@")){Q++,$=Q;continue}Q++}return Z}function zJ(J){let Z=[];for(let{prelude:Q,body:$}of DZ(J)){let Y=Q.replace(/\/\*[\s\S]*?\*\//g,"").trim();if(!Y||Y.startsWith("@")||!QQ(Y))continue;let X=MZ(Y);if(!X)continue;Z.push(`${X} {${$}}`)}if(!Z.length)return"";return["","/* Dark palette for a reader with no JavaScript to add the class it is"," * gated on. Generated from the dark rules above - see dark-mode-fallback.ts. */","@media (prefers-color-scheme: dark) {",Z.join(`
4
+
5
+ `),"}",""].join(`
6
+ `)}import{createHighlighter as TZ,highlight as wZ,listLanguages as LZ}from"ts-syntax-highlighter";var r=null;function t0(){r=null}async function ZQ(){if(r)return r;return r=await TZ({theme:"github-light",cache:!0}),r}var HJ=null;function $Q(){if(HJ)return HJ;let J=new Map;try{for(let Z of LZ()){J.set(Z.id.toLowerCase(),Z.id);for(let Q of Z.aliases??[])J.set(Q.toLowerCase(),Z.id)}}catch{}return HJ=J,J}var WJ={};function YQ(J){WJ={};for(let[Z,Q]of Object.entries(J??{}))WJ[Z.toLowerCase().trim()]=Q.toLowerCase().trim()}function XQ(J){let Z=J.toLowerCase().trim(),Q=WJ[Z]??Z;return $Q().get(Q)??Q}function zQ(J){let Z=J.toLowerCase().trim();return $Q().has(WJ[Z]??Z)}function qJ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function AZ(J,Z){let Q=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,$=[],Y;while((Y=Q.exec(Z))!==null){let W=Y[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;/g,"'");if(W)$.push({text:W,span:Y[0]})}if($.length===0)return Z;let X="",z=0;for(let W=0;W<$.length;W++){let{text:q,span:V}=$[W],K=J.indexOf(q,z);if(K===-1){X+=V;continue}if(K>z){let _=J.substring(z,K);if(/^\s+$/.test(_))X+=_}X+=V,z=K+q.length}return X}async function KJ(J,Z,Q="github-light"){let $=XQ(Z);if(!zQ($))return J.split(`
7
+ `).map((X)=>`<span class="line">${qJ(X)}</span>`).join(`
4
8
  `);try{let Y=J.split(`
5
- `);return(await Promise.all(Y.map(async(q)=>{if(!q.trim())return`<span class="line">${q}</span>`;let W=(await BZ(q,$,{theme:Q})).html;if(W=W.replace(/<div[^>]*class="syntax-wrapper"[^>]*>/g,""),W=W.replace(/<\/div>\s*$/g,""),W=W.replace(/<pre[^>]*>/g,""),W=W.replace(/<\/pre>/g,""),W=W.replace(/<code[^>]*>/g,""),W=W.replace(/<\/code>/g,""),W=RZ(q,W.trim()),!W.startsWith('<span class="line">'))W=`<span class="line">${W}</span>`;return W}))).join(`
9
+ `);return(await Promise.all(Y.map(async(z)=>{if(!z.trim())return`<span class="line">${z}</span>`;let q=(await wZ(z,$,{theme:Q})).html;if(q=q.replace(/<div[^>]*class="syntax-wrapper"[^>]*>/g,""),q=q.replace(/<\/div>\s*$/g,""),q=q.replace(/<pre[^>]*>/g,""),q=q.replace(/<\/pre>/g,""),q=q.replace(/<code[^>]*>/g,""),q=q.replace(/<\/code>/g,""),q=AZ(z,q.trim()),!q.startsWith('<span class="line">'))q=`<span class="line">${q}</span>`;return q}))).join(`
6
10
  `)}catch(Y){return console.warn(`Failed to highlight code for language "${Z}":`,Y),J.split(`
7
- `).map((q)=>`<span class="line">${zJ(q)}</span>`).join(`
8
- `)}}function d0(J,Z){let Q=JQ(Z);if(!QQ(Q))return zJ(J);return zJ(J)}function ZQ(){return`
11
+ `).map((z)=>`<span class="line">${qJ(z)}</span>`).join(`
12
+ `)}}function e0(J,Z){let Q=XQ(Z);if(!zQ(Q))return qJ(J);return qJ(J)}function WQ(){return`
9
13
  /* Basic syntax highlighting styles for ts-syntax-highlighter */
10
14
  /* The actual theme colors are injected by ts-syntax-highlighter */
11
15
 
@@ -117,6 +121,43 @@ html.dark .token[class*='invalid'] {
117
121
  color: #ffa198 !important;
118
122
  }
119
123
 
124
+ /* Light-mode token corrections.
125
+ * -------------------------------------------------------------------------
126
+ * Same mechanism as the dark block above, for a smaller reason. The resolved
127
+ * theme is GitHub Light, whose palette is specified against
128
+ * \`editor.background: #ffffff\` - and a code block here is drawn on
129
+ * --bp-c-bg-alt, a shade below white, with a line-highlight wash a shade
130
+ * below that. Three of its colours have no room for either:
131
+ *
132
+ * comment #6e7781 4.55:1 on white, 4.21:1 on the block, 3.74:1 on a
133
+ * highlighted line
134
+ * function #8250df 5.05 / 4.67 / 4.15
135
+ * keyword #cf222e 5.36 / 4.96 / 4.40
136
+ *
137
+ * Darkening the three is what fits: the alternative is putting code blocks on
138
+ * white, which is the palette's own ground but leaves the block with no edge
139
+ * against the page. Every other token in the theme clears 4.5:1 on the
140
+ * block, the highlighted line, the diff washes and a <mark>, so they are
141
+ * left exactly as the theme wrote them.
142
+ *
143
+ * Unguarded selectors, deliberately: every dark rule above carries
144
+ * \`html.dark\`, which outranks a bare class whatever the order, so the dark
145
+ * palette wins in the dark without a \`:not(.dark)\` on each of these - and
146
+ * without one more place where the two halves can fall out of step. */
147
+ .token[class*='comment'] {
148
+ color: #5c636b !important;
149
+ }
150
+
151
+ .token[class*='entity-name-function'],
152
+ .token[class*='support-function'] {
153
+ color: #7a3fd0 !important;
154
+ }
155
+
156
+ .token[class*='keyword'],
157
+ .token[class*='storage'] {
158
+ color: #c5141f !important;
159
+ }
160
+
120
161
  /* Line highlighting
121
162
  * -------------------------------------------------------------------------
122
163
  * Lines are emitted as \`<span class="line">\u2026</span>\\n\` so that the code
@@ -149,9 +190,11 @@ html.dark .token[class*='invalid'] {
149
190
  filter: none;
150
191
  }
151
192
 
193
+ /* The fallback for a page without the theme sheet's focus rules. Desaturated
194
+ * rather than faded: grayscale moves the hue and leaves the luminance, so the
195
+ * row still reads. opacity: 0.5 here put every token under 3:1. */
152
196
  .line.dimmed {
153
- opacity: 0.5;
154
- filter: grayscale(50%);
197
+ filter: grayscale(100%);
155
198
  }
156
199
 
157
200
  /* Diff highlighting */
@@ -177,13 +220,22 @@ html.dark .token[class*='invalid'] {
177
220
  box-shadow: inset 3px 0 #f59e0b;
178
221
  }
179
222
 
180
- /* Line numbers */
223
+ /* Line numbers
224
+ * -------------------------------------------------------------------------
225
+ * Keyed off html.dark like everything else in this sheet. It used to key off
226
+ * the OS preference, which is the one switch that disagrees with the rest: an
227
+ * explicit light choice on a dark machine put #9ca3af on a light block
228
+ * (2.2:1), and an explicit dark choice on a light machine left #6b7280 on a
229
+ * dark one (2.6:1) - the two cases a theme toggle exists to produce.
230
+ *
231
+ * #6b7280 also only managed 4.48:1 on the block and 3.97:1 on a highlighted
232
+ * line, so the light value came down with it. */
181
233
  .line-number {
182
234
  display: inline-block;
183
235
  width: 2.5rem;
184
236
  text-align: right;
185
237
  padding-right: 1rem;
186
- color: #6b7280;
238
+ color: #5b6270;
187
239
  user-select: none;
188
240
  }
189
241
 
@@ -191,17 +243,15 @@ html.dark .token[class*='invalid'] {
191
243
  padding-left: 0;
192
244
  }
193
245
 
194
- @media (prefers-color-scheme: dark) {
195
- .line-number {
196
- color: #9ca3af;
197
- }
246
+ html.dark .line-number {
247
+ color: #9ca3af;
198
248
  }
199
- `}async function c0(){await nJ()}async function l0(){return nJ()}import{stat as FZ}from"fs/promises";import{relative as $Q,resolve as o}from"path";import MZ from"process";var i=new Map;async function TZ(J){let Z=o(J);if(i.has(Z))return i.get(Z);try{let Q=Bun.spawn(["git","log","--pretty=format:%cI","--name-only","--relative","--no-merges","--","."],{cwd:Z,stdout:"pipe",stderr:"ignore"}),[$,Y]=await Promise.all([Q.exited,new Response(Q.stdout).text()]);if($!==0)return i.set(Z,null),null;let X=new Map,q="";for(let z of Y.split(`
200
- `)){if(!z.trim())continue;if(/^\d{4}-\d{2}-\d{2}T/.test(z)){q=z.trim();continue}if(q&&!X.has(z))X.set(z,q)}return i.set(Z,X),X}catch{return i.set(Z,null),null}}async function YQ(J,Z){let Q=await TZ(J);if(Q){let $=$Q(o(J),o(Z)).replace(/\\/g,"/"),Y=Q.get($);if(Y)return Y}try{return(await FZ(Z)).mtime.toISOString()}catch{return null}}function XQ(J,Z,Q){let $=$Q(o(MZ.cwd(),Z),o(Q)).replace(/\\/g,"/");return J.includes(":path")?J.replace(":path",$):`${J.replace(/\/$/,"")}/${$}`}function qQ(J,Z,Q){let $=new Date(J);if(Number.isNaN($.getTime()))return"";try{return new Intl.DateTimeFormat(Z,Q??{dateStyle:"medium"}).format($)}catch{return $.toISOString().slice(0,10)}}import{join as AJ}from"path";var KJ=new Map,zQ="\x00BPCODE",WQ="\x00";async function KQ(J,Z){let Q=AJ(J,Z);if(KJ.has(Q))return KJ.get(Q);let $=[AJ(J,`${Z}.stx`),AJ(J,Z,"index.stx")],Y=null;for(let X of $){let q=Bun.file(X);if(await q.exists()){Y={source:await q.text(),path:X};break}}return KJ.set(Q,Y),Y}function VQ(){KJ.clear()}function IZ(J,Z){try{let Q=Object.keys(Z),$=Q.map((Y)=>Z[Y]);return Function(...Q,`"use strict"; return (${J});`)(...$)}catch{return}}function DZ(J,Z){let Q={};if(!J)return Q;let $=/([:@]?[\w-]+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]*)\}))?/g,Y;while(Y=$.exec(J)){let X=Y[1];if(!X)continue;let q=X.startsWith(":"),z=X.replace(/^[:@]/,""),W=Y[2],V=Y[3],K=Y[4],G=W??V??K;if(G===void 0)Q[z]=!0;else if(q||K!==void 0)Q[z]=IZ(G,Z);else Q[z]=G}return Q}async function HJ(J,Z,Q,$={},Y=0){if(Y>10||!J.includes("<"))return J;let X=[],q=J.replace(/```[\s\S]*?```/g,(_)=>{return X.push(_),`${zQ}${X.length-1}${WQ}`}).replace(/`[^`\n]*`/g,(_)=>{return X.push(_),`${zQ}${X.length-1}${WQ}`}),z=/<([A-Z][A-Za-z0-9]*)((?:\s[^>]*?)?)(\/?)>/g,W="",V=0,K=!1,G;while(G=z.exec(q)){let _=G[0],U=G[1],N=G[2],B=G[3],R=await KQ(Z,U)??($.fallbackComponentsDir?await KQ($.fallbackComponentsDir,U):null);if(R==null)continue;K=!0,W+=q.slice(V,G.index);let M="",I=G.index+_.length;if(!B){let E=new RegExp(`</${U}>`,"g");E.lastIndex=I;let j=E.exec(q);if(j)M=q.slice(I,j.index).trim(),I=j.index+j[0].length}let T=DZ(N.trim(),Q),D;try{let{renderTemplateString:E}=await import("@stacksjs/stx/render"),j=/<script\b[^>]*\bclient\b/.test(R.source);if(D=await E(R.source,R.path,{context:{...Q,...T,slot:M},options:{componentsDir:Z,fallbackComponentsDir:$.fallbackComponentsDir},injectCSS:j,templateOnly:!j}),j&&$.rendered){let O=`BPLIVECOMPONENT${$.rendered.size}END`;$.rendered.set(O,D),D=`
249
+ `}async function J1(){await ZQ()}async function Q1(){return ZQ()}import{stat as HZ}from"fs/promises";import{relative as qQ,resolve as o}from"path";import yZ from"process";var i=new Map;async function PZ(J){let Z=o(J);if(i.has(Z))return i.get(Z);try{let Q=Bun.spawn(["git","log","--pretty=format:%cI","--name-only","--relative","--no-merges","--","."],{cwd:Z,stdout:"pipe",stderr:"ignore"}),[$,Y]=await Promise.all([Q.exited,new Response(Q.stdout).text()]);if($!==0)return i.set(Z,null),null;let X=new Map,z="";for(let W of Y.split(`
250
+ `)){if(!W.trim())continue;if(/^\d{4}-\d{2}-\d{2}T/.test(W)){z=W.trim();continue}if(z&&!X.has(W))X.set(W,z)}return i.set(Z,X),X}catch{return i.set(Z,null),null}}async function KQ(J,Z){let Q=await PZ(J);if(Q){let $=qQ(o(J),o(Z)).replace(/\\/g,"/"),Y=Q.get($);if(Y)return Y}try{return(await HZ(Z)).mtime.toISOString()}catch{return null}}function VQ(J,Z,Q){let $=qQ(o(yZ.cwd(),Z),o(Q)).replace(/\\/g,"/");return J.includes(":path")?J.replace(":path",$):`${J.replace(/\/$/,"")}/${$}`}function GQ(J,Z,Q){let $=new Date(J);if(Number.isNaN($.getTime()))return"";try{return new Intl.DateTimeFormat(Z,Q??{dateStyle:"medium"}).format($)}catch{return $.toISOString().slice(0,10)}}import{join as yJ}from"path";var VJ=new Map,_Q="\x00BPCODE",UQ="\x00";async function OQ(J,Z){let Q=yJ(J,Z);if(VJ.has(Q))return VJ.get(Q);let $=[yJ(J,`${Z}.stx`),yJ(J,Z,"index.stx")],Y=null;for(let X of $){let z=Bun.file(X);if(await z.exists()){Y={source:await z.text(),path:X};break}}return VJ.set(Q,Y),Y}function jQ(){VJ.clear()}function SZ(J,Z){try{let Q=Object.keys(Z),$=Q.map((Y)=>Z[Y]);return Function(...Q,`"use strict"; return (${J});`)(...$)}catch{return}}function kZ(J,Z){let Q={};if(!J)return Q;let $=/([:@]?[\w-]+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]*)\}))?/g,Y;while(Y=$.exec(J)){let X=Y[1];if(!X)continue;let z=X.startsWith(":"),W=X.replace(/^[:@]/,""),q=Y[2],V=Y[3],K=Y[4],_=q??V??K;if(_===void 0)Q[W]=!0;else if(z||K!==void 0)Q[W]=SZ(_,Z);else Q[W]=_}return Q}async function PJ(J,Z,Q,$={},Y=0){if(Y>10||!J.includes("<"))return J;let X=[],z=J.replace(/```[\s\S]*?```/g,(G)=>{return X.push(G),`${_Q}${X.length-1}${UQ}`}).replace(/`[^`\n]*`/g,(G)=>{return X.push(G),`${_Q}${X.length-1}${UQ}`}),W=/<([A-Z][A-Za-z0-9]*)((?:\s[^>]*?)?)(\/?)>/g,q="",V=0,K=!1,_;while(_=W.exec(z)){let G=_[0],O=_[1],N=_[2],E=_[3],B=await OQ(Z,O)??($.fallbackComponentsDir?await OQ($.fallbackComponentsDir,O):null);if(B==null)continue;K=!0,q+=z.slice(V,_.index);let M="",D=_.index+G.length;if(!E){let R=new RegExp(`</${O}>`,"g");R.lastIndex=D;let U=R.exec(z);if(U)M=z.slice(D,U.index).trim(),D=U.index+U[0].length}let I=kZ(N.trim(),Q),T;try{let{renderTemplateString:R}=await import("@stacksjs/stx/render"),U=/<script\b[^>]*\bclient\b/.test(B.source);if(T=await R(B.source,B.path,{context:{...Q,...I,slot:M},options:{componentsDir:Z,fallbackComponentsDir:$.fallbackComponentsDir},injectCSS:U,templateOnly:!U}),U&&$.rendered){let j=`BPLIVECOMPONENT${$.rendered.size}END`;$.rendered.set(j,T),T=`
201
251
 
202
- ${O}
252
+ ${j}
203
253
 
204
- `}}catch(E){let j=E instanceof Error?E.message:String(E);throw Error(`Failed to render BunPress component ${U}: ${j}`,{cause:E})}W+=D,V=I,z.lastIndex=I}if(W+=q.slice(V),W=W.replace(/\u0000BPCODE(\d+)\u0000/g,(_,U)=>X[Number(U)]??""),K)return HJ(W,Z,Q,$,Y+1);return W}import{join as jQ}from"path";var wZ=jQ(import.meta.dir,"templates"),VJ=new Map;async function LZ(J){if(VJ.has(J))return VJ.get(J);let Z=jQ(wZ,`${J}.stx`),Q=Bun.file(Z);if(!await Q.exists())throw Error(`Template not found: ${J}`);let $=await Q.text();return VJ.set(J,$),$}async function H(J,Z){let Q=await LZ(J);return AZ(Q,Z)}function UQ(){VJ.clear()}function AZ(J,Z){return J.replace(/\{!!\s*([\w.]+)\s*!!\}|\{\{\s*([\w.]+)\s*\}\}/g,(Q,$,Y)=>{if($!==void 0)return GQ(_Q(Z,$));return HZ(GQ(_Q(Z,Y)))})}function _Q(J,Z){return Z.split(".").reduce((Q,$)=>{if(Q==null||typeof Q!=="object")return;return Q[$]},J)}function GQ(J){if(J==null)return"";return String(J)}function HZ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var OQ=`/**
254
+ `}}catch(R){let U=R instanceof Error?R.message:String(R);throw Error(`Failed to render BunPress component ${O}: ${U}`,{cause:R})}q+=T,V=D,W.lastIndex=D}if(q+=z.slice(V),q=q.replace(/\u0000BPCODE(\d+)\u0000/g,(G,O)=>X[Number(O)]??""),K)return PJ(q,Z,Q,$,Y+1);return q}import{join as RQ}from"path";var xZ=RQ(import.meta.dir,"templates"),GJ=new Map;async function vZ(J){if(GJ.has(J))return GJ.get(J);let Z=RQ(xZ,`${J}.stx`),Q=Bun.file(Z);if(!await Q.exists())throw Error(`Template not found: ${J}`);let $=await Q.text();return GJ.set(J,$),$}async function H(J,Z){let Q=await vZ(J);return CZ(Q,Z)}function BQ(){GJ.clear()}function CZ(J,Z){return J.replace(/\{!!\s*([\w.]+)\s*!!\}|\{\{\s*([\w.]+)\s*\}\}/g,(Q,$,Y)=>{if($!==void 0)return EQ(NQ(Z,$));return bZ(EQ(NQ(Z,Y)))})}function NQ(J,Z){return Z.split(".").reduce((Q,$)=>{if(Q==null||typeof Q!=="object")return;return Q[$]},J)}function EQ(J){if(J==null)return"";return String(J)}function bZ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var FQ=`/**
205
255
  * VitePress Theme for BunPress - Layout & Chrome
206
256
  * -------------------------------------------------------------------------- */
207
257
 
@@ -712,7 +762,9 @@ ${O}
712
762
  text-align: left;
713
763
  color: var(--bp-c-text-3);
714
764
  background-color: var(--bp-c-bg-alt);
715
- border: 1px solid var(--bp-c-divider);
765
+ /* The control edge, not the content hairline: this is the only thing on the
766
+ * bar that says search is a field you can type into. */
767
+ border: 1px solid var(--bp-c-border);
716
768
  border-radius: 6px;
717
769
  cursor: pointer;
718
770
  transition: border-color 0.25s, background-color 0.25s, color 0.25s;
@@ -743,6 +795,10 @@ ${O}
743
795
  white-space: nowrap;
744
796
  }
745
797
 
798
+ .BPNavBarSearch-kbd::before {
799
+ content: attr(data-hint);
800
+ }
801
+
746
802
  .BPNavBarSearch-kbd {
747
803
  flex-shrink: 0;
748
804
  padding: 1px 5px;
@@ -752,7 +808,7 @@ ${O}
752
808
  line-height: 1.5;
753
809
  color: var(--bp-c-text-3);
754
810
  background-color: var(--bp-c-bg);
755
- border: 1px solid var(--bp-c-divider);
811
+ border: 1px solid var(--bp-c-border);
756
812
  border-radius: 4px;
757
813
  }
758
814
 
@@ -1011,13 +1067,21 @@ ${O}
1011
1067
  font-size: inherit;
1012
1068
  }
1013
1069
 
1070
+ /* Gradient-filled, which means no contrast checker will ever look at it: the
1071
+ * computed colour is transparent and the text is a clipped background. Both
1072
+ * stops still have to be read, and at the bottom of the clamp this is 18px -
1073
+ * under the 18.66px where bold counts as large text, so the floor is 4.5:1,
1074
+ * not 3:1. The light ramp passes end to end (7.08:1 and 5.86:1); the dark one
1075
+ * ran from #a8b1ff to #5c73e7, finishing at 4.14:1, so its far stop is a pale
1076
+ * tint instead - the same direction the dark filled button goes, and for the
1077
+ * same reason. */
1014
1078
  .BPHero-name {
1015
1079
  font-size: clamp(18px, 4vw, 24px);
1016
1080
  font-weight: 700;
1017
1081
  letter-spacing: -0.02em;
1018
1082
  line-height: 1.2;
1019
1083
  margin: 0 0 8px;
1020
- background: linear-gradient(135deg, var(--bp-c-brand-1, #5672cd) 0%, var(--bp-c-brand-2, #8b9cf7) 100%);
1084
+ background: linear-gradient(135deg, var(--bp-hero-name-from) 0%, var(--bp-hero-name-to) 100%);
1021
1085
  -webkit-background-clip: text;
1022
1086
  -webkit-text-fill-color: transparent;
1023
1087
  background-clip: text;
@@ -1069,21 +1133,25 @@ ${O}
1069
1133
  cursor: pointer;
1070
1134
  }
1071
1135
 
1136
+ /* The border defaults to the fill, so a theme whose fill is pale enough to
1137
+ * disappear against the page can give the button an edge without the rule
1138
+ * having to know about it. */
1072
1139
  .BPButton-brand {
1073
- color: var(--bp-button-brand-text, #03110b);
1074
- background-color: var(--bp-c-brand-1);
1075
- border-color: var(--bp-c-brand-1);
1140
+ color: var(--bp-button-brand-text);
1141
+ background-color: var(--bp-button-brand-bg);
1142
+ border-color: var(--bp-button-brand-border);
1076
1143
  }
1077
1144
 
1078
1145
  .BPButton-brand:hover {
1079
- background-color: var(--bp-c-brand-2);
1080
- border-color: var(--bp-c-brand-2);
1146
+ color: var(--bp-button-brand-hover-text);
1147
+ background-color: var(--bp-button-brand-hover-bg);
1148
+ border-color: var(--bp-button-brand-hover-border);
1081
1149
  }
1082
1150
 
1083
1151
  .BPButton-alt {
1084
1152
  color: var(--bp-c-text-1);
1085
1153
  background-color: transparent;
1086
- border-color: var(--bp-c-divider);
1154
+ border-color: var(--bp-c-border);
1087
1155
  }
1088
1156
 
1089
1157
  .BPButton-alt:hover {
@@ -1259,10 +1327,15 @@ ${O}
1259
1327
 
1260
1328
  /* The UA default is pure yellow with forced black text, which is jarring in
1261
1329
  * light mode and unreadable against a dark page. */
1330
+ /* <mark> keeps its inherited colour, so the wash has to work under whatever it
1331
+ * lands on - and the hardest case is a mark inside a code comment, where the
1332
+ * text is already the faintest thing in the block. Its own token rather than
1333
+ * --bp-c-warning-soft, because the dark wash needed thinning and the warning
1334
+ * blocks that share that token did not. */
1262
1335
  .bp-doc mark {
1263
1336
  padding: 1px 3px;
1264
1337
  border-radius: 3px;
1265
- background-color: var(--bp-c-warning-soft, rgba(234, 179, 8, 0.28));
1338
+ background-color: var(--bp-mark-bg);
1266
1339
  color: inherit;
1267
1340
  -webkit-box-decoration-break: clone;
1268
1341
  box-decoration-break: clone;
@@ -1335,7 +1408,7 @@ ${O}
1335
1408
  }
1336
1409
  .bp-doc [class*='language-'] pre::-webkit-scrollbar-thumb,
1337
1410
  .bp-doc pre[data-lang]::-webkit-scrollbar-thumb {
1338
- background-color: var(--bp-c-divider);
1411
+ background-color: var(--bp-c-border);
1339
1412
  border-radius: 3px;
1340
1413
  }
1341
1414
  .bp-doc [class*='language-'] pre::-webkit-scrollbar-thumb:hover,
@@ -1364,7 +1437,7 @@ ${O}
1364
1437
  .BPSidebar,
1365
1438
  .BPContent--doc {
1366
1439
  scrollbar-width: thin;
1367
- scrollbar-color: var(--bp-c-divider) transparent;
1440
+ scrollbar-color: var(--bp-c-border) transparent;
1368
1441
  }
1369
1442
 
1370
1443
  .BPSidebar::-webkit-scrollbar,
@@ -1380,7 +1453,7 @@ ${O}
1380
1453
 
1381
1454
  .BPSidebar::-webkit-scrollbar-thumb,
1382
1455
  .BPContent--doc::-webkit-scrollbar-thumb {
1383
- background-color: var(--bp-c-divider);
1456
+ background-color: var(--bp-c-border);
1384
1457
  border-radius: 4px;
1385
1458
  }
1386
1459
 
@@ -1497,7 +1570,7 @@ ${O}
1497
1570
  padding: 20px 16px 56px;
1498
1571
  }
1499
1572
  }
1500
- `;function yJ(){return`
1573
+ `;function SJ(){return`
1501
1574
  /* VitePress Theme for BunPress */
1502
1575
  ${`/**
1503
1576
  * VitePress Theme for BunPress
@@ -1589,6 +1662,10 @@ ${`/**
1589
1662
  --bp-c-red-2: #f14158;
1590
1663
  --bp-c-red-3: #b62a3c;
1591
1664
  --bp-c-red-soft: rgba(244, 63, 94, 0.16);
1665
+
1666
+ /* The sponsor pink had one value for both palettes, and it is drawn as the
1667
+ * sponsor button's label and border: 4.60:1 on white and 3.74:1 here. */
1668
+ --bp-c-sponsor: #f06ba7;
1592
1669
  }
1593
1670
 
1594
1671
  /**
@@ -1611,35 +1688,63 @@ ${`/**
1611
1688
 
1612
1689
  /**
1613
1690
  * Colors: Borders
1691
+ *
1692
+ * Two jobs, deliberately two tokens, and they are not interchangeable.
1693
+ *
1694
+ * --bp-c-divider is a hairline between pieces of content: a rule under a
1695
+ * heading, the line between table rows. Nothing depends on seeing it, so it
1696
+ * stays faint.
1697
+ *
1698
+ * --bp-c-border is the edge of a control - the search field, a secondary
1699
+ * button, an input. WCAG 1.4.11 asks 3:1 of anything that tells you where a
1700
+ * control is and what state it is in, so this one is measured against every
1701
+ * background a control sits on (--bp-c-bg, --bp-c-bg-alt, --bp-c-bg-elv) and
1702
+ * clears it on all of them. The old #c2c2c4 managed 1.78:1 and the old
1703
+ * #3c3f44 managed 1.62:1, which is a boundary you can only find with a
1704
+ * cursor - but neither value was ever the one at fault, because this token was
1705
+ * declared and then never used: every control in the theme borrowed the
1706
+ * hairline instead. The uses were moved; the values follow.
1614
1707
  * -------------------------------------------------------------------------- */
1615
1708
 
1616
1709
  :root {
1617
- --bp-c-border: #c2c2c4;
1710
+ --bp-c-border: #8e8e92;
1618
1711
  --bp-c-divider: #e2e2e3;
1619
1712
  --bp-c-gutter: #e2e2e3;
1620
1713
  }
1621
1714
 
1622
1715
  .dark {
1623
- --bp-c-border: #3c3f44;
1716
+ --bp-c-border: #696c76;
1624
1717
  --bp-c-divider: #2e2e32;
1625
1718
  --bp-c-gutter: #000000;
1626
1719
  }
1627
1720
 
1628
1721
  /**
1629
1722
  * Colors: Text
1630
- * Note: Using solid colors like VitePress for better consistency
1723
+ *
1724
+ * Three steps, and all three are text, so all three clear 4.5:1 against every
1725
+ * background they are drawn on. VitePress calls the third step a placeholder
1726
+ * colour and WCAG has no exemption for placeholders, so the ramp is sized from
1727
+ * the bottom up: text-3 first, at the floor, then text-2 and text-1 spaced far
1728
+ * enough above it to read as a hierarchy rather than as three greys.
1729
+ *
1730
+ * text-3 was #929295 (2.87:1 on --bp-c-bg-alt) and #6a6a71 (2.99:1 on
1731
+ * --bp-c-bg-elv), and it is the colour of the search trigger's own label, the
1732
+ * email preview's headers and the SMS character count - real text, not
1733
+ * decoration. text-2 moved with it: at 5.21:1 against text-3's new 4.70:1 the
1734
+ * two were a tenth of a step apart, and two tokens that look the same are
1735
+ * worse than one.
1631
1736
  * -------------------------------------------------------------------------- */
1632
1737
 
1633
1738
  :root {
1634
1739
  --bp-c-text-1: #3c3c43;
1635
- --bp-c-text-2: #67676c;
1636
- --bp-c-text-3: #929295;
1740
+ --bp-c-text-2: #5c5c62;
1741
+ --bp-c-text-3: #6e6e73;
1637
1742
  }
1638
1743
 
1639
1744
  .dark {
1640
1745
  --bp-c-text-1: #dfdfd6;
1641
- --bp-c-text-2: #98989f;
1642
- --bp-c-text-3: #6a6a71;
1746
+ --bp-c-text-2: #a3a3aa;
1747
+ --bp-c-text-3: #8a8a92;
1643
1748
  }
1644
1749
 
1645
1750
  /**
@@ -1755,6 +1860,24 @@ ${`/**
1755
1860
  --bp-header-anchor-symbol: '#';
1756
1861
  }
1757
1862
 
1863
+ :root {
1864
+ --bp-mark-bg: rgba(234, 179, 8, 0.14);
1865
+ }
1866
+
1867
+ .dark {
1868
+ --bp-mark-bg: rgba(234, 179, 8, 0.10);
1869
+ }
1870
+
1871
+ :root {
1872
+ --bp-hero-name-from: var(--bp-c-brand-1);
1873
+ --bp-hero-name-to: var(--bp-c-brand-2);
1874
+ }
1875
+
1876
+ .dark {
1877
+ --bp-hero-name-from: var(--bp-c-brand-1);
1878
+ --bp-hero-name-to: #8d97f0;
1879
+ }
1880
+
1758
1881
  /**
1759
1882
  * Component: Code
1760
1883
  * -------------------------------------------------------------------------- */
@@ -1785,9 +1908,9 @@ ${`/**
1785
1908
  --bp-code-line-warning-color: var(--bp-c-warning-soft);
1786
1909
  --bp-code-line-error-color: var(--bp-c-danger-soft);
1787
1910
 
1788
- --bp-code-copy-code-border-color: var(--bp-c-divider);
1911
+ --bp-code-copy-code-border-color: var(--bp-c-border);
1789
1912
  --bp-code-copy-code-bg: var(--bp-c-bg-soft);
1790
- --bp-code-copy-code-hover-border-color: var(--bp-c-divider);
1913
+ --bp-code-copy-code-hover-border-color: var(--bp-c-border);
1791
1914
  --bp-code-copy-code-hover-bg: var(--bp-c-bg);
1792
1915
  --bp-code-copy-code-active-text: var(--bp-c-text-2);
1793
1916
  --bp-code-copy-copied-text-content: 'Copied';
@@ -1805,15 +1928,24 @@ ${`/**
1805
1928
  * -------------------------------------------------------------------------- */
1806
1929
 
1807
1930
  :root {
1808
- --bp-button-brand-border: transparent;
1931
+ /* The filled button. These tokens are what a site overrides, so the rule
1932
+ * below reads them rather than reaching past them for --bp-c-brand-1 - which
1933
+ * is what it used to do, leaving --bp-button-brand-bg declared and dead and
1934
+ * anyone who set it wondering why nothing moved.
1935
+ *
1936
+ * The ramp reverses between the two palettes: in the light one brand-1 is
1937
+ * the deep end and carries white text, in the dark one it is the pale end
1938
+ * and carries none. Which is why the dark half overrides the text colour -
1939
+ * white on #a8b1ff is 2.02:1, a button you can see and cannot read. */
1940
+ --bp-button-brand-border: var(--bp-button-brand-bg);
1809
1941
  --bp-button-brand-text: var(--bp-c-white);
1810
- --bp-button-brand-bg: var(--bp-c-brand-3);
1811
- --bp-button-brand-hover-border: transparent;
1812
- --bp-button-brand-hover-text: var(--bp-c-white);
1942
+ --bp-button-brand-bg: var(--bp-c-brand-1);
1943
+ --bp-button-brand-hover-border: var(--bp-button-brand-hover-bg);
1944
+ --bp-button-brand-hover-text: var(--bp-button-brand-text);
1813
1945
  --bp-button-brand-hover-bg: var(--bp-c-brand-2);
1814
- --bp-button-brand-active-border: transparent;
1815
- --bp-button-brand-active-text: var(--bp-c-white);
1816
- --bp-button-brand-active-bg: var(--bp-c-brand-1);
1946
+ --bp-button-brand-active-border: var(--bp-button-brand-active-bg);
1947
+ --bp-button-brand-active-text: var(--bp-button-brand-text);
1948
+ --bp-button-brand-active-bg: var(--bp-c-brand-2);
1817
1949
 
1818
1950
  --bp-button-alt-border: transparent;
1819
1951
  --bp-button-alt-text: var(--bp-c-text-1);
@@ -1836,6 +1968,23 @@ ${`/**
1836
1968
  --bp-button-sponsor-active-bg: transparent;
1837
1969
  }
1838
1970
 
1971
+ .dark {
1972
+ /* Dark text on the pale fill, because the ramp reverses between the two
1973
+ * palettes: in the light one brand-1 is the deep end and carries white, in
1974
+ * the dark one it is the pale end and carries none.
1975
+ *
1976
+ * brand-2 reverses with it, and that is the subtler half. It is the hover
1977
+ * state - of a link, of inline code, of the filled button - and in the dark
1978
+ * indigo ramp every step below brand-1 is darker, so hovering a link took it
1979
+ * from #a8b1ff to #5c73e7 at 4.14:1, and hovering the button took the fill
1980
+ * and its text down together. A dark-mode accent brightens on hover. The
1981
+ * two tints are written out because the ramp has no step above its first;
1982
+ * everything that hovers reads them from here. */
1983
+ --bp-button-brand-text: var(--bp-c-bg);
1984
+ --bp-c-brand-2: #c0c6ff;
1985
+ --bp-button-brand-active-bg: #c8cdff;
1986
+ }
1987
+
1839
1988
  /**
1840
1989
  * Component: Custom Block
1841
1990
  * -------------------------------------------------------------------------- */
@@ -2850,18 +2999,38 @@ mjx-container > svg {
2850
2999
 
2851
3000
  /* Focus lines: unfocused rows blur back until the block is hovered.
2852
3001
  * The renderer marks them \`.dimmed\` (see processCodeBlock) \u2014 the upstream
2853
- * \`:not(.has-focus)\` form never matched this markup. */
3002
+ * \`:not(.has-focus)\` form never matched this markup.
3003
+ *
3004
+ * The blur alone, with no opacity under it. The pair used to be
3005
+ * blur + opacity: 0.7, and opacity on text composites it toward whatever is
3006
+ * behind - which took the comment token to 3.52:1 in the dark palette and
3007
+ * 3.01:1 in the light one. Opacity high enough to clear 4.5:1 is 0.9, which
3008
+ * is not a dim anybody would notice, so it was never the thing doing the
3009
+ * work: the blur is. Dimmed code is still code, and the reader is meant to be
3010
+ * able to see what the focused lines were lifted out of. */
2854
3011
  .bp-doc [class*='language-'] .line.dimmed,
2855
3012
  .bp-doc pre[data-lang] .line.dimmed {
2856
3013
  filter: blur(0.095rem);
2857
- opacity: 0.7;
2858
- transition: filter 0.35s, opacity 0.35s;
3014
+ transition: filter 0.35s;
2859
3015
  }
2860
3016
 
3017
+ /* :focus-within as well as :hover. Tabbing into a code block - to its copy
3018
+ * control, or to a link inside it - is how a keyboard reader gets here, and
3019
+ * "hover to read the rest" is not an answer for them. */
2861
3020
  .bp-doc [class*='language-']:hover .line.dimmed,
2862
- .bp-doc pre[data-lang]:hover .line.dimmed {
3021
+ .bp-doc [class*='language-']:focus-within .line.dimmed,
3022
+ .bp-doc pre[data-lang]:hover .line.dimmed,
3023
+ .bp-doc pre[data-lang]:focus-within .line.dimmed {
2863
3024
  filter: blur(0);
2864
- opacity: 1;
3025
+ }
3026
+
3027
+ /* A reader who has asked their system for more contrast, or for less in the
3028
+ * way of visual effects, has asked for this one to stop. */
3029
+ @media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
3030
+ .bp-doc [class*='language-'] .line.dimmed,
3031
+ .bp-doc pre[data-lang] .line.dimmed {
3032
+ filter: none;
3033
+ }
2865
3034
  }
2866
3035
 
2867
3036
  /* Both class spellings: \`.diff.remove\` is the upstream form, \`.diff-remove\`
@@ -3586,7 +3755,9 @@ ${`/**
3586
3755
  text-align: left;
3587
3756
  color: var(--bp-c-text-3);
3588
3757
  background-color: var(--bp-c-bg-alt);
3589
- border: 1px solid var(--bp-c-divider);
3758
+ /* The control edge, not the content hairline: this is the only thing on the
3759
+ * bar that says search is a field you can type into. */
3760
+ border: 1px solid var(--bp-c-border);
3590
3761
  border-radius: 6px;
3591
3762
  cursor: pointer;
3592
3763
  transition: border-color 0.25s, background-color 0.25s, color 0.25s;
@@ -3617,6 +3788,10 @@ ${`/**
3617
3788
  white-space: nowrap;
3618
3789
  }
3619
3790
 
3791
+ .BPNavBarSearch-kbd::before {
3792
+ content: attr(data-hint);
3793
+ }
3794
+
3620
3795
  .BPNavBarSearch-kbd {
3621
3796
  flex-shrink: 0;
3622
3797
  padding: 1px 5px;
@@ -3626,7 +3801,7 @@ ${`/**
3626
3801
  line-height: 1.5;
3627
3802
  color: var(--bp-c-text-3);
3628
3803
  background-color: var(--bp-c-bg);
3629
- border: 1px solid var(--bp-c-divider);
3804
+ border: 1px solid var(--bp-c-border);
3630
3805
  border-radius: 4px;
3631
3806
  }
3632
3807
 
@@ -3885,13 +4060,21 @@ ${`/**
3885
4060
  font-size: inherit;
3886
4061
  }
3887
4062
 
4063
+ /* Gradient-filled, which means no contrast checker will ever look at it: the
4064
+ * computed colour is transparent and the text is a clipped background. Both
4065
+ * stops still have to be read, and at the bottom of the clamp this is 18px -
4066
+ * under the 18.66px where bold counts as large text, so the floor is 4.5:1,
4067
+ * not 3:1. The light ramp passes end to end (7.08:1 and 5.86:1); the dark one
4068
+ * ran from #a8b1ff to #5c73e7, finishing at 4.14:1, so its far stop is a pale
4069
+ * tint instead - the same direction the dark filled button goes, and for the
4070
+ * same reason. */
3888
4071
  .BPHero-name {
3889
4072
  font-size: clamp(18px, 4vw, 24px);
3890
4073
  font-weight: 700;
3891
4074
  letter-spacing: -0.02em;
3892
4075
  line-height: 1.2;
3893
4076
  margin: 0 0 8px;
3894
- background: linear-gradient(135deg, var(--bp-c-brand-1, #5672cd) 0%, var(--bp-c-brand-2, #8b9cf7) 100%);
4077
+ background: linear-gradient(135deg, var(--bp-hero-name-from) 0%, var(--bp-hero-name-to) 100%);
3895
4078
  -webkit-background-clip: text;
3896
4079
  -webkit-text-fill-color: transparent;
3897
4080
  background-clip: text;
@@ -3943,21 +4126,25 @@ ${`/**
3943
4126
  cursor: pointer;
3944
4127
  }
3945
4128
 
4129
+ /* The border defaults to the fill, so a theme whose fill is pale enough to
4130
+ * disappear against the page can give the button an edge without the rule
4131
+ * having to know about it. */
3946
4132
  .BPButton-brand {
3947
- color: var(--bp-button-brand-text, #03110b);
3948
- background-color: var(--bp-c-brand-1);
3949
- border-color: var(--bp-c-brand-1);
4133
+ color: var(--bp-button-brand-text);
4134
+ background-color: var(--bp-button-brand-bg);
4135
+ border-color: var(--bp-button-brand-border);
3950
4136
  }
3951
4137
 
3952
4138
  .BPButton-brand:hover {
3953
- background-color: var(--bp-c-brand-2);
3954
- border-color: var(--bp-c-brand-2);
4139
+ color: var(--bp-button-brand-hover-text);
4140
+ background-color: var(--bp-button-brand-hover-bg);
4141
+ border-color: var(--bp-button-brand-hover-border);
3955
4142
  }
3956
4143
 
3957
4144
  .BPButton-alt {
3958
4145
  color: var(--bp-c-text-1);
3959
4146
  background-color: transparent;
3960
- border-color: var(--bp-c-divider);
4147
+ border-color: var(--bp-c-border);
3961
4148
  }
3962
4149
 
3963
4150
  .BPButton-alt:hover {
@@ -4133,10 +4320,15 @@ ${`/**
4133
4320
 
4134
4321
  /* The UA default is pure yellow with forced black text, which is jarring in
4135
4322
  * light mode and unreadable against a dark page. */
4323
+ /* <mark> keeps its inherited colour, so the wash has to work under whatever it
4324
+ * lands on - and the hardest case is a mark inside a code comment, where the
4325
+ * text is already the faintest thing in the block. Its own token rather than
4326
+ * --bp-c-warning-soft, because the dark wash needed thinning and the warning
4327
+ * blocks that share that token did not. */
4136
4328
  .bp-doc mark {
4137
4329
  padding: 1px 3px;
4138
4330
  border-radius: 3px;
4139
- background-color: var(--bp-c-warning-soft, rgba(234, 179, 8, 0.28));
4331
+ background-color: var(--bp-mark-bg);
4140
4332
  color: inherit;
4141
4333
  -webkit-box-decoration-break: clone;
4142
4334
  box-decoration-break: clone;
@@ -4209,7 +4401,7 @@ ${`/**
4209
4401
  }
4210
4402
  .bp-doc [class*='language-'] pre::-webkit-scrollbar-thumb,
4211
4403
  .bp-doc pre[data-lang]::-webkit-scrollbar-thumb {
4212
- background-color: var(--bp-c-divider);
4404
+ background-color: var(--bp-c-border);
4213
4405
  border-radius: 3px;
4214
4406
  }
4215
4407
  .bp-doc [class*='language-'] pre::-webkit-scrollbar-thumb:hover,
@@ -4238,7 +4430,7 @@ ${`/**
4238
4430
  .BPSidebar,
4239
4431
  .BPContent--doc {
4240
4432
  scrollbar-width: thin;
4241
- scrollbar-color: var(--bp-c-divider) transparent;
4433
+ scrollbar-color: var(--bp-c-border) transparent;
4242
4434
  }
4243
4435
 
4244
4436
  .BPSidebar::-webkit-scrollbar,
@@ -4254,7 +4446,7 @@ ${`/**
4254
4446
 
4255
4447
  .BPSidebar::-webkit-scrollbar-thumb,
4256
4448
  .BPContent--doc::-webkit-scrollbar-thumb {
4257
- background-color: var(--bp-c-divider);
4449
+ background-color: var(--bp-c-border);
4258
4450
  border-radius: 4px;
4259
4451
  }
4260
4452
 
@@ -4943,7 +5135,7 @@ ${`/**
4943
5135
  border-radius: 0;
4944
5136
  border: none;
4945
5137
  }`}
4946
- `}function yZ(){return`/**
5138
+ `}function fZ(){return`/**
4947
5139
  * VitePress Theme for BunPress
4948
5140
  * Colors: Solid
4949
5141
  * -------------------------------------------------------------------------- */
@@ -5033,6 +5225,10 @@ ${`/**
5033
5225
  --bp-c-red-2: #f14158;
5034
5226
  --bp-c-red-3: #b62a3c;
5035
5227
  --bp-c-red-soft: rgba(244, 63, 94, 0.16);
5228
+
5229
+ /* The sponsor pink had one value for both palettes, and it is drawn as the
5230
+ * sponsor button's label and border: 4.60:1 on white and 3.74:1 here. */
5231
+ --bp-c-sponsor: #f06ba7;
5036
5232
  }
5037
5233
 
5038
5234
  /**
@@ -5055,35 +5251,63 @@ ${`/**
5055
5251
 
5056
5252
  /**
5057
5253
  * Colors: Borders
5254
+ *
5255
+ * Two jobs, deliberately two tokens, and they are not interchangeable.
5256
+ *
5257
+ * --bp-c-divider is a hairline between pieces of content: a rule under a
5258
+ * heading, the line between table rows. Nothing depends on seeing it, so it
5259
+ * stays faint.
5260
+ *
5261
+ * --bp-c-border is the edge of a control - the search field, a secondary
5262
+ * button, an input. WCAG 1.4.11 asks 3:1 of anything that tells you where a
5263
+ * control is and what state it is in, so this one is measured against every
5264
+ * background a control sits on (--bp-c-bg, --bp-c-bg-alt, --bp-c-bg-elv) and
5265
+ * clears it on all of them. The old #c2c2c4 managed 1.78:1 and the old
5266
+ * #3c3f44 managed 1.62:1, which is a boundary you can only find with a
5267
+ * cursor - but neither value was ever the one at fault, because this token was
5268
+ * declared and then never used: every control in the theme borrowed the
5269
+ * hairline instead. The uses were moved; the values follow.
5058
5270
  * -------------------------------------------------------------------------- */
5059
5271
 
5060
5272
  :root {
5061
- --bp-c-border: #c2c2c4;
5273
+ --bp-c-border: #8e8e92;
5062
5274
  --bp-c-divider: #e2e2e3;
5063
5275
  --bp-c-gutter: #e2e2e3;
5064
5276
  }
5065
5277
 
5066
5278
  .dark {
5067
- --bp-c-border: #3c3f44;
5279
+ --bp-c-border: #696c76;
5068
5280
  --bp-c-divider: #2e2e32;
5069
5281
  --bp-c-gutter: #000000;
5070
5282
  }
5071
5283
 
5072
5284
  /**
5073
5285
  * Colors: Text
5074
- * Note: Using solid colors like VitePress for better consistency
5286
+ *
5287
+ * Three steps, and all three are text, so all three clear 4.5:1 against every
5288
+ * background they are drawn on. VitePress calls the third step a placeholder
5289
+ * colour and WCAG has no exemption for placeholders, so the ramp is sized from
5290
+ * the bottom up: text-3 first, at the floor, then text-2 and text-1 spaced far
5291
+ * enough above it to read as a hierarchy rather than as three greys.
5292
+ *
5293
+ * text-3 was #929295 (2.87:1 on --bp-c-bg-alt) and #6a6a71 (2.99:1 on
5294
+ * --bp-c-bg-elv), and it is the colour of the search trigger's own label, the
5295
+ * email preview's headers and the SMS character count - real text, not
5296
+ * decoration. text-2 moved with it: at 5.21:1 against text-3's new 4.70:1 the
5297
+ * two were a tenth of a step apart, and two tokens that look the same are
5298
+ * worse than one.
5075
5299
  * -------------------------------------------------------------------------- */
5076
5300
 
5077
5301
  :root {
5078
5302
  --bp-c-text-1: #3c3c43;
5079
- --bp-c-text-2: #67676c;
5080
- --bp-c-text-3: #929295;
5303
+ --bp-c-text-2: #5c5c62;
5304
+ --bp-c-text-3: #6e6e73;
5081
5305
  }
5082
5306
 
5083
5307
  .dark {
5084
5308
  --bp-c-text-1: #dfdfd6;
5085
- --bp-c-text-2: #98989f;
5086
- --bp-c-text-3: #6a6a71;
5309
+ --bp-c-text-2: #a3a3aa;
5310
+ --bp-c-text-3: #8a8a92;
5087
5311
  }
5088
5312
 
5089
5313
  /**
@@ -5199,6 +5423,24 @@ ${`/**
5199
5423
  --bp-header-anchor-symbol: '#';
5200
5424
  }
5201
5425
 
5426
+ :root {
5427
+ --bp-mark-bg: rgba(234, 179, 8, 0.14);
5428
+ }
5429
+
5430
+ .dark {
5431
+ --bp-mark-bg: rgba(234, 179, 8, 0.10);
5432
+ }
5433
+
5434
+ :root {
5435
+ --bp-hero-name-from: var(--bp-c-brand-1);
5436
+ --bp-hero-name-to: var(--bp-c-brand-2);
5437
+ }
5438
+
5439
+ .dark {
5440
+ --bp-hero-name-from: var(--bp-c-brand-1);
5441
+ --bp-hero-name-to: #8d97f0;
5442
+ }
5443
+
5202
5444
  /**
5203
5445
  * Component: Code
5204
5446
  * -------------------------------------------------------------------------- */
@@ -5229,9 +5471,9 @@ ${`/**
5229
5471
  --bp-code-line-warning-color: var(--bp-c-warning-soft);
5230
5472
  --bp-code-line-error-color: var(--bp-c-danger-soft);
5231
5473
 
5232
- --bp-code-copy-code-border-color: var(--bp-c-divider);
5474
+ --bp-code-copy-code-border-color: var(--bp-c-border);
5233
5475
  --bp-code-copy-code-bg: var(--bp-c-bg-soft);
5234
- --bp-code-copy-code-hover-border-color: var(--bp-c-divider);
5476
+ --bp-code-copy-code-hover-border-color: var(--bp-c-border);
5235
5477
  --bp-code-copy-code-hover-bg: var(--bp-c-bg);
5236
5478
  --bp-code-copy-code-active-text: var(--bp-c-text-2);
5237
5479
  --bp-code-copy-copied-text-content: 'Copied';
@@ -5249,15 +5491,24 @@ ${`/**
5249
5491
  * -------------------------------------------------------------------------- */
5250
5492
 
5251
5493
  :root {
5252
- --bp-button-brand-border: transparent;
5494
+ /* The filled button. These tokens are what a site overrides, so the rule
5495
+ * below reads them rather than reaching past them for --bp-c-brand-1 - which
5496
+ * is what it used to do, leaving --bp-button-brand-bg declared and dead and
5497
+ * anyone who set it wondering why nothing moved.
5498
+ *
5499
+ * The ramp reverses between the two palettes: in the light one brand-1 is
5500
+ * the deep end and carries white text, in the dark one it is the pale end
5501
+ * and carries none. Which is why the dark half overrides the text colour -
5502
+ * white on #a8b1ff is 2.02:1, a button you can see and cannot read. */
5503
+ --bp-button-brand-border: var(--bp-button-brand-bg);
5253
5504
  --bp-button-brand-text: var(--bp-c-white);
5254
- --bp-button-brand-bg: var(--bp-c-brand-3);
5255
- --bp-button-brand-hover-border: transparent;
5256
- --bp-button-brand-hover-text: var(--bp-c-white);
5505
+ --bp-button-brand-bg: var(--bp-c-brand-1);
5506
+ --bp-button-brand-hover-border: var(--bp-button-brand-hover-bg);
5507
+ --bp-button-brand-hover-text: var(--bp-button-brand-text);
5257
5508
  --bp-button-brand-hover-bg: var(--bp-c-brand-2);
5258
- --bp-button-brand-active-border: transparent;
5259
- --bp-button-brand-active-text: var(--bp-c-white);
5260
- --bp-button-brand-active-bg: var(--bp-c-brand-1);
5509
+ --bp-button-brand-active-border: var(--bp-button-brand-active-bg);
5510
+ --bp-button-brand-active-text: var(--bp-button-brand-text);
5511
+ --bp-button-brand-active-bg: var(--bp-c-brand-2);
5261
5512
 
5262
5513
  --bp-button-alt-border: transparent;
5263
5514
  --bp-button-alt-text: var(--bp-c-text-1);
@@ -5280,6 +5531,23 @@ ${`/**
5280
5531
  --bp-button-sponsor-active-bg: transparent;
5281
5532
  }
5282
5533
 
5534
+ .dark {
5535
+ /* Dark text on the pale fill, because the ramp reverses between the two
5536
+ * palettes: in the light one brand-1 is the deep end and carries white, in
5537
+ * the dark one it is the pale end and carries none.
5538
+ *
5539
+ * brand-2 reverses with it, and that is the subtler half. It is the hover
5540
+ * state - of a link, of inline code, of the filled button - and in the dark
5541
+ * indigo ramp every step below brand-1 is darker, so hovering a link took it
5542
+ * from #a8b1ff to #5c73e7 at 4.14:1, and hovering the button took the fill
5543
+ * and its text down together. A dark-mode accent brightens on hover. The
5544
+ * two tints are written out because the ramp has no step above its first;
5545
+ * everything that hovers reads them from here. */
5546
+ --bp-button-brand-text: var(--bp-c-bg);
5547
+ --bp-c-brand-2: #c0c6ff;
5548
+ --bp-button-brand-active-bg: #c8cdff;
5549
+ }
5550
+
5283
5551
  /**
5284
5552
  * Component: Custom Block
5285
5553
  * -------------------------------------------------------------------------- */
@@ -5512,7 +5780,7 @@ ${`/**
5512
5780
 
5513
5781
  .bpi-corner-down-left {
5514
5782
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3Cpath d='m9 10l-5 5l5 5'/%3E%3C/g%3E%3C/svg%3E");
5515
- }`}function SZ(){return`/**
5783
+ }`}function pZ(){return`/**
5516
5784
  * VitePress Theme for BunPress - Base Styles
5517
5785
  * -------------------------------------------------------------------------- */
5518
5786
 
@@ -6293,18 +6561,38 @@ mjx-container > svg {
6293
6561
 
6294
6562
  /* Focus lines: unfocused rows blur back until the block is hovered.
6295
6563
  * The renderer marks them \`.dimmed\` (see processCodeBlock) \u2014 the upstream
6296
- * \`:not(.has-focus)\` form never matched this markup. */
6564
+ * \`:not(.has-focus)\` form never matched this markup.
6565
+ *
6566
+ * The blur alone, with no opacity under it. The pair used to be
6567
+ * blur + opacity: 0.7, and opacity on text composites it toward whatever is
6568
+ * behind - which took the comment token to 3.52:1 in the dark palette and
6569
+ * 3.01:1 in the light one. Opacity high enough to clear 4.5:1 is 0.9, which
6570
+ * is not a dim anybody would notice, so it was never the thing doing the
6571
+ * work: the blur is. Dimmed code is still code, and the reader is meant to be
6572
+ * able to see what the focused lines were lifted out of. */
6297
6573
  .bp-doc [class*='language-'] .line.dimmed,
6298
6574
  .bp-doc pre[data-lang] .line.dimmed {
6299
6575
  filter: blur(0.095rem);
6300
- opacity: 0.7;
6301
- transition: filter 0.35s, opacity 0.35s;
6576
+ transition: filter 0.35s;
6302
6577
  }
6303
6578
 
6579
+ /* :focus-within as well as :hover. Tabbing into a code block - to its copy
6580
+ * control, or to a link inside it - is how a keyboard reader gets here, and
6581
+ * "hover to read the rest" is not an answer for them. */
6304
6582
  .bp-doc [class*='language-']:hover .line.dimmed,
6305
- .bp-doc pre[data-lang]:hover .line.dimmed {
6583
+ .bp-doc [class*='language-']:focus-within .line.dimmed,
6584
+ .bp-doc pre[data-lang]:hover .line.dimmed,
6585
+ .bp-doc pre[data-lang]:focus-within .line.dimmed {
6306
6586
  filter: blur(0);
6307
- opacity: 1;
6587
+ }
6588
+
6589
+ /* A reader who has asked their system for more contrast, or for less in the
6590
+ * way of visual effects, has asked for this one to stop. */
6591
+ @media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
6592
+ .bp-doc [class*='language-'] .line.dimmed,
6593
+ .bp-doc pre[data-lang] .line.dimmed {
6594
+ filter: none;
6595
+ }
6308
6596
  }
6309
6597
 
6310
6598
  /* Both class spellings: \`.diff.remove\` is the upstream form, \`.diff-remove\`
@@ -6517,7 +6805,7 @@ mjx-container > svg {
6517
6805
  .bp-doc .custom-block .bp-code-group .tabs {
6518
6806
  margin: 0;
6519
6807
  border-radius: 8px 8px 0 0;
6520
- }`}function PZ(){return`/**
6808
+ }`}function uZ(){return`/**
6521
6809
  * VitePress Theme for BunPress - Custom Blocks
6522
6810
  * -------------------------------------------------------------------------- */
6523
6811
 
@@ -6945,7 +7233,7 @@ mjx-container > svg {
6945
7233
 
6946
7234
  .github-alert-caution .github-alert-icon {
6947
7235
  fill: var(--bp-c-caution-1);
6948
- }`}function kZ(){return`/**
7236
+ }`}function gZ(){return`/**
6949
7237
  * VitePress Theme for BunPress - Code Groups
6950
7238
  * -------------------------------------------------------------------------- */
6951
7239
 
@@ -7086,7 +7374,7 @@ mjx-container > svg {
7086
7374
  margin: 0;
7087
7375
  border-radius: 0;
7088
7376
  border: none;
7089
- }`}var xZ={name:"vitepress",getCSS:yJ,getVars:yZ,getBase:SZ,getCustomBlocks:PZ,getCodeGroups:kZ},NQ=xZ;var BQ=`/**
7377
+ }`}var hZ={name:"vitepress",getCSS:SJ,getVars:fZ,getBase:pZ,getCustomBlocks:uZ,getCodeGroups:gZ},MQ=hZ;var IQ=`/**
7090
7378
  * Bun Theme for BunPress
7091
7379
  * Colors extracted from bun.sh
7092
7380
  * -------------------------------------------------------------------------- */
@@ -7134,12 +7422,15 @@ mjx-container > svg {
7134
7422
  --bp-c-gray-soft: rgba(156, 163, 175, 0.14);
7135
7423
 
7136
7424
  /* Semantic colors */
7137
- --bp-c-green-1: #16a34a;
7425
+ /* The -1 step is a title drawn on the page, so it is the 700 weight of the
7426
+ * ramp rather than the 600: #16a34a is 3.15:1 here and #ca8a04 is 2.81:1,
7427
+ * which are fill colours being asked to be text. */
7428
+ --bp-c-green-1: #15803d;
7138
7429
  --bp-c-green-2: #22c55e;
7139
7430
  --bp-c-green-3: #4ade80;
7140
7431
  --bp-c-green-soft: rgba(22, 163, 74, 0.08);
7141
7432
 
7142
- --bp-c-yellow-1: #ca8a04;
7433
+ --bp-c-yellow-1: #92400e;
7143
7434
  --bp-c-yellow-2: #eab308;
7144
7435
  --bp-c-yellow-3: #facc15;
7145
7436
  --bp-c-yellow-soft: rgba(234, 179, 8, 0.08);
@@ -7207,34 +7498,49 @@ mjx-container > svg {
7207
7498
 
7208
7499
  /**
7209
7500
  * Colors: Borders
7501
+ *
7502
+ * --bp-c-divider is the hairline between pieces of content and --bp-c-border
7503
+ * is the edge of a control, which WCAG 1.4.11 asks 3:1 of. The old pair came
7504
+ * from a Tailwind grey ramp read as two neighbouring steps rather than as two
7505
+ * jobs: #d1d5db managed 1.41:1 against the page and #3b3f4b managed 1.73:1,
7506
+ * so the search field, the copy control and the outlined buttons all had an
7507
+ * edge that was there in the stylesheet and not on the screen. See the same
7508
+ * note in the vitepress theme.
7210
7509
  * -------------------------------------------------------------------------- */
7211
7510
 
7212
7511
  :root {
7213
- --bp-c-border: #d1d5db;
7512
+ --bp-c-border: #858c99;
7214
7513
  --bp-c-divider: #e5e7eb;
7215
7514
  --bp-c-gutter: #e5e7eb;
7216
7515
  }
7217
7516
 
7218
7517
  .dark {
7219
- --bp-c-border: #3b3f4b;
7518
+ --bp-c-border: #696f80;
7220
7519
  --bp-c-divider: #282a36;
7221
7520
  --bp-c-gutter: #14151a;
7222
7521
  }
7223
7522
 
7224
7523
  /**
7225
7524
  * Colors: Text (from bun.sh gray scale)
7525
+ *
7526
+ * All three steps are text, so all three clear 4.5:1 on every background the
7527
+ * theme draws them on. text-3 was the bottom two steps of the bun.sh grey
7528
+ * ramp, #9ca3af and #6b7280, which are 2.43:1 and 3.35:1 here - and it is the
7529
+ * colour of the search trigger's label, the code block's language tag and the
7530
+ * line numbers. Dark text-2 moved up with text-3 to keep the three steps
7531
+ * distinguishable from one another.
7226
7532
  * -------------------------------------------------------------------------- */
7227
7533
 
7228
7534
  :root {
7229
7535
  --bp-c-text-1: #111827;
7230
7536
  --bp-c-text-2: #4b5563;
7231
- --bp-c-text-3: #9ca3af;
7537
+ --bp-c-text-3: #676f7d;
7232
7538
  }
7233
7539
 
7234
7540
  .dark {
7235
7541
  --bp-c-text-1: #e5e7eb;
7236
- --bp-c-text-2: #9ca3af;
7237
- --bp-c-text-3: #6b7280;
7542
+ --bp-c-text-2: #aeb4c0;
7543
+ --bp-c-text-3: #8c93a1;
7238
7544
  }
7239
7545
 
7240
7546
  /**
@@ -7247,23 +7553,38 @@ mjx-container > svg {
7247
7553
  --bp-c-default-3: var(--bp-c-gray-3);
7248
7554
  --bp-c-default-soft: var(--bp-c-gray-soft);
7249
7555
 
7250
- /* Brand = Bun Orange */
7251
- --bp-c-brand-1: var(--bp-c-bun-orange);
7252
- --bp-c-brand-2: var(--bp-c-bun-orange-light);
7253
- --bp-c-brand-3: var(--bp-c-bun-orange-dark);
7556
+ /* Brand = Bun Orange, which is a fill colour, not a text colour.
7557
+ *
7558
+ * The ramp was the identity orange in both palettes, and brand-1 is what
7559
+ * every link, every piece of inline code, the active code tab and the hero
7560
+ * name are drawn in. On the light ground that is #f89b4b on #f9fafb:
7561
+ * 2.05:1, the worst number anywhere in either theme, and it was every link
7562
+ * on the page. In the dark palette the same orange is 8.49:1, which is why
7563
+ * it was only ever half wrong and so stayed.
7564
+ *
7565
+ * So the ramp splits the way the vitepress one does: brand-1/2 are the text
7566
+ * end and invert with the palette, brand-3 and --bp-c-brand-soft keep the
7567
+ * identity orange for bars, washes and fills, and the filled button below
7568
+ * names the orange directly so the Bun button is still the Bun button. */
7569
+ --bp-c-brand-1: #9a4a07;
7570
+ --bp-c-brand-2: #b45309;
7571
+ --bp-c-brand-3: var(--bp-c-bun-orange);
7254
7572
  --bp-c-brand-soft: var(--bp-c-bun-orange-soft);
7255
7573
  --bp-c-brand: var(--bp-c-brand-1);
7256
7574
 
7257
- /* Tip = Bun Blue */
7258
- --bp-c-tip-1: var(--bp-c-bun-blue);
7259
- --bp-c-tip-2: var(--bp-c-bun-blue-light);
7260
- --bp-c-tip-3: var(--bp-c-bun-blue-dark);
7575
+ /* Tip and Note = Bun Blue, split the same way as the brand above: the -1
7576
+ * step is the alert's title and its icon, so on the light ground it is a
7577
+ * blue dark enough to read on the alert's own wash. #00a6e1 there is 2.31:1,
7578
+ * which made "Note" the least legible word in the block it titles. The
7579
+ * identity blue keeps -3, the washes and the filled alt button. */
7580
+ --bp-c-tip-1: #026b96;
7581
+ --bp-c-tip-2: #0077a8;
7582
+ --bp-c-tip-3: var(--bp-c-bun-blue);
7261
7583
  --bp-c-tip-soft: var(--bp-c-bun-blue-soft);
7262
7584
 
7263
- /* Note = Bun Blue */
7264
- --bp-c-note-1: var(--bp-c-bun-blue);
7265
- --bp-c-note-2: var(--bp-c-bun-blue-light);
7266
- --bp-c-note-3: var(--bp-c-bun-blue-dark);
7585
+ --bp-c-note-1: #026b96;
7586
+ --bp-c-note-2: #0077a8;
7587
+ --bp-c-note-3: var(--bp-c-bun-blue);
7267
7588
  --bp-c-note-soft: var(--bp-c-bun-blue-soft);
7268
7589
 
7269
7590
  --bp-c-success-1: var(--bp-c-green-1);
@@ -7291,6 +7612,28 @@ mjx-container > svg {
7291
7612
  --bp-c-caution-3: var(--bp-c-red-3);
7292
7613
  --bp-c-caution-soft: var(--bp-c-red-soft);
7293
7614
 
7615
+ /* Drawn as text on the page (the sponsor button's label and border), where
7616
+ * the identity pink is 3.66:1. */
7617
+ --bp-c-sponsor: #b100b0;
7618
+ }
7619
+
7620
+ .dark {
7621
+ /* On the dark ground the identity colours are the readable ones - orange at
7622
+ * 8.49:1, blue at 5.41:1 on its own wash, pink at 4.77:1 - so the text end
7623
+ * of each ramp goes back to them and the -3 steps take the darker shades for
7624
+ * bars and fills. */
7625
+ --bp-c-brand-1: var(--bp-c-bun-orange);
7626
+ --bp-c-brand-2: var(--bp-c-bun-orange-light);
7627
+ --bp-c-brand-3: var(--bp-c-bun-orange-dark);
7628
+
7629
+ --bp-c-tip-1: var(--bp-c-bun-blue);
7630
+ --bp-c-tip-2: var(--bp-c-bun-blue-light);
7631
+ --bp-c-tip-3: var(--bp-c-bun-blue-dark);
7632
+
7633
+ --bp-c-note-1: var(--bp-c-bun-blue);
7634
+ --bp-c-note-2: var(--bp-c-bun-blue-light);
7635
+ --bp-c-note-3: var(--bp-c-bun-blue-dark);
7636
+
7294
7637
  --bp-c-sponsor: var(--bp-c-bun-pink);
7295
7638
  }
7296
7639
 
@@ -7394,7 +7737,7 @@ mjx-container > svg {
7394
7737
  --bp-code-line-warning-color: var(--bp-c-warning-soft);
7395
7738
  --bp-code-line-error-color: var(--bp-c-danger-soft);
7396
7739
 
7397
- --bp-code-copy-code-border-color: var(--bp-c-divider);
7740
+ --bp-code-copy-code-border-color: var(--bp-c-border);
7398
7741
  --bp-code-copy-code-bg: var(--bp-c-bg-soft);
7399
7742
  --bp-code-copy-code-hover-border-color: var(--bp-c-brand-1);
7400
7743
  --bp-code-copy-code-hover-bg: var(--bp-c-bg);
@@ -7425,15 +7768,24 @@ mjx-container > svg {
7425
7768
  * -------------------------------------------------------------------------- */
7426
7769
 
7427
7770
  :root {
7428
- --bp-button-brand-border: transparent;
7771
+ /* The orange by name, not by ramp position: black on #f89b4b is 9.78:1 and
7772
+ * it is what a Bun button looks like, whereas brand-1 is now the dark orange
7773
+ * that links need.
7774
+ *
7775
+ * The edge is that dark orange, because the fill alone is 2.05:1 against
7776
+ * this theme's near-white page: the label reads perfectly and the button's
7777
+ * extent does not, which is the half of a control WCAG 1.4.11 is about.
7778
+ * brand-1 inverts to the identity orange in the dark palette, where the fill
7779
+ * is already 8.49:1 and the border simply matches it. */
7780
+ --bp-button-brand-border: var(--bp-c-brand-1);
7429
7781
  --bp-button-brand-text: var(--bp-c-black);
7430
- --bp-button-brand-bg: var(--bp-c-brand-1);
7431
- --bp-button-brand-hover-border: transparent;
7782
+ --bp-button-brand-bg: var(--bp-c-bun-orange);
7783
+ --bp-button-brand-hover-border: var(--bp-c-brand-1);
7432
7784
  --bp-button-brand-hover-text: var(--bp-c-black);
7433
- --bp-button-brand-hover-bg: var(--bp-c-brand-2);
7434
- --bp-button-brand-active-border: transparent;
7785
+ --bp-button-brand-hover-bg: var(--bp-c-bun-orange-light);
7786
+ --bp-button-brand-active-border: var(--bp-c-brand-1);
7435
7787
  --bp-button-brand-active-text: var(--bp-c-black);
7436
- --bp-button-brand-active-bg: var(--bp-c-brand-3);
7788
+ --bp-button-brand-active-bg: var(--bp-c-bun-orange-dark);
7437
7789
 
7438
7790
  /* Blue accent button (like bun.sh install button) */
7439
7791
  --bp-button-alt-border: transparent;
@@ -7640,7 +7992,7 @@ mjx-container > svg {
7640
7992
 
7641
7993
  .bpi-search {
7642
7994
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'%3E%3Cpath d='m21 21l-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E");
7643
- }`,EQ=`/**
7995
+ }`,DQ=`/**
7644
7996
  * Bun Theme for BunPress - Base Styles
7645
7997
  * -------------------------------------------------------------------------- */
7646
7998
 
@@ -8439,7 +8791,7 @@ p {
8439
8791
  .bp-doc .custom-block .bp-code-group .tabs {
8440
8792
  margin: 0;
8441
8793
  border-radius: 5px 5px 0 0;
8442
- }`,RQ=`/**
8794
+ }`,TQ=`/**
8443
8795
  * Bun Theme for BunPress - Custom Blocks
8444
8796
  * -------------------------------------------------------------------------- */
8445
8797
 
@@ -8803,7 +9155,7 @@ p {
8803
9155
 
8804
9156
  .github-alert-caution .github-alert-icon {
8805
9157
  fill: var(--bp-c-caution-1);
8806
- }`,FQ=`/**
9158
+ }`,wQ=`/**
8807
9159
  * Bun Theme for BunPress - Code Groups
8808
9160
  * -------------------------------------------------------------------------- */
8809
9161
 
@@ -8933,7 +9285,7 @@ p {
8933
9285
  margin: 0;
8934
9286
  border-radius: 0;
8935
9287
  border: none;
8936
- }`,MQ=`/**
9288
+ }`,LQ=`/**
8937
9289
  * Bun Theme for BunPress - Extra Bun-specific styles
8938
9290
  * -------------------------------------------------------------------------- */
8939
9291
 
@@ -9087,35 +9439,35 @@ p {
9087
9439
 
9088
9440
  .interactive-hover:hover {
9089
9441
  transform: scale(1.06);
9090
- }`;function TQ(){return`
9442
+ }`;function AQ(){return`
9091
9443
  /* Bun Theme for BunPress */
9092
9444
  /* Colors extracted from bun.sh */
9093
- ${BQ}
9094
- ${EQ}
9095
- ${OQ}
9096
- ${RQ}
9445
+ ${IQ}
9446
+ ${DQ}
9097
9447
  ${FQ}
9098
- ${MQ}
9099
- `}function vZ(){return BQ}function CZ(){return EQ}function bZ(){return RQ}function fZ(){return FQ}function pZ(){return MQ}var uZ={name:"bun",getCSS:TQ,getVars:vZ,getBase:CZ,getCustomBlocks:bZ,getCodeGroups:fZ,getExtras:pZ},IQ=uZ;var hZ={vitepress:NQ,bun:IQ};function DQ(J="vitepress"){let Z=hZ[J];if(!Z)return console.warn(`[BunPress] Unknown theme: ${J}, falling back to vitepress`),yJ();return Z.getCSS()}async function gZ(J,Z){let Q=J.themeConfig?.sidebar||J.sidebar||J.markdown?.sidebar;if(!Q)return"";let $=[];if(Array.isArray(Q))$=Q;else if(typeof Q==="object"){let q=Object.keys(Q).sort((z,W)=>W.length-z.length).find((z)=>Z.startsWith(z))||"/";$=Q[q]||[]}let Y=await Promise.all($.map(async(X)=>{if(X.link){let{html:W}=CJ(J,[X],Z,0);return await H("sidebar-section",{heading:"",items:W,collapsedClass:""})}let{html:q,active:z}=X.items?CJ(J,X.items,Z,0):{html:"",active:!1};return await H("sidebar-section",{heading:await H("sidebar-section-heading",{title:X.text}),items:q,collapsedClass:X.collapsed&&!z?" collapsed":""})}));return await H("sidebar",{sections:Y.join("")})}function CJ(J,Z,Q,$){let Y=!1;return{html:Z.map((q)=>{let z=!!q.link&&q.link===Q;if(q.items?.length){let K=CJ(J,q.items,Q,$+1),G=z||K.active;Y||=G;let _=q.collapsed&&!G,U=q.link?`<a class="BPSidebarGroup-link${z?" is-active":""}" href="${m(J,q.link)}">${q.text}</a>`:`<span class="BPSidebarGroup-text">${q.text}</span>`;return`<li class="BPSidebarGroup${_?" collapsed":""}${G?" has-active":""}" style="--bp-sidebar-depth:${$}"><div class="BPSidebarGroup-head">${U}<button class="BPSidebarGroup-toggle" type="button" aria-expanded="${_?"false":"true"}" aria-label="Toggle ${q.text.replace(/"/g,"&quot;")}" onclick="toggleSidebarGroup(this)"><svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></button></div><div class="BPSidebarGroup-items"><ul class="sidebar-items">${K.html}</ul></div></li>`}Y||=z;let W=m(J,q.link||"/");return`<li style="--bp-sidebar-depth:${$}"><a class="${z?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${W}">${q.text}</a></li>`}).join(""),active:Y}}eJ(S.markdown?.languageAliases);var mZ=`<button class="BPNavBarHamburger" type="button" aria-label="Toggle navigation" onclick="toggleSidebar()">
9448
+ ${TQ}
9449
+ ${wQ}
9450
+ ${LQ}
9451
+ `}function mZ(){return IQ}function dZ(){return DQ}function cZ(){return TQ}function lZ(){return wQ}function sZ(){return LQ}var rZ={name:"bun",getCSS:AQ,getVars:mZ,getBase:dZ,getCustomBlocks:cZ,getCodeGroups:lZ,getExtras:sZ},HQ=rZ;var iZ={vitepress:MQ,bun:HQ};function yQ(J="vitepress"){let Z=iZ[J];if(!Z)return console.warn(`[BunPress] Unknown theme: ${J}, falling back to vitepress`),SJ();return Z.getCSS()}async function oZ(J,Z){let Q=J.themeConfig?.sidebar||J.sidebar||J.markdown?.sidebar;if(!Q)return"";let $=[];if(Array.isArray(Q))$=Q;else if(typeof Q==="object"){let z=Object.keys(Q).sort((W,q)=>q.length-W.length).find((W)=>Z.startsWith(W))||"/";$=Q[z]||[]}let Y=await Promise.all($.map(async(X)=>{if(X.link){let{html:q}=pJ(J,[X],Z,0);return await H("sidebar-section",{heading:"",items:q,collapsedClass:""})}let{html:z,active:W}=X.items?pJ(J,X.items,Z,0):{html:"",active:!1};return await H("sidebar-section",{heading:await H("sidebar-section-heading",{title:X.text}),items:z,collapsedClass:X.collapsed&&!W?" collapsed":""})}));return await H("sidebar",{sections:Y.join("")})}function pJ(J,Z,Q,$){let Y=!1;return{html:Z.map((z)=>{let W=!!z.link&&z.link===Q;if(z.items?.length){let K=pJ(J,z.items,Q,$+1),_=W||K.active;Y||=_;let G=z.collapsed&&!_,O=z.link?`<a class="BPSidebarGroup-link${W?" is-active":""}" href="${m(J,z.link)}">${z.text}</a>`:`<span class="BPSidebarGroup-text">${z.text}</span>`;return`<li class="BPSidebarGroup${G?" collapsed":""}${_?" has-active":""}" style="--bp-sidebar-depth:${$}"><div class="BPSidebarGroup-head">${O}<button class="BPSidebarGroup-toggle" type="button" aria-expanded="${G?"false":"true"}" aria-label="Toggle ${z.text.replace(/"/g,"&quot;")}" onclick="toggleSidebarGroup(this)"><svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></button></div><div class="BPSidebarGroup-items"><ul class="sidebar-items">${K.html}</ul></div></li>`}Y||=W;let q=m(J,z.link||"/");return`<li style="--bp-sidebar-depth:${$}"><a class="${W?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${q}">${z.text}</a></li>`}).join(""),active:Y}}YQ(P.markdown?.languageAliases);var aZ=`<button class="BPNavBarHamburger" type="button" aria-label="Toggle navigation" onclick="toggleSidebar()">
9100
9452
  <svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9101
9453
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
9102
9454
  </svg>
9103
- </button>`,dZ=`<button class="BPNavToggle" type="button" aria-label="Menu" aria-expanded="false" aria-controls="bp-nav-screen" onclick="toggleNavScreen()">
9455
+ </button>`,nZ=`<button class="BPNavToggle" type="button" aria-label="Menu" aria-expanded="false" aria-controls="bp-nav-screen" onclick="toggleNavScreen()">
9104
9456
  <svg class="BPNavToggle-open" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9105
9457
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7h16M4 12h16M4 17h16"></path>
9106
9458
  </svg>
9107
9459
  <svg class="BPNavToggle-close" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9108
9460
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 6l12 12M18 6L6 18"></path>
9109
9461
  </svg>
9110
- </button>`;function cZ(J){if(!J.keyboard||!J.keys.length)return{hint:"",aria:""};let Z=(Q,$)=>{let Y=[];if(Q.ctrl)Y.push($?"Ctrl":"Control");if(Q.meta)Y.push($?"\u2318":"Meta");if(Q.alt)Y.push($?"\u2325":"Alt");if(Q.shift)Y.push("Shift");return Y.push(Q.key.length===1?Q.key.toUpperCase():Q.key),$?Y.join(""):Y.join("+")};return{hint:Z(J.keys[0],!0),aria:J.keys.map((Q)=>Z(Q,!1)).join(" ")}}function lZ(J,Z){let{hint:Q,aria:$}=cZ(Z),Y=F(J);return`<button class="BPNavBarSearch" type="button" aria-label="${Y}"${$?` aria-keyshortcuts="${F($)}"`:""}>
9462
+ </button>`;function tZ(J){if(!J.keyboard||!J.keys.length)return{hint:"",aria:""};let Z=(Q,$)=>{let Y=[];if(Q.ctrl)Y.push($?"Ctrl":"Control");if(Q.meta)Y.push($?"\u2318":"Meta");if(Q.alt)Y.push($?"\u2325":"Alt");if(Q.shift)Y.push("Shift");return Y.push(Q.key.length===1?Q.key.toUpperCase():Q.key),$?Y.join(""):Y.join("+")};return{hint:Z(J.keys[0],!0),aria:J.keys.map((Q)=>Z(Q,!1)).join(" ")}}function eZ(J,Z){let{hint:Q,aria:$}=tZ(Z),Y=F(J);return`<button class="BPNavBarSearch" type="button" aria-label="${Y}"${$?` aria-keyshortcuts="${F($)}"`:""}>
9111
9463
  <svg class="BPNavBarSearch-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9112
9464
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
9113
9465
  </svg>
9114
9466
  <span class="BPNavBarSearch-label">${Y}</span>
9115
- ${Q?`<kbd class="BPNavBarSearch-kbd">${F(Q)}</kbd>`:""}
9116
- </button>`}var sZ={github:'<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>',twitter:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>',discord:'<path d="M20.317 4.37a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.6 12.6 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.127 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.056c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.028M8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418m7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418"/>',x:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>'};function rZ(J){return(J.themeConfig?.socialLinks??[]).map(({icon:Q,link:$})=>{let Y=sZ[Q?.toLowerCase()],X=Q?Q.charAt(0).toUpperCase()+Q.slice(1):"Link",q=Y?`<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">${Y}</svg>`:`<span class="BPSocialLinks-text">${F(X)}</span>`;return`<a href="${F($)}" target="_blank" rel="noopener external" aria-label="${F(X)}">${q}</a>`}).join(`
9117
- `)}async function iZ(J,Z="On this page"){let Q=J.replace(/<nav class="table-of-contents[\s\S]*?<\/nav>/g,""),$=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,Y=[],X;while((X=$.exec(Q))!==null){let z=Number.parseInt(X[1]),W=X[2],V=X[3];V=V.replace(/<[^>]*>/g,"");let K=W.match(/id="([^"]*)"/),G=K?K[1]:V.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");Y.push({level:z,text:V,id:G})}if(Y.length===0)return{aside:"",inline:""};let q=Y.map((z)=>{let W=z.level>2?`level-${z.level}`:"";return`<a href="#${z.id}" class="${W}">${z.text}</a>`}).join(`
9118
- `);return{aside:await H("page-toc",{items:q,title:Z}),inline:await H("page-outline",{items:q,count:String(Y.length),title:Z})}}function oZ(J){let Z=new Set;return J.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(Q,$,Y,X)=>{if(Y.includes("id=")){let V=Y.match(/\bid=["']([^"']+)["']/)?.[1];if(V)Z.add(V);return Q}let q=X.match(/\s*\{#([\w-]+)\}\s*$/),z,W=X;if(q)z=q[1],W=X.replace(/\s*\{#[\w-]+\}\s*$/,"");else{let V=X.replace(/<[^>]*>/g,"");z=pJ(V)}return z=uJ(z,Z),`<h${$}${Y} id="${z}">${W}</h${$}>`})}function aZ(J,Z,Q=""){if(!Z&&!Q)return J;let $=!1,Y=J.replace(/<h1(?:\s[^>]*)?>[\s\S]*?<\/h1>/,(X)=>{return $=!0,`<div class="bp-page-header">${X}${Z}</div>${Q}`});return $?Y:`${Q}${J}`}function SJ(J,Z=""){let Q=nZ(Z),$=J.lastIndexOf("</body>");if($===-1)return J+Q;return J.slice(0,$)+Q+J.slice($)}function PJ(J,Z){if(!Z)return J;let Q=J.lastIndexOf("</body>");if(Q===-1)return J+Z;return J.slice(0,Q)+Z+J.slice(Q)}function nZ(J=""){return`<script data-bp-router="1">
9467
+ ${Q?`<kbd class="BPNavBarSearch-kbd" data-hint="${F(Q)}" aria-hidden="true"></kbd>`:""}
9468
+ </button>`}var J0={github:'<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>',twitter:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>',discord:'<path d="M20.317 4.37a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.6 12.6 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.127 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.056c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.028M8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418m7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418"/>',x:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>'};function Q0(J){return(J.themeConfig?.socialLinks??[]).map(({icon:Q,link:$})=>{let Y=J0[Q?.toLowerCase()],X=Q?Q.charAt(0).toUpperCase()+Q.slice(1):"Link",z=Y?`<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">${Y}</svg>`:`<span class="BPSocialLinks-text">${F(X)}</span>`;return`<a href="${F($)}" target="_blank" rel="noopener external" aria-label="${F(X)}">${z}</a>`}).join(`
9469
+ `)}async function Z0(J,Z="On this page"){let Q=J.replace(/<nav class="table-of-contents[\s\S]*?<\/nav>/g,""),$=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,Y=[],X;while((X=$.exec(Q))!==null){let W=Number.parseInt(X[1]),q=X[2],V=X[3];V=V.replace(/<[^>]*>/g,"");let K=q.match(/id="([^"]*)"/),_=K?K[1]:V.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");Y.push({level:W,text:V,id:_})}if(Y.length===0)return{aside:"",inline:""};let z=Y.map((W)=>{let q=W.level>2?`level-${W.level}`:"";return`<a href="#${W.id}" class="${q}">${W.text}</a>`}).join(`
9470
+ `);return{aside:await H("page-toc",{items:z,title:Z}),inline:await H("page-outline",{items:z,count:String(Y.length),title:Z})}}function $0(J){let Z=new Set;return J.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(Q,$,Y,X)=>{if(Y.includes("id=")){let V=Y.match(/\bid=["']([^"']+)["']/)?.[1];if(V)Z.add(V);return Q}let z=X.match(/\s*\{#([\w-]+)\}\s*$/),W,q=X;if(z)W=z[1],q=X.replace(/\s*\{#[\w-]+\}\s*$/,"");else{let V=X.replace(/<[^>]*>/g,"");W=hJ(V)}return W=mJ(W,Z),`<h${$}${Y} id="${W}">${q}</h${$}>`})}function Y0(J,Z,Q=""){if(!Z&&!Q)return J;let $=!1,Y=J.replace(/<h1(?:\s[^>]*)?>[\s\S]*?<\/h1>/,(X)=>{return $=!0,`<div class="bp-page-header">${X}${Z}</div>${Q}`});return $?Y:`${Q}${J}`}function kJ(J,Z=""){let Q=z0(Z),$=J.lastIndexOf("</body>");if($===-1)return J+Q;return J.slice(0,$)+Q+J.slice($)}function xJ(J,Z){if(!Z)return J;let Q=J.lastIndexOf("</body>");if(Q===-1)return J+Z;return J.slice(0,Q)+Z+J.slice(Q)}var X0="<script>try{var m=document.documentElement.getAttribute('data-theme-mode');if(m!=='dark'&&m!=='light'){var t=localStorage.getItem('bunpress-theme');if(t==='dark'||t==='light'){document.documentElement.setAttribute('data-bp-theme',t);if(t==='dark')document.documentElement.classList.add('dark');else document.documentElement.classList.remove('dark')}}}catch(e){}</script>";function vJ(J){let Z=J.indexOf("</head>");if(Z===-1)return J;return J.slice(0,Z)+X0+J.slice(Z)}function z0(J=""){return`<script data-bp-router="1">
9119
9471
  (function(){
9120
9472
  // The site's mount point ('/docs'). Links are written with it; the page can
9121
9473
  // be reached without it (the dev server answers both), so paths are compared
@@ -9437,57 +9789,57 @@ ${MQ}
9437
9789
 
9438
9790
  updateActiveLinks();
9439
9791
  })();
9440
- <`+"/script>"}var nQ=`<svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9792
+ <`+"/script>"}var ZZ=`<svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9441
9793
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
9442
- </svg>`;function tQ(J){return J.themeConfig?.nav||J.markdown?.nav||J.nav||[]}function eQ(J){if(typeof J.mega==="boolean")return J.mega;return(J.items??[]).some((Z)=>!!Z.description||(Z.items?.length??0)>0)}function JZ(J){let Z=J.items??[],Q=Z.filter((X)=>(X.items?.length??0)>0);if(Q.length===0)return[{items:Z}];let $=Z.filter((X)=>(X.items?.length??0)===0),Y=Q.map((X)=>({text:X.text,items:X.items??[]}));return $.length>0?[{items:$},...Y]:Y}function tZ(J,Z=""){let Q=tQ(J);if(Q.length===0)return"";let $=(K)=>{return m(J,K||"/")},Y=(K)=>QZ(K,Z),X=(K)=>Y(K)||(K.items??[]).some((G)=>X(G)),q=(K)=>{let G=K.icon?`<span class="BPMega-item-icon" aria-hidden="true">${K.icon}</span>`:"",_=K.description?`<span class="BPMega-item-desc">${K.description}</span>`:"";return`<a class="BPMega-item${Y(K)?" is-active":""}" href="${F($(K.link))}">
9443
- ${G}
9794
+ </svg>`;function $Z(J){return J.themeConfig?.nav||J.markdown?.nav||J.nav||[]}function YZ(J){if(typeof J.mega==="boolean")return J.mega;return(J.items??[]).some((Z)=>!!Z.description||(Z.items?.length??0)>0)}function XZ(J){let Z=J.items??[],Q=Z.filter((X)=>(X.items?.length??0)>0);if(Q.length===0)return[{items:Z}];let $=Z.filter((X)=>(X.items?.length??0)===0),Y=Q.map((X)=>({text:X.text,items:X.items??[]}));return $.length>0?[{items:$},...Y]:Y}function W0(J,Z=""){let Q=$Z(J);if(Q.length===0)return"";let $=(K)=>{return m(J,K||"/")},Y=(K)=>zZ(K,Z),X=(K)=>Y(K)||(K.items??[]).some((_)=>X(_)),z=(K)=>{let _=K.icon?`<span class="BPMega-item-icon" aria-hidden="true">${K.icon}</span>`:"",G=K.description?`<span class="BPMega-item-desc">${K.description}</span>`:"";return`<a class="BPMega-item${Y(K)?" is-active":""}" href="${F($(K.link))}">
9795
+ ${_}
9444
9796
  <span class="BPMega-item-body">
9445
9797
  <span class="BPMega-item-title">${K.text}</span>
9446
- ${_}
9798
+ ${G}
9447
9799
  </span>
9448
- </a>`},z=(K)=>{let G=JZ(K),_=Math.max(1,Math.min(K.columns??G.length,4)),U=G.map((B)=>{return`<div class="BPMega-group">
9449
- ${B.text?`<p class="BPMega-group-title">${B.text}</p>`:""}
9450
- ${B.items.map(q).join(`
9800
+ </a>`},W=(K)=>{let _=XZ(K),G=Math.max(1,Math.min(K.columns??_.length,4)),O=_.map((E)=>{return`<div class="BPMega-group">
9801
+ ${E.text?`<p class="BPMega-group-title">${E.text}</p>`:""}
9802
+ ${E.items.map(z).join(`
9451
9803
  `)}
9452
9804
  </div>`}).join(`
9453
9805
  `),N=K.footer?`<div class="BPMega-footer">
9454
9806
  ${K.footer.note?`<span class="BPMega-footer-note">${K.footer.note}</span>`:""}
9455
9807
  <a class="BPMega-footer-link" href="${F($(K.footer.link))}">${K.footer.text}</a>
9456
- </div>`:"";return`<div class="BPMega BPNavBarMenu-group-items" style="--bp-mega-columns:${_}">
9808
+ </div>`:"";return`<div class="BPMega BPNavBarMenu-group-items" style="--bp-mega-columns:${G}">
9457
9809
  <div class="BPMega-columns">
9458
- ${U}
9810
+ ${O}
9459
9811
  </div>
9460
9812
  ${N}
9461
- </div>`},W=(K)=>`<div class="BPNavBarMenu-group-items">
9462
- ${(K.items??[]).map((G)=>`<a href="${F($(G.link))}"${Y(G)?' class="is-active"':""}>${G.text}</a>`).join("")}
9463
- </div>`;return Q.map((K)=>{if(K.items&&K.items.length>0){let _=eQ(K),U=X(K)?" is-active":"";return`<div class="BPNavBarMenu-group${_?" is-mega":""}${U}">
9813
+ </div>`},q=(K)=>`<div class="BPNavBarMenu-group-items">
9814
+ ${(K.items??[]).map((_)=>`<a href="${F($(_.link))}"${Y(_)?' class="is-active"':""}>${_.text}</a>`).join("")}
9815
+ </div>`;return Q.map((K)=>{if(K.items&&K.items.length>0){let G=YZ(K),O=X(K)?" is-active":"";return`<div class="BPNavBarMenu-group${G?" is-mega":""}${O}">
9464
9816
  <button class="BPNavBarMenu-group-button" type="button" aria-expanded="false" aria-haspopup="true">
9465
9817
  <span>${K.text}</span>
9466
- ${nQ}
9818
+ ${ZZ}
9467
9819
  </button>
9468
- ${_?z(K):W(K)}
9469
- </div>`}return`<a class="BPNavBarMenu-link${Y(K)?" is-active":""}" href="${F($(K.link))}">${K.text}</a>`}).join("")}function QZ(J,Z){if(J.activeMatch)try{return new RegExp(J.activeMatch).test(Z)}catch{return!1}if(!J.link)return!1;let Q=J.link.split("#")[0].replace(/\/$/,"");return Q!==""&&Q!=="/"&&(Z===Q||Z.startsWith(`${Q}/`))}function eZ(J,Z=""){let Q=tQ(J);if(Q.length===0)return"";let $=(z)=>m(J,z||"/"),Y=(z)=>QZ(z,Z),X=(z,W)=>`<a class="${W}${Y(z)?" is-active":""}" href="${F($(z.link))}">${z.text}</a>`;return`<div class="BPNavScreen" id="bp-nav-screen" hidden>
9470
- <nav class="BPNavScreen-nav" aria-label="Site">${Q.map((z)=>{if(!z.items||z.items.length===0)return`<div class="BPNavScreen-section">${X(z,"BPNavScreen-link")}</div>`;let V=(eQ(z)?JZ(z):[{items:z.items}]).map((K)=>{return`${K.text?`<p class="BPNavScreen-subtitle">${K.text}</p>`:""}${K.items.map((_)=>X(_,"BPNavScreen-link")).join("")}`}).join("");return`<details class="BPNavScreen-section"${(z.items??[]).some((K)=>Y(K))?" open":""}>
9471
- <summary class="BPNavScreen-summary">${z.text}${nQ}</summary>
9820
+ ${G?W(K):q(K)}
9821
+ </div>`}return`<a class="BPNavBarMenu-link${Y(K)?" is-active":""}" href="${F($(K.link))}">${K.text}</a>`}).join("")}function zZ(J,Z){if(J.activeMatch)try{return new RegExp(J.activeMatch).test(Z)}catch{return!1}if(!J.link)return!1;let Q=J.link.split("#")[0].replace(/\/$/,"");return Q!==""&&Q!=="/"&&(Z===Q||Z.startsWith(`${Q}/`))}function q0(J,Z=""){let Q=$Z(J);if(Q.length===0)return"";let $=(W)=>m(J,W||"/"),Y=(W)=>zZ(W,Z),X=(W,q)=>`<a class="${q}${Y(W)?" is-active":""}" href="${F($(W.link))}">${W.text}</a>`;return`<div class="BPNavScreen" id="bp-nav-screen" hidden>
9822
+ <nav class="BPNavScreen-nav" aria-label="Site">${Q.map((W)=>{if(!W.items||W.items.length===0)return`<div class="BPNavScreen-section">${X(W,"BPNavScreen-link")}</div>`;let V=(YZ(W)?XZ(W):[{items:W.items}]).map((K)=>{return`${K.text?`<p class="BPNavScreen-subtitle">${K.text}</p>`:""}${K.items.map((G)=>X(G,"BPNavScreen-link")).join("")}`}).join("");return`<details class="BPNavScreen-section"${(W.items??[]).some((K)=>Y(K))?" open":""}>
9823
+ <summary class="BPNavScreen-summary">${W.text}${ZZ}</summary>
9472
9824
  <div class="BPNavScreen-items">${V}</div>
9473
9825
  </details>`}).join("")}</nav>
9474
- </div>`}function HQ(J,Z){let Q=p(J);if(!Q)return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z.slice(Q.length)||"/";return Z}function m(J,Z){let Q=p(J);if(!Q||!Z.startsWith("/")||Z.startsWith("//"))return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z;return Z==="/"?`${Q}/`:`${Q}${Z}`}function kJ(J,Z){return J.replace(/\b(href|src|action)="(\/[^"]*)"/g,(Q,$,Y)=>{let X=m(Z,Y);return X===Y?Q:`${$}="${X}"`})}function BJ(J){if(J==="/index")return"/";return J.endsWith("/index")?J.slice(0,-6):J}function J0(J,Z,Q){if(Q)return`<link rel="canonical" href="${F(Q)}">`;let $=NJ(J);if(!$)return"";let Y=BJ(Z);return`<link rel="canonical" href="${$}${Y}">`}function Q0(J,Z,Q,$,Y){let X=NJ(Q);if(!X)return"";let q=BJ($),z=`${X}${q}`,W=Q.title||Q.markdown?.title||J,V=Y||Q.markdown?.meta?.["og:image"]||Q.markdown?.meta?.ogImage,K=['<meta property="og:type" content="website">',`<meta property="og:url" content="${z}">`,`<meta property="og:title" content="${F(J)}">`,`<meta property="og:description" content="${F(Z)}">`,`<meta property="og:site_name" content="${F(W)}">`];if(V){K.push(`<meta property="og:image" content="${V}">`);let G=Q.markdown?.meta??{};for(let _ of["og:image:width","og:image:height","og:image:type","og:image:alt"]){let U=G[_];if(U!==void 0&&U!==null&&U!=="")K.push(`<meta property="${_}" content="${U}">`)}}return K.join(`
9475
- `)}function Z0(J,Z,Q,$){let Y=Q.markdown?.meta?.["twitter:card"]||Q.markdown?.meta?.twitterCard||"summary",X=Q.markdown?.meta?.["twitter:site"]||Q.markdown?.meta?.twitterSite,q=$||Q.markdown?.meta?.["twitter:image"]||Q.markdown?.meta?.twitterImage||Q.markdown?.meta?.["og:image"]||Q.markdown?.meta?.ogImage,z=[`<meta name="twitter:card" content="${Y}">`,`<meta name="twitter:title" content="${F(J)}">`,`<meta name="twitter:description" content="${F(Z)}">`];if(X)z.push(`<meta name="twitter:site" content="${X}">`);if(q){z.push(`<meta name="twitter:image" content="${q}">`);let W=Q.markdown?.meta?.["twitter:image:alt"]??Q.markdown?.meta?.["og:image:alt"];if(W!==void 0&&W!==null&&W!=="")z.push(`<meta name="twitter:image:alt" content="${W}">`)}return z.join(`
9476
- `)}function $0(J,Z,Q,$){let Y=NJ(Q);if(!Y)return"";let X=BJ($),q=`${Y}${X}`;if(X==="/"){let K={"@context":"https://schema.org","@type":"WebSite",name:Q.title||Q.markdown?.title||J,description:Z,url:Y};return`<script type="application/ld+json">
9826
+ </div>`}function xQ(J,Z){let Q=p(J);if(!Q)return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z.slice(Q.length)||"/";return Z}function m(J,Z){let Q=p(J);if(!Q||!Z.startsWith("/")||Z.startsWith("//"))return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z;return Z==="/"?`${Q}/`:`${Q}${Z}`}function CJ(J,Z){return J.replace(/\b(href|src|action)="(\/[^"]*)"/g,(Q,$,Y)=>{let X=m(Z,Y);return X===Y?Q:`${$}="${X}"`})}function RJ(J){if(J==="/index")return"/";return J.endsWith("/index")?J.slice(0,-6):J}function K0(J,Z,Q){if(Q)return`<link rel="canonical" href="${F(Q)}">`;let $=EJ(J);if(!$)return"";let Y=RJ(Z);return`<link rel="canonical" href="${$}${Y}">`}function V0(J,Z,Q,$,Y){let X=EJ(Q);if(!X)return"";let z=RJ($),W=`${X}${z}`,q=Q.title||Q.markdown?.title||J,V=Y||Q.markdown?.meta?.["og:image"]||Q.markdown?.meta?.ogImage,K=['<meta property="og:type" content="website">',`<meta property="og:url" content="${W}">`,`<meta property="og:title" content="${F(J)}">`,`<meta property="og:description" content="${F(Z)}">`,`<meta property="og:site_name" content="${F(q)}">`];if(V){K.push(`<meta property="og:image" content="${V}">`);let _=Q.markdown?.meta??{};for(let G of["og:image:width","og:image:height","og:image:type","og:image:alt"]){let O=_[G];if(O!==void 0&&O!==null&&O!=="")K.push(`<meta property="${G}" content="${O}">`)}}return K.join(`
9827
+ `)}function G0(J,Z,Q,$){let Y=Q.markdown?.meta?.["twitter:card"]||Q.markdown?.meta?.twitterCard||"summary",X=Q.markdown?.meta?.["twitter:site"]||Q.markdown?.meta?.twitterSite,z=$||Q.markdown?.meta?.["twitter:image"]||Q.markdown?.meta?.twitterImage||Q.markdown?.meta?.["og:image"]||Q.markdown?.meta?.ogImage,W=[`<meta name="twitter:card" content="${Y}">`,`<meta name="twitter:title" content="${F(J)}">`,`<meta name="twitter:description" content="${F(Z)}">`];if(X)W.push(`<meta name="twitter:site" content="${X}">`);if(z){W.push(`<meta name="twitter:image" content="${z}">`);let q=Q.markdown?.meta?.["twitter:image:alt"]??Q.markdown?.meta?.["og:image:alt"];if(q!==void 0&&q!==null&&q!=="")W.push(`<meta name="twitter:image:alt" content="${q}">`)}return W.join(`
9828
+ `)}function _0(J,Z,Q,$){let Y=EJ(Q);if(!Y)return"";let X=RJ($),z=`${Y}${X}`;if(X==="/"){let K={"@context":"https://schema.org","@type":"WebSite",name:Q.title||Q.markdown?.title||J,description:Z,url:Y};return`<script type="application/ld+json">
9477
9829
  ${JSON.stringify(K,null,2)}
9478
- </script>`}let z={"@context":"https://schema.org","@type":"TechArticle",headline:J,description:Z,url:q},W=X.split("/").filter(Boolean),V=W.map((K,G)=>{let _=G+1,U=`${Y}/${W.slice(0,_).join("/")}`;return{"@type":"ListItem",position:_,name:K.replace(/-/g," ").replace(/\b\w/g,(N)=>N.toUpperCase()),item:U}});if(V.length>0){let K={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:V};return`<script type="application/ld+json">
9479
- ${JSON.stringify(z,null,2)}
9830
+ </script>`}let W={"@context":"https://schema.org","@type":"TechArticle",headline:J,description:Z,url:z},q=X.split("/").filter(Boolean),V=q.map((K,_)=>{let G=_+1,O=`${Y}/${q.slice(0,G).join("/")}`;return{"@type":"ListItem",position:G,name:K.replace(/-/g," ").replace(/\b\w/g,(N)=>N.toUpperCase()),item:O}});if(V.length>0){let K={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:V};return`<script type="application/ld+json">
9831
+ ${JSON.stringify(W,null,2)}
9480
9832
  </script>
9481
9833
  <script type="application/ld+json">
9482
9834
  ${JSON.stringify(K,null,2)}
9483
9835
  </script>`}return`<script type="application/ld+json">
9484
- ${JSON.stringify(z,null,2)}
9485
- </script>`}function Y0(J){let Z=J.fonts;if(!Z)return{fontLinks:"",fontFaceCss:""};let Q=[],$=Z.google?.filter(Boolean)??[];if($.length>0){if(Z.preconnect!==!1)Q.push('<link rel="preconnect" href="https://fonts.googleapis.com">'),Q.push('<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>');let X=$.map((z)=>`family=${z.trim().replace(/\s+/g,"+")}`).join("&"),q=Z.display??"swap";Q.push(`<link href="https://fonts.googleapis.com/css2?${X}&display=${q}" rel="stylesheet">`)}let Y=(Z.faces??[]).map((X)=>X.trim()).filter(Boolean).join(`
9836
+ ${JSON.stringify(W,null,2)}
9837
+ </script>`}function U0(J){let Z=J.fonts;if(!Z)return{fontLinks:"",fontFaceCss:""};let Q=[],$=Z.google?.filter(Boolean)??[];if($.length>0){if(Z.preconnect!==!1)Q.push('<link rel="preconnect" href="https://fonts.googleapis.com">'),Q.push('<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>');let X=$.map((W)=>`family=${W.trim().replace(/\s+/g,"+")}`).join("&"),z=Z.display??"swap";Q.push(`<link href="https://fonts.googleapis.com/css2?${X}&display=${z}" rel="stylesheet">`)}let Y=(Z.faces??[]).map((X)=>X.trim()).filter(Boolean).join(`
9486
9838
  `);return{fontLinks:Q.join(`
9487
- `),fontFaceCss:Y}}function X0(J){let Z={...J.markdown?.themeConfig,...J.themeConfig},Q=[],$=(z,W)=>{if(W)Q.push(` ${z}: ${W};`)},Y=Z.colors??{};$("--bp-c-brand-1",Y.primary),$("--bp-c-brand-2",Y.secondary||Y.primary),$("--bp-c-brand-3",Y.accent||Y.secondary||Y.primary),$("--bp-c-bg",Y.background),$("--bp-c-bg-alt",Y.surface),$("--bp-c-bg-soft",Y.surface),$("--bp-c-text-1",Y.text),$("--bp-c-text-2",Y.muted);let X=Z.fonts??{};$("--bp-font-family-base",X.body),$("--bp-font-family-mono",X.mono);for(let[z,W]of Object.entries(Z.cssVars??{}))$(z.startsWith("--")?z:`--${z}`,W);let q=[];if(Q.length)q.push(`:root {
9839
+ `),fontFaceCss:Y}}function O0(J){let Z={...J.markdown?.themeConfig,...J.themeConfig},Q=[],$=(W,q)=>{if(q)Q.push(` ${W}: ${q};`)},Y=Z.colors??{};$("--bp-c-brand-1",Y.primary),$("--bp-c-brand-2",Y.secondary||Y.primary),$("--bp-c-brand-3",Y.accent||Y.secondary||Y.primary),$("--bp-c-bg",Y.background),$("--bp-c-bg-alt",Y.surface),$("--bp-c-bg-soft",Y.surface),$("--bp-c-text-1",Y.text),$("--bp-c-text-2",Y.muted);let X=Z.fonts??{};$("--bp-font-family-base",X.body),$("--bp-font-family-mono",X.mono);for(let[W,q]of Object.entries(Z.cssVars??{}))$(W.startsWith("--")?W:`--${W}`,q);let z=[];if(Q.length)z.push(`:root {
9488
9840
  ${Q.join(`
9489
9841
  `)}
9490
- }`);if(X.heading)q.push(`.bp-doc h1,
9842
+ }`);if(X.heading)z.push(`.bp-doc h1,
9491
9843
  .bp-doc h2,
9492
9844
  .bp-doc h3,
9493
9845
  .bp-doc h4,
@@ -9495,43 +9847,46 @@ ${Q.join(`
9495
9847
  .bp-doc h6,
9496
9848
  .BPHero-text {
9497
9849
  font-family: ${X.heading};
9498
- }`);if(Z.css)q.push(Z.css);return q.join(`
9499
-
9500
- `)}function q0(J,Z,Q,$){let Y=Z.match(/<h1(?:\s[^>]*)?>([\s\S]*?)<\/h1>/),X=Y?hJ(Y[1].replace(/<[^>]+>/g,"")).trim():"",q=typeof J.title==="string"&&J.title.trim()||X||Q,z=q&&q!==Q?`${q} | ${Q}`:Q,W=typeof J.description==="string"&&J.description.trim()||$.description||$.markdown?.meta?.description||"Documentation built with BunPress",V=[],K=(N)=>{V.push(N)},G=J.keywords;if(G){let N=Array.isArray(G)?G.join(", "):String(G);if(N.trim())K(`<meta name="keywords" content="${F(N)}">`)}if(typeof J.author==="string"&&J.author.trim())K(`<meta name="author" content="${F(J.author)}">`);if(typeof J.robots==="string"&&J.robots.trim())K(`<meta name="robots" content="${F(J.robots)}">`);if(J.meta&&typeof J.meta==="object")for(let[N,B]of Object.entries(J.meta)){if(B===void 0||B===null)continue;let R=N.startsWith("og:")?"property":"name";K(`<meta ${R}="${F(N)}" content="${F(String(B))}">`)}for(let N of ZZ(J.head))K(N);let _=typeof J.image==="string"?J.image:void 0,U=typeof J.canonical==="string"?J.canonical:void 0;return{documentTitle:z,pageTitle:q,description:W,image:_,canonical:U,extraTags:V.join(`
9501
- `)}}function ZZ(J){if(!Array.isArray(J))return[];let Z=[];for(let Q of J){if(!Array.isArray(Q)||typeof Q[0]!=="string")continue;let[$,Y]=Q;if(!["meta","link","base"].includes($.toLowerCase()))continue;let X=Object.entries(Y??{}).map(([q,z])=>`${F(q)}="${F(String(z))}"`).join(" ");Z.push(`<${$.toLowerCase()}${X?` ${X}`:""}>`)}return Z}async function z0(J,Z,Q,$,Y){let X=J.themeConfig,q="",z="",W=X?.editLink?.pattern;if(W&&Y&&Z.editLink!==!1){let U=XQ(W,$,Y),N=X?.editLink?.text??"Edit this page";q=`<a class="BPDocFooter-edit" href="${F(U)}" target="_blank" rel="noopener"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>${F(N)}</a>`}let V=X?.lastUpdated,K=Z.lastUpdated!==!1,G=V!==void 0&&V!==!1,_=typeof Z.lastUpdated==="string"?Z.lastUpdated:void 0;if(K&&(G||Z.lastUpdated===!0||_)){let U=_??(Y?await YQ($,Y):null);if(U){let N=typeof V==="object"?V:{},B=qQ(U,Q,N.formatOptions);if(B){let R=N.text??"Last updated";z=`<p class="BPDocFooter-updated">${F(R)}: <time datetime="${F(U)}">${F(B)}</time></p>`}}}if(!q&&!z)return"";return H("doc-footer",{editLink:q,lastUpdated:z})}async function yQ(J,Z,Q,$="doc",Y={},X={}){let{i18n:q,locale:z,sourceFile:W,docsDir:V=Z.docsDir||"./docs"}=X,K=q??await fJ(bJ(Z),Z),G=z||K.defaultLocale,_=CQ(Z,K,G),U=(w)=>K.translate(w,G),N=_.title||_.themeConfig?.siteTitle||_.markdown?.title||"BunPress Documentation",B=q0(Y,J,N,_),R=B.documentTitle,M=B.description,I=_.theme||"vitepress",T=DQ(I),D=ZQ(),E=kQ.markdown?.css||"",j=_.markdown?.css||"",O=j&&j!==E?j:"",L=X0(_),k=J0(_,Q,B.canonical),v=Q0(B.pageTitle,M,_,Q,B.image),u=Z0(B.pageTitle,M,_,B.image),d=$0(B.pageTitle,M,_,Q),gJ=Object.entries(_.markdown?.meta||{}).filter(([w])=>!w.startsWith("og:")&&!w.startsWith("twitter:")&&w!=="description"&&w!=="ogImage"&&w!=="twitterCard"&&w!=="twitterSite"&&w!=="twitterImage").map(([w,f])=>`<meta name="${w}" content="${f}">`).join(`
9502
- `),{fontLinks:x,fontFaceCss:y}=Y0(_),A=bQ(K,_,Q),EJ=ZZ(_.head).join(`
9503
- `),h=[gJ,EJ,k,A,v,u,B.extraTags,x].filter(Boolean).join(`
9504
- `),RJ=K0(_),FJ=V0(_),MJ=_.markdown?.scripts?.map((w)=>`<script>${w}</script>`).join(`
9505
- `)||"",QJ=fQ(K),P=[d,RJ,FJ,MJ,QJ?`<script>${QJ}</script>`:""].filter(Boolean).join(`
9506
- `),C=tZ(_,Q),c=_.search??_.markdown?.search,l=c?.enabled!==!1,ZJ=c?.algolia,mJ=c?.provider==="algolia"&&!!ZJ?.appId&&!!ZJ?.apiKey&&!!ZJ?.indexName,b=lQ(_,m(_,UJ));if(!_.search?.placeholder&&!_.markdown?.search?.placeholder)b.placeholder=U("search.placeholder");b.locale=K.enabled?G:null;let TJ=l?await H(mJ?"search-algolia":"search",{placeholder:b.placeholder,runtimeConfig:JSON.stringify(mJ?{...b,algolia:ZJ}:b).replace(/</g,"\\u003c")}):"",g=_.themeConfig?.footer,IJ=g?.message||g?.copyright?await H("footer",{message:g.message?`<p class="BPFooter-message">${g.message}</p>`:"",copyright:g.copyright?`<p class="BPFooter-copyright">${g.copyright}</p>`:""}):"",XZ=K.enabled?await H("locale-switcher",{label:U("nav.menu"),current:vJ(K,G),options:K.locales.map((w)=>{let f=vQ(K,w,BJ(Q)),s=w===G?' aria-current="true"':"";return`<li><a href="${F(f)}" data-locale="${F(w)}"${s}>${F(vJ(K,w))}</a></li>`}).join(`
9507
- `)}):"",qZ=_.themeConfig?.logo?`<img class="BPNavBarTitle-logo" src="${F(_.themeConfig.logo)}" alt="">`:"",dJ=eZ(_,Q),DJ=async(w)=>Y.navbar===!1?"":H("navbar",{title:N,logo:qZ,localeSwitcher:XZ,nav:C,navScreen:w==="doc"?"":dJ,navToggle:w==="doc"||!dJ?"":dZ,searchTrigger:l?lZ(b.placeholder,b.shortcuts):"",hamburger:w==="doc"?mZ:"",socialLinks:rZ(_)}),$J=_.darkMode??_.themeConfig?.darkMode??"auto",YJ=$J===!0||$J==="dark"?"dark":$J===!1||$J==="light"?"light":"auto",wJ=YJ==="dark"?"dark":"";if($==="home"){let w=await xJ(`${J}
9508
- ${C}`),f=`${y}
9850
+ }`);if(Z.css)z.push(Z.css);return z.join(`
9851
+
9852
+ `)}function j0(J,Z,Q,$){let Y=Z.match(/<h1(?:\s[^>]*)?>([\s\S]*?)<\/h1>/),X=Y?dJ(Y[1].replace(/<[^>]+>/g,"")).trim():"",z=typeof J.title==="string"&&J.title.trim()||X||Q,W=z&&z!==Q?`${z} | ${Q}`:Q,q=typeof J.description==="string"&&J.description.trim()||$.description||$.markdown?.meta?.description||"Documentation built with BunPress",V=[],K=(N)=>{V.push(N)},_=J.keywords;if(_){let N=Array.isArray(_)?_.join(", "):String(_);if(N.trim())K(`<meta name="keywords" content="${F(N)}">`)}if(typeof J.author==="string"&&J.author.trim())K(`<meta name="author" content="${F(J.author)}">`);if(typeof J.robots==="string"&&J.robots.trim())K(`<meta name="robots" content="${F(J.robots)}">`);if(J.meta&&typeof J.meta==="object")for(let[N,E]of Object.entries(J.meta)){if(E===void 0||E===null)continue;let B=N.startsWith("og:")?"property":"name";K(`<meta ${B}="${F(N)}" content="${F(String(E))}">`)}for(let N of WZ(J.head))K(N);let G=typeof J.image==="string"?J.image:void 0,O=typeof J.canonical==="string"?J.canonical:void 0;return{documentTitle:W,pageTitle:z,description:q,image:G,canonical:O,extraTags:V.join(`
9853
+ `)}}function WZ(J){if(!Array.isArray(J))return[];let Z=[];for(let Q of J){if(!Array.isArray(Q)||typeof Q[0]!=="string")continue;let[$,Y]=Q;if(!["meta","link","base"].includes($.toLowerCase()))continue;let X=Object.entries(Y??{}).map(([z,W])=>`${F(z)}="${F(String(W))}"`).join(" ");Z.push(`<${$.toLowerCase()}${X?` ${X}`:""}>`)}return Z}async function N0(J,Z,Q,$,Y){let X=J.themeConfig,z="",W="",q=X?.editLink?.pattern;if(q&&Y&&Z.editLink!==!1){let O=VQ(q,$,Y),N=X?.editLink?.text??"Edit this page";z=`<a class="BPDocFooter-edit" href="${F(O)}" target="_blank" rel="noopener"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>${F(N)}</a>`}let V=X?.lastUpdated,K=Z.lastUpdated!==!1,_=V!==void 0&&V!==!1,G=typeof Z.lastUpdated==="string"?Z.lastUpdated:void 0;if(K&&(_||Z.lastUpdated===!0||G)){let O=G??(Y?await KQ($,Y):null);if(O){let N=typeof V==="object"?V:{},E=GQ(O,Q,N.formatOptions);if(E){let B=N.text??"Last updated";W=`<p class="BPDocFooter-updated">${F(B)}: <time datetime="${F(O)}">${F(E)}</time></p>`}}}if(!z&&!W)return"";return H("doc-footer",{editLink:z,lastUpdated:W})}async function vQ(J,Z,Q,$="doc",Y={},X={}){let{i18n:z,locale:W,sourceFile:q,docsDir:V=Z.docsDir||"./docs"}=X,K=z??await gJ(uJ(Z),Z),_=W||K.defaultLocale,G=gQ(Z,K,_),O=(w)=>K.translate(w,_),N=G.title||G.themeConfig?.siteTitle||G.markdown?.title||"BunPress Documentation",E=j0(Y,J,N,G),B=E.documentTitle,M=E.description,D=G.theme||"vitepress",I=yQ(D),T=WQ(),R=fQ.markdown?.css||"",U=G.markdown?.css||"",j=U&&U!==R?U:"",L=O0(G),k=K0(G,Q,E.canonical),v=V0(E.pageTitle,M,G,Q,E.image),u=G0(E.pageTitle,M,G,E.image),d=_0(E.pageTitle,M,G,Q),cJ=Object.entries(G.markdown?.meta||{}).filter(([w])=>!w.startsWith("og:")&&!w.startsWith("twitter:")&&w!=="description"&&w!=="ogImage"&&w!=="twitterCard"&&w!=="twitterSite"&&w!=="twitterImage").map(([w,C])=>`<meta name="${w}" content="${C}">`).join(`
9854
+ `),{fontLinks:x,fontFaceCss:y}=U0(G),A=hQ(K,G,Q),BJ=WZ(G.head).join(`
9855
+ `),g=[cJ,BJ,k,A,v,u,E.extraTags,x].filter(Boolean).join(`
9856
+ `),FJ=R0(G),MJ=B0(G),IJ=G.markdown?.scripts?.map((w)=>`<script>${w}</script>`).join(`
9857
+ `)||"",QJ=mQ(K),S=[d,FJ,MJ,IJ,QJ?`<script>${QJ}</script>`:""].filter(Boolean).join(`
9858
+ `),b=W0(G,Q),c=G.search??G.markdown?.search,l=c?.enabled!==!1,ZJ=c?.algolia,lJ=c?.provider==="algolia"&&!!ZJ?.appId&&!!ZJ?.apiKey&&!!ZJ?.indexName,f=aQ(G,m(G,jJ));if(!G.search?.placeholder&&!G.markdown?.search?.placeholder)f.placeholder=O("search.placeholder");f.locale=K.enabled?_:null;let DJ=l?await H(lJ?"search-algolia":"search",{placeholder:f.placeholder,runtimeConfig:JSON.stringify(lJ?{...f,algolia:ZJ}:f).replace(/</g,"\\u003c")}):"",h=G.themeConfig?.footer,TJ=h?.message||h?.copyright?await H("footer",{message:h.message?`<p class="BPFooter-message">${h.message}</p>`:"",copyright:h.copyright?`<p class="BPFooter-copyright">${h.copyright}</p>`:""}):"",VZ=K.enabled?await H("locale-switcher",{label:O("nav.menu"),current:fJ(K,_),options:K.locales.map((w)=>{let C=uQ(K,w,RJ(Q)),s=w===_?' aria-current="true"':"";return`<li><a href="${F(C)}" data-locale="${F(w)}"${s}>${F(fJ(K,w))}</a></li>`}).join(`
9859
+ `)}):"",GZ=G.themeConfig?.logo?`<img class="BPNavBarTitle-logo" src="${F(G.themeConfig.logo)}" alt="">`:"",sJ=q0(G,Q),wJ=async(w)=>Y.navbar===!1?"":H("navbar",{title:N,logo:GZ,localeSwitcher:VZ,nav:b,navScreen:w==="doc"?"":sJ,navToggle:w==="doc"||!sJ?"":nZ,searchTrigger:l?eZ(f.placeholder,f.shortcuts):"",hamburger:w==="doc"?aZ:"",socialLinks:Q0(G)}),$J=G.darkMode??G.themeConfig?.darkMode??"auto",YJ=$J===!0||$J==="dark"?"dark":$J===!1||$J==="light"?"light":"auto",LJ=YJ==="dark"?"dark":"";if($==="home"){let w=await bJ(`${J}
9860
+ ${b}`),C=`${y}
9861
+ ${I}
9509
9862
  ${T}
9510
- ${D}
9511
- ${jJ}
9863
+ ${OJ}
9512
9864
  ${w}
9513
- ${E}
9514
- ${O}
9515
- ${L}`,s=await H("layout-home",{htmlClass:wJ,themeMode:YJ,lang:G,title:N,documentTitle:R,description:M,meta:h,customCSS:f,navbar:await DJ("plain"),search:TJ,footer:IJ,content:J});return kJ(SJ(PJ(s,P),p(_)),_)}if($==="page"){let w=await xJ(`${J}
9516
- ${C}`),f=`${y}
9865
+ ${R}
9866
+ ${j}
9867
+ ${L}`,s=`${C}
9868
+ ${zJ(C)}`,AJ=await H("layout-home",{htmlClass:LJ,themeMode:YJ,lang:_,title:N,documentTitle:B,description:M,meta:g,customCSS:s,navbar:await wJ("plain"),search:DJ,footer:TJ,content:J});return CJ(kJ(vJ(xJ(AJ,S)),p(G)),G)}if($==="page"){let w=await bJ(`${J}
9869
+ ${b}`),C=`${y}
9870
+ ${I}
9517
9871
  ${T}
9518
- ${D}
9519
- ${jJ}
9872
+ ${OJ}
9520
9873
  ${w}
9521
- ${E}
9522
- ${O}
9523
- ${L}`,s=await H("layout-page",{htmlClass:wJ,themeMode:YJ,lang:G,title:N,documentTitle:R,description:M,meta:h,customCSS:f,navbar:await DJ("plain"),search:TJ,footer:IJ,content:J});return kJ(SJ(PJ(s,P),p(_)),_)}let cJ=oZ(J),lJ=await iZ(cJ,U("toc.title")),sJ=await gZ(_,Q),rJ=aZ(cJ,await H("copy-page",{}),lJ.inline),zZ=lJ.aside,WZ=await xJ(`${rJ}
9524
- ${C}
9525
- ${sJ}`),KZ=`${y}
9874
+ ${R}
9875
+ ${j}
9876
+ ${L}`,s=`${C}
9877
+ ${zJ(C)}`,AJ=await H("layout-page",{htmlClass:LJ,themeMode:YJ,lang:_,title:N,documentTitle:B,description:M,meta:g,customCSS:s,navbar:await wJ("plain"),search:DJ,footer:TJ,content:J});return CJ(kJ(vJ(xJ(AJ,S)),p(G)),G)}let rJ=$0(J),iJ=await Z0(rJ,O("toc.title")),oJ=await oZ(G,Q),aJ=Y0(rJ,await H("copy-page",{}),iJ.inline),_Z=iJ.aside,UZ=await bJ(`${aJ}
9878
+ ${b}
9879
+ ${oJ}`),nJ=`${y}
9880
+ ${I}
9526
9881
  ${T}
9527
- ${D}
9528
- ${jJ}
9529
- ${WZ}
9530
- ${E}
9531
- ${O}
9532
- ${L}`,VZ=await z0(_,Y,G,V,W),_Z=await H("layout-doc",{htmlClass:wJ,themeMode:YJ,lang:G,title:N,documentTitle:R,description:M,meta:h,customCSS:KZ,navbar:await DJ("doc"),search:TJ,docFooter:VZ,footer:IJ,sidebar:Y.sidebar===!1?"":sJ,content:rJ,pageTOC:zZ});return kJ(SJ(PJ(_Z,P),p(_)),_)}var _J=null,SQ=!1;async function W0(){if(SQ)return _J;SQ=!0;try{_J=await import("@cwcss/crosswind")}catch{_J=null}return _J}async function xJ(J){let Z=await W0();if(!Z)return"";let $=new Z.Scanner([]).scanContent(J);if($.size===0)return"";let Y=new Z.CSSGenerator(Z.defaultConfig);for(let X of $)Y.generate(X);return Y.toCSS(!1,!1)}function K0(J){if(!J.fathom?.enabled||!J.fathom?.siteId)return"";let Z=J.fathom.scriptUrl||"https://cdn.usefathom.com/script.js",Q=J.fathom.defer!==!1,$=J.fathom.honorDNT||!1,Y=J.fathom.auto!==!1,X=J.fathom.canonical,q=J.fathom.spa||!1,z=[`data-site="${J.fathom.siteId}"`,$?'data-honor-dnt="true"':"",!Y?'data-auto="false"':"",X?`data-canonical="${X}"`:"",q?'data-spa="auto"':""].filter(Boolean).join(" ");return`<script src="${Z}" ${z}${Q?" defer":""}></script>`}function V0(J){let Z=J.analytics||J.selfHostedAnalytics;if(!Z?.enabled||!Z?.siteId)return"";let Q=GJ(Z.siteId);if(Z.scriptSrc)return`<script defer src="${GJ(Z.scriptSrc)}" data-site="${Q}"></script>`;let $=Z.apiEndpoint?GJ(Z.apiEndpoint):"",Y=Z.honorDNT?`var dnt=n.doNotTrack||w.doNotTrack||n.msDoNotTrack;if(dnt==="1"||dnt==="yes"||dnt===true){l('DNT enabled, skipping');return;}`:"",X=Z.trackHashChanges?"w.addEventListener('hashchange',function(){pv();});":"",q=Z.trackOutboundLinks?`d.addEventListener('click',function(e){try{var a=e.target.closest('a');if(a&&a.hostname&&a.hostname!==location.hostname){t('outbound',{url:a.href,text:(a.textContent||'').slice(0,100)});}}
9533
- catch (err){l('Outbound error',err);}});`:"",z=$?` data-api="${$}"`:"",W=Z.collectEndpoint?`/${Z.collectEndpoint.replace(/^\/+/,"")}`:"/collect",V=W==="/collect"?"":` data-collect="${GJ(W)}"`;return`<!-- ts-analytics: privacy-first analytics -->
9534
- <script data-site="${Q}"${z}${V} defer>
9882
+ ${OJ}
9883
+ ${UZ}
9884
+ ${R}
9885
+ ${j}
9886
+ ${L}`,OZ=`${nJ}
9887
+ ${zJ(nJ)}`,jZ=await N0(G,Y,_,V,q),NZ=await H("layout-doc",{htmlClass:LJ,themeMode:YJ,lang:_,title:N,documentTitle:B,description:M,meta:g,customCSS:OZ,navbar:await wJ("doc"),search:DJ,docFooter:jZ,footer:TJ,sidebar:Y.sidebar===!1?"":oJ,content:aJ,pageTOC:_Z});return CJ(kJ(vJ(xJ(NZ,S)),p(G)),G)}var _J=null,CQ=!1;async function E0(){if(CQ)return _J;CQ=!0;try{_J=await import("@cwcss/crosswind")}catch{_J=null}return _J}async function bJ(J){let Z=await E0();if(!Z)return"";let $=new Z.Scanner([]).scanContent(J);if($.size===0)return"";let Y=new Z.CSSGenerator(Z.defaultConfig);for(let X of $)Y.generate(X);return Y.toCSS(!1,!1)}function R0(J){if(!J.fathom?.enabled||!J.fathom?.siteId)return"";let Z=J.fathom.scriptUrl||"https://cdn.usefathom.com/script.js",Q=J.fathom.defer!==!1,$=J.fathom.honorDNT||!1,Y=J.fathom.auto!==!1,X=J.fathom.canonical,z=J.fathom.spa||!1,W=[`data-site="${J.fathom.siteId}"`,$?'data-honor-dnt="true"':"",!Y?'data-auto="false"':"",X?`data-canonical="${X}"`:"",z?'data-spa="auto"':""].filter(Boolean).join(" ");return`<script src="${Z}" ${W}${Q?" defer":""}></script>`}function B0(J){let Z=J.analytics||J.selfHostedAnalytics;if(!Z?.enabled||!Z?.siteId)return"";let Q=UJ(Z.siteId);if(Z.scriptSrc)return`<script defer src="${UJ(Z.scriptSrc)}" data-site="${Q}"></script>`;let $=Z.apiEndpoint?UJ(Z.apiEndpoint):"",Y=Z.honorDNT?`var dnt=n.doNotTrack||w.doNotTrack||n.msDoNotTrack;if(dnt==="1"||dnt==="yes"||dnt===true){l('DNT enabled, skipping');return;}`:"",X=Z.trackHashChanges?"w.addEventListener('hashchange',function(){pv();});":"",z=Z.trackOutboundLinks?`d.addEventListener('click',function(e){try{var a=e.target.closest('a');if(a&&a.hostname&&a.hostname!==location.hostname){t('outbound',{url:a.href,text:(a.textContent||'').slice(0,100)});}}
9888
+ catch (err){l('Outbound error',err);}});`:"",W=$?` data-api="${$}"`:"",q=Z.collectEndpoint?`/${Z.collectEndpoint.replace(/^\/+/,"")}`:"/collect",V=q==="/collect"?"":` data-collect="${UJ(q)}"`;return`<!-- ts-analytics: privacy-first analytics -->
9889
+ <script data-site="${Q}"${W}${V} defer>
9535
9890
  (function(){
9536
9891
  'use strict';
9537
9892
  var d=document,w=window,n=navigator,ss=w.sessionStorage,s=d.currentScript;
@@ -9579,7 +9934,7 @@ catch(err){l('Track error',err);}
9579
9934
  }
9580
9935
  var pvSent={};function pv(){var p=location.pathname;if(pvSent[p]&&Date.now()-pvSent[p]<1000)return;pvSent[p]=Date.now();l('Pageview',p);t('pageview',{path:p});}
9581
9936
  ${X}
9582
- ${q}
9937
+ ${z}
9583
9938
  var hp=history.pushState;if(hp){history.pushState=function(){hp.apply(history,arguments);pv();};}
9584
9939
  var hr=history.replaceState;if(hr){history.replaceState=function(){hr.apply(history,arguments);};}
9585
9940
  w.addEventListener('popstate',pv);
@@ -9593,69 +9948,69 @@ l('Initialized',site);
9593
9948
  }
9594
9949
  catch(err){if(w.console)console.error('[Analytics] Init error:',err);}
9595
9950
  })();
9596
- </script>`}function GJ(J){return J.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function _0(J){let Z=J.replace(/\r\n/g,`
9597
- `),Q=/^---\n([\s\S]*?)\n---\n?/,$=Z.match(Q);if(!$)return{frontmatter:{},content:Z};let Y=$[1],X=Z.slice($[0].length);try{return{frontmatter:LQ.parse(Y),content:X}}catch{try{let q=Y.replace(/^(\s*\w+:\s*)"(.+)",\s*(.+)$/gm,`$1'"$2," $3'`);return{frontmatter:LQ.parse(q),content:X}}catch(q){return console.error("Failed to parse frontmatter YAML:",q),{frontmatter:{},content:J}}}}async function G0(J){if(!J)return"";let Z=J.name?`<p class="BPHero-name">${J.name}</p>`:"",Q=J.text?`<h1 class="BPHero-text">${J.text}</h1>`:"",$=J.tagline?`<p class="BPHero-tagline">${J.tagline}</p>`:"",Y="";if(J.actions)Y=`<div class="BPHero-actions">${J.actions.map((V)=>{return`<a class="${V.theme==="brand"?"BPButton BPButton-brand":"BPButton BPButton-alt"}" href="${V.link}">${V.text}</a>`}).join(`
9951
+ </script>`}function UJ(J){return J.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function F0(J){let Z=J.replace(/\r\n/g,`
9952
+ `),Q=/^---\n([\s\S]*?)\n---\n?/,$=Z.match(Q);if(!$)return{frontmatter:{},content:Z};let Y=$[1],X=Z.slice($[0].length);try{return{frontmatter:SQ.parse(Y),content:X}}catch{try{let z=Y.replace(/^(\s*\w+:\s*)"(.+)",\s*(.+)$/gm,`$1'"$2," $3'`);return{frontmatter:SQ.parse(z),content:X}}catch(z){return console.error("Failed to parse frontmatter YAML:",z),{frontmatter:{},content:J}}}}async function M0(J){if(!J)return"";let Z=J.name?`<p class="BPHero-name">${J.name}</p>`:"",Q=J.text?`<h1 class="BPHero-text">${J.text}</h1>`:"",$=J.tagline?`<p class="BPHero-tagline">${J.tagline}</p>`:"",Y="";if(J.actions)Y=`<div class="BPHero-actions">${J.actions.map((V)=>{return`<a class="${V.theme==="brand"?"BPButton BPButton-brand":"BPButton BPButton-alt"}" href="${V.link}">${V.text}</a>`}).join(`
9598
9953
  `)}</div>`;let X=J.announcement?`<a class="BPHero-announcement" href="${F(J.announcement.link||"#")}">
9599
9954
  ${J.announcement.tag?`<span class="BPHero-announcement-tag">${J.announcement.tag}</span>`:""}
9600
9955
  <span class="BPHero-announcement-text">${J.announcement.text||""}</span>
9601
9956
  <svg class="BPHero-announcement-arrow" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>
9602
- </a>`:"",q=J.image?`<div class="hero-image"><img src="${F(J.image)}" alt="${F(J.name||"")}" /></div>`:"",z=(J.code?await j0(J.code):"")||q;return await H("hero",{announcement:X,name:Z,text:Q,tagline:$,actions:Y,image:z})}async function j0(J){let Q=(Array.isArray(J)?J:[J]).filter((X)=>typeof X?.content==="string"&&X.content.trim());if(Q.length===0)return"";let $=await Promise.all(Q.map(async(X,q)=>{let z=X.lang||"ts",W=await WJ(X.content.replace(/\n+$/,""),z);return`<div class="BPHeroCode-panel" data-index="${q}"${q===0?"":" hidden"}>
9603
- <pre data-lang="${F(z)}"><code class="language-${F(z)}">${W}</code></pre>
9957
+ </a>`:"",z=J.image?`<div class="hero-image"><img src="${F(J.image)}" alt="${F(J.name||"")}" /></div>`:"",W=(J.code?await I0(J.code):"")||z;return await H("hero",{announcement:X,name:Z,text:Q,tagline:$,actions:Y,image:W})}async function I0(J){let Q=(Array.isArray(J)?J:[J]).filter((X)=>typeof X?.content==="string"&&X.content.trim());if(Q.length===0)return"";let $=await Promise.all(Q.map(async(X,z)=>{let W=X.lang||"ts",q=await KJ(X.content.replace(/\n+$/,""),W);return`<div class="BPHeroCode-panel" data-index="${z}"${z===0?"":" hidden"}>
9958
+ <pre data-lang="${F(W)}"><code class="language-${F(W)}">${q}</code></pre>
9604
9959
  </div>`}));return`<div class="BPHeroCode">
9605
- <div class="BPHeroCode-head">${Q.length>1?`<div class="BPHeroCode-tabs" role="tablist">${Q.map((X,q)=>`<button class="BPHeroCode-tab${q===0?" is-active":""}" type="button" role="tab" aria-selected="${q===0}" onclick="switchHeroCodeTab(this, ${q})">${X.file||X.lang||`Example ${q+1}`}</button>`).join("")}</div>`:Q[0].file?`<span class="BPHeroCode-file">${Q[0].file}</span>`:""}</div>
9960
+ <div class="BPHeroCode-head">${Q.length>1?`<div class="BPHeroCode-tabs" role="tablist">${Q.map((X,z)=>`<button class="BPHeroCode-tab${z===0?" is-active":""}" type="button" role="tab" aria-selected="${z===0}" onclick="switchHeroCodeTab(this, ${z})">${X.file||X.lang||`Example ${z+1}`}</button>`).join("")}</div>`:Q[0].file?`<span class="BPHeroCode-file">${Q[0].file}</span>`:""}</div>
9606
9961
  <div class="BPHeroCode-body">${$.join("")}</div>
9607
- </div>`}var U0={Fast:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>',Shield:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',Blade:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Tools:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Components:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>',Stream:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 12h6l3-9 3 18 3-9h5"/></svg>',Desktop:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8m-4-4v4"/></svg>',Parser:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M16 18l6-6-6-6M8 6l-6 6 6 6"/></svg>',Icons:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></svg>'};function O0(J){if(J.startsWith("<")||/\p{Emoji}/u.test(J))return J;return U0[J]||`<span class="BPFeature-icon-text">${J.charAt(0)}</span>`}async function N0(J){if(!J||J.length===0)return"";let Z=J.map((Q)=>{let $=Q.icon?O0(Q.icon):"",Y=$?`<div class="BPFeature-icon">${$}</div>`:"",X=Q.link,q=X?"a":"div",z=X?` href="${F(X)}"`:"",W=Number(Q.span)>1?` style="--bp-feature-span:${Math.min(Math.trunc(Number(Q.span)),3)}"`:"",V=X?" is-linked":"",K=X?`<span class="BPFeature-link">${Q.linkText||"Learn more"}<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></span>`:"";return`
9608
- <${q} class="BPFeature${V}"${z}${W}>
9962
+ </div>`}var D0={Fast:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>',Shield:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',Blade:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Tools:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Components:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>',Stream:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 12h6l3-9 3 18 3-9h5"/></svg>',Desktop:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8m-4-4v4"/></svg>',Parser:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M16 18l6-6-6-6M8 6l-6 6 6 6"/></svg>',Icons:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></svg>'};function T0(J){if(J.startsWith("<")||/\p{Emoji}/u.test(J))return J;return D0[J]||`<span class="BPFeature-icon-text">${J.charAt(0)}</span>`}async function w0(J){if(!J||J.length===0)return"";let Z=J.map((Q)=>{let $=Q.icon?T0(Q.icon):"",Y=$?`<div class="BPFeature-icon">${$}</div>`:"",X=Q.link,z=X?"a":"div",W=X?` href="${F(X)}"`:"",q=Number(Q.span)>1?` style="--bp-feature-span:${Math.min(Math.trunc(Number(Q.span)),3)}"`:"",V=X?" is-linked":"",K=X?`<span class="BPFeature-link">${Q.linkText||"Learn more"}<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></span>`:"";return`
9963
+ <${z} class="BPFeature${V}"${W}${q}>
9609
9964
  ${Y}
9610
- <h3 class="BPFeature-title">${Q.title||""}</h3>
9965
+ <h2 class="BPFeature-title">${Q.title||""}</h2>
9611
9966
  <p class="BPFeature-details">${Q.details||""}</p>
9612
9967
  ${K}
9613
- </${q}>`}).join("");return await H("features",{items:Z})}function B0(J){let Z={smile:"\uD83D\uDE04",laughing:"\uD83D\uDE06",blush:"\uD83D\uDE0A",heart_eyes:"\uD83D\uDE0D",kissing_heart:"\uD83D\uDE18",relaxed:"\u263A\uFE0F",wink:"\uD83D\uDE09",grin:"\uD83D\uDE01",joy:"\uD83D\uDE02",sweat_smile:"\uD83D\uDE05",rofl:"\uD83E\uDD23",thinking:"\uD83E\uDD14",zipper_mouth:"\uD83E\uDD10",neutral_face:"\uD83D\uDE10",expressionless:"\uD83D\uDE11",confused:"\uD83D\uDE15",worried:"\uD83D\uDE1F",slightly_frowning_face:"\uD83D\uDE41",frowning_face:"\u2639\uFE0F",persevere:"\uD83D\uDE23",disappointed:"\uD83D\uDE1E",sweat:"\uD83D\uDE13",tired_face:"\uD83D\uDE2B",cry:"\uD83D\uDE22",sob:"\uD83D\uDE2D",triumph:"\uD83D\uDE24",angry:"\uD83D\uDE20",rage:"\uD83D\uDE21",no_mouth:"\uD83D\uDE36",sleeping:"\uD83D\uDE34","+1":"\uD83D\uDC4D",thumbsup:"\uD83D\uDC4D","-1":"\uD83D\uDC4E",thumbsdown:"\uD83D\uDC4E",clap:"\uD83D\uDC4F",raised_hands:"\uD83D\uDE4C",pray:"\uD83D\uDE4F",wave:"\uD83D\uDC4B",ok_hand:"\uD83D\uDC4C",point_up:"\u261D\uFE0F",point_down:"\uD83D\uDC47",point_left:"\uD83D\uDC48",point_right:"\uD83D\uDC49",muscle:"\uD83D\uDCAA",heart:"\u2764\uFE0F",blue_heart:"\uD83D\uDC99",green_heart:"\uD83D\uDC9A",yellow_heart:"\uD83D\uDC9B",purple_heart:"\uD83D\uDC9C",broken_heart:"\uD83D\uDC94",sparkling_heart:"\uD83D\uDC96",star:"\u2B50",star2:"\uD83C\uDF1F",sparkles:"\u2728",boom:"\uD83D\uDCA5",fire:"\uD83D\uDD25",tada:"\uD83C\uDF89",confetti_ball:"\uD83C\uDF8A",rocket:"\uD83D\uDE80",zap:"\u26A1",bulb:"\uD83D\uDCA1",bell:"\uD83D\uDD14",mega:"\uD83D\uDCE3",loudspeaker:"\uD83D\uDCE2",warning:"\u26A0\uFE0F",white_check_mark:"\u2705",check:"\u2705",x:"\u274C",heavy_check_mark:"\u2714\uFE0F",heavy_multiplication_x:"\u2716\uFE0F",question:"\u2753",grey_question:"\u2754",exclamation:"\u2757",grey_exclamation:"\u2755",heavy_plus_sign:"\u2795",heavy_minus_sign:"\u2796",pencil2:"\u270F\uFE0F",memo:"\uD83D\uDCDD",book:"\uD83D\uDCD6",books:"\uD83D\uDCDA",bookmark:"\uD83D\uDD16",mag:"\uD83D\uDD0D",mag_right:"\uD83D\uDD0E",lock:"\uD83D\uDD12",unlock:"\uD83D\uDD13",key:"\uD83D\uDD11",link:"\uD83D\uDD17",computer:"\uD83D\uDCBB",email:"\uD83D\uDCE7",inbox_tray:"\uD83D\uDCE5",outbox_tray:"\uD83D\uDCE4",package:"\uD83D\uDCE6",file_folder:"\uD83D\uDCC1",open_file_folder:"\uD83D\uDCC2",page_facing_up:"\uD83D\uDCC4",calendar:"\uD83D\uDCC5",chart_with_upwards_trend:"\uD83D\uDCC8",chart_with_downwards_trend:"\uD83D\uDCC9",bar_chart:"\uD83D\uDCCA",clipboard:"\uD83D\uDCCB",pushpin:"\uD83D\uDCCC",round_pushpin:"\uD83D\uDCCD",paperclip:"\uD83D\uDCCE",straight_ruler:"\uD83D\uDCCF",wrench:"\uD83D\uDD27",hammer:"\uD83D\uDD28",gear:"\u2699\uFE0F",nut_and_bolt:"\uD83D\uDD29",seedling:"\uD83C\uDF31",evergreen_tree:"\uD83C\uDF32",deciduous_tree:"\uD83C\uDF33",palm_tree:"\uD83C\uDF34",cactus:"\uD83C\uDF35",herb:"\uD83C\uDF3F",shamrock:"\u2618\uFE0F",four_leaf_clover:"\uD83C\uDF40",bug:"\uD83D\uDC1B",bee:"\uD83D\uDC1D",bird:"\uD83D\uDC26",dog:"\uD83D\uDC36",cat:"\uD83D\uDC31",penguin:"\uD83D\uDC27",turtle:"\uD83D\uDC22",fish:"\uD83D\uDC1F",coffee:"\u2615",tea:"\uD83C\uDF75",beer:"\uD83C\uDF7A",beers:"\uD83C\uDF7B",wine_glass:"\uD83C\uDF77",pizza:"\uD83C\uDF55",hamburger:"\uD83C\uDF54",fries:"\uD83C\uDF5F",cake:"\uD83C\uDF70",birthday:"\uD83C\uDF82",cookie:"\uD83C\uDF6A",doughnut:"\uD83C\uDF69",apple:"\uD83C\uDF4E",green_apple:"\uD83C\uDF4F",banana:"\uD83C\uDF4C",strawberry:"\uD83C\uDF53",house:"\uD83C\uDFE0",office:"\uD83C\uDFE2",hospital:"\uD83C\uDFE5",school:"\uD83C\uDFEB",car:"\uD83D\uDE97",taxi:"\uD83D\uDE95",bus:"\uD83D\uDE8C",train:"\uD83D\uDE82",airplane:"\u2708\uFE0F",ship:"\uD83D\uDEA2",bike:"\uD83D\uDEB2",soccer:"\u26BD",basketball:"\uD83C\uDFC0",football:"\uD83C\uDFC8",baseball:"\u26BE",tennis:"\uD83C\uDFBE",trophy:"\uD83C\uDFC6",medal:"\uD83C\uDFC5",dart:"\uD83C\uDFAF",game_die:"\uD83C\uDFB2",musical_note:"\uD83C\uDFB5",notes:"\uD83C\uDFB6",art:"\uD83C\uDFA8",camera:"\uD83D\uDCF7",movie_camera:"\uD83C\uDFA5",checkered_flag:"\uD83C\uDFC1",triangular_flag_on_post:"\uD83D\uDEA9",flag_us:"\uD83C\uDDFA\uD83C\uDDF8",flag_gb:"\uD83C\uDDEC\uD83C\uDDE7",flag_fr:"\uD83C\uDDEB\uD83C\uDDF7",flag_de:"\uD83C\uDDE9\uD83C\uDDEA",flag_jp:"\uD83C\uDDEF\uD83C\uDDF5",flag_cn:"\uD83C\uDDE8\uD83C\uDDF3"};return J.replace(/:(\w+):/g,(Q,$)=>{return Z[$]||Q})}function E0(J){let Z=/<Badge([^/>]+)\/>/gi;return J.replace(Z,(Q,$)=>{let Y=$.match(/type="(info|tip|warning|danger)"/i),X=$.match(/text="([^"]+)"/),q=Y?Y[1].toLowerCase():"info",z=X?X[1]:"";return`<span class="badge badge-${q}">${z}</span>`})}function R0(J,Z=!0,Q=!0){return J.replace(/<a\s+href="([^"]+)"([^>]*)>/g,($,Y,X)=>{if(X.includes("target="))return $;if(Y.startsWith("http://")||Y.startsWith("https://"))return`<a href="${Y}"${Z?' target="_blank"':""}${Q?' rel="noreferrer noopener"':""}${X}>`;return $})}function F0(J){return J.replace(/<a\s+href="([^"]+)"\s+target="_blank"[^>]*>[\s\S]+?<\/a>/g,(Z,Q)=>{if(Z.includes("external-link-icon"))return Z;let $='<svg class="external-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>';return Z.replace("</a>",`${$}</a>`)})}function M0(J){return J.replace(/<img([^>]+)>/g,(Z,Q)=>{if(Q.includes("loading="))return Z;return`<img ${Q} loading="lazy" decoding="async">`})}function T0(J,Z){if(!J.includes("[[toc]]"))return{content:J,tocHtml:null};let Q=gQ(J),$={...uQ,...Z},Y=dQ(Q,$),q={items:mQ(Y),title:$.title||"Table of Contents",config:$},z=cQ(q),W="<!--INLINE_TOC_PLACEHOLDER-->";return{content:J.replace(/\[\[toc\]\]/g,W),tocHtml:z}}function I0(J,Z){return J.replace(/<!--INLINE_TOC_PLACEHOLDER-->/g,Z)}function $Z(J){let Z=J.replace(/\s+$/,"").split(`
9968
+ </${z}>`}).join("");return await H("features",{items:Z})}function L0(J){let Z={smile:"\uD83D\uDE04",laughing:"\uD83D\uDE06",blush:"\uD83D\uDE0A",heart_eyes:"\uD83D\uDE0D",kissing_heart:"\uD83D\uDE18",relaxed:"\u263A\uFE0F",wink:"\uD83D\uDE09",grin:"\uD83D\uDE01",joy:"\uD83D\uDE02",sweat_smile:"\uD83D\uDE05",rofl:"\uD83E\uDD23",thinking:"\uD83E\uDD14",zipper_mouth:"\uD83E\uDD10",neutral_face:"\uD83D\uDE10",expressionless:"\uD83D\uDE11",confused:"\uD83D\uDE15",worried:"\uD83D\uDE1F",slightly_frowning_face:"\uD83D\uDE41",frowning_face:"\u2639\uFE0F",persevere:"\uD83D\uDE23",disappointed:"\uD83D\uDE1E",sweat:"\uD83D\uDE13",tired_face:"\uD83D\uDE2B",cry:"\uD83D\uDE22",sob:"\uD83D\uDE2D",triumph:"\uD83D\uDE24",angry:"\uD83D\uDE20",rage:"\uD83D\uDE21",no_mouth:"\uD83D\uDE36",sleeping:"\uD83D\uDE34","+1":"\uD83D\uDC4D",thumbsup:"\uD83D\uDC4D","-1":"\uD83D\uDC4E",thumbsdown:"\uD83D\uDC4E",clap:"\uD83D\uDC4F",raised_hands:"\uD83D\uDE4C",pray:"\uD83D\uDE4F",wave:"\uD83D\uDC4B",ok_hand:"\uD83D\uDC4C",point_up:"\u261D\uFE0F",point_down:"\uD83D\uDC47",point_left:"\uD83D\uDC48",point_right:"\uD83D\uDC49",muscle:"\uD83D\uDCAA",heart:"\u2764\uFE0F",blue_heart:"\uD83D\uDC99",green_heart:"\uD83D\uDC9A",yellow_heart:"\uD83D\uDC9B",purple_heart:"\uD83D\uDC9C",broken_heart:"\uD83D\uDC94",sparkling_heart:"\uD83D\uDC96",star:"\u2B50",star2:"\uD83C\uDF1F",sparkles:"\u2728",boom:"\uD83D\uDCA5",fire:"\uD83D\uDD25",tada:"\uD83C\uDF89",confetti_ball:"\uD83C\uDF8A",rocket:"\uD83D\uDE80",zap:"\u26A1",bulb:"\uD83D\uDCA1",bell:"\uD83D\uDD14",mega:"\uD83D\uDCE3",loudspeaker:"\uD83D\uDCE2",warning:"\u26A0\uFE0F",white_check_mark:"\u2705",check:"\u2705",x:"\u274C",heavy_check_mark:"\u2714\uFE0F",heavy_multiplication_x:"\u2716\uFE0F",question:"\u2753",grey_question:"\u2754",exclamation:"\u2757",grey_exclamation:"\u2755",heavy_plus_sign:"\u2795",heavy_minus_sign:"\u2796",pencil2:"\u270F\uFE0F",memo:"\uD83D\uDCDD",book:"\uD83D\uDCD6",books:"\uD83D\uDCDA",bookmark:"\uD83D\uDD16",mag:"\uD83D\uDD0D",mag_right:"\uD83D\uDD0E",lock:"\uD83D\uDD12",unlock:"\uD83D\uDD13",key:"\uD83D\uDD11",link:"\uD83D\uDD17",computer:"\uD83D\uDCBB",email:"\uD83D\uDCE7",inbox_tray:"\uD83D\uDCE5",outbox_tray:"\uD83D\uDCE4",package:"\uD83D\uDCE6",file_folder:"\uD83D\uDCC1",open_file_folder:"\uD83D\uDCC2",page_facing_up:"\uD83D\uDCC4",calendar:"\uD83D\uDCC5",chart_with_upwards_trend:"\uD83D\uDCC8",chart_with_downwards_trend:"\uD83D\uDCC9",bar_chart:"\uD83D\uDCCA",clipboard:"\uD83D\uDCCB",pushpin:"\uD83D\uDCCC",round_pushpin:"\uD83D\uDCCD",paperclip:"\uD83D\uDCCE",straight_ruler:"\uD83D\uDCCF",wrench:"\uD83D\uDD27",hammer:"\uD83D\uDD28",gear:"\u2699\uFE0F",nut_and_bolt:"\uD83D\uDD29",seedling:"\uD83C\uDF31",evergreen_tree:"\uD83C\uDF32",deciduous_tree:"\uD83C\uDF33",palm_tree:"\uD83C\uDF34",cactus:"\uD83C\uDF35",herb:"\uD83C\uDF3F",shamrock:"\u2618\uFE0F",four_leaf_clover:"\uD83C\uDF40",bug:"\uD83D\uDC1B",bee:"\uD83D\uDC1D",bird:"\uD83D\uDC26",dog:"\uD83D\uDC36",cat:"\uD83D\uDC31",penguin:"\uD83D\uDC27",turtle:"\uD83D\uDC22",fish:"\uD83D\uDC1F",coffee:"\u2615",tea:"\uD83C\uDF75",beer:"\uD83C\uDF7A",beers:"\uD83C\uDF7B",wine_glass:"\uD83C\uDF77",pizza:"\uD83C\uDF55",hamburger:"\uD83C\uDF54",fries:"\uD83C\uDF5F",cake:"\uD83C\uDF70",birthday:"\uD83C\uDF82",cookie:"\uD83C\uDF6A",doughnut:"\uD83C\uDF69",apple:"\uD83C\uDF4E",green_apple:"\uD83C\uDF4F",banana:"\uD83C\uDF4C",strawberry:"\uD83C\uDF53",house:"\uD83C\uDFE0",office:"\uD83C\uDFE2",hospital:"\uD83C\uDFE5",school:"\uD83C\uDFEB",car:"\uD83D\uDE97",taxi:"\uD83D\uDE95",bus:"\uD83D\uDE8C",train:"\uD83D\uDE82",airplane:"\u2708\uFE0F",ship:"\uD83D\uDEA2",bike:"\uD83D\uDEB2",soccer:"\u26BD",basketball:"\uD83C\uDFC0",football:"\uD83C\uDFC8",baseball:"\u26BE",tennis:"\uD83C\uDFBE",trophy:"\uD83C\uDFC6",medal:"\uD83C\uDFC5",dart:"\uD83C\uDFAF",game_die:"\uD83C\uDFB2",musical_note:"\uD83C\uDFB5",notes:"\uD83C\uDFB6",art:"\uD83C\uDFA8",camera:"\uD83D\uDCF7",movie_camera:"\uD83C\uDFA5",checkered_flag:"\uD83C\uDFC1",triangular_flag_on_post:"\uD83D\uDEA9",flag_us:"\uD83C\uDDFA\uD83C\uDDF8",flag_gb:"\uD83C\uDDEC\uD83C\uDDE7",flag_fr:"\uD83C\uDDEB\uD83C\uDDF7",flag_de:"\uD83C\uDDE9\uD83C\uDDEA",flag_jp:"\uD83C\uDDEF\uD83C\uDDF5",flag_cn:"\uD83C\uDDE8\uD83C\uDDF3"};return J.replace(/:(\w+):/g,(Q,$)=>{return Z[$]||Q})}function A0(J){let Z=/<Badge([^/>]+)\/>/gi;return J.replace(Z,(Q,$)=>{let Y=$.match(/type="(info|tip|warning|danger)"/i),X=$.match(/text="([^"]+)"/),z=Y?Y[1].toLowerCase():"info",W=X?X[1]:"";return`<span class="badge badge-${z}">${W}</span>`})}function H0(J,Z=!0,Q=!0){return J.replace(/<a\s+href="([^"]+)"([^>]*)>/g,($,Y,X)=>{if(X.includes("target="))return $;if(Y.startsWith("http://")||Y.startsWith("https://"))return`<a href="${Y}"${Z?' target="_blank"':""}${Q?' rel="noreferrer noopener"':""}${X}>`;return $})}function y0(J){return J.replace(/<a\s+href="([^"]+)"\s+target="_blank"[^>]*>[\s\S]+?<\/a>/g,(Z,Q)=>{if(Z.includes("external-link-icon"))return Z;let $='<svg class="external-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>';return Z.replace("</a>",`${$}</a>`)})}function P0(J){return J.replace(/<img([^>]+)>/g,(Z,Q)=>{if(Q.includes("loading="))return Z;return`<img ${Q} loading="lazy" decoding="async">`})}function S0(J,Z){if(!J.includes("[[toc]]"))return{content:J,tocHtml:null};let Q=sQ(J),$={...cQ,...Z},Y=iQ(Q,$),z={items:rQ(Y),title:$.title||"Table of Contents",config:$},W=oQ(z),q="<!--INLINE_TOC_PLACEHOLDER-->";return{content:J.replace(/\[\[toc\]\]/g,q),tocHtml:W}}function k0(J,Z){return J.replace(/<!--INLINE_TOC_PLACEHOLDER-->/g,Z)}function qZ(J){let Z=J.replace(/\s+$/,"").split(`
9614
9969
  `),Q=Z.filter((X)=>X.trim()).map((X)=>X.match(/^[ \t]*/)[0].length),$=Q.length>0?Math.min(...Q):0,Y=Z.map((X)=>X.slice($)).join(`
9615
9970
  `).trim();return Y?`
9616
9971
 
9617
9972
  ${Y}
9618
9973
 
9619
- `:""}async function D0(J){let Z=/^>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n((?:>\s*.*\n?)*)/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,q,z]=Y,W=z.split(`
9620
- `).map((G)=>G.replace(/^>\s?/,"")).join(`
9621
- `),V=q.toLowerCase(),K=await H(`blocks/alerts/${V}`,{content:$Z(W)});$=`${$.slice(0,Y.index)}
9974
+ `:""}async function x0(J){let Z=/^>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n((?:>\s*.*\n?)*)/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,z,W]=Y,q=W.split(`
9975
+ `).map((_)=>_.replace(/^>\s?/,"")).join(`
9976
+ `),V=z.toLowerCase(),K=await H(`blocks/alerts/${V}`,{content:qZ(q)});$=`${$.slice(0,Y.index)}
9622
9977
 
9623
9978
  ${K}
9624
9979
 
9625
- ${$.slice(Y.index+X.length)}`}return $}async function w0(J,Z){let Q=/^<<<\s+@\/([^\s[{#]+)(?:\{(\d+)-(\d+)\}|#(\w+))?\s*(?:\[[^\]]+\]\s*)?$/gm,$=Array.from(J.matchAll(Q)),Y=J;for(let X of $.reverse()){let[q,z,W,V,K]=X;try{let{join:G}=await import("path"),_=G(Z,z),U=Bun.file(_);if(!await U.exists()){console.warn(`Code import: File not found: ${_}`);continue}let B=(await U.text()).split(`
9626
- `),R=z.split(".").pop()||"",I={js:"javascript",ts:"typescript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",yaml:"yaml",yml:"yaml",json:"json",md:"markdown",html:"html",css:"css",scss:"scss",vue:"vue"}[R]||R;if(W&&V){let E=Number.parseInt(W)-1,j=Number.parseInt(V);B=B.slice(E,j)}else if(K){let E=B.findIndex((O)=>O.includes(`#region ${K}`)||O.includes(`// region ${K}`)||O.includes(`# region ${K}`)),j=B.findIndex((O,L)=>L>E&&(O.includes("#endregion")||O.includes("// endregion")||O.includes("# endregion")));if(E!==-1&&j!==-1)B=B.slice(E+1,j);else console.warn(`Code import: Region '${K}' not found in ${z}`)}let T=B.join(`
9627
- `),D=`\`\`\`${I}
9628
- ${T}
9629
- \`\`\``;Y=Y.slice(0,X.index)+D+Y.slice(X.index+q.length)}catch(G){console.error(`Error importing code from ${z}:`,G)}}return Y}async function YZ(J,Z,Q=new Set,$,Y){let X=/<!--@include:\s*([^\s{]+)(?:\{(\d+)-(\d+)\}|\{#([\w-]+)\})?\s*-->/g,q=Array.from(J.matchAll(X)),z=J;for(let W of q.reverse()){let[V,K,G,_,U]=W;try{if($){let j=J.slice(0,W.index),O=J.slice(W.index+V.length);if(!/(?:^|\n) {0,3}$/.test(j)||!/^[ \t]*(?:\r?\n|$)/.test(O))throw Error("Source-aware Markdown includes must be on their own line")}let{join:N,resolve:B}=await import("path"),R=B(N(Z,K));if(Q.has(R)){console.warn(`Markdown include: Circular reference detected for ${K}`);continue}let M=Bun.file(R);if(!await M.exists()){console.warn(`Markdown include: File not found: ${R}`);continue}let T=(await M.text()).split(`
9630
- `);if(G&&_){let j=Number.parseInt(G)-1,O=Number.parseInt(_);T=T.slice(j,O)}else if(U){let j=T.findIndex((L)=>L.includes(`<!-- #region ${U} -->`)||L.includes(`<!-- region ${U} -->`)),O=T.findIndex((L,k)=>k>j&&(L.includes("<!-- #endregion -->")||L.includes("<!-- endregion -->")));if(j!==-1&&O!==-1)T=T.slice(j+1,O);else{console.warn(`Markdown include: Region '${U}' not found in ${K}`);continue}}let D=T.join(`
9631
- `),E=new Set(Q);if(E.add(R),D=await e(D,(j)=>YZ(j,Z,E,$,Y)),$&&Y){let j=`bunpress-source-${aQ()}`;Y.set(`${j}:start`,{...$.page,sourceFile:R}),Y.set(`${j}:end`,null),D=`
9632
- <!--${j}:start-->
9980
+ ${$.slice(Y.index+X.length)}`}return $}async function v0(J,Z){let Q=/^<<<\s+@\/([^\s[{#]+)(?:\{(\d+)-(\d+)\}|#(\w+))?\s*(?:\[[^\]]+\]\s*)?$/gm,$=Array.from(J.matchAll(Q)),Y=J;for(let X of $.reverse()){let[z,W,q,V,K]=X;try{let{join:_}=await import("path"),G=_(Z,W),O=Bun.file(G);if(!await O.exists()){console.warn(`Code import: File not found: ${G}`);continue}let E=(await O.text()).split(`
9981
+ `),B=W.split(".").pop()||"",D={js:"javascript",ts:"typescript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",yaml:"yaml",yml:"yaml",json:"json",md:"markdown",html:"html",css:"css",scss:"scss",vue:"vue"}[B]||B;if(q&&V){let R=Number.parseInt(q)-1,U=Number.parseInt(V);E=E.slice(R,U)}else if(K){let R=E.findIndex((j)=>j.includes(`#region ${K}`)||j.includes(`// region ${K}`)||j.includes(`# region ${K}`)),U=E.findIndex((j,L)=>L>R&&(j.includes("#endregion")||j.includes("// endregion")||j.includes("# endregion")));if(R!==-1&&U!==-1)E=E.slice(R+1,U);else console.warn(`Code import: Region '${K}' not found in ${W}`)}let I=E.join(`
9982
+ `),T=`\`\`\`${D}
9983
+ ${I}
9984
+ \`\`\``;Y=Y.slice(0,X.index)+T+Y.slice(X.index+z.length)}catch(_){console.error(`Error importing code from ${W}:`,_)}}return Y}async function KZ(J,Z,Q=new Set,$,Y){let X=/<!--@include:\s*([^\s{]+)(?:\{(\d+)-(\d+)\}|\{#([\w-]+)\})?\s*-->/g,z=Array.from(J.matchAll(X)),W=J;for(let q of z.reverse()){let[V,K,_,G,O]=q;try{if($){let U=J.slice(0,q.index),j=J.slice(q.index+V.length);if(!/(?:^|\n) {0,3}$/.test(U)||!/^[ \t]*(?:\r?\n|$)/.test(j))throw Error("Source-aware Markdown includes must be on their own line")}let{join:N,resolve:E}=await import("path"),B=E(N(Z,K));if(Q.has(B)){console.warn(`Markdown include: Circular reference detected for ${K}`);continue}let M=Bun.file(B);if(!await M.exists()){console.warn(`Markdown include: File not found: ${B}`);continue}let I=(await M.text()).split(`
9985
+ `);if(_&&G){let U=Number.parseInt(_)-1,j=Number.parseInt(G);I=I.slice(U,j)}else if(O){let U=I.findIndex((L)=>L.includes(`<!-- #region ${O} -->`)||L.includes(`<!-- region ${O} -->`)),j=I.findIndex((L,k)=>k>U&&(L.includes("<!-- #endregion -->")||L.includes("<!-- endregion -->")));if(U!==-1&&j!==-1)I=I.slice(U+1,j);else{console.warn(`Markdown include: Region '${O}' not found in ${K}`);continue}}let T=I.join(`
9986
+ `),R=new Set(Q);if(R.add(B),T=await e(T,(U)=>KZ(U,Z,R,$,Y)),$&&Y){let U=`bunpress-source-${QZ()}`;Y.set(`${U}:start`,{...$.page,sourceFile:B}),Y.set(`${U}:end`,null),T=`
9987
+ <!--${U}:start-->
9633
9988
 
9634
- ${D}
9989
+ ${T}
9635
9990
 
9636
- <!--${j}:end-->
9637
- `}z=z.slice(0,W.index)+D+z.slice(W.index+V.length)}catch(N){if($)throw N;console.error(`Error including markdown from ${K}:`,N)}}return z}async function L0(J){let Z=/^:::\s+code-group[ \t]*\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,q]=Y,z=/^```(\w+)[ \t]+\[([^\]]+)\][ \t]*\n((?:(?!^```)[\s\S])*)^```$/gm,W=Array.from(q.matchAll(z));if(W.length===0)continue;let V=new Bun.CryptoHasher("sha256");V.update(`${Y.index}\x00${X}`);let K=`code-group-${V.digest("hex").slice(0,12)}`,G=W.map((N,B)=>{let R=N[2];return`<button class="code-group-tab${B===0?" active":""}" onclick="switchCodeTab('${K}', ${B})">${R}</button>`}).join(""),_=await Promise.all(W.map(async(N,B)=>{let R=N[1],M=N[3],I=B===0,T=S.markdown?.syntaxHighlightTheme||"github-light",D=await WJ(M,R,T),E=`<pre data-lang="${R}"><code class="language-${R}">${D}</code></pre>`;return`<div class="code-group-panel${I?" active":""}" data-panel="${B}">
9638
- ${E}
9639
- </div>`})),U=[`<div class="code-group" id="${K}">`,' <div class="code-group-tabs">',` ${G}`," </div>",' <div class="code-group-panels">',` ${_.join(`
9991
+ <!--${U}:end-->
9992
+ `}W=W.slice(0,q.index)+T+W.slice(q.index+V.length)}catch(N){if($)throw N;console.error(`Error including markdown from ${K}:`,N)}}return W}async function C0(J){let Z=/^:::\s+code-group[ \t]*\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,z]=Y,W=/^```(\w+)[ \t]+\[([^\]]+)\][ \t]*\n((?:(?!^```)[\s\S])*)^```$/gm,q=Array.from(z.matchAll(W));if(q.length===0)continue;let V=new Bun.CryptoHasher("sha256");V.update(`${Y.index}\x00${X}`);let K=`code-group-${V.digest("hex").slice(0,12)}`,_=q.map((N,E)=>{let B=N[2];return`<button class="code-group-tab${E===0?" active":""}" onclick="switchCodeTab('${K}', ${E})">${B}</button>`}).join(""),G=await Promise.all(q.map(async(N,E)=>{let B=N[1],M=N[3],D=E===0,I=P.markdown?.syntaxHighlightTheme||"github-light",T=await KJ(M,B,I),R=`<pre data-lang="${B}"><code class="language-${B}">${T}</code></pre>`;return`<div class="code-group-panel${D?" active":""}" data-panel="${E}">
9993
+ ${R}
9994
+ </div>`})),O=[`<div class="code-group" id="${K}">`,' <div class="code-group-tabs">',` ${_}`," </div>",' <div class="code-group-panels">',` ${G.join(`
9640
9995
  `)}`," </div>","</div>"].join(`
9641
- `);$=$.slice(0,Y.index)+U+$.slice(Y.index+X.length)}return $}async function A0(J){let Z=/^:::\s+(info|tip|warning|danger|details|raw)(?: +([^\n\t ][^\n]*))?\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,q,z,W]=Y,V={info:"INFO",tip:"TIP",warning:"WARNING",danger:"DANGER",details:"Details",raw:""},K=z&&z.trim()||V[q],G=await H(`blocks/containers/${q}`,{title:K,content:$Z(W)});$=`${$.slice(0,Y.index)}
9996
+ `);$=$.slice(0,Y.index)+O+$.slice(Y.index+X.length)}return $}async function b0(J){let Z=/^:::\s+(info|tip|warning|danger|details|raw)(?: +([^\n\t ][^\n]*))?\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,z,W,q]=Y,V={info:"INFO",tip:"TIP",warning:"WARNING",danger:"DANGER",details:"Details",raw:""},K=W&&W.trim()||V[z],_=await H(`blocks/containers/${z}`,{title:K,content:qZ(q)});$=`${$.slice(0,Y.index)}
9642
9997
 
9643
- ${G}
9998
+ ${_}
9644
9999
 
9645
- ${$.slice(Y.index+X.length)}`}return $}function H0(J){let Z=J.match(/^([\w#+.-]+)/),Q=Z?Z[1]:"",$=J.match(/\{([^}]+)\}/),Y=[];if($){let q=$[1].split(",");for(let z of q){let W=z.trim();if(W.includes("-")){let[V,K]=W.split("-").map(Number);for(let G=V;G<=K;G++)Y.push(G)}else Y.push(Number(W))}}let X=J.includes(":line-numbers");return{lang:Q,highlights:Y,showLineNumbers:X}}async function y0(J,Z,Q){let $=J[Z],Y=$.match(/^(`{3,})/),X=Y?Y[1].length:3,q="`".repeat(X),z=$.substring(X).trim(),W=H0(z),V=W.lang,K=Q.lineHighlighting?W.highlights:[],G=Q.lineNumbers?W.showLineNumbers:!1,_=[],U=Z+1;while(U<J.length){let x=J[U];if(x.match(new RegExp(`^\`{${X},}\\s*$`)))break;_.push(x),U++}if(Q.messagePreviews){let x=pQ(V,_.join(`
9646
- `));if(x!==null)return{html:x,endIndex:U}}let N=new Set,B=new Set,R=new Set,M=new Set,I=new Set,T=_.map((x,y)=>{let A=x;if(A.includes("// [!code focus]"))N.add(y),A=A.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(A.includes("// [!code ++]"))B.add(y),A=A.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(A.includes("// [!code --]"))R.add(y),A=A.replace(/\/\/ \[!code --\]/,"").trimEnd();if(A.includes("// [!code error]"))M.add(y),A=A.replace(/\/\/ \[!code error\]/,"").trimEnd();if(A.includes("// [!code warning]"))I.add(y),A=A.replace(/\/\/ \[!code warning\]/,"").trimEnd();return A}),D=N.size>0,E=T.join(`
9647
- `),j=S.markdown?.syntaxHighlightTheme||"github-light",k=(await WJ(E,V,j)).split(`
9648
- `).map((x,y)=>{let A=y+1,EJ=K.includes(A),h=N.has(y),RJ=Q.diffs&&B.has(y),FJ=Q.diffs&&R.has(y),MJ=Q.errorWarningMarkers&&M.has(y),QJ=Q.errorWarningMarkers&&I.has(y),P=["line"];if(EJ)P.push("highlighted");if(h)P.push("focused");if(D&&!h)P.push("dimmed");if(RJ)P.push("diff-add");if(FJ)P.push("diff-remove");if(MJ)P.push("has-error");if(QJ)P.push("has-warning");if(x.startsWith('<span class="line">')){let c=P.join(" "),l=x.replace('<span class="line">',`<span class="${c}">`);if(G)return`<span class="${P.join(" ")}"><span class="line-number">${A}</span>${l.replace(/^<span class="[^"]*">/,"").replace(/<\/span>$/,"")}</span>`;return l}let C=P.length>0?` class="${P.join(" ")}"`:"";if(G)return`<span${C}><span class="line-number">${A}</span>${x}</span>`;return`<span${C}>${x}</span>`}).join(`
9649
- `),v=[];if(G)v.push("line-numbers-mode");if(D)v.push("has-focused-lines");let u=v.length>0?` class="${v.join(" ")}"`:"",d=V?` data-lang="${V}"`:"";return{html:`<pre${u}${d}><code class="language-${V}">${k}</code></pre>`,endIndex:U}}function S0(J){let Z=new Map;return{content:J.replace(/^(#{1,6})\s+(.*?)\s*\{#([\w-]+)\}\s*$/gm,($,Y,X,q)=>{let z=hQ(X),W=Z.get(z)??[];return W.push(q),Z.set(z,W),`${Y} ${X.trim()}`}),customAnchors:Z}}async function P0(J,Z,Q){let $=J.split(`
9650
- `),Y=[],X=0,q=0;while(X<$.length){let z=$[X];if(z.match(/^`{3,}/)){let{html:W,endIndex:V}=await y0($,X,Q),K=`<!--BUNPRESS_CODE_${q++}-->`;Z.set(K,W),Y.push(""),Y.push(K),Y.push(""),X=V+1}else Y.push(z),X++}return Y.join(`
9651
- `)}function k0(J){return J=J.replace(/==(.+?)==/g,"<mark>$1</mark>"),J=J.replace(/\^(.+?)\^/g,"<sup>$1</sup>"),J=J.replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>"),J}function x0(J,Z=!0,Q=!0,$=!0){if(Q||Z){let Y=`${Q?`<div class="table-responsive">
10000
+ ${$.slice(Y.index+X.length)}`}return $}function f0(J){let Z=J.match(/^([\w#+.-]+)/),Q=Z?Z[1]:"",$=J.match(/\{([^}]+)\}/),Y=[];if($){let z=$[1].split(",");for(let W of z){let q=W.trim();if(q.includes("-")){let[V,K]=q.split("-").map(Number);for(let _=V;_<=K;_++)Y.push(_)}else Y.push(Number(q))}}let X=J.includes(":line-numbers");return{lang:Q,highlights:Y,showLineNumbers:X}}async function p0(J,Z,Q){let $=J[Z],Y=$.match(/^(`{3,})/),X=Y?Y[1].length:3,z="`".repeat(X),W=$.substring(X).trim(),q=f0(W),V=q.lang,K=Q.lineHighlighting?q.highlights:[],_=Q.lineNumbers?q.showLineNumbers:!1,G=[],O=Z+1;while(O<J.length){let x=J[O];if(x.match(new RegExp(`^\`{${X},}\\s*$`)))break;G.push(x),O++}if(Q.messagePreviews){let x=dQ(V,G.join(`
10001
+ `));if(x!==null)return{html:x,endIndex:O}}let N=new Set,E=new Set,B=new Set,M=new Set,D=new Set,I=G.map((x,y)=>{let A=x;if(A.includes("// [!code focus]"))N.add(y),A=A.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(A.includes("// [!code ++]"))E.add(y),A=A.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(A.includes("// [!code --]"))B.add(y),A=A.replace(/\/\/ \[!code --\]/,"").trimEnd();if(A.includes("// [!code error]"))M.add(y),A=A.replace(/\/\/ \[!code error\]/,"").trimEnd();if(A.includes("// [!code warning]"))D.add(y),A=A.replace(/\/\/ \[!code warning\]/,"").trimEnd();return A}),T=N.size>0,R=I.join(`
10002
+ `),U=P.markdown?.syntaxHighlightTheme||"github-light",k=(await KJ(R,V,U)).split(`
10003
+ `).map((x,y)=>{let A=y+1,BJ=K.includes(A),g=N.has(y),FJ=Q.diffs&&E.has(y),MJ=Q.diffs&&B.has(y),IJ=Q.errorWarningMarkers&&M.has(y),QJ=Q.errorWarningMarkers&&D.has(y),S=["line"];if(BJ)S.push("highlighted");if(g)S.push("focused");if(T&&!g)S.push("dimmed");if(FJ)S.push("diff-add");if(MJ)S.push("diff-remove");if(IJ)S.push("has-error");if(QJ)S.push("has-warning");if(x.startsWith('<span class="line">')){let c=S.join(" "),l=x.replace('<span class="line">',`<span class="${c}">`);if(_)return`<span class="${S.join(" ")}"><span class="line-number">${A}</span>${l.replace(/^<span class="[^"]*">/,"").replace(/<\/span>$/,"")}</span>`;return l}let b=S.length>0?` class="${S.join(" ")}"`:"";if(_)return`<span${b}><span class="line-number">${A}</span>${x}</span>`;return`<span${b}>${x}</span>`}).join(`
10004
+ `),v=[];if(_)v.push("line-numbers-mode");if(T)v.push("has-focused-lines");let u=v.length>0?` class="${v.join(" ")}"`:"",d=V?` data-lang="${V}"`:"";return{html:`<pre${u}${d}><code class="language-${V}">${k}</code></pre>`,endIndex:O}}function u0(J){let Z=new Map;return{content:J.replace(/^(#{1,6})\s+(.*?)\s*\{#([\w-]+)\}\s*$/gm,($,Y,X,z)=>{let W=lQ(X),q=Z.get(W)??[];return q.push(z),Z.set(W,q),`${Y} ${X.trim()}`}),customAnchors:Z}}async function g0(J,Z,Q){let $=J.split(`
10005
+ `),Y=[],X=0,z=0;while(X<$.length){let W=$[X];if(W.match(/^`{3,}/)){let{html:q,endIndex:V}=await p0($,X,Q),K=`<!--BUNPRESS_CODE_${z++}-->`;Z.set(K,q),Y.push(""),Y.push(K),Y.push(""),X=V+1}else Y.push(W),X++}return Y.join(`
10006
+ `)}function h0(J){return J=J.replace(/==(.+?)==/g,"<mark>$1</mark>"),J=J.replace(/\^(.+?)\^/g,"<sup>$1</sup>"),J=J.replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>"),J}function m0(J,Z=!0,Q=!0,$=!0){if(Q||Z){let Y=`${Q?`<div class="table-responsive">
9652
10007
  `:""}<table${Z?' class="enhanced-table"':""}>`;J=J.replace(/<table>/g,Y),J=J.replace(/<\/table>/g,Q?`</table>
9653
- </div>`:"</table>")}if($)J=J.replace(/<(th|td) align="(left|center|right)">/g,(Y,X,q)=>{return`<${X} style="text-align: ${q}">`}),J=J.replace(/<(th|td)>/g,(Y,X)=>{return`<${X} style="text-align: left">`});return J}function v0(J,Z){let Q=new Set;return J.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,($,Y,X,q)=>{if(X.includes(" id="))return $;let z=q.replace(/<[^>]+>/g,"").trim(),V=Z.get(z)?.shift();if(!V)V=pJ(z);return V=uJ(V,Q),`<h${Y} id="${V}"${X}>${q}</h${Y}>`})}async function C0(J,Z="./docs",Q){let{frontmatter:$,content:Y}=_0(J);if($.layout==="home"){let q=await G0($.hero),z=await N0($.features),W=Y.trim()?await PQ(Y,$,Z,Q):"",V=W?`<div class="BPHome-content"><div class="container bp-doc vp-doc">${W}</div></div>`:"";return{html:q+z+V,frontmatter:$}}return{html:await PQ(Y,$,Z,Q),frontmatter:$}}async function PQ(J,Z,Q,$){let Y=new Map,X=S.markdown?.features,q=(j)=>{if(!X)return!0;let O=X[j];return O===void 0||O===!0||typeof O==="object"&&O!==null},z=(j,O)=>{if(!q(j))return!1;let L=X?.[j];if(typeof L!=="object"||L===null)return!0;return L[O]!==!1},W=q("includes")?await e(J,(j)=>YZ(j,Q,new Set($?[$.page.sourceFile]:[]),$,Y)):J,V={...Z,data:await oJ(Q,S.dataDir),site:{title:S.title||S.markdown?.title||"",description:S.description||S.markdown?.meta?.description||"",themeConfig:S.themeConfig}},K=S.componentsDir?JJ(t.cwd(),S.componentsDir):JJ(Q,".components"),G=new Map,_=S.fallbackComponentsDir;W=await HJ(W,K,V,{fallbackComponentsDir:_?n(_):void 0,rendered:G});let U=W.replace(/```[\s\S]*?```/g,"");if(U.includes("@if")||U.includes("@foreach")||U.includes("@for (")||U.includes("<script server")||U.includes("@include")||/\{\{(?!\{)\s*\w/.test(U))try{let j=await import("@stacksjs/stx/render"),O=[],L=W.replace(/```[\s\S]*?```/g,(k)=>{return O.push(k),`\x00BPSTXCODE${O.length-1}\x00`}).replace(/`[^`\n]*`/g,(k)=>{return O.push(k),`\x00BPSTXCODE${O.length-1}\x00`});W=await j.renderString(L,V,{injectCSS:!1,templateOnly:!0}),W=W.replace(/\u0000BPSTXCODE(\d+)\u0000/g,(k,v)=>O[Number(v)]??"")}catch(j){let O=j instanceof Error?j.message:String(j);throw Error(`Failed to render BunPress stx syntax: ${O}`,{cause:j})}let{content:B,tocHtml:R}=q("inlineToc")?T0(W,Z.toc):{content:W,tocHtml:""};W=q("codeImports")?await e(B,(j)=>w0(j,Q)):B,W=q("codeGroups")?await L0(W):W,W=await e(W,async(j)=>{let O=q("githubAlerts")?await D0(j):j;return O=q("containers")?await A0(O):O,O=q("emoji")?B0(O):O,O=q("badges")?E0(O):O,O});let{content:M,customAnchors:I}=q("customAnchors")?S0(W):{content:W,customAnchors:new Map};W=M;let T=new Map;W=q("codeBlocks")?await P0(W,T,{lineHighlighting:z("codeBlocks","lineHighlighting"),lineNumbers:z("codeBlocks","lineNumbers"),diffs:z("codeBlocks","diffs"),errorWarningMarkers:z("codeBlocks","errorWarningMarkers"),messagePreviews:q("messagePreviews")}):W;let D={tables:!0,strikethrough:!0,tasklists:!0,autolinks:!0,...S.markdown?.parserOptions??{}};if(Y.size){let j=new Set;for(let O=W.indexOf("]:");O!==-1;O=W.indexOf("]:",O+2))for(let L=W.lastIndexOf("[",O-1);L!==-1;L=L===0?-1:W.lastIndexOf("[",L-1)){let k=W.slice(L+1,O);if(j.has(k))continue;if(j.add(k),j.size>256)throw Error("Markdown include reference validation exceeded 256 candidate labels. Split the document or use inline links.");let v=`bunpress-reference-${aQ()}`,u=!1;if(Bun.markdown.render(`[${v}][${k}]
10008
+ </div>`:"</table>")}if($)J=J.replace(/<(th|td) align="(left|center|right)">/g,(Y,X,z)=>{return`<${X} style="text-align: ${z}">`}),J=J.replace(/<(th|td)>/g,(Y,X)=>{return`<${X} style="text-align: left">`});return J}function d0(J,Z){let Q=new Set;return J.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,($,Y,X,z)=>{if(X.includes(" id="))return $;let W=z.replace(/<[^>]+>/g,"").trim(),V=Z.get(W)?.shift();if(!V)V=hJ(W);return V=mJ(V,Q),`<h${Y} id="${V}"${X}>${z}</h${Y}>`})}async function c0(J,Z="./docs",Q){let{frontmatter:$,content:Y}=F0(J);if($.layout==="home"){let z=await M0($.hero),W=await w0($.features),q=Y.trim()?await bQ(Y,$,Z,Q):"",V=q?`<div class="BPHome-content"><div class="container bp-doc vp-doc">${q}</div></div>`:"";return{html:z+W+V,frontmatter:$}}return{html:await bQ(Y,$,Z,Q),frontmatter:$}}async function bQ(J,Z,Q,$){let Y=new Map,X=P.markdown?.features,z=(U)=>{if(!X)return!0;let j=X[U];return j===void 0||j===!0||typeof j==="object"&&j!==null},W=(U,j)=>{if(!z(U))return!1;let L=X?.[U];if(typeof L!=="object"||L===null)return!0;return L[j]!==!1},q=z("includes")?await e(J,(U)=>KZ(U,Q,new Set($?[$.page.sourceFile]:[]),$,Y)):J,V={...Z,data:await eJ(Q,P.dataDir),site:{title:P.title||P.markdown?.title||"",description:P.description||P.markdown?.meta?.description||"",themeConfig:P.themeConfig}},K=P.componentsDir?JJ(t.cwd(),P.componentsDir):JJ(Q,".components"),_=new Map,G=P.fallbackComponentsDir;q=await PJ(q,K,V,{fallbackComponentsDir:G?n(G):void 0,rendered:_});let O=q.replace(/```[\s\S]*?```/g,"");if(O.includes("@if")||O.includes("@foreach")||O.includes("@for (")||O.includes("<script server")||O.includes("@include")||/\{\{(?!\{)\s*\w/.test(O))try{let U=await import("@stacksjs/stx/render"),j=[],L=q.replace(/```[\s\S]*?```/g,(k)=>{return j.push(k),`\x00BPSTXCODE${j.length-1}\x00`}).replace(/`[^`\n]*`/g,(k)=>{return j.push(k),`\x00BPSTXCODE${j.length-1}\x00`});q=await U.renderString(L,V,{injectCSS:!1,templateOnly:!0}),q=q.replace(/\u0000BPSTXCODE(\d+)\u0000/g,(k,v)=>j[Number(v)]??"")}catch(U){let j=U instanceof Error?U.message:String(U);throw Error(`Failed to render BunPress stx syntax: ${j}`,{cause:U})}let{content:E,tocHtml:B}=z("inlineToc")?S0(q,Z.toc):{content:q,tocHtml:""};q=z("codeImports")?await e(E,(U)=>v0(U,Q)):E,q=z("codeGroups")?await C0(q):q,q=await e(q,async(U)=>{let j=z("githubAlerts")?await x0(U):U;return j=z("containers")?await b0(j):j,j=z("emoji")?L0(j):j,j=z("badges")?A0(j):j,j});let{content:M,customAnchors:D}=z("customAnchors")?u0(q):{content:q,customAnchors:new Map};q=M;let I=new Map;q=z("codeBlocks")?await g0(q,I,{lineHighlighting:W("codeBlocks","lineHighlighting"),lineNumbers:W("codeBlocks","lineNumbers"),diffs:W("codeBlocks","diffs"),errorWarningMarkers:W("codeBlocks","errorWarningMarkers"),messagePreviews:z("messagePreviews")}):q;let T={tables:!0,strikethrough:!0,tasklists:!0,autolinks:!0,...P.markdown?.parserOptions??{}};if(Y.size){let U=new Set;for(let j=q.indexOf("]:");j!==-1;j=q.indexOf("]:",j+2))for(let L=q.lastIndexOf("[",j-1);L!==-1;L=L===0?-1:q.lastIndexOf("[",L-1)){let k=q.slice(L+1,j);if(U.has(k))continue;if(U.add(k),U.size>256)throw Error("Markdown include reference validation exceeded 256 candidate labels. Split the document or use inline links.");let v=`bunpress-reference-${QZ()}`,u=!1;if(Bun.markdown.render(`[${v}][${k}]
9654
10009
 
9655
- ${W}`,{link(d){if(d===v)u=!0;return""}},D),u)throw Error("Markdown includes cannot be combined with reference definitions. Use inline links instead.")}}let E=Bun.markdown.html(W,D);if($)E=await oQ(E,$,Y);for(let[j,O]of T)E=E.replace(`<p>${j}</p>`,O),E=E.replace(j,O);if(q("inlineFormatting"))E=k0(E);if(q("tables"))E=x0(E,z("tables","enhancedStyling"),z("tables","responsive"),z("tables","alignment"));if(E=v0(E,I),R)E=I0(E,R);if(q("externalLinks")){if(z("externalLinks","autoTarget")||z("externalLinks","autoRel"))E=R0(E,z("externalLinks","autoTarget"),z("externalLinks","autoRel"));if(z("externalLinks","showIcon"))E=F0(E)}if(q("imageLazyLoading"))E=M0(E);for(let[j,O]of G)E=E.replace(`<p>${j}</p>`,()=>O),E=E.replace(j,()=>O);return E}async function b0(J={}){let Z=J.config||S,Q=J.port??3000,$=J.root||"./docs",Y=await fJ(bJ(Z),Z),X=Bun.serve({port:Q,async fetch(W){let V=new URL(W.url);try{decodeURIComponent(V.pathname)}catch{return new Response("Malformed path",{status:400})}let K=HQ(Z,V.pathname);if(K==="/")K="/index";else if(K.length>1&&K.endsWith("/"))K=K.replace(/\/+$/,"");if(K===UJ.replace(/\.json$/,"")||V.pathname.endsWith(UJ)){let N=await sQ($,Z);return new Response(JSON.stringify(N),{headers:{"Content-Type":"application/json","Cache-Control":"no-store"}})}let G=[".png",".jpg",".jpeg",".gif",".webp",".avif",".svg",".css",".js",".ico",".woff",".woff2",".ttf"];try{let N=decodeURIComponent(HQ(Z,V.pathname));if(!N.split("/").some((B)=>B.startsWith("."))){let B=n($,"public"),R=n(B,`.${N}`);if(R.startsWith(`${B}${AQ}`)){let M=/\.[^/]+$/.test(N)?[R]:[JJ(R,"index.html")];for(let I of M){let T=Bun.file(I);if(await T.exists()&&(await OJ(I)).isFile())return new Response(T)}}if(G.some((M)=>N.endsWith(M))){let M=n($),I=n(M,`.${N}`);if(I.startsWith(`${M}${AQ}`)){let T=Bun.file(I);if(await T.exists()&&(await OJ(I)).isFile())return new Response(T)}}}}catch{}let{locale:_,path:U}=xQ(Y,K);try{let N=iQ(await rQ($),$,Y),B=N.findPage(_,U);if(B){let R=await Bun.file(B.sourceFile).text(),{html:M,frontmatter:I}=await C0(R,$,{page:B,catalog:N}),T=I.layout||"doc",D=await yQ(M,Z,U,T,I,{i18n:Y,locale:_,sourceFile:B.sourceFile,docsDir:$});return new Response(D,{headers:{"Content-Type":"text/html; charset=utf-8"}})}}catch{return new Response("Documentation page could not be rendered",{status:500})}return new Response(await yQ("<h1>404 - Page Not Found</h1><p>The page you are looking for does not exist.</p>",Z,K),{status:404,headers:{"Content-Type":"text/html; charset=utf-8"}})}}),q=`http://localhost:${X.port}`,z=()=>X.stop();if(!J.quiet)console.log(`
9656
- \uD83D\uDCDA BunPress documentation server running at ${q}`),console.log(`Press Ctrl+C to stop
9657
- `);return{server:X,url:q,stop:z}}async function A1(J={}){let{stop:Z}=await b0(J),Q=J.watch!==void 0?J.watch:!0,$=J.root||"./docs";if(Q){console.log(`Watching for changes in ${$} directory...
9658
- `);try{let Y=new Map,X=new wQ("**/*.{md,stx,ts,js,css,html}");for await(let W of X.scan($))try{let V=JJ($,W),K=await OJ(V);Y.set(W,K.mtimeMs)}catch{}let q=null,z=()=>{if(q)clearTimeout(q);q=setTimeout(async()=>{console.log("File changed detected, reloading..."),UQ(),VQ(),aJ(),console.log("Ready for requests")},100)};setInterval(async()=>{try{let W=!1,V=new Set,K=new wQ("**/*.{md,stx,ts,js,css,html}");for await(let G of K.scan($)){V.add(G);try{let _=JJ($,G),U=await OJ(_),N=Y.get(G);if(N===void 0||U.mtimeMs>N)W=!0,Y.set(G,U.mtimeMs)}catch{}}for(let G of Y.keys())if(!V.has(G))W=!0,Y.delete(G);if(W)z()}catch{}},1000)}catch(Y){console.error("Error setting up file watcher:",Y)}}t.on("SIGINT",()=>{console.log(`
10010
+ ${q}`,{link(d){if(d===v)u=!0;return""}},T),u)throw Error("Markdown includes cannot be combined with reference definitions. Use inline links instead.")}}let R=Bun.markdown.html(q,T);if($)R=await JZ(R,$,Y);for(let[U,j]of I)R=R.replace(`<p>${U}</p>`,j),R=R.replace(U,j);if(z("inlineFormatting"))R=h0(R);if(z("tables"))R=m0(R,W("tables","enhancedStyling"),W("tables","responsive"),W("tables","alignment"));if(R=d0(R,D),B)R=k0(R,B);if(z("externalLinks")){if(W("externalLinks","autoTarget")||W("externalLinks","autoRel"))R=H0(R,W("externalLinks","autoTarget"),W("externalLinks","autoRel"));if(W("externalLinks","showIcon"))R=y0(R)}if(z("imageLazyLoading"))R=P0(R);for(let[U,j]of _)R=R.replace(`<p>${U}</p>`,()=>j),R=R.replace(U,()=>j);return R}async function l0(J={}){let Z=J.config||P,Q=J.port??3000,$=J.root||"./docs",Y=await gJ(uJ(Z),Z),X=Bun.serve({port:Q,async fetch(q){let V=new URL(q.url);try{decodeURIComponent(V.pathname)}catch{return new Response("Malformed path",{status:400})}let K=xQ(Z,V.pathname);if(K==="/")K="/index";else if(K.length>1&&K.endsWith("/"))K=K.replace(/\/+$/,"");if(K===jJ.replace(/\.json$/,"")||V.pathname.endsWith(jJ)){let N=await nQ($,Z);return new Response(JSON.stringify(N),{headers:{"Content-Type":"application/json","Cache-Control":"no-store"}})}let _=[".png",".jpg",".jpeg",".gif",".webp",".avif",".svg",".css",".js",".ico",".woff",".woff2",".ttf"];try{let N=decodeURIComponent(xQ(Z,V.pathname));if(!N.split("/").some((E)=>E.startsWith("."))){let E=n($,"public"),B=n(E,`.${N}`);if(B.startsWith(`${E}${kQ}`)){let M=/\.[^/]+$/.test(N)?[B]:[JJ(B,"index.html")];for(let D of M){let I=Bun.file(D);if(await I.exists()&&(await NJ(D)).isFile())return new Response(I)}}if(_.some((M)=>N.endsWith(M))){let M=n($),D=n(M,`.${N}`);if(D.startsWith(`${M}${kQ}`)){let I=Bun.file(D);if(await I.exists()&&(await NJ(D)).isFile())return new Response(I)}}}}catch{}let{locale:G,path:O}=pQ(Y,K);try{let N=eQ(await tQ($),$,Y),E=N.findPage(G,O);if(E){let B=await Bun.file(E.sourceFile).text(),{html:M,frontmatter:D}=await c0(B,$,{page:E,catalog:N}),I=D.layout||"doc",T=await vQ(M,Z,O,I,D,{i18n:Y,locale:G,sourceFile:E.sourceFile,docsDir:$});return new Response(T,{headers:{"Content-Type":"text/html; charset=utf-8"}})}}catch{return new Response("Documentation page could not be rendered",{status:500})}return new Response(await vQ("<h1>404 - Page Not Found</h1><p>The page you are looking for does not exist.</p>",Z,K),{status:404,headers:{"Content-Type":"text/html; charset=utf-8"}})}}),z=`http://localhost:${X.port}`,W=()=>X.stop();if(!J.quiet)console.log(`
10011
+ \uD83D\uDCDA BunPress documentation server running at ${z}`),console.log(`Press Ctrl+C to stop
10012
+ `);return{server:X,url:z,stop:W}}async function p1(J={}){let{stop:Z}=await l0(J),Q=J.watch!==void 0?J.watch:!0,$=J.root||"./docs";if(Q){console.log(`Watching for changes in ${$} directory...
10013
+ `);try{let Y=new Map,X=new PQ("**/*.{md,stx,ts,js,css,html}");for await(let q of X.scan($))try{let V=JJ($,q),K=await NJ(V);Y.set(q,K.mtimeMs)}catch{}let z=null,W=()=>{if(z)clearTimeout(z);z=setTimeout(async()=>{console.log("File changed detected, reloading..."),BQ(),jQ(),JQ(),console.log("Ready for requests")},100)};setInterval(async()=>{try{let q=!1,V=new Set,K=new PQ("**/*.{md,stx,ts,js,css,html}");for await(let _ of K.scan($)){V.add(_);try{let G=JJ($,_),O=await NJ(G),N=Y.get(_);if(N===void 0||O.mtimeMs>N)q=!0,Y.set(_,O.mtimeMs)}catch{}}for(let _ of Y.keys())if(!V.has(_))q=!0,Y.delete(_);if(q)W()}catch{}},1000)}catch(Y){console.error("Error setting up file watcher:",Y)}}t.on("SIGINT",()=>{console.log(`
9659
10014
  Shutting down server...`),Z(),t.exit(0)}),t.on("SIGTERM",()=>{console.log(`
9660
10015
  Shutting down server...`),Z(),t.exit(0)}),await new Promise(()=>{})}
9661
- export{m0 as a,eJ as b,JQ as c,QQ as d,WJ as e,d0 as f,ZQ as g,c0 as h,l0 as i,HQ as j,yQ as k,C0 as l,b0 as m,A1 as n};
10016
+ export{t0 as a,YQ as b,XQ as c,zQ as d,KJ as e,e0 as f,WQ as g,J1 as h,Q1 as i,xQ as j,vQ as k,c0 as l,l0 as m,p1 as n};