boltdocs 2.7.7 → 2.7.8
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/client/index.cjs +1 -1
- package/dist/client/index.js +1 -1
- package/dist/node/cli-entry.cjs +1 -1
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/{node-CsY-eLEP.mjs → node-BXd1xgio.mjs} +1 -1
- package/dist/{node-PfSXEt5t.cjs → node-DWhzY9qh.cjs} +1 -1
- package/dist/{package-BBsNSOR-.cjs → package-60UENucA.cjs} +1 -1
- package/dist/{package-D-7aOtPv.mjs → package-DGLEx5yT.mjs} +1 -1
- package/package.json +2 -2
- package/src/client/ssg/create-routes.tsx +13 -1
package/dist/client/index.cjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icons-dev-BlV3wWFT.cjs`),t=require(`../docs-layout-x2yKt2cL.cjs`),n=require(`../image-BHhTvQzr.cjs`),r=require(`../search-dialog-BvBopRsZ.cjs`),i=require(`../search-dialog-DuYTIefy.cjs`),a=require(`../mdx-r4cDQxWu.cjs`);let o=require(`react-router-dom`),s=require(`react`),c=require(`react/jsx-runtime`),l=require(`react-aria-components`),u=require(`virtual:boltdocs-icons`);u=e.rt(u);let d=require(`react-helmet-async`);d=e.rt(d);let f=require(`virtual:boltdocs-mdx-components`);f=e.rt(f);let p=require(`virtual:boltdocs-layout`);p=e.rt(p);let m=require(`@bdocs/ssg`);const h=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),g=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),_=globalThis[h]||(globalThis[h]=(0,s.createContext)({}));function v(){let e=(0,s.use)(_);return(!e||Object.keys(e).length===0)&&globalThis[g]?globalThis[g]:e}function y({components:e,children:t}){let n=(0,s.useMemo)(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[g]=n),(0,c.jsx)(_.Provider,{value:n,children:t})}function b(){let{currentRoute:t}=e.X(),n=[];return t&&(t.groupTitle&&n.push({label:t.groupTitle}),n.push({label:t.title,href:t.path})),{crumbs:n,activeRoute:t}}function x(){let{crumbs:n,activeRoute:r}=b();return n.length===0?null:(0,c.jsxs)(t.N.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[(0,c.jsx)(t.N.Item,{children:(0,c.jsx)(t.N.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:(0,c.jsx)(e.F,{size:14})})}),n.map((n,i)=>{let a=n.href===r?.path;return(0,c.jsxs)(t.N.Item,{className:`gap-2`,children:[(0,c.jsx)(t.N.Separator,{className:`text-muted/40`}),(0,c.jsx)(t.N.Link,{href:n.href,className:e.y(`transition-colors`,a?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:n.label})]},`crumb-${n.href}-${n.label}-${i}`)})]})}const S=e=>{let[t,n]=(0,s.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function C({content:n,mdxRaw:r}){let i=r||n||``,{copied:a,handleCopy:o,handleOpenRaw:s}=S(i);return i?(0,c.jsx)(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:(0,c.jsxs)(t.j,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[(0,c.jsx)(t.M,{onPress:o,className:e.y(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,a&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":a?`Copied!`:`Copy Markdown`,children:a?(0,c.jsx)(e.w,{size:14}):(0,c.jsx)(e.k,{size:14})}),(0,c.jsxs)(t.M,{onPress:o,className:e.y(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,a&&`text-emerald-500 hover:bg-emerald-500/5`),children:[a?(0,c.jsx)(e.w,{size:16}):(0,c.jsx)(e.k,{size:16}),a?`Copied!`:`Copy Markdown`]}),(0,c.jsxs)(t.k.Trigger,{placement:`bottom end`,children:[(0,c.jsx)(t.M,{className:e.y(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:(0,c.jsx)(e.T,{size:14})}),(0,c.jsxs)(t.k.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{onAction:o,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.k,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),(0,c.jsxs)(t.k.Item,{onAction:s,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.j,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function w({children:e,fallback:n}){return(0,c.jsx)(t.D,{fallback:n,children:e})}async function T(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:ee(i.stargazers_count)}const ee=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function te({repo:t}){let[n,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{t&&T(t).then(e=>r(e)).catch(()=>r(`0`))},[t]),(0,c.jsxs)(`a`,{href:`https://github.com/${t}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[(0,c.jsx)(e.s,{className:`h-4 w-4 text-body`}),n!==null&&(0,c.jsxs)(`span`,{className:`tabular-nums font-medium`,children:[n,` stars`]})]})}function E(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function D(){let t=e.nt(),{theme:r,resolvedTheme:i}=n.l(),a=(0,o.useLocation)(),{currentLocale:c}=e.X(),l=t.theme||{},u=E(l.title,c)||`Boltdocs`,d=l.navbar||[],f=l.socialLinks||[],p=l.githubRepo,m=(0,s.useMemo)(()=>d.map(e=>{let n=e.href||e.to||e.link||``,r=e=>{let n=a.pathname;if(n===e)return!0;if(!e||e===`/`)return n===`/`;let r=e=>{let n=e.split(`/`).filter(Boolean),r=0;return t.i18n?.locales&&n[r]&&t.i18n.locales[n[r]]&&r++,t.versions?.versions&&n[r]&&t.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},i=r(e),o=r(n);return i.length===0?o.length===0:o.length<i.length?!1:i.every((e,t)=>o[t]===e)},i=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:E(e.label||e.text,c),href:t,active:r(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(e.items);return{label:E(e.label||e.text,c),href:n,active:r(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:i}}),[d,a.pathname,c,t]),h=l.logo;return{links:m,title:u,logo:h?typeof h==`string`?h:i===`dark`?h.dark:h.light:null,logoProps:{alt:(h&&typeof h==`object`?h.alt:void 0)||u,width:h&&typeof h==`object`?h.width:void 0,height:h&&typeof h==`object`?h.height:void 0},github:p?`https://github.com/${p}`:null,social:f,config:t,theme:r}}function O(){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:`h-9 w-9`});let u=r===`system`?e.V:r===`dark`?e.H:e.K;return(0,c.jsxs)(t.k.Trigger,{placement:`bottom right`,children:[(0,c.jsx)(l.Button,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:(0,c.jsx)(u,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),(0,c.jsxs)(t.k.Root,{selectionMode:`single`,selectedKeys:[r],onSelectionChange:e=>{let t=Array.from(e)[0];i(t)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.K,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Light`})]}),(0,c.jsxs)(t.k.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.H,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Dark`})]}),(0,c.jsxs)(t.k.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.V,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`System`})]})]})]})}function ne({className:t}){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:e.y(`h-10 w-full bg-surface rounded-xl animate-pulse`,t)});let l=r===`dark`;return(0,c.jsxs)(`div`,{className:e.y(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,t),children:[(0,c.jsx)(`div`,{className:e.y(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,l?`translate-x-full`:`translate-x-0`)}),(0,c.jsx)(`button`,{onClick:()=>i(`light`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:(0,c.jsx)(e.K,{size:18})}),(0,c.jsx)(`button`,{onClick:()=>i(`dark`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:(0,c.jsx)(e.H,{size:18})})]})}function k(t=[],n=[]){let r=(0,o.useLocation)(),i=(0,s.useRef)([]),[a,c]=(0,s.useState)({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),l=e.Z(r.pathname),u=n.find(t=>e.Z(t.path)===l)?.tab?.toLowerCase(),d=t.findIndex(e=>e.id.toLowerCase()===u),f=d===-1?0:d;return(0,s.useEffect)(()=>{let e=i.current[f];e&&c({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[f,t.length,r.pathname]),{tabs:t,activeIndex:f,indicatorStyle:a,tabRefs:i,activeTabId:u}}function re({tabs:n,routes:r}){let{currentLocale:i}=e.X(),{indicatorStyle:a,tabRefs:o,activeIndex:l}=k(n,r);(0,s.useEffect)(()=>{let e=o.current[l];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[l]);let d=t=>{if(!t)return null;if(t.trim().startsWith(`<svg`))return(0,c.jsx)(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:t}});let n={...e.Y,...u.default},r=n[t]||n[t+`Icon`];return r?(0,c.jsx)(r,{size:16}):(0,c.jsx)(`img`,{src:t,alt:``,className:`h-4 w-4 object-contain`})};return(0,c.jsx)(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:(0,c.jsxs)(t.E.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[n.map((t,n)=>{let a=n===l,s=r.find(e=>e.tab&&e.tab.toLowerCase()===t.id.toLowerCase());return(0,c.jsxs)(e._,{href:s?s.path:`#`,ref:e=>{o.current[n]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${a?`text-primary-500`:`text-muted hover:text-body`}`,children:[d(t.icon),(0,c.jsx)(`span`,{children:E(t.text,i)})]},t.id)}),(0,c.jsx)(t.E.Indicator,{style:a,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function A(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function j(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:c}=e.X(),l=n.versions,{setVersion:u}=e.$();return{currentVersion:a,currentVersionLabel:l?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:(0,s.useMemo)(()=>l?l.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[l,a]),handleVersionChange:e=>{if(!l||e===a)return;u(e);let o=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${c?`/${c}`:``}`;if(i){let t=A(i.filePath,i.version,i.locale),a=r.find(r=>A(r.filePath,r.version,r.locale)===t&&(r.version||l.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===c));if(a)o=a.path;else{let t=r.find(t=>A(t.filePath,t.version,t.locale)===`index.md`&&(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}}else{let t=r.find(t=>(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}t(o)}}}function M(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:c}=e.X(),l=n.i18n,{setLocale:u}=e.$(),d=e=>{if(!l||e===a)return;u(e);let o=n.base||`/`,s=o===`/`?``:o.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=A(i.filePath,i.version,i.locale),n=r.find(n=>A(n.filePath,n.version,n.locale)===t&&(n.locale||l.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>A(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||l.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${s}${i.version?`/${i.version}`:``}${e===l.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(l.locales)?l.locales.includes(n[0]):l.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===l.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||l.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(c||n.versions?.defaultVersion));if(t)f=t.path;else{let t=c&&c!==n.versions?.defaultVersion?`/${c}`:``;f=e===l.defaultLocale?`${s}${t}`:`${s}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},f=l?.locales,p=f?Array.isArray(f)?a:f[a]:void 0;return{currentLocale:a,currentLocaleLabel:l?.localeConfigs?.[a]?.label||p||a,availableLocales:(0,s.useMemo)(()=>l?Array.isArray(l.locales)?l.locales.map(e=>({key:e,label:l?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(l.locales).map(([e,t])=>({key:e,label:l?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[l,a]),handleLocaleChange:d}}function N({className:n}){let{currentVersionLabel:r,availableVersions:i,handleVersionChange:a}=j();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsx)(`span`,{className:`font-semibold text-[0.8125rem]`,children:r}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function P({className:n}){let{currentLocale:r,availableLocales:i,handleLocaleChange:a}=M();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(e.L,{className:`w-3.5 h-3.5 text-primary-500`}),(0,c.jsx)(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:r||`en`})]}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:(0,c.jsx)(`span`,{children:e.label})},`${e.value??``}`)})})]})}const F=(0,s.lazy)(()=>Promise.resolve().then(()=>require(`../search-dialog-Cyko6TJm.cjs`)).then(e=>({default:e.SearchDialog})));function I(){let{links:n,title:i,logo:a,logoProps:l,github:u,social:d,config:f}=D(),{routes:p,allRoutes:m,currentRoute:h,currentVersion:g,currentLocale:_}=e.X(),{pathname:v}=(0,o.useLocation)(),{isSidebarOpen:y,toggleSidebar:b}=t.T(),[x,S]=(0,s.useState)(!1),C=f.theme||{},w=!!h?.filePath,T=C?.tabs&&C.tabs.length>0;return(0,c.jsxs)(r.n.Root,{className:e.y(`border-b border-subtle bg-main/80 backdrop-blur-md`,T&&`border-b-0`),children:[(0,c.jsxs)(r.n.Content,{children:[(0,c.jsxs)(r.n.Left,{children:[w&&(0,c.jsx)(t.M,{onPress:b,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":y?`Close sidebar`:`Open sidebar`,children:y?(0,c.jsx)(e.J,{className:`w-5 h-5 text-body`}):(0,c.jsx)(e.B,{className:`w-5 h-5 text-body`})}),a&&(0,c.jsx)(r.n.Logo,{src:a,alt:l?.alt||i,width:l?.width??24,height:l?.height??24,href:`site:/`}),(0,c.jsx)(r.n.Title,{href:`site:/`,children:i}),(0,c.jsx)(`div`,{className:`hidden sm:block`,children:f.versions&&g&&(0,c.jsx)(N,{})})]}),(0,c.jsx)(r.n.Center,{children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:(0,c.jsx)(F,{routes:p||[]})})}),(0,c.jsxs)(r.n.Right,{children:[(0,c.jsx)(s.Suspense,{fallback:null,children:(0,c.jsx)(`div`,{className:`lg:hidden`,children:(0,c.jsx)(F,{routes:p||[]})})}),(0,c.jsx)(r.n.Links,{children:n.map(e=>(0,c.jsx)(ie,{link:e},e.href))}),(0,c.jsxs)(`div`,{className:`hidden sm:flex items-center gap-2`,children:[f.i18n&&_&&(0,c.jsx)(P,{}),(0,c.jsx)(r.n.Split,{className:`bg-subtle`})]}),(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(O,{})}),u&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(te,{repo:C?.githubRepo??``})}),d.length>0&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(r.n.Split,{className:`bg-subtle`})}),(0,c.jsx)(`div`,{className:`hidden md:flex items-center gap-1`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),(0,c.jsx)(r.n.More,{onPress:()=>S(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),(0,c.jsxs)(r.n.MobileMenu,{isOpen:x,onClose:()=>S(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[(0,c.jsx)(`div`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,c.jsx)(L,{link:e,onClose:()=>S(!1)},e.href))}),d.length>0&&(0,c.jsxs)(`div`,{className:`mt-6`,children:[(0,c.jsx)(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),(0,c.jsx)(`div`,{className:`flex flex-wrap gap-2 px-2`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),w&&T&&C?.tabs&&(0,c.jsx)(`div`,{className:`w-full border-b border-subtle bg-main`,children:(0,c.jsx)(re,{tabs:C.tabs,routes:m||p||[]})})]})}function ie({link:t}){let n=e.b(t.href||``),{pathname:i}=(0,o.useLocation)(),a=i===n||i.startsWith(n+`/`);return t.items&&t.items.length>0?(0,c.jsx)(r.n.Dropdown,{label:(0,c.jsx)(`span`,{className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,a?`text-primary-500`:`text-muted hover:text-body`),children:t.label}),children:t.items?.map(t=>(0,c.jsx)(r.n.DropdownItem,{href:e.b(t.href||``),label:t.label},t.href))}):(0,c.jsx)(r.n.Link,{...t,href:n,active:a,className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,a?`text-primary-500`:`text-muted hover:text-body`)})}function L({link:t,onClose:n}){let i=e.b(t.href||``),{pathname:a}=(0,o.useLocation)(),s=a===i;return t.items&&t.items.length>0?(0,c.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,c.jsx)(`div`,{className:e.y(`px-3 py-2 text-sm transition-all`,s?`text-body`:`text-muted/80 hover:text-body`),children:t.label}),(0,c.jsx)(`div`,{className:`flex flex-col gap-1 pl-4`,children:t.items?.map(e=>(0,c.jsx)(L,{link:e,onClose:n},e.href))})]}):(0,c.jsx)(r.n.MobileLink,{...t,href:i,active:s,onPress:n,className:e.y(`transition-all`,s?`text-body`:`text-muted/80 hover:text-body`)})}function R(){return(0,c.jsx)(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:(0,c.jsxs)(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[(0,c.jsx)(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),(0,c.jsx)(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),(0,c.jsxs)(e._,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[(0,c.jsx)(e.C,{size:14}),` Go to Home`]})]})})}function z({headings:n=[],editLink:r,communityHelp:i,filePath:a}){return n.length===0?null:(0,c.jsxs)(t._.Root,{children:[(0,c.jsxs)(t._.Header,{className:`flex flex-row gap-x-2`,children:[(0,c.jsx)(e.q,{size:16}),`On this page`]}),(0,c.jsx)(t._.Tree,{headings:n}),(r||i)&&(0,c.jsxs)(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[(0,c.jsx)(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),(0,c.jsxs)(`ul`,{className:`space-y-3`,children:[r&&a&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:r.replace(`:path`,a),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.W,{size:16}),`Edit this page`]})}),i&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.O,{size:16}),`Community help`]})})]})]})]})}function B(){let{routes:t,currentRoute:n}=e.X(),r=(0,o.useLocation)();return(0,s.useMemo)(()=>{if(!n)return{prevPage:null,nextPage:null,currentRoute:null};let e=n.tab?.toLowerCase(),i=e?t.filter(t=>t.tab?.toLowerCase()===e):t.filter(e=>!e.tab),a=i.findIndex(e=>e.path===r.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:n}},[t,n,r.pathname])}function V(){let{prevPage:e,nextPage:n}=B();return!e&&!n?null:(0,c.jsxs)(t.h.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?(0,c.jsxs)(t.h.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):(0,c.jsx)(`div`,{}),n?(0,c.jsxs)(t.h.Link,{to:n.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:n.title})]}):(0,c.jsx)(`div`,{})]})}function H({routes:n,config:r}){let{logo:i,title:a,logoProps:o}=D(),{closeSidebar:s}=t.T(),l=i?(0,c.jsx)(`img`,{src:i,alt:o?.alt||a,width:24,height:24,className:`rounded-xl`}):null,u=r.versions||r.i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t.i.Root,{children:(0,c.jsx)(t.i.Content,{children:(0,c.jsx)(t.i.Items,{routes:n})})}),(0,c.jsxs)(t.i.Mobile,{children:[(0,c.jsxs)(t.i.Header,{children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[l,(0,c.jsx)(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:a})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(ne,{className:`w-24 h-9 rounded-xl`}),(0,c.jsx)(t.M,{onPress:s,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:(0,c.jsx)(e.J,{size:20})})]})]}),(0,c.jsxs)(t.i.Content,{children:[u&&(0,c.jsxs)(`div`,{className:`flex flex-col gap-4 mb-10`,children:[(0,c.jsxs)(`div`,{className:`flex gap-3`,children:[r.versions&&(0,c.jsx)(N,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),r.i18n&&(0,c.jsx)(P,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),(0,c.jsx)(`div`,{className:`mt-2 border-b border-subtle`})]}),(0,c.jsx)(t.i.Items,{routes:n})]})]})]})}const U=Object.assign(H,{Root:t.i.Root,Mobile:t.i.Mobile,Header:t.i.Header,Content:t.i.Content,Group:t.i.Group,Link:t.i.Link,SubGroup:t.i.SubGroup,Item:t.i.Item,Items:t.i.Items});function W({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return(0,c.jsxs)(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[(0,c.jsx)(`span`,{}),(0,c.jsxs)(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function G({route:e,content:t,mdxComponents:n}){let r=v(),i=(0,s.useMemo)(()=>({LastUpdated:W,...r,...n}),[r,n]),a=i.LastUpdated||W;return t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t,{components:i}),e?.lastUpdated&&(0,c.jsx)(a,{date:e.lastUpdated})]}):null}function K({MDXComponent:e,mdxComponents:t}){let n=(0,o.useLoaderData)(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?(0,c.jsx)(G,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const q=d,J=q.Helmet||q.default?.Helmet||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),Y=q.HelmetProvider||q.default?.HelmetProvider||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e}));function ae(){let{pathname:e,hash:t}=(0,o.useLocation)(),n=(e=`auto`)=>{let n=document.querySelector(`.boltdocs-content`)||window,r=()=>n===window?window.scrollY:n.scrollTop,i=(e,t)=>{n===window?window.scrollTo({top:e,behavior:t}):n.scrollTo({top:e,behavior:t})};if(t){let a=t.replace(`#`,``),o=document.getElementById(a);if(o){let t=n===window?0:n.getBoundingClientRect().top;return i(o.getBoundingClientRect().top-t-80+r(),e),!0}}return i(0,e),!1};return(0,s.useLayoutEffect)(()=>{n(`auto`)},[e,t]),(0,s.useEffect)(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const oe={...a.t,NotFound:R,404:R};function X(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function se({config:t}){let{currentLocale:n}=e.$();return(0,s.useEffect)(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function ce({config:t,routeMap:n}){let r=(0,o.useLocation)(),{setLocale:i,setVersion:a}=e.$();return(0,s.useEffect)(()=>{let e=X(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function Z({config:r,routes:i,components:a={}}){let l=(0,s.useMemo)(()=>({...oe,...f.default,...a}),[a]),{pathname:u}=(0,o.useLocation)(),d=(0,s.useMemo)(()=>X(u||`/`),[u]),p=(0,s.useMemo)(()=>{let e=new Map;for(let t of i){let n=X(t.path===``?`/`:t.path);e.set(n,t)}return e},[i]),m=(0,s.useMemo)(()=>{let e=p.get(d),t,n;return e&&(r.i18n&&(t=e.locale||r.i18n.defaultLocale),r.versions&&(n=e.version||r.versions.defaultVersion)),{initLocale:t,initVersion:n}},[d,r,p]);return(0,c.jsx)(Y,{children:(0,c.jsx)(e.et,{routes:i,children:(0,c.jsx)(n.c,{children:(0,c.jsx)(t.w,{children:(0,c.jsx)(y,{components:l,children:(0,c.jsxs)(e.tt.Provider,{value:r,children:[(0,c.jsx)(ae,{}),(0,c.jsxs)(e.Q,{initialLocale:m.initLocale,initialVersion:m.initVersion,children:[(0,c.jsx)(ce,{config:r,routeMap:p}),(0,c.jsx)(se,{config:r}),(0,c.jsx)(o.Outlet,{})]})]})})})})})})}function le({siteTitle:t,siteDescription:n,routes:r}){let i=(0,o.useLocation)(),a=e.nt(),{currentLocale:l}=e.X(),u=(0,s.useMemo)(()=>r?.find?.(e=>e.path===i.pathname),[r,i.pathname]),d=u?.title,f=E(n,l),p=u?.description||f||``,m=E(t,l),h=d?`${d} | ${m}`:m,g=u?.seo||{},_=a?.seo?.metatags||{},v=a?.seo?.thumbnails?.background,y=g[`og:image`]||v;return(0,c.jsxs)(J,{children:[(0,c.jsx)(`title`,{children:h}),(0,c.jsx)(`meta`,{name:`description`,content:p}),(0,c.jsx)(`meta`,{property:`og:title`,content:h}),(0,c.jsx)(`meta`,{property:`og:description`,content:p}),(0,c.jsx)(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&(0,c.jsx)(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&(0,c.jsx)(`link`,{rel:`canonical`,href:window.location.origin+i.pathname}),(0,c.jsx)(`meta`,{name:`twitter:card`,content:`summary`}),(0,c.jsx)(`meta`,{name:`twitter:title`,content:h}),(0,c.jsx)(`meta`,{name:`twitter:description`,content:p}),y&&(0,c.jsx)(`meta`,{name:`twitter:image`,content:y}),y&&(0,c.jsx)(`meta`,{property:`og:image`,content:y}),(0,c.jsx)(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(_).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e)),Object.entries(g).map(([e,t])=>e===`noindex`&&t===!0?(0,c.jsx)(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?(0,c.jsx)(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?(0,c.jsx)(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e))]})}function ue(){let t=e.nt(),{currentRoute:n,allRoutes:r}=e.X();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(le,{siteTitle:t.theme?.title,siteDescription:t.theme?.description,routes:r||[]}),(0,c.jsx)(p.default,{route:n,children:(0,c.jsx)(o.Outlet,{})})]})}const de=()=>(0,c.jsx)(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),fe=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return(0,s.useEffect)(()=>{if(!{}.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return{}.hot.on(`boltdocs:mdx-update`,e),()=>({}).hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?(0,c.jsx)(K,{MDXComponent:i,mdxComponents:r}):(0,c.jsx)(de,{})},pe=()=>{let e=v();return(0,c.jsx)(e.NotFound||e[404]||R,{})};function me(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),l=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},u=[],d=n.versions?.defaultVersion,f=(n.base||`/docs`).replace(/\/$/,``),p=(n.base||`/docs`).replace(/\/$/,``);p||=`/`,d&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(f)?t.substring(f.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===d||n.startsWith(`${d}/`))){let t=`${f}/${d}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;u.push({...e,path:t,version:d})}});let m=[...t,...u],h=new Map,g=Object.keys(r);if(g.length>0){let e=g[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of g){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?h.set(i,e):h.set(r,e)}}let _=m.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=h.get(t),i=n?r[n]:null,a=l(e.path===``?`/`:e.path),s=a===p?`.`:a.startsWith(p+`/`)?a.slice(p.length+1):a;return{path:s,element:(0,c.jsx)(fe,{moduleKey:n,moduleLoader:i,route:e,components:o},n||s),loader:async()=>({path:s,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[s]}}),v=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],y=n.versions?.versions?.map(e=>e.path)||[],b=[];b.push({path:p,filter:()=>!0});let x=[];y.length>0&&y.forEach(e=>x.push(`/${e}`)),v.length>0&&v.forEach(e=>x.push(`/${e}`)),y.length>0&&v.length>0&&y.forEach(e=>{v.forEach(t=>{x.push(`/${e}/${t}`)})}),x.forEach(e=>{let t=p===`/`?e:`${p}${e}`;b.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let S=new Set(_.map(e=>(e.path||``).replace(/\/$/,``))),C=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;C.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{C.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),b.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(S.has(r)||C.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,o=a&&S.has(a.replace(/\/$/,``))?_.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):_.find(e=>t(e.path)&&e.path!==r);if(!o&&_.length>0&&(o=_[0]),o){let t=e===p?`.`:e.startsWith(p+`/`)?e.slice(p.length+1):e;_.push({path:t,element:o.element,loader:o.loader,getStaticPaths:()=>[]});let r=m.find(e=>{let t=l(e.path===``?`/`:e.path);return(t===p?`.`:t.startsWith(p+`/`)?t.slice(p.length+1):t)===o.path});if(r){let t=l(r.path),i=n.siteUrl?`${n.siteUrl.replace(/\/$/,``)}${t}`:t;m.push({...r,path:e,seo:{...r.seo,canonical:i}})}}}});let w=[{path:p,element:(0,c.jsx)(ue,{}),children:_}],T=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;w.find(e=>e.path===r)||(T.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),w.push({path:r,element:(0,c.jsx)(s,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;w.find(e=>e.path===r)||(T.push({path:r,locale:n,title:e,filePath:``,headings:[]}),w.push({path:r,element:(0,c.jsx)(s,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),w.push({path:`*`,element:(0,c.jsx)(s,{children:(0,c.jsx)(pe,{})})}),[{element:(0,c.jsx)(Z,{config:n,routes:[...m,...T],components:o}),children:w}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?he(e):window.dataLayer?ge(e):$()}function he(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function ge(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const _e=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function ve(e={}){let{config:n,autoTrackPageViews:r=!0,autoTrackDownloads:i=!0,autoTrackExternalLinks:a=!0,excludePatterns:o=[]}=e,c=typeof globalThis<`u`?globalThis[_e]:void 0,l=n??c?.integrations,u=(0,s.useMemo)(()=>Q(l),[l]),d=(0,s.useRef)(``),f=t.r();return(0,s.useEffect)(()=>{if(!r||!u.isEnabled)return;let e=f.pathname+f.search;e!==d.current&&(d.current=e,u.trackPageView(e,document.title))},[f.pathname,r,u]),(0,s.useEffect)(()=>{if(!i||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!o.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;u.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,a,u,o]),(0,s.useEffect)(()=>{if(!a||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(o.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&u.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[a,u,o]),u}function ye(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)((t,n)=>{e.trackPageView(t,n)},[e])}function be(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)(t=>{e.trackEvent(t)},[e])}function xe({children:n}){let{routes:r,currentRoute:i}=e.X(),a=e.nt();return(0,c.jsxs)(t.t,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[(0,c.jsx)(I,{}),(0,c.jsxs)(t.t.Body,{className:`bg-main`,children:[(0,c.jsx)(U,{routes:r||[],config:a}),(0,c.jsx)(t.t.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:(0,c.jsxs)(t.t.ContentMdx,{className:`max-w-3xl sm:max-w-4xl lg:max-w-4xl px-2 pt-8 pb-24`,children:[(0,c.jsxs)(t.t.Header,{children:[(0,c.jsxs)(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,c.jsx)(x,{}),(0,c.jsx)(C,{mdxRaw:i?._rawContent,route:i})]}),i?.title&&(0,c.jsx)(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:i.title}),i?.description&&(0,c.jsx)(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:i.description})]}),(0,c.jsx)(w,{children:(0,c.jsx)(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:n})}),(0,c.jsx)(t.t.Footer,{children:(0,c.jsx)(V,{})})]})}),(0,c.jsx)(z,{headings:i?.headings,editLink:a.theme?.editLink,communityHelp:a.theme?.communityHelp,filePath:i?.filePath})]})]})}const Se=Object.assign(xe,{Body:t.t.Body,Content:t.t.Content,ContentMdx:t.t.ContentMdx,Header:t.t.Header,Footer:t.t.Footer});exports.BoltdocsShell=Z,exports.Breadcrumbs=x,exports.Card=a.r,exports.Cards=a.n,exports.CopyMarkdown=C,exports.DocsLayout=Se,exports.ErrorBoundary=w,exports.MdxPage=K,exports.Navbar=I,exports.NotFound=R,exports.OnThisPage=z,exports.PageNav=V,exports.SearchDialog=i.t,exports.Sidebar=U,Object.defineProperty(exports,`ViteReactSSG`,{enumerable:!0,get:function(){return m.ViteReactSSG}}),exports.cn=e.y,exports.copyToClipboard=a.i,exports.createRoutes=me,exports.getStarsRepo=T,exports.getTranslated=E,exports.reactToText=a.a,exports.useAnalytics=ve,exports.useBreadcrumbs=b,exports.useConfig=e.nt,exports.useI18n=M,exports.useLocalizedTo=e.b,exports.useLocation=t.r,exports.useMdxComponents=v,exports.useNavbar=D,exports.usePageNav=B,exports.useRoutes=e.X,exports.useSearch=i.n,exports.useSearchHighlight=t.n,exports.useSidebar=t.m,exports.useTabs=k,exports.useTheme=n.l,exports.useTrackEvent=be,exports.useTrackPageView=ye,exports.useUI=t.T,exports.useVersion=j;
|
|
6
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icons-dev-BlV3wWFT.cjs`),t=require(`../docs-layout-x2yKt2cL.cjs`),n=require(`../image-BHhTvQzr.cjs`),r=require(`../search-dialog-BvBopRsZ.cjs`),i=require(`../search-dialog-DuYTIefy.cjs`),a=require(`../mdx-r4cDQxWu.cjs`);let o=require(`react-router-dom`),s=require(`react`),c=require(`react/jsx-runtime`),l=require(`react-aria-components`),u=require(`virtual:boltdocs-icons`);u=e.rt(u);let d=require(`react-helmet-async`);d=e.rt(d);let f=require(`virtual:boltdocs-mdx-components`);f=e.rt(f);let p=require(`virtual:boltdocs-layout`);p=e.rt(p);let m=require(`@bdocs/ssg`);const h=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),g=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),_=globalThis[h]||(globalThis[h]=(0,s.createContext)({}));function v(){let e=(0,s.use)(_);return(!e||Object.keys(e).length===0)&&globalThis[g]?globalThis[g]:e}function y({components:e,children:t}){let n=(0,s.useMemo)(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[g]=n),(0,c.jsx)(_.Provider,{value:n,children:t})}function b(){let{currentRoute:t}=e.X(),n=[];return t&&(t.groupTitle&&n.push({label:t.groupTitle}),n.push({label:t.title,href:t.path})),{crumbs:n,activeRoute:t}}function x(){let{crumbs:n,activeRoute:r}=b();return n.length===0?null:(0,c.jsxs)(t.N.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[(0,c.jsx)(t.N.Item,{children:(0,c.jsx)(t.N.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:(0,c.jsx)(e.F,{size:14})})}),n.map((n,i)=>{let a=n.href===r?.path;return(0,c.jsxs)(t.N.Item,{className:`gap-2`,children:[(0,c.jsx)(t.N.Separator,{className:`text-muted/40`}),(0,c.jsx)(t.N.Link,{href:n.href,className:e.y(`transition-colors`,a?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:n.label})]},`crumb-${n.href}-${n.label}-${i}`)})]})}const S=e=>{let[t,n]=(0,s.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function C({content:n,mdxRaw:r}){let i=r||n||``,{copied:a,handleCopy:o,handleOpenRaw:s}=S(i);return i?(0,c.jsx)(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:(0,c.jsxs)(t.j,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[(0,c.jsx)(t.M,{onPress:o,className:e.y(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,a&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":a?`Copied!`:`Copy Markdown`,children:a?(0,c.jsx)(e.w,{size:14}):(0,c.jsx)(e.k,{size:14})}),(0,c.jsxs)(t.M,{onPress:o,className:e.y(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,a&&`text-emerald-500 hover:bg-emerald-500/5`),children:[a?(0,c.jsx)(e.w,{size:16}):(0,c.jsx)(e.k,{size:16}),a?`Copied!`:`Copy Markdown`]}),(0,c.jsxs)(t.k.Trigger,{placement:`bottom end`,children:[(0,c.jsx)(t.M,{className:e.y(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:(0,c.jsx)(e.T,{size:14})}),(0,c.jsxs)(t.k.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{onAction:o,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.k,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),(0,c.jsxs)(t.k.Item,{onAction:s,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.j,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function w({children:e,fallback:n}){return(0,c.jsx)(t.D,{fallback:n,children:e})}async function T(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:ee(i.stargazers_count)}const ee=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function te({repo:t}){let[n,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{t&&T(t).then(e=>r(e)).catch(()=>r(`0`))},[t]),(0,c.jsxs)(`a`,{href:`https://github.com/${t}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[(0,c.jsx)(e.s,{className:`h-4 w-4 text-body`}),n!==null&&(0,c.jsxs)(`span`,{className:`tabular-nums font-medium`,children:[n,` stars`]})]})}function E(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function D(){let t=e.nt(),{theme:r,resolvedTheme:i}=n.l(),a=(0,o.useLocation)(),{currentLocale:c}=e.X(),l=t.theme||{},u=E(l.title,c)||`Boltdocs`,d=l.navbar||[],f=l.socialLinks||[],p=l.githubRepo,m=(0,s.useMemo)(()=>d.map(e=>{let n=e.href||e.to||e.link||``,r=e=>{let n=a.pathname;if(n===e)return!0;if(!e||e===`/`)return n===`/`;let r=e=>{let n=e.split(`/`).filter(Boolean),r=0;return t.i18n?.locales&&n[r]&&t.i18n.locales[n[r]]&&r++,t.versions?.versions&&n[r]&&t.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},i=r(e),o=r(n);return i.length===0?o.length===0:o.length<i.length?!1:i.every((e,t)=>o[t]===e)},i=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:E(e.label||e.text,c),href:t,active:r(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(e.items);return{label:E(e.label||e.text,c),href:n,active:r(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:i}}),[d,a.pathname,c,t]),h=l.logo;return{links:m,title:u,logo:h?typeof h==`string`?h:i===`dark`?h.dark:h.light:null,logoProps:{alt:(h&&typeof h==`object`?h.alt:void 0)||u,width:h&&typeof h==`object`?h.width:void 0,height:h&&typeof h==`object`?h.height:void 0},github:p?`https://github.com/${p}`:null,social:f,config:t,theme:r}}function O(){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:`h-9 w-9`});let u=r===`system`?e.V:r===`dark`?e.H:e.K;return(0,c.jsxs)(t.k.Trigger,{placement:`bottom right`,children:[(0,c.jsx)(l.Button,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:(0,c.jsx)(u,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),(0,c.jsxs)(t.k.Root,{selectionMode:`single`,selectedKeys:[r],onSelectionChange:e=>{let t=Array.from(e)[0];i(t)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.K,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Light`})]}),(0,c.jsxs)(t.k.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.H,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Dark`})]}),(0,c.jsxs)(t.k.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.V,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`System`})]})]})]})}function ne({className:t}){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:e.y(`h-10 w-full bg-surface rounded-xl animate-pulse`,t)});let l=r===`dark`;return(0,c.jsxs)(`div`,{className:e.y(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,t),children:[(0,c.jsx)(`div`,{className:e.y(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,l?`translate-x-full`:`translate-x-0`)}),(0,c.jsx)(`button`,{onClick:()=>i(`light`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:(0,c.jsx)(e.K,{size:18})}),(0,c.jsx)(`button`,{onClick:()=>i(`dark`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:(0,c.jsx)(e.H,{size:18})})]})}function k(t=[],n=[]){let r=(0,o.useLocation)(),i=(0,s.useRef)([]),[a,c]=(0,s.useState)({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),l=e.Z(r.pathname),u=n.find(t=>e.Z(t.path)===l)?.tab?.toLowerCase(),d=t.findIndex(e=>e.id.toLowerCase()===u),f=d===-1?0:d;return(0,s.useEffect)(()=>{let e=i.current[f];e&&c({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[f,t.length,r.pathname]),{tabs:t,activeIndex:f,indicatorStyle:a,tabRefs:i,activeTabId:u}}function re({tabs:n,routes:r}){let{currentLocale:i}=e.X(),{indicatorStyle:a,tabRefs:o,activeIndex:l}=k(n,r);(0,s.useEffect)(()=>{let e=o.current[l];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[l]);let d=t=>{if(!t)return null;if(t.trim().startsWith(`<svg`))return(0,c.jsx)(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:t}});let n={...e.Y,...u.default},r=n[t]||n[t+`Icon`];return r?(0,c.jsx)(r,{size:16}):(0,c.jsx)(`img`,{src:t,alt:``,className:`h-4 w-4 object-contain`})};return(0,c.jsx)(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:(0,c.jsxs)(t.E.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[n.map((t,n)=>{let a=n===l,s=r.find(e=>e.tab&&e.tab.toLowerCase()===t.id.toLowerCase());return(0,c.jsxs)(e._,{href:s?s.path:`#`,ref:e=>{o.current[n]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${a?`text-primary-500`:`text-muted hover:text-body`}`,children:[d(t.icon),(0,c.jsx)(`span`,{children:E(t.text,i)})]},t.id)}),(0,c.jsx)(t.E.Indicator,{style:a,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function A(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function j(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:c}=e.X(),l=n.versions,{setVersion:u}=e.$();return{currentVersion:a,currentVersionLabel:l?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:(0,s.useMemo)(()=>l?l.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[l,a]),handleVersionChange:e=>{if(!l||e===a)return;u(e);let o=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${c?`/${c}`:``}`;if(i){let t=A(i.filePath,i.version,i.locale),a=r.find(r=>A(r.filePath,r.version,r.locale)===t&&(r.version||l.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===c));if(a)o=a.path;else{let t=r.find(t=>A(t.filePath,t.version,t.locale)===`index.md`&&(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}}else{let t=r.find(t=>(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}t(o)}}}function M(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:c}=e.X(),l=n.i18n,{setLocale:u}=e.$(),d=e=>{if(!l||e===a)return;u(e);let o=n.base||`/`,s=o===`/`?``:o.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=A(i.filePath,i.version,i.locale),n=r.find(n=>A(n.filePath,n.version,n.locale)===t&&(n.locale||l.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>A(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||l.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${s}${i.version?`/${i.version}`:``}${e===l.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(l.locales)?l.locales.includes(n[0]):l.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===l.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||l.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(c||n.versions?.defaultVersion));if(t)f=t.path;else{let t=c&&c!==n.versions?.defaultVersion?`/${c}`:``;f=e===l.defaultLocale?`${s}${t}`:`${s}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},f=l?.locales,p=f?Array.isArray(f)?a:f[a]:void 0;return{currentLocale:a,currentLocaleLabel:l?.localeConfigs?.[a]?.label||p||a,availableLocales:(0,s.useMemo)(()=>l?Array.isArray(l.locales)?l.locales.map(e=>({key:e,label:l?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(l.locales).map(([e,t])=>({key:e,label:l?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[l,a]),handleLocaleChange:d}}function N({className:n}){let{currentVersionLabel:r,availableVersions:i,handleVersionChange:a}=j();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsx)(`span`,{className:`font-semibold text-[0.8125rem]`,children:r}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function P({className:n}){let{currentLocale:r,availableLocales:i,handleLocaleChange:a}=M();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(e.L,{className:`w-3.5 h-3.5 text-primary-500`}),(0,c.jsx)(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:r||`en`})]}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:(0,c.jsx)(`span`,{children:e.label})},`${e.value??``}`)})})]})}const F=(0,s.lazy)(()=>Promise.resolve().then(()=>require(`../search-dialog-Cyko6TJm.cjs`)).then(e=>({default:e.SearchDialog})));function I(){let{links:n,title:i,logo:a,logoProps:l,github:u,social:d,config:f}=D(),{routes:p,allRoutes:m,currentRoute:h,currentVersion:g,currentLocale:_}=e.X(),{pathname:v}=(0,o.useLocation)(),{isSidebarOpen:y,toggleSidebar:b}=t.T(),[x,S]=(0,s.useState)(!1),C=f.theme||{},w=!!h?.filePath,T=C?.tabs&&C.tabs.length>0;return(0,c.jsxs)(r.n.Root,{className:e.y(`border-b border-subtle bg-main/80 backdrop-blur-md`,T&&`border-b-0`),children:[(0,c.jsxs)(r.n.Content,{children:[(0,c.jsxs)(r.n.Left,{children:[w&&(0,c.jsx)(t.M,{onPress:b,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":y?`Close sidebar`:`Open sidebar`,children:y?(0,c.jsx)(e.J,{className:`w-5 h-5 text-body`}):(0,c.jsx)(e.B,{className:`w-5 h-5 text-body`})}),a&&(0,c.jsx)(r.n.Logo,{src:a,alt:l?.alt||i,width:l?.width??24,height:l?.height??24,href:`site:/`}),(0,c.jsx)(r.n.Title,{href:`site:/`,children:i}),(0,c.jsx)(`div`,{className:`hidden sm:block`,children:f.versions&&g&&(0,c.jsx)(N,{})})]}),(0,c.jsx)(r.n.Center,{children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:(0,c.jsx)(F,{routes:p||[]})})}),(0,c.jsxs)(r.n.Right,{children:[(0,c.jsx)(s.Suspense,{fallback:null,children:(0,c.jsx)(`div`,{className:`lg:hidden`,children:(0,c.jsx)(F,{routes:p||[]})})}),(0,c.jsx)(r.n.Links,{children:n.map(e=>(0,c.jsx)(ie,{link:e},e.href))}),(0,c.jsxs)(`div`,{className:`hidden sm:flex items-center gap-2`,children:[f.i18n&&_&&(0,c.jsx)(P,{}),(0,c.jsx)(r.n.Split,{className:`bg-subtle`})]}),(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(O,{})}),u&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(te,{repo:C?.githubRepo??``})}),d.length>0&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(r.n.Split,{className:`bg-subtle`})}),(0,c.jsx)(`div`,{className:`hidden md:flex items-center gap-1`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),(0,c.jsx)(r.n.More,{onPress:()=>S(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),(0,c.jsxs)(r.n.MobileMenu,{isOpen:x,onClose:()=>S(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[(0,c.jsx)(`div`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,c.jsx)(L,{link:e,onClose:()=>S(!1)},e.href))}),d.length>0&&(0,c.jsxs)(`div`,{className:`mt-6`,children:[(0,c.jsx)(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),(0,c.jsx)(`div`,{className:`flex flex-wrap gap-2 px-2`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),w&&T&&C?.tabs&&(0,c.jsx)(`div`,{className:`w-full border-b border-subtle bg-main`,children:(0,c.jsx)(re,{tabs:C.tabs,routes:m||p||[]})})]})}function ie({link:t}){let n=e.b(t.href||``),{pathname:i}=(0,o.useLocation)(),a=i===n||i.startsWith(n+`/`);return t.items&&t.items.length>0?(0,c.jsx)(r.n.Dropdown,{label:(0,c.jsx)(`span`,{className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,a?`text-primary-500`:`text-muted hover:text-body`),children:t.label}),children:t.items?.map(t=>(0,c.jsx)(r.n.DropdownItem,{href:e.b(t.href||``),label:t.label},t.href))}):(0,c.jsx)(r.n.Link,{...t,href:n,active:a,className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,a?`text-primary-500`:`text-muted hover:text-body`)})}function L({link:t,onClose:n}){let i=e.b(t.href||``),{pathname:a}=(0,o.useLocation)(),s=a===i;return t.items&&t.items.length>0?(0,c.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,c.jsx)(`div`,{className:e.y(`px-3 py-2 text-sm transition-all`,s?`text-body`:`text-muted/80 hover:text-body`),children:t.label}),(0,c.jsx)(`div`,{className:`flex flex-col gap-1 pl-4`,children:t.items?.map(e=>(0,c.jsx)(L,{link:e,onClose:n},e.href))})]}):(0,c.jsx)(r.n.MobileLink,{...t,href:i,active:s,onPress:n,className:e.y(`transition-all`,s?`text-body`:`text-muted/80 hover:text-body`)})}function R(){return(0,c.jsx)(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:(0,c.jsxs)(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[(0,c.jsx)(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),(0,c.jsx)(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),(0,c.jsxs)(e._,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[(0,c.jsx)(e.C,{size:14}),` Go to Home`]})]})})}function z({headings:n=[],editLink:r,communityHelp:i,filePath:a}){return n.length===0?null:(0,c.jsxs)(t._.Root,{children:[(0,c.jsxs)(t._.Header,{className:`flex flex-row gap-x-2`,children:[(0,c.jsx)(e.q,{size:16}),`On this page`]}),(0,c.jsx)(t._.Tree,{headings:n}),(r||i)&&(0,c.jsxs)(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[(0,c.jsx)(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),(0,c.jsxs)(`ul`,{className:`space-y-3`,children:[r&&a&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:r.replace(`:path`,a),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.W,{size:16}),`Edit this page`]})}),i&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.O,{size:16}),`Community help`]})})]})]})]})}function B(){let{routes:t,currentRoute:n}=e.X(),r=(0,o.useLocation)();return(0,s.useMemo)(()=>{if(!n)return{prevPage:null,nextPage:null,currentRoute:null};let e=n.tab?.toLowerCase(),i=e?t.filter(t=>t.tab?.toLowerCase()===e):t.filter(e=>!e.tab),a=i.findIndex(e=>e.path===r.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:n}},[t,n,r.pathname])}function V(){let{prevPage:e,nextPage:n}=B();return!e&&!n?null:(0,c.jsxs)(t.h.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?(0,c.jsxs)(t.h.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):(0,c.jsx)(`div`,{}),n?(0,c.jsxs)(t.h.Link,{to:n.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:n.title})]}):(0,c.jsx)(`div`,{})]})}function H({routes:n,config:r}){let{logo:i,title:a,logoProps:o}=D(),{closeSidebar:s}=t.T(),l=i?(0,c.jsx)(`img`,{src:i,alt:o?.alt||a,width:24,height:24,className:`rounded-xl`}):null,u=r.versions||r.i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t.i.Root,{children:(0,c.jsx)(t.i.Content,{children:(0,c.jsx)(t.i.Items,{routes:n})})}),(0,c.jsxs)(t.i.Mobile,{children:[(0,c.jsxs)(t.i.Header,{children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[l,(0,c.jsx)(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:a})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(ne,{className:`w-24 h-9 rounded-xl`}),(0,c.jsx)(t.M,{onPress:s,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:(0,c.jsx)(e.J,{size:20})})]})]}),(0,c.jsxs)(t.i.Content,{children:[u&&(0,c.jsxs)(`div`,{className:`flex flex-col gap-4 mb-10`,children:[(0,c.jsxs)(`div`,{className:`flex gap-3`,children:[r.versions&&(0,c.jsx)(N,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),r.i18n&&(0,c.jsx)(P,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),(0,c.jsx)(`div`,{className:`mt-2 border-b border-subtle`})]}),(0,c.jsx)(t.i.Items,{routes:n})]})]})]})}const U=Object.assign(H,{Root:t.i.Root,Mobile:t.i.Mobile,Header:t.i.Header,Content:t.i.Content,Group:t.i.Group,Link:t.i.Link,SubGroup:t.i.SubGroup,Item:t.i.Item,Items:t.i.Items});function W({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return(0,c.jsxs)(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[(0,c.jsx)(`span`,{}),(0,c.jsxs)(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function G({route:e,content:t,mdxComponents:n}){let r=v(),i=(0,s.useMemo)(()=>({LastUpdated:W,...r,...n}),[r,n]),a=i.LastUpdated||W;return t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t,{components:i}),e?.lastUpdated&&(0,c.jsx)(a,{date:e.lastUpdated})]}):null}function K({MDXComponent:e,mdxComponents:t}){let n=(0,o.useLoaderData)(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?(0,c.jsx)(G,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const q=d,J=q.Helmet||q.default?.Helmet||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),Y=q.HelmetProvider||q.default?.HelmetProvider||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e}));function ae(){let{pathname:e,hash:t}=(0,o.useLocation)(),n=(e=`auto`)=>{let n=document.querySelector(`.boltdocs-content`)||window,r=()=>n===window?window.scrollY:n.scrollTop,i=(e,t)=>{n===window?window.scrollTo({top:e,behavior:t}):n.scrollTo({top:e,behavior:t})};if(t){let a=t.replace(`#`,``),o=document.getElementById(a);if(o){let t=n===window?0:n.getBoundingClientRect().top;return i(o.getBoundingClientRect().top-t-80+r(),e),!0}}return i(0,e),!1};return(0,s.useLayoutEffect)(()=>{n(`auto`)},[e,t]),(0,s.useEffect)(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const oe={...a.t,NotFound:R,404:R};function X(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function se({config:t}){let{currentLocale:n}=e.$();return(0,s.useEffect)(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function ce({config:t,routeMap:n}){let r=(0,o.useLocation)(),{setLocale:i,setVersion:a}=e.$();return(0,s.useEffect)(()=>{let e=X(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function Z({config:r,routes:i,components:a={}}){let l=(0,s.useMemo)(()=>({...oe,...f.default,...a}),[a]),{pathname:u}=(0,o.useLocation)(),d=(0,s.useMemo)(()=>X(u||`/`),[u]),p=(0,s.useMemo)(()=>{let e=new Map;for(let t of i){let n=X(t.path===``?`/`:t.path);e.set(n,t)}return e},[i]),m=(0,s.useMemo)(()=>{let e=p.get(d),t,n;return e&&(r.i18n&&(t=e.locale||r.i18n.defaultLocale),r.versions&&(n=e.version||r.versions.defaultVersion)),{initLocale:t,initVersion:n}},[d,r,p]);return(0,c.jsx)(Y,{children:(0,c.jsx)(e.et,{routes:i,children:(0,c.jsx)(n.c,{children:(0,c.jsx)(t.w,{children:(0,c.jsx)(y,{components:l,children:(0,c.jsxs)(e.tt.Provider,{value:r,children:[(0,c.jsx)(ae,{}),(0,c.jsxs)(e.Q,{initialLocale:m.initLocale,initialVersion:m.initVersion,children:[(0,c.jsx)(ce,{config:r,routeMap:p}),(0,c.jsx)(se,{config:r}),(0,c.jsx)(o.Outlet,{})]})]})})})})})})}function le({siteTitle:t,siteDescription:n,routes:r}){let i=(0,o.useLocation)(),a=e.nt(),{currentLocale:l}=e.X(),u=(0,s.useMemo)(()=>r?.find?.(e=>e.path===i.pathname),[r,i.pathname]),d=u?.title,f=E(n,l),p=u?.description||f||``,m=E(t,l),h=d?`${d} | ${m}`:m,g=u?.seo||{},_=a?.seo?.metatags||{},v=a?.seo?.thumbnails?.background,y=g[`og:image`]||v;return(0,c.jsxs)(J,{children:[(0,c.jsx)(`title`,{children:h}),(0,c.jsx)(`meta`,{name:`description`,content:p}),(0,c.jsx)(`meta`,{property:`og:title`,content:h}),(0,c.jsx)(`meta`,{property:`og:description`,content:p}),(0,c.jsx)(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&(0,c.jsx)(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&(0,c.jsx)(`link`,{rel:`canonical`,href:window.location.origin+i.pathname}),(0,c.jsx)(`meta`,{name:`twitter:card`,content:`summary`}),(0,c.jsx)(`meta`,{name:`twitter:title`,content:h}),(0,c.jsx)(`meta`,{name:`twitter:description`,content:p}),y&&(0,c.jsx)(`meta`,{name:`twitter:image`,content:y}),y&&(0,c.jsx)(`meta`,{property:`og:image`,content:y}),(0,c.jsx)(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(_).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e)),Object.entries(g).map(([e,t])=>e===`noindex`&&t===!0?(0,c.jsx)(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?(0,c.jsx)(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?(0,c.jsx)(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e))]})}function ue(){let t=e.nt(),{currentRoute:n,allRoutes:r}=e.X();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(le,{siteTitle:t.theme?.title,siteDescription:t.theme?.description,routes:r||[]}),(0,c.jsx)(p.default,{route:n,children:(0,c.jsx)(o.Outlet,{})})]})}const de=()=>(0,c.jsx)(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),fe=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return(0,s.useEffect)(()=>{if(!{}.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return{}.hot.on(`boltdocs:mdx-update`,e),()=>({}).hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?(0,c.jsx)(K,{MDXComponent:i,mdxComponents:r}):(0,c.jsx)(de,{})},pe=()=>{let e=v();return(0,c.jsx)(e.NotFound||e[404]||R,{})};function me(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),l=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},u=[],d=n.versions?.defaultVersion,f=(n.base||`/docs`).replace(/\/$/,``),p=(n.base||`/docs`).replace(/\/$/,``);p||=`/`,d&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(f)?t.substring(f.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===d||n.startsWith(`${d}/`))){let t=`${f}/${d}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;u.push({...e,path:t,version:d})}});let m=[...t,...u],h=new Map,g=Object.keys(r);if(g.length>0){let e=g[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of g){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?h.set(i,e):h.set(r,e)}}let _=m.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=h.get(t),i=n?r[n]:null,a=l(e.path===``?`/`:e.path),s=a===p?`.`:a.startsWith(p+`/`)?a.slice(p.length+1):a;return{path:s,element:(0,c.jsx)(fe,{moduleKey:n,moduleLoader:i,route:e,components:o},n||s),loader:async()=>({path:s,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[s]}}),v=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],y=n.versions?.versions?.map(e=>e.path)||[],b=[];b.push({path:p,filter:()=>!0});let x=[];y.length>0&&y.forEach(e=>x.push(`/${e}`)),v.length>0&&v.forEach(e=>x.push(`/${e}`)),y.length>0&&v.length>0&&y.forEach(e=>{v.forEach(t=>{x.push(`/${e}/${t}`)})}),x.forEach(e=>{let t=p===`/`?e:`${p}${e}`;b.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let S=new Set(_.map(e=>(e.path||``).replace(/\/$/,``))),C=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;C.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{C.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),b.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(S.has(r)||C.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,o=a&&S.has(a.replace(/\/$/,``))?_.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):_.find(e=>t(e.path)&&e.path!==r);if(!o&&_.length>0&&(o=_[0]),o){let t=e===p?`.`:e.startsWith(p+`/`)?e.slice(p.length+1):e,r=t===`.`;_.push({...r?{index:!0}:{path:t},element:o.element,loader:o.loader,getStaticPaths:()=>[]});let i=m.find(e=>{let t=l(e.path===``?`/`:e.path);return(t===p?`.`:t.startsWith(p+`/`)?t.slice(p.length+1):t)===o.path});if(i){let t=l(i.path),r=n.siteUrl?`${n.siteUrl.replace(/\/$/,``)}${t}`:t;m.push({...i,path:e,seo:{...i.seo,canonical:r}})}}}});let w=[{path:p,element:(0,c.jsx)(ue,{}),children:_}],T=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;w.find(e=>e.path===r)||(T.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),w.push({path:r,element:(0,c.jsx)(s,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;w.find(e=>e.path===r)||(T.push({path:r,locale:n,title:e,filePath:``,headings:[]}),w.push({path:r,element:(0,c.jsx)(s,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),w.push({path:`*`,element:(0,c.jsx)(s,{children:(0,c.jsx)(pe,{})})}),[{element:(0,c.jsx)(Z,{config:n,routes:[...m,...T],components:o}),children:w}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?he(e):window.dataLayer?ge(e):$()}function he(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function ge(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const _e=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function ve(e={}){let{config:n,autoTrackPageViews:r=!0,autoTrackDownloads:i=!0,autoTrackExternalLinks:a=!0,excludePatterns:o=[]}=e,c=typeof globalThis<`u`?globalThis[_e]:void 0,l=n??c?.integrations,u=(0,s.useMemo)(()=>Q(l),[l]),d=(0,s.useRef)(``),f=t.r();return(0,s.useEffect)(()=>{if(!r||!u.isEnabled)return;let e=f.pathname+f.search;e!==d.current&&(d.current=e,u.trackPageView(e,document.title))},[f.pathname,r,u]),(0,s.useEffect)(()=>{if(!i||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!o.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;u.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,a,u,o]),(0,s.useEffect)(()=>{if(!a||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(o.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&u.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[a,u,o]),u}function ye(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)((t,n)=>{e.trackPageView(t,n)},[e])}function be(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)(t=>{e.trackEvent(t)},[e])}function xe({children:n}){let{routes:r,currentRoute:i}=e.X(),a=e.nt();return(0,c.jsxs)(t.t,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[(0,c.jsx)(I,{}),(0,c.jsxs)(t.t.Body,{className:`bg-main`,children:[(0,c.jsx)(U,{routes:r||[],config:a}),(0,c.jsx)(t.t.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:(0,c.jsxs)(t.t.ContentMdx,{className:`max-w-3xl sm:max-w-4xl lg:max-w-4xl px-2 pt-8 pb-24`,children:[(0,c.jsxs)(t.t.Header,{children:[(0,c.jsxs)(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,c.jsx)(x,{}),(0,c.jsx)(C,{mdxRaw:i?._rawContent,route:i})]}),i?.title&&(0,c.jsx)(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:i.title}),i?.description&&(0,c.jsx)(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:i.description})]}),(0,c.jsx)(w,{children:(0,c.jsx)(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:n})}),(0,c.jsx)(t.t.Footer,{children:(0,c.jsx)(V,{})})]})}),(0,c.jsx)(z,{headings:i?.headings,editLink:a.theme?.editLink,communityHelp:a.theme?.communityHelp,filePath:i?.filePath})]})]})}const Se=Object.assign(xe,{Body:t.t.Body,Content:t.t.Content,ContentMdx:t.t.ContentMdx,Header:t.t.Header,Footer:t.t.Footer});exports.BoltdocsShell=Z,exports.Breadcrumbs=x,exports.Card=a.r,exports.Cards=a.n,exports.CopyMarkdown=C,exports.DocsLayout=Se,exports.ErrorBoundary=w,exports.MdxPage=K,exports.Navbar=I,exports.NotFound=R,exports.OnThisPage=z,exports.PageNav=V,exports.SearchDialog=i.t,exports.Sidebar=U,Object.defineProperty(exports,`ViteReactSSG`,{enumerable:!0,get:function(){return m.ViteReactSSG}}),exports.cn=e.y,exports.copyToClipboard=a.i,exports.createRoutes=me,exports.getStarsRepo=T,exports.getTranslated=E,exports.reactToText=a.a,exports.useAnalytics=ve,exports.useBreadcrumbs=b,exports.useConfig=e.nt,exports.useI18n=M,exports.useLocalizedTo=e.b,exports.useLocation=t.r,exports.useMdxComponents=v,exports.useNavbar=D,exports.usePageNav=B,exports.useRoutes=e.X,exports.useSearch=i.n,exports.useSearchHighlight=t.n,exports.useSidebar=t.m,exports.useTabs=k,exports.useTheme=n.l,exports.useTrackEvent=be,exports.useTrackPageView=ye,exports.useUI=t.T,exports.useVersion=j;
|
package/dist/client/index.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{$ as e,B as t,C as n,F as r,H as i,J as a,K as o,L as s,O as c,Q as l,T as u,V as d,W as f,X as p,Y as m,Z as h,_ as g,b as _,et as v,j as y,k as b,nt as x,q as S,s as C,tt as w,w as ee,y as T}from"../icons-dev-B_RZIyxu.js";import{D as te,E as ne,M as E,N as D,T as O,_ as k,h as A,i as j,j as re,k as M,m as ie,n as ae,r as oe,t as N,w as se}from"../docs-layout-KoWNZc8_.js";import{c as ce,l as P}from"../image-CqKzYD8f.js";import{n as F}from"../search-dialog-D6BNohIJ.js";import{n as le,t as ue}from"../search-dialog-B584t9ZF.js";import{a as de,i as fe,n as pe,r as me,t as he}from"../mdx-DudBEac0.js";import{ViteReactSSG as ge}from"@bdocs/ssg";import{Outlet as _e,useLoaderData as ve,useLocation as I,useNavigate as ye}from"react-router-dom";import{Suspense as be,createContext as xe,lazy as Se,use as Ce,useCallback as we,useEffect as L,useLayoutEffect as Te,useMemo as R,useRef as Ee,useState as z}from"react";import{Fragment as B,jsx as V,jsxs as H}from"react/jsx-runtime";import{Button as De}from"react-aria-components";import Oe from"virtual:boltdocs-icons";import*as ke from"react-helmet-async";import Ae from"virtual:boltdocs-mdx-components";import je from"virtual:boltdocs-layout";const Me=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),U=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),Ne=globalThis[Me]||(globalThis[Me]=xe({}));function W(){let e=Ce(Ne);return(!e||Object.keys(e).length===0)&&globalThis[U]?globalThis[U]:e}function Pe({components:e,children:t}){let n=R(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[U]=n),V(Ne.Provider,{value:n,children:t})}function Fe(){let{currentRoute:e}=p(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}function Ie(){let{crumbs:e,activeRoute:t}=Fe();return e.length===0?null:H(D.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[V(D.Item,{children:V(D.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:V(r,{size:14})})}),e.map((e,n)=>{let r=e.href===t?.path;return H(D.Item,{className:`gap-2`,children:[V(D.Separator,{className:`text-muted/40`}),V(D.Link,{href:e.href,className:T(`transition-colors`,r?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:e.label})]},`crumb-${e.href}-${e.label}-${n}`)})]})}const Le=e=>{let[t,n]=z(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function Re({content:e,mdxRaw:t}){let n=t||e||``,{copied:r,handleCopy:i,handleOpenRaw:a}=Le(n);return n?V(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:H(re,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[V(E,{onPress:i,className:T(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,r&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":r?`Copied!`:`Copy Markdown`,children:V(r?ee:b,{size:14})}),H(E,{onPress:i,className:T(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,r&&`text-emerald-500 hover:bg-emerald-500/5`),children:[V(r?ee:b,{size:16}),r?`Copied!`:`Copy Markdown`]}),H(M.Trigger,{placement:`bottom end`,children:[V(E,{className:T(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:V(u,{size:14})}),H(M.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[H(M.Item,{onAction:i,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[V(b,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),V(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),H(M.Item,{onAction:a,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[V(y,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),V(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function ze({children:e,fallback:t}){return V(te,{fallback:t,children:e})}async function Be(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:Ve(i.stargazers_count)}const Ve=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function He({repo:e}){let[t,n]=z(null);return L(()=>{e&&Be(e).then(e=>n(e)).catch(()=>n(`0`))},[e]),H(`a`,{href:`https://github.com/${e}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[V(C,{className:`h-4 w-4 text-body`}),t!==null&&H(`span`,{className:`tabular-nums font-medium`,children:[t,` stars`]})]})}function G(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function K(){let e=x(),{theme:t,resolvedTheme:n}=P(),r=I(),{currentLocale:i}=p(),a=e.theme||{},o=G(a.title,i)||`Boltdocs`,s=a.navbar||[],c=a.socialLinks||[],l=a.githubRepo,u=R(()=>s.map(t=>{let n=t.href||t.to||t.link||``,a=t=>{let n=r.pathname;if(n===t)return!0;if(!t||t===`/`)return n===`/`;let i=t=>{let n=t.split(`/`).filter(Boolean),r=0;return e.i18n?.locales&&n[r]&&e.i18n.locales[n[r]]&&r++,e.versions?.versions&&n[r]&&e.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},a=i(t),o=i(n);return a.length===0?o.length===0:o.length<a.length?!1:a.every((e,t)=>o[t]===e)},o=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:G(e.label||e.text,i),href:t,active:a(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(t.items);return{label:G(t.label||t.text,i),href:n,active:a(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:o}}),[s,r.pathname,i,e]),d=a.logo;return{links:u,title:o,logo:d?typeof d==`string`?d:n===`dark`?d.dark:d.light:null,logoProps:{alt:(d&&typeof d==`object`?d.alt:void 0)||o,width:d&&typeof d==`object`?d.width:void 0,height:d&&typeof d==`object`?d.height:void 0},github:l?`https://github.com/${l}`:null,social:c,config:e,theme:t}}function Ue(){let{theme:e,setTheme:t}=P(),[n,r]=z(!1);if(L(()=>{r(!0)},[]),!n)return V(`div`,{className:`h-9 w-9`});let a=e===`system`?d:e===`dark`?i:o;return H(M.Trigger,{placement:`bottom right`,children:[V(De,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:V(a,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),H(M.Root,{selectionMode:`single`,selectedKeys:[e],onSelectionChange:e=>{let n=Array.from(e)[0];t(n)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[H(M.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[V(o,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`Light`})]}),H(M.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[V(i,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`Dark`})]}),H(M.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[V(d,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`System`})]})]})]})}function We({className:e}){let{theme:t,setTheme:n}=P(),[r,a]=z(!1);if(L(()=>{a(!0)},[]),!r)return V(`div`,{className:T(`h-10 w-full bg-surface rounded-xl animate-pulse`,e)});let s=t===`dark`;return H(`div`,{className:T(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,e),children:[V(`div`,{className:T(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,s?`translate-x-full`:`translate-x-0`)}),V(`button`,{onClick:()=>n(`light`),className:T(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,s?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:V(o,{size:18})}),V(`button`,{onClick:()=>n(`dark`),className:T(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,s?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:V(i,{size:18})})]})}function Ge(e=[],t=[]){let n=I(),r=Ee([]),[i,a]=z({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),o=h(n.pathname),s=t.find(e=>h(e.path)===o)?.tab?.toLowerCase(),c=e.findIndex(e=>e.id.toLowerCase()===s),l=c===-1?0:c;return L(()=>{let e=r.current[l];e&&a({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[l,e.length,n.pathname]),{tabs:e,activeIndex:l,indicatorStyle:i,tabRefs:r,activeTabId:s}}function Ke({tabs:e,routes:t}){let{currentLocale:n}=p(),{indicatorStyle:r,tabRefs:i,activeIndex:a}=Ge(e,t);L(()=>{let e=i.current[a];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[a]);let o=e=>{if(!e)return null;if(e.trim().startsWith(`<svg`))return V(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t={...m,...Oe},n=t[e]||t[e+`Icon`];return n?V(n,{size:16}):V(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return V(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:H(ne.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[e.map((e,r)=>{let s=r===a,c=t.find(t=>t.tab&&t.tab.toLowerCase()===e.id.toLowerCase());return H(g,{href:c?c.path:`#`,ref:e=>{i.current[r]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${s?`text-primary-500`:`text-muted hover:text-body`}`,children:[o(e.icon),V(`span`,{children:G(e.text,n)})]},e.id)}),V(ne.Indicator,{style:r,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function q(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function qe(){let t=ye(),n=x(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:o}=p(),s=n.versions,{setVersion:c}=e();return{currentVersion:a,currentVersionLabel:s?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:R(()=>s?s.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[s,a]),handleVersionChange:e=>{if(!s||e===a)return;c(e);let l=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${o?`/${o}`:``}`;if(i){let t=q(i.filePath,i.version,i.locale),a=r.find(r=>q(r.filePath,r.version,r.locale)===t&&(r.version||s.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===o));if(a)l=a.path;else{let t=r.find(t=>q(t.filePath,t.version,t.locale)===`index.md`&&(t.version||s.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===o));t&&(l=t.path)}}else{let t=r.find(t=>(t.version||s.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===o));t&&(l=t.path)}t(l)}}}function Je(){let t=ye(),n=x(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:o}=p(),s=n.i18n,{setLocale:c}=e(),l=e=>{if(!s||e===a)return;c(e);let l=n.base||`/`,u=l===`/`?``:l.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=q(i.filePath,i.version,i.locale),n=r.find(n=>q(n.filePath,n.version,n.locale)===t&&(n.locale||s.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>q(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||s.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${u}${i.version?`/${i.version}`:``}${e===s.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(s.locales)?s.locales.includes(n[0]):s.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===s.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||s.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(o||n.versions?.defaultVersion));if(t)f=t.path;else{let t=o&&o!==n.versions?.defaultVersion?`/${o}`:``;f=e===s.defaultLocale?`${u}${t}`:`${u}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},u=s?.locales,d=u?Array.isArray(u)?a:u[a]:void 0;return{currentLocale:a,currentLocaleLabel:s?.localeConfigs?.[a]?.label||d||a,availableLocales:R(()=>s?Array.isArray(s.locales)?s.locales.map(e=>({key:e,label:s?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(s.locales).map(([e,t])=>({key:e,label:s?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[s,a]),handleLocaleChange:l}}function J({className:e}){let{currentVersionLabel:t,availableVersions:n,handleVersionChange:r}=qe();return n.length===0?null:H(M.Trigger,{children:[H(E,{className:T(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[V(`span`,{className:`font-semibold text-[0.8125rem]`,children:t}),V(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),V(M.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:V(M.Section,{items:n,children:e=>V(M.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function Ye({className:e}){let{currentLocale:t,availableLocales:n,handleLocaleChange:r}=Je();return n.length===0?null:H(M.Trigger,{children:[H(E,{className:T(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[H(`div`,{className:`flex items-center gap-1.5`,children:[V(s,{className:`w-3.5 h-3.5 text-primary-500`}),V(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:t||`en`})]}),V(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),V(M.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:V(M.Section,{items:n,children:e=>V(M.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:V(`span`,{children:e.label})},`${e.value??``}`)})})]})}const Xe=Se(()=>import(`../search-dialog-ByvGScjt.js`).then(e=>({default:e.SearchDialog})));function Ze(){let{links:e,title:n,logo:r,logoProps:i,github:o,social:s,config:c}=K(),{routes:l,allRoutes:u,currentRoute:d,currentVersion:f,currentLocale:m}=p(),{pathname:h}=I(),{isSidebarOpen:g,toggleSidebar:_}=O(),[v,y]=z(!1),b=c.theme||{},x=!!d?.filePath,S=b?.tabs&&b.tabs.length>0;return H(F.Root,{className:T(`border-b border-subtle bg-main/80 backdrop-blur-md`,S&&`border-b-0`),children:[H(F.Content,{children:[H(F.Left,{children:[x&&V(E,{onPress:_,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":g?`Close sidebar`:`Open sidebar`,children:V(g?a:t,{className:`w-5 h-5 text-body`})}),r&&V(F.Logo,{src:r,alt:i?.alt||n,width:i?.width??24,height:i?.height??24,href:`site:/`}),V(F.Title,{href:`site:/`,children:n}),V(`div`,{className:`hidden sm:block`,children:c.versions&&f&&V(J,{})})]}),V(F.Center,{children:V(be,{fallback:V(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:V(Xe,{routes:l||[]})})}),H(F.Right,{children:[V(be,{fallback:null,children:V(`div`,{className:`lg:hidden`,children:V(Xe,{routes:l||[]})})}),V(F.Links,{children:e.map(e=>V(Qe,{link:e},e.href))}),H(`div`,{className:`hidden sm:flex items-center gap-2`,children:[c.i18n&&m&&V(Ye,{}),V(F.Split,{className:`bg-subtle`})]}),V(`div`,{className:`hidden md:block`,children:V(Ue,{})}),o&&V(`div`,{className:`hidden md:block`,children:V(He,{repo:b?.githubRepo??``})}),s.length>0&&V(`div`,{className:`hidden md:block`,children:V(F.Split,{className:`bg-subtle`})}),V(`div`,{className:`hidden md:flex items-center gap-1`,children:s.map(({icon:e,link:t})=>V(F.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),V(F.More,{onPress:()=>y(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),H(F.MobileMenu,{isOpen:v,onClose:()=>y(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[V(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>V($e,{link:e,onClose:()=>y(!1)},e.href))}),s.length>0&&H(`div`,{className:`mt-6`,children:[V(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),V(`div`,{className:`flex flex-wrap gap-2 px-2`,children:s.map(({icon:e,link:t})=>V(F.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),x&&S&&b?.tabs&&V(`div`,{className:`w-full border-b border-subtle bg-main`,children:V(Ke,{tabs:b.tabs,routes:u||l||[]})})]})}function Qe({link:e}){let t=_(e.href||``),{pathname:n}=I(),r=n===t||n.startsWith(t+`/`);return e.items&&e.items.length>0?V(F.Dropdown,{label:V(`span`,{className:T(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,r?`text-primary-500`:`text-muted hover:text-body`),children:e.label}),children:e.items?.map(e=>V(F.DropdownItem,{href:_(e.href||``),label:e.label},e.href))}):V(F.Link,{...e,href:t,active:r,className:T(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,r?`text-primary-500`:`text-muted hover:text-body`)})}function $e({link:e,onClose:t}){let n=_(e.href||``),{pathname:r}=I(),i=r===n;return e.items&&e.items.length>0?H(`div`,{className:`flex flex-col gap-1`,children:[V(`div`,{className:T(`px-3 py-2 text-sm transition-all`,i?`text-body`:`text-muted/80 hover:text-body`),children:e.label}),V(`div`,{className:`flex flex-col gap-1 pl-4`,children:e.items?.map(e=>V($e,{link:e,onClose:t},e.href))})]}):V(F.MobileLink,{...e,href:n,active:i,onPress:t,className:T(`transition-all`,i?`text-body`:`text-muted/80 hover:text-body`)})}function Y(){return V(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:H(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[V(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),H(`div`,{className:`space-y-2`,children:[V(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),V(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),H(g,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[V(n,{size:14}),` Go to Home`]})]})})}function et({headings:e=[],editLink:t,communityHelp:n,filePath:r}){return e.length===0?null:H(k.Root,{children:[H(k.Header,{className:`flex flex-row gap-x-2`,children:[V(S,{size:16}),`On this page`]}),V(k.Tree,{headings:e}),(t||n)&&H(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[V(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),H(`ul`,{className:`space-y-3`,children:[t&&r&&V(`li`,{children:H(`a`,{href:t.replace(`:path`,r),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[V(f,{size:16}),`Edit this page`]})}),n&&V(`li`,{children:H(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[V(c,{size:16}),`Community help`]})})]})]})]})}function tt(){let{routes:e,currentRoute:t}=p(),n=I();return R(()=>{if(!t)return{prevPage:null,nextPage:null,currentRoute:null};let r=t.tab?.toLowerCase(),i=r?e.filter(e=>e.tab?.toLowerCase()===r):e.filter(e=>!e.tab),a=i.findIndex(e=>e.path===n.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:t}},[e,t,n.pathname])}function nt(){let{prevPage:e,nextPage:t}=tt();return!e&&!t?null:H(A.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?H(A.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[V(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),V(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):V(`div`,{}),t?H(A.Link,{to:t.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[V(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),V(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:t.title})]}):V(`div`,{})]})}function rt({routes:e,config:t}){let{logo:n,title:r,logoProps:i}=K(),{closeSidebar:o}=O(),s=n?V(`img`,{src:n,alt:i?.alt||r,width:24,height:24,className:`rounded-xl`}):null,c=t.versions||t.i18n;return H(B,{children:[V(j.Root,{children:V(j.Content,{children:V(j.Items,{routes:e})})}),H(j.Mobile,{children:[H(j.Header,{children:[H(`div`,{className:`flex items-center gap-3`,children:[s,V(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:r})]}),H(`div`,{className:`flex items-center gap-2`,children:[V(We,{className:`w-24 h-9 rounded-xl`}),V(E,{onPress:o,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:V(a,{size:20})})]})]}),H(j.Content,{children:[c&&H(`div`,{className:`flex flex-col gap-4 mb-10`,children:[H(`div`,{className:`flex gap-3`,children:[t.versions&&V(J,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),t.i18n&&V(Ye,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),V(`div`,{className:`mt-2 border-b border-subtle`})]}),V(j.Items,{routes:e})]})]})]})}const it=Object.assign(rt,{Root:j.Root,Mobile:j.Mobile,Header:j.Header,Content:j.Content,Group:j.Group,Link:j.Link,SubGroup:j.SubGroup,Item:j.Item,Items:j.Items});function at({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return H(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[V(`span`,{}),H(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function ot({route:e,content:t,mdxComponents:n}){let r=W(),i=R(()=>({LastUpdated:at,...r,...n}),[r,n]),a=i.LastUpdated||at;return t?H(B,{children:[V(t,{components:i}),e?.lastUpdated&&V(a,{date:e.lastUpdated})]}):null}function st({MDXComponent:e,mdxComponents:t}){let n=ve(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?V(ot,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const X=ke,ct=X.Helmet||X.default?.Helmet||(({children:e})=>V(B,{children:e})),lt=X.HelmetProvider||X.default?.HelmetProvider||(({children:e})=>V(B,{children:e}));function ut(){let{pathname:e,hash:t}=I(),n=(e=`auto`)=>{let n=document.querySelector(`.boltdocs-content`)||window,r=()=>n===window?window.scrollY:n.scrollTop,i=(e,t)=>{n===window?window.scrollTo({top:e,behavior:t}):n.scrollTo({top:e,behavior:t})};if(t){let a=t.replace(`#`,``),o=document.getElementById(a);if(o){let t=n===window?0:n.getBoundingClientRect().top;return i(o.getBoundingClientRect().top-t-80+r(),e),!0}}return i(0,e),!1};return Te(()=>{n(`auto`)},[e,t]),L(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const dt={...he,NotFound:Y,404:Y};function Z(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function ft({config:t}){let{currentLocale:n}=e();return L(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function pt({config:t,routeMap:n}){let r=I(),{setLocale:i,setVersion:a}=e();return L(()=>{let e=Z(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function mt({config:e,routes:t,components:n={}}){let r=R(()=>({...dt,...Ae,...n}),[n]),{pathname:i}=I(),a=R(()=>Z(i||`/`),[i]),o=R(()=>{let e=new Map;for(let n of t){let t=Z(n.path===``?`/`:n.path);e.set(t,n)}return e},[t]),s=R(()=>{let t=o.get(a),n,r;return t&&(e.i18n&&(n=t.locale||e.i18n.defaultLocale),e.versions&&(r=t.version||e.versions.defaultVersion)),{initLocale:n,initVersion:r}},[a,e,o]);return V(lt,{children:V(v,{routes:t,children:V(ce,{children:V(se,{children:V(Pe,{components:r,children:H(w.Provider,{value:e,children:[V(ut,{}),H(l,{initialLocale:s.initLocale,initialVersion:s.initVersion,children:[V(pt,{config:e,routeMap:o}),V(ft,{config:e}),V(_e,{})]})]})})})})})})}function ht({siteTitle:e,siteDescription:t,routes:n}){let r=I(),i=x(),{currentLocale:a}=p(),o=R(()=>n?.find?.(e=>e.path===r.pathname),[n,r.pathname]),s=o?.title,c=G(t,a),l=o?.description||c||``,u=G(e,a),d=s?`${s} | ${u}`:u,f=o?.seo||{},m=i?.seo?.metatags||{},h=i?.seo?.thumbnails?.background,g=f[`og:image`]||h;return H(ct,{children:[V(`title`,{children:d}),V(`meta`,{name:`description`,content:l}),V(`meta`,{property:`og:title`,content:d}),V(`meta`,{property:`og:description`,content:l}),V(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&V(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&V(`link`,{rel:`canonical`,href:window.location.origin+r.pathname}),V(`meta`,{name:`twitter:card`,content:`summary`}),V(`meta`,{name:`twitter:title`,content:d}),V(`meta`,{name:`twitter:description`,content:l}),g&&V(`meta`,{name:`twitter:image`,content:g}),g&&V(`meta`,{property:`og:image`,content:g}),V(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(m).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?V(`meta`,{property:e,content:t},e):V(`meta`,{name:e,content:t},e)),Object.entries(f).map(([e,t])=>e===`noindex`&&t===!0?V(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?V(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?V(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?V(`meta`,{property:e,content:t},e):V(`meta`,{name:e,content:t},e))]})}function gt(){let e=x(),{currentRoute:t,allRoutes:n}=p();return H(B,{children:[V(ht,{siteTitle:e.theme?.title,siteDescription:e.theme?.description,routes:n||[]}),V(je,{route:t,children:V(_e,{})})]})}const _t=()=>V(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),vt=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return L(()=>{if(!import.meta.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return import.meta.hot.on(`boltdocs:mdx-update`,e),()=>import.meta.hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?V(st,{MDXComponent:i,mdxComponents:r}):V(_t,{})},yt=()=>{let e=W();return V(e.NotFound||e[404]||Y,{})};function bt(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>V(B,{children:e})),c=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},l=[],u=n.versions?.defaultVersion,d=(n.base||`/docs`).replace(/\/$/,``),f=(n.base||`/docs`).replace(/\/$/,``);f||=`/`,u&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(d)?t.substring(d.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===u||n.startsWith(`${u}/`))){let t=`${d}/${u}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;l.push({...e,path:t,version:u})}});let p=[...t,...l],m=new Map,h=Object.keys(r);if(h.length>0){let e=h[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of h){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?m.set(i,e):m.set(r,e)}}let g=p.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=m.get(t),i=n?r[n]:null,a=c(e.path===``?`/`:e.path),s=a===f?`.`:a.startsWith(f+`/`)?a.slice(f.length+1):a;return{path:s,element:V(vt,{moduleKey:n,moduleLoader:i,route:e,components:o},n||s),loader:async()=>({path:s,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[s]}}),_=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],v=n.versions?.versions?.map(e=>e.path)||[],y=[];y.push({path:f,filter:()=>!0});let b=[];v.length>0&&v.forEach(e=>b.push(`/${e}`)),_.length>0&&_.forEach(e=>b.push(`/${e}`)),v.length>0&&_.length>0&&v.forEach(e=>{_.forEach(t=>{b.push(`/${e}/${t}`)})}),b.forEach(e=>{let t=f===`/`?e:`${f}${e}`;y.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let x=new Set(g.map(e=>(e.path||``).replace(/\/$/,``))),S=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;S.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{S.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),y.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(x.has(r)||S.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,o=a&&x.has(a.replace(/\/$/,``))?g.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):g.find(e=>t(e.path)&&e.path!==r);if(!o&&g.length>0&&(o=g[0]),o){let t=e===f?`.`:e.startsWith(f+`/`)?e.slice(f.length+1):e;g.push({path:t,element:o.element,loader:o.loader,getStaticPaths:()=>[]});let r=p.find(e=>{let t=c(e.path===``?`/`:e.path);return(t===f?`.`:t.startsWith(f+`/`)?t.slice(f.length+1):t)===o.path});if(r){let t=c(r.path),i=n.siteUrl?`${n.siteUrl.replace(/\/$/,``)}${t}`:t;p.push({...r,path:e,seo:{...r.seo,canonical:i}})}}}});let C=[{path:f,element:V(gt,{}),children:g}],w=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),C.push({path:r,element:V(s,{children:V(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n,title:e,filePath:``,headings:[]}),C.push({path:r,element:V(s,{children:V(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),C.push({path:`*`,element:V(s,{children:V(yt,{})})}),[{element:V(mt,{config:n,routes:[...p,...w],components:o}),children:C}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?xt(e):window.dataLayer?St(e):$()}function xt(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function St(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const Ct=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function wt(e={}){let{config:t,autoTrackPageViews:n=!0,autoTrackDownloads:r=!0,autoTrackExternalLinks:i=!0,excludePatterns:a=[]}=e,o=typeof globalThis<`u`?globalThis[Ct]:void 0,s=t??o?.integrations,c=R(()=>Q(s),[s]),l=Ee(``),u=oe();return L(()=>{if(!n||!c.isEnabled)return;let e=u.pathname+u.search;e!==l.current&&(l.current=e,c.trackPageView(e,document.title))},[u.pathname,n,c]),L(()=>{if(!r||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!a.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;c.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[r,i,c,a]),L(()=>{if(!i||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(a.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&c.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,c,a]),c}function Tt(){let e=R(()=>Q(),[]);return we((t,n)=>{e.trackPageView(t,n)},[e])}function Et(){let e=R(()=>Q(),[]);return we(t=>{e.trackEvent(t)},[e])}function Dt({children:e}){let{routes:t,currentRoute:n}=p(),r=x();return H(N,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[V(Ze,{}),H(N.Body,{className:`bg-main`,children:[V(it,{routes:t||[],config:r}),V(N.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:H(N.ContentMdx,{className:`max-w-3xl sm:max-w-4xl lg:max-w-4xl px-2 pt-8 pb-24`,children:[H(N.Header,{children:[H(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[V(Ie,{}),V(Re,{mdxRaw:n?._rawContent,route:n})]}),n?.title&&V(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:n.title}),n?.description&&V(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:n.description})]}),V(ze,{children:V(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:e})}),V(N.Footer,{children:V(nt,{})})]})}),V(et,{headings:n?.headings,editLink:r.theme?.editLink,communityHelp:r.theme?.communityHelp,filePath:n?.filePath})]})]})}const Ot=Object.assign(Dt,{Body:N.Body,Content:N.Content,ContentMdx:N.ContentMdx,Header:N.Header,Footer:N.Footer});export{mt as BoltdocsShell,Ie as Breadcrumbs,me as Card,pe as Cards,Re as CopyMarkdown,Ot as DocsLayout,ze as ErrorBoundary,st as MdxPage,Ze as Navbar,Y as NotFound,et as OnThisPage,nt as PageNav,ue as SearchDialog,it as Sidebar,ge as ViteReactSSG,T as cn,fe as copyToClipboard,bt as createRoutes,Be as getStarsRepo,G as getTranslated,de as reactToText,wt as useAnalytics,Fe as useBreadcrumbs,x as useConfig,Je as useI18n,_ as useLocalizedTo,oe as useLocation,W as useMdxComponents,K as useNavbar,tt as usePageNav,p as useRoutes,le as useSearch,ae as useSearchHighlight,ie as useSidebar,Ge as useTabs,P as useTheme,Et as useTrackEvent,Tt as useTrackPageView,O as useUI,qe as useVersion};
|
|
6
|
+
import{$ as e,B as t,C as n,F as r,H as i,J as a,K as o,L as s,O as c,Q as l,T as u,V as d,W as f,X as p,Y as m,Z as h,_ as g,b as _,et as v,j as y,k as b,nt as x,q as S,s as C,tt as w,w as ee,y as T}from"../icons-dev-B_RZIyxu.js";import{D as te,E as ne,M as E,N as D,T as O,_ as k,h as A,i as j,j as re,k as M,m as ie,n as ae,r as oe,t as N,w as se}from"../docs-layout-KoWNZc8_.js";import{c as ce,l as P}from"../image-CqKzYD8f.js";import{n as F}from"../search-dialog-D6BNohIJ.js";import{n as le,t as ue}from"../search-dialog-B584t9ZF.js";import{a as de,i as fe,n as pe,r as me,t as he}from"../mdx-DudBEac0.js";import{ViteReactSSG as ge}from"@bdocs/ssg";import{Outlet as _e,useLoaderData as ve,useLocation as I,useNavigate as ye}from"react-router-dom";import{Suspense as be,createContext as xe,lazy as Se,use as Ce,useCallback as we,useEffect as L,useLayoutEffect as Te,useMemo as R,useRef as Ee,useState as z}from"react";import{Fragment as B,jsx as V,jsxs as H}from"react/jsx-runtime";import{Button as De}from"react-aria-components";import Oe from"virtual:boltdocs-icons";import*as ke from"react-helmet-async";import Ae from"virtual:boltdocs-mdx-components";import je from"virtual:boltdocs-layout";const Me=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),U=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),Ne=globalThis[Me]||(globalThis[Me]=xe({}));function W(){let e=Ce(Ne);return(!e||Object.keys(e).length===0)&&globalThis[U]?globalThis[U]:e}function Pe({components:e,children:t}){let n=R(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[U]=n),V(Ne.Provider,{value:n,children:t})}function Fe(){let{currentRoute:e}=p(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}function Ie(){let{crumbs:e,activeRoute:t}=Fe();return e.length===0?null:H(D.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[V(D.Item,{children:V(D.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:V(r,{size:14})})}),e.map((e,n)=>{let r=e.href===t?.path;return H(D.Item,{className:`gap-2`,children:[V(D.Separator,{className:`text-muted/40`}),V(D.Link,{href:e.href,className:T(`transition-colors`,r?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:e.label})]},`crumb-${e.href}-${e.label}-${n}`)})]})}const Le=e=>{let[t,n]=z(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function Re({content:e,mdxRaw:t}){let n=t||e||``,{copied:r,handleCopy:i,handleOpenRaw:a}=Le(n);return n?V(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:H(re,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[V(E,{onPress:i,className:T(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,r&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":r?`Copied!`:`Copy Markdown`,children:V(r?ee:b,{size:14})}),H(E,{onPress:i,className:T(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,r&&`text-emerald-500 hover:bg-emerald-500/5`),children:[V(r?ee:b,{size:16}),r?`Copied!`:`Copy Markdown`]}),H(M.Trigger,{placement:`bottom end`,children:[V(E,{className:T(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:V(u,{size:14})}),H(M.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[H(M.Item,{onAction:i,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[V(b,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),V(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),H(M.Item,{onAction:a,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[V(y,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),V(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function ze({children:e,fallback:t}){return V(te,{fallback:t,children:e})}async function Be(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:Ve(i.stargazers_count)}const Ve=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function He({repo:e}){let[t,n]=z(null);return L(()=>{e&&Be(e).then(e=>n(e)).catch(()=>n(`0`))},[e]),H(`a`,{href:`https://github.com/${e}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[V(C,{className:`h-4 w-4 text-body`}),t!==null&&H(`span`,{className:`tabular-nums font-medium`,children:[t,` stars`]})]})}function G(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function K(){let e=x(),{theme:t,resolvedTheme:n}=P(),r=I(),{currentLocale:i}=p(),a=e.theme||{},o=G(a.title,i)||`Boltdocs`,s=a.navbar||[],c=a.socialLinks||[],l=a.githubRepo,u=R(()=>s.map(t=>{let n=t.href||t.to||t.link||``,a=t=>{let n=r.pathname;if(n===t)return!0;if(!t||t===`/`)return n===`/`;let i=t=>{let n=t.split(`/`).filter(Boolean),r=0;return e.i18n?.locales&&n[r]&&e.i18n.locales[n[r]]&&r++,e.versions?.versions&&n[r]&&e.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},a=i(t),o=i(n);return a.length===0?o.length===0:o.length<a.length?!1:a.every((e,t)=>o[t]===e)},o=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:G(e.label||e.text,i),href:t,active:a(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(t.items);return{label:G(t.label||t.text,i),href:n,active:a(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:o}}),[s,r.pathname,i,e]),d=a.logo;return{links:u,title:o,logo:d?typeof d==`string`?d:n===`dark`?d.dark:d.light:null,logoProps:{alt:(d&&typeof d==`object`?d.alt:void 0)||o,width:d&&typeof d==`object`?d.width:void 0,height:d&&typeof d==`object`?d.height:void 0},github:l?`https://github.com/${l}`:null,social:c,config:e,theme:t}}function Ue(){let{theme:e,setTheme:t}=P(),[n,r]=z(!1);if(L(()=>{r(!0)},[]),!n)return V(`div`,{className:`h-9 w-9`});let a=e===`system`?d:e===`dark`?i:o;return H(M.Trigger,{placement:`bottom right`,children:[V(De,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:V(a,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),H(M.Root,{selectionMode:`single`,selectedKeys:[e],onSelectionChange:e=>{let n=Array.from(e)[0];t(n)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[H(M.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[V(o,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`Light`})]}),H(M.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[V(i,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`Dark`})]}),H(M.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[V(d,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`System`})]})]})]})}function We({className:e}){let{theme:t,setTheme:n}=P(),[r,a]=z(!1);if(L(()=>{a(!0)},[]),!r)return V(`div`,{className:T(`h-10 w-full bg-surface rounded-xl animate-pulse`,e)});let s=t===`dark`;return H(`div`,{className:T(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,e),children:[V(`div`,{className:T(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,s?`translate-x-full`:`translate-x-0`)}),V(`button`,{onClick:()=>n(`light`),className:T(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,s?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:V(o,{size:18})}),V(`button`,{onClick:()=>n(`dark`),className:T(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,s?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:V(i,{size:18})})]})}function Ge(e=[],t=[]){let n=I(),r=Ee([]),[i,a]=z({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),o=h(n.pathname),s=t.find(e=>h(e.path)===o)?.tab?.toLowerCase(),c=e.findIndex(e=>e.id.toLowerCase()===s),l=c===-1?0:c;return L(()=>{let e=r.current[l];e&&a({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[l,e.length,n.pathname]),{tabs:e,activeIndex:l,indicatorStyle:i,tabRefs:r,activeTabId:s}}function Ke({tabs:e,routes:t}){let{currentLocale:n}=p(),{indicatorStyle:r,tabRefs:i,activeIndex:a}=Ge(e,t);L(()=>{let e=i.current[a];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[a]);let o=e=>{if(!e)return null;if(e.trim().startsWith(`<svg`))return V(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t={...m,...Oe},n=t[e]||t[e+`Icon`];return n?V(n,{size:16}):V(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return V(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:H(ne.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[e.map((e,r)=>{let s=r===a,c=t.find(t=>t.tab&&t.tab.toLowerCase()===e.id.toLowerCase());return H(g,{href:c?c.path:`#`,ref:e=>{i.current[r]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${s?`text-primary-500`:`text-muted hover:text-body`}`,children:[o(e.icon),V(`span`,{children:G(e.text,n)})]},e.id)}),V(ne.Indicator,{style:r,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function q(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function qe(){let t=ye(),n=x(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:o}=p(),s=n.versions,{setVersion:c}=e();return{currentVersion:a,currentVersionLabel:s?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:R(()=>s?s.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[s,a]),handleVersionChange:e=>{if(!s||e===a)return;c(e);let l=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${o?`/${o}`:``}`;if(i){let t=q(i.filePath,i.version,i.locale),a=r.find(r=>q(r.filePath,r.version,r.locale)===t&&(r.version||s.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===o));if(a)l=a.path;else{let t=r.find(t=>q(t.filePath,t.version,t.locale)===`index.md`&&(t.version||s.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===o));t&&(l=t.path)}}else{let t=r.find(t=>(t.version||s.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===o));t&&(l=t.path)}t(l)}}}function Je(){let t=ye(),n=x(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:o}=p(),s=n.i18n,{setLocale:c}=e(),l=e=>{if(!s||e===a)return;c(e);let l=n.base||`/`,u=l===`/`?``:l.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=q(i.filePath,i.version,i.locale),n=r.find(n=>q(n.filePath,n.version,n.locale)===t&&(n.locale||s.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>q(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||s.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${u}${i.version?`/${i.version}`:``}${e===s.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(s.locales)?s.locales.includes(n[0]):s.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===s.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||s.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(o||n.versions?.defaultVersion));if(t)f=t.path;else{let t=o&&o!==n.versions?.defaultVersion?`/${o}`:``;f=e===s.defaultLocale?`${u}${t}`:`${u}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},u=s?.locales,d=u?Array.isArray(u)?a:u[a]:void 0;return{currentLocale:a,currentLocaleLabel:s?.localeConfigs?.[a]?.label||d||a,availableLocales:R(()=>s?Array.isArray(s.locales)?s.locales.map(e=>({key:e,label:s?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(s.locales).map(([e,t])=>({key:e,label:s?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[s,a]),handleLocaleChange:l}}function J({className:e}){let{currentVersionLabel:t,availableVersions:n,handleVersionChange:r}=qe();return n.length===0?null:H(M.Trigger,{children:[H(E,{className:T(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[V(`span`,{className:`font-semibold text-[0.8125rem]`,children:t}),V(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),V(M.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:V(M.Section,{items:n,children:e=>V(M.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function Ye({className:e}){let{currentLocale:t,availableLocales:n,handleLocaleChange:r}=Je();return n.length===0?null:H(M.Trigger,{children:[H(E,{className:T(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[H(`div`,{className:`flex items-center gap-1.5`,children:[V(s,{className:`w-3.5 h-3.5 text-primary-500`}),V(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:t||`en`})]}),V(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),V(M.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:V(M.Section,{items:n,children:e=>V(M.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:V(`span`,{children:e.label})},`${e.value??``}`)})})]})}const Xe=Se(()=>import(`../search-dialog-ByvGScjt.js`).then(e=>({default:e.SearchDialog})));function Ze(){let{links:e,title:n,logo:r,logoProps:i,github:o,social:s,config:c}=K(),{routes:l,allRoutes:u,currentRoute:d,currentVersion:f,currentLocale:m}=p(),{pathname:h}=I(),{isSidebarOpen:g,toggleSidebar:_}=O(),[v,y]=z(!1),b=c.theme||{},x=!!d?.filePath,S=b?.tabs&&b.tabs.length>0;return H(F.Root,{className:T(`border-b border-subtle bg-main/80 backdrop-blur-md`,S&&`border-b-0`),children:[H(F.Content,{children:[H(F.Left,{children:[x&&V(E,{onPress:_,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":g?`Close sidebar`:`Open sidebar`,children:V(g?a:t,{className:`w-5 h-5 text-body`})}),r&&V(F.Logo,{src:r,alt:i?.alt||n,width:i?.width??24,height:i?.height??24,href:`site:/`}),V(F.Title,{href:`site:/`,children:n}),V(`div`,{className:`hidden sm:block`,children:c.versions&&f&&V(J,{})})]}),V(F.Center,{children:V(be,{fallback:V(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:V(Xe,{routes:l||[]})})}),H(F.Right,{children:[V(be,{fallback:null,children:V(`div`,{className:`lg:hidden`,children:V(Xe,{routes:l||[]})})}),V(F.Links,{children:e.map(e=>V(Qe,{link:e},e.href))}),H(`div`,{className:`hidden sm:flex items-center gap-2`,children:[c.i18n&&m&&V(Ye,{}),V(F.Split,{className:`bg-subtle`})]}),V(`div`,{className:`hidden md:block`,children:V(Ue,{})}),o&&V(`div`,{className:`hidden md:block`,children:V(He,{repo:b?.githubRepo??``})}),s.length>0&&V(`div`,{className:`hidden md:block`,children:V(F.Split,{className:`bg-subtle`})}),V(`div`,{className:`hidden md:flex items-center gap-1`,children:s.map(({icon:e,link:t})=>V(F.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),V(F.More,{onPress:()=>y(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),H(F.MobileMenu,{isOpen:v,onClose:()=>y(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[V(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>V($e,{link:e,onClose:()=>y(!1)},e.href))}),s.length>0&&H(`div`,{className:`mt-6`,children:[V(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),V(`div`,{className:`flex flex-wrap gap-2 px-2`,children:s.map(({icon:e,link:t})=>V(F.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),x&&S&&b?.tabs&&V(`div`,{className:`w-full border-b border-subtle bg-main`,children:V(Ke,{tabs:b.tabs,routes:u||l||[]})})]})}function Qe({link:e}){let t=_(e.href||``),{pathname:n}=I(),r=n===t||n.startsWith(t+`/`);return e.items&&e.items.length>0?V(F.Dropdown,{label:V(`span`,{className:T(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,r?`text-primary-500`:`text-muted hover:text-body`),children:e.label}),children:e.items?.map(e=>V(F.DropdownItem,{href:_(e.href||``),label:e.label},e.href))}):V(F.Link,{...e,href:t,active:r,className:T(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,r?`text-primary-500`:`text-muted hover:text-body`)})}function $e({link:e,onClose:t}){let n=_(e.href||``),{pathname:r}=I(),i=r===n;return e.items&&e.items.length>0?H(`div`,{className:`flex flex-col gap-1`,children:[V(`div`,{className:T(`px-3 py-2 text-sm transition-all`,i?`text-body`:`text-muted/80 hover:text-body`),children:e.label}),V(`div`,{className:`flex flex-col gap-1 pl-4`,children:e.items?.map(e=>V($e,{link:e,onClose:t},e.href))})]}):V(F.MobileLink,{...e,href:n,active:i,onPress:t,className:T(`transition-all`,i?`text-body`:`text-muted/80 hover:text-body`)})}function Y(){return V(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:H(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[V(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),H(`div`,{className:`space-y-2`,children:[V(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),V(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),H(g,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[V(n,{size:14}),` Go to Home`]})]})})}function et({headings:e=[],editLink:t,communityHelp:n,filePath:r}){return e.length===0?null:H(k.Root,{children:[H(k.Header,{className:`flex flex-row gap-x-2`,children:[V(S,{size:16}),`On this page`]}),V(k.Tree,{headings:e}),(t||n)&&H(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[V(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),H(`ul`,{className:`space-y-3`,children:[t&&r&&V(`li`,{children:H(`a`,{href:t.replace(`:path`,r),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[V(f,{size:16}),`Edit this page`]})}),n&&V(`li`,{children:H(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[V(c,{size:16}),`Community help`]})})]})]})]})}function tt(){let{routes:e,currentRoute:t}=p(),n=I();return R(()=>{if(!t)return{prevPage:null,nextPage:null,currentRoute:null};let r=t.tab?.toLowerCase(),i=r?e.filter(e=>e.tab?.toLowerCase()===r):e.filter(e=>!e.tab),a=i.findIndex(e=>e.path===n.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:t}},[e,t,n.pathname])}function nt(){let{prevPage:e,nextPage:t}=tt();return!e&&!t?null:H(A.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?H(A.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[V(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),V(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):V(`div`,{}),t?H(A.Link,{to:t.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[V(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),V(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:t.title})]}):V(`div`,{})]})}function rt({routes:e,config:t}){let{logo:n,title:r,logoProps:i}=K(),{closeSidebar:o}=O(),s=n?V(`img`,{src:n,alt:i?.alt||r,width:24,height:24,className:`rounded-xl`}):null,c=t.versions||t.i18n;return H(B,{children:[V(j.Root,{children:V(j.Content,{children:V(j.Items,{routes:e})})}),H(j.Mobile,{children:[H(j.Header,{children:[H(`div`,{className:`flex items-center gap-3`,children:[s,V(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:r})]}),H(`div`,{className:`flex items-center gap-2`,children:[V(We,{className:`w-24 h-9 rounded-xl`}),V(E,{onPress:o,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:V(a,{size:20})})]})]}),H(j.Content,{children:[c&&H(`div`,{className:`flex flex-col gap-4 mb-10`,children:[H(`div`,{className:`flex gap-3`,children:[t.versions&&V(J,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),t.i18n&&V(Ye,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),V(`div`,{className:`mt-2 border-b border-subtle`})]}),V(j.Items,{routes:e})]})]})]})}const it=Object.assign(rt,{Root:j.Root,Mobile:j.Mobile,Header:j.Header,Content:j.Content,Group:j.Group,Link:j.Link,SubGroup:j.SubGroup,Item:j.Item,Items:j.Items});function at({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return H(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[V(`span`,{}),H(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function ot({route:e,content:t,mdxComponents:n}){let r=W(),i=R(()=>({LastUpdated:at,...r,...n}),[r,n]),a=i.LastUpdated||at;return t?H(B,{children:[V(t,{components:i}),e?.lastUpdated&&V(a,{date:e.lastUpdated})]}):null}function st({MDXComponent:e,mdxComponents:t}){let n=ve(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?V(ot,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const X=ke,ct=X.Helmet||X.default?.Helmet||(({children:e})=>V(B,{children:e})),lt=X.HelmetProvider||X.default?.HelmetProvider||(({children:e})=>V(B,{children:e}));function ut(){let{pathname:e,hash:t}=I(),n=(e=`auto`)=>{let n=document.querySelector(`.boltdocs-content`)||window,r=()=>n===window?window.scrollY:n.scrollTop,i=(e,t)=>{n===window?window.scrollTo({top:e,behavior:t}):n.scrollTo({top:e,behavior:t})};if(t){let a=t.replace(`#`,``),o=document.getElementById(a);if(o){let t=n===window?0:n.getBoundingClientRect().top;return i(o.getBoundingClientRect().top-t-80+r(),e),!0}}return i(0,e),!1};return Te(()=>{n(`auto`)},[e,t]),L(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const dt={...he,NotFound:Y,404:Y};function Z(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function ft({config:t}){let{currentLocale:n}=e();return L(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function pt({config:t,routeMap:n}){let r=I(),{setLocale:i,setVersion:a}=e();return L(()=>{let e=Z(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function mt({config:e,routes:t,components:n={}}){let r=R(()=>({...dt,...Ae,...n}),[n]),{pathname:i}=I(),a=R(()=>Z(i||`/`),[i]),o=R(()=>{let e=new Map;for(let n of t){let t=Z(n.path===``?`/`:n.path);e.set(t,n)}return e},[t]),s=R(()=>{let t=o.get(a),n,r;return t&&(e.i18n&&(n=t.locale||e.i18n.defaultLocale),e.versions&&(r=t.version||e.versions.defaultVersion)),{initLocale:n,initVersion:r}},[a,e,o]);return V(lt,{children:V(v,{routes:t,children:V(ce,{children:V(se,{children:V(Pe,{components:r,children:H(w.Provider,{value:e,children:[V(ut,{}),H(l,{initialLocale:s.initLocale,initialVersion:s.initVersion,children:[V(pt,{config:e,routeMap:o}),V(ft,{config:e}),V(_e,{})]})]})})})})})})}function ht({siteTitle:e,siteDescription:t,routes:n}){let r=I(),i=x(),{currentLocale:a}=p(),o=R(()=>n?.find?.(e=>e.path===r.pathname),[n,r.pathname]),s=o?.title,c=G(t,a),l=o?.description||c||``,u=G(e,a),d=s?`${s} | ${u}`:u,f=o?.seo||{},m=i?.seo?.metatags||{},h=i?.seo?.thumbnails?.background,g=f[`og:image`]||h;return H(ct,{children:[V(`title`,{children:d}),V(`meta`,{name:`description`,content:l}),V(`meta`,{property:`og:title`,content:d}),V(`meta`,{property:`og:description`,content:l}),V(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&V(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&V(`link`,{rel:`canonical`,href:window.location.origin+r.pathname}),V(`meta`,{name:`twitter:card`,content:`summary`}),V(`meta`,{name:`twitter:title`,content:d}),V(`meta`,{name:`twitter:description`,content:l}),g&&V(`meta`,{name:`twitter:image`,content:g}),g&&V(`meta`,{property:`og:image`,content:g}),V(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(m).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?V(`meta`,{property:e,content:t},e):V(`meta`,{name:e,content:t},e)),Object.entries(f).map(([e,t])=>e===`noindex`&&t===!0?V(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?V(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?V(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?V(`meta`,{property:e,content:t},e):V(`meta`,{name:e,content:t},e))]})}function gt(){let e=x(),{currentRoute:t,allRoutes:n}=p();return H(B,{children:[V(ht,{siteTitle:e.theme?.title,siteDescription:e.theme?.description,routes:n||[]}),V(je,{route:t,children:V(_e,{})})]})}const _t=()=>V(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),vt=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return L(()=>{if(!import.meta.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return import.meta.hot.on(`boltdocs:mdx-update`,e),()=>import.meta.hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?V(st,{MDXComponent:i,mdxComponents:r}):V(_t,{})},yt=()=>{let e=W();return V(e.NotFound||e[404]||Y,{})};function bt(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>V(B,{children:e})),c=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},l=[],u=n.versions?.defaultVersion,d=(n.base||`/docs`).replace(/\/$/,``),f=(n.base||`/docs`).replace(/\/$/,``);f||=`/`,u&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(d)?t.substring(d.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===u||n.startsWith(`${u}/`))){let t=`${d}/${u}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;l.push({...e,path:t,version:u})}});let p=[...t,...l],m=new Map,h=Object.keys(r);if(h.length>0){let e=h[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of h){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?m.set(i,e):m.set(r,e)}}let g=p.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=m.get(t),i=n?r[n]:null,a=c(e.path===``?`/`:e.path),s=a===f?`.`:a.startsWith(f+`/`)?a.slice(f.length+1):a;return{path:s,element:V(vt,{moduleKey:n,moduleLoader:i,route:e,components:o},n||s),loader:async()=>({path:s,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[s]}}),_=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],v=n.versions?.versions?.map(e=>e.path)||[],y=[];y.push({path:f,filter:()=>!0});let b=[];v.length>0&&v.forEach(e=>b.push(`/${e}`)),_.length>0&&_.forEach(e=>b.push(`/${e}`)),v.length>0&&_.length>0&&v.forEach(e=>{_.forEach(t=>{b.push(`/${e}/${t}`)})}),b.forEach(e=>{let t=f===`/`?e:`${f}${e}`;y.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let x=new Set(g.map(e=>(e.path||``).replace(/\/$/,``))),S=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;S.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{S.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),y.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(x.has(r)||S.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,o=a&&x.has(a.replace(/\/$/,``))?g.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):g.find(e=>t(e.path)&&e.path!==r);if(!o&&g.length>0&&(o=g[0]),o){let t=e===f?`.`:e.startsWith(f+`/`)?e.slice(f.length+1):e,r=t===`.`;g.push({...r?{index:!0}:{path:t},element:o.element,loader:o.loader,getStaticPaths:()=>[]});let i=p.find(e=>{let t=c(e.path===``?`/`:e.path);return(t===f?`.`:t.startsWith(f+`/`)?t.slice(f.length+1):t)===o.path});if(i){let t=c(i.path),r=n.siteUrl?`${n.siteUrl.replace(/\/$/,``)}${t}`:t;p.push({...i,path:e,seo:{...i.seo,canonical:r}})}}}});let C=[{path:f,element:V(gt,{}),children:g}],w=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),C.push({path:r,element:V(s,{children:V(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n,title:e,filePath:``,headings:[]}),C.push({path:r,element:V(s,{children:V(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),C.push({path:`*`,element:V(s,{children:V(yt,{})})}),[{element:V(mt,{config:n,routes:[...p,...w],components:o}),children:C}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?xt(e):window.dataLayer?St(e):$()}function xt(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function St(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const Ct=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function wt(e={}){let{config:t,autoTrackPageViews:n=!0,autoTrackDownloads:r=!0,autoTrackExternalLinks:i=!0,excludePatterns:a=[]}=e,o=typeof globalThis<`u`?globalThis[Ct]:void 0,s=t??o?.integrations,c=R(()=>Q(s),[s]),l=Ee(``),u=oe();return L(()=>{if(!n||!c.isEnabled)return;let e=u.pathname+u.search;e!==l.current&&(l.current=e,c.trackPageView(e,document.title))},[u.pathname,n,c]),L(()=>{if(!r||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!a.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;c.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[r,i,c,a]),L(()=>{if(!i||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(a.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&c.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,c,a]),c}function Tt(){let e=R(()=>Q(),[]);return we((t,n)=>{e.trackPageView(t,n)},[e])}function Et(){let e=R(()=>Q(),[]);return we(t=>{e.trackEvent(t)},[e])}function Dt({children:e}){let{routes:t,currentRoute:n}=p(),r=x();return H(N,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[V(Ze,{}),H(N.Body,{className:`bg-main`,children:[V(it,{routes:t||[],config:r}),V(N.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:H(N.ContentMdx,{className:`max-w-3xl sm:max-w-4xl lg:max-w-4xl px-2 pt-8 pb-24`,children:[H(N.Header,{children:[H(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[V(Ie,{}),V(Re,{mdxRaw:n?._rawContent,route:n})]}),n?.title&&V(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:n.title}),n?.description&&V(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:n.description})]}),V(ze,{children:V(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:e})}),V(N.Footer,{children:V(nt,{})})]})}),V(et,{headings:n?.headings,editLink:r.theme?.editLink,communityHelp:r.theme?.communityHelp,filePath:n?.filePath})]})]})}const Ot=Object.assign(Dt,{Body:N.Body,Content:N.Content,ContentMdx:N.ContentMdx,Header:N.Header,Footer:N.Footer});export{mt as BoltdocsShell,Ie as Breadcrumbs,me as Card,pe as Cards,Re as CopyMarkdown,Ot as DocsLayout,ze as ErrorBoundary,st as MdxPage,Ze as Navbar,Y as NotFound,et as OnThisPage,nt as PageNav,ue as SearchDialog,it as Sidebar,ge as ViteReactSSG,T as cn,fe as copyToClipboard,bt as createRoutes,Be as getStarsRepo,G as getTranslated,de as reactToText,wt as useAnalytics,Fe as useBreadcrumbs,x as useConfig,Je as useI18n,_ as useLocalizedTo,oe as useLocation,W as useMdxComponents,K as useNavbar,tt as usePageNav,p as useRoutes,le as useSearch,ae as useSearchHighlight,ie as useSidebar,Ge as useTabs,P as useTheme,Et as useTrackEvent,Tt as useTrackPageView,O as useUI,qe as useVersion};
|
package/dist/node/cli-entry.cjs
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
const e=require(`../chunk-Ds5LZdWN.cjs`),t=require(`../routes-Co1mRM58.cjs`),n=require(`../node-
|
|
7
|
+
const e=require(`../chunk-Ds5LZdWN.cjs`),t=require(`../routes-Co1mRM58.cjs`),n=require(`../node-DWhzY9qh.cjs`),r=require(`../doctor-COpf35L2.cjs`);let i=require(`vite`),a=require(`node:path`);a=e.n(a);let o=require(`cac`);o=e.n(o);let s=require(`@bdocs/ssg/node`);async function c(e=process.cwd()){try{let t=await(0,s.createServer)(await n.n(e,`development`));await t.listen(),t.printUrls(),t.bindCLIShortcuts({print:!0})}catch(e){r.u(`Failed to start dev server:`,e),process.exit(1)}}async function l(e=process.cwd()){try{let i=await n.n(e,`production`),o=await r.p(`docs`,e),c=await t.t(a.default.resolve(e,`docs`),o,i.base),l={};for(let e of c)if(e.path&&e.componentPath){l[e.path]=e.componentPath;let t=e.path.replace(/\/$/,``);l[t]=e.componentPath}await(0,s.build)({entry:`boltdocs/entry`,routeToSourceFileMap:l,cacheDir:a.default.resolve(e,`.boltdocs`)},i),r.d(`SSG build completed successfully!`),process.exit(0)}catch(e){r.u(`Build failed:`,e),process.exit(1)}}async function u(e=process.cwd()){try{(await(0,i.preview)(await n.n(e,`production`))).printUrls()}catch(e){r.u(`Failed to start preview server:`,e),process.exit(1)}}const d=(0,o.default)(`boltdocs`);d.command(`[root]`,`Start development server`).alias(`dev`).action(c),d.command(`build [root]`,`Build for production`).action(l),d.command(`preview [root]`,`Preview production build`).action(u),d.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).action(async(e,t)=>{let{doctorAction:n}=await Promise.resolve().then(()=>require(`../doctor-BQiQhCTl.cjs`));await n(e,t)}),d.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await Promise.resolve().then(()=>require(`../generator-DGW6pkCC.cjs`));await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),d.help(),d.version(`2.0.0`),d.parse();
|
package/dist/node/cli-entry.mjs
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
import{i as e,o as t,r as n}from"../doctor-COxqQQQ8.mjs";import{t as r}from"../routes-D0KpEheM.mjs";import{n as i}from"../node-
|
|
7
|
+
import{i as e,o as t,r as n}from"../doctor-COxqQQQ8.mjs";import{t as r}from"../routes-D0KpEheM.mjs";import{n as i}from"../node-BXd1xgio.mjs";import{preview as a}from"vite";import o from"node:path";import s from"cac";import{build as c,createServer as l}from"@bdocs/ssg/node";async function u(e=process.cwd()){try{let t=await l(await i(e,`development`));await t.listen(),t.printUrls(),t.bindCLIShortcuts({print:!0})}catch(e){n(`Failed to start dev server:`,e),process.exit(1)}}async function d(a=process.cwd()){try{let n=await i(a,`production`),s=await t(`docs`,a),l=await r(o.resolve(a,`docs`),s,n.base),u={};for(let e of l)if(e.path&&e.componentPath){u[e.path]=e.componentPath;let t=e.path.replace(/\/$/,``);u[t]=e.componentPath}await c({entry:`boltdocs/entry`,routeToSourceFileMap:u,cacheDir:o.resolve(a,`.boltdocs`)},n),e(`SSG build completed successfully!`),process.exit(0)}catch(e){n(`Build failed:`,e),process.exit(1)}}async function f(e=process.cwd()){try{(await a(await i(e,`production`))).printUrls()}catch(e){n(`Failed to start preview server:`,e),process.exit(1)}}const p=s(`boltdocs`);p.command(`[root]`,`Start development server`).alias(`dev`).action(u),p.command(`build [root]`,`Build for production`).action(d),p.command(`preview [root]`,`Preview production build`).action(f),p.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).action(async(e,t)=>{let{doctorAction:n}=await import(`../doctor-COxqQQQ8.mjs`).then(e=>e.t);await n(e,t)}),p.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await import(`../generator-Dv3wEmhZ.mjs`);await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),p.help(),p.version(`2.0.0`),p.parse();export{};
|
package/dist/node/index.cjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../utils-Clzu7jvb.cjs`),t=require(`../node-
|
|
6
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../utils-Clzu7jvb.cjs`),t=require(`../node-DWhzY9qh.cjs`),n=require(`../doctor-COpf35L2.cjs`);exports.BoltdocsPluginStore=t.u,exports.PluginCompatibilityError=t.d,exports.PluginError=t.f,exports.PluginHookError=t.p,exports.PluginLifecycleManager=t.a,exports.PluginPermissionError=t.m,exports.PluginSandbox=t.o,exports.PluginValidationError=t.h,exports.SecurePluginSchema=t.s,exports.createPlugin=t.i,exports.createViteConfig=t.n,exports.default=t.t,exports.defineConfig=n.h,exports.generateEntryCode=t.r,exports.hasPermission=t.c,exports.normalizePath=e.l,exports.resolveConfig=n.p,exports.sanitizeFilename=e.d,exports.validatePlugins=t.l;
|
package/dist/node/index.mjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{c as e,o as t}from"../doctor-COxqQQQ8.mjs";import{d as n,l as r}from"../utils-BxNAXhZZ.mjs";import{a as i,c as a,d as o,f as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"../node-
|
|
6
|
+
import{c as e,o as t}from"../doctor-COxqQQQ8.mjs";import{d as n,l as r}from"../utils-BxNAXhZZ.mjs";import{a as i,c as a,d as o,f as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"../node-BXd1xgio.mjs";export{v as BoltdocsPluginStore,o as PluginCompatibilityError,s as PluginError,m as PluginHookError,i as PluginLifecycleManager,d as PluginPermissionError,p as PluginSandbox,c as PluginValidationError,g as SecurePluginSchema,l as createPlugin,f as createViteConfig,_ as default,e as defineConfig,h as generateEntryCode,a as hasPermission,r as normalizePath,t as resolveConfig,n as sanitizeFilename,u as validatePlugins};
|
|
@@ -104,7 +104,7 @@ export const createRoot = ViteReactSSG(
|
|
|
104
104
|
const mdxComponents = components.default || components;
|
|
105
105
|
export default mdxComponents;
|
|
106
106
|
export * from '${e}';`}return`export default {};`}if(c===`layout`){let e=[`tsx`,`jsx`],t=null;for(let n of e){let e=v.resolve(r,`layout.${n}`);if(x.existsSync(e)){t=e;break}}if(t)return`import UserLayout from '${a(t)}';
|
|
107
|
-
export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(c===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],t=null;for(let n of e){let e=v.resolve(r,`icons.${n}`);if(x.existsSync(e)){t=e;break}}return t?`import * as icons from '${a(t)}';\nexport default icons;`:`export default {};`}if(c===`search`){if(!V){let e=Ie(await f(r,s));V=`export default ${JSON.stringify(e,null,2)};`}return V}if(c===`client`){let e=L,t=``;for(;e&&e!==v.parse(e).root;){let n=v.join(e,`src/client/index.ts`),r=v.join(e,`dist/client/index.mjs`),i=v.join(e,`client/index.ts`);if(x.existsSync(n)){t=a(n);break}if(x.existsSync(r)){t=a(r);break}if(x.existsSync(i)){t=a(i);break}e=v.dirname(e)}if(!t)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${L}`);return`export * from '${t}';`}}}}const ze={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Be(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const H=new Map;async function Ve(e){try{let{data:t}=await c(e),n=JSON.stringify(t);return S.createHash(`md5`).update(n).digest(`hex`)}catch{return``}}function He(e){return H.get(e)}function Ue(e,t){H.set(e,t)}function We(e){H.delete(e)}function U(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ge(r,i,o,c,l){let f=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(c){let p=l();await p?.runHook(`beforeDev`),n(r,process.cwd(),o()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:e}=await import(`./routes-D0KpEheM.mjs`).then(e=>e.r),t=await e(r,o());for(let e of t)if(e.filePath){let t=v.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await c.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),c.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(ze).forEach(([e,n])=>{t.setHeader(e,n)});let r=o();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Be(r)),n()}),c.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),c.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,a=o(),s=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(r);if(i.includes(`text/html`)&&!s){let n=T(a);n=E(n,a),n=await c.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let m=e.map(e=>v.resolve(process.cwd(),e)),h=[`tsx`,`jsx`].map(e=>v.resolve(r,`layout.${e}`)),g=[`tsx`,`ts`,`jsx`,`js`],ee=g.map(e=>v.resolve(r,`mdx-components.${e}`)),_=g.map(e=>v.resolve(r,`pages-external/index.${e}`)),y=g.map(e=>v.resolve(r,`icons.${e}`));c.watcher.add([...m,...ee,...h,..._,...y]);let b=async(l,p)=>{try{let m=a(l);if(e.some(e=>m.endsWith(e))){c.restart();return}if(g.some(e=>m.endsWith(`mdx-components.${e}`))){t(o(),r),U(c,`mdx-components.tsx`),c.ws.send({type:`full-reload`});return}if(g.some(e=>m.endsWith(`icons.${e}`))){U(c,`icons.tsx`),c.ws.send({type:`full-reload`});return}if(m.endsWith(`layout.tsx`)||m.endsWith(`layout.jsx`)){U(c,`layout.tsx`),c.ws.send({type:`full-reload`});return}if(m.includes(`/pages-external/`)||m.includes(`\\pages-external\\`)){U(c,`entry`),c.ws.send({type:`full-reload`});return}if(!m.toLowerCase().startsWith(i.toLowerCase())||!s(m))return;if(p===`add`||p===`unlink`){p===`unlink`&&We(l),d(),Le();let e=o();t(e,r),U(c,`config`),U(c,`routes`),U(c,`search`),n(r,process.cwd(),e).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),c.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:e?.theme,i18n:e?.i18n,versions:e?.versions,siteUrl:e?.siteUrl}}),c.ws.send({type:`full-reload`});return}f.has(m)&&clearTimeout(f.get(m)),f.set(m,setTimeout(async()=>{f.delete(m);try{let e=He(l),t=await Ve(l);Ue(l,t),u(l),e!==void 0&&e!==t&&(U(c,`routes`),U(c,`search`));let n=a(v.relative(r,l)),i=c.moduleGraph.getModulesByFile(m);if(i)for(let e of i)c.moduleGraph.invalidateModule(e);c.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:m,relPath:n}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${p} event:`,e)}};c.watcher.on(`add`,e=>b(e,`add`)),c.watcher.on(`unlink`,e=>b(e,`unlink`)),c.watcher.on(`change`,e=>b(e,`change`)),await p?.runHook(`afterDev`)},handleHotUpdate({file:e,server:t}){let n=a(e);if(n.toLowerCase().startsWith(i.toLowerCase())&&s(n))return[]}}}const W=p.createRequire(import.meta.url);function Ke(e){let t=v.dirname(e);for(;t&&t!==v.dirname(t);){let e=v.join(t,`package.json`);if(x.existsSync(e))return e;t=v.dirname(t)}return null}function qe(e){let t=e.split(`/`);return e.startsWith(`@`)?{packageName:t.slice(0,2).join(`/`),subpath:t.slice(2).join(`/`)}:{packageName:t[0],subpath:t.slice(1).join(`/`)}}function G(e,t=W){try{let{packageName:n,subpath:r}=qe(e),i;try{i=t.resolve(n+`/package.json`)}catch{i=Ke(t.resolve(n))||``}if(!i)throw Error(`Could not find package.json for ${n}`);let a=v.dirname(i),o=JSON.parse(x.readFileSync(i,`utf-8`)),s=``,c=r?`./`+r:`.`;if(o.exports){let e=o.exports[c]||o.exports[r];e&&(s=typeof e==`string`?e:e.import||e.default||e.require||e)}if(!s&&!r&&(s=o.module||o.main||`index.js`),typeof s==`object`&&(s=s.import||s.default||s.require||``),s){let e=v.resolve(a,s);if(x.existsSync(e))return e}}catch{}return t.resolve(e)}function Je(){let e=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`],t=[],n=W;try{let e=v.join(process.cwd(),`node_modules/boltdocs/package.json`);if(x.existsSync(e)){let t=x.realpathSync(e);n=p.createRequire(t)}else n=p.createRequire(v.join(process.cwd(),`package.json`))}catch{}for(let r of e)try{let e=``;e=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(r,n):n.resolve(r),e&&t.push(x.realpathSync(e))}catch{}if(n!==W)for(let n of e)try{let e=``;e=n===`@bdocs/ssg`||n===`react-router-dom`||n===`react-helmet-async`?G(n,W):W.resolve(n),e&&t.push(x.realpathSync(e))}catch{}for(let e of[`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`]){try{t.push(x.realpathSync(n.resolve(e)))}catch{}if(n!==W)try{t.push(x.realpathSync(W.resolve(e)))}catch{}}return Array.from(new Set(t)).map(e=>a(e))}function Ye(e={},t){let n=v.resolve(process.cwd(),e.docsDir||`docs`),i=a(n),o=t,s,c=!1,l,u=[],d=()=>o;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){c=t.command===`build`;let i=!!(t.ssrBuild||t.ssr||e.build?.ssr),a=e.envDir||process.cwd(),s=ee(t.mode,a,``);Object.assign(process.env,s),o||=await r(n);let d=(await import(`./package-D-7aOtPv.mjs`)).version,p=P(o.plugins||[],d);return o.plugins=p,l=new Ne(p,o),u=p.flatMap(e=>I.getSanitizedCapabilities(e).vitePlugins||[]),c&&await l.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=je(w(await f(n,o)),o);t&&x.writeFileSync(v.join(e,`sitemap.xml`),t);let r=Me(o);x.writeFileSync(v.join(e,`robots.txt`),r)}},build:{ssrManifest:c},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`,`react-fast-compare`,`invariant`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{alias:[{find:`react-router-dom`,replacement:G(`react-router-dom`)},{find:`react-helmet-async`,replacement:G(`react-helmet-async`)},{find:`@bdocs/ssg`,replacement:G(`@bdocs/ssg`)}],dedupe:[`react`,`react-dom`,...i?[]:[`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]]},ssr:{external:[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...Je()],optimizeDeps:{include:[`react-fast-compare`,`invariant`]},noExternal:[]}}},configResolved(e){s=e,l?.runHook(`configResolved`,o)},resolveId(e,t,n){let r=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`].find(t=>e===t||e.startsWith(t+`/`)||e.includes(`/node_modules/${t}/`)||t.startsWith(`@`)&&e.includes(`/node_modules/${t.replace(`/`,v.sep)}/`));if(r&&n?.ssr){let t=e;if(!v.isAbsolute(e)){let n=W;try{let e=v.join(process.cwd(),`node_modules/boltdocs/package.json`);if(x.existsSync(e)){let t=x.realpathSync(e);n=p.createRequire(t)}else n=p.createRequire(v.join(process.cwd(),`package.json`))}catch{}try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(e,n):n.resolve(e)}catch{try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(e,W):W.resolve(e)}catch{}}}try{t=x.realpathSync(t)}catch{}return{id:t,external:!0}}return null},transformIndexHtml:{order:`pre`,handler(e){return E(e,o)}},async buildEnd(){let{pool:e}=await import(`./worker-pool-Bd8Y9KDv.mjs`);await e.terminate()},async closeBundle(){!c||s?.build?.ssr||(await l?.runHook(`afterBuild`),await l?.runHook(`buildEnd`))}},Re(e,d,()=>s,n),Ge(n,i,d,e=>{o=e},()=>l),{...te({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...u]}const K=new l(`mdx`),Xe=[de.default||de,fe.default||fe,pe.default||pe,me.default||me,he.default||he,ge.default||ge,_e.default||_e],Ze=[ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae];let Qe=null,q=null;const $e=()=>(Qe??=le(),Qe),et=async e=>q||(q=ue({themes:Xe,langs:Ze,engine:$e()}),q),J={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},tt={PRE:`pre`,CODE:`code`},Y={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},X={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},nt={LIGHT:`github-light`,DARK:`github-dark`},Z={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},rt=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,X.LINE_NUMBERS)}}},it=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,X.WORD_WRAP)}}},at=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Y.TITLE]=t)}}),ot=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Y.LANG]=this.options.lang||Z.LANG}});function st(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var ct=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:nt.LIGHT,dark:nt.DARK}}async getHighlighter(){return await et(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=st(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||Z.LANG,meta:{__raw:i,...r},transformers:[rt(),it(),at(),ot()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${X.FALLBACK}"><code>${lt(e)}</code></pre>`}}};function lt(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}let Q=null,ut;function dt(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Q===null||ut!==t)&&(Q=new ct(e),ut=t),Q}function ft(e){let t=dt(e);return async e=>{let n=await t.getHighlighter();ce(e,J.ELEMENT,e=>{if(e.tagName===tt.PRE&&e.children?.[0]?.type===J.ELEMENT&&e.children[0].tagName===tt.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):Z.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=st(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${X.FALLBACK}"><code>${lt(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Y.TITLE]=s.title),e.properties[Y.HIGHLIGHTED]=`true`,e.properties[Y.HIGHLIGHTED_HTML]=l,e.properties[Y.LANG]=a,e.children=[]}})}}function pt(){return e=>{ce(e,J.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let mt=!1;function $(e,t=ie){let n=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[ae,oe,pt,...n],rehypePlugins:[se,[ft,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){mt||=(await K.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${S.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await K.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
|
|
107
|
+
export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(c===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],t=null;for(let n of e){let e=v.resolve(r,`icons.${n}`);if(x.existsSync(e)){t=e;break}}return t?`import * as icons from '${a(t)}';\nexport default icons;`:`export default {};`}if(c===`search`){if(!V){let e=Ie(await f(r,s));V=`export default ${JSON.stringify(e,null,2)};`}return V}if(c===`client`){let e=L,t=``;for(;e&&e!==v.parse(e).root;){let n=v.join(e,`src/client/index.ts`),r=v.join(e,`dist/client/index.mjs`),i=v.join(e,`client/index.ts`);if(x.existsSync(n)){t=a(n);break}if(x.existsSync(r)){t=a(r);break}if(x.existsSync(i)){t=a(i);break}e=v.dirname(e)}if(!t)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${L}`);return`export * from '${t}';`}}}}const ze={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Be(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const H=new Map;async function Ve(e){try{let{data:t}=await c(e),n=JSON.stringify(t);return S.createHash(`md5`).update(n).digest(`hex`)}catch{return``}}function He(e){return H.get(e)}function Ue(e,t){H.set(e,t)}function We(e){H.delete(e)}function U(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ge(r,i,o,c,l){let f=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(c){let p=l();await p?.runHook(`beforeDev`),n(r,process.cwd(),o()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:e}=await import(`./routes-D0KpEheM.mjs`).then(e=>e.r),t=await e(r,o());for(let e of t)if(e.filePath){let t=v.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await c.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),c.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(ze).forEach(([e,n])=>{t.setHeader(e,n)});let r=o();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Be(r)),n()}),c.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),c.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,a=o(),s=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(r);if(i.includes(`text/html`)&&!s){let n=T(a);n=E(n,a),n=await c.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let m=e.map(e=>v.resolve(process.cwd(),e)),h=[`tsx`,`jsx`].map(e=>v.resolve(r,`layout.${e}`)),g=[`tsx`,`ts`,`jsx`,`js`],ee=g.map(e=>v.resolve(r,`mdx-components.${e}`)),_=g.map(e=>v.resolve(r,`pages-external/index.${e}`)),y=g.map(e=>v.resolve(r,`icons.${e}`));c.watcher.add([...m,...ee,...h,..._,...y]);let b=async(l,p)=>{try{let m=a(l);if(e.some(e=>m.endsWith(e))){c.restart();return}if(g.some(e=>m.endsWith(`mdx-components.${e}`))){t(o(),r),U(c,`mdx-components.tsx`),c.ws.send({type:`full-reload`});return}if(g.some(e=>m.endsWith(`icons.${e}`))){U(c,`icons.tsx`),c.ws.send({type:`full-reload`});return}if(m.endsWith(`layout.tsx`)||m.endsWith(`layout.jsx`)){U(c,`layout.tsx`),c.ws.send({type:`full-reload`});return}if(m.includes(`/pages-external/`)||m.includes(`\\pages-external\\`)){U(c,`entry`),c.ws.send({type:`full-reload`});return}if(!m.toLowerCase().startsWith(i.toLowerCase())||!s(m))return;if(p===`add`||p===`unlink`){p===`unlink`&&We(l),d(),Le();let e=o();t(e,r),U(c,`config`),U(c,`routes`),U(c,`search`),n(r,process.cwd(),e).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),c.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:e?.theme,i18n:e?.i18n,versions:e?.versions,siteUrl:e?.siteUrl}}),c.ws.send({type:`full-reload`});return}f.has(m)&&clearTimeout(f.get(m)),f.set(m,setTimeout(async()=>{f.delete(m);try{let e=He(l),t=await Ve(l);Ue(l,t),u(l),e!==void 0&&e!==t&&(U(c,`routes`),U(c,`search`));let n=a(v.relative(r,l)),i=c.moduleGraph.getModulesByFile(m);if(i)for(let e of i)c.moduleGraph.invalidateModule(e);c.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:m,relPath:n}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${p} event:`,e)}};c.watcher.on(`add`,e=>b(e,`add`)),c.watcher.on(`unlink`,e=>b(e,`unlink`)),c.watcher.on(`change`,e=>b(e,`change`)),await p?.runHook(`afterDev`)},handleHotUpdate({file:e,server:t}){let n=a(e);if(n.toLowerCase().startsWith(i.toLowerCase())&&s(n))return[]}}}const W=p.createRequire(import.meta.url);function Ke(e){let t=v.dirname(e);for(;t&&t!==v.dirname(t);){let e=v.join(t,`package.json`);if(x.existsSync(e))return e;t=v.dirname(t)}return null}function qe(e){let t=e.split(`/`);return e.startsWith(`@`)?{packageName:t.slice(0,2).join(`/`),subpath:t.slice(2).join(`/`)}:{packageName:t[0],subpath:t.slice(1).join(`/`)}}function G(e,t=W){try{let{packageName:n,subpath:r}=qe(e),i;try{i=t.resolve(n+`/package.json`)}catch{i=Ke(t.resolve(n))||``}if(!i)throw Error(`Could not find package.json for ${n}`);let a=v.dirname(i),o=JSON.parse(x.readFileSync(i,`utf-8`)),s=``,c=r?`./`+r:`.`;if(o.exports){let e=o.exports[c]||o.exports[r];e&&(s=typeof e==`string`?e:e.import||e.default||e.require||e)}if(!s&&!r&&(s=o.module||o.main||`index.js`),typeof s==`object`&&(s=s.import||s.default||s.require||``),s){let e=v.resolve(a,s);if(x.existsSync(e))return e}}catch{}return t.resolve(e)}function Je(){let e=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`],t=[],n=W;try{let e=v.join(process.cwd(),`node_modules/boltdocs/package.json`);if(x.existsSync(e)){let t=x.realpathSync(e);n=p.createRequire(t)}else n=p.createRequire(v.join(process.cwd(),`package.json`))}catch{}for(let r of e)try{let e=``;e=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(r,n):n.resolve(r),e&&t.push(x.realpathSync(e))}catch{}if(n!==W)for(let n of e)try{let e=``;e=n===`@bdocs/ssg`||n===`react-router-dom`||n===`react-helmet-async`?G(n,W):W.resolve(n),e&&t.push(x.realpathSync(e))}catch{}for(let e of[`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`]){try{t.push(x.realpathSync(n.resolve(e)))}catch{}if(n!==W)try{t.push(x.realpathSync(W.resolve(e)))}catch{}}return Array.from(new Set(t)).map(e=>a(e))}function Ye(e={},t){let n=v.resolve(process.cwd(),e.docsDir||`docs`),i=a(n),o=t,s,c=!1,l,u=[],d=()=>o;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){c=t.command===`build`;let i=!!(t.ssrBuild||t.ssr||e.build?.ssr),a=e.envDir||process.cwd(),s=ee(t.mode,a,``);Object.assign(process.env,s),o||=await r(n);let d=(await import(`./package-DGLEx5yT.mjs`)).version,p=P(o.plugins||[],d);return o.plugins=p,l=new Ne(p,o),u=p.flatMap(e=>I.getSanitizedCapabilities(e).vitePlugins||[]),c&&await l.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`flat`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=je(w(await f(n,o)),o);t&&x.writeFileSync(v.join(e,`sitemap.xml`),t);let r=Me(o);x.writeFileSync(v.join(e,`robots.txt`),r)}},build:{ssrManifest:c},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`,`react-fast-compare`,`invariant`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{alias:[{find:`react-router-dom`,replacement:G(`react-router-dom`)},{find:`react-helmet-async`,replacement:G(`react-helmet-async`)},{find:`@bdocs/ssg`,replacement:G(`@bdocs/ssg`)}],dedupe:[`react`,`react-dom`,...i?[]:[`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]]},ssr:{external:[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...Je()],optimizeDeps:{include:[`react-fast-compare`,`invariant`]},noExternal:[]}}},configResolved(e){s=e,l?.runHook(`configResolved`,o)},resolveId(e,t,n){let r=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`].find(t=>e===t||e.startsWith(t+`/`)||e.includes(`/node_modules/${t}/`)||t.startsWith(`@`)&&e.includes(`/node_modules/${t.replace(`/`,v.sep)}/`));if(r&&n?.ssr){let t=e;if(!v.isAbsolute(e)){let n=W;try{let e=v.join(process.cwd(),`node_modules/boltdocs/package.json`);if(x.existsSync(e)){let t=x.realpathSync(e);n=p.createRequire(t)}else n=p.createRequire(v.join(process.cwd(),`package.json`))}catch{}try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(e,n):n.resolve(e)}catch{try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(e,W):W.resolve(e)}catch{}}}try{t=x.realpathSync(t)}catch{}return{id:t,external:!0}}return null},transformIndexHtml:{order:`pre`,handler(e){return E(e,o)}},async buildEnd(){let{pool:e}=await import(`./worker-pool-Bd8Y9KDv.mjs`);await e.terminate()},async closeBundle(){!c||s?.build?.ssr||(await l?.runHook(`afterBuild`),await l?.runHook(`buildEnd`))},configurePreviewServer(e){let t=s?.build?.outDir?v.resolve(s.root||process.cwd(),s.build.outDir):v.resolve(process.cwd(),`dist`);e.middlewares.use((e,n,r)=>{let i=e.url||`/`,a=i.split(`?`)[0].split(`#`)[0];if(v.extname(a))return r();let o=a.replace(/\/$/,``)||`/`,s=v.join(t,o,`index.html`);o!==`/`&&x.existsSync(s)&&(e.url=`${o}/index.html${i.includes(`?`)?`?${i.split(`?`)[1]}`:``}`),r()})}},Re(e,d,()=>s,n),Ge(n,i,d,e=>{o=e},()=>l),{...te({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...u]}const K=new l(`mdx`),Xe=[de.default||de,fe.default||fe,pe.default||pe,me.default||me,he.default||he,ge.default||ge,_e.default||_e],Ze=[ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae];let Qe=null,q=null;const $e=()=>(Qe??=le(),Qe),et=async e=>q||(q=ue({themes:Xe,langs:Ze,engine:$e()}),q),J={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},tt={PRE:`pre`,CODE:`code`},Y={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},X={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},nt={LIGHT:`github-light`,DARK:`github-dark`},Z={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},rt=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,X.LINE_NUMBERS)}}},it=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,X.WORD_WRAP)}}},at=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Y.TITLE]=t)}}),ot=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Y.LANG]=this.options.lang||Z.LANG}});function st(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var ct=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:nt.LIGHT,dark:nt.DARK}}async getHighlighter(){return await et(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=st(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||Z.LANG,meta:{__raw:i,...r},transformers:[rt(),it(),at(),ot()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${X.FALLBACK}"><code>${lt(e)}</code></pre>`}}};function lt(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}let Q=null,ut;function dt(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Q===null||ut!==t)&&(Q=new ct(e),ut=t),Q}function ft(e){let t=dt(e);return async e=>{let n=await t.getHighlighter();ce(e,J.ELEMENT,e=>{if(e.tagName===tt.PRE&&e.children?.[0]?.type===J.ELEMENT&&e.children[0].tagName===tt.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):Z.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=st(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${X.FALLBACK}"><code>${lt(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Y.TITLE]=s.title),e.properties[Y.HIGHLIGHTED]=`true`,e.properties[Y.HIGHLIGHTED_HTML]=l,e.properties[Y.LANG]=a,e.children=[]}})}}function pt(){return e=>{ce(e,J.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let mt=!1;function $(e,t=ie){let n=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[ae,oe,pt,...n],rehypePlugins:[se,[ft,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){mt||=(await K.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${S.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await K.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
|
|
108
108
|
if (import.meta.hot) {
|
|
109
109
|
import.meta.hot.accept();
|
|
110
110
|
}
|
|
@@ -104,7 +104,7 @@ export const createRoot = ViteReactSSG(
|
|
|
104
104
|
const mdxComponents = components.default || components;
|
|
105
105
|
export default mdxComponents;
|
|
106
106
|
export * from '${e}';`}return`export default {};`}if(u===`layout`){let e=[`tsx`,`jsx`],n=null;for(let t of e){let e=c.default.resolve(a,`layout.${t}`);if(d.default.existsSync(e)){n=e;break}}if(n)return`import UserLayout from '${t.l(n)}';
|
|
107
|
-
export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(u===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],n=null;for(let t of e){let e=c.default.resolve(a,`icons.${t}`);if(d.default.existsSync(e)){n=e;break}}return n?`import * as icons from '${t.l(n)}';\nexport default icons;`:`export default {};`}if(u===`search`){if(!W){let e=xe(await r.t(a,l));W=`export default ${JSON.stringify(e,null,2)};`}return W}if(u===`client`){let e=__dirname,n=``;for(;e&&e!==c.default.parse(e).root;){let r=c.default.join(e,`src/client/index.ts`),i=c.default.join(e,`dist/client/index.mjs`),a=c.default.join(e,`client/index.ts`);if(d.default.existsSync(r)){n=t.l(r);break}if(d.default.existsSync(i)){n=t.l(i);break}if(d.default.existsSync(a)){n=t.l(a);break}e=c.default.dirname(e)}if(!n)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${__dirname}`);return`export * from '${n}';`}}}}const we={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Te(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const G=new Map;async function Ee(e){try{let{data:n}=await t.u(e),r=JSON.stringify(n);return f.default.createHash(`md5`).update(r).digest(`hex`)}catch{return``}}function De(e){return G.get(e)}function Oe(e,t){G.set(e,t)}function ke(e){G.delete(e)}function K(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ae(e,n,a,o,s){let l=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(o){let u=s();await u?.runHook(`beforeDev`),i.s(e,process.cwd(),a()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:t}=await Promise.resolve().then(()=>require(`./routes-CHf76Ye4.cjs`)),n=await t(e,a());for(let e of n)if(e.filePath){let t=c.default.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await o.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),o.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(we).forEach(([e,n])=>{t.setHeader(e,n)});let r=a();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Te(r)),n()}),o.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),o.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,s=a(),c=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(r);if(i.includes(`text/html`)&&!c){let n=de(s);n=fe(n,s),n=await o.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let d=i.f.map(e=>c.default.resolve(process.cwd(),e)),f=[`tsx`,`jsx`].map(t=>c.default.resolve(e,`layout.${t}`)),p=[`tsx`,`ts`,`jsx`,`js`],m=p.map(t=>c.default.resolve(e,`mdx-components.${t}`)),h=p.map(t=>c.default.resolve(e,`pages-external/index.${t}`)),g=p.map(t=>c.default.resolve(e,`icons.${t}`));o.watcher.add([...d,...m,...f,...h,...g]);let _=async(s,u)=>{try{let d=t.l(s);if(i.f.some(e=>d.endsWith(e))){o.restart();return}if(p.some(e=>d.endsWith(`mdx-components.${e}`))){i.g(a(),e),K(o,`mdx-components.tsx`),o.ws.send({type:`full-reload`});return}if(p.some(e=>d.endsWith(`icons.${e}`))){K(o,`icons.tsx`),o.ws.send({type:`full-reload`});return}if(d.endsWith(`layout.tsx`)||d.endsWith(`layout.jsx`)){K(o,`layout.tsx`),o.ws.send({type:`full-reload`});return}if(d.includes(`/pages-external/`)||d.includes(`\\pages-external\\`)){K(o,`entry`),o.ws.send({type:`full-reload`});return}if(!d.toLowerCase().startsWith(n.toLowerCase())||!t.s(d))return;if(u===`add`||u===`unlink`){u===`unlink`&&ke(s),r.n(),Se();let t=a();i.g(t,e),K(o,`config`),K(o,`routes`),K(o,`search`),i.s(e,process.cwd(),t).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),o.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:t?.theme,i18n:t?.i18n,versions:t?.versions,siteUrl:t?.siteUrl}}),o.ws.send({type:`full-reload`});return}l.has(d)&&clearTimeout(l.get(d)),l.set(d,setTimeout(async()=>{l.delete(d);try{let n=De(s),i=await Ee(s);Oe(s,i),r.r(s),n!==void 0&&n!==i&&(K(o,`routes`),K(o,`search`));let a=t.l(c.default.relative(e,s)),l=o.moduleGraph.getModulesByFile(d);if(l)for(let e of l)o.moduleGraph.invalidateModule(e);o.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:d,relPath:a}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${u} event:`,e)}};o.watcher.on(`add`,e=>_(e,`add`)),o.watcher.on(`unlink`,e=>_(e,`unlink`)),o.watcher.on(`change`,e=>_(e,`change`)),await u?.runHook(`afterDev`)},handleHotUpdate({file:e,server:r}){let i=t.l(e);if(i.toLowerCase().startsWith(n.toLowerCase())&&t.s(i))return[]}}}const q=g.createRequire(require(`url`).pathToFileURL(__filename).href);function je(e){let t=c.default.dirname(e);for(;t&&t!==c.default.dirname(t);){let e=c.default.join(t,`package.json`);if(d.default.existsSync(e))return e;t=c.default.dirname(t)}return null}function Me(e){let t=e.split(`/`);return e.startsWith(`@`)?{packageName:t.slice(0,2).join(`/`),subpath:t.slice(2).join(`/`)}:{packageName:t[0],subpath:t.slice(1).join(`/`)}}function J(e,t=q){try{let{packageName:n,subpath:r}=Me(e),i;try{i=t.resolve(n+`/package.json`)}catch{i=je(t.resolve(n))||``}if(!i)throw Error(`Could not find package.json for ${n}`);let a=c.default.dirname(i),o=JSON.parse(d.default.readFileSync(i,`utf-8`)),s=``,l=r?`./`+r:`.`;if(o.exports){let e=o.exports[l]||o.exports[r];e&&(s=typeof e==`string`?e:e.import||e.default||e.require||e)}if(!s&&!r&&(s=o.module||o.main||`index.js`),typeof s==`object`&&(s=s.import||s.default||s.require||``),s){let e=c.default.resolve(a,s);if(d.default.existsSync(e))return e}}catch{}return t.resolve(e)}function Ne(){let e=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`],n=[],r=q;try{let e=c.default.join(process.cwd(),`node_modules/boltdocs/package.json`);if(d.default.existsSync(e)){let t=d.default.realpathSync(e);r=g.createRequire(t)}else r=g.createRequire(c.default.join(process.cwd(),`package.json`))}catch{}for(let t of e)try{let e=``;e=t===`@bdocs/ssg`||t===`react-router-dom`||t===`react-helmet-async`?J(t,r):r.resolve(t),e&&n.push(d.default.realpathSync(e))}catch{}if(r!==q)for(let t of e)try{let e=``;e=t===`@bdocs/ssg`||t===`react-router-dom`||t===`react-helmet-async`?J(t,q):q.resolve(t),e&&n.push(d.default.realpathSync(e))}catch{}for(let e of[`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`]){try{n.push(d.default.realpathSync(r.resolve(e)))}catch{}if(r!==q)try{n.push(d.default.realpathSync(q.resolve(e)))}catch{}}return Array.from(new Set(n)).map(e=>t.l(e))}function Pe(e={},n){let a=c.default.resolve(process.cwd(),e.docsDir||`docs`),o=t.l(a),l=n,u,f=!1,m,h=[],_=()=>l;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){f=t.command===`build`;let n=!!(t.ssrBuild||t.ssr||e.build?.ssr),o=e.envDir||process.cwd(),u=(0,s.loadEnv)(t.mode,o,``);Object.assign(process.env,u),l||=await i.m(a);let p=(await Promise.resolve().then(()=>require(`./package-BBsNSOR-.cjs`))).version,g=_e(l.plugins||[],p);return l.plugins=g,m=new ve(g,l),h=g.flatMap(e=>B.getSanitizedCapabilities(e).vitePlugins||[]),f&&await m.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=le(ce(await r.t(a,l)),l);t&&d.default.writeFileSync(c.default.join(e,`sitemap.xml`),t);let n=ue(l);d.default.writeFileSync(c.default.join(e,`robots.txt`),n)}},build:{ssrManifest:f},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`,`react-fast-compare`,`invariant`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{alias:[{find:`react-router-dom`,replacement:J(`react-router-dom`)},{find:`react-helmet-async`,replacement:J(`react-helmet-async`)},{find:`@bdocs/ssg`,replacement:J(`@bdocs/ssg`)}],dedupe:[`react`,`react-dom`,...n?[]:[`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]]},ssr:{external:[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...Ne()],optimizeDeps:{include:[`react-fast-compare`,`invariant`]},noExternal:[]}}},configResolved(e){u=e,m?.runHook(`configResolved`,l)},resolveId(e,t,n){let r=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`].find(t=>e===t||e.startsWith(t+`/`)||e.includes(`/node_modules/${t}/`)||t.startsWith(`@`)&&e.includes(`/node_modules/${t.replace(`/`,c.default.sep)}/`));if(r&&n?.ssr){let t=e;if(!c.default.isAbsolute(e)){let n=q;try{let e=c.default.join(process.cwd(),`node_modules/boltdocs/package.json`);if(d.default.existsSync(e)){let t=d.default.realpathSync(e);n=g.createRequire(t)}else n=g.createRequire(c.default.join(process.cwd(),`package.json`))}catch{}try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?J(e,n):n.resolve(e)}catch{try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?J(e,q):q.resolve(e)}catch{}}}try{t=d.default.realpathSync(t)}catch{}return{id:t,external:!0}}return null},transformIndexHtml:{order:`pre`,handler(e){return fe(e,l)}},async buildEnd(){let{pool:e}=await Promise.resolve().then(()=>require(`./worker-pool-BwU8ckrg.cjs`));await e.terminate()},async closeBundle(){!f||u?.build?.ssr||(await m?.runHook(`afterBuild`),await m?.runHook(`buildEnd`))}},Ce(e,_,()=>u,a),Ae(a,o,_,e=>{l=e},()=>m),{...(0,p.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...h]}const Y=new n.r(`mdx`),Fe=[x.default.default||x.default,S.default.default||S.default,C.default.default||C.default,w.default.default||w.default,T.default.default||T.default,E.default.default||E.default,D.default.default||D.default],Ie=[O.default,re.default,k.default,A.default,j.default,M.default,ie.default,ae.default,oe.default,se.default,N.default,P.default,F.default];let Le=null,X=null;const Re=()=>(Le??=(0,te.createJavaScriptRegexEngine)(),Le),ze=async e=>X||(X=(0,ne.createHighlighterCore)({themes:Fe,langs:Ie,engine:Re()}),X),Z={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},Be={PRE:`pre`,CODE:`code`},Q={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},$={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},Ve={LIGHT:`github-light`,DARK:`github-dark`},He={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},Ue=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,$.LINE_NUMBERS)}}},We=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,$.WORD_WRAP)}}},Ge=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Q.TITLE]=t)}}),Ke=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Q.LANG]=this.options.lang||He.LANG}});function qe(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var Je=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:Ve.LIGHT,dark:Ve.DARK}}async getHighlighter(){return await ze(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=qe(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||He.LANG,meta:{__raw:i,...r},transformers:[Ue(),We(),Ge(),Ke()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${$.FALLBACK}"><code>${Ye(e)}</code></pre>`}}};function Ye(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}let Xe=null,Ze;function Qe(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Xe===null||Ze!==t)&&(Xe=new Je(e),Ze=t),Xe}function $e(e){let t=Qe(e);return async e=>{let n=await t.getHighlighter();(0,ee.visit)(e,Z.ELEMENT,e=>{if(e.tagName===Be.PRE&&e.children?.[0]?.type===Z.ELEMENT&&e.children[0].tagName===Be.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):He.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=qe(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${$.FALLBACK}"><code>${Ye(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Q.TITLE]=s.title),e.properties[Q.HIGHLIGHTED]=`true`,e.properties[Q.HIGHLIGHTED_HTML]=l,e.properties[Q.LANG]=a,e.children=[]}})}}function et(){return e=>{(0,ee.visit)(e,Z.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let tt=!1;function nt(e,t=_.default){let n=e?.plugins?.flatMap(e=>B.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>B.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[v.default,y.default,et,...n],rehypePlugins:[b.default,[$e,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){tt||=(await Y.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${f.default.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await Y.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
|
|
107
|
+
export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(u===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],n=null;for(let t of e){let e=c.default.resolve(a,`icons.${t}`);if(d.default.existsSync(e)){n=e;break}}return n?`import * as icons from '${t.l(n)}';\nexport default icons;`:`export default {};`}if(u===`search`){if(!W){let e=xe(await r.t(a,l));W=`export default ${JSON.stringify(e,null,2)};`}return W}if(u===`client`){let e=__dirname,n=``;for(;e&&e!==c.default.parse(e).root;){let r=c.default.join(e,`src/client/index.ts`),i=c.default.join(e,`dist/client/index.mjs`),a=c.default.join(e,`client/index.ts`);if(d.default.existsSync(r)){n=t.l(r);break}if(d.default.existsSync(i)){n=t.l(i);break}if(d.default.existsSync(a)){n=t.l(a);break}e=c.default.dirname(e)}if(!n)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${__dirname}`);return`export * from '${n}';`}}}}const we={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Te(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const G=new Map;async function Ee(e){try{let{data:n}=await t.u(e),r=JSON.stringify(n);return f.default.createHash(`md5`).update(r).digest(`hex`)}catch{return``}}function De(e){return G.get(e)}function Oe(e,t){G.set(e,t)}function ke(e){G.delete(e)}function K(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ae(e,n,a,o,s){let l=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(o){let u=s();await u?.runHook(`beforeDev`),i.s(e,process.cwd(),a()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:t}=await Promise.resolve().then(()=>require(`./routes-CHf76Ye4.cjs`)),n=await t(e,a());for(let e of n)if(e.filePath){let t=c.default.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await o.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),o.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(we).forEach(([e,n])=>{t.setHeader(e,n)});let r=a();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Te(r)),n()}),o.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),o.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,s=a(),c=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(r);if(i.includes(`text/html`)&&!c){let n=de(s);n=fe(n,s),n=await o.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let d=i.f.map(e=>c.default.resolve(process.cwd(),e)),f=[`tsx`,`jsx`].map(t=>c.default.resolve(e,`layout.${t}`)),p=[`tsx`,`ts`,`jsx`,`js`],m=p.map(t=>c.default.resolve(e,`mdx-components.${t}`)),h=p.map(t=>c.default.resolve(e,`pages-external/index.${t}`)),g=p.map(t=>c.default.resolve(e,`icons.${t}`));o.watcher.add([...d,...m,...f,...h,...g]);let _=async(s,u)=>{try{let d=t.l(s);if(i.f.some(e=>d.endsWith(e))){o.restart();return}if(p.some(e=>d.endsWith(`mdx-components.${e}`))){i.g(a(),e),K(o,`mdx-components.tsx`),o.ws.send({type:`full-reload`});return}if(p.some(e=>d.endsWith(`icons.${e}`))){K(o,`icons.tsx`),o.ws.send({type:`full-reload`});return}if(d.endsWith(`layout.tsx`)||d.endsWith(`layout.jsx`)){K(o,`layout.tsx`),o.ws.send({type:`full-reload`});return}if(d.includes(`/pages-external/`)||d.includes(`\\pages-external\\`)){K(o,`entry`),o.ws.send({type:`full-reload`});return}if(!d.toLowerCase().startsWith(n.toLowerCase())||!t.s(d))return;if(u===`add`||u===`unlink`){u===`unlink`&&ke(s),r.n(),Se();let t=a();i.g(t,e),K(o,`config`),K(o,`routes`),K(o,`search`),i.s(e,process.cwd(),t).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),o.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:t?.theme,i18n:t?.i18n,versions:t?.versions,siteUrl:t?.siteUrl}}),o.ws.send({type:`full-reload`});return}l.has(d)&&clearTimeout(l.get(d)),l.set(d,setTimeout(async()=>{l.delete(d);try{let n=De(s),i=await Ee(s);Oe(s,i),r.r(s),n!==void 0&&n!==i&&(K(o,`routes`),K(o,`search`));let a=t.l(c.default.relative(e,s)),l=o.moduleGraph.getModulesByFile(d);if(l)for(let e of l)o.moduleGraph.invalidateModule(e);o.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:d,relPath:a}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${u} event:`,e)}};o.watcher.on(`add`,e=>_(e,`add`)),o.watcher.on(`unlink`,e=>_(e,`unlink`)),o.watcher.on(`change`,e=>_(e,`change`)),await u?.runHook(`afterDev`)},handleHotUpdate({file:e,server:r}){let i=t.l(e);if(i.toLowerCase().startsWith(n.toLowerCase())&&t.s(i))return[]}}}const q=g.createRequire(require(`url`).pathToFileURL(__filename).href);function je(e){let t=c.default.dirname(e);for(;t&&t!==c.default.dirname(t);){let e=c.default.join(t,`package.json`);if(d.default.existsSync(e))return e;t=c.default.dirname(t)}return null}function Me(e){let t=e.split(`/`);return e.startsWith(`@`)?{packageName:t.slice(0,2).join(`/`),subpath:t.slice(2).join(`/`)}:{packageName:t[0],subpath:t.slice(1).join(`/`)}}function J(e,t=q){try{let{packageName:n,subpath:r}=Me(e),i;try{i=t.resolve(n+`/package.json`)}catch{i=je(t.resolve(n))||``}if(!i)throw Error(`Could not find package.json for ${n}`);let a=c.default.dirname(i),o=JSON.parse(d.default.readFileSync(i,`utf-8`)),s=``,l=r?`./`+r:`.`;if(o.exports){let e=o.exports[l]||o.exports[r];e&&(s=typeof e==`string`?e:e.import||e.default||e.require||e)}if(!s&&!r&&(s=o.module||o.main||`index.js`),typeof s==`object`&&(s=s.import||s.default||s.require||``),s){let e=c.default.resolve(a,s);if(d.default.existsSync(e))return e}}catch{}return t.resolve(e)}function Ne(){let e=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`],n=[],r=q;try{let e=c.default.join(process.cwd(),`node_modules/boltdocs/package.json`);if(d.default.existsSync(e)){let t=d.default.realpathSync(e);r=g.createRequire(t)}else r=g.createRequire(c.default.join(process.cwd(),`package.json`))}catch{}for(let t of e)try{let e=``;e=t===`@bdocs/ssg`||t===`react-router-dom`||t===`react-helmet-async`?J(t,r):r.resolve(t),e&&n.push(d.default.realpathSync(e))}catch{}if(r!==q)for(let t of e)try{let e=``;e=t===`@bdocs/ssg`||t===`react-router-dom`||t===`react-helmet-async`?J(t,q):q.resolve(t),e&&n.push(d.default.realpathSync(e))}catch{}for(let e of[`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`]){try{n.push(d.default.realpathSync(r.resolve(e)))}catch{}if(r!==q)try{n.push(d.default.realpathSync(q.resolve(e)))}catch{}}return Array.from(new Set(n)).map(e=>t.l(e))}function Pe(e={},n){let a=c.default.resolve(process.cwd(),e.docsDir||`docs`),o=t.l(a),l=n,u,f=!1,m,h=[],_=()=>l;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){f=t.command===`build`;let n=!!(t.ssrBuild||t.ssr||e.build?.ssr),o=e.envDir||process.cwd(),u=(0,s.loadEnv)(t.mode,o,``);Object.assign(process.env,u),l||=await i.m(a);let p=(await Promise.resolve().then(()=>require(`./package-60UENucA.cjs`))).version,g=_e(l.plugins||[],p);return l.plugins=g,m=new ve(g,l),h=g.flatMap(e=>B.getSanitizedCapabilities(e).vitePlugins||[]),f&&await m.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`flat`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=le(ce(await r.t(a,l)),l);t&&d.default.writeFileSync(c.default.join(e,`sitemap.xml`),t);let n=ue(l);d.default.writeFileSync(c.default.join(e,`robots.txt`),n)}},build:{ssrManifest:f},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`,`react-fast-compare`,`invariant`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{alias:[{find:`react-router-dom`,replacement:J(`react-router-dom`)},{find:`react-helmet-async`,replacement:J(`react-helmet-async`)},{find:`@bdocs/ssg`,replacement:J(`@bdocs/ssg`)}],dedupe:[`react`,`react-dom`,...n?[]:[`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]]},ssr:{external:[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...Ne()],optimizeDeps:{include:[`react-fast-compare`,`invariant`]},noExternal:[]}}},configResolved(e){u=e,m?.runHook(`configResolved`,l)},resolveId(e,t,n){let r=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`].find(t=>e===t||e.startsWith(t+`/`)||e.includes(`/node_modules/${t}/`)||t.startsWith(`@`)&&e.includes(`/node_modules/${t.replace(`/`,c.default.sep)}/`));if(r&&n?.ssr){let t=e;if(!c.default.isAbsolute(e)){let n=q;try{let e=c.default.join(process.cwd(),`node_modules/boltdocs/package.json`);if(d.default.existsSync(e)){let t=d.default.realpathSync(e);n=g.createRequire(t)}else n=g.createRequire(c.default.join(process.cwd(),`package.json`))}catch{}try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?J(e,n):n.resolve(e)}catch{try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?J(e,q):q.resolve(e)}catch{}}}try{t=d.default.realpathSync(t)}catch{}return{id:t,external:!0}}return null},transformIndexHtml:{order:`pre`,handler(e){return fe(e,l)}},async buildEnd(){let{pool:e}=await Promise.resolve().then(()=>require(`./worker-pool-BwU8ckrg.cjs`));await e.terminate()},async closeBundle(){!f||u?.build?.ssr||(await m?.runHook(`afterBuild`),await m?.runHook(`buildEnd`))},configurePreviewServer(e){let t=u?.build?.outDir?c.default.resolve(u.root||process.cwd(),u.build.outDir):c.default.resolve(process.cwd(),`dist`);e.middlewares.use((e,n,r)=>{let i=e.url||`/`,a=i.split(`?`)[0].split(`#`)[0];if(c.default.extname(a))return r();let o=a.replace(/\/$/,``)||`/`,s=c.default.join(t,o,`index.html`);o!==`/`&&d.default.existsSync(s)&&(e.url=`${o}/index.html${i.includes(`?`)?`?${i.split(`?`)[1]}`:``}`),r()})}},Ce(e,_,()=>u,a),Ae(a,o,_,e=>{l=e},()=>m),{...(0,p.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...h]}const Y=new n.r(`mdx`),Fe=[x.default.default||x.default,S.default.default||S.default,C.default.default||C.default,w.default.default||w.default,T.default.default||T.default,E.default.default||E.default,D.default.default||D.default],Ie=[O.default,re.default,k.default,A.default,j.default,M.default,ie.default,ae.default,oe.default,se.default,N.default,P.default,F.default];let Le=null,X=null;const Re=()=>(Le??=(0,te.createJavaScriptRegexEngine)(),Le),ze=async e=>X||(X=(0,ne.createHighlighterCore)({themes:Fe,langs:Ie,engine:Re()}),X),Z={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},Be={PRE:`pre`,CODE:`code`},Q={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},$={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},Ve={LIGHT:`github-light`,DARK:`github-dark`},He={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},Ue=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,$.LINE_NUMBERS)}}},We=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,$.WORD_WRAP)}}},Ge=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Q.TITLE]=t)}}),Ke=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Q.LANG]=this.options.lang||He.LANG}});function qe(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var Je=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:Ve.LIGHT,dark:Ve.DARK}}async getHighlighter(){return await ze(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=qe(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||He.LANG,meta:{__raw:i,...r},transformers:[Ue(),We(),Ge(),Ke()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${$.FALLBACK}"><code>${Ye(e)}</code></pre>`}}};function Ye(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}let Xe=null,Ze;function Qe(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Xe===null||Ze!==t)&&(Xe=new Je(e),Ze=t),Xe}function $e(e){let t=Qe(e);return async e=>{let n=await t.getHighlighter();(0,ee.visit)(e,Z.ELEMENT,e=>{if(e.tagName===Be.PRE&&e.children?.[0]?.type===Z.ELEMENT&&e.children[0].tagName===Be.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):He.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=qe(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${$.FALLBACK}"><code>${Ye(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Q.TITLE]=s.title),e.properties[Q.HIGHLIGHTED]=`true`,e.properties[Q.HIGHLIGHTED_HTML]=l,e.properties[Q.LANG]=a,e.children=[]}})}}function et(){return e=>{(0,ee.visit)(e,Z.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let tt=!1;function nt(e,t=_.default){let n=e?.plugins?.flatMap(e=>B.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>B.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[v.default,y.default,et,...n],rehypePlugins:[b.default,[$e,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){tt||=(await Y.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${f.default.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await Y.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
|
|
108
108
|
if (import.meta.hot) {
|
|
109
109
|
import.meta.hot.accept();
|
|
110
110
|
}
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var e=`2.7.
|
|
6
|
+
var e=`2.7.8`;Object.defineProperty(exports,`version`,{enumerable:!0,get:function(){return e}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "boltdocs",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.8",
|
|
4
4
|
"description": "A lightweight documentation generator for React projects.",
|
|
5
5
|
"main": "dist/node/index.mjs",
|
|
6
6
|
"module": "dist/node/index.mjs",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"vite": "7.0.0 || 8.0.0",
|
|
88
88
|
"vite-plugin-image-optimizer": "2.0.3",
|
|
89
89
|
"zod": "4.3.6",
|
|
90
|
-
"@bdocs/ssg": "0.0.
|
|
90
|
+
"@bdocs/ssg": "0.0.5"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"react": "19.0.0",
|
|
@@ -318,8 +318,20 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
|
318
318
|
: bPath.startsWith(baseDocsPath + '/')
|
|
319
319
|
? bPath.slice(baseDocsPath.length + 1)
|
|
320
320
|
: bPath
|
|
321
|
+
|
|
322
|
+
// Use `index: true` for the docs base path (e.g. /docs) instead of
|
|
323
|
+
// `path: '.'`. The dot-path is a client-only React Router feature: it
|
|
324
|
+
// means "same URL as parent" in createBrowserRouter, but createStaticHandler
|
|
325
|
+
// does not recognise it during SSG. This caused the static handler to skip
|
|
326
|
+
// the fallback loader entirely → loaderData was empty for /docs → the SSR
|
|
327
|
+
// rendered an empty content slot while the client hydrated with the first
|
|
328
|
+
// doc's element → structural mismatch → visual page duplication on refresh.
|
|
329
|
+
// Index routes are correctly matched by both browser and static handler.
|
|
330
|
+
const isBasePathFallback = redirectPath === '.'
|
|
321
331
|
docRoutes.push({
|
|
322
|
-
|
|
332
|
+
...(isBasePathFallback
|
|
333
|
+
? { index: true as const }
|
|
334
|
+
: { path: redirectPath }),
|
|
323
335
|
element: matchedRouteObj.element,
|
|
324
336
|
loader: matchedRouteObj.loader,
|
|
325
337
|
getStaticPaths: () => [],
|