@stacksjs/bunpress 0.2.36 → 0.2.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +1 -1
- package/dist/{chunk-af54cmqz.js → chunk-4vg1gerz.js} +1 -1
- package/dist/{chunk-2ak6pzvc.js → chunk-fezafska.js} +1 -1
- package/dist/{chunk-967sb9pd.js → chunk-h86jm08b.js} +5 -5
- package/dist/{chunk-e93ycakx.js → chunk-j7jdypwb.js} +1369 -231
- package/dist/src/index.js +1 -1
- package/dist/src/screen-gallery.d.ts +10 -0
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$ as
|
|
3
|
-
`)}function
|
|
2
|
+
import{$ as Ob,B as pp,D as M,G as qb,H as G1,I as Ab,J as K1,K as E1,L as wp,M as qp,O as j1,P as U1,Q as _1,S as B1,aa as A1,ba as O1,ca as zp,da as E,ea as F1,fa as R1,ga as L1}from"./chunk-kw0tya77.js";import{ha as bb,ia as Rb,ja as P,ka as xp,la as vp,ma as V1,na as X1,pa as d1,qa as eb,ra as y1,sa as W1}from"./chunk-94yk2vs9.js";function hb(b,x){let p=b.themeConfig?.sidebar||b.sidebar||b.markdown?.sidebar;if(!p)return[];if(Array.isArray(p))return p;if(typeof p==="object"){let w=Object.keys(p).sort((q,Z)=>Z.length-q.length).find((q)=>x.startsWith(q))||"/";return p[w]||[]}return[]}function o1(b){return!!b&&!/^[a-z][a-z0-9+.-]*:/i.test(b)&&!b.startsWith("//")}function yp(b,x){let p=[],v=(J,$)=>{for(let Q of J){if(o1(Q.link))p.push({text:Q.text,link:Q.link,ancestors:$});if(Q.items?.length)v(Q.items,Q.text?[...$,Q.text]:$)}};v(b,[]);let w=p.findIndex((J)=>J.link===x);if(w===-1)return{ancestors:[]};let q=p[w],Z=p[w-1],z=p[w+1];return{ancestors:q.ancestors,current:q.text,prev:Z?{text:Z.text,link:Z.link}:void 0,next:z?{text:z.text,link:z.link}:void 0}}function Yb(b){return b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function ub(b){return b}function Wp(b,x="Breadcrumb"){if(!b.current||b.ancestors.length===0)return"";let p=b.ancestors.map((v)=>`<li class="bp-breadcrumb-item">${ub(v)}</li>`);return p.push(`<li class="bp-breadcrumb-item" aria-current="page">${ub(b.current)}</li>`),`<nav class="bp-breadcrumb" aria-label="${Yb(x)}"><ol>${p.join("")}</ol></nav>`}var dp='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="square" stroke-linejoin="miter" aria-hidden="true"><path d="M5 12h14"/><path d="m13 6 6 6-6 6"/></svg>';function Gp(b,x,p={prev:"Previous",next:"Next",nav:"Pagination"}){if(!b.prev&&!b.next)return"";let v=(w,q)=>`<a class="bp-pager-link bp-pager-${q}" href="${Yb(x(w.link))}"><span class="bp-pager-label">${Yb(q==="prev"?p.prev:p.next)}</span><span class="bp-pager-title">${q==="prev"?dp:""}<span>${ub(w.text)}</span>${q==="next"?dp:""}</span></a>`;return`<nav class="bp-pager" aria-label="${Yb(p.nav)}">`+(b.prev?v(b.prev,"prev"):'<span class="bp-pager-spacer"></span>')+(b.next?v(b.next,"next"):"")+"</nav>"}var{Glob:q1,YAML:z1}=globalThis.Bun;import{randomUUID as N1}from"crypto";import{stat as Fb}from"fs/promises";import{join as zb,resolve as vb,sep as Z1}from"path";import wb from"process";var{Glob:a1}=globalThis.Bun;import{join as Kp,resolve as s1}from"path";import n1 from"process";var Vb=new Map;function t1(b,x,p){let v=x.split("."),w=b;for(let q=0;q<v.length-1;q++){let Z=v[q];if(typeof w[Z]!=="object"||w[Z]===null)w[Z]={};w=w[Z]}w[v[v.length-1]]=p}async function Ep(b,x){let p=x?s1(n1.cwd(),x):Kp(b,".data");if(Vb.has(p))return Vb.get(p);let v={};try{let w=new a1("**/*.json");for await(let q of w.scan({cwd:p,absolute:!1}))try{let Z=await Bun.file(Kp(p,q)).text(),z=q.replace(/\.json$/,"").replace(/[/\\]/g,".");t1(v,z,JSON.parse(Z))}catch{}}catch{}return Vb.set(p,v),v}function jp(){Vb.clear()}function Up(b){return/(?:^|[\s>+~,(])(?:html)?\.dark(?![\w-])/.test(b)}function e1(b){return bx(b,",").map((x)=>x.trim()).filter((x)=>x&&Up(x)).map((x)=>x.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 bx(b,x){let p=[],v=0,w=null,q=0;for(let Z=0;Z<b.length;Z++){let z=b[Z];if(w){if(z==="\\")Z++;else if(z===w)w=null;continue}if(z==='"'||z==="'"){w=z;continue}if(z==="("||z==="["){v++;continue}if(z===")"||z==="]"){v--;continue}if(z===x&&v===0)p.push(b.slice(q,Z)),q=Z+1}return p.push(b.slice(q)),p}function px(b){let x=[],p=0,v=0;while(p<b.length){let w=b[p];if(w==="/"&&b[p+1]==="*"){let q=b.indexOf("*/",p+2);p=q===-1?b.length:q+2;continue}if(w==='"'||w==="'"){let q=w;p++;while(p<b.length&&b[p]!==q){if(b[p]==="\\")p++;p++}p++;continue}if(w==="{"){let q=1,Z=p+1;while(Z<b.length&&q>0){let z=b[Z];if(z==="/"&&b[Z+1]==="*"){let J=b.indexOf("*/",Z+2);Z=J===-1?b.length:J+2;continue}if(z==='"'||z==="'"){let J=z;Z++;while(Z<b.length&&b[Z]!==J){if(b[Z]==="\\")Z++;Z++}Z++;continue}if(z==="{")q++;else if(z==="}")q--;Z++}if(q===0)x.push({prelude:b.slice(v,p),body:b.slice(p+1,Z-1)});p=Z,v=p;continue}if(w===";"&&b.slice(v,p).trimStart().startsWith("@")){p++,v=p;continue}p++}return x}function Xb(b){let x=[];for(let{prelude:p,body:v}of px(b)){let w=p.replace(/\/\*[\s\S]*?\*\//g,"").trim();if(!w||w.startsWith("@")||!Up(w))continue;let q=e1(w);if(!q)continue;x.push(`${q} {${v}}`)}if(!x.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) {",x.join(`
|
|
4
4
|
|
|
5
5
|
`),"}",""].join(`
|
|
6
|
-
`)}var
|
|
7
|
-
`||
|
|
6
|
+
`)}var s=new Map;function _p(b){return b==="{"||b==="}"||b===";"||b===","}function h(b){let x=s.get(b);if(x!==void 0)return x;let p="",v=!1,w=b.length,q=(z)=>{if(v){let J=p[p.length-1],$=z[0];if(J!==void 0&&!_p(J)&&!_p($)&&J!==":")p+=" ";v=!1}if(z==="}"&&p.endsWith(";"))p=p.slice(0,-1);p+=z};for(let z=0;z<w;z++){let J=b[z];if(J==="/"&&b[z+1]==="*"){let $=b.indexOf("*/",z+2);z=$===-1?w:$+1,v=!0;continue}if(J==='"'||J==="'"){let $=z+1;while($<w&&b[$]!==J){if(b[$]==="\\")$++;$++}q(b.slice(z,$+1)),z=$;continue}if((J==="u"||J==="U")&&b.slice(z,z+4).toLowerCase()==="url("&&b[z+4]!=='"'&&b[z+4]!=="'"){let $=b.indexOf(")",z+4),Q=$===-1?w-1:$;q(b.slice(z,Q+1)),z=Q;continue}if(J===" "||J===`
|
|
7
|
+
`||J==="\t"||J==="\r"||J==="\f"){v=!0;continue}q(J)}let Z=p.trim();if(s.size>=32)s.delete(s.keys().next().value);return s.set(b,Z),Z}var db="data-bp-hoisted",xx=/<script\b[^>]*>[\s\S]*?<\/script\s*>|<!--[\s\S]*?-->|<(svg|template|noscript|textarea|pre|iframe)\b[^>]*>[\s\S]*?<\/\1\s*>|<style\b([^>]*)>([\s\S]*?)<\/style\s*>/gi;function yb(b){let x=b.search(/<\/head\s*>/i);if(x===-1)return b;let p=new Set,v=[],w=b.slice(x).replace(xx,(q,Z,z,J)=>{if(J===void 0||!/^<style\b/i.test(q))return q;let $=(z??"").trim(),Q=`${$}\x00${J.trim()}`;if(!p.has(Q)){if(p.add(Q),J.trim())v.push(`<style ${db}${$?` ${$}`:""}>${h(J)}</style>`)}return""});if(v.length===0)return b;return`${b.slice(0,x)}${v.join(`
|
|
8
8
|
`)}
|
|
9
|
-
${
|
|
9
|
+
${w}`}var Bp="bp-doc--long";function Ap(b){return b.length>150000}var Op=`
|
|
10
10
|
@supports (overflow-anchor: auto) {
|
|
11
11
|
.bp-doc--long > :nth-child(n + 41):is(p, ul, ol, pre, table, .table-responsive, div[class*="language-"]) {
|
|
12
12
|
content-visibility: auto;
|
|
@@ -17,60 +17,60 @@ ${Y}`}var MQ="bp-doc--long";function DQ(J){return J.length>150000}var wQ=`
|
|
|
17
17
|
contain-intrinsic-size: auto 240px;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`;import{createHighlighter as
|
|
21
|
-
`).map((
|
|
22
|
-
`);try{let
|
|
23
|
-
`);return(await Promise.all(
|
|
24
|
-
`)}catch(
|
|
25
|
-
`).map((
|
|
26
|
-
`)}}function
|
|
20
|
+
`;import{createHighlighter as vx,highlight as wx,listLanguages as qx}from"ts-syntax-highlighter";var n=null;function l0(){n=null}async function Fp(){if(n)return n;return n=await vx({theme:"github-light",cache:!0}),n}var cb=null;function Rp(){if(cb)return cb;let b=new Map;try{for(let x of qx()){b.set(x.id.toLowerCase(),x.id);for(let p of x.aliases??[])b.set(p.toLowerCase(),x.id)}}catch{}return cb=b,b}var Wb={};function Lp(b){Wb={};for(let[x,p]of Object.entries(b??{}))Wb[x.toLowerCase().trim()]=p.toLowerCase().trim()}function Np(b){let x=b.toLowerCase().trim(),p=Wb[x]??x;return Rp().get(p)??p}function Mp(b){let x=b.toLowerCase().trim();return Rp().has(Wb[x]??x)}function Gb(b){return b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function zx(b,x){let p=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,v=[],w;while((w=p.exec(x))!==null){let z=w[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;/g,"'");if(z)v.push({text:z,span:w[0]})}if(v.length===0)return x;let q="",Z=0;for(let z=0;z<v.length;z++){let{text:J,span:$}=v[z],Q=b.indexOf(J,Z);if(Q===-1){q+=$;continue}if(Q>Z){let V=b.substring(Z,Q);if(/^\s+$/.test(V))q+=V}q+=$,Z=Q+J.length}return q}async function Kb(b,x,p="github-light"){let v=Np(x);if(!Mp(v))return b.split(`
|
|
21
|
+
`).map((q)=>`<span class="line">${Gb(q)}</span>`).join(`
|
|
22
|
+
`);try{let w=b.split(`
|
|
23
|
+
`);return(await Promise.all(w.map(async(Z)=>{if(!Z.trim())return`<span class="line">${Z}</span>`;let J=(await wx(Z,v,{theme:p})).html;if(J=J.replace(/<div[^>]*class="syntax-wrapper"[^>]*>/g,""),J=J.replace(/<\/div>\s*$/g,""),J=J.replace(/<pre[^>]*>/g,""),J=J.replace(/<\/pre>/g,""),J=J.replace(/<code[^>]*>/g,""),J=J.replace(/<\/code>/g,""),J=zx(Z,J.trim()),!J.startsWith('<span class="line">'))J=`<span class="line">${J}</span>`;return J}))).join(`
|
|
24
|
+
`)}catch(w){return console.warn(`Failed to highlight code for language "${x}":`,w),b.split(`
|
|
25
|
+
`).map((Z)=>`<span class="line">${Gb(Z)}</span>`).join(`
|
|
26
|
+
`)}}function o0(b,x){let p=Np(x);if(!Mp(p))return Gb(b);return Gb(b)}var Zx={default:"#24292f",variable:"#953800",type:"#953800",function:"#7a3fd0",tag:"#116329",constant:"#0550ae",keyword:"#c5141f",string:"#0a3069",comment:"#5c636b",invalid:"#82071e"};function Jx(){let b=Zx;return`
|
|
27
27
|
/* Light palette over a dark inline theme (see lightPaletteForDarkInlineTheme). */
|
|
28
28
|
.token {
|
|
29
|
-
color: ${
|
|
29
|
+
color: ${b.default} !important;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.token[class*='variable'] {
|
|
33
|
-
color: ${
|
|
33
|
+
color: ${b.variable} !important;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.token[class*='entity-name-type'],
|
|
37
37
|
.token[class*='support-type'],
|
|
38
38
|
.token[class*='support-class'] {
|
|
39
|
-
color: ${
|
|
39
|
+
color: ${b.type} !important;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.token[class*='entity-name-function'],
|
|
43
43
|
.token[class*='support-function'] {
|
|
44
|
-
color: ${
|
|
44
|
+
color: ${b.function} !important;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.token[class*='entity-name-tag'],
|
|
48
48
|
.token[class*='markup-inserted'] {
|
|
49
|
-
color: ${
|
|
49
|
+
color: ${b.tag} !important;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.token[class*='constant'],
|
|
53
53
|
.token[class*='entity-other-attribute'] {
|
|
54
|
-
color: ${
|
|
54
|
+
color: ${b.constant} !important;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.token[class*='keyword'],
|
|
58
58
|
.token[class*='storage'] {
|
|
59
|
-
color: ${
|
|
59
|
+
color: ${b.keyword} !important;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.token[class*='string'] {
|
|
63
|
-
color: ${
|
|
63
|
+
color: ${b.string} !important;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.token[class*='comment'] {
|
|
67
|
-
color: ${
|
|
67
|
+
color: ${b.comment} !important;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.token[class*='invalid'] {
|
|
71
|
-
color: ${
|
|
71
|
+
color: ${b.invalid} !important;
|
|
72
72
|
}
|
|
73
|
-
`}function
|
|
73
|
+
`}function fp(b="github-light"){return`${Qx()}${b==="github-light"?"":Jx()}`}function Qx(){return`
|
|
74
74
|
/* Basic syntax highlighting styles for ts-syntax-highlighter */
|
|
75
75
|
/* The actual theme colors are injected by ts-syntax-highlighter */
|
|
76
76
|
|
|
@@ -307,12 +307,1119 @@ html.dark .token[class*='invalid'] {
|
|
|
307
307
|
html.dark .line-number {
|
|
308
308
|
color: #9ca3af;
|
|
309
309
|
}
|
|
310
|
-
`}async function
|
|
311
|
-
`)){if(!z.trim())continue;if(/^\d{4}-\d{2}-\d{2}T/.test(z)){
|
|
310
|
+
`}async function a0(){await Fp()}async function s0(){return Fp()}import{stat as $x}from"fs/promises";import{relative as Ip,resolve as e}from"path";import Yx from"process";var t=new Map;async function Vx(b){let x=e(b);if(t.has(x))return t.get(x);try{let p=Bun.spawn(["git","log","--pretty=format:%cI","--name-only","--relative","--no-merges","--","."],{cwd:x,stdout:"pipe",stderr:"ignore"}),[v,w]=await Promise.all([p.exited,new Response(p.stdout).text()]);if(v!==0)return t.set(x,null),null;let q=new Map,Z="";for(let z of w.split(`
|
|
311
|
+
`)){if(!z.trim())continue;if(/^\d{4}-\d{2}-\d{2}T/.test(z)){Z=z.trim();continue}if(Z&&!q.has(z))q.set(z,Z)}return t.set(x,q),q}catch{return t.set(x,null),null}}async function Dp(b,x){let p=await Vx(b);if(p){let v=Ip(e(b),e(x)).replace(/\\/g,"/"),w=p.get(v);if(w)return w}try{return(await $x(x)).mtime.toISOString()}catch{return null}}function Tp(b,x,p){let v=Ip(e(Yx.cwd(),x),e(p)).replace(/\\/g,"/");return b.includes(":path")?b.replace(":path",v):`${b.replace(/\/$/,"")}/${v}`}function kp(b,x,p){let v=new Date(b);if(Number.isNaN(v.getTime()))return"";try{return new Intl.DateTimeFormat(x,p??{dateStyle:"medium"}).format(v)}catch{return v.toISOString().slice(0,10)}}import{join as rb}from"path";var Eb=new Map,Sp="\x00BPCODE",Hp="\x00";async function Pp(b,x){let p=rb(b,x);if(Eb.has(p))return Eb.get(p);let v=[rb(b,`${x}.stx`),rb(b,x,"index.stx")],w=null;for(let q of v){let Z=Bun.file(q);if(await Z.exists()){w={source:await Z.text(),path:q};break}}return Eb.set(p,w),w}function gp(){Eb.clear()}function Xx(b,x){try{let p=Object.keys(x),v=p.map((w)=>x[w]);return Function(...p,`"use strict"; return (${b});`)(...v)}catch{return}}function dx(b,x){let p={};if(!b)return p;let v=/([:@]?[\w-]+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]*)\}))?/g,w;while(w=v.exec(b)){let q=w[1];if(!q)continue;let Z=q.startsWith(":"),z=q.replace(/^[:@]/,""),J=w[2],$=w[3],Q=w[4],V=J??$??Q;if(V===void 0)p[z]=!0;else if(Z||Q!==void 0)p[z]=Xx(V,x);else p[z]=V}return p}async function mb(b,x,p,v={},w=0){if(w>10||!b.includes("<"))return b;let q=[],Z=b.replace(/```[\s\S]*?```/g,(Y)=>{return q.push(Y),`${Sp}${q.length-1}${Hp}`}).replace(/`[^`\n]*`/g,(Y)=>{return q.push(Y),`${Sp}${q.length-1}${Hp}`}),z=/<([A-Z][A-Za-z0-9]*)((?:\s[^>]*?)?)(\/?)>/g,J="",$=0,Q=!1,V;while(V=z.exec(Z)){let Y=V[0],X=V[1],W=V[2],K=V[3],j=await Pp(x,X)??(v.fallbackComponentsDir?await Pp(v.fallbackComponentsDir,X):null);if(j==null)continue;Q=!0,J+=Z.slice($,V.index);let U="",B=V.index+Y.length;if(!K){let G=new RegExp(`</${X}>`,"g");G.lastIndex=B;let d=G.exec(Z);if(d)U=Z.slice(B,d.index).trim(),B=d.index+d[0].length}let _=dx(W.trim(),p),O;try{let{renderTemplateString:G}=await import("@stacksjs/stx/render"),d=/<script\b[^>]*\bclient\b/.test(j.source);if(O=await G(j.source,j.path,{context:{...p,..._,slot:U},options:{componentsDir:x,fallbackComponentsDir:v.fallbackComponentsDir},injectCSS:d,templateOnly:!d}),d&&v.rendered){let y=`BPLIVECOMPONENT${v.rendered.size}END`;v.rendered.set(y,O),O=`
|
|
312
312
|
|
|
313
|
-
${
|
|
313
|
+
${y}
|
|
314
314
|
|
|
315
|
-
`}}catch(
|
|
315
|
+
`}}catch(G){let d=G instanceof Error?G.message:String(G);throw Error(`Failed to render BunPress component ${X}: ${d}`,{cause:G})}J+=O,$=B,z.lastIndex=B}if(J+=Z.slice($),J=J.replace(/\u0000BPCODE(\d+)\u0000/g,(Y,X)=>q[Number(X)]??""),Q)return mb(J,x,p,v,w+1);return J}import{join as hp}from"path";var yx=hp(import.meta.dir,"templates"),jb=new Map;async function Wx(b){if(jb.has(b))return jb.get(b);let x=hp(yx,`${b}.stx`),p=Bun.file(x);if(!await p.exists())throw Error(`Template not found: ${b}`);let v=Gx(await p.text());return jb.set(b,v),v}function Gx(b){return b.replace(/\{\{--[\s\S]*?--\}\}\n?/g,"")}async function L(b,x){let p=await Wx(b);return Kx(p,x)}function cp(){jb.clear()}function Kx(b,x){return b.replace(/\{!!\s*([\w.]+)\s*!!\}|\{\{\s*([\w.]+)\s*\}\}/g,(p,v,w)=>{if(v!==void 0)return up(Cp(x,v));return Ex(up(Cp(x,w)))})}function Cp(b,x){return x.split(".").reduce((p,v)=>{if(p==null||typeof p!=="object")return;return p[v]},b)}function up(b){if(b==null)return"";return String(b)}function Ex(b){return b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Ub=`
|
|
316
|
+
/* ==========================================================================
|
|
317
|
+
BunPress Screen Gallery & Device Frames
|
|
318
|
+
========================================================================== */
|
|
319
|
+
|
|
320
|
+
.bp-doc .bp-screens-gallery {
|
|
321
|
+
margin: 20px 0 32px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.bp-doc .bp-screens-summary {
|
|
325
|
+
display: grid;
|
|
326
|
+
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
|
327
|
+
gap: 10px;
|
|
328
|
+
margin: 16px 0 20px;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.bp-doc .bp-screens-stat {
|
|
332
|
+
display: flex;
|
|
333
|
+
flex-direction: column;
|
|
334
|
+
gap: 3px;
|
|
335
|
+
padding: 12px 14px;
|
|
336
|
+
border-radius: 10px;
|
|
337
|
+
border: 1px solid var(--bp-c-divider);
|
|
338
|
+
background: var(--bp-c-bg-soft);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.bp-doc .bp-screens-stat-value {
|
|
342
|
+
font-size: 20px;
|
|
343
|
+
font-weight: 700;
|
|
344
|
+
line-height: 1.2;
|
|
345
|
+
color: var(--bp-c-text-1);
|
|
346
|
+
font-variant-numeric: tabular-nums;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.bp-doc .bp-screens-stat-label {
|
|
350
|
+
font-size: 12px;
|
|
351
|
+
color: var(--bp-c-text-2);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* Filter & Layout Toolbar */
|
|
355
|
+
.bp-doc .bp-screens-toolbar {
|
|
356
|
+
display: flex;
|
|
357
|
+
flex-direction: column;
|
|
358
|
+
gap: 12px;
|
|
359
|
+
padding: 14px 16px;
|
|
360
|
+
margin: 0 0 28px;
|
|
361
|
+
border-radius: 12px;
|
|
362
|
+
border: 1px solid var(--bp-c-divider);
|
|
363
|
+
background: var(--bp-c-bg-soft);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.bp-doc .bp-screens-toolbar-top {
|
|
367
|
+
display: flex;
|
|
368
|
+
flex-wrap: wrap;
|
|
369
|
+
align-items: center;
|
|
370
|
+
gap: 10px;
|
|
371
|
+
justify-content: space-between;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.bp-doc .bp-screens-search-wrap {
|
|
375
|
+
position: relative;
|
|
376
|
+
flex: 1 1 220px;
|
|
377
|
+
max-width: 360px;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.bp-doc .bp-screens-search {
|
|
381
|
+
width: 100%;
|
|
382
|
+
height: 34px;
|
|
383
|
+
padding: 0 12px;
|
|
384
|
+
border-radius: 8px;
|
|
385
|
+
border: 1px solid var(--bp-c-divider);
|
|
386
|
+
background: var(--bp-c-bg);
|
|
387
|
+
color: var(--bp-c-text-1);
|
|
388
|
+
font-size: 13px;
|
|
389
|
+
outline: none;
|
|
390
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.bp-doc .bp-screens-search:focus {
|
|
394
|
+
border-color: var(--bp-c-brand-1);
|
|
395
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--bp-c-brand-1) 18%, transparent);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.bp-doc .bp-screens-toolbar-right {
|
|
399
|
+
display: flex;
|
|
400
|
+
flex-wrap: wrap;
|
|
401
|
+
align-items: center;
|
|
402
|
+
gap: 10px;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.bp-doc .bp-screens-count {
|
|
406
|
+
font-size: 12px;
|
|
407
|
+
color: var(--bp-c-text-2);
|
|
408
|
+
font-variant-numeric: tabular-nums;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.bp-doc .bp-screens-view-modes {
|
|
412
|
+
display: inline-flex;
|
|
413
|
+
padding: 2px;
|
|
414
|
+
border-radius: 8px;
|
|
415
|
+
border: 1px solid var(--bp-c-divider);
|
|
416
|
+
background: var(--bp-c-bg);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.bp-doc .bp-screens-mode-btn {
|
|
420
|
+
padding: 4px 10px;
|
|
421
|
+
border: 0;
|
|
422
|
+
border-radius: 6px;
|
|
423
|
+
background: transparent;
|
|
424
|
+
color: var(--bp-c-text-2);
|
|
425
|
+
font-size: 12px;
|
|
426
|
+
font-weight: 500;
|
|
427
|
+
cursor: pointer;
|
|
428
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.bp-doc .bp-screens-mode-btn:hover {
|
|
432
|
+
color: var(--bp-c-text-1);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.bp-doc .bp-screens-mode-btn.is-active {
|
|
436
|
+
background: var(--bp-c-brand-1);
|
|
437
|
+
color: #ffffff;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.bp-doc .bp-screens-filter-rows {
|
|
441
|
+
display: flex;
|
|
442
|
+
flex-direction: column;
|
|
443
|
+
gap: 8px;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.bp-doc .bp-screens-filter-row {
|
|
447
|
+
display: flex;
|
|
448
|
+
flex-wrap: wrap;
|
|
449
|
+
align-items: center;
|
|
450
|
+
gap: 6px;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.bp-doc .bp-screens-filter-label {
|
|
454
|
+
font-size: 11px;
|
|
455
|
+
font-weight: 600;
|
|
456
|
+
text-transform: uppercase;
|
|
457
|
+
letter-spacing: 0.04em;
|
|
458
|
+
color: var(--bp-c-text-3);
|
|
459
|
+
margin-right: 4px;
|
|
460
|
+
min-width: 58px;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.bp-doc .bp-screens-pill {
|
|
464
|
+
display: inline-flex;
|
|
465
|
+
align-items: center;
|
|
466
|
+
gap: 5px;
|
|
467
|
+
padding: 4px 10px;
|
|
468
|
+
border-radius: 999px;
|
|
469
|
+
border: 1px solid var(--bp-c-divider);
|
|
470
|
+
background: var(--bp-c-bg);
|
|
471
|
+
color: var(--bp-c-text-2);
|
|
472
|
+
font-size: 12px;
|
|
473
|
+
font-weight: 500;
|
|
474
|
+
line-height: 1.3;
|
|
475
|
+
cursor: pointer;
|
|
476
|
+
transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.bp-doc .bp-screens-pill:hover {
|
|
480
|
+
border-color: var(--bp-c-brand-1);
|
|
481
|
+
color: var(--bp-c-text-1);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.bp-doc .bp-screens-pill.is-active {
|
|
485
|
+
border-color: var(--bp-c-brand-1);
|
|
486
|
+
background: color-mix(in srgb, var(--bp-c-brand-1) 12%, var(--bp-c-bg));
|
|
487
|
+
color: var(--bp-c-brand-1);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.bp-doc .bp-screens-pill-dim {
|
|
491
|
+
font-size: 11px;
|
|
492
|
+
opacity: 0.72;
|
|
493
|
+
font-variant-numeric: tabular-nums;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/* Walkthrough Videos Grid */
|
|
497
|
+
.bp-doc .bp-screens-films {
|
|
498
|
+
display: flex;
|
|
499
|
+
flex-wrap: wrap;
|
|
500
|
+
gap: 18px;
|
|
501
|
+
align-items: flex-start;
|
|
502
|
+
margin: 16px 0 32px;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.bp-doc .bp-film-card {
|
|
506
|
+
display: flex;
|
|
507
|
+
flex-direction: column;
|
|
508
|
+
gap: 10px;
|
|
509
|
+
padding: 14px;
|
|
510
|
+
border-radius: 12px;
|
|
511
|
+
border: 1px solid var(--bp-c-divider);
|
|
512
|
+
background: var(--bp-c-bg-soft);
|
|
513
|
+
flex: 1 1 340px;
|
|
514
|
+
min-width: 0;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.bp-doc .bp-film-card[data-device="mobile"],
|
|
518
|
+
.bp-doc .bp-film-card[data-device="ios"],
|
|
519
|
+
.bp-doc .bp-film-card[data-device="android"] {
|
|
520
|
+
flex: 0 1 260px;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.bp-doc .bp-film-card[data-device="tablet"] {
|
|
524
|
+
flex: 0 1 320px;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.bp-doc .bp-film-header {
|
|
528
|
+
display: flex;
|
|
529
|
+
align-items: center;
|
|
530
|
+
justify-content: space-between;
|
|
531
|
+
gap: 8px;
|
|
532
|
+
font-size: 13px;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.bp-doc .bp-film-title {
|
|
536
|
+
font-weight: 600;
|
|
537
|
+
color: var(--bp-c-text-1);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.bp-doc .bp-film-meta {
|
|
541
|
+
font-size: 12px;
|
|
542
|
+
color: var(--bp-c-text-2);
|
|
543
|
+
font-variant-numeric: tabular-nums;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.bp-doc .bp-film-card video {
|
|
547
|
+
display: block;
|
|
548
|
+
width: 100%;
|
|
549
|
+
max-height: 460px;
|
|
550
|
+
margin: 0;
|
|
551
|
+
border-radius: 8px;
|
|
552
|
+
border: 1px solid var(--bp-c-divider);
|
|
553
|
+
background: var(--bp-c-bg);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.bp-doc .bp-film-footer {
|
|
557
|
+
display: flex;
|
|
558
|
+
align-items: center;
|
|
559
|
+
justify-content: space-between;
|
|
560
|
+
gap: 8px;
|
|
561
|
+
font-size: 12px;
|
|
562
|
+
color: var(--bp-c-text-2);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/* Screen Showcase Section */
|
|
566
|
+
.bp-doc .bp-screen-showcase {
|
|
567
|
+
margin: 10px 0 28px;
|
|
568
|
+
padding: 16px;
|
|
569
|
+
border-radius: 14px;
|
|
570
|
+
border: 1px solid var(--bp-c-divider);
|
|
571
|
+
background: var(--bp-c-bg-soft);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.bp-doc .bp-screen-showcase[hidden],
|
|
575
|
+
.bp-doc .bp-screen-group-empty[hidden],
|
|
576
|
+
.bp-doc .bp-screen-profile-group[hidden],
|
|
577
|
+
.bp-doc .bp-device-frame[hidden],
|
|
578
|
+
.bp-doc .bp-film-card[hidden] {
|
|
579
|
+
display: none !important;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.bp-doc .bp-screen-meta {
|
|
583
|
+
display: flex;
|
|
584
|
+
flex-wrap: wrap;
|
|
585
|
+
align-items: center;
|
|
586
|
+
justify-content: space-between;
|
|
587
|
+
gap: 8px 14px;
|
|
588
|
+
margin-bottom: 14px;
|
|
589
|
+
padding-bottom: 12px;
|
|
590
|
+
border-bottom: 1px solid var(--bp-c-divider);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.bp-doc .bp-screen-route {
|
|
594
|
+
display: inline-flex;
|
|
595
|
+
align-items: center;
|
|
596
|
+
gap: 6px;
|
|
597
|
+
font-size: 12px;
|
|
598
|
+
color: var(--bp-c-text-2);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.bp-doc .bp-screen-route code {
|
|
602
|
+
font-size: 12px;
|
|
603
|
+
padding: 2px 7px;
|
|
604
|
+
border-radius: 6px;
|
|
605
|
+
background: var(--bp-c-bg);
|
|
606
|
+
border: 1px solid var(--bp-c-divider);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.bp-doc .bp-screen-badges {
|
|
610
|
+
display: flex;
|
|
611
|
+
flex-wrap: wrap;
|
|
612
|
+
gap: 6px;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.bp-doc .bp-screen-badge {
|
|
616
|
+
display: inline-flex;
|
|
617
|
+
align-items: center;
|
|
618
|
+
padding: 2px 8px;
|
|
619
|
+
border-radius: 999px;
|
|
620
|
+
font-size: 11px;
|
|
621
|
+
font-weight: 500;
|
|
622
|
+
color: var(--bp-c-text-2);
|
|
623
|
+
background: var(--bp-c-bg);
|
|
624
|
+
border: 1px solid var(--bp-c-divider);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.bp-doc .bp-screen-profile-group + .bp-screen-profile-group {
|
|
628
|
+
margin-top: 18px;
|
|
629
|
+
padding-top: 16px;
|
|
630
|
+
border-top: 1px dashed var(--bp-c-divider);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.bp-doc .bp-screen-profile-label {
|
|
634
|
+
display: inline-flex;
|
|
635
|
+
align-items: center;
|
|
636
|
+
gap: 6px;
|
|
637
|
+
margin-bottom: 12px;
|
|
638
|
+
font-size: 12px;
|
|
639
|
+
font-weight: 600;
|
|
640
|
+
color: var(--bp-c-text-2);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.bp-doc .bp-screen-profile-dot {
|
|
644
|
+
width: 7px;
|
|
645
|
+
height: 7px;
|
|
646
|
+
border-radius: 999px;
|
|
647
|
+
background: var(--bp-c-brand-1);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/* Per-screen Device Tabs (visible in Tabs mode) */
|
|
651
|
+
.bp-doc .bp-screen-tabs {
|
|
652
|
+
display: none;
|
|
653
|
+
flex-wrap: wrap;
|
|
654
|
+
gap: 6px;
|
|
655
|
+
margin-bottom: 12px;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.bp-doc [data-bp-view-mode="tabs"] .bp-screen-tabs {
|
|
659
|
+
display: flex;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.bp-doc .bp-screen-tab {
|
|
663
|
+
padding: 4px 10px;
|
|
664
|
+
border-radius: 7px;
|
|
665
|
+
border: 1px solid var(--bp-c-divider);
|
|
666
|
+
background: var(--bp-c-bg);
|
|
667
|
+
color: var(--bp-c-text-2);
|
|
668
|
+
font-size: 12px;
|
|
669
|
+
font-weight: 500;
|
|
670
|
+
cursor: pointer;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.bp-doc .bp-screen-tab.is-active {
|
|
674
|
+
border-color: var(--bp-c-brand-1);
|
|
675
|
+
background: color-mix(in srgb, var(--bp-c-brand-1) 12%, var(--bp-c-bg));
|
|
676
|
+
color: var(--bp-c-brand-1);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/* Multi-Device Stage */
|
|
680
|
+
.bp-doc .bp-device-stage {
|
|
681
|
+
display: flex;
|
|
682
|
+
flex-wrap: wrap;
|
|
683
|
+
gap: 18px;
|
|
684
|
+
align-items: flex-start;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
.bp-doc [data-bp-view-mode="grid"] .bp-device-stage {
|
|
688
|
+
display: grid;
|
|
689
|
+
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
690
|
+
align-items: start;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.bp-doc [data-bp-view-mode="tabs"] .bp-device-stage {
|
|
694
|
+
display: block;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.bp-doc [data-bp-view-mode="tabs"] .bp-device-frame:not(.is-tab-active) {
|
|
698
|
+
display: none !important;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.bp-doc [data-bp-view-mode="tabs"] .bp-device-frame.is-tab-active {
|
|
702
|
+
max-width: 100%;
|
|
703
|
+
margin: 0 auto;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.bp-doc [data-bp-view-mode="tabs"] .bp-device-frame.is-tab-active[data-device="mobile"],
|
|
707
|
+
.bp-doc [data-bp-view-mode="tabs"] .bp-device-frame.is-tab-active[data-device="ios"],
|
|
708
|
+
.bp-doc [data-bp-view-mode="tabs"] .bp-device-frame.is-tab-active[data-device="android"] {
|
|
709
|
+
max-width: 390px;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.bp-doc [data-bp-view-mode="tabs"] .bp-device-frame.is-tab-active[data-device="tablet"] {
|
|
713
|
+
max-width: 580px;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/* Individual Device Frames */
|
|
717
|
+
.bp-doc figure.bp-device-frame {
|
|
718
|
+
margin: 0;
|
|
719
|
+
display: flex;
|
|
720
|
+
flex-direction: column;
|
|
721
|
+
gap: 8px;
|
|
722
|
+
flex: 1 1 340px;
|
|
723
|
+
min-width: 0;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.bp-doc figure.bp-device-frame[data-device="tablet"] {
|
|
727
|
+
flex: 1.35 1 220px;
|
|
728
|
+
max-width: 360px;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.bp-doc figure.bp-device-frame[data-device="mobile"],
|
|
732
|
+
.bp-doc figure.bp-device-frame[data-device="ios"],
|
|
733
|
+
.bp-doc figure.bp-device-frame[data-device="android"] {
|
|
734
|
+
flex: 1 1 170px;
|
|
735
|
+
max-width: 240px;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.bp-doc [data-bp-view-mode="grid"] figure.bp-device-frame {
|
|
739
|
+
max-width: none !important;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.bp-doc .bp-device-shell {
|
|
743
|
+
position: relative;
|
|
744
|
+
border-radius: 12px;
|
|
745
|
+
border: 1px solid var(--bp-c-divider);
|
|
746
|
+
background: var(--bp-c-bg);
|
|
747
|
+
overflow: hidden;
|
|
748
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
|
749
|
+
cursor: zoom-in;
|
|
750
|
+
transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.bp-doc .bp-device-shell:hover {
|
|
754
|
+
transform: translateY(-2px);
|
|
755
|
+
border-color: var(--bp-c-brand-1);
|
|
756
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
.bp-doc figure.bp-device-frame[data-scheme="dark"] .bp-device-shell {
|
|
760
|
+
background: #141417;
|
|
761
|
+
border-color: #2f2f36;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/* Desktop / Laptop / macOS browser bar */
|
|
765
|
+
.bp-doc .bp-device-chrome {
|
|
766
|
+
display: flex;
|
|
767
|
+
align-items: center;
|
|
768
|
+
gap: 8px;
|
|
769
|
+
height: 26px;
|
|
770
|
+
padding: 0 10px;
|
|
771
|
+
background: var(--bp-c-bg-soft);
|
|
772
|
+
border-bottom: 1px solid var(--bp-c-divider);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.bp-doc figure.bp-device-frame[data-scheme="dark"] .bp-device-chrome {
|
|
776
|
+
background: #1c1c21;
|
|
777
|
+
border-bottom-color: #2d2d34;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.bp-doc .bp-device-dots {
|
|
781
|
+
display: inline-flex;
|
|
782
|
+
gap: 4px;
|
|
783
|
+
flex-shrink: 0;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
.bp-doc .bp-device-dots span {
|
|
787
|
+
width: 7px;
|
|
788
|
+
height: 7px;
|
|
789
|
+
border-radius: 999px;
|
|
790
|
+
background: var(--bp-c-divider);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.bp-doc figure.bp-device-frame[data-scheme="dark"] .bp-device-dots span {
|
|
794
|
+
background: #3d3d47;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.bp-doc .bp-device-url {
|
|
798
|
+
flex: 1;
|
|
799
|
+
min-width: 0;
|
|
800
|
+
overflow: hidden;
|
|
801
|
+
text-overflow: ellipsis;
|
|
802
|
+
white-space: nowrap;
|
|
803
|
+
font-family: var(--bp-font-family-mono, ui-monospace, monospace);
|
|
804
|
+
font-size: 10px;
|
|
805
|
+
color: var(--bp-c-text-3);
|
|
806
|
+
text-align: center;
|
|
807
|
+
padding: 1px 8px;
|
|
808
|
+
border-radius: 4px;
|
|
809
|
+
background: var(--bp-c-bg);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.bp-doc figure.bp-device-frame[data-scheme="dark"] .bp-device-url {
|
|
813
|
+
background: #121216;
|
|
814
|
+
color: #9b9ba6;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/* Tablet bezel */
|
|
818
|
+
.bp-doc figure.bp-device-frame[data-device="tablet"] .bp-device-shell {
|
|
819
|
+
border-radius: 16px;
|
|
820
|
+
padding: 9px 7px 11px;
|
|
821
|
+
background: #e6e7ec;
|
|
822
|
+
border-color: #cfd1da;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
html.dark .bp-doc figure.bp-device-frame[data-device="tablet"] .bp-device-shell,
|
|
826
|
+
.bp-doc figure.bp-device-frame[data-device="tablet"][data-scheme="dark"] .bp-device-shell {
|
|
827
|
+
background: #1e1e23;
|
|
828
|
+
border-color: #35353e;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.bp-doc figure.bp-device-frame[data-device="tablet"] .bp-device-screen {
|
|
832
|
+
border-radius: 8px;
|
|
833
|
+
overflow: hidden;
|
|
834
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/* Mobile / iOS / Android bezel */
|
|
838
|
+
.bp-doc figure.bp-device-frame[data-device="mobile"] .bp-device-shell,
|
|
839
|
+
.bp-doc figure.bp-device-frame[data-device="ios"] .bp-device-shell,
|
|
840
|
+
.bp-doc figure.bp-device-frame[data-device="android"] .bp-device-shell {
|
|
841
|
+
border-radius: 24px;
|
|
842
|
+
padding: 10px 6px 10px;
|
|
843
|
+
background: #e6e7ec;
|
|
844
|
+
border-color: #cfd1da;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
html.dark .bp-doc figure.bp-device-frame[data-device="mobile"] .bp-device-shell,
|
|
848
|
+
html.dark .bp-doc figure.bp-device-frame[data-device="ios"] .bp-device-shell,
|
|
849
|
+
html.dark .bp-doc figure.bp-device-frame[data-device="android"] .bp-device-shell,
|
|
850
|
+
.bp-doc figure.bp-device-frame[data-device="mobile"][data-scheme="dark"] .bp-device-shell,
|
|
851
|
+
.bp-doc figure.bp-device-frame[data-device="ios"][data-scheme="dark"] .bp-device-shell,
|
|
852
|
+
.bp-doc figure.bp-device-frame[data-device="android"][data-scheme="dark"] .bp-device-shell {
|
|
853
|
+
background: #1b1b20;
|
|
854
|
+
border-color: #34343d;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.bp-doc .bp-device-notch {
|
|
858
|
+
width: 44px;
|
|
859
|
+
height: 5px;
|
|
860
|
+
border-radius: 999px;
|
|
861
|
+
margin: 0 auto 7px;
|
|
862
|
+
background: rgba(0, 0, 0, 0.16);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
html.dark .bp-doc .bp-device-notch,
|
|
866
|
+
.bp-doc figure.bp-device-frame[data-scheme="dark"] .bp-device-notch {
|
|
867
|
+
background: rgba(255, 255, 255, 0.16);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
.bp-doc figure.bp-device-frame[data-device="mobile"] .bp-device-screen,
|
|
871
|
+
.bp-doc figure.bp-device-frame[data-device="ios"] .bp-device-screen,
|
|
872
|
+
.bp-doc figure.bp-device-frame[data-device="android"] .bp-device-screen {
|
|
873
|
+
border-radius: 15px;
|
|
874
|
+
overflow: hidden;
|
|
875
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.bp-doc .bp-device-homebar {
|
|
879
|
+
width: 56px;
|
|
880
|
+
height: 4px;
|
|
881
|
+
border-radius: 999px;
|
|
882
|
+
margin: 7px auto 0;
|
|
883
|
+
background: rgba(0, 0, 0, 0.16);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
html.dark .bp-doc .bp-device-homebar,
|
|
887
|
+
.bp-doc figure.bp-device-frame[data-scheme="dark"] .bp-device-homebar {
|
|
888
|
+
background: rgba(255, 255, 255, 0.18);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.bp-doc figure.bp-device-frame .bp-device-screen img {
|
|
892
|
+
display: block;
|
|
893
|
+
width: 100%;
|
|
894
|
+
height: auto;
|
|
895
|
+
margin: 0;
|
|
896
|
+
border: 0;
|
|
897
|
+
border-radius: 0;
|
|
898
|
+
box-shadow: none;
|
|
899
|
+
background: transparent;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.bp-doc [data-bp-view-mode="grid"] figure.bp-device-frame .bp-device-screen img {
|
|
903
|
+
aspect-ratio: 4 / 3;
|
|
904
|
+
object-fit: cover;
|
|
905
|
+
object-position: top center;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
.bp-doc figcaption.bp-device-caption {
|
|
909
|
+
display: flex;
|
|
910
|
+
align-items: center;
|
|
911
|
+
justify-content: space-between;
|
|
912
|
+
gap: 8px;
|
|
913
|
+
font-size: 12px;
|
|
914
|
+
line-height: 1.35;
|
|
915
|
+
color: var(--bp-c-text-2);
|
|
916
|
+
padding: 0 2px;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
.bp-doc .bp-device-caption-name {
|
|
920
|
+
font-weight: 600;
|
|
921
|
+
color: var(--bp-c-text-1);
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
.bp-doc .bp-device-caption-meta {
|
|
925
|
+
font-size: 11px;
|
|
926
|
+
color: var(--bp-c-text-3);
|
|
927
|
+
font-variant-numeric: tabular-nums;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.bp-doc .bp-screens-empty {
|
|
931
|
+
padding: 28px 20px;
|
|
932
|
+
text-align: center;
|
|
933
|
+
border-radius: 12px;
|
|
934
|
+
border: 1px dashed var(--bp-c-divider);
|
|
935
|
+
color: var(--bp-c-text-2);
|
|
936
|
+
font-size: 14px;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/* Lightbox Modal */
|
|
940
|
+
.bp-lightbox {
|
|
941
|
+
position: fixed;
|
|
942
|
+
inset: 0;
|
|
943
|
+
z-index: 9999;
|
|
944
|
+
display: none;
|
|
945
|
+
flex-direction: column;
|
|
946
|
+
background: rgba(10, 10, 14, 0.92);
|
|
947
|
+
backdrop-filter: blur(8px);
|
|
948
|
+
color: #f4f4f6;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.bp-lightbox.is-open {
|
|
952
|
+
display: flex;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
.bp-lightbox-bar {
|
|
956
|
+
display: flex;
|
|
957
|
+
flex-wrap: wrap;
|
|
958
|
+
align-items: center;
|
|
959
|
+
justify-content: space-between;
|
|
960
|
+
gap: 10px 16px;
|
|
961
|
+
padding: 12px 18px;
|
|
962
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
|
|
963
|
+
background: rgba(16, 16, 22, 0.85);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
.bp-lightbox-info {
|
|
967
|
+
display: flex;
|
|
968
|
+
flex-wrap: wrap;
|
|
969
|
+
align-items: center;
|
|
970
|
+
gap: 8px;
|
|
971
|
+
min-width: 0;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
.bp-lightbox-title {
|
|
975
|
+
font-size: 14px;
|
|
976
|
+
font-weight: 600;
|
|
977
|
+
color: #ffffff;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.bp-lightbox-chip {
|
|
981
|
+
padding: 2px 8px;
|
|
982
|
+
border-radius: 999px;
|
|
983
|
+
background: rgba(255, 255, 255, 0.1);
|
|
984
|
+
color: #d6d6de;
|
|
985
|
+
font-size: 12px;
|
|
986
|
+
font-variant-numeric: tabular-nums;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
.bp-lightbox-actions {
|
|
990
|
+
display: flex;
|
|
991
|
+
flex-wrap: wrap;
|
|
992
|
+
align-items: center;
|
|
993
|
+
gap: 8px;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
.bp-lightbox-btn {
|
|
997
|
+
display: inline-flex;
|
|
998
|
+
align-items: center;
|
|
999
|
+
justify-content: center;
|
|
1000
|
+
height: 32px;
|
|
1001
|
+
padding: 0 11px;
|
|
1002
|
+
border-radius: 8px;
|
|
1003
|
+
border: 1px solid rgba(255, 255, 255, 0.18);
|
|
1004
|
+
background: rgba(255, 255, 255, 0.08);
|
|
1005
|
+
color: #f4f4f6;
|
|
1006
|
+
font-size: 12px;
|
|
1007
|
+
font-weight: 500;
|
|
1008
|
+
text-decoration: none;
|
|
1009
|
+
cursor: pointer;
|
|
1010
|
+
transition: background 0.15s ease, border-color 0.15s ease;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
.bp-lightbox-btn:hover {
|
|
1014
|
+
background: rgba(255, 255, 255, 0.16);
|
|
1015
|
+
border-color: rgba(255, 255, 255, 0.34);
|
|
1016
|
+
color: #ffffff;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
.bp-lightbox-stage {
|
|
1020
|
+
position: relative;
|
|
1021
|
+
flex: 1;
|
|
1022
|
+
min-height: 0;
|
|
1023
|
+
overflow: auto;
|
|
1024
|
+
display: flex;
|
|
1025
|
+
align-items: center;
|
|
1026
|
+
justify-content: center;
|
|
1027
|
+
padding: 24px 64px;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
.bp-lightbox-stage.is-zoomed {
|
|
1031
|
+
align-items: flex-start;
|
|
1032
|
+
justify-content: flex-start;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
.bp-lightbox-img {
|
|
1036
|
+
display: block;
|
|
1037
|
+
max-width: 100%;
|
|
1038
|
+
max-height: calc(100vh - 120px);
|
|
1039
|
+
width: auto;
|
|
1040
|
+
height: auto;
|
|
1041
|
+
border-radius: 10px;
|
|
1042
|
+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
|
|
1043
|
+
cursor: zoom-in;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
.bp-lightbox-stage.is-zoomed .bp-lightbox-img {
|
|
1047
|
+
max-width: none;
|
|
1048
|
+
max-height: none;
|
|
1049
|
+
cursor: zoom-out;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
.bp-lightbox-nav {
|
|
1053
|
+
position: fixed;
|
|
1054
|
+
top: 50%;
|
|
1055
|
+
transform: translateY(-50%);
|
|
1056
|
+
width: 40px;
|
|
1057
|
+
height: 40px;
|
|
1058
|
+
border-radius: 999px;
|
|
1059
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
1060
|
+
background: rgba(16, 16, 22, 0.8);
|
|
1061
|
+
color: #ffffff;
|
|
1062
|
+
font-size: 20px;
|
|
1063
|
+
line-height: 1;
|
|
1064
|
+
cursor: pointer;
|
|
1065
|
+
display: inline-flex;
|
|
1066
|
+
align-items: center;
|
|
1067
|
+
justify-content: center;
|
|
1068
|
+
z-index: 10000;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
.bp-lightbox-nav:hover {
|
|
1072
|
+
background: rgba(255, 255, 255, 0.18);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
.bp-lightbox-prev {
|
|
1076
|
+
left: 14px;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
.bp-lightbox-next {
|
|
1080
|
+
right: 14px;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
@media (max-width: 640px) {
|
|
1084
|
+
.bp-doc .bp-screen-showcase {
|
|
1085
|
+
padding: 12px;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
.bp-doc figure.bp-device-frame[data-device="tablet"],
|
|
1089
|
+
.bp-doc figure.bp-device-frame[data-device="mobile"],
|
|
1090
|
+
.bp-doc figure.bp-device-frame[data-device="ios"],
|
|
1091
|
+
.bp-doc figure.bp-device-frame[data-device="android"] {
|
|
1092
|
+
max-width: 100%;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
.bp-lightbox-stage {
|
|
1096
|
+
padding: 14px;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
.bp-lightbox-nav {
|
|
1100
|
+
top: auto;
|
|
1101
|
+
bottom: 16px;
|
|
1102
|
+
transform: none;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
`,rp=`
|
|
1106
|
+
(function() {
|
|
1107
|
+
if (typeof document === 'undefined' || window.__bpScreenGalleryBound) return;
|
|
1108
|
+
window.__bpScreenGalleryBound = true;
|
|
1109
|
+
|
|
1110
|
+
var lightbox = null;
|
|
1111
|
+
var lbItems = [];
|
|
1112
|
+
var lbIndex = 0;
|
|
1113
|
+
|
|
1114
|
+
function ensureLightbox() {
|
|
1115
|
+
if (lightbox && document.body.contains(lightbox)) return lightbox;
|
|
1116
|
+
lightbox = document.createElement('div');
|
|
1117
|
+
lightbox.className = 'bp-lightbox';
|
|
1118
|
+
lightbox.setAttribute('role', 'dialog');
|
|
1119
|
+
lightbox.setAttribute('aria-modal', 'true');
|
|
1120
|
+
lightbox.setAttribute('aria-label', 'Screenshot preview');
|
|
1121
|
+
lightbox.innerHTML =
|
|
1122
|
+
'<div class="bp-lightbox-bar">' +
|
|
1123
|
+
'<div class="bp-lightbox-info">' +
|
|
1124
|
+
'<span class="bp-lightbox-title"></span>' +
|
|
1125
|
+
'<span class="bp-lightbox-chip" data-lb-route></span>' +
|
|
1126
|
+
'<span class="bp-lightbox-chip" data-lb-device></span>' +
|
|
1127
|
+
'<span class="bp-lightbox-chip" data-lb-role></span>' +
|
|
1128
|
+
'<span class="bp-lightbox-chip" data-lb-counter></span>' +
|
|
1129
|
+
'</div>' +
|
|
1130
|
+
'<div class="bp-lightbox-actions">' +
|
|
1131
|
+
'<button type="button" class="bp-lightbox-btn" data-lb-zoom>100% Zoom</button>' +
|
|
1132
|
+
'<button type="button" class="bp-lightbox-btn" data-lb-copy>Copy path</button>' +
|
|
1133
|
+
'<a class="bp-lightbox-btn" data-lb-open target="_blank" rel="noopener noreferrer">Open PNG</a>' +
|
|
1134
|
+
'<button type="button" class="bp-lightbox-btn" data-lb-close aria-label="Close">Close</button>' +
|
|
1135
|
+
'</div>' +
|
|
1136
|
+
'</div>' +
|
|
1137
|
+
'<div class="bp-lightbox-stage">' +
|
|
1138
|
+
'<button type="button" class="bp-lightbox-nav bp-lightbox-prev" data-lb-prev aria-label="Previous screenshot">‹</button>' +
|
|
1139
|
+
'<img class="bp-lightbox-img" alt="">' +
|
|
1140
|
+
'<button type="button" class="bp-lightbox-nav bp-lightbox-next" data-lb-next aria-label="Next screenshot">›</button>' +
|
|
1141
|
+
'</div>';
|
|
1142
|
+
|
|
1143
|
+
document.body.appendChild(lightbox);
|
|
1144
|
+
|
|
1145
|
+
var stage = lightbox.querySelector('.bp-lightbox-stage');
|
|
1146
|
+
var img = lightbox.querySelector('.bp-lightbox-img');
|
|
1147
|
+
var zoomBtn = lightbox.querySelector('[data-lb-zoom]');
|
|
1148
|
+
var copyBtn = lightbox.querySelector('[data-lb-copy]');
|
|
1149
|
+
|
|
1150
|
+
function toggleZoom() {
|
|
1151
|
+
var zoomed = stage.classList.toggle('is-zoomed');
|
|
1152
|
+
zoomBtn.textContent = zoomed ? 'Fit view' : '100% Zoom';
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
zoomBtn.addEventListener('click', toggleZoom);
|
|
1156
|
+
img.addEventListener('click', toggleZoom);
|
|
1157
|
+
lightbox.querySelector('[data-lb-close]').addEventListener('click', closeLightbox);
|
|
1158
|
+
lightbox.querySelector('[data-lb-prev]').addEventListener('click', function() { stepLightbox(-1); });
|
|
1159
|
+
lightbox.querySelector('[data-lb-next]').addEventListener('click', function() { stepLightbox(1); });
|
|
1160
|
+
stage.addEventListener('click', function(e) { if (e.target === stage) closeLightbox(); });
|
|
1161
|
+
copyBtn.addEventListener('click', function() {
|
|
1162
|
+
var current = lbItems[lbIndex];
|
|
1163
|
+
if (!current) return;
|
|
1164
|
+
var value = current.filePath || current.src;
|
|
1165
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
1166
|
+
navigator.clipboard.writeText(value).then(function() {
|
|
1167
|
+
copyBtn.textContent = 'Copied';
|
|
1168
|
+
setTimeout(function() { copyBtn.textContent = 'Copy path'; }, 1600);
|
|
1169
|
+
}).catch(function() {});
|
|
1170
|
+
}
|
|
1171
|
+
});
|
|
1172
|
+
|
|
1173
|
+
document.addEventListener('keydown', function(e) {
|
|
1174
|
+
if (!lightbox || !lightbox.classList.contains('is-open')) return;
|
|
1175
|
+
if (e.key === 'Escape') closeLightbox();
|
|
1176
|
+
else if (e.key === 'ArrowLeft') stepLightbox(-1);
|
|
1177
|
+
else if (e.key === 'ArrowRight') stepLightbox(1);
|
|
1178
|
+
else if (e.key === 'z' || e.key === 'Z') toggleZoom();
|
|
1179
|
+
});
|
|
1180
|
+
|
|
1181
|
+
return lightbox;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
function renderLightbox() {
|
|
1185
|
+
if (!lightbox || !lbItems.length) return;
|
|
1186
|
+
var item = lbItems[lbIndex];
|
|
1187
|
+
var stage = lightbox.querySelector('.bp-lightbox-stage');
|
|
1188
|
+
var img = lightbox.querySelector('.bp-lightbox-img');
|
|
1189
|
+
stage.classList.remove('is-zoomed');
|
|
1190
|
+
lightbox.querySelector('[data-lb-zoom]').textContent = '100% Zoom';
|
|
1191
|
+
img.src = item.src;
|
|
1192
|
+
img.alt = item.alt || item.title;
|
|
1193
|
+
lightbox.querySelector('.bp-lightbox-title').textContent = item.title;
|
|
1194
|
+
var routeEl = lightbox.querySelector('[data-lb-route]');
|
|
1195
|
+
routeEl.textContent = item.route || '';
|
|
1196
|
+
routeEl.style.display = item.route ? '' : 'none';
|
|
1197
|
+
var devEl = lightbox.querySelector('[data-lb-device]');
|
|
1198
|
+
devEl.textContent = item.deviceLabel;
|
|
1199
|
+
var roleEl = lightbox.querySelector('[data-lb-role]');
|
|
1200
|
+
roleEl.textContent = item.role && item.role !== 'default' ? ['role: ', item.role].join('') : '';
|
|
1201
|
+
roleEl.style.display = item.role && item.role !== 'default' ? '' : 'none';
|
|
1202
|
+
lightbox.querySelector('[data-lb-counter]').textContent = [lbIndex + 1, ' / ', lbItems.length].join('');
|
|
1203
|
+
lightbox.querySelector('[data-lb-open]').setAttribute('href', item.src);
|
|
1204
|
+
lightbox.querySelector('[data-lb-prev]').style.display = lbItems.length > 1 ? '' : 'none';
|
|
1205
|
+
lightbox.querySelector('[data-lb-next]').style.display = lbItems.length > 1 ? '' : 'none';
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
function openLightbox(items, index) {
|
|
1209
|
+
ensureLightbox();
|
|
1210
|
+
lbItems = items;
|
|
1211
|
+
lbIndex = index;
|
|
1212
|
+
renderLightbox();
|
|
1213
|
+
lightbox.classList.add('is-open');
|
|
1214
|
+
document.documentElement.style.overflow = 'hidden';
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
function closeLightbox() {
|
|
1218
|
+
if (!lightbox) return;
|
|
1219
|
+
lightbox.classList.remove('is-open');
|
|
1220
|
+
document.documentElement.style.overflow = '';
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
function stepLightbox(delta) {
|
|
1224
|
+
if (!lbItems.length) return;
|
|
1225
|
+
lbIndex = (lbIndex + delta + lbItems.length) % lbItems.length;
|
|
1226
|
+
renderLightbox();
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
function collectVisibleItems(root) {
|
|
1230
|
+
var items = [];
|
|
1231
|
+
root.querySelectorAll('figure.bp-device-frame').forEach(function(fig) {
|
|
1232
|
+
if (fig.hidden) return;
|
|
1233
|
+
var showcase = fig.closest('.bp-screen-showcase');
|
|
1234
|
+
if (showcase && showcase.hidden) return;
|
|
1235
|
+
var profileGroup = fig.closest('.bp-screen-profile-group');
|
|
1236
|
+
if (profileGroup && profileGroup.hidden) return;
|
|
1237
|
+
var img = fig.querySelector('img');
|
|
1238
|
+
if (!img) return;
|
|
1239
|
+
items.push({
|
|
1240
|
+
figure: fig,
|
|
1241
|
+
src: img.currentSrc || img.getAttribute('src') || '',
|
|
1242
|
+
alt: img.getAttribute('alt') || '',
|
|
1243
|
+
title: fig.getAttribute('data-screen-title') || (showcase ? showcase.getAttribute('data-screen-title') : '') || img.getAttribute('alt') || 'Screenshot',
|
|
1244
|
+
route: fig.getAttribute('data-screen-route') || (showcase ? showcase.getAttribute('data-screen-route') : '') || '',
|
|
1245
|
+
deviceLabel: fig.getAttribute('data-viewport-label') || fig.getAttribute('data-viewport') || '',
|
|
1246
|
+
role: fig.getAttribute('data-profile') || '',
|
|
1247
|
+
filePath: fig.getAttribute('data-file-path') || ''
|
|
1248
|
+
});
|
|
1249
|
+
});
|
|
1250
|
+
return items;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
function initScreenGalleries() {
|
|
1254
|
+
document.querySelectorAll('[data-bp-screens-gallery]').forEach(function(root) {
|
|
1255
|
+
if (root.getAttribute('data-bp-initialized') === '1') return;
|
|
1256
|
+
root.setAttribute('data-bp-initialized', '1');
|
|
1257
|
+
|
|
1258
|
+
var state = {
|
|
1259
|
+
viewport: 'all',
|
|
1260
|
+
profile: 'all',
|
|
1261
|
+
scheme: 'all',
|
|
1262
|
+
query: '',
|
|
1263
|
+
mode: root.getAttribute('data-bp-view-mode') || 'stage'
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1266
|
+
var searchInput = root.querySelector('[data-bp-filter-search]');
|
|
1267
|
+
var countEl = root.querySelector('[data-bp-screens-count]');
|
|
1268
|
+
var emptyEl = root.querySelector('[data-bp-screens-empty]');
|
|
1269
|
+
var showcases = Array.prototype.slice.call(root.querySelectorAll('.bp-screen-showcase'));
|
|
1270
|
+
var films = Array.prototype.slice.call(root.querySelectorAll('.bp-film-card'));
|
|
1271
|
+
|
|
1272
|
+
function syncTabs(group) {
|
|
1273
|
+
var visibleFrames = Array.prototype.slice.call(group.querySelectorAll('figure.bp-device-frame')).filter(function(f) { return !f.hidden; });
|
|
1274
|
+
var tabs = Array.prototype.slice.call(group.querySelectorAll('.bp-screen-tab'));
|
|
1275
|
+
var activeTab = null;
|
|
1276
|
+
tabs.forEach(function(tab) {
|
|
1277
|
+
var vp = tab.getAttribute('data-tab-viewport');
|
|
1278
|
+
var matching = visibleFrames.some(function(f) { return f.getAttribute('data-viewport') === vp; });
|
|
1279
|
+
tab.hidden = !matching;
|
|
1280
|
+
if (matching && tab.classList.contains('is-active')) activeTab = tab;
|
|
1281
|
+
});
|
|
1282
|
+
if (!activeTab) {
|
|
1283
|
+
activeTab = tabs.find(function(t) { return !t.hidden; }) || null;
|
|
1284
|
+
}
|
|
1285
|
+
tabs.forEach(function(t) { t.classList.toggle('is-active', t === activeTab); });
|
|
1286
|
+
var activeVp = activeTab ? activeTab.getAttribute('data-tab-viewport') : null;
|
|
1287
|
+
visibleFrames.forEach(function(f, idx) {
|
|
1288
|
+
f.classList.toggle('is-tab-active', activeVp ? f.getAttribute('data-viewport') === activeVp : idx === 0);
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
function applyFilters() {
|
|
1293
|
+
root.setAttribute('data-bp-view-mode', state.mode);
|
|
1294
|
+
var q = state.query.trim().toLowerCase();
|
|
1295
|
+
var visibleScreens = 0;
|
|
1296
|
+
|
|
1297
|
+
films.forEach(function(card) {
|
|
1298
|
+
var vp = card.getAttribute('data-viewport') || '';
|
|
1299
|
+
var scheme = card.getAttribute('data-scheme') || 'light';
|
|
1300
|
+
var vpOk = state.viewport === 'all' || vp === state.viewport;
|
|
1301
|
+
var schemeOk = state.scheme === 'all' || scheme === state.scheme;
|
|
1302
|
+
card.hidden = !(vpOk && schemeOk);
|
|
1303
|
+
});
|
|
1304
|
+
|
|
1305
|
+
showcases.forEach(function(showcase) {
|
|
1306
|
+
var title = (showcase.getAttribute('data-screen-title') || '').toLowerCase();
|
|
1307
|
+
var route = (showcase.getAttribute('data-screen-route') || '').toLowerCase();
|
|
1308
|
+
var id = (showcase.getAttribute('data-screen-id') || '').toLowerCase();
|
|
1309
|
+
var textMatch = !q || title.indexOf(q) !== -1 || route.indexOf(q) !== -1 || id.indexOf(q) !== -1;
|
|
1310
|
+
|
|
1311
|
+
var anyProfileVisible = false;
|
|
1312
|
+
showcase.querySelectorAll('.bp-screen-profile-group').forEach(function(group) {
|
|
1313
|
+
var prof = group.getAttribute('data-profile') || 'default';
|
|
1314
|
+
var profMatch = state.profile === 'all' || prof === state.profile;
|
|
1315
|
+
var anyFrameVisible = false;
|
|
1316
|
+
|
|
1317
|
+
group.querySelectorAll('figure.bp-device-frame').forEach(function(fig) {
|
|
1318
|
+
var vp = fig.getAttribute('data-viewport') || '';
|
|
1319
|
+
var scheme = fig.getAttribute('data-scheme') || 'light';
|
|
1320
|
+
var show = textMatch && profMatch && (state.viewport === 'all' || vp === state.viewport) && (state.scheme === 'all' || scheme === state.scheme);
|
|
1321
|
+
fig.hidden = !show;
|
|
1322
|
+
if (show) anyFrameVisible = true;
|
|
1323
|
+
});
|
|
1324
|
+
|
|
1325
|
+
group.hidden = !anyFrameVisible;
|
|
1326
|
+
if (anyFrameVisible) {
|
|
1327
|
+
anyProfileVisible = true;
|
|
1328
|
+
syncTabs(group);
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
|
|
1332
|
+
showcase.hidden = !anyProfileVisible;
|
|
1333
|
+
var prev = showcase.previousElementSibling;
|
|
1334
|
+
if (prev && prev.tagName === 'H3') prev.hidden = !anyProfileVisible;
|
|
1335
|
+
if (anyProfileVisible) visibleScreens++;
|
|
1336
|
+
});
|
|
1337
|
+
|
|
1338
|
+
// Hide section groups and their h2 headings when every screen inside is filtered out.
|
|
1339
|
+
root.querySelectorAll('[data-bp-screen-group]').forEach(function(groupEl) {
|
|
1340
|
+
var hasVisible = Array.prototype.some.call(groupEl.querySelectorAll('.bp-screen-showcase'), function(s) { return !s.hidden; });
|
|
1341
|
+
groupEl.hidden = !hasVisible;
|
|
1342
|
+
});
|
|
1343
|
+
|
|
1344
|
+
var filmsWrap = root.querySelector('.bp-screens-films');
|
|
1345
|
+
if (filmsWrap) {
|
|
1346
|
+
var hasFilm = films.some(function(f) { return !f.hidden; });
|
|
1347
|
+
filmsWrap.hidden = !hasFilm;
|
|
1348
|
+
var filmHeading = filmsWrap.previousElementSibling;
|
|
1349
|
+
if (filmHeading && filmHeading.tagName === 'H2') filmHeading.hidden = !hasFilm;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
if (countEl) countEl.textContent = ['Showing ', visibleScreens, ' of ', showcases.length, ' screens'].join('');
|
|
1353
|
+
if (emptyEl) emptyEl.hidden = visibleScreens > 0;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
root.querySelectorAll('[data-bp-filter-viewport]').forEach(function(btn) {
|
|
1357
|
+
btn.addEventListener('click', function() {
|
|
1358
|
+
state.viewport = btn.getAttribute('data-bp-filter-viewport') || 'all';
|
|
1359
|
+
root.querySelectorAll('[data-bp-filter-viewport]').forEach(function(b) { b.classList.toggle('is-active', b === btn); });
|
|
1360
|
+
applyFilters();
|
|
1361
|
+
});
|
|
1362
|
+
});
|
|
1363
|
+
|
|
1364
|
+
root.querySelectorAll('[data-bp-filter-profile]').forEach(function(btn) {
|
|
1365
|
+
btn.addEventListener('click', function() {
|
|
1366
|
+
state.profile = btn.getAttribute('data-bp-filter-profile') || 'all';
|
|
1367
|
+
root.querySelectorAll('[data-bp-filter-profile]').forEach(function(b) { b.classList.toggle('is-active', b === btn); });
|
|
1368
|
+
applyFilters();
|
|
1369
|
+
});
|
|
1370
|
+
});
|
|
1371
|
+
|
|
1372
|
+
root.querySelectorAll('[data-bp-filter-scheme]').forEach(function(btn) {
|
|
1373
|
+
btn.addEventListener('click', function() {
|
|
1374
|
+
state.scheme = btn.getAttribute('data-bp-filter-scheme') || 'all';
|
|
1375
|
+
root.querySelectorAll('[data-bp-filter-scheme]').forEach(function(b) { b.classList.toggle('is-active', b === btn); });
|
|
1376
|
+
applyFilters();
|
|
1377
|
+
});
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1380
|
+
root.querySelectorAll('[data-bp-mode]').forEach(function(btn) {
|
|
1381
|
+
btn.addEventListener('click', function() {
|
|
1382
|
+
state.mode = btn.getAttribute('data-bp-mode') || 'stage';
|
|
1383
|
+
root.querySelectorAll('[data-bp-mode]').forEach(function(b) { b.classList.toggle('is-active', b === btn); });
|
|
1384
|
+
applyFilters();
|
|
1385
|
+
});
|
|
1386
|
+
});
|
|
1387
|
+
|
|
1388
|
+
if (searchInput) {
|
|
1389
|
+
searchInput.addEventListener('input', function() {
|
|
1390
|
+
state.query = searchInput.value || '';
|
|
1391
|
+
applyFilters();
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
root.querySelectorAll('.bp-screen-tab').forEach(function(tab) {
|
|
1396
|
+
tab.addEventListener('click', function() {
|
|
1397
|
+
var group = tab.closest('.bp-screen-profile-group');
|
|
1398
|
+
if (!group) return;
|
|
1399
|
+
group.querySelectorAll('.bp-screen-tab').forEach(function(t) { t.classList.toggle('is-active', t === tab); });
|
|
1400
|
+
syncTabs(group);
|
|
1401
|
+
});
|
|
1402
|
+
});
|
|
1403
|
+
|
|
1404
|
+
root.addEventListener('click', function(e) {
|
|
1405
|
+
var shell = e.target.closest('.bp-device-shell');
|
|
1406
|
+
if (!shell) return;
|
|
1407
|
+
var fig = shell.closest('figure.bp-device-frame');
|
|
1408
|
+
if (!fig) return;
|
|
1409
|
+
var items = collectVisibleItems(root);
|
|
1410
|
+
var idx = items.findIndex(function(item) { return item.figure === fig; });
|
|
1411
|
+
if (idx !== -1) openLightbox(items, idx);
|
|
1412
|
+
});
|
|
1413
|
+
|
|
1414
|
+
applyFilters();
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
document.addEventListener('DOMContentLoaded', initScreenGalleries);
|
|
1419
|
+
document.addEventListener('bp:navigated', initScreenGalleries);
|
|
1420
|
+
if (document.readyState !== 'loading') initScreenGalleries();
|
|
1421
|
+
})();
|
|
1422
|
+
`;function pb(){return`
|
|
316
1423
|
/* VitePress Theme for BunPress */
|
|
317
1424
|
${`/**
|
|
318
1425
|
* VitePress Theme for BunPress
|
|
@@ -1365,6 +2472,20 @@ mjx-container > svg {
|
|
|
1365
2472
|
font-weight: 600;
|
|
1366
2473
|
}
|
|
1367
2474
|
|
|
2475
|
+
.bp-doc p > img,
|
|
2476
|
+
.bp-doc figure > img,
|
|
2477
|
+
.bp-doc video {
|
|
2478
|
+
border-radius: 10px;
|
|
2479
|
+
border: 1px solid var(--bp-c-divider);
|
|
2480
|
+
box-shadow: var(--bp-shadow-1);
|
|
2481
|
+
background: var(--bp-c-bg-soft);
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
.bp-doc video {
|
|
2485
|
+
width: 100%;
|
|
2486
|
+
margin: 16px 0;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
1368
2489
|
/**
|
|
1369
2490
|
* Lists
|
|
1370
2491
|
* -------------------------------------------------------------------------- */
|
|
@@ -3877,7 +4998,7 @@ ${`/**
|
|
|
3877
4998
|
border-radius: 0;
|
|
3878
4999
|
border: none;
|
|
3879
5000
|
}`}
|
|
3880
|
-
`}function
|
|
5001
|
+
`}function jx(){return`/**
|
|
3881
5002
|
* VitePress Theme for BunPress
|
|
3882
5003
|
* Colors: Solid
|
|
3883
5004
|
* -------------------------------------------------------------------------- */
|
|
@@ -4522,7 +5643,7 @@ ${`/**
|
|
|
4522
5643
|
|
|
4523
5644
|
.bpi-corner-down-left {
|
|
4524
5645
|
--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");
|
|
4525
|
-
}`}function
|
|
5646
|
+
}`}function Ux(){return`/**
|
|
4526
5647
|
* VitePress Theme for BunPress - Base Styles
|
|
4527
5648
|
* -------------------------------------------------------------------------- */
|
|
4528
5649
|
|
|
@@ -4927,6 +6048,20 @@ mjx-container > svg {
|
|
|
4927
6048
|
font-weight: 600;
|
|
4928
6049
|
}
|
|
4929
6050
|
|
|
6051
|
+
.bp-doc p > img,
|
|
6052
|
+
.bp-doc figure > img,
|
|
6053
|
+
.bp-doc video {
|
|
6054
|
+
border-radius: 10px;
|
|
6055
|
+
border: 1px solid var(--bp-c-divider);
|
|
6056
|
+
box-shadow: var(--bp-shadow-1);
|
|
6057
|
+
background: var(--bp-c-bg-soft);
|
|
6058
|
+
}
|
|
6059
|
+
|
|
6060
|
+
.bp-doc video {
|
|
6061
|
+
width: 100%;
|
|
6062
|
+
margin: 16px 0;
|
|
6063
|
+
}
|
|
6064
|
+
|
|
4930
6065
|
/**
|
|
4931
6066
|
* Lists
|
|
4932
6067
|
* -------------------------------------------------------------------------- */
|
|
@@ -5547,7 +6682,7 @@ mjx-container > svg {
|
|
|
5547
6682
|
.bp-doc .custom-block .bp-code-group .tabs {
|
|
5548
6683
|
margin: 0;
|
|
5549
6684
|
border-radius: 8px 8px 0 0;
|
|
5550
|
-
}`}function
|
|
6685
|
+
}`}function _x(){return`/**
|
|
5551
6686
|
* VitePress Theme for BunPress - Custom Blocks
|
|
5552
6687
|
* -------------------------------------------------------------------------- */
|
|
5553
6688
|
|
|
@@ -5975,7 +7110,7 @@ mjx-container > svg {
|
|
|
5975
7110
|
|
|
5976
7111
|
.github-alert-caution .github-alert-icon {
|
|
5977
7112
|
fill: var(--bp-c-caution-1);
|
|
5978
|
-
}`}function
|
|
7113
|
+
}`}function Bx(){return`/**
|
|
5979
7114
|
* VitePress Theme for BunPress - Code Groups
|
|
5980
7115
|
* -------------------------------------------------------------------------- */
|
|
5981
7116
|
|
|
@@ -6116,7 +7251,7 @@ mjx-container > svg {
|
|
|
6116
7251
|
margin: 0;
|
|
6117
7252
|
border-radius: 0;
|
|
6118
7253
|
border: none;
|
|
6119
|
-
}`}var
|
|
7254
|
+
}`}var Ax={name:"vitepress",getCSS:pb,getVars:jx,getBase:Ux,getCustomBlocks:_x,getCodeGroups:Bx},mp=Ax;var sp=`
|
|
6120
7255
|
/* Bun theme palette (bun.com/docs) */
|
|
6121
7256
|
:root {
|
|
6122
7257
|
--bun-canvas: #ffffff;
|
|
@@ -6315,7 +7450,7 @@ html.dark {
|
|
|
6315
7450
|
--bp-c-default-soft: rgba(234, 234, 232, 0.06);
|
|
6316
7451
|
--bp-code-line-highlight-color: rgba(255, 46, 151, 0.12);
|
|
6317
7452
|
}
|
|
6318
|
-
`,
|
|
7453
|
+
`,np=`
|
|
6319
7454
|
/* Bun theme: chrome */
|
|
6320
7455
|
html body {
|
|
6321
7456
|
font-family: var(--bp-font-family-base);
|
|
@@ -6990,7 +8125,7 @@ html .BPFooter {
|
|
|
6990
8125
|
padding: 24px 20px 40px;
|
|
6991
8126
|
}
|
|
6992
8127
|
}
|
|
6993
|
-
`,
|
|
8128
|
+
`,tp=`
|
|
6994
8129
|
/* Bun theme: prose */
|
|
6995
8130
|
html .bp-doc {
|
|
6996
8131
|
font-size: 16.48px;
|
|
@@ -7228,30 +8363,30 @@ html .bp-doc :is(table, .enhanced-table) td {
|
|
|
7228
8363
|
color: color-mix(in srgb, var(--bun-fg) 88%, transparent);
|
|
7229
8364
|
border-bottom: 0;
|
|
7230
8365
|
}
|
|
7231
|
-
`,
|
|
7232
|
-
`)}function
|
|
7233
|
-
${
|
|
7234
|
-
${
|
|
7235
|
-
${
|
|
7236
|
-
${
|
|
7237
|
-
${
|
|
7238
|
-
${
|
|
7239
|
-
${
|
|
7240
|
-
${
|
|
7241
|
-
${
|
|
7242
|
-
${
|
|
7243
|
-
${
|
|
7244
|
-
${
|
|
7245
|
-
${
|
|
7246
|
-
${
|
|
7247
|
-
${
|
|
7248
|
-
${
|
|
7249
|
-
${
|
|
7250
|
-
${
|
|
7251
|
-
${
|
|
7252
|
-
${
|
|
7253
|
-
${
|
|
7254
|
-
${
|
|
8366
|
+
`,ip=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='square'%3E%3Cpath d='M14 3H6v18h12V7z'/%3E%3Cpath d='M14 3v4h4'/%3E%3C/svg%3E")`,lp=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='square'%3E%3Cpath d='m5 8 4 4-4 4'/%3E%3Cpath d='M12 16h7'/%3E%3C/svg%3E")`,Ox=["bash","sh","shell","zsh","console","terminal","shellscript","fish","powershell","ps1"];function op(b){return Ox.map((x)=>`html .bp-doc pre[data-lang="${x}"]${b}`).join(`,
|
|
8367
|
+
`)}function ap(b){let x=`${b} :is(.bp-doc, .BPHeroCode)`;return`
|
|
8368
|
+
${x} .token { color: var(--bun-sk-text) !important; }
|
|
8369
|
+
${x} .token[class*='variable-parameter'],
|
|
8370
|
+
${x} .token[class*='parameter'] { color: var(--bun-sk-param) !important; }
|
|
8371
|
+
${x} .token[class*='entity-name-type'],
|
|
8372
|
+
${x} .token[class*='entity-name-class'],
|
|
8373
|
+
${x} .token[class*='support-type'],
|
|
8374
|
+
${x} .token[class*='support-class'],
|
|
8375
|
+
${x} .token[class*='entity-other-inherited'] { color: var(--bun-sk-type) !important; }
|
|
8376
|
+
${x} .token[class*='entity-name-function'],
|
|
8377
|
+
${x} .token[class*='support-function'],
|
|
8378
|
+
${x} .token[class*='meta-function-call'],
|
|
8379
|
+
${x} .token[class*='entity-other-attribute'] { color: var(--bun-sk-fn) !important; }
|
|
8380
|
+
${x} .token[class*='constant'],
|
|
8381
|
+
${x} .token[class*='support-constant'],
|
|
8382
|
+
${x} .token[class*='variable-language'] { color: var(--bun-sk-const) !important; }
|
|
8383
|
+
${x} .token[class*='keyword'],
|
|
8384
|
+
${x} .token[class*='storage'],
|
|
8385
|
+
${x} .token[class*='entity-name-tag'] { color: var(--bun-sk-keyword) !important; }
|
|
8386
|
+
${x} .token[class*='string'],
|
|
8387
|
+
${x} .token[class*='markup-inline-raw'] { color: var(--bun-sk-string) !important; }
|
|
8388
|
+
${x} .token[class*='comment'] { color: var(--bun-sk-comment) !important; font-style: italic; }
|
|
8389
|
+
${x} .token[class*='invalid'] { color: var(--bun-danger) !important; }`}var ep=`
|
|
7255
8390
|
/* Bun theme: code */
|
|
7256
8391
|
html .bp-doc pre[data-lang],
|
|
7257
8392
|
html .bp-doc div[class*='language-'] {
|
|
@@ -7303,19 +8438,19 @@ html .bp-doc pre[data-lang]::after {
|
|
|
7303
8438
|
width: 16px;
|
|
7304
8439
|
height: 16px;
|
|
7305
8440
|
background-color: var(--bun-fg-muted);
|
|
7306
|
-
-webkit-mask: ${
|
|
7307
|
-
mask: ${
|
|
8441
|
+
-webkit-mask: ${ip} center / contain no-repeat;
|
|
8442
|
+
mask: ${ip} center / contain no-repeat;
|
|
7308
8443
|
z-index: 3;
|
|
7309
8444
|
pointer-events: none;
|
|
7310
8445
|
}
|
|
7311
8446
|
|
|
7312
|
-
${
|
|
8447
|
+
${op("::before")} {
|
|
7313
8448
|
content: "terminal";
|
|
7314
8449
|
}
|
|
7315
8450
|
|
|
7316
|
-
${
|
|
7317
|
-
-webkit-mask-image: ${
|
|
7318
|
-
mask-image: ${
|
|
8451
|
+
${op("::after")} {
|
|
8452
|
+
-webkit-mask-image: ${lp};
|
|
8453
|
+
mask-image: ${lp};
|
|
7319
8454
|
}
|
|
7320
8455
|
|
|
7321
8456
|
html .bp-doc pre[data-lang] code,
|
|
@@ -7449,19 +8584,19 @@ html .bp-doc .code-group pre[data-lang]::after {
|
|
|
7449
8584
|
}
|
|
7450
8585
|
|
|
7451
8586
|
/* Syntax: Bun's palette, by scope, over whatever the highlighter wrote inline. */
|
|
7452
|
-
${
|
|
7453
|
-
${
|
|
7454
|
-
`,
|
|
7455
|
-
${
|
|
8587
|
+
${ap("html")}
|
|
8588
|
+
${ap("html.dark")}
|
|
8589
|
+
`,ib=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='square'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E")`,Fx=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='square'%3E%3Cpath d='M9 18h6M10 21h4'/%3E%3Cpath d='M12 3a6 6 0 0 0-3.5 10.9V15h7v-1.1A6 6 0 0 0 12 3z'/%3E%3C/svg%3E")`,Rx=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='square'%3E%3Cpath d='M12 3 2 20h20z'/%3E%3Cpath d='M12 10v4M12 17v.5'/%3E%3C/svg%3E")`,Lx=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='square'%3E%3Cpath d='M8 3h8l5 5v8l-5 5H8l-5-5V8z'/%3E%3Cpath d='M12 8v5M12 16v.5'/%3E%3C/svg%3E")`;function xb(b,x,p){return`
|
|
8590
|
+
${b.map((v)=>`html .bp-doc ${v}`).join(`,
|
|
7456
8591
|
`)} {
|
|
7457
|
-
--bun-callout: var(${
|
|
7458
|
-
--bun-callout-icon: ${
|
|
7459
|
-
}`}var
|
|
8592
|
+
--bun-callout: var(${x});
|
|
8593
|
+
--bun-callout-icon: ${p};
|
|
8594
|
+
}`}var b1=`
|
|
7460
8595
|
/* Bun theme: callouts */
|
|
7461
8596
|
html .bp-doc .custom-block,
|
|
7462
8597
|
html .bp-doc .github-alert {
|
|
7463
8598
|
--bun-callout: var(--bun-info);
|
|
7464
|
-
--bun-callout-icon: ${
|
|
8599
|
+
--bun-callout-icon: ${ib};
|
|
7465
8600
|
position: relative;
|
|
7466
8601
|
margin: 20px 0;
|
|
7467
8602
|
padding: 14px 16px 14px 44px;
|
|
@@ -7485,11 +8620,11 @@ html .bp-doc .github-alert::before {
|
|
|
7485
8620
|
-webkit-mask: var(--bun-callout-icon) center / contain no-repeat;
|
|
7486
8621
|
mask: var(--bun-callout-icon) center / contain no-repeat;
|
|
7487
8622
|
}
|
|
7488
|
-
${
|
|
7489
|
-
${
|
|
7490
|
-
${
|
|
7491
|
-
${
|
|
7492
|
-
${
|
|
8623
|
+
${xb([".custom-block.tip",".github-alert-tip"],"--bun-success",Fx)}
|
|
8624
|
+
${xb([".custom-block.warning",".github-alert-warning"],"--bun-warning",Rx)}
|
|
8625
|
+
${xb([".custom-block.danger",".custom-block.caution",".github-alert-caution"],"--bun-danger",Lx)}
|
|
8626
|
+
${xb([".github-alert-important"],"--bun-important",ib)}
|
|
8627
|
+
${xb([".custom-block.details"],"--bun-fg-muted",ib)}
|
|
7493
8628
|
|
|
7494
8629
|
html .bp-doc .custom-block-title,
|
|
7495
8630
|
html .bp-doc .github-alert-title {
|
|
@@ -7562,7 +8697,7 @@ html .bp-doc details.custom-block summary {
|
|
|
7562
8697
|
color: var(--bun-fg);
|
|
7563
8698
|
cursor: pointer;
|
|
7564
8699
|
}
|
|
7565
|
-
`,
|
|
8700
|
+
`,p1=`
|
|
7566
8701
|
/* Bun theme: home */
|
|
7567
8702
|
html .BPHero-name {
|
|
7568
8703
|
font-family: var(--bp-font-family-mono);
|
|
@@ -7687,40 +8822,40 @@ html .BPSearch-panel {
|
|
|
7687
8822
|
border-radius: var(--bun-radius-lg);
|
|
7688
8823
|
box-shadow: none;
|
|
7689
8824
|
}
|
|
7690
|
-
`;function
|
|
8825
|
+
`;function x1(){return`${pb()}
|
|
7691
8826
|
/* Bun Theme for BunPress (bun.com/docs) */
|
|
7692
|
-
${
|
|
7693
|
-
${
|
|
7694
|
-
${
|
|
7695
|
-
${
|
|
7696
|
-
${
|
|
7697
|
-
${
|
|
7698
|
-
`}function
|
|
7699
|
-
${
|
|
8827
|
+
${sp}
|
|
8828
|
+
${np}
|
|
8829
|
+
${tp}
|
|
8830
|
+
${ep}
|
|
8831
|
+
${b1}
|
|
8832
|
+
${p1}
|
|
8833
|
+
`}function Nx(){return sp}function Mx(){return`${np}
|
|
8834
|
+
${tp}`}function fx(){return b1}function Ix(){return ep}function Dx(){return p1}var Tx={name:"bun",getCSS:x1,getVars:Nx,getBase:Mx,getCustomBlocks:fx,getCodeGroups:Ix,getExtras:Dx},v1=Tx;var kx={vitepress:mp,bun:v1};function w1(b="vitepress"){let x=kx[b];if(!x)return console.warn(`[BunPress] Unknown theme: ${b}, falling back to vitepress`),pb();return x.getCSS()}async function Sx(b,x){let p=hb(b,x);if(p.length===0)return"";let v=await Promise.all(p.map(async(w)=>{if(w.link){let{html:z}=bp(b,[w],x,0);return await L("sidebar-section",{heading:"",items:z,collapsedClass:""})}let{html:q,active:Z}=w.items?bp(b,w.items,x,0):{html:"",active:!1};return await L("sidebar-section",{heading:await L("sidebar-section-heading",{title:w.text}),items:q,collapsedClass:w.collapsed&&!Z?" collapsed":""})}));return await L("sidebar",{sections:v.join("")})}function bp(b,x,p,v){let w=!1;return{html:x.map((Z)=>{let z=!!Z.link&&Z.link===p;if(Z.items?.length){let Q=bp(b,Z.items,p,v+1),V=z||Q.active;w||=V;let Y=Z.collapsed&&!V,X=Z.link?`<a class="BPSidebarGroup-link${z?" is-active":""}" href="${g(b,Z.link)}">${Z.text}</a>`:`<span class="BPSidebarGroup-text">${Z.text}</span>`;return`<li class="BPSidebarGroup${Y?" collapsed":""}${V?" has-active":""}" style="--bp-sidebar-depth:${v}"><div class="BPSidebarGroup-head">${X}<button class="BPSidebarGroup-toggle" type="button" aria-expanded="${Y?"false":"true"}" aria-label="Toggle ${Z.text.replace(/"/g,""")}" 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">${Q.html}</ul></div></li>`}w||=z;let J=g(b,Z.link||"/");return`<li style="--bp-sidebar-depth:${v}"><a class="${z?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${J}">${Z.text}</a></li>`}).join(""),active:w}}Lp(M.markdown?.languageAliases);var Hx=`<button class="BPNavBarHamburger" type="button" aria-label="Toggle navigation" onclick="toggleSidebar()">
|
|
7700
8835
|
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
7701
8836
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
|
|
7702
8837
|
</svg>
|
|
7703
|
-
</button>`,
|
|
8838
|
+
</button>`,Px=`<button class="BPNavToggle" type="button" aria-label="Menu" aria-expanded="false" aria-controls="bp-nav-screen" onclick="toggleNavScreen()">
|
|
7704
8839
|
<svg class="BPNavToggle-open" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
7705
8840
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7h16M4 12h16M4 17h16"></path>
|
|
7706
8841
|
</svg>
|
|
7707
8842
|
<svg class="BPNavToggle-close" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
7708
8843
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 6l12 12M18 6L6 18"></path>
|
|
7709
8844
|
</svg>
|
|
7710
|
-
</button>`;function
|
|
8845
|
+
</button>`;function gx(b){if(!b.keyboard||!b.keys.length)return{hint:"",aria:""};let x=(p,v)=>{let w=[];if(p.ctrl)w.push(v?"Ctrl":"Control");if(p.meta)w.push(v?"\u2318":"Meta");if(p.alt)w.push(v?"\u2325":"Alt");if(p.shift)w.push("Shift");return w.push(p.key.length===1?p.key.toUpperCase():p.key),v?w.join(""):w.join("+")};return{hint:x(b.keys[0],!0),aria:b.keys.map((p)=>x(p,!1)).join(" ")}}function Cx(b,x){let{hint:p,aria:v}=gx(x),w=E(b);return`<button class="BPNavBarSearch" type="button" aria-label="${w}"${v?` aria-keyshortcuts="${E(v)}"`:""}>
|
|
7711
8846
|
<svg class="BPNavBarSearch-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
7712
8847
|
<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>
|
|
7713
8848
|
</svg>
|
|
7714
|
-
<span class="BPNavBarSearch-label">${
|
|
7715
|
-
${
|
|
7716
|
-
</button>`}var
|
|
7717
|
-
`)}async function
|
|
7718
|
-
`);return{aside:await
|
|
8849
|
+
<span class="BPNavBarSearch-label">${w}</span>
|
|
8850
|
+
${p?`<kbd class="BPNavBarSearch-kbd" data-hint="${E(p)}" aria-hidden="true"></kbd>`:""}
|
|
8851
|
+
</button>`}var ux={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 hx(b){let x=pp.themeConfig?.socialLinks;if(!b||!x||b.length!==x.length)return!1;return b.every((p,v)=>p.icon===x[v]?.icon&&p.link===x[v]?.link)}function Lb(b){let x=b.markdown?.themeConfig,p=b.themeConfig,v={...x,...p};if(x?.socialLinks!==void 0&&hx(p?.socialLinks))v.socialLinks=x.socialLinks;return v}function cx(b){return(Lb(b).socialLinks??[]).map(({icon:p,link:v})=>{let w=ux[p?.toLowerCase()],q=p?p.charAt(0).toUpperCase()+p.slice(1):"Link",Z=w?`<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">${w}</svg>`:`<span class="BPSocialLinks-text">${E(q)}</span>`;return`<a href="${E(v)}" target="_blank" rel="noopener external" aria-label="${E(q)}">${Z}</a>`}).join(`
|
|
8852
|
+
`)}async function rx(b,x="On this page"){let p=b.replace(/<nav class="table-of-contents[\s\S]*?<\/nav>/g,""),v=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,w=[],q;while((q=v.exec(p))!==null){let z=Number.parseInt(q[1]),J=q[2],$=q[3];$=$.replace(/<[^>]*>/g,"");let Q=J.match(/id="([^"]*)"/),V=Q?Q[1]:$.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");w.push({level:z,text:$,id:V})}if(w.length===0)return{aside:"",inline:""};let Z=w.map((z)=>{let J=z.level>2?`level-${z.level}`:"";return`<a href="#${z.id}" class="${J}">${z.text}</a>`}).join(`
|
|
8853
|
+
`);return{aside:await L("page-toc",{items:Z,title:x}),inline:await L("page-outline",{items:Z,count:String(w.length),title:x})}}function mx(b){let x=new Set;return b.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(p,v,w,q)=>{if(w.includes("id=")){let $=w.match(/\bid=["']([^"']+)["']/)?.[1];if($)x.add($);return p}let Z=q.match(/\s*\{#([\w-]+)\}\s*$/),z,J=q;if(Z)z=Z[1],J=q.replace(/\s*\{#[\w-]+\}\s*$/,"");else{let $=q.replace(/<[^>]*>/g,"");z=wp($)}return z=qp(z,x),`<h${v}${w} id="${z}">${J}</h${v}>`})}function ix(b,x){let p=typeof x.title==="string"?x.title.trim():"";if(!p||/<h1[\s>]/i.test(b))return b;let v=typeof x.description==="string"?x.description.trim():"",w=(q)=>q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return`<h1>${w(p)}</h1>${v?`<p>${w(v)}</p>`:""}${b}`}var lb="<!--bp-outline-slot-->";function lx(b,x,p="",v=""){if(!x&&!p&&!v)return b;let w=!1,q=b.replace(/<h1(?:\s[^>]*)?>[\s\S]*?<\/h1>/,(Z)=>{return w=!0,`<div class="bp-page-header${v?" has-breadcrumb":""}">${v}${Z}${x}</div>${lb}`});if(w){let Z=q.indexOf(lb),z=q.slice(Z+lb.length),J=v?/^\s*<p(?:\s[^>]*)?>[\s\S]*?<\/p>/.exec(z):null;return J?`${q.slice(0,Z)}${J[0]}${p}${z.slice(J[0].length)}`:`${q.slice(0,Z)}${p}${z}`}return`${p}${b}`}function ob(b,x=""){let p=ax(x),v=b.lastIndexOf("</body>");if(v===-1)return b+p;return b.slice(0,v)+p+b.slice(v)}function ab(b,x){if(!x)return b;let p=b.lastIndexOf("</body>");if(p===-1)return b+x;return b.slice(0,p)+x+b.slice(p)}var ox="<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 sb(b){let x=b.indexOf("</head>");if(x===-1)return b;return b.slice(0,x)+ox+b.slice(x)}function ax(b=""){return`<script data-bp-router="1">
|
|
7719
8854
|
(function(){
|
|
7720
8855
|
// The site's mount point ('/docs'). Links are written with it; the page can
|
|
7721
8856
|
// be reached without it (the dev server answers both), so paths are compared
|
|
7722
8857
|
// with it taken off.
|
|
7723
|
-
var basePath = ${JSON.stringify(
|
|
8858
|
+
var basePath = ${JSON.stringify(b)};
|
|
7724
8859
|
function sitePath(p) {
|
|
7725
8860
|
return basePath && (p === basePath || p.indexOf(basePath + '/') === 0) ? (p.slice(basePath.length) || '/') : p;
|
|
7726
8861
|
}
|
|
@@ -7954,8 +9089,8 @@ ${oQ}`}function H0(){return nQ}function y0(){return aQ}function P0(){return tQ}v
|
|
|
7954
9089
|
// styles are added here. Nothing is removed - a block for a component
|
|
7955
9090
|
// that is no longer on screen matches nothing and costs nothing.
|
|
7956
9091
|
var haveStyles = {};
|
|
7957
|
-
document.querySelectorAll('style[${
|
|
7958
|
-
doc.querySelectorAll('style[${
|
|
9092
|
+
document.querySelectorAll('style[${db}]').forEach(function(s) { haveStyles[s.textContent] = true; });
|
|
9093
|
+
doc.querySelectorAll('style[${db}]').forEach(function(s) {
|
|
7959
9094
|
if (haveStyles[s.textContent]) return;
|
|
7960
9095
|
haveStyles[s.textContent] = true;
|
|
7961
9096
|
document.head.appendChild(s.cloneNode(true));
|
|
@@ -8050,105 +9185,108 @@ ${oQ}`}function H0(){return nQ}function y0(){return aQ}function P0(){return tQ}v
|
|
|
8050
9185
|
|
|
8051
9186
|
updateActiveLinks();
|
|
8052
9187
|
})();
|
|
8053
|
-
<`+"/script>"}var
|
|
9188
|
+
<`+"/script>"}var M1=`<svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
8054
9189
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
|
|
8055
|
-
</svg>`;function
|
|
8056
|
-
${
|
|
9190
|
+
</svg>`;function f1(b){return b.themeConfig?.nav||b.markdown?.nav||b.nav||[]}function I1(b){if(typeof b.mega==="boolean")return b.mega;return(b.items??[]).some((x)=>!!x.description||(x.items?.length??0)>0)}function D1(b){let x=b.items??[],p=x.filter((q)=>(q.items?.length??0)>0);if(p.length===0)return[{items:x}];let v=x.filter((q)=>(q.items?.length??0)===0),w=p.map((q)=>({text:q.text,items:q.items??[]}));return v.length>0?[{items:v},...w]:w}function sx(b,x=""){let p=f1(b);if(p.length===0)return"";let v=(Q)=>{return g(b,Q||"/")},w=(Q)=>T1(Q,x),q=(Q)=>w(Q)||(Q.items??[]).some((V)=>q(V)),Z=(Q)=>{let V=Q.icon?`<span class="BPMega-item-icon" aria-hidden="true">${Q.icon}</span>`:"",Y=Q.description?`<span class="BPMega-item-desc">${Q.description}</span>`:"";return`<a class="BPMega-item${w(Q)?" is-active":""}" href="${E(v(Q.link))}">
|
|
9191
|
+
${V}
|
|
8057
9192
|
<span class="BPMega-item-body">
|
|
8058
|
-
<span class="BPMega-item-title">${
|
|
8059
|
-
${
|
|
9193
|
+
<span class="BPMega-item-title">${Q.text}</span>
|
|
9194
|
+
${Y}
|
|
8060
9195
|
</span>
|
|
8061
|
-
</a>`},z=(
|
|
8062
|
-
${
|
|
8063
|
-
${
|
|
9196
|
+
</a>`},z=(Q)=>{let V=D1(Q),Y=Math.max(1,Math.min(Q.columns??V.length,4)),X=V.map((K)=>{return`<div class="BPMega-group">
|
|
9197
|
+
${K.text?`<p class="BPMega-group-title">${K.text}</p>`:""}
|
|
9198
|
+
${K.items.map(Z).join(`
|
|
8064
9199
|
`)}
|
|
8065
9200
|
</div>`}).join(`
|
|
8066
|
-
`),
|
|
8067
|
-
${
|
|
8068
|
-
<a class="BPMega-footer-link" href="${
|
|
8069
|
-
</div>`:"";return`<div class="BPMega BPNavBarMenu-group-items" style="--bp-mega-columns:${
|
|
9201
|
+
`),W=Q.footer?`<div class="BPMega-footer">
|
|
9202
|
+
${Q.footer.note?`<span class="BPMega-footer-note">${Q.footer.note}</span>`:""}
|
|
9203
|
+
<a class="BPMega-footer-link" href="${E(v(Q.footer.link))}">${Q.footer.text}</a>
|
|
9204
|
+
</div>`:"";return`<div class="BPMega BPNavBarMenu-group-items" style="--bp-mega-columns:${Y}">
|
|
8070
9205
|
<div class="BPMega-columns">
|
|
8071
|
-
${
|
|
9206
|
+
${X}
|
|
8072
9207
|
</div>
|
|
8073
|
-
${
|
|
8074
|
-
</div>`},
|
|
8075
|
-
${(
|
|
8076
|
-
</div>`;return
|
|
9208
|
+
${W}
|
|
9209
|
+
</div>`},J=(Q)=>`<div class="BPNavBarMenu-group-items">
|
|
9210
|
+
${(Q.items??[]).map((V)=>`<a href="${E(v(V.link))}"${w(V)?' class="is-active"':""}>${V.text}</a>`).join("")}
|
|
9211
|
+
</div>`;return p.map((Q)=>{if(Q.items&&Q.items.length>0){let Y=I1(Q),X=q(Q)?" is-active":"";return`<div class="BPNavBarMenu-group${Y?" is-mega":""}${X}">
|
|
8077
9212
|
<button class="BPNavBarMenu-group-button" type="button" aria-expanded="false" aria-haspopup="true">
|
|
8078
|
-
<span>${
|
|
8079
|
-
${
|
|
9213
|
+
<span>${Q.text}</span>
|
|
9214
|
+
${M1}
|
|
8080
9215
|
</button>
|
|
8081
|
-
${
|
|
8082
|
-
</div>`}return`<a class="BPNavBarMenu-link${
|
|
8083
|
-
<nav class="BPNavScreen-nav" aria-label="Site">${
|
|
8084
|
-
<summary class="BPNavScreen-summary">${z.text}${
|
|
8085
|
-
<div class="BPNavScreen-items">${
|
|
9216
|
+
${Y?z(Q):J(Q)}
|
|
9217
|
+
</div>`}return`<a class="BPNavBarMenu-link${w(Q)?" is-active":""}" href="${E(v(Q.link))}">${Q.text}</a>`}).join("")}function T1(b,x){if(b.activeMatch)try{return new RegExp(b.activeMatch).test(x)}catch{return!1}if(!b.link)return!1;let p=b.link.split("#")[0].replace(/\/$/,"");return p!==""&&p!=="/"&&(x===p||x.startsWith(`${p}/`))}function nx(b,x=""){let p=f1(b);if(p.length===0)return"";let v=(z)=>g(b,z||"/"),w=(z)=>T1(z,x),q=(z,J)=>`<a class="${J}${w(z)?" is-active":""}" href="${E(v(z.link))}">${z.text}</a>`;return`<div class="BPNavScreen" id="bp-nav-screen" hidden>
|
|
9218
|
+
<nav class="BPNavScreen-nav" aria-label="Site">${p.map((z)=>{if(!z.items||z.items.length===0)return`<div class="BPNavScreen-section">${q(z,"BPNavScreen-link")}</div>`;let $=(I1(z)?D1(z):[{items:z.items}]).map((Q)=>{return`${Q.text?`<p class="BPNavScreen-subtitle">${Q.text}</p>`:""}${Q.items.map((Y)=>q(Y,"BPNavScreen-link")).join("")}`}).join("");return`<details class="BPNavScreen-section"${(z.items??[]).some((Q)=>w(Q))?" open":""}>
|
|
9219
|
+
<summary class="BPNavScreen-summary">${z.text}${M1}</summary>
|
|
9220
|
+
<div class="BPNavScreen-items">${$}</div>
|
|
8086
9221
|
</details>`}).join("")}</nav>
|
|
8087
|
-
</div>`}function
|
|
8088
|
-
`)}function
|
|
8089
|
-
`)}function
|
|
8090
|
-
${JSON.stringify(
|
|
8091
|
-
</script>`}let z={"@context":"https://schema.org","@type":"TechArticle",headline:
|
|
9222
|
+
</div>`}function J1(b,x){let p=P(b);if(!p)return x;if(x===p||x.startsWith(`${p}/`))return x.slice(p.length)||"/";return x}function g(b,x){let p=P(b);if(!p||!x.startsWith("/")||x.startsWith("//"))return x;if(x===p||x.startsWith(`${p}/`))return x;return x==="/"?`${p}/`:`${p}${x}`}function nb(b,x){return b.replace(/\b(href|src|poster|action)="(\/[^"]*)"/g,(p,v,w)=>{let q=g(x,w);return q===w?p:`${v}="${q}"`})}function Nb(b){if(b==="/index")return"/";return b.endsWith("/index")?b.slice(0,-6):b}function tx(b,x,p){if(p)return`<link rel="canonical" href="${E(p)}">`;let v=Rb(b);if(!v)return"";let w=Nb(x);return`<link rel="canonical" href="${v}${w}">`}function ex(b,x,p,v,w){let q=Rb(p);if(!q)return"";let Z=Nb(v),z=`${q}${Z}`,J=p.title||p.markdown?.title||b,$=w||p.markdown?.meta?.["og:image"]||p.markdown?.meta?.ogImage,Q=['<meta property="og:type" content="website">',`<meta property="og:url" content="${z}">`,`<meta property="og:title" content="${E(b)}">`,`<meta property="og:description" content="${E(x)}">`,`<meta property="og:site_name" content="${E(J)}">`];if($){Q.push(`<meta property="og:image" content="${$}">`);let V=p.markdown?.meta??{};for(let Y of["og:image:width","og:image:height","og:image:type","og:image:alt"]){let X=V[Y];if(X!==void 0&&X!==null&&X!=="")Q.push(`<meta property="${Y}" content="${X}">`)}}return Q.join(`
|
|
9223
|
+
`)}function b0(b,x,p,v){let w=p.markdown?.meta?.["twitter:card"]||p.markdown?.meta?.twitterCard||"summary",q=p.markdown?.meta?.["twitter:site"]||p.markdown?.meta?.twitterSite,Z=v||p.markdown?.meta?.["twitter:image"]||p.markdown?.meta?.twitterImage||p.markdown?.meta?.["og:image"]||p.markdown?.meta?.ogImage,z=[`<meta name="twitter:card" content="${w}">`,`<meta name="twitter:title" content="${E(b)}">`,`<meta name="twitter:description" content="${E(x)}">`];if(q)z.push(`<meta name="twitter:site" content="${q}">`);if(Z){z.push(`<meta name="twitter:image" content="${Z}">`);let J=p.markdown?.meta?.["twitter:image:alt"]??p.markdown?.meta?.["og:image:alt"];if(J!==void 0&&J!==null&&J!=="")z.push(`<meta name="twitter:image:alt" content="${J}">`)}return z.join(`
|
|
9224
|
+
`)}function p0(b,x,p,v){let w=Rb(p);if(!w)return"";let q=Nb(v),Z=`${w}${q}`;if(q==="/"){let Q={"@context":"https://schema.org","@type":"WebSite",name:p.title||p.markdown?.title||b,description:x,url:w};return`<script type="application/ld+json">
|
|
9225
|
+
${JSON.stringify(Q,null,2)}
|
|
9226
|
+
</script>`}let z={"@context":"https://schema.org","@type":"TechArticle",headline:b,description:x,url:Z},J=q.split("/").filter(Boolean),$=J.map((Q,V)=>{let Y=V+1,X=`${w}/${J.slice(0,Y).join("/")}`;return{"@type":"ListItem",position:Y,name:Q.replace(/-/g," ").replace(/\b\w/g,(W)=>W.toUpperCase()),item:X}});if($.length>0){let Q={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:$};return`<script type="application/ld+json">
|
|
8092
9227
|
${JSON.stringify(z,null,2)}
|
|
8093
9228
|
</script>
|
|
8094
9229
|
<script type="application/ld+json">
|
|
8095
|
-
${JSON.stringify(
|
|
9230
|
+
${JSON.stringify(Q,null,2)}
|
|
8096
9231
|
</script>`}return`<script type="application/ld+json">
|
|
8097
9232
|
${JSON.stringify(z,null,2)}
|
|
8098
|
-
</script>`}var
|
|
8099
|
-
`);return{fontLinks:
|
|
8100
|
-
`),fontFaceCss:
|
|
8101
|
-
${
|
|
9233
|
+
</script>`}var x0=["Archivo:wdth,wght@62..100,700..900","Martian Mono:wdth,wght@87.5..100,400..600"];function v0(b){let x=b.fonts??(b.theme==="bun"?{google:x0}:void 0);if(!x)return{fontLinks:"",fontFaceCss:""};let p=[],v=x.google?.filter(Boolean)??[];if(v.length>0){if(x.preconnect!==!1)p.push('<link rel="preconnect" href="https://fonts.googleapis.com">'),p.push('<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>');let q=v.map((z)=>`family=${z.trim().replace(/\s+/g,"+")}`).join("&"),Z=x.display??"swap";p.push(`<link href="https://fonts.googleapis.com/css2?${q}&display=${Z}" rel="stylesheet">`)}let w=(x.faces??[]).map((q)=>q.trim()).filter(Boolean).join(`
|
|
9234
|
+
`);return{fontLinks:p.join(`
|
|
9235
|
+
`),fontFaceCss:w}}function w0(b){let x=Lb(b),p=[],v=(z,J)=>{if(J)p.push(` ${z}: ${J};`)},w=x.colors??{};v("--bp-c-brand-1",w.primary),v("--bp-c-brand-2",w.secondary||w.primary),v("--bp-c-brand-3",w.accent||w.secondary||w.primary),v("--bp-c-bg",w.background),v("--bp-c-bg-alt",w.surface),v("--bp-c-bg-soft",w.surface),v("--bp-c-text-1",w.text),v("--bp-c-text-2",w.muted);let q=x.fonts??{};v("--bp-font-family-base",q.body),v("--bp-font-family-mono",q.mono);for(let[z,J]of Object.entries(x.cssVars??{}))v(z.startsWith("--")?z:`--${z}`,J);let Z=[];if(p.length)Z.push(`:root {
|
|
9236
|
+
${p.join(`
|
|
8102
9237
|
`)}
|
|
8103
|
-
}`);if(
|
|
9238
|
+
}`);if(q.heading)Z.push(`.bp-doc h1,
|
|
8104
9239
|
.bp-doc h2,
|
|
8105
9240
|
.bp-doc h3,
|
|
8106
9241
|
.bp-doc h4,
|
|
8107
9242
|
.bp-doc h5,
|
|
8108
9243
|
.bp-doc h6,
|
|
8109
9244
|
.BPHero-text {
|
|
8110
|
-
font-family: ${
|
|
8111
|
-
}`);if(
|
|
8112
|
-
|
|
8113
|
-
`)}function
|
|
8114
|
-
`)}}function
|
|
8115
|
-
`),{fontLinks:
|
|
8116
|
-
`),
|
|
8117
|
-
`),
|
|
8118
|
-
`)||"",
|
|
8119
|
-
`),
|
|
8120
|
-
`)}):"",
|
|
8121
|
-
${
|
|
8122
|
-
${
|
|
8123
|
-
${
|
|
8124
|
-
${
|
|
8125
|
-
${
|
|
8126
|
-
${
|
|
8127
|
-
${
|
|
8128
|
-
${
|
|
8129
|
-
${
|
|
8130
|
-
${
|
|
8131
|
-
${
|
|
8132
|
-
${
|
|
8133
|
-
${
|
|
8134
|
-
${
|
|
8135
|
-
${
|
|
8136
|
-
${
|
|
8137
|
-
${y}
|
|
8138
|
-
${
|
|
8139
|
-
${h}
|
|
8140
|
-
${
|
|
8141
|
-
${
|
|
8142
|
-
${
|
|
8143
|
-
${
|
|
8144
|
-
${
|
|
8145
|
-
${
|
|
8146
|
-
${
|
|
8147
|
-
${
|
|
8148
|
-
${y}
|
|
8149
|
-
${
|
|
8150
|
-
|
|
8151
|
-
|
|
9245
|
+
font-family: ${q.heading};
|
|
9246
|
+
}`);if(x.css)Z.push(x.css);return Z.join(`
|
|
9247
|
+
|
|
9248
|
+
`)}function q0(b,x,p,v){let w=x.match(/<h1(?:\s[^>]*)?>([\s\S]*?)<\/h1>/),q=w?zp(w[1].replace(/<[^>]+>/g,"")).trim():"",Z=typeof b.title==="string"&&b.title.trim()||q||p,z=Z&&Z!==p?`${Z} | ${p}`:p,J=typeof b.description==="string"&&b.description.trim()||v.description||v.markdown?.meta?.description||"Documentation built with BunPress",$=[],Q=(W)=>{$.push(W)},V=b.keywords;if(V){let W=Array.isArray(V)?V.join(", "):String(V);if(W.trim())Q(`<meta name="keywords" content="${E(W)}">`)}if(typeof b.author==="string"&&b.author.trim())Q(`<meta name="author" content="${E(b.author)}">`);if(typeof b.robots==="string"&&b.robots.trim())Q(`<meta name="robots" content="${E(b.robots)}">`);if(b.meta&&typeof b.meta==="object")for(let[W,K]of Object.entries(b.meta)){if(K===void 0||K===null)continue;let j=W.startsWith("og:")?"property":"name";Q(`<meta ${j}="${E(W)}" content="${E(String(K))}">`)}for(let W of k1(b.head))Q(W);let Y=typeof b.image==="string"?b.image:void 0,X=typeof b.canonical==="string"?b.canonical:void 0;return{documentTitle:z,pageTitle:Z,description:J,image:Y,canonical:X,extraTags:$.join(`
|
|
9249
|
+
`)}}function k1(b){if(!Array.isArray(b))return[];let x=[];for(let p of b){if(!Array.isArray(p)||typeof p[0]!=="string")continue;let[v,w]=p;if(!["meta","link","base"].includes(v.toLowerCase()))continue;let q=Object.entries(w??{}).map(([Z,z])=>`${E(Z)}="${E(String(z))}"`).join(" ");x.push(`<${v.toLowerCase()}${q?` ${q}`:""}>`)}return x}async function z0(b,x,p,v,w){let q=Lb(b),Z="",z="",J=q?.editLink?.pattern;if(J&&w&&x.editLink!==!1){let X=Tp(J,v,w),W=q?.editLink?.text??"Edit this page";Z=`<a class="BPDocFooter-edit" href="${E(X)}" 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>${E(W)}</a>`}let $=q?.lastUpdated,Q=x.lastUpdated!==!1,V=$!==void 0&&$!==!1,Y=typeof x.lastUpdated==="string"?x.lastUpdated:void 0;if(Q&&(V||x.lastUpdated===!0||Y)){let X=Y??(w?await Dp(v,w):null);if(X){let W=typeof $==="object"?$:{},K=kp(X,p,W.formatOptions);if(K){let j=W.text??"Last updated";z=`<p class="BPDocFooter-updated">${E(j)}: <time datetime="${E(X)}">${E(K)}</time></p>`}}}if(!Z&&!z)return"";return L("doc-footer",{editLink:Z,lastUpdated:z})}async function Q1(b,x,p,v="doc",w={},q={}){let{i18n:Z,locale:z,sourceFile:J,docsDir:$=x.docsDir||"./docs"}=q,Q=Z??await vp(xp(x),x),V=z||Q.defaultLocale,Y=d1(x,Q,V),X=(A)=>Q.translate(A,V),W=Lb(Y),K=Y.title||W.siteTitle||Y.markdown?.title||"BunPress Documentation",j=W.siteTitle??K,U=q0(w,b,K,Y),B=U.documentTitle,_=U.description,O=Y.theme||"vitepress",G=w1(O),d=fp(Y.markdown?.syntaxHighlightTheme),y=pp.markdown?.css||"",F=Y.markdown?.css||"",N=F&&F!==y?F:"",D=w0(Y),C=tx(Y,p,U.canonical),c=ex(U.pageTitle,_,Y,p,U.image),Zp=b0(U.pageTitle,_,Y,U.image),f=p0(U.pageTitle,_,Y,p),I=Object.entries(Y.markdown?.meta||{}).filter(([A])=>!A.startsWith("og:")&&!A.startsWith("twitter:")&&A!=="description"&&A!=="ogImage"&&A!=="twitterCard"&&A!=="twitterSite"&&A!=="twitterImage").map(([A,k])=>`<meta name="${A}" content="${k}">`).join(`
|
|
9250
|
+
`),{fontLinks:R,fontFaceCss:r}=v0(Y),Zb=y1(Q,Y,p),Mb=k1(Y.head).join(`
|
|
9251
|
+
`),m=[I,Mb,C,Zb,c,Zp,U.extraTags,R].filter(Boolean).join(`
|
|
9252
|
+
`),fb=J0(Y),Ib=Q0(Y),T=Y.markdown?.scripts?.map((A)=>`<script>${A}</script>`).join(`
|
|
9253
|
+
`)||"",i=W1(Q),l=[f,fb,Ib,T,`<script data-bp-screen-gallery="1">${rp}</script>`,i?`<script>${i}</script>`:""].filter(Boolean).join(`
|
|
9254
|
+
`),S=sx(Y,p),Db=Y.search??Y.markdown?.search,Jp=Db?.enabled!==!1,Jb=Db?.algolia,Qp=Db?.provider==="algolia"&&!!Jb?.appId&&!!Jb?.apiKey&&!!Jb?.indexName,H=A1(Y,g(Y,Ob));if(!Y.search?.placeholder&&!Y.markdown?.search?.placeholder)H.placeholder=X("search.placeholder");H.locale=Q.enabled?V:null;let Tb=Jp?await L(Qp?"search-algolia":"search",{placeholder:H.placeholder,runtimeConfig:JSON.stringify(Qp?{...H,algolia:Jb}:H).replace(/</g,"\\u003c")}):"",u=W.footer,kb=u?.message||u?.copyright?await L("footer",{message:u.message?`<p class="BPFooter-message">${u.message}</p>`:"",copyright:u.copyright?`<p class="BPFooter-copyright">${u.copyright}</p>`:""}):"",P1=Q.enabled?await L("locale-switcher",{label:X("nav.menu"),current:eb(Q,V),options:Q.locales.map((A)=>{let k=X1(Q,A,Nb(p)),a=A===V?' aria-current="true"':"";return`<li><a href="${E(k)}" data-locale="${E(A)}"${a}>${E(eb(Q,A))}</a></li>`}).join(`
|
|
9255
|
+
`)}):"",g1=W.logo?`<img class="BPNavBarTitle-logo" src="${E(W.logo)}" alt="">`:"",$p=nx(Y,p),Sb=async(A)=>w.navbar===!1?"":L("navbar",{title:j,logo:g1,localeSwitcher:P1,nav:S,navScreen:A==="doc"?"":$p,navToggle:A==="doc"||!$p?"":Px,searchTrigger:Jp?Cx(H.placeholder,H.shortcuts):"",hamburger:A==="doc"?Hx:"",socialLinks:cx(Y)}),Qb=Y.darkMode??Y.themeConfig?.darkMode??"auto",$b=Qb===!0||Qb==="dark"?"dark":Qb===!1||Qb==="light"?"light":"auto",Hb=$b==="dark"?"dark":"";if(v==="home"){let A=await tb(`${b}
|
|
9256
|
+
${S}`),k=`${r}
|
|
9257
|
+
${G}
|
|
9258
|
+
${d}
|
|
9259
|
+
${Ab}
|
|
9260
|
+
${Ub}
|
|
9261
|
+
${A}
|
|
9262
|
+
${y}
|
|
9263
|
+
${N}
|
|
9264
|
+
${D}`,a=h(`${k}
|
|
9265
|
+
${Xb(k)}`),Cb=await L("layout-home",{htmlClass:Hb,themeMode:$b,lang:V,title:K,documentTitle:B,description:_,meta:m,customCSS:a,navbar:await Sb("plain"),search:Tb,footer:kb,content:b});return nb(ob(sb(ab(yb(Cb),l)),P(Y)),Y)}if(v==="page"){let A=await tb(`${b}
|
|
9266
|
+
${S}`),k=`${r}
|
|
9267
|
+
${G}
|
|
9268
|
+
${d}
|
|
9269
|
+
${Ab}
|
|
9270
|
+
${Ub}
|
|
9271
|
+
${A}
|
|
9272
|
+
${y}
|
|
9273
|
+
${N}
|
|
9274
|
+
${D}`,a=h(`${k}
|
|
9275
|
+
${Xb(k)}`),Cb=await L("layout-page",{htmlClass:Hb,themeMode:$b,lang:V,title:K,documentTitle:B,description:_,meta:m,customCSS:a,navbar:await Sb("plain"),search:Tb,footer:kb,content:b});return nb(ob(sb(ab(yb(Cb),l)),P(Y)),Y)}let Pb=mx(b),Yp=await rx(Pb,X("toc.title")),Vp=await Sx(Y,p),o=O==="bun"?yp(hb(Y,p),p):void 0,C1=o?Wp(o,X("breadcrumb.label")):"",u1=o?Gp(o,(A)=>g(Y,A),{prev:X("docFooter.prev"),next:X("docFooter.next"),nav:X("docFooter.label")}):"",h1=o?ix(Pb,w):Pb,gb=lx(h1,await L("copy-page",{}),Yp.inline,C1),c1=Yp.aside,r1=await tb(`${gb}
|
|
9276
|
+
${S}
|
|
9277
|
+
${Vp}`),Xp=`${r}
|
|
9278
|
+
${G}
|
|
9279
|
+
${d}
|
|
9280
|
+
${Ab}
|
|
9281
|
+
${Ub}
|
|
9282
|
+
${r1}
|
|
9283
|
+
${y}
|
|
9284
|
+
${Op}
|
|
9285
|
+
${N}
|
|
9286
|
+
${D}`,m1=h(`${Xp}
|
|
9287
|
+
${Xb(Xp)}`),i1=`${u1}${await z0(Y,w,V,$,J)}`,l1=await L("layout-doc",{htmlClass:Hb,themeMode:$b,lang:V,title:K,documentTitle:B,description:_,meta:m,customCSS:m1,docClass:Ap(gb)?` ${Bp}`:"",navbar:await Sb("doc"),search:Tb,docFooter:i1,footer:kb,sidebar:w.sidebar===!1?"":Vp,content:gb,pageTOC:c1});return nb(ob(sb(ab(yb(l1),l)),P(Y)),Y)}var _b=null,$1=!1;async function Z0(){if($1)return _b;$1=!0;try{_b=await import("@cwcss/crosswind")}catch{_b=null}return _b}async function tb(b){let x=await Z0();if(!x)return"";let v=new x.Scanner([]).scanContent(b);if(v.size===0)return"";let w=new x.CSSGenerator(x.defaultConfig);for(let q of v)w.generate(q);return w.toCSS(!1,!1)}function J0(b){if(!b.fathom?.enabled||!b.fathom?.siteId)return"";let x=b.fathom.scriptUrl||"https://cdn.usefathom.com/script.js",p=b.fathom.defer!==!1,v=b.fathom.honorDNT||!1,w=b.fathom.auto!==!1,q=b.fathom.canonical,Z=b.fathom.spa||!1,z=[`data-site="${b.fathom.siteId}"`,v?'data-honor-dnt="true"':"",!w?'data-auto="false"':"",q?`data-canonical="${q}"`:"",Z?'data-spa="auto"':""].filter(Boolean).join(" ");return`<script src="${x}" ${z}${p?" defer":""}></script>`}function Q0(b){let x=b.analytics||b.selfHostedAnalytics;if(!x?.enabled||!x?.siteId)return"";let p=Bb(x.siteId);if(x.scriptSrc)return`<script defer src="${Bb(x.scriptSrc)}" data-site="${p}"></script>`;let v=x.apiEndpoint?Bb(x.apiEndpoint):"",w=x.honorDNT?`var dnt=n.doNotTrack||w.doNotTrack||n.msDoNotTrack;if(dnt==="1"||dnt==="yes"||dnt===true){l('DNT enabled, skipping');return;}`:"",q=x.trackHashChanges?"w.addEventListener('hashchange',function(){pv();});":"",Z=x.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)});}}
|
|
9288
|
+
catch (err){l('Outbound error',err);}});`:"",z=v?` data-api="${v}"`:"",J=x.collectEndpoint?`/${x.collectEndpoint.replace(/^\/+/,"")}`:"/collect",$=J==="/collect"?"":` data-collect="${Bb(J)}"`;return`<!-- ts-analytics: privacy-first analytics -->
|
|
9289
|
+
<script data-site="${p}"${z}${$} defer>
|
|
8152
9290
|
(function(){
|
|
8153
9291
|
'use strict';
|
|
8154
9292
|
var d=document,w=window,n=navigator,ss=w.sessionStorage,s=d.currentScript;
|
|
@@ -8157,7 +9295,7 @@ var collect=s.dataset.collect||'/collect';
|
|
|
8157
9295
|
var debug=w.ANALYTICS_DEBUG||false;
|
|
8158
9296
|
function l(){if(debug&&w.console)console.log.apply(console,['[Analytics]'].concat([].slice.call(arguments)));}
|
|
8159
9297
|
try{
|
|
8160
|
-
${
|
|
9298
|
+
${w}
|
|
8161
9299
|
var SK='_tsa_sid',VK='_tsa_vid';
|
|
8162
9300
|
var sid=ss.getItem(SK);
|
|
8163
9301
|
if(!sid){sid=Math.random().toString(36).slice(2)+Date.now().toString(36);ss.setItem(SK,sid);l('New session',sid);}
|
|
@@ -8195,8 +9333,8 @@ send(api+collect,data);
|
|
|
8195
9333
|
catch(err){l('Track error',err);}
|
|
8196
9334
|
}
|
|
8197
9335
|
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});}
|
|
8198
|
-
${X}
|
|
8199
9336
|
${q}
|
|
9337
|
+
${Z}
|
|
8200
9338
|
var hp=history.pushState;if(hp){history.pushState=function(){hp.apply(history,arguments);pv();};}
|
|
8201
9339
|
var hr=history.replaceState;if(hr){history.replaceState=function(){hr.apply(history,arguments);};}
|
|
8202
9340
|
w.addEventListener('popstate',pv);
|
|
@@ -8210,69 +9348,69 @@ l('Initialized',site);
|
|
|
8210
9348
|
}
|
|
8211
9349
|
catch(err){if(w.console)console.error('[Analytics] Init error:',err);}
|
|
8212
9350
|
})();
|
|
8213
|
-
</script>`}function
|
|
8214
|
-
`),
|
|
8215
|
-
`)}</div>`;let
|
|
8216
|
-
${
|
|
8217
|
-
<span class="BPHero-announcement-text">${
|
|
9351
|
+
</script>`}function Bb(b){return b.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function $0(b){let x=b.replace(/\r\n/g,`
|
|
9352
|
+
`),p=/^---\n([\s\S]*?)\n---\n?/,v=x.match(p);if(!v)return{frontmatter:{},content:x};let w=v[1],q=x.slice(v[0].length);try{return{frontmatter:z1.parse(w),content:q}}catch{try{let Z=w.replace(/^(\s*\w+:\s*)"(.+)",\s*(.+)$/gm,`$1'"$2," $3'`);return{frontmatter:z1.parse(Z),content:q}}catch(Z){return console.error("Failed to parse frontmatter YAML:",Z),{frontmatter:{},content:b}}}}async function Y0(b){if(!b)return"";let x=b.name?`<p class="BPHero-name">${b.name}</p>`:"",p=b.text?`<h1 class="BPHero-text">${b.text}</h1>`:"",v=b.tagline?`<p class="BPHero-tagline">${b.tagline}</p>`:"",w="";if(b.actions)w=`<div class="BPHero-actions">${b.actions.map(($)=>{return`<a class="${$.theme==="brand"?"BPButton BPButton-brand":"BPButton BPButton-alt"}" href="${$.link}">${$.text}</a>`}).join(`
|
|
9353
|
+
`)}</div>`;let q=b.announcement?`<a class="BPHero-announcement" href="${E(b.announcement.link||"#")}">
|
|
9354
|
+
${b.announcement.tag?`<span class="BPHero-announcement-tag">${b.announcement.tag}</span>`:""}
|
|
9355
|
+
<span class="BPHero-announcement-text">${b.announcement.text||""}</span>
|
|
8218
9356
|
<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>
|
|
8219
|
-
</a>`:"",
|
|
8220
|
-
<pre data-lang="${
|
|
9357
|
+
</a>`:"",Z=b.image?`<div class="hero-image"><img src="${E(b.image)}" alt="${E(b.name||"")}" /></div>`:"",z=(b.code?await V0(b.code):"")||Z;return await L("hero",{announcement:q,name:x,text:p,tagline:v,actions:w,image:z})}async function V0(b){let p=(Array.isArray(b)?b:[b]).filter((q)=>typeof q?.content==="string"&&q.content.trim());if(p.length===0)return"";let v=await Promise.all(p.map(async(q,Z)=>{let z=q.lang||"ts",J=await Kb(q.content.replace(/\n+$/,""),z);return`<div class="BPHeroCode-panel" data-index="${Z}"${Z===0?"":" hidden"}>
|
|
9358
|
+
<pre data-lang="${E(z)}"><code class="language-${E(z)}">${J}</code></pre>
|
|
8221
9359
|
</div>`}));return`<div class="BPHeroCode">
|
|
8222
|
-
<div class="BPHeroCode-head">${
|
|
8223
|
-
<div class="BPHeroCode-body">${
|
|
8224
|
-
</div>`}var
|
|
8225
|
-
<${
|
|
8226
|
-
${
|
|
8227
|
-
<h2 class="BPFeature-title">${
|
|
8228
|
-
<p class="BPFeature-details">${
|
|
8229
|
-
${
|
|
8230
|
-
</${
|
|
8231
|
-
`),
|
|
8232
|
-
`).trim();return
|
|
9360
|
+
<div class="BPHeroCode-head">${p.length>1?`<div class="BPHeroCode-tabs" role="tablist">${p.map((q,Z)=>`<button class="BPHeroCode-tab${Z===0?" is-active":""}" type="button" role="tab" aria-selected="${Z===0}" onclick="switchHeroCodeTab(this, ${Z})">${q.file||q.lang||`Example ${Z+1}`}</button>`).join("")}</div>`:p[0].file?`<span class="BPHeroCode-file">${p[0].file}</span>`:""}</div>
|
|
9361
|
+
<div class="BPHeroCode-body">${v.join("")}</div>
|
|
9362
|
+
</div>`}var X0={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 d0(b){if(b.startsWith("<")||/\p{Emoji}/u.test(b))return b;return X0[b]||`<span class="BPFeature-icon-text">${b.charAt(0)}</span>`}async function y0(b){if(!b||b.length===0)return"";let x=b.map((p)=>{let v=p.icon?d0(p.icon):"",w=v?`<div class="BPFeature-icon">${v}</div>`:"",q=p.link,Z=q?"a":"div",z=q?` href="${E(q)}"`:"",J=Number(p.span)>1?` style="--bp-feature-span:${Math.min(Math.trunc(Number(p.span)),3)}"`:"",$=q?" is-linked":"",Q=q?`<span class="BPFeature-link">${p.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`
|
|
9363
|
+
<${Z} class="BPFeature${$}"${z}${J}>
|
|
9364
|
+
${w}
|
|
9365
|
+
<h2 class="BPFeature-title">${p.title||""}</h2>
|
|
9366
|
+
<p class="BPFeature-details">${p.details||""}</p>
|
|
9367
|
+
${Q}
|
|
9368
|
+
</${Z}>`}).join("");return await L("features",{items:x})}function W0(b){let x={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 b.replace(/:(\w+):/g,(p,v)=>{return x[v]||p})}function G0(b){let x=/<Badge([^/>]+)\/>/gi;return b.replace(x,(p,v)=>{let w=v.match(/type="(info|tip|warning|danger)"/i),q=v.match(/text="([^"]+)"/),Z=w?w[1].toLowerCase():"info",z=q?q[1]:"";return`<span class="badge badge-${Z}">${z}</span>`})}function K0(b,x=!0,p=!0){return b.replace(/<a\s+href="([^"]+)"([^>]*)>/g,(v,w,q)=>{if(q.includes("target="))return v;if(w.startsWith("http://")||w.startsWith("https://"))return`<a href="${w}"${x?' target="_blank"':""}${p?' rel="noreferrer noopener"':""}${q}>`;return v})}function E0(b){return b.replace(/<a\s+href="([^"]+)"\s+target="_blank"[^>]*>[\s\S]+?<\/a>/g,(x,p)=>{if(x.includes("external-link-icon"))return x;let v='<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 x.replace("</a>",`${v}</a>`)})}function j0(b){return b.replace(/<img(\s[^>]*?)>/g,(x,p)=>{if(/\bloading\s*=/.test(p))return x;return`<img ${p.trim().replace(/\/$/,"").trimEnd()} loading="lazy" decoding="async">`})}function U0(b,x){if(!b.includes("[[toc]]"))return{content:b,tocHtml:null};let p=j1(b),v={...K1,...x},w=_1(p,v),Z={items:U1(w),title:v.title||"Table of Contents",config:v},z=B1(Z),J="<!--INLINE_TOC_PLACEHOLDER-->";return{content:b.replace(/\[\[toc\]\]/g,J),tocHtml:z}}function _0(b,x){return b.replace(/<!--INLINE_TOC_PLACEHOLDER-->/g,x)}function S1(b){let x=b.replace(/\s+$/,"").split(`
|
|
9369
|
+
`),p=x.filter((q)=>q.trim()).map((q)=>q.match(/^[ \t]*/)[0].length),v=p.length>0?Math.min(...p):0,w=x.map((q)=>q.slice(v)).join(`
|
|
9370
|
+
`).trim();return w?`
|
|
8233
9371
|
|
|
8234
|
-
${
|
|
9372
|
+
${w}
|
|
8235
9373
|
|
|
8236
|
-
`:""}async function
|
|
8237
|
-
`).map((
|
|
8238
|
-
`)
|
|
9374
|
+
`:""}async function B0(b){let x=/^>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n((?:>\s*.*\n?)*)/gm,p=Array.from(b.matchAll(x)),v=b;for(let w of p.reverse()){let[q,Z,z]=w,J=z.split(`
|
|
9375
|
+
`).map((V)=>V.replace(/^>\s?/,"")).join(`
|
|
9376
|
+
`),$=Z.toLowerCase(),Q=await L(`blocks/alerts/${$}`,{content:S1(J)});v=`${v.slice(0,w.index)}
|
|
8239
9377
|
|
|
8240
|
-
${
|
|
9378
|
+
${Q}
|
|
8241
9379
|
|
|
8242
|
-
${
|
|
8243
|
-
`),
|
|
8244
|
-
`),
|
|
8245
|
-
${
|
|
8246
|
-
\`\`\``;
|
|
8247
|
-
`);if(
|
|
8248
|
-
`),
|
|
8249
|
-
<!--${
|
|
9380
|
+
${v.slice(w.index+q.length)}`}return v}async function A0(b,x){let p=/^<<<\s+@\/([^\s[{#]+)(?:\{(\d+)-(\d+)\}|#(\w+))?\s*(?:\[[^\]]+\]\s*)?$/gm,v=Array.from(b.matchAll(p)),w=b;for(let q of v.reverse()){let[Z,z,J,$,Q]=q;try{let{join:V}=await import("path"),Y=V(x,z),X=Bun.file(Y);if(!await X.exists()){console.warn(`Code import: File not found: ${Y}`);continue}let K=(await X.text()).split(`
|
|
9381
|
+
`),j=z.split(".").pop()||"",B={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"}[j]||j;if(J&&$){let G=Number.parseInt(J)-1,d=Number.parseInt($);K=K.slice(G,d)}else if(Q){let G=K.findIndex((y)=>y.includes(`#region ${Q}`)||y.includes(`// region ${Q}`)||y.includes(`# region ${Q}`)),d=K.findIndex((y,F)=>F>G&&(y.includes("#endregion")||y.includes("// endregion")||y.includes("# endregion")));if(G!==-1&&d!==-1)K=K.slice(G+1,d);else console.warn(`Code import: Region '${Q}' not found in ${z}`)}let _=K.join(`
|
|
9382
|
+
`),O=`\`\`\`${B}
|
|
9383
|
+
${_}
|
|
9384
|
+
\`\`\``;w=w.slice(0,q.index)+O+w.slice(q.index+Z.length)}catch(V){console.error(`Error importing code from ${z}:`,V)}}return w}async function H1(b,x,p=new Set,v,w){let q=/<!--@include:\s*([^\s{]+)(?:\{(\d+)-(\d+)\}|\{#([\w-]+)\})?\s*-->/g,Z=Array.from(b.matchAll(q)),z=b;for(let J of Z.reverse()){let[$,Q,V,Y,X]=J;try{if(v){let d=b.slice(0,J.index),y=b.slice(J.index+$.length);if(!/(?:^|\n) {0,3}$/.test(d)||!/^[ \t]*(?:\r?\n|$)/.test(y))throw Error("Source-aware Markdown includes must be on their own line")}let{join:W,resolve:K}=await import("path"),j=K(W(x,Q));if(p.has(j)){console.warn(`Markdown include: Circular reference detected for ${Q}`);continue}let U=Bun.file(j);if(!await U.exists()){console.warn(`Markdown include: File not found: ${j}`);continue}let _=(await U.text()).split(`
|
|
9385
|
+
`);if(V&&Y){let d=Number.parseInt(V)-1,y=Number.parseInt(Y);_=_.slice(d,y)}else if(X){let d=_.findIndex((F)=>F.includes(`<!-- #region ${X} -->`)||F.includes(`<!-- region ${X} -->`)),y=_.findIndex((F,N)=>N>d&&(F.includes("<!-- #endregion -->")||F.includes("<!-- endregion -->")));if(d!==-1&&y!==-1)_=_.slice(d+1,y);else{console.warn(`Markdown include: Region '${X}' not found in ${Q}`);continue}}let O=_.join(`
|
|
9386
|
+
`),G=new Set(p);if(G.add(j),O=await qb(O,(d)=>H1(d,x,G,v,w)),v&&w){let d=`bunpress-source-${N1()}`;w.set(`${d}:start`,{...v.page,sourceFile:j}),w.set(`${d}:end`,null),O=`
|
|
9387
|
+
<!--${d}:start-->
|
|
8250
9388
|
|
|
8251
|
-
${
|
|
9389
|
+
${O}
|
|
8252
9390
|
|
|
8253
|
-
<!--${
|
|
8254
|
-
`}z=z.slice(0,
|
|
8255
|
-
${
|
|
8256
|
-
</div>`})),
|
|
9391
|
+
<!--${d}:end-->
|
|
9392
|
+
`}z=z.slice(0,J.index)+O+z.slice(J.index+$.length)}catch(W){if(v)throw W;console.error(`Error including markdown from ${Q}:`,W)}}return z}async function O0(b){let x=/^:::\s+code-group[ \t]*\n((?:(?!^:::)[\s\S])*)^:::$/gm,p=Array.from(b.matchAll(x)),v=b;for(let w of p.reverse()){let[q,Z]=w,z=/^```(\w+)[ \t]+\[([^\]]+)\][ \t]*\n((?:(?!^```)[\s\S])*)^```$/gm,J=Array.from(Z.matchAll(z));if(J.length===0)continue;let $=new Bun.CryptoHasher("sha256");$.update(`${w.index}\x00${q}`);let Q=`code-group-${$.digest("hex").slice(0,12)}`,V=J.map((W,K)=>{let j=W[2];return`<button class="code-group-tab${K===0?" active":""}" onclick="switchCodeTab('${Q}', ${K})">${j}</button>`}).join(""),Y=await Promise.all(J.map(async(W,K)=>{let j=W[1],U=W[3],B=K===0,_=M.markdown?.syntaxHighlightTheme||"github-light",O=await Kb(U,j,_),G=`<pre data-lang="${j}"><code class="language-${j}">${O}</code></pre>`;return`<div class="code-group-panel${B?" active":""}" data-panel="${K}">
|
|
9393
|
+
${G}
|
|
9394
|
+
</div>`})),X=[`<div class="code-group" id="${Q}">`,' <div class="code-group-tabs">',` ${V}`," </div>",' <div class="code-group-panels">',` ${Y.join(`
|
|
8257
9395
|
`)}`," </div>","</div>"].join(`
|
|
8258
|
-
`)
|
|
9396
|
+
`);v=v.slice(0,w.index)+X+v.slice(w.index+q.length)}return v}async function F0(b){let x=/^:::\s+(info|tip|warning|danger|details|raw)(?: +([^\n\t ][^\n]*))?\n((?:(?!^:::)[\s\S])*)^:::$/gm,p=Array.from(b.matchAll(x)),v=b;for(let w of p.reverse()){let[q,Z,z,J]=w,$={info:"INFO",tip:"TIP",warning:"WARNING",danger:"DANGER",details:"Details",raw:""},Q=z&&z.trim()||$[Z],V=await L(`blocks/containers/${Z}`,{title:Q,content:S1(J)}),Y=z?.trim()?V:V.replace('class="custom-block-title"','class="custom-block-title is-default"');v=`${v.slice(0,w.index)}
|
|
8259
9397
|
|
|
8260
|
-
${
|
|
9398
|
+
${Y}
|
|
8261
9399
|
|
|
8262
|
-
${
|
|
8263
|
-
`));if(
|
|
8264
|
-
`),
|
|
8265
|
-
`).map((
|
|
8266
|
-
`),
|
|
8267
|
-
`),
|
|
8268
|
-
`)}function
|
|
8269
|
-
`:""}<table${
|
|
8270
|
-
</div>`:"</table>")}if(
|
|
8271
|
-
|
|
8272
|
-
${
|
|
8273
|
-
\uD83D\uDCDA BunPress documentation server running at ${
|
|
8274
|
-
`);return{server:
|
|
8275
|
-
`);try{let
|
|
8276
|
-
Shutting down server...`),
|
|
8277
|
-
Shutting down server...`),
|
|
8278
|
-
export{
|
|
9400
|
+
${v.slice(w.index+q.length)}`}return v}function R0(b){let x=b.match(/^([\w#+.-]+)/),p=x?x[1]:"",v=b.match(/\{([^}]+)\}/),w=[];if(v){let Z=v[1].split(",");for(let z of Z){let J=z.trim();if(J.includes("-")){let[$,Q]=J.split("-").map(Number);for(let V=$;V<=Q;V++)w.push(V)}else w.push(Number(J))}}let q=b.includes(":line-numbers");return{lang:p,highlights:w,showLineNumbers:q}}async function L0(b,x,p){let v=b[x],w=v.match(/^(`{3,})/),q=w?w[1].length:3,Z="`".repeat(q),z=v.substring(q).trim(),J=R0(z),$=J.lang,Q=p.lineHighlighting?J.highlights:[],V=p.lineNumbers?J.showLineNumbers:!1,Y=[],X=x+1;while(X<b.length){let f=b[X];if(f.match(new RegExp(`^\`{${q},}\\s*$`)))break;Y.push(f),X++}if(p.messagePreviews){let f=G1($,Y.join(`
|
|
9401
|
+
`));if(f!==null)return{html:f,endIndex:X}}let W=new Set,K=new Set,j=new Set,U=new Set,B=new Set,_=Y.map((f,I)=>{let R=f;if(R.includes("// [!code focus]"))W.add(I),R=R.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(R.includes("// [!code ++]"))K.add(I),R=R.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(R.includes("// [!code --]"))j.add(I),R=R.replace(/\/\/ \[!code --\]/,"").trimEnd();if(R.includes("// [!code error]"))U.add(I),R=R.replace(/\/\/ \[!code error\]/,"").trimEnd();if(R.includes("// [!code warning]"))B.add(I),R=R.replace(/\/\/ \[!code warning\]/,"").trimEnd();return R}),O=W.size>0,G=_.join(`
|
|
9402
|
+
`),d=M.markdown?.syntaxHighlightTheme||"github-light",N=(await Kb(G,$,d)).split(`
|
|
9403
|
+
`).map((f,I)=>{let R=I+1,r=Q.includes(R),Zb=W.has(I),Mb=p.diffs&&K.has(I),m=p.diffs&&j.has(I),fb=p.errorWarningMarkers&&U.has(I),Ib=p.errorWarningMarkers&&B.has(I),T=["line"];if(r)T.push("highlighted");if(Zb)T.push("focused");if(O&&!Zb)T.push("dimmed");if(Mb)T.push("diff-add");if(m)T.push("diff-remove");if(fb)T.push("has-error");if(Ib)T.push("has-warning");if(f.startsWith('<span class="line">')){let l=T.join(" "),S=f.replace('<span class="line">',`<span class="${l}">`);if(V)return`<span class="${T.join(" ")}"><span class="line-number">${R}</span>${S.replace(/^<span class="[^"]*">/,"").replace(/<\/span>$/,"")}</span>`;return S}let i=T.length>0?` class="${T.join(" ")}"`:"";if(V)return`<span${i}><span class="line-number">${R}</span>${f}</span>`;return`<span${i}>${f}</span>`}).join(`
|
|
9404
|
+
`),D=[];if(V)D.push("line-numbers-mode");if(O)D.push("has-focused-lines");let C=D.length>0?` class="${D.join(" ")}"`:"",c=$?` data-lang="${$}"`:"";return{html:`<pre${C}${c}><code class="language-${$}">${N}</code></pre>`,endIndex:X}}function N0(b){let x=new Map;return{content:b.replace(/^(#{1,6})\s+(.*?)\s*\{#([\w-]+)\}\s*$/gm,(v,w,q,Z)=>{let z=E1(q),J=x.get(z)??[];return J.push(Z),x.set(z,J),`${w} ${q.trim()}`}),customAnchors:x}}async function M0(b,x,p){let v=b.split(`
|
|
9405
|
+
`),w=[],q=0,Z=0;while(q<v.length){let z=v[q];if(z.match(/^`{3,}/)){let{html:J,endIndex:$}=await L0(v,q,p),Q=`<!--BUNPRESS_CODE_${Z++}-->`;x.set(Q,J),w.push(""),w.push(Q),w.push(""),q=$+1}else w.push(z),q++}return w.join(`
|
|
9406
|
+
`)}function f0(b){return b=b.replace(/==(.+?)==/g,"<mark>$1</mark>"),b=b.replace(/\^(.+?)\^/g,"<sup>$1</sup>"),b=b.replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>"),b}function I0(b,x=!0,p=!0,v=!0){if(p||x){let w=`${p?`<div class="table-responsive">
|
|
9407
|
+
`:""}<table${x?' class="enhanced-table"':""}>`;b=b.replace(/<table>/g,w),b=b.replace(/<\/table>/g,p?`</table>
|
|
9408
|
+
</div>`:"</table>")}if(v)b=b.replace(/<(th|td) align="(left|center|right)">/g,(w,q,Z)=>{return`<${q} style="text-align: ${Z}">`}),b=b.replace(/<(th|td)>/g,(w,q)=>{return`<${q} style="text-align: left">`});return b}function D0(b,x){let p=new Set;return b.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(v,w,q,Z)=>{if(q.includes(" id="))return v;let z=Z.replace(/<[^>]+>/g,"").trim(),$=x.get(z)?.shift();if(!$)$=wp(z);return $=qp($,p),`<h${w} id="${$}"${q}>${Z}</h${w}>`})}async function T0(b,x="./docs",p){let{frontmatter:v,content:w}=$0(b);if(v.layout==="home"){let Z=await Y0(v.hero),z=await y0(v.features),J=w.trim()?await Y1(w,v,x,p):"",$=J?`<div class="BPHome-content"><div class="container bp-doc vp-doc">${J}</div></div>`:"";return{html:Z+z+$,frontmatter:v}}return{html:await Y1(w,v,x,p),frontmatter:v}}async function Y1(b,x,p,v){let w=new Map,q=M.markdown?.features,Z=(d)=>{if(!q)return!0;let y=q[d];return y===void 0||y===!0||typeof y==="object"&&y!==null},z=(d,y)=>{if(!Z(d))return!1;let F=q?.[d];if(typeof F!=="object"||F===null)return!0;return F[y]!==!1},J=Z("includes")?await qb(b,(d)=>H1(d,p,new Set(v?[v.page.sourceFile]:[]),v,w)):b,$={...x,data:await Ep(p,M.dataDir),site:{title:M.title||M.markdown?.title||"",description:M.description||M.markdown?.meta?.description||"",themeConfig:M.themeConfig}},Q=M.componentsDir?zb(wb.cwd(),M.componentsDir):zb(p,".components"),V=new Map,Y=M.fallbackComponentsDir;J=await mb(J,Q,$,{fallbackComponentsDir:Y?vb(Y):void 0,rendered:V});let X=J.replace(/```[\s\S]*?```/g,"");if(X.includes("@if")||X.includes("@foreach")||X.includes("@for (")||X.includes("<script server")||X.includes("@include")||/\{\{(?!\{)\s*\w/.test(X))try{let d=await import("@stacksjs/stx/render"),y=[],F=J.replace(/```[\s\S]*?```/g,(N)=>{return y.push(N),`\x00BPSTXCODE${y.length-1}\x00`}).replace(/`[^`\n]*`/g,(N)=>{return y.push(N),`\x00BPSTXCODE${y.length-1}\x00`});J=await d.renderString(F,$,{injectCSS:!1,templateOnly:!0}),J=J.replace(/\u0000BPSTXCODE(\d+)\u0000/g,(N,D)=>y[Number(D)]??"")}catch(d){let y=d instanceof Error?d.message:String(d);throw Error(`Failed to render BunPress stx syntax: ${y}`,{cause:d})}let{content:K,tocHtml:j}=Z("inlineToc")?U0(J,x.toc):{content:J,tocHtml:""};J=Z("codeImports")?await qb(K,(d)=>A0(d,p)):K,J=Z("codeGroups")?await O0(J):J,J=await qb(J,async(d)=>{let y=Z("githubAlerts")?await B0(d):d;return y=Z("containers")?await F0(y):y,y=Z("emoji")?W0(y):y,y=Z("badges")?G0(y):y,y});let{content:U,customAnchors:B}=Z("customAnchors")?N0(J):{content:J,customAnchors:new Map};J=U;let _=new Map;J=Z("codeBlocks")?await M0(J,_,{lineHighlighting:z("codeBlocks","lineHighlighting"),lineNumbers:z("codeBlocks","lineNumbers"),diffs:z("codeBlocks","diffs"),errorWarningMarkers:z("codeBlocks","errorWarningMarkers"),messagePreviews:Z("messagePreviews")}):J;let O={tables:!0,strikethrough:!0,tasklists:!0,autolinks:!0,...M.markdown?.parserOptions??{}};if(w.size){let d=new Set;for(let y=J.indexOf("]:");y!==-1;y=J.indexOf("]:",y+2))for(let F=J.lastIndexOf("[",y-1);F!==-1;F=F===0?-1:J.lastIndexOf("[",F-1)){let N=J.slice(F+1,y);if(d.has(N))continue;if(d.add(N),d.size>256)throw Error("Markdown include reference validation exceeded 256 candidate labels. Split the document or use inline links.");let D=`bunpress-reference-${N1()}`,C=!1;if(Bun.markdown.render(`[${D}][${N}]
|
|
9409
|
+
|
|
9410
|
+
${J}`,{link(c){if(c===D)C=!0;return""}},O),C)throw Error("Markdown includes cannot be combined with reference definitions. Use inline links instead.")}}let G=Bun.markdown.html(J,O);if(v)G=await L1(G,v,w);for(let[d,y]of _)G=G.replace(`<p>${d}</p>`,y),G=G.replace(d,y);if(Z("inlineFormatting"))G=f0(G);if(Z("tables"))G=I0(G,z("tables","enhancedStyling"),z("tables","responsive"),z("tables","alignment"));if(G=D0(G,B),j)G=_0(G,j);if(Z("externalLinks")){if(z("externalLinks","autoTarget")||z("externalLinks","autoRel"))G=K0(G,z("externalLinks","autoTarget"),z("externalLinks","autoRel"));if(z("externalLinks","showIcon"))G=E0(G)}if(Z("imageLazyLoading"))G=j0(G);for(let[d,y]of V)G=G.replace(`<p>${d}</p>`,()=>y),G=G.replace(d,()=>y);return G}async function k0(b={}){let x=b.config||M,p=b.port??3000,v=b.root||"./docs",w=await vp(xp(x),x),q=Bun.serve({port:p,async fetch(J){let $=new URL(J.url);try{decodeURIComponent($.pathname)}catch{return new Response("Malformed path",{status:400})}let Q=J1(x,$.pathname);if(Q==="/")Q="/index";else if(Q.length>1&&Q.endsWith("/"))Q=Q.replace(/\/+$/,"");if(Q===Ob.replace(/\.json$/,"")||$.pathname.endsWith(Ob)){let W=await O1(v,x);return new Response(JSON.stringify(W),{headers:{"Content-Type":"application/json","Cache-Control":"no-store"}})}let V=[".png",".jpg",".jpeg",".gif",".webp",".avif",".svg",".css",".js",".ico",".woff",".woff2",".ttf"];try{let W=decodeURIComponent(J1(x,$.pathname));if(!W.split("/").some((K)=>K.startsWith("."))){let K=vb(v,"public"),j=vb(K,`.${W}`);if(j.startsWith(`${K}${Z1}`)){let U=/\.[^/]+$/.test(W)?[j]:[zb(j,"index.html")];for(let B of U){let _=Bun.file(B);if(await _.exists()&&(await Fb(B)).isFile())return new Response(_)}}if(V.some((U)=>W.endsWith(U))){let U=vb(v),B=vb(U,`.${W}`);if(B.startsWith(`${U}${Z1}`)){let _=Bun.file(B);if(await _.exists()&&(await Fb(B)).isFile())return new Response(_)}}}}catch{}let{locale:Y,path:X}=V1(w,Q);try{let W=R1(await F1(v),v,w),K=W.findPage(Y,X);if(K){let j=await Bun.file(K.sourceFile).text(),{html:U,frontmatter:B}=await T0(j,v,{page:K,catalog:W}),_=B.layout||"doc",O=await Q1(U,x,X,_,B,{i18n:w,locale:Y,sourceFile:K.sourceFile,docsDir:v});return new Response(O,{headers:{"Content-Type":"text/html; charset=utf-8"}})}}catch{return new Response("Documentation page could not be rendered",{status:500})}return new Response(await Q1("<h1>404 - Page Not Found</h1><p>The page you are looking for does not exist.</p>",x,Q),{status:404,headers:{"Content-Type":"text/html; charset=utf-8"}})}}),Z=`http://localhost:${q.port}`,z=()=>q.stop();if(!b.quiet)console.log(`
|
|
9411
|
+
\uD83D\uDCDA BunPress documentation server running at ${Z}`),console.log(`Press Ctrl+C to stop
|
|
9412
|
+
`);return{server:q,url:Z,stop:z}}async function gv(b={}){let{stop:x}=await k0(b),p=b.watch!==void 0?b.watch:!0,v=b.root||"./docs";if(p){console.log(`Watching for changes in ${v} directory...
|
|
9413
|
+
`);try{let w=new Map,q=new q1("**/*.{md,stx,ts,js,css,html}");for await(let J of q.scan(v))try{let $=zb(v,J),Q=await Fb($);w.set(J,Q.mtimeMs)}catch{}let Z=null,z=()=>{if(Z)clearTimeout(Z);Z=setTimeout(async()=>{console.log("File changed detected, reloading..."),cp(),gp(),jp(),console.log("Ready for requests")},100)};setInterval(async()=>{try{let J=!1,$=new Set,Q=new q1("**/*.{md,stx,ts,js,css,html}");for await(let V of Q.scan(v)){$.add(V);try{let Y=zb(v,V),X=await Fb(Y),W=w.get(V);if(W===void 0||X.mtimeMs>W)J=!0,w.set(V,X.mtimeMs)}catch{}}for(let V of w.keys())if(!$.has(V))J=!0,w.delete(V);if(J)z()}catch{}},1000)}catch(w){console.error("Error setting up file watcher:",w)}}wb.on("SIGINT",()=>{console.log(`
|
|
9414
|
+
Shutting down server...`),x(),wb.exit(0)}),wb.on("SIGTERM",()=>{console.log(`
|
|
9415
|
+
Shutting down server...`),x(),wb.exit(0)}),await new Promise(()=>{})}
|
|
9416
|
+
export{l0 as a,Lp as b,Np as c,Mp as d,Kb as e,o0 as f,Zx as g,fp as h,a0 as i,s0 as j,J1 as k,x0 as l,Q1 as m,T0 as n,k0 as o,gv as p};
|