@stacksjs/bunpress 0.2.21 → 0.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{q as $,r as I,s as f,t as h,w as x}from"./chunk-yave4hym.js";import"./chunk-rcr6k1et.js";import{E as _}from"./chunk-3ymfys00.js";import"./chunk-rnzqf7rp.js";import{join as D}from"path";var E="@stacksjs/ts-cloud";async function Y(){try{return await import(E)}catch(j){throw Error(`Deploying requires @stacksjs/ts-cloud, which is an optional dependency.
2
+ import{o as $,p as I,q as f,r as h,t as x}from"./chunk-7gvva4jg.js";import"./chunk-5dtz0br7.js";import{B as _}from"./chunk-vm81tncs.js";import"./chunk-gn1n2yxt.js";import{join as D}from"path";var E="@stacksjs/ts-cloud";async function Y(){try{return await import(E)}catch(j){throw Error(`Deploying requires @stacksjs/ts-cloud, which is an optional dependency.
3
3
  Install it with: bun add -d @stacksjs/ts-cloud
4
4
  Original error: ${j instanceof Error?j.message:String(j)}`)}}function W(j,A){let k=A||j?.provider;if(!k||k==="route53")return null;if(k==="porkbun"){let m=j?.apiKey||process.env.PORKBUN_API_KEY,w=j?.secretKey||process.env.PORKBUN_SECRET_KEY;if(!m||!w)throw Error("Porkbun API credentials not found. Set PORKBUN_API_KEY and PORKBUN_SECRET_KEY environment variables, or configure them in bunpress.config.ts under cloud.dnsProvider");return{provider:"porkbun",apiKey:m,secretKey:w}}if(k==="godaddy"){let m=j?.apiKey||process.env.GODADDY_API_KEY,w=j?.secretKey||process.env.GODADDY_API_SECRET,J=j?.environment||process.env.GODADDY_ENVIRONMENT;if(!m||!w)throw Error("GoDaddy API credentials not found. Set GODADDY_API_KEY and GODADDY_API_SECRET environment variables, or configure them in bunpress.config.ts under cloud.dnsProvider");return{provider:"godaddy",apiKey:m,apiSecret:w,environment:J}}throw Error(`Unknown DNS provider: ${k}. Supported: porkbun, godaddy, route53`)}async function F(j={}){let A=await _,k=A.cloud||{},m=j.verbose??A.verbose??!1;if(k.driver&&k.driver!=="aws")return I(`Unsupported cloud driver: ${k.driver}. Only 'aws' is implemented.`),!1;let w=j.region||k.region||"us-east-1",J=j.domain||k.domain,M=j.subdomain||k.subdomain,N=j.baseDomain||k.baseDomain,O=j.bucket||k.bucket,P=j.stackName||k.stackName,U=j.hostedZoneId||k.hostedZoneId,Q=j.certificateArn||k.certificateArn,V=k.cacheControl||"max-age=31536000, public",B;if(J)B=J;else if(M&&N)B=`${M}.${N}`;let K=B?.replace(/\./g,"-")||"bunpress-site",G=null;try{G=W(k.dnsProvider,j.dnsProvider)}catch(H){return I(H.message),!1}let L=G!==null;if(j.dryRun){if(f("Dry run mode - no changes will be made"),console.log(`
5
5
  Configuration:`),console.log(` Region: ${w}`),console.log(` Site Name: ${K}`),console.log(` Bucket: ${O||"auto-generated"}`),console.log(` Domain: ${B||"not specified"}`),console.log(` Stack Name: ${P||`${K}-static-site`}`),console.log(` DNS Provider: ${G?.provider||"route53 (AWS)"}`),!L)console.log(` Hosted Zone ID: ${U||"auto-detected"}`);return console.log(` Certificate ARN: ${Q||"auto-created"}`),!0}if(!process.env.AWS_ACCESS_KEY_ID||!process.env.AWS_SECRET_ACCESS_KEY)return I("AWS credentials not found. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables."),!1;let z=new h("Building documentation...");try{if(!m)z.start();if(!await x({verbose:m})){if(!m)z.fail("Build failed");return!1}if(!m)z.succeed("Documentation built successfully");let C=A.outDir||"./dist",X=D(C,".bunpress");if(!m)z.text="Deploying infrastructure with CloudFormation...",z.start();else if(console.log(`
@@ -0,0 +1,38 @@
1
+ // @bun
2
+ var Y=import.meta.require;function Q(q){return(q.sitemap?.baseUrl||q.url||"").replace(/\/$/,"")}function j(q){if(q.basePath){let B=q.basePath.trim().replace(/\/+$/,"");if(!B||B==="/")return"";return B.startsWith("/")?B:`/${B}`}let G=Q(q);if(!G)return"";try{let B=new URL(G).pathname.replace(/\/+$/,"");return B==="/"?"":B}catch{return""}}var V={"search.placeholder":"Search documentation","toc.title":"On this page","nav.menu":"Menu","search.noResults":"No results for","theme.toggle":"Toggle dark mode"};function A(q){let G=q?.i18n,B=(G?.locales??[]).filter(Boolean),H=G?.defaultLocale||B[0]||q?.lang||"en",J=(G?.enabled??B.length>1)&&B.length>0;return{enabled:J,locales:J?B:[H],defaultLocale:H,fallbackLocale:G?.fallbackLocale??H,localePath:G?.localePath??"./locales",detectLocale:G?.detectLocale===!0,localeNames:G?.localeNames??{},localeConfig:G?.localeConfig??{},translate:(K)=>V[K]??K}}async function E(q,G){if(!q.enabled)return q;try{let{createTranslator:B,loadTranslations:H}=await import("@stacksjs/ts-i18n"),J=await H({translationsDir:q.localePath,defaultLocale:q.defaultLocale,fallbackLocale:q.fallbackLocale,sources:G?.i18n?.sources??["ts","yaml","json"],optional:!0,verbose:!1}),K=B(J,{defaultLocale:q.defaultLocale,fallbackLocale:q.fallbackLocale}),P=new Set;for(let M of Object.values(J))for(let N of Object.keys(M??{}))P.add(N);let W=[...P].sort((M,N)=>M==="theme"?-1:N==="theme"?1:M.localeCompare(N));return{...q,translate:(M,N,X)=>{for(let R of[M,...W.map((O)=>`${O}.${M}`)])try{let O=K(R,N,X);if(typeof O==="string"&&O&&O!==R)return O}catch{}return V[M]??M}}}catch(B){return console.warn("[bunpress] i18n translations could not be loaded; falling back to defaults \u2014",B instanceof Error?B.message:B),q}}function F(q,G){if(!q.enabled)return{locale:q.defaultLocale,path:G};let B=G.match(/^\/([^/]+)(\/.*)?$/);if(B&&q.locales.includes(B[1])&&B[1]!==q.defaultLocale)return{locale:B[1],path:B[2]||"/"};return{locale:q.defaultLocale,path:G}}function Z(q,G,B){if(!q.enabled||G===q.defaultLocale)return B||"/";return`/${G}${B==="/"?"":B}`||`/${G}`}function I(q,G,B,H){let J=H==="/"?"/index":H,K=[];if(q.enabled&&B!==q.defaultLocale)K.push(`${G}/${B}${J}.md`),K.push(`${G}/${B}${J}/index.md`),K.push(`${G}${J}.${B}.md`);if(K.push(`${G}${J}.md`),K.push(`${G}${J}/index.md`),q.enabled)K.push(`${G}${J}.${q.defaultLocale}.md`);return K}function _(q,G,B){let H=G.localeConfig[B];if(!H)return q;return{...q,...H,themeConfig:H.themeConfig?{...q.themeConfig,...H.themeConfig}:q.themeConfig,markdown:H.markdown?{...q.markdown,...H.markdown}:q.markdown}}function D(q,G){return q.localeNames[G]??G}function S(q,G,B){if(!q.enabled)return"";let H=Q(G);if(!H)return"";let J=q.locales.map((K)=>{let P=`${H}${Z(q,K,B==="/index"?"/":B)}`;return`<link rel="alternate" hreflang="${K}" href="${P}">`});return J.push(`<link rel="alternate" hreflang="x-default" href="${H}${B==="/index"?"/":B}">`),J.join(`
3
+ `)}function w(q){if(!q.enabled||!q.detectLocale)return"";return`
4
+ (function () {
5
+ var LOCALES = ${JSON.stringify(q.locales)};
6
+ var DEFAULT = ${JSON.stringify(q.defaultLocale)};
7
+ var KEY = 'bunpress-locale';
8
+
9
+ try {
10
+ var current = location.pathname.split('/')[1];
11
+ if (LOCALES.indexOf(current) !== -1) {
12
+ // Reading a non-default locale is itself a choice; remember it.
13
+ localStorage.setItem(KEY, current);
14
+ return;
15
+ }
16
+ if (localStorage.getItem(KEY)) return;
17
+
18
+ var preferred = (navigator.languages || [navigator.language || ''])
19
+ .map(function (tag) { return String(tag).toLowerCase(); });
20
+
21
+ for (var i = 0; i < preferred.length; i++) {
22
+ var tag = preferred[i];
23
+ var exact = LOCALES.indexOf(tag) !== -1 ? tag : null;
24
+ // 'en-GB' should match an 'en' locale.
25
+ var base = exact || (LOCALES.indexOf(tag.split('-')[0]) !== -1 ? tag.split('-')[0] : null);
26
+ if (base && base !== DEFAULT) {
27
+ localStorage.setItem(KEY, base);
28
+ location.replace(\`/\${base}\${location.pathname}\${location.search}\${location.hash}\`);
29
+ return;
30
+ }
31
+ if (base === DEFAULT) return;
32
+ }
33
+ } catch (_) {
34
+ // Storage or history unavailable: leave the reader where they are.
35
+ }
36
+ })();
37
+ `.trim()}
38
+ export{Y as fa,Q as ga,j as ha,A as ia,E as ja,F as ka,Z as la,I as ma,_ as na,D as oa,S as pa,w as qa};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{fa as o,ia as C}from"./chunk-rnzqf7rp.js";import{loadConfig as n}from"bunfig";var t={docsDir:"./docs",outDir:"./dist",theme:"vitepress",nav:[{text:"Guide",link:"/install"},{text:"API",link:"/advanced#api-reference"},{text:"Examples",link:"/examples"}],plugins:[],markdown:{title:"BunPress Documentation",meta:{description:"Documentation built with BunPress",generator:"BunPress",viewport:"width=device-width, initial-scale=1.0"},sidebar:{"/":[{text:"Getting Started",items:[{text:"Introduction",link:"/"},{text:"Installation",link:"/install"},{text:"Quick Start",link:"/quick-start"},{text:"Usage",link:"/usage"},{text:"Configuration",link:"/config"}]},{text:"Core Features",items:[{text:"Features Overview",link:"/features"},{text:"Markdown Extensions",link:"/markdown-extensions"},{text:"Syntax Highlighting",link:"/syntax-highlighting"},{text:"Table of Contents",link:"/table-of-contents"},{text:"CLI Commands",link:"/cli"}]},{text:"SEO & Analytics",items:[{text:"SEO Features",link:"/seo"},{text:"Analytics (Fathom)",link:"/config#fathom-analytics-configuration"}]},{text:"Advanced",items:[{text:"Advanced Usage",link:"/advanced"},{text:"Examples",link:"/examples"},{text:"Best Practices",link:"/best-practices"}]},{text:"More",items:[{text:"Showcase",link:"/showcase"},{text:"Partners",link:"/partners"},{text:"License",link:"/license"},{text:"Postcardware",link:"/postcardware"}]}]},css:`
2
+ import{ha as Q0,ia as X0,la as L,ma as q0}from"./chunk-gn1n2yxt.js";import{loadConfig as K0}from"bunfig";var G0={docsDir:"./docs",outDir:"./dist",theme:"vitepress",nav:[{text:"Guide",link:"/install"},{text:"API",link:"/advanced#api-reference"},{text:"Examples",link:"/examples"}],plugins:[],markdown:{title:"BunPress Documentation",meta:{description:"Documentation built with BunPress",generator:"BunPress",viewport:"width=device-width, initial-scale=1.0"},sidebar:{"/":[{text:"Getting Started",items:[{text:"Introduction",link:"/"},{text:"Installation",link:"/install"},{text:"Quick Start",link:"/quick-start"},{text:"Usage",link:"/usage"},{text:"Configuration",link:"/config"}]},{text:"Core Features",items:[{text:"Features Overview",link:"/features"},{text:"Markdown Extensions",link:"/markdown-extensions"},{text:"Syntax Highlighting",link:"/syntax-highlighting"},{text:"Table of Contents",link:"/table-of-contents"},{text:"CLI Commands",link:"/cli"}]},{text:"SEO & Analytics",items:[{text:"SEO Features",link:"/seo"},{text:"Analytics (Fathom)",link:"/config#fathom-analytics-configuration"}]},{text:"Advanced",items:[{text:"Advanced Usage",link:"/advanced"},{text:"Examples",link:"/examples"},{text:"Best Practices",link:"/best-practices"}]},{text:"More",items:[{text:"Showcase",link:"/showcase"},{text:"Partners",link:"/partners"},{text:"License",link:"/license"},{text:"Postcardware",link:"/postcardware"}]}]},css:`
3
3
  /* Additional BunPress customizations */
4
4
  /* Note: Base styles are provided by the VitePress theme */
5
5
 
@@ -1236,19 +1236,19 @@ if (typeof document !== 'undefined') {
1236
1236
  }
1237
1237
  });
1238
1238
  }
1239
- `],preserveDirectoryStructure:!0,features:{inlineFormatting:!0,containers:!0,githubAlerts:!0,codeBlocks:{lineHighlighting:!0,lineNumbers:!0,focus:!0,diffs:!0,errorWarningMarkers:!0},codeGroups:!0,codeImports:!0,inlineToc:!0,customAnchors:!0,emoji:!0,badges:!0,includes:!0,externalLinks:{autoTarget:!0,autoRel:!0,showIcon:!0},imageLazyLoading:!0,tables:{alignment:!0,enhancedStyling:!0,responsive:!0}},syntaxHighlightTheme:"github-light"},search:{enabled:!0,maxResults:12,keyboardShortcuts:!0},themeConfig:{socialLinks:[{icon:"github",link:"https://github.com/stacksjs/bunpress"}]},verbose:!1,sitemap:{enabled:!0,filename:"sitemap.xml",defaultPriority:0.5,defaultChangefreq:"monthly",maxUrlsPerFile:50000,useSitemapIndex:!1},robots:{enabled:!0,filename:"robots.txt"}};function e($){let Q=$.plugins;if(!Array.isArray(Q)||Q.length===0)return $;let Z=$;for(let J of Q){if(!J||typeof J!=="object")continue;let V=J.name||"unnamed plugin";try{if(typeof J.extendConfig==="function")Z=J.extendConfig(Z)??Z}catch(W){console.error(`[bunpress] ${V}: extendConfig failed \u2014`,W)}try{if(typeof J.validateConfig==="function"){let W=J.validateConfig(Z);for(let X of W?.warnings??[])console.warn(`[bunpress] ${V}: ${X}`);for(let X of W?.errors??[])console.error(`[bunpress] ${V}: ${X}`)}}catch(W){console.error(`[bunpress] ${V}: validateConfig failed \u2014`,W)}}for(let J of Q)try{J?.onConfigLoad?.(Z)}catch(V){console.error(`[bunpress] ${J?.name||"unnamed plugin"}: onConfigLoad failed \u2014`,V)}return Z}async function QQ(){let $=["bunpress.config.ts","bunpress.config.js",".config/bunpress.ts","docs.config.ts",".config/docs.ts"],Q=[];for(let Z of $)if(await Bun.file(Z).exists())Q.push(Z);if(Q.length>1){let[Z,...J]=Q;console.warn(`[bunpress] Multiple config files found. Using ${Z}; ignoring ${J.join(", ")}.`)}await ZQ(Q.length>0)}async function ZQ($){let Q=["docs","documentation","site"],Z=["bunpress.config.ts","bunpress.config.js","docs.config.ts"];for(let J of Q)for(let V of Z){let W=`${J}/${V}`;if(!await Bun.file(W).exists())continue;let X=$?`merge it into the config at the project root, or pass --config ${W}`:`move it to ./${V}, or pass --config ${W}`;console.warn(`[bunpress] ${W} is never loaded: config is discovered from the working directory, not the docs directory. To use it, ${X}.`);return}}await QQ();var $Q=e(await n({name:"bunpress",alias:"docs",defaultConfig:t}));async function TQ(){return $Q}function D(){let $=null;return(Q)=>{let Z=Q.match(/^\s{0,3}(`{3,}|~{3,})(.*)$/);if(!Z)return $!==null;let J=Z[1];if($===null)return $=J,!0;let V=J[0]===$[0],W=J.length>=$.length;if(V&&W&&Z[2].trim()==="")$=null;return!0}}function T($){let Q=D();return $.split(`
1239
+ `],preserveDirectoryStructure:!0,features:{inlineFormatting:!0,containers:!0,githubAlerts:!0,codeBlocks:{lineHighlighting:!0,lineNumbers:!0,focus:!0,diffs:!0,errorWarningMarkers:!0},codeGroups:!0,codeImports:!0,inlineToc:!0,customAnchors:!0,emoji:!0,badges:!0,includes:!0,externalLinks:{autoTarget:!0,autoRel:!0,showIcon:!0},imageLazyLoading:!0,tables:{alignment:!0,enhancedStyling:!0,responsive:!0}},syntaxHighlightTheme:"github-light"},search:{enabled:!0,maxResults:12,keyboardShortcuts:!0},themeConfig:{socialLinks:[{icon:"github",link:"https://github.com/stacksjs/bunpress"}]},verbose:!1,sitemap:{enabled:!0,filename:"sitemap.xml",defaultPriority:0.5,defaultChangefreq:"monthly",maxUrlsPerFile:50000,useSitemapIndex:!1},robots:{enabled:!0,filename:"robots.txt"}};function B0(X){let Q=X.plugins;if(!Array.isArray(Q)||Q.length===0)return X;let Z=X;for(let $ of Q){if(!$||typeof $!=="object")continue;let J=$.name||"unnamed plugin";try{if(typeof $.extendConfig==="function")Z=$.extendConfig(Z)??Z}catch(V){console.error(`[bunpress] ${J}: extendConfig failed \u2014`,V)}try{if(typeof $.validateConfig==="function"){let V=$.validateConfig(Z);for(let W of V?.warnings??[])console.warn(`[bunpress] ${J}: ${W}`);for(let W of V?.errors??[])console.error(`[bunpress] ${J}: ${W}`)}}catch(V){console.error(`[bunpress] ${J}: validateConfig failed \u2014`,V)}}for(let $ of Q)try{$?.onConfigLoad?.(Z)}catch(J){console.error(`[bunpress] ${$?.name||"unnamed plugin"}: onConfigLoad failed \u2014`,J)}return Z}async function N0(){let X=["bunpress.config.ts","bunpress.config.js",".config/bunpress.ts","docs.config.ts",".config/docs.ts"],Q=[];for(let Z of X)if(await Bun.file(Z).exists())Q.push(Z);if(Q.length>1){let[Z,...$]=Q;console.warn(`[bunpress] Multiple config files found. Using ${Z}; ignoring ${$.join(", ")}.`)}await M0(Q.length>0)}async function M0(X){let Q=["docs","documentation","site"],Z=["bunpress.config.ts","bunpress.config.js","docs.config.ts"];for(let $ of Q)for(let J of Z){let V=`${$}/${J}`;if(!await Bun.file(V).exists())continue;let W=X?`merge it into the config at the project root, or pass --config ${V}`:`move it to ./${J}, or pass --config ${V}`;console.warn(`[bunpress] ${V} is never loaded: config is discovered from the working directory, not the docs directory. To use it, ${W}.`);return}}await N0();var U0=B0(await K0({name:"bunpress",alias:"docs",defaultConfig:G0}));async function t0(){return U0}function E(){let X=null;return(Q)=>{let Z=Q.match(/^\s{0,3}(`{3,}|~{3,})(.*)$/);if(!Z)return X!==null;let $=Z[1];if(X===null)return X=$,!0;let J=$[0]===X[0],V=$.length>=X.length;if(J&&V&&Z[2].trim()==="")X=null;return!0}}function u(X){let Q=E();return X.split(`
1240
1240
  `).filter((Z)=>!Q(Z)).join(`
1241
- `)}function S($){return`\x00BPCODE${$}\x00`}var JQ=/\u0000BPCODE(\d+)\u0000/g;function VQ($){let Q=[],Z=D(),J=[],V=null,W=()=>{if(!V)return;Q.push(V.join(`
1242
- `)),J.push(S(Q.length-1)),V=null};for(let X of $.split(`
1243
- `)){if(Z(X)){V??=[],V.push(X);continue}W(),J.push(X.replace(/(`+)(?:(?!\1)[\s\S])*\1/g,(j)=>{return Q.push(j),S(Q.length-1)}))}return W(),{masked:J.join(`
1244
- `),restore:(X)=>X.replace(JQ,(j,Y)=>Q[Number(Y)]??j)}}async function kQ($,Q){let{masked:Z,restore:J}=VQ($);return J(await Q(Z))}var WQ=["email","sms"];function XQ($){return WQ.includes($.toLowerCase())}function F($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var m=/\{\{\s*([\w.-]+)\s*\}\}|\{([\w.-]+)\}/g;function R($){return F($).replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^*\w])\*([^*\s][^*]*)\*(?!\w)/g,"$1<em>$2</em>").replace(m,(Q)=>`<span class="bp-message-var">${Q}</span>`)}var YQ=/\[([^\]]+)\]\(([^)\s]+)\)|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])/g;function M($){let Q="",Z=0;for(let J of $.matchAll(YQ)){Q+=R($.slice(Z,J.index));let V=J[2]??J[3],W=J[1]??J[3];Q+=`<a href="${F(V)}" target="_blank" rel="noopener noreferrer">${R(W)}</a>`,Z=J.index+J[0].length}return Q+R($.slice(Z))}var x=/^([A-Za-z][\w-]*):\s*(.*)$/,H=/^\s*-{3,}\s*$/;function A($,Q){let Z=$.replace(/\r\n?/g,`
1241
+ `)}function p(X){return`\x00BPCODE${X}\x00`}var I0=/\u0000BPCODE(\d+)\u0000/g;function _0(X){let Q=[],Z=E(),$=[],J=null,V=()=>{if(!J)return;Q.push(J.join(`
1242
+ `)),$.push(p(Q.length-1)),J=null};for(let W of X.split(`
1243
+ `)){if(Z(W)){J??=[],J.push(W);continue}V(),$.push(W.replace(/(`+)(?:(?!\1)[\s\S])*\1/g,(Y)=>{return Q.push(Y),p(Q.length-1)}))}return V(),{masked:$.join(`
1244
+ `),restore:(W)=>W.replace(I0,(Y,j)=>Q[Number(j)]??Y)}}async function Q1(X,Q){let{masked:Z,restore:$}=_0(X);return $(await Q(Z))}var F0=["email","sms"];function R0(X){return F0.includes(X.toLowerCase())}function F(X){return X.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var c=/\{\{\s*([\w.-]+)\s*\}\}|\{([\w.-]+)\}/g;function w(X){return F(X).replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^*\w])\*([^*\s][^*]*)\*(?!\w)/g,"$1<em>$2</em>").replace(c,(Q)=>`<span class="bp-message-var">${Q}</span>`)}var D0=/\[([^\]]+)\]\(([^)\s]+)\)|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])/g;function _(X){let Q="",Z=0;for(let $ of X.matchAll(D0)){Q+=w(X.slice(Z,$.index));let J=$[2]??$[3],V=$[1]??$[3];Q+=`<a href="${F(J)}" target="_blank" rel="noopener noreferrer">${w(V)}</a>`,Z=$.index+$[0].length}return Q+w(X.slice(Z))}var g=/^([A-Za-z][\w-]*):\s*(.*)$/,y=/^\s*-{3,}\s*$/;function S(X,Q){let Z=X.replace(/\r\n?/g,`
1245
1245
  `).replace(/^\n+|\n+$/g,"").split(`
1246
- `),J=[],V=0,W=Z.findIndex((j)=>H.test(j));if(W>0){let j=Z.slice(0,W).filter((Y)=>Y.trim()!=="");if(j.length>0&&j.every((Y)=>x.test(Y))){for(let Y of j){let[,K,z]=Y.match(x);J.push({key:K.toLowerCase(),value:z.trim()})}V=W+1}}let X=[[]];for(let j of Z.slice(V)){if(Q&&H.test(j)){X.push([]);continue}X[X.length-1].push(j)}return{headers:J,parts:X.map((j)=>jQ(j)).filter((j)=>j.length>0)}}function jQ($){let Q=0,Z=$.length;while(Q<Z&&$[Q].trim()==="")Q++;while(Z>Q&&$[Z-1].trim()==="")Z--;return $.slice(Q,Z)}function qQ($){let Q=[[]];for(let Z of $){if(Z.trim()===""){if(Q[Q.length-1].length>0)Q.push([]);continue}Q[Q.length-1].push(Z)}return Q.filter((Z)=>Z.length>0)}var k=/^\s*\[([^\]]+)\]\(([^)\s]+)\)\s*$/,f=/^\s*[-*]\s+/;function zQ($){return qQ($).map((Q)=>{if(Q.length===1&&H.test(Q[0]))return"<hr>";if(Q.every((Z)=>k.test(Z)))return`<p class="bp-email-actions">${Q.map((J)=>{let[,V,W]=J.match(k);return`<a class="bp-email-button" href="${F(W)}" target="_blank" rel="noopener noreferrer">${R(V)}</a>`}).join("")}</p>`;if(Q.every((Z)=>f.test(Z)))return`<ul>${Q.map((Z)=>`<li>${M(Z.replace(f,""))}</li>`).join("")}</ul>`;if(Q.every((Z)=>Z.startsWith(">")))return`<blockquote>${Q.map((Z)=>M(Z.replace(/^>\s?/,""))).join("<br>")}</blockquote>`;return Q.join(`
1246
+ `),$=[],J=0,V=Z.findIndex((Y)=>y.test(Y));if(V>0){let Y=Z.slice(0,V).filter((j)=>j.trim()!=="");if(Y.length>0&&Y.every((j)=>g.test(j))){for(let j of Y){let[,M,z]=j.match(g);$.push({key:M.toLowerCase(),value:z.trim()})}J=V+1}}let W=[[]];for(let Y of Z.slice(J)){if(Q&&y.test(Y)){W.push([]);continue}W[W.length-1].push(Y)}return{headers:$,parts:W.map((Y)=>O0(Y)).filter((Y)=>Y.length>0)}}function O0(X){let Q=0,Z=X.length;while(Q<Z&&X[Q].trim()==="")Q++;while(Z>Q&&X[Z-1].trim()==="")Z--;return X.slice(Q,Z)}function H0(X){let Q=[[]];for(let Z of X){if(Z.trim()===""){if(Q[Q.length-1].length>0)Q.push([]);continue}Q[Q.length-1].push(Z)}return Q.filter((Z)=>Z.length>0)}var h=/^\s*\[([^\]]+)\]\(([^)\s]+)\)\s*$/,d=/^\s*[-*]\s+/;function A0(X){return H0(X).map((Q)=>{if(Q.length===1&&y.test(Q[0]))return"<hr>";if(Q.every((Z)=>h.test(Z)))return`<p class="bp-email-actions">${Q.map(($)=>{let[,J,V]=$.match(h);return`<a class="bp-email-button" href="${F(V)}" target="_blank" rel="noopener noreferrer">${w(J)}</a>`}).join("")}</p>`;if(Q.every((Z)=>d.test(Z)))return`<ul>${Q.map((Z)=>`<li>${_(Z.replace(d,""))}</li>`).join("")}</ul>`;if(Q.every((Z)=>Z.startsWith(">")))return`<blockquote>${Q.map((Z)=>_(Z.replace(/^>\s?/,""))).join("<br>")}</blockquote>`;return Q.join(`
1247
1247
  `).split(/\n\s*-{3,}\s*\n?/).map((Z)=>`<p>${Z.split(`
1248
- `).map(M).join("<br>")}</p>`).join("<hr>")}).join(`
1249
- `)}var KQ={from:"From",to:"To",cc:"Cc",bcc:"Bcc","reply-to":"Reply-To"};function u($){return KQ[$]??$.replace(/[-_]/g," ").replace(/^\w/,(Q)=>Q.toUpperCase())}function GQ($){let{headers:Q,parts:Z}=A($,!1),J=Q.find((X)=>X.key==="subject")?.value,V=Q.find((X)=>X.key==="preheader")?.value,W=Q.filter((X)=>X.key!=="subject"&&X.key!=="preheader").map((X)=>`<div><dt>${F(u(X.key))}</dt><dd>${M(X.value)}</dd></div>`).join("");return['<figure class="bp-email bp-message" aria-label="Email preview">','<div class="bp-email-bar"><span class="bp-email-dots" aria-hidden="true"><i></i><i></i><i></i></span><span class="bp-message-kind">Email</span></div>',J?`<div class="bp-email-subject">${M(J)}</div>`:"",W?`<dl class="bp-email-headers">${W}</dl>`:"",V?`<div class="bp-email-preheader"><span>Preview text</span> ${M(V)}</div>`:"",`<div class="bp-email-body">${zQ(Z[0]??[])}</div>`,"</figure>"].join("")}var BQ=`@\xA3$\xA5\xE8\xE9\xF9\xEC\xF2\xC7
1250
- \xD8\xF8\r\xC5\xE5\u0394_\u03A6\u0393\u039B\u03A9\u03A0\u03A8\u03A3\u0398\u039E\xC6\xE6\xDF\xC9 !"#\xA4%&'()*+,-./0123456789:;<=>?\xA1ABCDEFGHIJKLMNOPQRSTUVWXYZ\xC4\xD6\xD1\xDC\xA7\xBFabcdefghijklmnopqrstuvwxyz\xE4\xF6\xF1\xFC\xE0`,NQ="^{}\\[~]|\u20AC\f";function MQ($){let Q=0,Z=!0;for(let V of $)if(BQ.includes(V))Q+=1;else if(NQ.includes(V))Q+=2;else{Z=!1;break}if(Z)return{encoding:"GSM-7",length:Q,segments:Q<=160?1:Math.ceil(Q/153)};let J=$.length;return{encoding:"UCS-2",length:J,segments:J<=70?1:Math.ceil(J/67)}}function UQ($){let Q=$.replace(m,""),Z=Q!==$;if(Z&&Q.trim()==="")return'<div class="bp-sms-meta">Length depends on what is filled in</div>';let{encoding:J,length:V,segments:W}=MQ(Q),X=Z?" + placeholders":"",j=`${Z?"at least ":""}${W} ${W===1?"segment":"segments"}`,Y=`${V} ${J==="GSM-7"?"characters":"UTF-16 units"} (${J})${Z?", not counting placeholders":""}`;return`<div class="bp-sms-meta" title="${F(Y)}">${V} chars${X} \xB7 ${j}${J==="UCS-2"?" \xB7 Unicode":""}</div>`}function FQ($){let{headers:Q,parts:Z}=A($,!0),J=Q.find((Y)=>Y.key==="from")?.value??"",V=Q.find((Y)=>Y.key==="to")?.value,W=Q.filter((Y)=>Y.key!=="from"&&Y.key!=="to").map((Y)=>`<div><dt>${F(u(Y.key))}</dt><dd>${M(Y.value)}</dd></div>`).join(""),X=(J.replace(/[^A-Za-z0-9]/g,"")[0]??"#").toUpperCase(),j=Z.map((Y)=>{let K=Y.every((q)=>q.trim()===""||q.startsWith(">")),z=K?Y.map((q)=>q.replace(/^>\s?/,"")):Y,G=z.join(`
1251
- `),B=z.map(M).join("<br>");if(K)return`<div class="bp-sms-reply bp-sms-row"><div class="bp-sms-bubble">${B}</div></div>`;return`<div class="bp-sms-row"><div class="bp-sms-bubble">${B}</div>${UQ(G)}</div>`}).join("");return['<figure class="bp-message bp-sms" aria-label="SMS preview">','<div class="bp-sms-phone">','<div class="bp-sms-header">',`<span class="bp-sms-avatar" aria-hidden="true">${F(X)}</span>`,'<span class="bp-sms-who">',`<span class="bp-sms-from">${M(J||"Text message")}</span>`,V?`<span class="bp-sms-to">to ${M(V)}</span>`:"","</span>",'<span class="bp-message-kind">SMS</span>',"</div>",W?`<dl class="bp-sms-details">${W}</dl>`:"",`<div class="bp-sms-thread">${j}</div>`,"</div>","</figure>"].join("")}function mQ($,Q){switch($.toLowerCase()){case"email":return GQ(Q);case"sms":return FQ(Q);default:return null}}var uQ=`
1248
+ `).map(_).join("<br>")}</p>`).join("<hr>")}).join(`
1249
+ `)}var L0={from:"From",to:"To",cc:"Cc",bcc:"Bcc","reply-to":"Reply-To"};function l(X){return L0[X]??X.replace(/[-_]/g," ").replace(/^\w/,(Q)=>Q.toUpperCase())}function C0(X){let{headers:Q,parts:Z}=S(X,!1),$=Q.find((W)=>W.key==="subject")?.value,J=Q.find((W)=>W.key==="preheader")?.value,V=Q.filter((W)=>W.key!=="subject"&&W.key!=="preheader").map((W)=>`<div><dt>${F(l(W.key))}</dt><dd>${_(W.value)}</dd></div>`).join("");return['<figure class="bp-email bp-message" aria-label="Email preview">','<div class="bp-email-bar"><span class="bp-email-dots" aria-hidden="true"><i></i><i></i><i></i></span><span class="bp-message-kind">Email</span></div>',$?`<div class="bp-email-subject">${_($)}</div>`:"",V?`<dl class="bp-email-headers">${V}</dl>`:"",J?`<div class="bp-email-preheader"><span>Preview text</span> ${_(J)}</div>`:"",`<div class="bp-email-body">${A0(Z[0]??[])}</div>`,"</figure>"].join("")}var E0=`@\xA3$\xA5\xE8\xE9\xF9\xEC\xF2\xC7
1250
+ \xD8\xF8\r\xC5\xE5\u0394_\u03A6\u0393\u039B\u03A9\u03A0\u03A8\u03A3\u0398\u039E\xC6\xE6\xDF\xC9 !"#\xA4%&'()*+,-./0123456789:;<=>?\xA1ABCDEFGHIJKLMNOPQRSTUVWXYZ\xC4\xD6\xD1\xDC\xA7\xBFabcdefghijklmnopqrstuvwxyz\xE4\xF6\xF1\xFC\xE0`,w0="^{}\\[~]|\u20AC\f";function P0(X){let Q=0,Z=!0;for(let J of X)if(E0.includes(J))Q+=1;else if(w0.includes(J))Q+=2;else{Z=!1;break}if(Z)return{encoding:"GSM-7",length:Q,segments:Q<=160?1:Math.ceil(Q/153)};let $=X.length;return{encoding:"UCS-2",length:$,segments:$<=70?1:Math.ceil($/67)}}function y0(X){let Q=X.replace(c,""),Z=Q!==X;if(Z&&Q.trim()==="")return'<div class="bp-sms-meta">Length depends on what is filled in</div>';let{encoding:$,length:J,segments:V}=P0(Q),W=Z?" + placeholders":"",Y=`${Z?"at least ":""}${V} ${V===1?"segment":"segments"}`,j=`${J} ${$==="GSM-7"?"characters":"UTF-16 units"} (${$})${Z?", not counting placeholders":""}`;return`<div class="bp-sms-meta" title="${F(j)}">${J} chars${W} \xB7 ${Y}${$==="UCS-2"?" \xB7 Unicode":""}</div>`}function S0(X){let{headers:Q,parts:Z}=S(X,!0),$=Q.find((j)=>j.key==="from")?.value??"",J=Q.find((j)=>j.key==="to")?.value,V=Q.filter((j)=>j.key!=="from"&&j.key!=="to").map((j)=>`<div><dt>${F(l(j.key))}</dt><dd>${_(j.value)}</dd></div>`).join(""),W=($.replace(/[^A-Za-z0-9]/g,"")[0]??"#").toUpperCase(),Y=Z.map((j)=>{let M=j.every((q)=>q.trim()===""||q.startsWith(">")),z=M?j.map((q)=>q.replace(/^>\s?/,"")):j,B=z.join(`
1251
+ `),K=z.map(_).join("<br>");if(M)return`<div class="bp-sms-reply bp-sms-row"><div class="bp-sms-bubble">${K}</div></div>`;return`<div class="bp-sms-row"><div class="bp-sms-bubble">${K}</div>${y0(B)}</div>`}).join("");return['<figure class="bp-message bp-sms" aria-label="SMS preview">','<div class="bp-sms-phone">','<div class="bp-sms-header">',`<span class="bp-sms-avatar" aria-hidden="true">${F(W)}</span>`,'<span class="bp-sms-who">',`<span class="bp-sms-from">${_($||"Text message")}</span>`,J?`<span class="bp-sms-to">to ${_(J)}</span>`:"","</span>",'<span class="bp-message-kind">SMS</span>',"</div>",V?`<dl class="bp-sms-details">${V}</dl>`:"",`<div class="bp-sms-thread">${Y}</div>`,"</div>","</figure>"].join("")}function Z1(X,Q){switch(X.toLowerCase()){case"email":return C0(Q);case"sms":return S0(Q);default:return null}}var $1=`
1252
1252
  .bp-message {
1253
1253
  margin: 20px 0;
1254
1254
  font-size: 15px;
@@ -1491,17 +1491,17 @@ if (typeof document !== 'undefined') {
1491
1491
  font-size: 11px;
1492
1492
  color: var(--bp-c-text-3, #929295);
1493
1493
  }
1494
- `;function p($){let Q=[],Z=null,J=null;for(let V of $.split(`
1495
- `)){let W=V.match(/^\s{0,3}(`{3,}|~{3,})(.*)$/);if(J){if(W&&W[1][0]===J.marker[0]&&W[1].length>=J.marker.length&&W[2].trim()===""){let{headers:X,parts:j}=A(J.lines.join(`
1496
- `),!0);Q.push("",...X.map((Y)=>Y.value),...j.flat(),""),J=null}else J.lines.push(V);continue}if(Z){if(W&&W[1][0]===Z[0]&&W[1].length>=Z.length&&W[2].trim()==="")Z=null;Q.push(V);continue}if(W){if(XQ(W[2].trim().split(/[\s{]/)[0]??""))J={marker:W[1],lines:[]};else Z=W[1];if(!J)Q.push(V);continue}Q.push(V)}return Q.join(`
1497
- `)}var IQ={enabled:!0,position:["sidebar"],title:"Table of Contents",maxDepth:6,minDepth:2,className:"table-of-contents",smoothScroll:!0,activeHighlight:!0,collapsible:!0,exclude:[]};function L($){return $.replace(/\s*<!-- toc-ignore -->\s*/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1").replace(/<[^>]*>/g,"").trim()}function P($){return $.toLowerCase().trim().replace(/<[^>]*>/g,"").replace(/what's new\?\s*\(v2\.0\)/g,"whats-new-v2-0").replace(/features\s*&\s*benefits/g,"features-benefits").replace(/vue\.js\s*\+\s*typescript\s*=\s*\u2764\uFE0F/g,"vue-js-typescript").replace(/\//g,"-").replace(/\./g,"-").replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function w($,Q){let Z=$,J=1;while(Q.has($))$=`${Z}-${J}`,J++;return Q.add($),$}function g($,Q){return w(P($),Q)}function _Q($){let Q=[],Z=new Set,J=/^(#{1,6})\s+(.+)$/gm,V;while((V=J.exec($))!==null){let W=V[1].length,X=V[2].trim();if(!X)continue;if(X.includes("toc-ignore"))continue;let j=X.replace(/\s*<!-- toc-ignore -->\s*/g,"").trim();j=j.replace(/`([^`]+)`/g,"<code>$1</code>");let Y=j.includes("<code>"),K=g(L(X),Z);Q.push({level:W,text:j,id:K,children:[],hasCode:Y})}return Q}function DQ($){let Q=[],Z=[];for(let J of $){while(Z.length>0&&Z[Z.length-1].level>=J.level)Z.pop();if(Z.length===0)Q.push(J);else Z[Z.length-1].children.push(J);Z.push(J)}return Q}function RQ($,Q){let{minDepth:Z=2,maxDepth:J=6,exclude:V=[]}=Q,W=(X)=>{let j=[];for(let Y of X){if(V.some((z)=>{if(z.startsWith("/")&&z.endsWith("/"))return new RegExp(z.slice(1,-1)).test(Y.text);else return Y.text===z}))continue;if(Y.level>J)continue;let K=W(Y.children);if(Y.level>=Z&&Y.level<=J)j.push({...Y,children:K});else j.push(...K)}return j};return W($)}function y($){let{items:Q,title:Z,config:J}=$,{className:V,collapsible:W}=J,X=(j,Y=0)=>{if(j.length===0)return"";let K=Y===0?"toc-list":"toc-sublist",z=Y===0?"toc-item":"toc-subitem";return`<ul class="${K}">
1498
- ${j.map((G)=>{let B=G.children.length>0,q=B&&W?"toc-expand":"",_=B?X(G.children,Y+1):"",E=50,N=G.text.length>50?`${G.text.substring(0,50)}...`:G.text,U=G.text.length>50?"toc-truncate":"";return`<li class="${G.hasCode?"toc-code":""} ${q} ${z} ${U}">
1499
- <a href="#${G.id}" class="toc-link" title="${G.text.replace(/<[^>]*>/g,"")}">${N}</a>
1500
- ${_}
1494
+ `;function r(X){let Q=[],Z=null,$=null;for(let J of X.split(`
1495
+ `)){let V=J.match(/^\s{0,3}(`{3,}|~{3,})(.*)$/);if($){if(V&&V[1][0]===$.marker[0]&&V[1].length>=$.marker.length&&V[2].trim()===""){let{headers:W,parts:Y}=S($.lines.join(`
1496
+ `),!0);Q.push("",...W.map((j)=>j.value),...Y.flat(),""),$=null}else $.lines.push(J);continue}if(Z){if(V&&V[1][0]===Z[0]&&V[1].length>=Z.length&&V[2].trim()==="")Z=null;Q.push(J);continue}if(V){if(R0(V[2].trim().split(/[\s{]/)[0]??""))$={marker:V[1],lines:[]};else Z=V[1];if(!$)Q.push(J);continue}Q.push(J)}return Q.join(`
1497
+ `)}var T0={enabled:!0,position:["sidebar"],title:"Table of Contents",maxDepth:6,minDepth:2,className:"table-of-contents",smoothScroll:!0,activeHighlight:!0,collapsible:!0,exclude:[]};function T(X){return X.replace(/\s*<!-- toc-ignore -->\s*/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1").replace(/<[^>]*>/g,"").trim()}function v(X){return X.toLowerCase().trim().replace(/<[^>]*>/g,"").replace(/what's new\?\s*\(v2\.0\)/g,"whats-new-v2-0").replace(/features\s*&\s*benefits/g,"features-benefits").replace(/vue\.js\s*\+\s*typescript\s*=\s*\u2764\uFE0F/g,"vue-js-typescript").replace(/\//g,"-").replace(/\./g,"-").replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function b(X,Q){let Z=X,$=1;while(Q.has(X))X=`${Z}-${$}`,$++;return Q.add(X),X}function s(X,Q){return b(v(X),Q)}function v0(X){let Q=[],Z=new Set,$=/^(#{1,6})\s+(.+)$/gm,J;while((J=$.exec(X))!==null){let V=J[1].length,W=J[2].trim();if(!W)continue;if(W.includes("toc-ignore"))continue;let Y=W.replace(/\s*<!-- toc-ignore -->\s*/g,"").trim();Y=Y.replace(/`([^`]+)`/g,"<code>$1</code>");let j=Y.includes("<code>"),M=s(T(W),Z);Q.push({level:V,text:Y,id:M,children:[],hasCode:j})}return Q}function b0(X){let Q=[],Z=[];for(let $ of X){while(Z.length>0&&Z[Z.length-1].level>=$.level)Z.pop();if(Z.length===0)Q.push($);else Z[Z.length-1].children.push($);Z.push($)}return Q}function x0(X,Q){let{minDepth:Z=2,maxDepth:$=6,exclude:J=[]}=Q,V=(W)=>{let Y=[];for(let j of W){if(J.some((z)=>{if(z.startsWith("/")&&z.endsWith("/"))return new RegExp(z.slice(1,-1)).test(j.text);else return j.text===z}))continue;if(j.level>$)continue;let M=V(j.children);if(j.level>=Z&&j.level<=$)Y.push({...j,children:M});else Y.push(...M)}return Y};return V(X)}function P(X){let{items:Q,title:Z,config:$}=X,{className:J,collapsible:V}=$,W=(Y,j=0)=>{if(Y.length===0)return"";let M=j===0?"toc-list":"toc-sublist",z=j===0?"toc-item":"toc-subitem";return`<ul class="${M}">
1498
+ ${Y.map((B)=>{let K=B.children.length>0,q=K&&V?"toc-expand":"",G=K?W(B.children,j+1):"",I=50,N=B.text.length>50?`${B.text.substring(0,50)}...`:B.text,U=B.text.length>50?"toc-truncate":"";return`<li class="${B.hasCode?"toc-code":""} ${q} ${z} ${U}">
1499
+ <a href="#${B.id}" class="toc-link" title="${B.text.replace(/<[^>]*>/g,"")}">${N}</a>
1500
+ ${G}
1501
1501
  </li>`}).join(`
1502
1502
  `)}
1503
- </ul>`};return[`<nav class="${V}" role="navigation" aria-label="${Z}">`,'<div class="toc-container">',` <h2 class="toc-title">${Z}</h2>`,` ${X(Q)}`,"</div>","</nav>"].join(`
1504
- `)}function h($){return y($).replace("table-of-contents","table-of-contents toc-inline inline-toc")}function yQ($){return y($).replace("table-of-contents","table-of-contents toc-sidebar sidebar-toc")}function OQ($){return y($).replace("table-of-contents","table-of-contents toc-floating floating-toc")}function HQ($,Q={}){let Z={...Q};if(typeof Z.position==="string")Z.position=[Z.position];let J={...IQ,...Z},V=_Q($),W=DQ(V),X=RQ(W,J);return{title:J.title,items:X,config:J}}function gQ($,Q={}){let Z=HQ($,Q);return(Array.isArray(Q.position)?Q.position:[Q.position||"sidebar"]).map((V)=>{let W;switch(V){case"inline":W=h(Z);break;case"sidebar":W=yQ(Z);break;case"floating":W=OQ(Z);break;default:W=y(Z)}return{position:V,data:Z,html:W}})}function hQ($,Q){let Z=h(Q);return $.replace(/\[\[toc\]\]/gi,Z)}function dQ($){let Q=new Set;return $.replace(/<h([1-6])>(.*?)<\/h[1-6]>/gi,(Z,J,V)=>{let W=g(V.replace(/<[^>]*>/g,""),Q);return`<h${J} id="${W}"><a href="#${W}" class="heading-anchor">#</a>${V}</h${J}>`})}function cQ(){return`
1503
+ </ul>`};return[`<nav class="${J}" role="navigation" aria-label="${Z}">`,'<div class="toc-container">',` <h2 class="toc-title">${Z}</h2>`,` ${W(Q)}`,"</div>","</nav>"].join(`
1504
+ `)}function o(X){return P(X).replace("table-of-contents","table-of-contents toc-inline inline-toc")}function k0(X){return P(X).replace("table-of-contents","table-of-contents toc-sidebar sidebar-toc")}function m0(X){return P(X).replace("table-of-contents","table-of-contents toc-floating floating-toc")}function f0(X,Q={}){let Z={...Q};if(typeof Z.position==="string")Z.position=[Z.position];let $={...T0,...Z},J=v0(X),V=b0(J),W=x0(V,$);return{title:$.title,items:W,config:$}}function V1(X,Q={}){let Z=f0(X,Q);return(Array.isArray(Q.position)?Q.position:[Q.position||"sidebar"]).map((J)=>{let V;switch(J){case"inline":V=o(Z);break;case"sidebar":V=k0(Z);break;case"floating":V=m0(Z);break;default:V=P(Z)}return{position:J,data:Z,html:V}})}function W1(X,Q){let Z=o(Q);return X.replace(/\[\[toc\]\]/gi,Z)}function Y1(X){let Q=new Set;return X.replace(/<h([1-6])>(.*?)<\/h[1-6]>/gi,(Z,$,J)=>{let V=s(J.replace(/<[^>]*>/g,""),Q);return`<h${$} id="${V}"><a href="#${V}" class="heading-anchor">#</a>${J}</h${$}>`})}function q1(){return`
1505
1505
  .table-of-contents {
1506
1506
  position: sticky;
1507
1507
  top: 60px; /* Match navbar height */
@@ -1631,7 +1631,7 @@ html {
1631
1631
  max-width: 250px;
1632
1632
  }
1633
1633
  }
1634
- `}function lQ($={}){let Q=$.smoothScroll!==!1,Z=$.activeHighlight!==!1,J=$.collapsible!==!1;return`
1634
+ `}function j1(X={}){let Q=X.smoothScroll!==!1,Z=X.activeHighlight!==!1,$=X.collapsible!==!1;return`
1635
1635
  function initToc() {
1636
1636
  const tocLinks = document.querySelectorAll('.toc-link')
1637
1637
 
@@ -1700,7 +1700,7 @@ function initToc() {
1700
1700
  updateActiveTocItem()
1701
1701
 
1702
1702
  // TOC collapse/expand functionality
1703
- const expandableItems = ${String(J)} ? document.querySelectorAll('.toc-expand') : []
1703
+ const expandableItems = ${String($)} ? document.querySelectorAll('.toc-expand') : []
1704
1704
 
1705
1705
  expandableItems.forEach(item => {
1706
1706
  item.addEventListener('click', function(e) {
@@ -1733,7 +1733,7 @@ if (document.readyState === 'loading') {
1733
1733
  else {
1734
1734
  initToc()
1735
1735
  }
1736
- `}var{Glob:d,YAML:AQ}=globalThis.Bun;import{join as LQ}from"path";var eQ="/search-index.json",I={include:["**/*.md"],exclude:["public/**","**/node_modules/**"],searchFields:["title","content","headings","keywords"],maxResults:10,minQueryLength:1,fuzzy:!1,fuzziness:1,stemmer:"none",maxContentLength:800,boost:{title:10,headings:5,content:1}};function r($){let Q=$?.options??{};return{...I,...Q,include:Q.include??I.include,exclude:Q.exclude??I.exclude,searchFields:Q.searchFields??I.searchFields,maxResults:Q.maxResults??$?.maxResults??I.maxResults,boost:{...I.boost,...Q.boost??{}}}}var c=[{key:"k",meta:!0,ctrl:!1,alt:!1,shift:!1},{key:"k",meta:!1,ctrl:!0,alt:!1,shift:!1},{key:"/",meta:!1,ctrl:!1,alt:!1,shift:!1}];function PQ($){if(!$)return c;let Q=(Array.isArray($)?$:[$]).map((V)=>String(V).toLowerCase()),Z={meta:!1,ctrl:!1,alt:!1,shift:!1},J="";for(let V of Q)if(V==="meta"||V==="cmd"||V==="command")Z.meta=!0;else if(V==="ctrl"||V==="control")Z.ctrl=!0;else if(V==="alt"||V==="option")Z.alt=!0;else if(V==="shift")Z.shift=!0;else J=V;if(!J)return c;return[{key:J,...Z}]}function l($){if(typeof $!=="function")return null;let Q=Function.prototype.toString.call($);return Q.includes("[native code]")?null:Q}function QZ($,Q){let Z=$?.search??$?.markdown?.search,J=r(Z),V=Z?.resultOptions??{};return{indexUrl:Q,placeholder:Z?.placeholder??"Search documentation",lazy:Z?.lazy!==!1,maxResults:J.maxResults,minQueryLength:J.minQueryLength,searchFields:J.searchFields,boost:{title:J.boost.title??10,headings:J.boost.headings??5,content:J.boost.content??1},fuzzy:J.fuzzy,fuzziness:J.fuzziness,stemmer:J.stemmer,shortcuts:{keyboard:Z?.keyboardShortcuts!==!1,keys:PQ(Z?.shortcut)},result:{showDescription:V.showDescription!==!1,descriptionLength:V.descriptionLength??180,highlightMatches:V.highlightMatches!==!1,showPath:V.showPath!==!1},tokenizeSource:l(Z?.options?.tokenize),onSearchSource:l(Z?.onSearch),locale:null}}function s($){return T(p($)).replace(/^:::.*$/gm," ").replace(/^\s{0,3}>\s*\[!(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/gim," ").replace(/<[^>]+>/g," ").replace(/!\[[^\]]*\]\([^)]*\)/g," ").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/[*_~]{1,3}([^*_~]+)[*_~]{1,3}/g,"$1").replace(/^\s{0,3}>\s?/gm,"").replace(/^\s*[-*+]\s+/gm,"").replace(/^\s*\d+\.\s+/gm,"").replace(/^\s*\|?[\s:|-]+\|[\s:|-]*$/gm," ").replace(/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/gm," ").replace(/\|/g," ").replace(/\s+/g," ").trim()}function wQ($){let Q=$.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!Q)return{body:$,data:{}};let Z={};try{Z=AQ.parse(Q[1])??{}}catch{Z={}}return{body:$.slice(Q[0].length),data:Z}}function CQ($){let Q=$.replace(/\.md$/,"");if(Q==="index")return"/";if(Q.endsWith("/index"))return`/${Q.slice(0,-6)}`;return`/${Q}`}function EQ($,Q,Z){let{body:J,data:V}=wQ(Q);if(V.search===!1)return[];if(V.layout==="home")return[];let W=typeof V.search==="object"&&V.search!==null?V.search:{},X=Array.isArray(W.keywords)?W.keywords.map(String):[],j=CQ($),Y=J.split(`
1737
- `),K=J.match(/^#\s+(.+)$/m),z=W.title||V.title||(K?K[1].trim():j),G=[],B=new Set,q={title:z,anchor:"",level:1,buffer:[]},_=()=>{let N=s(q.buffer.join(`
1738
- `)).slice(0,Z.maxContentLength);if(!N&&!q.title)return;let U={url:q.anchor?`${j}#${q.anchor}`:j,page:z,title:s(q.title)||z,text:N,level:q.level};if(X.length)U.keywords=X;G.push(U)},E=D();for(let N of Y){let U=E(N)?null:N.match(/^(#{1,6})\s+(.+?)\s*$/);if(!U){q.buffer.push(N);continue}let O=U[1].length,v=U[2].replace(/\s*\{#([\w-]+)\}\s*$/,""),b=U[2].match(/\{#([\w-]+)\}\s*$/),a=w(b?b[1]:P(L(v)),B);if(O===1){q.buffer.push("");continue}_(),q={title:v,anchor:a,level:O,buffer:[]}}return _(),G.filter((N)=>N.text||N.level>1)}function vQ($,Q){let{storeFields:Z}=Q;if(!Z||!Z.length)return $;let J=new Set(["url",...Z]);if(Q.searchFields.includes("title"))J.add("title");if(Q.searchFields.includes("content"))J.add("text");if(Q.searchFields.includes("headings"))J.add("page");if(Q.searchFields.includes("keywords"))J.add("keywords");return $.map((V)=>{let W={};for(let[X,j]of Object.entries(V))if(J.has(X)&&j!==void 0)W[X]=j;return W})}function i($){return $.split("#")[0]}function bQ($,Q){if(!Q.enabled)return{locale:Q.defaultLocale,page:$};let Z=$.split("/");if(Z.length>1&&Q.locales.includes(Z[0])&&Z[0]!==Q.defaultLocale)return{locale:Z[0],page:Z.slice(1).join("/")};let J=$.match(/^(.*)\.([A-Za-z-]+)(\.md)$/);if(J&&Q.locales.includes(J[2]))return{locale:J[2],page:`${J[1]}${J[3]}`};return{locale:Q.defaultLocale,page:$}}async function ZZ($,Q){let Z=Q?.search??Q?.markdown?.search,J=r(Z),V=o(Q),W=J.exclude.map((K)=>new d(K)),X=[],j=new Set,Y=new Map;for(let K of V.locales)Y.set(K,new Set);for(let K of J.include){let z=new d(K);for await(let G of z.scan($)){let B=G.replace(/\\/g,"/");if(W.some((q)=>q.match(B)))continue;j.add(B)}}for(let K of[...j].sort())try{let z=await Bun.file(LQ($,K)).text(),{locale:G,page:B}=bQ(K,V);for(let q of EQ(B,z,J)){if(V.enabled)q.locale=G,q.url=C(V,G,q.url);X.push(q),Y.get(G)?.add(i(q.url))}}catch{}if(V.enabled){let K=X.filter((z)=>z.locale===V.defaultLocale);for(let z of V.locales){if(z===V.defaultLocale)continue;let G=Y.get(z)??new Set;for(let B of K){let q=C(V,z,B.url);if(G.has(i(q)))continue;X.push({...B,url:q,locale:z})}}}return vQ(X,J)}
1739
- export{t as C,e as D,$Q as E,TQ as F,T as G,kQ as H,mQ as I,uQ as J,IQ as K,L,P as M,w as N,g as O,_Q as P,DQ as Q,RQ as R,y as S,h as T,yQ as U,OQ as V,HQ as W,gQ as X,hQ as Y,dQ as Z,cQ as _,lQ as $,eQ as aa,QZ as ba,ZZ as ca};
1736
+ `}var{Glob:i,YAML:p0}=globalThis.Bun;import{join as u0}from"path";var _1="/search-index.json",O={include:["**/*.md"],exclude:["public/**","**/node_modules/**"],searchFields:["title","content","headings","keywords"],maxResults:10,minQueryLength:1,fuzzy:!1,fuzziness:1,stemmer:"none",maxContentLength:800,boost:{title:10,headings:5,content:1}};function Z0(X){let Q=X?.options??{};return{...O,...Q,include:Q.include??O.include,exclude:Q.exclude??O.exclude,searchFields:Q.searchFields??O.searchFields,maxResults:Q.maxResults??X?.maxResults??O.maxResults,boost:{...O.boost,...Q.boost??{}}}}var n=[{key:"k",meta:!0,ctrl:!1,alt:!1,shift:!1},{key:"k",meta:!1,ctrl:!0,alt:!1,shift:!1},{key:"/",meta:!1,ctrl:!1,alt:!1,shift:!1}];function g0(X){if(!X)return n;let Q=(Array.isArray(X)?X:[X]).map((J)=>String(J).toLowerCase()),Z={meta:!1,ctrl:!1,alt:!1,shift:!1},$="";for(let J of Q)if(J==="meta"||J==="cmd"||J==="command")Z.meta=!0;else if(J==="ctrl"||J==="control")Z.ctrl=!0;else if(J==="alt"||J==="option")Z.alt=!0;else if(J==="shift")Z.shift=!0;else $=J;if(!$)return n;return[{key:$,...Z}]}function a(X){if(typeof X!=="function")return null;let Q=Function.prototype.toString.call(X);return Q.includes("[native code]")?null:Q}function F1(X,Q){let Z=X?.search??X?.markdown?.search,$=Z0(Z),J=Z?.resultOptions??{};return{indexUrl:Q,placeholder:Z?.placeholder??"Search documentation",lazy:Z?.lazy!==!1,maxResults:$.maxResults,minQueryLength:$.minQueryLength,searchFields:$.searchFields,boost:{title:$.boost.title??10,headings:$.boost.headings??5,content:$.boost.content??1},fuzzy:$.fuzzy,fuzziness:$.fuzziness,stemmer:$.stemmer,shortcuts:{keyboard:Z?.keyboardShortcuts!==!1,keys:g0(Z?.shortcut)},result:{showDescription:J.showDescription!==!1,descriptionLength:J.descriptionLength??180,highlightMatches:J.highlightMatches!==!1,showPath:J.showPath!==!1},tokenizeSource:a(Z?.options?.tokenize),onSearchSource:a(Z?.onSearch),locale:null}}function t(X){return u(r(X)).replace(/^:::.*$/gm," ").replace(/^\s{0,3}>\s*\[!(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/gim," ").replace(/<[^>]+>/g," ").replace(/!\[[^\]]*\]\([^)]*\)/g," ").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/[*_~]{1,3}([^*_~]+)[*_~]{1,3}/g,"$1").replace(/^\s{0,3}>\s?/gm,"").replace(/^\s*[-*+]\s+/gm,"").replace(/^\s*\d+\.\s+/gm,"").replace(/^\s*\|?[\s:|-]+\|[\s:|-]*$/gm," ").replace(/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/gm," ").replace(/\|/g," ").replace(/\s+/g," ").trim()}function h0(X){let Q=X.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!Q)return{body:X,data:{}};let Z={};try{Z=p0.parse(Q[1])??{}}catch{Z={}}return{body:X.slice(Q[0].length),data:Z}}function d0(X){let Q=X.replace(/\.md$/,"");if(Q==="index")return"/";if(Q.endsWith("/index"))return`/${Q.slice(0,-6)}`;return`/${Q}`}function c0(X,Q,Z){let{body:$,data:J}=h0(Q);if(J.search===!1)return[];if(J.layout==="home")return[];let V=typeof J.search==="object"&&J.search!==null?J.search:{},W=Array.isArray(V.keywords)?V.keywords.map(String):[],Y=d0(X),j=$.split(`
1737
+ `),M=$.match(/^#\s+(.+)$/m),z=V.title||J.title||(M?M[1].trim():Y),B=[],K=new Set,q={title:z,anchor:"",level:1,buffer:[]},G=()=>{let N=t(q.buffer.join(`
1738
+ `)).slice(0,Z.maxContentLength);if(!N&&!q.title)return;let U={url:q.anchor?`${Y}#${q.anchor}`:Y,page:z,title:t(q.title)||z,text:N,level:q.level};if(W.length)U.keywords=W;B.push(U)},I=E();for(let N of j){let U=I(N)?null:N.match(/^(#{1,6})\s+(.+?)\s*$/);if(!U){q.buffer.push(N);continue}let H=U[1].length,A=U[2].replace(/\s*\{#([\w-]+)\}\s*$/,""),R=U[2].match(/\{#([\w-]+)\}\s*$/),D=b(R?R[1]:v(T(A)),K);if(H===1){q.buffer.push("");continue}G(),q={title:A,anchor:D,level:H,buffer:[]}}return G(),B.filter((N)=>N.text||N.level>1)}function l0(X,Q){let{storeFields:Z}=Q;if(!Z||!Z.length)return X;let $=new Set(["url",...Z]);if(Q.searchFields.includes("title"))$.add("title");if(Q.searchFields.includes("content"))$.add("text");if(Q.searchFields.includes("headings"))$.add("page");if(Q.searchFields.includes("keywords"))$.add("keywords");return X.map((J)=>{let V={};for(let[W,Y]of Object.entries(J))if($.has(W)&&Y!==void 0)V[W]=Y;return V})}function e(X){return X.split("#")[0]}function r0(X,Q){if(!Q.enabled)return{locale:Q.defaultLocale,page:X};let Z=X.split("/");if(Z.length>1&&Q.locales.includes(Z[0])&&Z[0]!==Q.defaultLocale)return{locale:Z[0],page:Z.slice(1).join("/")};let $=X.match(/^(.*)\.([A-Za-z-]+)(\.md)$/);if($&&Q.locales.includes($[2]))return{locale:$[2],page:`${$[1]}${$[3]}`};return{locale:Q.defaultLocale,page:X}}async function R1(X,Q){let Z=Q?.search??Q?.markdown?.search,$=Z0(Z),J=X0(Q),V=$.exclude.map((z)=>new i(z)),W=[],Y=new Set,j=new Map;for(let z of J.locales)j.set(z,new Set);for(let z of $.include){let B=new i(z);for await(let K of B.scan(X)){let q=K.replace(/\\/g,"/");if(V.some((G)=>G.match(q)))continue;Y.add(q)}}for(let z of[...Y].sort())try{let B=await Bun.file(u0(X,z)).text(),{locale:K,page:q}=r0(z,J);for(let G of c0(q,B,$)){if(J.enabled)G.locale=K,G.url=L(J,K,G.url);W.push(G),j.get(K)?.add(e(G.url))}}catch{}if(J.enabled){let z=W.filter((B)=>B.locale===J.defaultLocale);for(let B of J.locales){if(B===J.defaultLocale)continue;let K=j.get(B)??new Set;for(let q of z){let G=L(J,B,q.url);if(K.has(e(G)))continue;W.push({...q,url:G,locale:B})}}}let M=Q?Q0(Q):"";if(M)for(let z of W)z.url=`${M}${z.url}`;return l0(W,$)}function $0(X){let Q={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};return X.replace(/&(#x[\da-f]+|#\d+|[a-z]+);/gi,(Z,$)=>{if($[0]==="#"){let J=$[1]==="x"||$[1]==="X"?Number.parseInt($.slice(2),16):Number.parseInt($.slice(1),10);return Number.isFinite(J)&&J>0&&J<=1114111?String.fromCodePoint(J):Z}return Q[$.toLowerCase()]??Z})}function J0(X){return String(X??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var{Glob:s0}=globalThis.Bun;import{dirname as o0,isAbsolute as V0,join as i0,relative as W0,resolve as C,sep as Y0}from"path";async function E1(X){let Q=[];for await(let Z of new s0("**/*.md").scan({cwd:X,onlyFiles:!0}))Q.push(i0(X,Z));return Q}function j0(X){return X.split("/").map((Q)=>encodeURIComponent(Q)).join("/")}function x(X){let Q=X==="index"?"":X.replace(/\/index$/,"/");return`/${j0(Q)}`}function k(X){return X.split("/").map((Z)=>encodeURIComponent(decodeURIComponent(Z))).join("/").replace(/\/+$/,"")||"/"}function w1(X,Q,Z){let $=C(Q),J={...Z,locales:[...Z.locales]},V=new Set(X.map((K)=>C(K))),W=new Map,Y=new Set;for(let K of V){let q=W0($,K).split(Y0).join("/").replace(/\.md$/,"");if(q===".."||q.startsWith("../")||V0(q))throw Error("Markdown source is outside the documentation root");let G=J.defaultLocale,I=!1;if(J.enabled){let N=q.split("/");if(N.length>1&&J.locales.includes(N[0])&&N[0]!==J.defaultLocale)G=N.shift(),I=!0,q=N.join("/");else{let U=q.match(/^(.*)\.([A-Za-z-]+)$/);if(U&&J.locales.includes(U[2]))q=U[1],G=U[2],I=!0}}W.set(K,{path:q,locale:G,explicitLocale:I}),Y.add(q)}let j=[],M=new Map,z=new Map,B=new Map;for(let K of J.locales)for(let q of Y){let G=J.enabled?q0(J,$,K,`/${q}`).map((U)=>C(U)).find((U)=>V.has(U)):C($,`${q}.md`);if(!G||!V.has(G))continue;let I=Object.freeze({sourceFile:G,relativePath:q,locale:K}),N=`${K}\x00${k(x(q))}`;if(z.has(N))throw Error(`Documentation pages share an output route: ${x(q)}`);z.set(N,I),M.set(`${K}\x00${q}`,I),B.set(`${K}\x00${k(`/${j0(q)}`)}`,I),j.push(I)}return Object.freeze({pages:Object.freeze(j),findPage(K,q){let G=`${K}\x00${k(q)}`;return z.get(G)??B.get(G)},resolveLink(K,q){if(!q||/^(?:[a-z][a-z\d+.-]*:|\/|#|\?)/i.test(q))return q;let G=q.search(/[?#]/),I=G===-1?q:q.slice(0,G),N=G===-1?"":q.slice(G),U=I.replace(/%([\da-f]{2})/gi,(n0,z0)=>String.fromCharCode(Number.parseInt(z0,16)));if(!/\.md$/i.test(U))return q;let H=decodeURIComponent(I),A=C(o0(K.sourceFile),H),R=W0($,A);if(R===".."||R.startsWith(`..${Y0}`)||V0(R))return q;let D=W.get(A);if(!D)throw Error(`Markdown link has no documentation source: ${I}`);let m=D.explicitLocale?D.locale:K.locale,f=M.get(`${m}\x00${D.path}`);if(!f)throw Error(`Markdown link has no rendered page: ${I}`);return`${L(J,m,x(f.relativePath))}${N}`}})}async function P1(X,Q,Z=new Map){let $=[Q.page],J=new Set(Z.keys()),V=await new HTMLRewriter().onDocument({comments(W){let Y=Z.get(W.text);if(Y===void 0)return;if(!J.delete(W.text))throw Error("Markdown include source boundary was duplicated");if(Y===null){if($.length===1)throw Error("Markdown include source boundaries are unbalanced");$.pop()}else $.push(Y);W.remove()}}).on("a[href]",{element(W){let Y=$0(W.getAttribute("href")),j=Q.catalog.resolveLink($[$.length-1],Y);if(j!==Y)W.setAttribute("href",J0(j))}}).transform(new Response(X)).text();if(J.size||$.length!==1)throw Error("Markdown include source boundaries did not survive rendering");return V}
1739
+ export{G0 as z,B0 as A,U0 as B,t0 as C,u as D,Q1 as E,Z1 as F,$1 as G,T0 as H,T as I,v as J,b as K,s as L,v0 as M,b0 as N,x0 as O,P,o as Q,k0 as R,m0 as S,f0 as T,V1 as U,W1 as V,Y1 as W,q1 as X,j1 as Y,_1 as Z,F1 as _,R1 as $,$0 as aa,J0 as ba,E1 as ca,w1 as da,P1 as ea};
@@ -0,0 +1,2 @@
1
+ /** A complete replacement, serialized locally and locked against other build processes. */
2
+ export declare function withBuildOutput<T>(directory: string, render: (staging: string) => Promise<T>, afterPublish?: () => Promise<void>): Promise<T>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Text from HTML back to text: `Raster &amp; heatmap` to `Raster & heatmap`.
3
+ * A page title is read from its rendered `<h1>`, and is escaped again where
4
+ * it is written; left encoded, `&` came out as `&amp;amp;` in the tab.
5
+ */
6
+ export declare function decodeHtmlEntities(value: string): string;
7
+ export declare function escapeHtmlAttribute(value: string): string;
package/dist/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{a as W,b as X,c as Y,d as Z,e as _,f as $,g as b,h as v,i as A,j as zj,k as Bj,l as Dj,m as Ej,n as Gj,o as Hj,p as Ij}from"../chunk-7jcye3th.js";import{A as u,B as w,x as j,y as k,z as q}from"../chunk-rcr6k1et.js";import{$ as wj,C as Q,D as S,E as T,F as V,K as p,L as f,M as c,N as d,O as g,P as a,Q as n,R as o,S as r,T as t,U as i,V as s,W as e,X as jj,Y as kj,Z as qj,_ as uj,aa as z,ba as B,ca as D}from"../chunk-3ymfys00.js";import{fa as F,ga as R,ha as U,ia as m,ja as x,ka as C,la as l,ma as h,na as y}from"../chunk-rnzqf7rp.js";export{Ej as wrapInLayout,Dj as stripConfiguredBasePath,Hj as startServer,U as splitLocaleFromPath,X as setLanguageAliases,Ij as serveCLI,F as resolveI18nConfig,W as resetHighlighter,d as reserveUniqueSlug,kj as processInlineTocSyntax,v as prewarmHighlighter,Y as normalizeLanguage,Gj as markdownToHtml,f as markdownHeadingText,m as localizeUrl,l as localeLabel,x as localeContentCandidates,R as loadI18nTranslations,Z as isLanguageSupported,$ as highlightCodeSync,_ as highlightCode,b as getSyntaxHighlightingStyles,A as getHighlighterInstance,Bj as getConfiguredBasePath,V as getConfig,g as generateUniqueSlug,uj as generateTocStyles,wj as generateTocScripts,jj as generateTocPositions,r as generateTocHtml,e as generateTocData,c as generateSlug,w as generateSitemap,i as generateSidebarTocHtml,k as generateRssFeed,q as generateRobotsTxt,y as generateLocaleDetectionScript,t as generateInlineTocHtml,h as generateHreflangTags,s as generateFloatingTocHtml,o as filterHeadings,a as extractHeadings,qj as enhanceHeadingsWithAnchors,p as defaultTocConfig,Q as defaultConfig,zj as decodeHtmlEntities,C as configForLocale,T as config,n as buildTocHierarchy,u as buildSitemap,B as buildSearchRuntimeConfig,D as buildSearchIndex,j as buildRssFeed,S as applyConfigPlugins,z as SEARCH_INDEX_PATH};
2
+ import{a as W,b as X,c as Y,d as Z,e as _,f as $,g as b,h as v,i as A,j as Dj,k as Ej,l as Gj,m as Hj,n as Ij}from"../chunk-a6b6xwxm.js";import{u as j,v as k,w as q,x as u,y as w}from"../chunk-5dtz0br7.js";import{$ as D,A as S,B as T,C as V,H as f,I as c,J as d,K as g,L as a,M as n,N as o,O as r,P as t,Q as i,R as s,S as e,T as jj,U as kj,V as qj,W as uj,X as wj,Y as zj,Z as z,_ as B,aa as Bj,z as Q}from"../chunk-vm81tncs.js";import{ha as F,ia as R,ja as U,ka as m,la as x,ma as C,na as l,oa as h,pa as y,qa as p}from"../chunk-gn1n2yxt.js";export{Ej as wrapInLayout,Dj as stripConfiguredBasePath,Hj as startServer,m as splitLocaleFromPath,X as setLanguageAliases,Ij as serveCLI,R as resolveI18nConfig,W as resetHighlighter,g as reserveUniqueSlug,qj as processInlineTocSyntax,v as prewarmHighlighter,Y as normalizeLanguage,Gj as markdownToHtml,c as markdownHeadingText,x as localizeUrl,h as localeLabel,C as localeContentCandidates,U as loadI18nTranslations,Z as isLanguageSupported,$ as highlightCodeSync,_ as highlightCode,b as getSyntaxHighlightingStyles,A as getHighlighterInstance,F as getConfiguredBasePath,V as getConfig,a as generateUniqueSlug,wj as generateTocStyles,zj as generateTocScripts,kj as generateTocPositions,t as generateTocHtml,jj as generateTocData,d as generateSlug,w as generateSitemap,s as generateSidebarTocHtml,k as generateRssFeed,q as generateRobotsTxt,p as generateLocaleDetectionScript,i as generateInlineTocHtml,y as generateHreflangTags,e as generateFloatingTocHtml,r as filterHeadings,n as extractHeadings,uj as enhanceHeadingsWithAnchors,f as defaultTocConfig,Q as defaultConfig,Bj as decodeHtmlEntities,l as configForLocale,T as config,o as buildTocHierarchy,u as buildSitemap,B as buildSearchRuntimeConfig,D as buildSearchIndex,j as buildRssFeed,S as applyConfigPlugins,z as SEARCH_INDEX_PATH};
@@ -0,0 +1,22 @@
1
+ import type { ResolvedI18n } from './i18n';
2
+ export declare function findMarkdownFiles(dir: string): Promise<string[]>;
3
+ /** One finite source/route snapshot, owned by one build or one dev request. */
4
+ export declare function createMarkdownPageCatalog(markdownFiles: readonly string[], docsDir: string, i18n: ResolvedI18n): MarkdownPageCatalog;
5
+ /** Parse actual anchor attributes; code text, images and external destinations stay intact. */
6
+ export declare function rewriteMarkdownSourceLinks(html: string, context: MarkdownPageContext, origins?: MarkdownLinkOrigins): Promise<string>;
7
+ export declare interface MarkdownPage {
8
+ readonly sourceFile: string
9
+ readonly relativePath: string
10
+ readonly locale: string
11
+ }
12
+ export declare interface MarkdownPageCatalog {
13
+ readonly pages: readonly MarkdownPage[]
14
+ findPage: (locale: string, path: string) => MarkdownPage | undefined
15
+ resolveLink: (page: MarkdownPage, destination: string) => string
16
+ }
17
+ export declare interface MarkdownPageContext {
18
+ readonly page: MarkdownPage
19
+ readonly catalog: MarkdownPageCatalog
20
+ }
21
+ /** Per-render boundaries for authored content expanded from another file. */
22
+ export type MarkdownLinkOrigins = Map<string, MarkdownPage | null>;
@@ -1,20 +1,16 @@
1
1
  import { config } from './config';
2
+ import { decodeHtmlEntities } from './html-entities';
3
+ import { getConfiguredBasePath } from './site-url';
2
4
  import type { BunPressConfig, Frontmatter } from './types';
5
+ import type { MarkdownPageContext } from './markdown-pages';
3
6
  import type { ResolvedI18n } from './i18n';
4
- /**
5
- * Text from HTML back to text: `Raster &amp; heatmap` to `Raster & heatmap`.
6
- * A page title is read from its rendered `<h1>`, and is escaped again where
7
- * it is written; left encoded, `&` came out as `&amp;amp;` in the tab.
8
- */
9
- export declare function decodeHtmlEntities(value: string): string;
10
- export declare function getConfiguredBasePath(config: BunPressConfig): string;
11
7
  export declare function stripConfiguredBasePath(config: BunPressConfig, pathname: string): string;
12
8
  export declare function wrapInLayout(content: string, siteConfig: BunPressConfig, currentPath: string, layout?: string, frontmatter?: Frontmatter, options?: WrapLayoutOptions): Promise<string>;
13
9
  /**
14
10
  * Convert markdown to HTML using Bun's built-in markdown parser
15
11
  * See: https://bun.com/docs/runtime/markdown
16
12
  */
17
- export declare function markdownToHtml(markdown: string, rootDir?: string): Promise<{ html: string, frontmatter: any }>;
13
+ export declare function markdownToHtml(markdown: string, rootDir?: string, pageContext?: MarkdownPageContext): Promise<{ html: string, frontmatter: any }>;
18
14
  /**
19
15
  * Start the BunPress documentation server
20
16
  */
@@ -52,3 +48,5 @@ export declare interface WrapLayoutOptions {
52
48
  sourceFile?: string
53
49
  docsDir?: string
54
50
  }
51
+ export { getConfiguredBasePath } from './site-url';
52
+ export { decodeHtmlEntities } from './html-entities';
@@ -14,3 +14,5 @@ import type { BunPressConfig } from './types';
14
14
  * moves; `url` is the place to say it once.
15
15
  */
16
16
  export declare function siteUrl(config: BunPressConfig): string;
17
+ /** Shared deployment prefix for rendered pages and generated navigation data. */
18
+ export declare function getConfiguredBasePath(config: BunPressConfig): string;
@@ -0,0 +1,6 @@
1
+ <button class="sidebar-section-toggle" onclick="toggleSection(this.parentElement)" type="button">
2
+ <span>{{ title }}</span>
3
+ <svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
4
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
5
+ </svg>
6
+ </button>
@@ -1,10 +1,5 @@
1
1
  <div class="BPSidebarItem sidebar-section{{ collapsedClass }}">
2
- <button class="sidebar-section-toggle" onclick="toggleSection(this.parentElement)" type="button">
3
- <span>{{ title }}</span>
4
- <svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
5
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
6
- </svg>
7
- </button>
2
+ {!! heading !!}
8
3
  <div class="sidebar-items-wrapper">
9
4
  <ul class="sidebar-items">
10
5
  {!! items !!}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/bunpress",
3
3
  "type": "module",
4
- "version": "0.2.21",
4
+ "version": "0.2.23",
5
5
  "description": "Modern documentation engine. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -1,38 +0,0 @@
1
- // @bun
2
- var j=import.meta.require;function X(q){return(q.sitemap?.baseUrl||q.url||"").replace(/\/$/,"")}var Y={"search.placeholder":"Search documentation","toc.title":"On this page","nav.menu":"Menu","search.noResults":"No results for","theme.toggle":"Toggle dark mode"};function O(q){let B=q?.i18n,H=(B?.locales??[]).filter(Boolean),J=B?.defaultLocale||H[0]||q?.lang||"en",K=(B?.enabled??H.length>1)&&H.length>0;return{enabled:K,locales:K?H:[J],defaultLocale:J,fallbackLocale:B?.fallbackLocale??J,localePath:B?.localePath??"./locales",detectLocale:B?.detectLocale===!0,localeNames:B?.localeNames??{},localeConfig:B?.localeConfig??{},translate:(M)=>Y[M]??M}}async function A(q,B){if(!q.enabled)return q;try{let{createTranslator:H,loadTranslations:J}=await import("@stacksjs/ts-i18n"),K=await J({translationsDir:q.localePath,defaultLocale:q.defaultLocale,fallbackLocale:q.fallbackLocale,sources:B?.i18n?.sources??["ts","yaml","json"],optional:!0,verbose:!1}),M=H(K,{defaultLocale:q.defaultLocale,fallbackLocale:q.fallbackLocale}),V=new Set;for(let N of Object.values(K))for(let P of Object.keys(N??{}))V.add(P);let Z=[...V].sort((N,P)=>N==="theme"?-1:P==="theme"?1:N.localeCompare(P));return{...q,translate:(N,P,$)=>{for(let W of[N,...Z.map((Q)=>`${Q}.${N}`)])try{let Q=M(W,P,$);if(typeof Q==="string"&&Q&&Q!==W)return Q}catch{}return Y[N]??N}}}catch(H){return console.warn("[bunpress] i18n translations could not be loaded; falling back to defaults \u2014",H instanceof Error?H.message:H),q}}function E(q,B){if(!q.enabled)return{locale:q.defaultLocale,path:B};let H=B.match(/^\/([^/]+)(\/.*)?$/);if(H&&q.locales.includes(H[1])&&H[1]!==q.defaultLocale)return{locale:H[1],path:H[2]||"/"};return{locale:q.defaultLocale,path:B}}function x(q,B,H){if(!q.enabled||B===q.defaultLocale)return H||"/";return`/${B}${H==="/"?"":H}`||`/${B}`}function I(q,B,H,J){let K=J==="/"?"/index":J,M=[];if(q.enabled&&H!==q.defaultLocale)M.push(`${B}/${H}${K}.md`),M.push(`${B}/${H}${K}/index.md`),M.push(`${B}${K}.${H}.md`);if(M.push(`${B}${K}.md`),M.push(`${B}${K}/index.md`),q.enabled)M.push(`${B}${K}.${q.defaultLocale}.md`);return M}function _(q,B,H){let J=B.localeConfig[H];if(!J)return q;return{...q,...J,themeConfig:J.themeConfig?{...q.themeConfig,...J.themeConfig}:q.themeConfig,markdown:J.markdown?{...q.markdown,...J.markdown}:q.markdown}}function D(q,B){return q.localeNames[B]??B}function F(q,B,H){if(!q.enabled)return"";let J=X(B);if(!J)return"";let K=q.locales.map((M)=>{let V=`${J}${x(q,M,H==="/index"?"/":H)}`;return`<link rel="alternate" hreflang="${M}" href="${V}">`});return K.push(`<link rel="alternate" hreflang="x-default" href="${J}${H==="/index"?"/":H}">`),K.join(`
3
- `)}function R(q){if(!q.enabled||!q.detectLocale)return"";return`
4
- (function () {
5
- var LOCALES = ${JSON.stringify(q.locales)};
6
- var DEFAULT = ${JSON.stringify(q.defaultLocale)};
7
- var KEY = 'bunpress-locale';
8
-
9
- try {
10
- var current = location.pathname.split('/')[1];
11
- if (LOCALES.indexOf(current) !== -1) {
12
- // Reading a non-default locale is itself a choice; remember it.
13
- localStorage.setItem(KEY, current);
14
- return;
15
- }
16
- if (localStorage.getItem(KEY)) return;
17
-
18
- var preferred = (navigator.languages || [navigator.language || ''])
19
- .map(function (tag) { return String(tag).toLowerCase(); });
20
-
21
- for (var i = 0; i < preferred.length; i++) {
22
- var tag = preferred[i];
23
- var exact = LOCALES.indexOf(tag) !== -1 ? tag : null;
24
- // 'en-GB' should match an 'en' locale.
25
- var base = exact || (LOCALES.indexOf(tag.split('-')[0]) !== -1 ? tag.split('-')[0] : null);
26
- if (base && base !== DEFAULT) {
27
- localStorage.setItem(KEY, base);
28
- location.replace(\`/\${base}\${location.pathname}\${location.search}\${location.hash}\`);
29
- return;
30
- }
31
- if (base === DEFAULT) return;
32
- }
33
- } catch (_) {
34
- // Storage or history unavailable: leave the reader where they are.
35
- }
36
- })();
37
- `.trim()}
38
- export{j as da,X as ea,O as fa,A as ga,E as ha,x as ia,I as ja,_ as ka,D as la,F as ma,R as na};