deepspace 0.22.0 → 0.22.1
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/CHANGELOG.md +6 -0
- package/dist/{chunk-7TDBFEB7.js → chunk-XXOLIJB5.js} +2 -2
- package/dist/{chunk-7TDBFEB7.js.map → chunk-XXOLIJB5.js.map} +1 -1
- package/dist/cli.js +54 -3
- package/dist/cli.js.map +1 -1
- package/dist/documentation-client-core.js +1 -1
- package/dist/documentation-default-renderer.cjs +1 -1
- package/dist/documentation-react.js +1 -1
- package/dist/documentation-runtime.js +1 -1
- package/dist/documentation-server-core.js +1 -1
- package/dist/documentation.js +1 -1
- package/dist/documentation.js.map +1 -1
- package/package.json +1 -1
|
@@ -64,7 +64,7 @@ Learn more: https://react.dev/warnings/version-mismatch`))}uf();function sf(e,n)
|
|
|
64
64
|
${c}`)}),[n.config.assistant.access,n.page.title,r]);return(0,S.jsxs)("article",{className:"documentation-article",ref:i,children:[(0,S.jsx)(bb,{items:n.breadcrumbs}),(0,S.jsxs)("header",{className:"documentation-article-header",children:[(0,S.jsxs)("div",{className:"documentation-article-meta",children:[n.config.theme.eyebrowStyle!=="none"&&(0,S.jsx)("div",{className:"documentation-eyebrow",children:n.page.kind==="openapi"?"API reference":n.config.theme.eyebrowStyle==="breadcrumbs"?n.breadcrumbs.join(" / "):n.breadcrumbs[0]??"Documentation"}),(0,S.jsx)(Df,{data:n,onAssistantOpen:r})]}),(0,S.jsx)("h1",{children:n.page.title}),n.page.description&&(0,S.jsx)("p",{className:"documentation-lede",children:n.page.description})]}),(0,S.jsx)(yb,{headings:Lf(n.page.headings)}),(0,S.jsxs)(Mf,{value:a,children:[e??(0,S.jsx)("div",{className:"documentation-prose","data-prose":"html",dangerouslySetInnerHTML:{__html:n.page.html}}),l.map(c=>(0,Of.createPortal)((0,S.jsx)(Pf,{readCode:()=>Tb(c.pre)}),c.host,c.key))]}),n.page.openapi?.playground&&(0,S.jsx)(mb,{operation:n.page.openapi}),t&&(0,S.jsx)("div",{className:"documentation-launcher-dock",children:t}),(0,S.jsxs)("nav",{className:"documentation-pagination","aria-label":"Page navigation",children:[n.previous?(0,S.jsxs)("a",{rel:"prev",href:Te(n.basePath,n.previous.route),children:[(0,S.jsx)("small",{children:"Previous"}),(0,S.jsxs)("span",{children:[(0,S.jsx)(pt,{className:"is-back"}),n.previous.title]})]}):(0,S.jsx)("span",{}),n.next?(0,S.jsxs)("a",{rel:"next",href:Te(n.basePath,n.next.route),children:[(0,S.jsx)("small",{children:"Next"}),(0,S.jsxs)("span",{children:[n.next.title,(0,S.jsx)(pt,{})]})]}):(0,S.jsx)("span",{})]})]})}function bb({items:e}){return(0,S.jsx)("nav",{className:"documentation-breadcrumbs","aria-label":"Breadcrumb",children:e.map((n,t)=>(0,S.jsxs)("span",{children:[t>0&&(0,S.jsx)(pt,{}),n]},`${n}:${e.slice(0,t+1).join("/")}`))})}function Lf(e){return e.filter(n=>n.depth===2||n.depth===3)}function Hf({active:e,headings:n}){return(0,S.jsx)(S.Fragment,{children:n.map(t=>(0,S.jsx)("a",{"aria-current":e===t.id?"location":void 0,className:`${t.depth===3?"depth-3 ":""}${e===t.id?"is-active":""}`,href:`#${t.id}`,children:t.text},t.id))})}function yb({headings:e}){return e.length===0?null:(0,S.jsxs)("details",{className:"documentation-outline-disclosure",children:[(0,S.jsxs)("summary",{children:[(0,S.jsx)(Af,{}),"On this page"]}),(0,S.jsx)("nav",{className:"documentation-outline","aria-label":"On this page",children:(0,S.jsx)(Hf,{active:"",headings:e})})]})}function Bf({data:e}){let n=(0,Me.useMemo)(()=>Lf(e.page.headings),[e.page.headings]),[t,r]=(0,Me.useState)(n[0]?.id??"");return(0,Me.useEffect)(()=>r(n[0]?.id??""),[n]),(0,Me.useEffect)(()=>{let i=null,l=()=>{i=null;let o=document.documentElement,u=(Number.parseFloat(getComputedStyle(o).scrollPaddingTop)||96)+4,s=o.scrollHeight>window.innerHeight+4&&window.innerHeight+window.scrollY>=o.scrollHeight-2,d=n[0]?.id??"";for(let h of n){let E=document.getElementById(h.id);if(E)if(E.getBoundingClientRect().top<=u)d=h.id;else break}if(s){let h=decodeURIComponent(window.location.hash.slice(1));if(h&&n.some(E=>E.id===h)){let E=document.getElementById(h)?.getBoundingClientRect().top;E!==void 0&&E>u&&E<window.innerHeight&&(d=h)}}r(d)},a=()=>{i===null&&(i=window.requestAnimationFrame(l))},c=o=>{o.target instanceof Element&&o.target.closest(".documentation-outline a")&&window.setTimeout(a,0)};return l(),window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a,{passive:!0}),window.addEventListener("popstate",a),window.addEventListener("hashchange",a),document.addEventListener("click",c),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a),window.removeEventListener("popstate",a),window.removeEventListener("hashchange",a),document.removeEventListener("click",c),i!==null&&window.cancelAnimationFrame(i)}},[n]),(0,S.jsx)("aside",{className:"documentation-context-rail","aria-label":"Page context",children:n.length>0&&(0,S.jsxs)("nav",{className:"documentation-outline","aria-label":"On this page",children:[(0,S.jsx)("h2",{children:"On this page"}),(0,S.jsx)(Hf,{active:t,headings:n})]})})}function mb({operation:e}){let[n,t]=(0,Me.useState)(""),[r,i]=(0,Me.useState)(""),[l,a]=(0,Me.useState)("No request sent."),[c,o]=(0,Me.useState)(!1);if(!e.baseUrl)return null;let u=`${e.baseUrl.replace(/\/$/,"")}${e.path}`,f=async()=>{o(!0),a("Sending request\u2026");try{let s={};r&&(s.Authorization=`Bearer ${r}`),n.trim()&&(s["Content-Type"]="application/json");let d=await fetch(u,{method:e.method,headers:s,body:["GET","HEAD"].includes(e.method)?void 0:n.trim()||void 0}),h=await d.text();a(`${d.status} ${d.statusText}
|
|
65
65
|
|
|
66
66
|
${h}`)}catch(s){a(fa(s))}finally{o(!1)}};return(0,S.jsxs)("section",{className:"documentation-playground","data-playground":!0,children:[(0,S.jsxs)("div",{className:"documentation-playground-title",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("span",{className:`method method-${e.method.toLowerCase()}`,children:e.method}),(0,S.jsx)("strong",{children:"Try this operation"})]}),(0,S.jsx)("code",{children:u})]}),(0,S.jsx)("p",{children:"Requests run in your browser. Tokens stay in memory and never enter search or assistant context."}),(0,S.jsxs)("label",{children:[(0,S.jsx)("span",{children:"Bearer token"}),(0,S.jsx)("input",{type:"password",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:r,onChange:s=>i(s.target.value),placeholder:"Optional"})]}),(0,S.jsxs)("label",{children:[(0,S.jsx)("span",{children:"JSON body"}),(0,S.jsx)("textarea",{rows:7,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:n,onChange:s=>t(s.target.value),placeholder:"{}"})]}),(0,S.jsx)("button",{type:"button",disabled:c,onClick:f,children:c?"Sending\u2026":`Send ${e.method} request`}),(0,S.jsx)("pre",{"aria-live":"polite",children:l})]})}function Eb(e,n){let[t,r]=(0,Me.useState)([]);return(0,Me.useEffect)(()=>{let i=e.current;if(!i)return;let l=[],a=[];return i.querySelectorAll(Nf+" pre").forEach((c,o)=>{let u=document.createElement("div");u.className="documentation-code-block",c.replaceWith(u),u.appendChild(c);let f=c.getAttribute("data-code-title");if(f&&!u.closest("[data-tab-group]")){let h=document.createElement("div");h.className="documentation-code-title",h.textContent=f,u.insertBefore(h,c)}let s=document.createElement("div");s.className="documentation-code-actions";let d=_f(c.querySelector("code")?.className??"");if(d){let h=document.createElement("span");h.className="documentation-code-language",h.textContent=d,s.appendChild(h)}u.appendChild(s),l.push({block:u,pre:c}),a.push({key:`${n}:${o}`,host:s,pre:c})}),r(a),()=>{r([]);for(let{block:c,pre:o}of l)c.replaceWith(o)}},[e,n]),t}function Tb(e){return e.querySelector("code")?.textContent??e.textContent??""}function xb(e,n){(0,Me.useEffect)(()=>{let t=e.current;if(!t)return;let r=[];return t.querySelectorAll(`${Nf} [data-tab-group]`).forEach((i,l)=>{if(i.querySelector(":scope > .documentation-tab-buttons"))return;let a=Array.from(i.querySelectorAll(":scope > [data-tab]"));if(a.length===0)return;let c=document.createElement("div");c.className="documentation-tab-buttons",c.setAttribute("role","tablist");let o=a.map((E,y)=>E.dataset.tabTitle??`Tab ${y+1}`),u=(E,y=!1)=>{if(a.forEach((g,m)=>{g.hidden=m!==E,g.setAttribute("role","tabpanel")}),Array.from(c.querySelectorAll("button")).forEach((g,m)=>{g.setAttribute("aria-selected",m===E?"true":"false"),g.setAttribute("tabindex",m===E?"0":"-1")}),y){let g=o[E];g&&(Yi("deepspace-documentation-tab-selection",g),document.dispatchEvent(new CustomEvent("deepspace-documentation-tab-change",{detail:{label:g,source:i}})))}};a.forEach((E,y)=>{let g=document.createElement("button");g.type="button",g.id=`documentation-tab-${l}-${y}`,g.setAttribute("role","tab"),g.textContent=o[y],E.setAttribute("aria-labelledby",g.id);let m=()=>u(y,!0),T=w=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(w.key))return;w.preventDefault();let I=w.key==="Home"?0:w.key==="End"?a.length-1:(y+(w.key==="ArrowRight"?1:-1)+a.length)%a.length;u(I),c.querySelectorAll("button")[I]?.focus()};g.addEventListener("click",m),g.addEventListener("keydown",T),c.appendChild(g),r.push(()=>{g.removeEventListener("click",m),g.removeEventListener("keydown",T)})});let f=i.querySelector(":scope > .documentation-code-group-title");f&&i.insertBefore(c,f.nextSibling),f||i.insertBefore(c,i.firstChild);let s=E=>{let y=E.detail;if(!y?.label||y.source===i)return;let g=o.findIndex(m=>m===y.label);g>=0&&u(g)};document.addEventListener("deepspace-documentation-tab-change",s);let d=Gi("deepspace-documentation-tab-selection"),h=d?o.findIndex(E=>E===d):-1;u(h>=0?h:0),r.push(()=>{document.removeEventListener("deepspace-documentation-tab-change",s),c.remove()})}),()=>r.reverse().forEach(i=>i())},[e,n.page.route])}var Pe=J(un(),1);function zf(e){if(!e||e.startsWith(":")||!e.startsWith("data:"))return null;let n=e.slice(5).replace(/^ /,"").replace(/\r$/,"");if(n==="[DONE]")return null;try{let t=JSON.parse(n);return!t||typeof t!="object"?null:t}catch{return null}}function St(e){let n=e.trim();return!n||/^documentation$/i.test(n)?"documentation":/(?:\bdocs?|documentation)$/i.test(n)?n:`${n} documentation`}function Wf(e,n=12){let t=[];for(let i=0;i<e.length-1;i+=1){let l=e[i];if(l?.role!=="user"||l.state!==void 0||!l.text.trim())continue;let a=e[i+1];a?.role!=="assistant"||a.state!==void 0||!a.text.trim()||(t.push([{role:"user",content:l.text},{role:"assistant",content:a.text}]),i+=1)}let r=Math.max(0,Math.floor(n/2));return r===0?[]:t.slice(-r).flat()}var Uf=J(un(),1);function Cr(e,n,t,r=!0,i){(0,Uf.useEffect)(()=>{if(!e)return;let l=document.activeElement,a=n.current,c=window.requestAnimationFrame(()=>{(a?.querySelector("[data-autofocus]")??a?.querySelector("button,a,input,textarea"))?.focus()}),o=u=>{if(u.key==="Escape"){u.preventDefault(),t();return}if(!r||u.key!=="Tab"||!a)return;let f=Array.from(a.querySelectorAll('a[href],button:not([disabled]),input:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])'));if(f.length===0)return;let s=f[0],d=f[f.length-1];u.shiftKey&&document.activeElement===s?(u.preventDefault(),d?.focus()):!u.shiftKey&&document.activeElement===d&&(u.preventDefault(),s?.focus())};return document.addEventListener("keydown",o),()=>{window.cancelAnimationFrame(c),document.removeEventListener("keydown",o),(i?document.getElementById(i):l?.isConnected&&l!==document.body&&!a?.contains(l)?l:null)?.focus()}},[t,e,n,i,r])}var M=J(Ie(),1);function Yf({input:e,name:n,onInputChange:t,onSubmit:r}){let i=St(n);return(0,M.jsxs)("form",{className:"documentation-assistant-launcher",id:"deepspace-documentation-assistant-launcher",onSubmit:a=>{a.preventDefault();let c=e.trim();c&&r(c)},children:[(0,M.jsx)("input",{"aria-label":`Ask the ${i} agent`,autoCapitalize:"sentences",autoComplete:"off",autoCorrect:"off",enterKeyHint:"send",id:"deepspace-documentation-assistant-launcher-input",maxLength:4e3,onChange:a=>t(a.target.value),placeholder:"Ask anything\u2026",spellCheck:!1,value:e}),(0,M.jsxs)("span",{"aria-hidden":"true",className:"documentation-launcher-hint",children:[(0,M.jsx)("kbd",{children:"\u2318"}),(0,M.jsx)("kbd",{children:"I"})]}),(0,M.jsx)("button",{className:"documentation-launcher-send",type:"submit",disabled:!e.trim(),"aria-label":"Send question to documentation agent",children:(0,M.jsx)(uc,{})})]})}function Xf({access:e,basePath:n,input:t,name:r,onClose:i,onInputChange:l,open:a,route:c,seed:o,suggestions:u}){let f=(0,Pe.useRef)(null),s=(0,Pe.useRef)(null),d=(0,Pe.useRef)(null),h=(0,Pe.useRef)(null),E=(0,Pe.useRef)(null),y=(0,Pe.useRef)(null),g=(0,Pe.useRef)(0),[m,T]=(0,Pe.useState)([{id:"welcome",role:"assistant",text:`I can search the ${St(r)} and cite the exact pages I use.`}]),[w,I]=(0,Pe.useState)(!1);if(Cr(a,f,i,!1,"deepspace-documentation-assistant-launcher-input"),(0,Pe.useEffect)(()=>{if(!a||o.id===0||g.current===o.id||(g.current=o.id,!o.submit||!o.value?.trim()))return;y.current=o.value;let k=window.requestAnimationFrame(()=>s.current?.requestSubmit());return()=>window.cancelAnimationFrame(k)},[a,o]),(0,Pe.useEffect)(()=>{let k=d.current;k&&(k.scrollTop=k.scrollHeight)},[m]),(0,Pe.useEffect)(()=>{let k=h.current;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`,k.style.overflowY=k.scrollHeight>160?"auto":"hidden")},[t,a]),(0,Pe.useEffect)(()=>()=>E.current?.abort(),[]),!a)return null;let R=async k=>{k?.preventDefault();let Z=(y.current??t).trim();if(y.current=null,!Z||w)return;let P=Wf(m);l(""),I(!0);let le=`user-${Date.now()}`,p=`assistant-${Date.now()}`;T(he=>[...he,{id:le,role:"user",text:Z},{id:p,role:"assistant",text:"",state:"streaming",status:"Searching this documentation\u2026"}]);let U=new AbortController;E.current=U;let G=!1,O=window.setTimeout(()=>{T(he=>he.map(ee=>ee.id===p?{...ee,status:"Still working through the documentation\u2026"}:ee))},12e3),$=window.setTimeout(()=>{G=!0,U.abort()},12e4);try{let he={"Content-Type":"application/json"};if(e==="authenticated"){let V=await fetch("/api/auth/token",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}}),z=V.ok?await V.json().catch(()=>null):null;if(!z?.token)throw new Error("Sign in to use the documentation assistant.");he.Authorization=`Bearer ${z.token}`}let ee=await fetch(Te(n,"/api/ai"),{method:"POST",headers:he,body:JSON.stringify({question:Z,route:c,messages:P}),signal:U.signal});if(!ee.ok||!ee.body){let V=await ee.json().catch(()=>null);throw new Error(V?.error??`Assistant unavailable (${ee.status})`)}let xe=ee.body.getReader(),ve=new TextDecoder,ae="",oe="",fe=V=>{let z=zf(V);if(z){if(z.type==="text-delta"&&typeof z.delta=="string")oe+=z.delta,T(de=>de.map(N=>N.id===p?{...N,text:oe,state:"streaming",status:void 0}:N));else if(z.type==="tool-input-available"){let de=z.toolName==="documentation_read"?"Reading the relevant source pages\u2026":"Searching this documentation\u2026";T(N=>N.map($e=>$e.id===p?{...$e,status:de}:$e))}else if(z.type==="tool-output-available")T(de=>de.map(N=>N.id===p?{...N,status:"Reviewing the source material\u2026"}:N));else if(z.type==="error")throw new Error(typeof z.errorText=="string"?z.errorText:"The assistant stream failed.")}};for(;;){let V=await xe.read();if(V.done)break;ae+=ve.decode(V.value,{stream:!0});let z=ae.split(/\r?\n/);ae=z.pop()??"";for(let de of z)fe(de)}ae+=ve.decode(),fe(ae),T(V=>V.map(z=>z.id===p?{...z,text:oe||"No answer was returned.",state:void 0}:z))}catch(he){let ee=G?"The documentation search took too long. Try a narrower question.":U.signal.aborted?"Response stopped.":fa(he);T(xe=>xe.map(ve=>ve.id===p?{...ve,text:ee,state:"error"}:ve))}finally{window.clearTimeout(O),window.clearTimeout($),E.current=null,I(!1)}},x=u??["How do I get started?","Show me a complete example","What should I understand first?"];return(0,M.jsxs)("aside",{"aria-label":"Documentation assistant",className:"documentation-assistant",id:"deepspace-documentation-assistant",ref:f,role:"complementary",children:[(0,M.jsxs)("header",{children:[(0,M.jsx)("div",{children:(0,M.jsxs)("span",{children:[(0,M.jsxs)("strong",{id:"deepspace-documentation-assistant-title",children:["Ask ",r]}),(0,M.jsx)("small",{children:"Answers from this documentation build"})]})}),(0,M.jsx)("button",{type:"button",onClick:i,"aria-label":"Close documentation assistant",children:(0,M.jsx)(ga,{})})]}),(0,M.jsxs)("div",{className:"documentation-assistant-messages",ref:d,"aria-live":"polite",children:[m.map(k=>(0,M.jsx)("div",{className:`documentation-assistant-message is-${k.role}${k.state?` is-${k.state}`:""}`,children:(0,M.jsxs)("div",{children:[k.role==="assistant"?(0,M.jsx)(wb,{value:k.text}):k.text,k.state==="streaming"&&!k.text&&(0,M.jsxs)("span",{className:"documentation-assistant-activity",role:"status",children:[(0,M.jsx)("span",{"aria-hidden":"true"}),k.status??"Working\u2026"]})]})},k.id)),m.length===1&&(0,M.jsxs)("div",{className:"documentation-assistant-suggestions",children:[(0,M.jsx)("p",{children:"Try asking"}),x.map(k=>(0,M.jsx)("button",{type:"button",onClick:()=>l(k),children:k},k))]})]}),(0,M.jsxs)("form",{className:"documentation-assistant-composer",onSubmit:R,ref:s,children:[(0,M.jsx)("textarea",{"aria-label":"Ask a documentation question",autoCapitalize:"sentences",autoComplete:"off",autoCorrect:"off","data-autofocus":!0,enterKeyHint:"send",maxLength:4e3,onChange:k=>l(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),R())},placeholder:"Ask a question about this documentation",ref:h,rows:1,spellCheck:!1,value:t}),w?(0,M.jsx)("button",{type:"button",onClick:()=>E.current?.abort(),"aria-label":"Stop response",children:(0,M.jsx)(pf,{})}):(0,M.jsx)("button",{type:"submit",disabled:!t.trim(),"aria-label":"Send question",children:(0,M.jsx)(uc,{})})]}),(0,M.jsx)("footer",{children:"Responses cite this deployment and may still contain mistakes."})]})}function wb({value:e}){let n=[],t=/```([^\n`]*)\n([\s\S]*?)(?:```|$)/g,r=0;for(let i of e.matchAll(t)){let l=i.index??0;l>r&&n.push(...Gf(e.slice(r,l),`text-${r}`)),n.push((0,M.jsx)(Cb,{code:(i[2]??"").replace(/\n$/,""),language:(i[1]??"").trim().split(/\s+/,1)[0]??""},`code-${l}`)),r=l+i[0].length}return r<e.length&&n.push(...Gf(e.slice(r),`text-${r}`)),(0,M.jsx)("div",{className:"documentation-assistant-markdown",children:n})}function Cb({code:e,language:n}){let[t,r]=(0,Pe.useState)(!1);return(0,M.jsxs)("figure",{className:"documentation-assistant-code",children:[(0,M.jsxs)("figcaption",{children:[(0,M.jsx)("span",{children:n||"Code"}),(0,M.jsx)("button",{type:"button",onClick:async()=>{await kt(e),r(!0),window.setTimeout(()=>r(!1),1400)},children:t?"Copied":"Copy"})]}),(0,M.jsx)("pre",{children:(0,M.jsx)("code",{children:e})})]})}function Gf(e,n){let t=e.split(`
|
|
67
|
-
`),r=[],i=0;for(;i<t.length;){let l=t[i]?.trim()??"";if(!l){i+=1;continue}let a=l.match(/^(#{1,4})\s+(.+)$/);if(a){r.push((0,M.jsx)("strong",{className:"documentation-assistant-heading",children:sc(a[2])},`${n}-heading-${i}`)),i+=1;continue}let c=/^[-*]\s+/.test(l),o=/^\d+[.)]\s+/.test(l);if(c||o){let f=[];for(;i<t.length;){let s=t[i]?.trim()??"",d=c?s.match(/^[-*]\s+(.+)$/):s.match(/^\d+[.)]\s+(.+)$/);if(!d)break;f.push((0,M.jsx)("li",{children:sc(d[1])},`${n}-item-${i}`)),i+=1}r.push(c?(0,M.jsx)("ul",{children:f},`${n}-list-${i}`):(0,M.jsx)("ol",{children:f},`${n}-list-${i}`));continue}let u=[l];for(i+=1;i<t.length;){let f=t[i]?.trim()??"";if(!f||/^(?:#{1,4}\s+|[-*]\s+|\d+[.)]\s+)/.test(f))break;u.push(f),i+=1}r.push((0,M.jsx)("p",{children:u.map((f,s)=>(0,M.jsxs)("span",{children:[sc(f),s<u.length-1&&" "]},`${s}:${f.slice(0,18)}`))},`${n}-paragraph-${i}`))}return r}function sc(e){let n=/(\[[^\]]+\]\((?:https?:\/\/|\/)[^)]+\)|`[^`]+`|\*\*[^*]+\*\*)/g;return e.split(n).filter(Boolean).map((t,r)=>{let i=t.match(/^\[([^\]]+)\]\(((?:https?:\/\/|\/)[^)]+)\)$/);return i?(0,M.jsx)("a",{href:i[2],...ut(i[2]),children:i[1]},`${r}:${t}`):t.startsWith("`")&&t.endsWith("`")?(0,M.jsx)("code",{children:t.slice(1,-1)},`${r}:${t}`):t.startsWith("**")&&t.endsWith("**")?(0,M.jsx)("strong",{children:t.slice(2,-2)},`${r}:${t}`):(0,M.jsx)("span",{children:t},`${r}:${t}`)})}var $t=J(un(),1);var Zf="0.22.0";var C=J(Ie(),1);function Jf({data:e,onMenuOpen:n,onSearchOpen:t}){return(0,C.jsxs)("header",{className:"documentation-header",children:[(0,C.jsx)("a",{className:"documentation-brand",href:e.config.theme.logoHref??Te(e.basePath,"/"),"aria-label":`${St(e.config.name)} home`,...ut(e.config.theme.logoHref??Te(e.basePath,"/")),children:(0,C.jsx)(Qf,{data:e})}),(0,C.jsx)("div",{className:"documentation-header-center",children:(0,C.jsxs)("button",{className:"documentation-search-trigger",type:"button",onClick:t,"aria-label":"Search documentation",children:[(0,C.jsx)(Xi,{}),(0,C.jsx)("span",{children:"Search documentation"}),(0,C.jsx)("kbd",{children:"\u2318K"})]})}),(0,C.jsx)("nav",{className:"documentation-top-links","aria-label":"Product navigation",children:e.config.links.map(r=>(0,C.jsxs)("a",{href:r.href,...ut(r.href),children:[r.label,sa(r.href)&&(0,C.jsx)(Zi,{})]},`${r.label}:${r.href}`))}),(0,C.jsxs)("div",{className:"documentation-mobile-actions",children:[(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:t,"aria-label":"Search documentation",children:(0,C.jsx)(Xi,{})}),(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Open documentation navigation",children:(0,C.jsx)(Ef,{})})]})]})}function Qf({data:e}){let{logo:n,logoDark:t}=e.config.theme;return n?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-light",src:n,alt:""}),(0,C.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-dark",src:t??n,alt:""}),(0,C.jsx)("span",{className:"documentation-brand-product",children:"Documentation"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{className:"documentation-brand-mark",children:(0,C.jsx)(Tr,{})}),(0,C.jsx)("span",{className:"documentation-brand-name",children:e.config.name})]})}function Vf({data:e}){return(0,C.jsxs)("aside",{className:"documentation-sidebar","aria-label":"Documentation navigation",children:[(0,C.jsx)("nav",{className:"documentation-page-tree",children:(0,C.jsx)(ya,{activeRoute:e.page.route,basePath:e.basePath,nodes:e.navigation})}),(0,C.jsxs)("div",{className:"documentation-sidebar-footer",children:[!e.config.theme.strictMode&&(0,C.jsx)(qf,{defaultMode:e.config.theme.defaultMode??"system"}),e.config.footer.length>0&&(0,C.jsx)("nav",{"aria-label":"Documentation footer",children:e.config.footer.map(n=>(0,C.jsx)("a",{href:n.href,...ut(n.href),children:n.label},`${n.label}:${n.href}`))}),(0,C.jsx)("span",{children:`Built with deepspace ${Zf}`})]})]})}function ya({activeRoute:e,basePath:n,depth:t=0,nodes:r}){return(0,C.jsx)(C.Fragment,{children:r.map(i=>{if(i.kind==="group"){let c=jf(i,e);return t===0?(0,C.jsxs)("section",{className:"documentation-nav-section",children:[(0,C.jsx)("h2",{children:i.label}),(0,C.jsx)(ya,{activeRoute:e,basePath:n,depth:t+1,nodes:i.items})]},`group:${i.label}`):(0,C.jsxs)("details",{className:"documentation-nav-folder",open:c,children:[(0,C.jsxs)("summary",{children:[(0,C.jsx)("span",{children:i.label}),(0,C.jsx)(va,{})]}),(0,C.jsx)("div",{children:(0,C.jsx)(ya,{activeRoute:e,basePath:n,depth:t+1,nodes:i.items})})]},`group:${i.label}`)}let l=i.kind==="page"?Te(n,i.route):i.href,a=i.kind==="page"&&i.route===e;return(0,C.jsxs)("a",{"aria-current":a?"page":void 0,className:a?"documentation-nav-link is-active":"documentation-nav-link",href:l,...ut(l),children:[(0,C.jsx)("span",{children:i.label}),sa(l)&&(0,C.jsx)(Zi,{})]},`${i.kind}:${l}`)})})}function Kf({data:e,onClose:n,open:t}){let r=(0,$t.useRef)(null);return Cr(t,r,n),t?(0,C.jsx)("div",{className:"documentation-modal-layer",role:"presentation",onMouseDown:i=>{i.currentTarget===i.target&&n()},children:(0,C.jsxs)("div",{className:"documentation-mobile-nav",role:"dialog","aria-modal":"true","aria-label":"Documentation navigation",ref:r,children:[(0,C.jsxs)("header",{children:[(0,C.jsx)("a",{"aria-label":`${St(e.config.name)} home`,className:"documentation-brand",href:e.config.theme.logoHref??Te(e.basePath,"/"),...ut(e.config.theme.logoHref??Te(e.basePath,"/")),children:(0,C.jsx)(Qf,{data:e})}),(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Close documentation navigation","data-autofocus":!0,children:(0,C.jsx)(ga,{})})]}),(0,C.jsx)("nav",{className:"documentation-page-tree",children:(0,C.jsx)(ya,{activeRoute:e.page.route,basePath:e.basePath,nodes:e.navigation})}),(0,C.jsxs)("footer",{children:[!e.config.theme.strictMode&&(0,C.jsx)(qf,{defaultMode:e.config.theme.defaultMode??"system"}),e.config.footer.map(i=>(0,C.jsx)("a",{href:i.href,...ut(i.href),children:i.label},`${i.label}:${i.href}`))]})]})}):null}function qf({defaultMode:e}){let[n,t]=(0,$t.useState)(e);(0,$t.useEffect)(()=>{let i=Gi("deepspace-documentation-theme");(i==="light"||i==="dark"||i==="system")&&t(i)},[]),(0,$t.useEffect)(()=>kb(n),[n]);let r=i=>{t(i),Yi("deepspace-documentation-theme",i)};return(0,C.jsxs)("div",{className:"documentation-theme-controls",role:"group","aria-label":"Theme preference",children:[(0,C.jsx)("button",{"aria-pressed":n==="system","aria-label":"Use system theme",onClick:()=>r("system"),type:"button",children:(0,C.jsx)(wf,{})}),(0,C.jsx)("button",{"aria-pressed":n==="light","aria-label":"Use light theme",onClick:()=>r("light"),type:"button",children:(0,C.jsx)(Tf,{})}),(0,C.jsx)("button",{"aria-pressed":n==="dark","aria-label":"Use dark theme",onClick:()=>r("dark"),type:"button",children:(0,C.jsx)(xf,{})})]})}function jf(e,n){return e.items.some(t=>t.kind==="page"?t.route===n:t.kind==="group"&&jf(t,n))}function kb(e){let n=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{document.documentElement.dataset.themeMode=e,document.documentElement.dataset.theme=e==="system"?n.matches?"dark":"light":e};return t(),n.addEventListener?.("change",t),()=>n.removeEventListener?.("change",t)}var je=J(un(),1);var D=J(Ie(),1);function $f({assistantEnabled:e,basePath:n,name:t,onAssistantOpen:r,onClose:i,onNavigate:l,open:a}){let c=(0,je.useRef)(null),o=(0,je.useRef)(null),[u,f]=(0,je.useState)(null),[s,d]=(0,je.useState)(!1),[h,E]=(0,je.useState)(""),[y,g]=(0,je.useState)(0);Cr(a,c,i),(0,je.useEffect)(()=>{!a||u||s||(d(!0),fetch(Te(n,"/search.json")).then(R=>R.ok?R.json():[]).then(f).catch(()=>f([])).finally(()=>d(!1)))},[n,u,s,a]),(0,je.useEffect)(()=>{a||(E(""),g(0))},[a]),(0,je.useEffect)(()=>{o.current?.querySelector(`#documentation-search-option-${y}`)?.scrollIntoView({block:"nearest"})},[y,h]);let m=(0,je.useMemo)(()=>pb(u??[]),[u]),T=(0,je.useMemo)(()=>Sb(m,h),[m,h]);if(!a)return null;let w=T.length+(e&&h.trim()?1:0),I=R=>{if(R.key==="ArrowDown"&&w>0)R.preventDefault(),g(x=>(x+1)%w);else if(R.key==="ArrowUp"&&w>0)R.preventDefault(),g(x=>(x-1+w)%w);else if(R.key==="Enter"){R.preventDefault();let x=y<T.length?T[y]:void 0;if(x){i();let k=Te(n,x.href);l?l(k):window.location.assign(k)}else e&&h.trim()&&r(h.trim())}};return(0,D.jsx)("div",{className:"documentation-modal-layer documentation-search-layer",role:"presentation",onMouseDown:R=>{R.currentTarget===R.target&&i()},children:(0,D.jsxs)("div",{className:"documentation-search-dialog",role:"dialog","aria-modal":"true","aria-label":"Search documentation",ref:c,children:[(0,D.jsxs)("label",{className:"documentation-search-input",children:[(0,D.jsx)(Xi,{}),(0,D.jsx)("input",{"aria-activedescendant":w>0?`documentation-search-option-${y}`:void 0,"aria-controls":"documentation-search-results","aria-expanded":"true","aria-label":`Search ${St(t)}`,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off","data-autofocus":!0,enterKeyHint:"go",onChange:R=>{E(R.target.value),g(0)},onKeyDown:I,placeholder:`Search ${t}`,role:"combobox",spellCheck:!1,value:h}),(0,D.jsx)("kbd",{children:"Esc"})]}),(0,D.jsxs)("div",{className:"documentation-search-results",id:"documentation-search-results",ref:o,role:"listbox","aria-label":"Search results",children:[!h.trim()&&(0,D.jsxs)("div",{className:"documentation-search-empty",children:[(0,D.jsx)(Tr,{}),(0,D.jsx)("strong",{children:"Find an answer in these docs"}),(0,D.jsx)("span",{children:"Search pages, headings, APIs, and examples."})]}),h.trim()&&s&&(0,D.jsx)("div",{className:"documentation-search-state",children:"Searching this documentation\u2026"}),h.trim()&&!s&&T.length===0&&(0,D.jsxs)("div",{className:"documentation-search-state",children:["No documentation matched \u201C",h.trim(),"\u201D."]}),T.map((R,x)=>(0,D.jsxs)("a",{"aria-selected":y===x,className:y===x?"documentation-search-result is-active":"documentation-search-result",href:Te(n,R.href),id:`documentation-search-option-${x}`,onClick:i,onMouseEnter:()=>g(x),role:"option",children:[(0,D.jsx)("span",{className:"documentation-search-kind",children:R.kind==="section"?(0,D.jsx)(Sf,{}):(0,D.jsx)(ba,{})}),(0,D.jsxs)("span",{className:"documentation-search-copy",children:[(0,D.jsx)("strong",{children:Ab(R.title,h)}),R.kind==="section"?(0,D.jsxs)("span",{className:"documentation-search-crumbs",children:[R.context,(0,D.jsx)(pt,{}),R.title]}):(0,D.jsx)("small",{children:R.context})]}),(0,D.jsx)(pt,{})]},R.href)),e&&h.trim()&&(0,D.jsxs)("button",{"aria-selected":y===T.length,className:y===T.length?"documentation-search-assistant is-active":"documentation-search-assistant",id:`documentation-search-option-${T.length}`,onClick:()=>r(h.trim()),onMouseEnter:()=>g(T.length),role:"option",type:"button",children:[(0,D.jsx)(ha,{}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"Ask DeepSpace"}),(0,D.jsx)("small",{children:"Answer from the current documentation with citations"})]}),(0,D.jsx)(pt,{})]})]}),(0,D.jsxs)("footer",{children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"\u2191"}),(0,D.jsx)("kbd",{children:"\u2193"})," select"]}),(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"\u21B5"})," open"]}),(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"esc"})," close"]})]})]})})}function pb(e){return e.map(n=>({entry:n,title:Qi(n.title),headings:n.headings.map(t=>({heading:t,normalized:Qi(t.text)})),headingText:Qi(n.headings.map(t=>t.text).join(" ")),haystack:Qi(`${n.description??""} ${n.text}`)}))}function Sb(e,n){let t=Qi(n);if(!t)return[];let r=t.split(" ").filter(Boolean),i=[];for(let{entry:l,title:a,headings:c,headingText:o,haystack:u}of e){let f=a===t?180:a.startsWith(t)?110:a.includes(t)?75:0;o.includes(t)&&(f+=55);for(let s of r)a.includes(s)?f+=24:o.includes(s)?f+=14:u.includes(s)?f+=5:f-=18;f>0&&i.push({route:l.route,score:f,result:{href:l.route,kind:"page",title:l.title,context:l.description??l.text.slice(0,150)}});for(let{heading:s,normalized:d}of c){let h=d===t?120:d.startsWith(t)?80:d.includes(t)?60:0;if(h===0)for(let E of r)d.includes(E)&&(h+=18);h<=0||i.push({route:`${l.route}#${s.id}`,score:h,result:{href:`${l.route}#${s.id}`,kind:"section",title:s.text,context:l.title}})}}return i.sort((l,a)=>a.score-l.score||l.route.localeCompare(a.route)).slice(0,10).map(l=>l.result)}function Ab(e,n){let t=n.trim();if(!t)return e;let r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:(0,D.jsxs)(D.Fragment,{children:[e.slice(0,r),(0,D.jsx)("mark",{children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function Qi(e){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}var ze=J(Ie(),1);function ed({data:e,children:n,navigating:t=!1,onNavigate:r}){let[i,l]=(0,Bn.useState)(!1),[a,c]=(0,Bn.useState)(!1),[o,u]=(0,Bn.useState)(!1),[f,s]=(0,Bn.useState)(""),[d,h]=(0,Bn.useState)({id:0,submit:!1}),E=e.config.assistant.access==="disabled"?null:e.config.assistant.access,y=E!==null,g=["documentation-app",y?"has-assistant":"",o?"is-assistant-open":"",t?"is-navigating":""].filter(Boolean).join(" "),m=(0,Bn.useCallback)((T,w=!1)=>{T!==void 0&&s(T),h(I=>({id:I.id+1,submit:w,value:T})),c(!1),u(!0)},[]);return(0,Bn.useEffect)(()=>{let T=w=>{(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="k"&&(w.preventDefault(),c(!0)),(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="i"&&(w.preventDefault(),e.config.assistant.access!=="disabled"&&m())};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[e.config.assistant.access,m]),(0,Bn.useEffect)(()=>{l(!1),c(!1)},[e.page.route]),(0,ze.jsxs)("div",{"aria-busy":t||void 0,className:g,children:[(0,ze.jsx)("a",{className:"documentation-skip-link",href:"#documentation-content",children:"Skip to main content"}),(0,ze.jsx)(Jf,{data:e,onMenuOpen:()=>l(!0),onSearchOpen:()=>c(!0)}),(0,ze.jsxs)("div",{className:"documentation-frame",children:[(0,ze.jsx)(Vf,{data:e}),(0,ze.jsx)("main",{className:"documentation-main",id:"documentation-content",children:(0,ze.jsxs)("div",{className:"documentation-reader-grid",children:[(0,ze.jsx)("div",{className:"documentation-reader-column",children:(0,ze.jsx)(Ff,{data:e,launcher:E&&!o?(0,ze.jsx)(Yf,{input:f,name:e.config.name,onInputChange:s,onSubmit:T=>m(T,!0)}):void 0,onAssistantOpen:m,children:n})}),(0,ze.jsx)(Bf,{data:e})]})})]}),(0,ze.jsx)(Kf,{data:e,onClose:()=>l(!1),open:i}),(0,ze.jsx)($f,{assistantEnabled:y,basePath:e.basePath,name:e.config.name,onAssistantOpen:m,onClose:()=>c(!1),onNavigate:r,open:a}),E&&(0,ze.jsx)(Xf,{access:E,basePath:e.basePath,input:f,name:e.config.name,onClose:()=>u(!1),onInputChange:s,open:o,route:e.page.route,seed:d,suggestions:e.config.assistant.suggestions})]})}function Ib(e){return(0,td.renderToString)((0,nd.createElement)(ed,{data:e}))}0&&(module.exports={renderDefaultDocumentation});
|
|
67
|
+
`),r=[],i=0;for(;i<t.length;){let l=t[i]?.trim()??"";if(!l){i+=1;continue}let a=l.match(/^(#{1,4})\s+(.+)$/);if(a){r.push((0,M.jsx)("strong",{className:"documentation-assistant-heading",children:sc(a[2])},`${n}-heading-${i}`)),i+=1;continue}let c=/^[-*]\s+/.test(l),o=/^\d+[.)]\s+/.test(l);if(c||o){let f=[];for(;i<t.length;){let s=t[i]?.trim()??"",d=c?s.match(/^[-*]\s+(.+)$/):s.match(/^\d+[.)]\s+(.+)$/);if(!d)break;f.push((0,M.jsx)("li",{children:sc(d[1])},`${n}-item-${i}`)),i+=1}r.push(c?(0,M.jsx)("ul",{children:f},`${n}-list-${i}`):(0,M.jsx)("ol",{children:f},`${n}-list-${i}`));continue}let u=[l];for(i+=1;i<t.length;){let f=t[i]?.trim()??"";if(!f||/^(?:#{1,4}\s+|[-*]\s+|\d+[.)]\s+)/.test(f))break;u.push(f),i+=1}r.push((0,M.jsx)("p",{children:u.map((f,s)=>(0,M.jsxs)("span",{children:[sc(f),s<u.length-1&&" "]},`${s}:${f.slice(0,18)}`))},`${n}-paragraph-${i}`))}return r}function sc(e){let n=/(\[[^\]]+\]\((?:https?:\/\/|\/)[^)]+\)|`[^`]+`|\*\*[^*]+\*\*)/g;return e.split(n).filter(Boolean).map((t,r)=>{let i=t.match(/^\[([^\]]+)\]\(((?:https?:\/\/|\/)[^)]+)\)$/);return i?(0,M.jsx)("a",{href:i[2],...ut(i[2]),children:i[1]},`${r}:${t}`):t.startsWith("`")&&t.endsWith("`")?(0,M.jsx)("code",{children:t.slice(1,-1)},`${r}:${t}`):t.startsWith("**")&&t.endsWith("**")?(0,M.jsx)("strong",{children:t.slice(2,-2)},`${r}:${t}`):(0,M.jsx)("span",{children:t},`${r}:${t}`)})}var $t=J(un(),1);var Zf="0.22.1";var C=J(Ie(),1);function Jf({data:e,onMenuOpen:n,onSearchOpen:t}){return(0,C.jsxs)("header",{className:"documentation-header",children:[(0,C.jsx)("a",{className:"documentation-brand",href:e.config.theme.logoHref??Te(e.basePath,"/"),"aria-label":`${St(e.config.name)} home`,...ut(e.config.theme.logoHref??Te(e.basePath,"/")),children:(0,C.jsx)(Qf,{data:e})}),(0,C.jsx)("div",{className:"documentation-header-center",children:(0,C.jsxs)("button",{className:"documentation-search-trigger",type:"button",onClick:t,"aria-label":"Search documentation",children:[(0,C.jsx)(Xi,{}),(0,C.jsx)("span",{children:"Search documentation"}),(0,C.jsx)("kbd",{children:"\u2318K"})]})}),(0,C.jsx)("nav",{className:"documentation-top-links","aria-label":"Product navigation",children:e.config.links.map(r=>(0,C.jsxs)("a",{href:r.href,...ut(r.href),children:[r.label,sa(r.href)&&(0,C.jsx)(Zi,{})]},`${r.label}:${r.href}`))}),(0,C.jsxs)("div",{className:"documentation-mobile-actions",children:[(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:t,"aria-label":"Search documentation",children:(0,C.jsx)(Xi,{})}),(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Open documentation navigation",children:(0,C.jsx)(Ef,{})})]})]})}function Qf({data:e}){let{logo:n,logoDark:t}=e.config.theme;return n?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-light",src:n,alt:""}),(0,C.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-dark",src:t??n,alt:""}),(0,C.jsx)("span",{className:"documentation-brand-product",children:"Documentation"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{className:"documentation-brand-mark",children:(0,C.jsx)(Tr,{})}),(0,C.jsx)("span",{className:"documentation-brand-name",children:e.config.name})]})}function Vf({data:e}){return(0,C.jsxs)("aside",{className:"documentation-sidebar","aria-label":"Documentation navigation",children:[(0,C.jsx)("nav",{className:"documentation-page-tree",children:(0,C.jsx)(ya,{activeRoute:e.page.route,basePath:e.basePath,nodes:e.navigation})}),(0,C.jsxs)("div",{className:"documentation-sidebar-footer",children:[!e.config.theme.strictMode&&(0,C.jsx)(qf,{defaultMode:e.config.theme.defaultMode??"system"}),e.config.footer.length>0&&(0,C.jsx)("nav",{"aria-label":"Documentation footer",children:e.config.footer.map(n=>(0,C.jsx)("a",{href:n.href,...ut(n.href),children:n.label},`${n.label}:${n.href}`))}),(0,C.jsx)("span",{children:`Built with deepspace ${Zf}`})]})]})}function ya({activeRoute:e,basePath:n,depth:t=0,nodes:r}){return(0,C.jsx)(C.Fragment,{children:r.map(i=>{if(i.kind==="group"){let c=jf(i,e);return t===0?(0,C.jsxs)("section",{className:"documentation-nav-section",children:[(0,C.jsx)("h2",{children:i.label}),(0,C.jsx)(ya,{activeRoute:e,basePath:n,depth:t+1,nodes:i.items})]},`group:${i.label}`):(0,C.jsxs)("details",{className:"documentation-nav-folder",open:c,children:[(0,C.jsxs)("summary",{children:[(0,C.jsx)("span",{children:i.label}),(0,C.jsx)(va,{})]}),(0,C.jsx)("div",{children:(0,C.jsx)(ya,{activeRoute:e,basePath:n,depth:t+1,nodes:i.items})})]},`group:${i.label}`)}let l=i.kind==="page"?Te(n,i.route):i.href,a=i.kind==="page"&&i.route===e;return(0,C.jsxs)("a",{"aria-current":a?"page":void 0,className:a?"documentation-nav-link is-active":"documentation-nav-link",href:l,...ut(l),children:[(0,C.jsx)("span",{children:i.label}),sa(l)&&(0,C.jsx)(Zi,{})]},`${i.kind}:${l}`)})})}function Kf({data:e,onClose:n,open:t}){let r=(0,$t.useRef)(null);return Cr(t,r,n),t?(0,C.jsx)("div",{className:"documentation-modal-layer",role:"presentation",onMouseDown:i=>{i.currentTarget===i.target&&n()},children:(0,C.jsxs)("div",{className:"documentation-mobile-nav",role:"dialog","aria-modal":"true","aria-label":"Documentation navigation",ref:r,children:[(0,C.jsxs)("header",{children:[(0,C.jsx)("a",{"aria-label":`${St(e.config.name)} home`,className:"documentation-brand",href:e.config.theme.logoHref??Te(e.basePath,"/"),...ut(e.config.theme.logoHref??Te(e.basePath,"/")),children:(0,C.jsx)(Qf,{data:e})}),(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Close documentation navigation","data-autofocus":!0,children:(0,C.jsx)(ga,{})})]}),(0,C.jsx)("nav",{className:"documentation-page-tree",children:(0,C.jsx)(ya,{activeRoute:e.page.route,basePath:e.basePath,nodes:e.navigation})}),(0,C.jsxs)("footer",{children:[!e.config.theme.strictMode&&(0,C.jsx)(qf,{defaultMode:e.config.theme.defaultMode??"system"}),e.config.footer.map(i=>(0,C.jsx)("a",{href:i.href,...ut(i.href),children:i.label},`${i.label}:${i.href}`))]})]})}):null}function qf({defaultMode:e}){let[n,t]=(0,$t.useState)(e);(0,$t.useEffect)(()=>{let i=Gi("deepspace-documentation-theme");(i==="light"||i==="dark"||i==="system")&&t(i)},[]),(0,$t.useEffect)(()=>kb(n),[n]);let r=i=>{t(i),Yi("deepspace-documentation-theme",i)};return(0,C.jsxs)("div",{className:"documentation-theme-controls",role:"group","aria-label":"Theme preference",children:[(0,C.jsx)("button",{"aria-pressed":n==="system","aria-label":"Use system theme",onClick:()=>r("system"),type:"button",children:(0,C.jsx)(wf,{})}),(0,C.jsx)("button",{"aria-pressed":n==="light","aria-label":"Use light theme",onClick:()=>r("light"),type:"button",children:(0,C.jsx)(Tf,{})}),(0,C.jsx)("button",{"aria-pressed":n==="dark","aria-label":"Use dark theme",onClick:()=>r("dark"),type:"button",children:(0,C.jsx)(xf,{})})]})}function jf(e,n){return e.items.some(t=>t.kind==="page"?t.route===n:t.kind==="group"&&jf(t,n))}function kb(e){let n=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{document.documentElement.dataset.themeMode=e,document.documentElement.dataset.theme=e==="system"?n.matches?"dark":"light":e};return t(),n.addEventListener?.("change",t),()=>n.removeEventListener?.("change",t)}var je=J(un(),1);var D=J(Ie(),1);function $f({assistantEnabled:e,basePath:n,name:t,onAssistantOpen:r,onClose:i,onNavigate:l,open:a}){let c=(0,je.useRef)(null),o=(0,je.useRef)(null),[u,f]=(0,je.useState)(null),[s,d]=(0,je.useState)(!1),[h,E]=(0,je.useState)(""),[y,g]=(0,je.useState)(0);Cr(a,c,i),(0,je.useEffect)(()=>{!a||u||s||(d(!0),fetch(Te(n,"/search.json")).then(R=>R.ok?R.json():[]).then(f).catch(()=>f([])).finally(()=>d(!1)))},[n,u,s,a]),(0,je.useEffect)(()=>{a||(E(""),g(0))},[a]),(0,je.useEffect)(()=>{o.current?.querySelector(`#documentation-search-option-${y}`)?.scrollIntoView({block:"nearest"})},[y,h]);let m=(0,je.useMemo)(()=>pb(u??[]),[u]),T=(0,je.useMemo)(()=>Sb(m,h),[m,h]);if(!a)return null;let w=T.length+(e&&h.trim()?1:0),I=R=>{if(R.key==="ArrowDown"&&w>0)R.preventDefault(),g(x=>(x+1)%w);else if(R.key==="ArrowUp"&&w>0)R.preventDefault(),g(x=>(x-1+w)%w);else if(R.key==="Enter"){R.preventDefault();let x=y<T.length?T[y]:void 0;if(x){i();let k=Te(n,x.href);l?l(k):window.location.assign(k)}else e&&h.trim()&&r(h.trim())}};return(0,D.jsx)("div",{className:"documentation-modal-layer documentation-search-layer",role:"presentation",onMouseDown:R=>{R.currentTarget===R.target&&i()},children:(0,D.jsxs)("div",{className:"documentation-search-dialog",role:"dialog","aria-modal":"true","aria-label":"Search documentation",ref:c,children:[(0,D.jsxs)("label",{className:"documentation-search-input",children:[(0,D.jsx)(Xi,{}),(0,D.jsx)("input",{"aria-activedescendant":w>0?`documentation-search-option-${y}`:void 0,"aria-controls":"documentation-search-results","aria-expanded":"true","aria-label":`Search ${St(t)}`,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off","data-autofocus":!0,enterKeyHint:"go",onChange:R=>{E(R.target.value),g(0)},onKeyDown:I,placeholder:`Search ${t}`,role:"combobox",spellCheck:!1,value:h}),(0,D.jsx)("kbd",{children:"Esc"})]}),(0,D.jsxs)("div",{className:"documentation-search-results",id:"documentation-search-results",ref:o,role:"listbox","aria-label":"Search results",children:[!h.trim()&&(0,D.jsxs)("div",{className:"documentation-search-empty",children:[(0,D.jsx)(Tr,{}),(0,D.jsx)("strong",{children:"Find an answer in these docs"}),(0,D.jsx)("span",{children:"Search pages, headings, APIs, and examples."})]}),h.trim()&&s&&(0,D.jsx)("div",{className:"documentation-search-state",children:"Searching this documentation\u2026"}),h.trim()&&!s&&T.length===0&&(0,D.jsxs)("div",{className:"documentation-search-state",children:["No documentation matched \u201C",h.trim(),"\u201D."]}),T.map((R,x)=>(0,D.jsxs)("a",{"aria-selected":y===x,className:y===x?"documentation-search-result is-active":"documentation-search-result",href:Te(n,R.href),id:`documentation-search-option-${x}`,onClick:i,onMouseEnter:()=>g(x),role:"option",children:[(0,D.jsx)("span",{className:"documentation-search-kind",children:R.kind==="section"?(0,D.jsx)(Sf,{}):(0,D.jsx)(ba,{})}),(0,D.jsxs)("span",{className:"documentation-search-copy",children:[(0,D.jsx)("strong",{children:Ab(R.title,h)}),R.kind==="section"?(0,D.jsxs)("span",{className:"documentation-search-crumbs",children:[R.context,(0,D.jsx)(pt,{}),R.title]}):(0,D.jsx)("small",{children:R.context})]}),(0,D.jsx)(pt,{})]},R.href)),e&&h.trim()&&(0,D.jsxs)("button",{"aria-selected":y===T.length,className:y===T.length?"documentation-search-assistant is-active":"documentation-search-assistant",id:`documentation-search-option-${T.length}`,onClick:()=>r(h.trim()),onMouseEnter:()=>g(T.length),role:"option",type:"button",children:[(0,D.jsx)(ha,{}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"Ask DeepSpace"}),(0,D.jsx)("small",{children:"Answer from the current documentation with citations"})]}),(0,D.jsx)(pt,{})]})]}),(0,D.jsxs)("footer",{children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"\u2191"}),(0,D.jsx)("kbd",{children:"\u2193"})," select"]}),(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"\u21B5"})," open"]}),(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"esc"})," close"]})]})]})})}function pb(e){return e.map(n=>({entry:n,title:Qi(n.title),headings:n.headings.map(t=>({heading:t,normalized:Qi(t.text)})),headingText:Qi(n.headings.map(t=>t.text).join(" ")),haystack:Qi(`${n.description??""} ${n.text}`)}))}function Sb(e,n){let t=Qi(n);if(!t)return[];let r=t.split(" ").filter(Boolean),i=[];for(let{entry:l,title:a,headings:c,headingText:o,haystack:u}of e){let f=a===t?180:a.startsWith(t)?110:a.includes(t)?75:0;o.includes(t)&&(f+=55);for(let s of r)a.includes(s)?f+=24:o.includes(s)?f+=14:u.includes(s)?f+=5:f-=18;f>0&&i.push({route:l.route,score:f,result:{href:l.route,kind:"page",title:l.title,context:l.description??l.text.slice(0,150)}});for(let{heading:s,normalized:d}of c){let h=d===t?120:d.startsWith(t)?80:d.includes(t)?60:0;if(h===0)for(let E of r)d.includes(E)&&(h+=18);h<=0||i.push({route:`${l.route}#${s.id}`,score:h,result:{href:`${l.route}#${s.id}`,kind:"section",title:s.text,context:l.title}})}}return i.sort((l,a)=>a.score-l.score||l.route.localeCompare(a.route)).slice(0,10).map(l=>l.result)}function Ab(e,n){let t=n.trim();if(!t)return e;let r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:(0,D.jsxs)(D.Fragment,{children:[e.slice(0,r),(0,D.jsx)("mark",{children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function Qi(e){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}var ze=J(Ie(),1);function ed({data:e,children:n,navigating:t=!1,onNavigate:r}){let[i,l]=(0,Bn.useState)(!1),[a,c]=(0,Bn.useState)(!1),[o,u]=(0,Bn.useState)(!1),[f,s]=(0,Bn.useState)(""),[d,h]=(0,Bn.useState)({id:0,submit:!1}),E=e.config.assistant.access==="disabled"?null:e.config.assistant.access,y=E!==null,g=["documentation-app",y?"has-assistant":"",o?"is-assistant-open":"",t?"is-navigating":""].filter(Boolean).join(" "),m=(0,Bn.useCallback)((T,w=!1)=>{T!==void 0&&s(T),h(I=>({id:I.id+1,submit:w,value:T})),c(!1),u(!0)},[]);return(0,Bn.useEffect)(()=>{let T=w=>{(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="k"&&(w.preventDefault(),c(!0)),(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="i"&&(w.preventDefault(),e.config.assistant.access!=="disabled"&&m())};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[e.config.assistant.access,m]),(0,Bn.useEffect)(()=>{l(!1),c(!1)},[e.page.route]),(0,ze.jsxs)("div",{"aria-busy":t||void 0,className:g,children:[(0,ze.jsx)("a",{className:"documentation-skip-link",href:"#documentation-content",children:"Skip to main content"}),(0,ze.jsx)(Jf,{data:e,onMenuOpen:()=>l(!0),onSearchOpen:()=>c(!0)}),(0,ze.jsxs)("div",{className:"documentation-frame",children:[(0,ze.jsx)(Vf,{data:e}),(0,ze.jsx)("main",{className:"documentation-main",id:"documentation-content",children:(0,ze.jsxs)("div",{className:"documentation-reader-grid",children:[(0,ze.jsx)("div",{className:"documentation-reader-column",children:(0,ze.jsx)(Ff,{data:e,launcher:E&&!o?(0,ze.jsx)(Yf,{input:f,name:e.config.name,onInputChange:s,onSubmit:T=>m(T,!0)}):void 0,onAssistantOpen:m,children:n})}),(0,ze.jsx)(Bf,{data:e})]})})]}),(0,ze.jsx)(Kf,{data:e,onClose:()=>l(!1),open:i}),(0,ze.jsx)($f,{assistantEnabled:y,basePath:e.basePath,name:e.config.name,onAssistantOpen:m,onClose:()=>c(!1),onNavigate:r,open:a}),E&&(0,ze.jsx)(Xf,{access:E,basePath:e.basePath,input:f,name:e.config.name,onClose:()=>u(!1),onInputChange:s,open:o,route:e.page.route,seed:d,suggestions:e.config.assistant.suggestions})]})}function Ib(e){return(0,td.renderToString)((0,nd.createElement)(ed,{data:e}))}0&&(module.exports={renderDefaultDocumentation});
|
|
68
68
|
/*! Bundled license information:
|
|
69
69
|
|
|
70
70
|
react/cjs/react.production.js:
|
|
@@ -11,7 +11,7 @@ Error generating stack: `+a.message+`
|
|
|
11
11
|
${c}`)}),[e.config.assistant.access,e.page.title,a]);return(0,z.jsxs)("article",{className:"documentation-article",ref:l,children:[(0,z.jsx)(W0,{items:e.breadcrumbs}),(0,z.jsxs)("header",{className:"documentation-article-header",children:[(0,z.jsxs)("div",{className:"documentation-article-meta",children:[e.config.theme.eyebrowStyle!=="none"&&(0,z.jsx)("div",{className:"documentation-eyebrow",children:e.page.kind==="openapi"?"API reference":e.config.theme.eyebrowStyle==="breadcrumbs"?e.breadcrumbs.join(" / "):e.breadcrumbs[0]??"Documentation"}),(0,z.jsx)(mg,{data:e,onAssistantOpen:a})]}),(0,z.jsx)("h1",{children:e.page.title}),e.page.description&&(0,z.jsx)("p",{className:"documentation-lede",children:e.page.description})]}),(0,z.jsx)(F0,{headings:yg(e.page.headings)}),(0,z.jsxs)(fg,{value:i,children:[t??(0,z.jsx)("div",{className:"documentation-prose","data-prose":"html",dangerouslySetInnerHTML:{__html:e.page.html}}),u.map(c=>(0,pg.createPortal)((0,z.jsx)(Vf,{readCode:()=>tv(c.pre)}),c.host,c.key))]}),e.page.openapi?.playground&&(0,z.jsx)(I0,{operation:e.page.openapi}),n&&(0,z.jsx)("div",{className:"documentation-launcher-dock",children:n}),(0,z.jsxs)("nav",{className:"documentation-pagination","aria-label":"Page navigation",children:[e.previous?(0,z.jsxs)("a",{rel:"prev",href:lt(e.basePath,e.previous.route),children:[(0,z.jsx)("small",{children:"Previous"}),(0,z.jsxs)("span",{children:[(0,z.jsx)(zn,{className:"is-back"}),e.previous.title]})]}):(0,z.jsx)("span",{}),e.next?(0,z.jsxs)("a",{rel:"next",href:lt(e.basePath,e.next.route),children:[(0,z.jsx)("small",{children:"Next"}),(0,z.jsxs)("span",{children:[e.next.title,(0,z.jsx)(zn,{})]})]}):(0,z.jsx)("span",{})]})]})}function W0({items:t}){return(0,z.jsx)("nav",{className:"documentation-breadcrumbs","aria-label":"Breadcrumb",children:t.map((e,n)=>(0,z.jsxs)("span",{children:[n>0&&(0,z.jsx)(zn,{}),e]},`${e}:${t.slice(0,n+1).join("/")}`))})}function yg(t){return t.filter(e=>e.depth===2||e.depth===3)}function vg({active:t,headings:e}){return(0,z.jsx)(z.Fragment,{children:e.map(n=>(0,z.jsx)("a",{"aria-current":t===n.id?"location":void 0,className:`${n.depth===3?"depth-3 ":""}${t===n.id?"is-active":""}`,href:`#${n.id}`,children:n.text},n.id))})}function F0({headings:t}){return t.length===0?null:(0,z.jsxs)("details",{className:"documentation-outline-disclosure",children:[(0,z.jsxs)("summary",{children:[(0,z.jsx)(ig,{}),"On this page"]}),(0,z.jsx)("nav",{className:"documentation-outline","aria-label":"On this page",children:(0,z.jsx)(vg,{active:"",headings:t})})]})}function bg({data:t}){let e=(0,Ot.useMemo)(()=>yg(t.page.headings),[t.page.headings]),[n,a]=(0,Ot.useState)(e[0]?.id??"");return(0,Ot.useEffect)(()=>a(e[0]?.id??""),[e]),(0,Ot.useEffect)(()=>{let l=null,u=()=>{l=null;let o=document.documentElement,s=(Number.parseFloat(getComputedStyle(o).scrollPaddingTop)||96)+4,h=o.scrollHeight>window.innerHeight+4&&window.innerHeight+window.scrollY>=o.scrollHeight-2,m=e[0]?.id??"";for(let p of e){let S=document.getElementById(p.id);if(S)if(S.getBoundingClientRect().top<=s)m=p.id;else break}if(h){let p=decodeURIComponent(window.location.hash.slice(1));if(p&&e.some(S=>S.id===p)){let S=document.getElementById(p)?.getBoundingClientRect().top;S!==void 0&&S>s&&S<window.innerHeight&&(m=p)}}a(m)},i=()=>{l===null&&(l=window.requestAnimationFrame(u))},c=o=>{o.target instanceof Element&&o.target.closest(".documentation-outline a")&&window.setTimeout(i,0)};return u(),window.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",i,{passive:!0}),window.addEventListener("popstate",i),window.addEventListener("hashchange",i),document.addEventListener("click",c),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i),window.removeEventListener("popstate",i),window.removeEventListener("hashchange",i),document.removeEventListener("click",c),l!==null&&window.cancelAnimationFrame(l)}},[e]),(0,z.jsx)("aside",{className:"documentation-context-rail","aria-label":"Page context",children:e.length>0&&(0,z.jsxs)("nav",{className:"documentation-outline","aria-label":"On this page",children:[(0,z.jsx)("h2",{children:"On this page"}),(0,z.jsx)(vg,{active:n,headings:e})]})})}function I0({operation:t}){let[e,n]=(0,Ot.useState)(""),[a,l]=(0,Ot.useState)(""),[u,i]=(0,Ot.useState)("No request sent."),[c,o]=(0,Ot.useState)(!1);if(!t.baseUrl)return null;let s=`${t.baseUrl.replace(/\/$/,"")}${t.path}`,g=async()=>{o(!0),i("Sending request\u2026");try{let h={};a&&(h.Authorization=`Bearer ${a}`),e.trim()&&(h["Content-Type"]="application/json");let m=await fetch(s,{method:t.method,headers:h,body:["GET","HEAD"].includes(t.method)?void 0:e.trim()||void 0}),p=await m.text();i(`${m.status} ${m.statusText}
|
|
12
12
|
|
|
13
13
|
${p}`)}catch(h){i(Gi(h))}finally{o(!1)}};return(0,z.jsxs)("section",{className:"documentation-playground","data-playground":!0,children:[(0,z.jsxs)("div",{className:"documentation-playground-title",children:[(0,z.jsxs)("div",{children:[(0,z.jsx)("span",{className:`method method-${t.method.toLowerCase()}`,children:t.method}),(0,z.jsx)("strong",{children:"Try this operation"})]}),(0,z.jsx)("code",{children:s})]}),(0,z.jsx)("p",{children:"Requests run in your browser. Tokens stay in memory and never enter search or assistant context."}),(0,z.jsxs)("label",{children:[(0,z.jsx)("span",{children:"Bearer token"}),(0,z.jsx)("input",{type:"password",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:a,onChange:h=>l(h.target.value),placeholder:"Optional"})]}),(0,z.jsxs)("label",{children:[(0,z.jsx)("span",{children:"JSON body"}),(0,z.jsx)("textarea",{rows:7,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:e,onChange:h=>n(h.target.value),placeholder:"{}"})]}),(0,z.jsx)("button",{type:"button",disabled:c,onClick:g,children:c?"Sending\u2026":`Send ${t.method} request`}),(0,z.jsx)("pre",{"aria-live":"polite",children:u})]})}function P0(t,e){let[n,a]=(0,Ot.useState)([]);return(0,Ot.useEffect)(()=>{let l=t.current;if(!l)return;let u=[],i=[];return l.querySelectorAll(gg+" pre").forEach((c,o)=>{let s=document.createElement("div");s.className="documentation-code-block",c.replaceWith(s),s.appendChild(c);let g=c.getAttribute("data-code-title");if(g&&!s.closest("[data-tab-group]")){let p=document.createElement("div");p.className="documentation-code-title",p.textContent=g,s.insertBefore(p,c)}let h=document.createElement("div");h.className="documentation-code-actions";let m=Kf(c.querySelector("code")?.className??"");if(m){let p=document.createElement("span");p.className="documentation-code-language",p.textContent=m,h.appendChild(p)}s.appendChild(h),u.push({block:s,pre:c}),i.push({key:`${e}:${o}`,host:h,pre:c})}),a(i),()=>{a([]);for(let{block:c,pre:o}of u)c.replaceWith(o)}},[t,e]),n}function tv(t){return t.querySelector("code")?.textContent??t.textContent??""}function ev(t,e){(0,Ot.useEffect)(()=>{let n=t.current;if(!n)return;let a=[];return n.querySelectorAll(`${gg} [data-tab-group]`).forEach((l,u)=>{if(l.querySelector(":scope > .documentation-tab-buttons"))return;let i=Array.from(l.querySelectorAll(":scope > [data-tab]"));if(i.length===0)return;let c=document.createElement("div");c.className="documentation-tab-buttons",c.setAttribute("role","tablist");let o=i.map((S,T)=>S.dataset.tabTitle??`Tab ${T+1}`),s=(S,T=!1)=>{if(i.forEach((v,r)=>{v.hidden=r!==S,v.setAttribute("role","tabpanel")}),Array.from(c.querySelectorAll("button")).forEach((v,r)=>{v.setAttribute("aria-selected",r===S?"true":"false"),v.setAttribute("tabindex",r===S?"0":"-1")}),T){let v=o[S];v&&(Ka("deepspace-documentation-tab-selection",v),document.dispatchEvent(new CustomEvent("deepspace-documentation-tab-change",{detail:{label:v,source:l}})))}};i.forEach((S,T)=>{let v=document.createElement("button");v.type="button",v.id=`documentation-tab-${u}-${T}`,v.setAttribute("role","tab"),v.textContent=o[T],S.setAttribute("aria-labelledby",v.id);let r=()=>s(T,!0),f=d=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(d.key))return;d.preventDefault();let y=d.key==="Home"?0:d.key==="End"?i.length-1:(T+(d.key==="ArrowRight"?1:-1)+i.length)%i.length;s(y),c.querySelectorAll("button")[y]?.focus()};v.addEventListener("click",r),v.addEventListener("keydown",f),c.appendChild(v),a.push(()=>{v.removeEventListener("click",r),v.removeEventListener("keydown",f)})});let g=l.querySelector(":scope > .documentation-code-group-title");g&&l.insertBefore(c,g.nextSibling),g||l.insertBefore(c,l.firstChild);let h=S=>{let T=S.detail;if(!T?.label||T.source===l)return;let v=o.findIndex(r=>r===T.label);v>=0&&s(v)};document.addEventListener("deepspace-documentation-tab-change",h);let m=Va("deepspace-documentation-tab-selection"),p=m?o.findIndex(S=>S===m):-1;s(p>=0?p:0),a.push(()=>{document.removeEventListener("deepspace-documentation-tab-change",h),c.remove()})}),()=>a.reverse().forEach(l=>l())},[t,e.page.route])}var xt=Y(Zt(),1);function Sg(t){if(!t||t.startsWith(":")||!t.startsWith("data:"))return null;let e=t.slice(5).replace(/^ /,"").replace(/\r$/,"");if(e==="[DONE]")return null;try{let n=JSON.parse(e);return!n||typeof n!="object"?null:n}catch{return null}}function Nn(t){let e=t.trim();return!e||/^documentation$/i.test(e)?"documentation":/(?:\bdocs?|documentation)$/i.test(e)?e:`${e} documentation`}function Eg(t,e=12){let n=[];for(let l=0;l<t.length-1;l+=1){let u=t[l];if(u?.role!=="user"||u.state!==void 0||!u.text.trim())continue;let i=t[l+1];i?.role!=="assistant"||i.state!==void 0||!i.text.trim()||(n.push([{role:"user",content:u.text},{role:"assistant",content:i.text}]),l+=1)}let a=Math.max(0,Math.floor(e/2));return a===0?[]:n.slice(-a).flat()}var Dg=Y(Zt(),1);function Fa(t,e,n,a=!0,l){(0,Dg.useEffect)(()=>{if(!t)return;let u=document.activeElement,i=e.current,c=window.requestAnimationFrame(()=>{(i?.querySelector("[data-autofocus]")??i?.querySelector("button,a,input,textarea"))?.focus()}),o=s=>{if(s.key==="Escape"){s.preventDefault(),n();return}if(!a||s.key!=="Tab"||!i)return;let g=Array.from(i.querySelectorAll('a[href],button:not([disabled]),input:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])'));if(g.length===0)return;let h=g[0],m=g[g.length-1];s.shiftKey&&document.activeElement===h?(s.preventDefault(),m?.focus()):!s.shiftKey&&document.activeElement===m&&(s.preventDefault(),h?.focus())};return document.addEventListener("keydown",o),()=>{window.cancelAnimationFrame(c),document.removeEventListener("keydown",o),(l?document.getElementById(l):u?.isConnected&&u!==document.body&&!i?.contains(u)?u:null)?.focus()}},[n,t,e,l,a])}var x=Y(ut(),1);function Ag({input:t,name:e,onInputChange:n,onSubmit:a}){let l=Nn(e);return(0,x.jsxs)("form",{className:"documentation-assistant-launcher",id:"deepspace-documentation-assistant-launcher",onSubmit:i=>{i.preventDefault();let c=t.trim();c&&a(c)},children:[(0,x.jsx)("input",{"aria-label":`Ask the ${l} agent`,autoCapitalize:"sentences",autoComplete:"off",autoCorrect:"off",enterKeyHint:"send",id:"deepspace-documentation-assistant-launcher-input",maxLength:4e3,onChange:i=>n(i.target.value),placeholder:"Ask anything\u2026",spellCheck:!1,value:t}),(0,x.jsxs)("span",{"aria-hidden":"true",className:"documentation-launcher-hint",children:[(0,x.jsx)("kbd",{children:"\u2318"}),(0,x.jsx)("kbd",{children:"I"})]}),(0,x.jsx)("button",{className:"documentation-launcher-send",type:"submit",disabled:!t.trim(),"aria-label":"Send question to documentation agent",children:(0,x.jsx)(kf,{})})]})}function Cg({access:t,basePath:e,input:n,name:a,onClose:l,onInputChange:u,open:i,route:c,seed:o,suggestions:s}){let g=(0,xt.useRef)(null),h=(0,xt.useRef)(null),m=(0,xt.useRef)(null),p=(0,xt.useRef)(null),S=(0,xt.useRef)(null),T=(0,xt.useRef)(null),v=(0,xt.useRef)(0),[r,f]=(0,xt.useState)([{id:"welcome",role:"assistant",text:`I can search the ${Nn(a)} and cite the exact pages I use.`}]),[d,y]=(0,xt.useState)(!1);if(Fa(i,g,l,!1,"deepspace-documentation-assistant-launcher-input"),(0,xt.useEffect)(()=>{if(!i||o.id===0||v.current===o.id||(v.current=o.id,!o.submit||!o.value?.trim()))return;T.current=o.value;let b=window.requestAnimationFrame(()=>h.current?.requestSubmit());return()=>window.cancelAnimationFrame(b)},[i,o]),(0,xt.useEffect)(()=>{let b=m.current;b&&(b.scrollTop=b.scrollHeight)},[r]),(0,xt.useEffect)(()=>{let b=p.current;b&&(b.style.height="auto",b.style.height=`${Math.min(b.scrollHeight,160)}px`,b.style.overflowY=b.scrollHeight>160?"auto":"hidden")},[n,i]),(0,xt.useEffect)(()=>()=>S.current?.abort(),[]),!i)return null;let D=async b=>{b?.preventDefault();let R=(T.current??n).trim();if(T.current=null,!R||d)return;let C=Eg(r);u(""),y(!0);let O=`user-${Date.now()}`,F=`assistant-${Date.now()}`;f(We=>[...We,{id:O,role:"user",text:R},{id:F,role:"assistant",text:"",state:"streaming",status:"Searching this documentation\u2026"}]);let rt=new AbortController;S.current=rt;let Pa=!1,Ff=window.setTimeout(()=>{f(We=>We.map(me=>me.id===F?{...me,status:"Still working through the documentation\u2026"}:me))},12e3),Qg=window.setTimeout(()=>{Pa=!0,rt.abort()},12e4);try{let We={"Content-Type":"application/json"};if(t==="authenticated"){let pe=await fetch("/api/auth/token",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}}),dt=pe.ok?await pe.json().catch(()=>null):null;if(!dt?.token)throw new Error("Sign in to use the documentation assistant.");We.Authorization=`Bearer ${dt.token}`}let me=await fetch(lt(e,"/api/ai"),{method:"POST",headers:We,body:JSON.stringify({question:R,route:c,messages:C}),signal:rt.signal});if(!me.ok||!me.body){let pe=await me.json().catch(()=>null);throw new Error(pe?.error??`Assistant unavailable (${me.status})`)}let Wi=me.body.getReader(),In=new TextDecoder,tl="",Fi="",If=pe=>{let dt=Sg(pe);if(dt){if(dt.type==="text-delta"&&typeof dt.delta=="string")Fi+=dt.delta,f(Rn=>Rn.map(ze=>ze.id===F?{...ze,text:Fi,state:"streaming",status:void 0}:ze));else if(dt.type==="tool-input-available"){let Rn=dt.toolName==="documentation_read"?"Reading the relevant source pages\u2026":"Searching this documentation\u2026";f(ze=>ze.map(Ii=>Ii.id===F?{...Ii,status:Rn}:Ii))}else if(dt.type==="tool-output-available")f(Rn=>Rn.map(ze=>ze.id===F?{...ze,status:"Reviewing the source material\u2026"}:ze));else if(dt.type==="error")throw new Error(typeof dt.errorText=="string"?dt.errorText:"The assistant stream failed.")}};for(;;){let pe=await Wi.read();if(pe.done)break;tl+=In.decode(pe.value,{stream:!0});let dt=tl.split(/\r?\n/);tl=dt.pop()??"";for(let Rn of dt)If(Rn)}tl+=In.decode(),If(tl),f(pe=>pe.map(dt=>dt.id===F?{...dt,text:Fi||"No answer was returned.",state:void 0}:dt))}catch(We){let me=Pa?"The documentation search took too long. Try a narrower question.":rt.signal.aborted?"Response stopped.":Gi(We);f(Wi=>Wi.map(In=>In.id===F?{...In,text:me,state:"error"}:In))}finally{window.clearTimeout(Ff),window.clearTimeout(Qg),S.current=null,y(!1)}},M=s??["How do I get started?","Show me a complete example","What should I understand first?"];return(0,x.jsxs)("aside",{"aria-label":"Documentation assistant",className:"documentation-assistant",id:"deepspace-documentation-assistant",ref:g,role:"complementary",children:[(0,x.jsxs)("header",{children:[(0,x.jsx)("div",{children:(0,x.jsxs)("span",{children:[(0,x.jsxs)("strong",{id:"deepspace-documentation-assistant-title",children:["Ask ",a]}),(0,x.jsx)("small",{children:"Answers from this documentation build"})]})}),(0,x.jsx)("button",{type:"button",onClick:l,"aria-label":"Close documentation assistant",children:(0,x.jsx)(Qi,{})})]}),(0,x.jsxs)("div",{className:"documentation-assistant-messages",ref:m,"aria-live":"polite",children:[r.map(b=>(0,x.jsx)("div",{className:`documentation-assistant-message is-${b.role}${b.state?` is-${b.state}`:""}`,children:(0,x.jsxs)("div",{children:[b.role==="assistant"?(0,x.jsx)(nv,{value:b.text}):b.text,b.state==="streaming"&&!b.text&&(0,x.jsxs)("span",{className:"documentation-assistant-activity",role:"status",children:[(0,x.jsx)("span",{"aria-hidden":"true"}),b.status??"Working\u2026"]})]})},b.id)),r.length===1&&(0,x.jsxs)("div",{className:"documentation-assistant-suggestions",children:[(0,x.jsx)("p",{children:"Try asking"}),M.map(b=>(0,x.jsx)("button",{type:"button",onClick:()=>u(b),children:b},b))]})]}),(0,x.jsxs)("form",{className:"documentation-assistant-composer",onSubmit:D,ref:h,children:[(0,x.jsx)("textarea",{"aria-label":"Ask a documentation question",autoCapitalize:"sentences",autoComplete:"off",autoCorrect:"off","data-autofocus":!0,enterKeyHint:"send",maxLength:4e3,onChange:b=>u(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),D())},placeholder:"Ask a question about this documentation",ref:p,rows:1,spellCheck:!1,value:n}),d?(0,x.jsx)("button",{type:"button",onClick:()=>S.current?.abort(),"aria-label":"Stop response",children:(0,x.jsx)(lg,{})}):(0,x.jsx)("button",{type:"submit",disabled:!n.trim(),"aria-label":"Send question",children:(0,x.jsx)(kf,{})})]}),(0,x.jsx)("footer",{children:"Responses cite this deployment and may still contain mistakes."})]})}function nv({value:t}){let e=[],n=/```([^\n`]*)\n([\s\S]*?)(?:```|$)/g,a=0;for(let l of t.matchAll(n)){let u=l.index??0;u>a&&e.push(...Tg(t.slice(a,u),`text-${a}`)),e.push((0,x.jsx)(av,{code:(l[2]??"").replace(/\n$/,""),language:(l[1]??"").trim().split(/\s+/,1)[0]??""},`code-${u}`)),a=u+l[0].length}return a<t.length&&e.push(...Tg(t.slice(a),`text-${a}`)),(0,x.jsx)("div",{className:"documentation-assistant-markdown",children:e})}function av({code:t,language:e}){let[n,a]=(0,xt.useState)(!1);return(0,x.jsxs)("figure",{className:"documentation-assistant-code",children:[(0,x.jsxs)("figcaption",{children:[(0,x.jsx)("span",{children:e||"Code"}),(0,x.jsx)("button",{type:"button",onClick:async()=>{await Mn(t),a(!0),window.setTimeout(()=>a(!1),1400)},children:n?"Copied":"Copy"})]}),(0,x.jsx)("pre",{children:(0,x.jsx)("code",{children:t})})]})}function Tg(t,e){let n=t.split(`
|
|
14
|
-
`),a=[],l=0;for(;l<n.length;){let u=n[l]?.trim()??"";if(!u){l+=1;continue}let i=u.match(/^(#{1,4})\s+(.+)$/);if(i){a.push((0,x.jsx)("strong",{className:"documentation-assistant-heading",children:$f(i[2])},`${e}-heading-${l}`)),l+=1;continue}let c=/^[-*]\s+/.test(u),o=/^\d+[.)]\s+/.test(u);if(c||o){let g=[];for(;l<n.length;){let h=n[l]?.trim()??"",m=c?h.match(/^[-*]\s+(.+)$/):h.match(/^\d+[.)]\s+(.+)$/);if(!m)break;g.push((0,x.jsx)("li",{children:$f(m[1])},`${e}-item-${l}`)),l+=1}a.push(c?(0,x.jsx)("ul",{children:g},`${e}-list-${l}`):(0,x.jsx)("ol",{children:g},`${e}-list-${l}`));continue}let s=[u];for(l+=1;l<n.length;){let g=n[l]?.trim()??"";if(!g||/^(?:#{1,4}\s+|[-*]\s+|\d+[.)]\s+)/.test(g))break;s.push(g),l+=1}a.push((0,x.jsx)("p",{children:s.map((g,h)=>(0,x.jsxs)("span",{children:[$f(g),h<s.length-1&&" "]},`${h}:${g.slice(0,18)}`))},`${e}-paragraph-${l}`))}return a}function $f(t){let e=/(\[[^\]]+\]\((?:https?:\/\/|\/)[^)]+\)|`[^`]+`|\*\*[^*]+\*\*)/g;return t.split(e).filter(Boolean).map((n,a)=>{let l=n.match(/^\[([^\]]+)\]\(((?:https?:\/\/|\/)[^)]+)\)$/);return l?(0,x.jsx)("a",{href:l[2],...Je(l[2]),children:l[1]},`${a}:${n}`):n.startsWith("`")&&n.endsWith("`")?(0,x.jsx)("code",{children:n.slice(1,-1)},`${a}:${n}`):n.startsWith("**")&&n.endsWith("**")?(0,x.jsx)("strong",{children:n.slice(2,-2)},`${a}:${n}`):(0,x.jsx)("span",{children:n},`${a}:${n}`)})}var Fn=Y(Zt(),1);var Mg="0.22.0";var A=Y(ut(),1);function zg({data:t,onMenuOpen:e,onSearchOpen:n}){return(0,A.jsxs)("header",{className:"documentation-header",children:[(0,A.jsx)("a",{className:"documentation-brand",href:t.config.theme.logoHref??lt(t.basePath,"/"),"aria-label":`${Nn(t.config.name)} home`,...Je(t.config.theme.logoHref??lt(t.basePath,"/")),children:(0,A.jsx)(Ng,{data:t})}),(0,A.jsx)("div",{className:"documentation-header-center",children:(0,A.jsxs)("button",{className:"documentation-search-trigger",type:"button",onClick:n,"aria-label":"Search documentation",children:[(0,A.jsx)(au,{}),(0,A.jsx)("span",{children:"Search documentation"}),(0,A.jsx)("kbd",{children:"\u2318K"})]})}),(0,A.jsx)("nav",{className:"documentation-top-links","aria-label":"Product navigation",children:t.config.links.map(a=>(0,A.jsxs)("a",{href:a.href,...Je(a.href),children:[a.label,Yi(a.href)&&(0,A.jsx)(lu,{})]},`${a.label}:${a.href}`))}),(0,A.jsxs)("div",{className:"documentation-mobile-actions",children:[(0,A.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Search documentation",children:(0,A.jsx)(au,{})}),(0,A.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:e,"aria-label":"Open documentation navigation",children:(0,A.jsx)(Fp,{})})]})]})}function Ng({data:t}){let{logo:e,logoDark:n}=t.config.theme;return e?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-light",src:e,alt:""}),(0,A.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-dark",src:n??e,alt:""}),(0,A.jsx)("span",{className:"documentation-brand-product",children:"Documentation"})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("span",{className:"documentation-brand-mark",children:(0,A.jsx)(Ja,{})}),(0,A.jsx)("span",{className:"documentation-brand-name",children:t.config.name})]})}function Rg({data:t}){return(0,A.jsxs)("aside",{className:"documentation-sidebar","aria-label":"Documentation navigation",children:[(0,A.jsx)("nav",{className:"documentation-page-tree",children:(0,A.jsx)(Vi,{activeRoute:t.page.route,basePath:t.basePath,nodes:t.navigation})}),(0,A.jsxs)("div",{className:"documentation-sidebar-footer",children:[!t.config.theme.strictMode&&(0,A.jsx)(xg,{defaultMode:t.config.theme.defaultMode??"system"}),t.config.footer.length>0&&(0,A.jsx)("nav",{"aria-label":"Documentation footer",children:t.config.footer.map(e=>(0,A.jsx)("a",{href:e.href,...Je(e.href),children:e.label},`${e.label}:${e.href}`))}),(0,A.jsx)("span",{children:`Built with deepspace ${Mg}`})]})]})}function Vi({activeRoute:t,basePath:e,depth:n=0,nodes:a}){return(0,A.jsx)(A.Fragment,{children:a.map(l=>{if(l.kind==="group"){let c=_g(l,t);return n===0?(0,A.jsxs)("section",{className:"documentation-nav-section",children:[(0,A.jsx)("h2",{children:l.label}),(0,A.jsx)(Vi,{activeRoute:t,basePath:e,depth:n+1,nodes:l.items})]},`group:${l.label}`):(0,A.jsxs)("details",{className:"documentation-nav-folder",open:c,children:[(0,A.jsxs)("summary",{children:[(0,A.jsx)("span",{children:l.label}),(0,A.jsx)(ki,{})]}),(0,A.jsx)("div",{children:(0,A.jsx)(Vi,{activeRoute:t,basePath:e,depth:n+1,nodes:l.items})})]},`group:${l.label}`)}let u=l.kind==="page"?lt(e,l.route):l.href,i=l.kind==="page"&&l.route===t;return(0,A.jsxs)("a",{"aria-current":i?"page":void 0,className:i?"documentation-nav-link is-active":"documentation-nav-link",href:u,...Je(u),children:[(0,A.jsx)("span",{children:l.label}),Yi(u)&&(0,A.jsx)(lu,{})]},`${l.kind}:${u}`)})})}function Og({data:t,onClose:e,open:n}){let a=(0,Fn.useRef)(null);return Fa(n,a,e),n?(0,A.jsx)("div",{className:"documentation-modal-layer",role:"presentation",onMouseDown:l=>{l.currentTarget===l.target&&e()},children:(0,A.jsxs)("div",{className:"documentation-mobile-nav",role:"dialog","aria-modal":"true","aria-label":"Documentation navigation",ref:a,children:[(0,A.jsxs)("header",{children:[(0,A.jsx)("a",{"aria-label":`${Nn(t.config.name)} home`,className:"documentation-brand",href:t.config.theme.logoHref??lt(t.basePath,"/"),...Je(t.config.theme.logoHref??lt(t.basePath,"/")),children:(0,A.jsx)(Ng,{data:t})}),(0,A.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:e,"aria-label":"Close documentation navigation","data-autofocus":!0,children:(0,A.jsx)(Qi,{})})]}),(0,A.jsx)("nav",{className:"documentation-page-tree",children:(0,A.jsx)(Vi,{activeRoute:t.page.route,basePath:t.basePath,nodes:t.navigation})}),(0,A.jsxs)("footer",{children:[!t.config.theme.strictMode&&(0,A.jsx)(xg,{defaultMode:t.config.theme.defaultMode??"system"}),t.config.footer.map(l=>(0,A.jsx)("a",{href:l.href,...Je(l.href),children:l.label},`${l.label}:${l.href}`))]})]})}):null}function xg({defaultMode:t}){let[e,n]=(0,Fn.useState)(t);(0,Fn.useEffect)(()=>{let l=Va("deepspace-documentation-theme");(l==="light"||l==="dark"||l==="system")&&n(l)},[]),(0,Fn.useEffect)(()=>uv(e),[e]);let a=l=>{n(l),Ka("deepspace-documentation-theme",l)};return(0,A.jsxs)("div",{className:"documentation-theme-controls",role:"group","aria-label":"Theme preference",children:[(0,A.jsx)("button",{"aria-pressed":e==="system","aria-label":"Use system theme",onClick:()=>a("system"),type:"button",children:(0,A.jsx)(tg,{})}),(0,A.jsx)("button",{"aria-pressed":e==="light","aria-label":"Use light theme",onClick:()=>a("light"),type:"button",children:(0,A.jsx)(Ip,{})}),(0,A.jsx)("button",{"aria-pressed":e==="dark","aria-label":"Use dark theme",onClick:()=>a("dark"),type:"button",children:(0,A.jsx)(Pp,{})})]})}function _g(t,e){return t.items.some(n=>n.kind==="page"?n.route===e:n.kind==="group"&&_g(n,e))}function uv(t){let e=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>{document.documentElement.dataset.themeMode=t,document.documentElement.dataset.theme=t==="system"?e.matches?"dark":"light":t};return n(),e.addEventListener?.("change",n),()=>e.removeEventListener?.("change",n)}var Bt=Y(Zt(),1);var H=Y(ut(),1);function Ug({assistantEnabled:t,basePath:e,name:n,onAssistantOpen:a,onClose:l,onNavigate:u,open:i}){let c=(0,Bt.useRef)(null),o=(0,Bt.useRef)(null),[s,g]=(0,Bt.useState)(null),[h,m]=(0,Bt.useState)(!1),[p,S]=(0,Bt.useState)(""),[T,v]=(0,Bt.useState)(0);Fa(i,c,l),(0,Bt.useEffect)(()=>{!i||s||h||(m(!0),fetch(lt(e,"/search.json")).then(D=>D.ok?D.json():[]).then(g).catch(()=>g([])).finally(()=>m(!1)))},[e,s,h,i]),(0,Bt.useEffect)(()=>{i||(S(""),v(0))},[i]),(0,Bt.useEffect)(()=>{o.current?.querySelector(`#documentation-search-option-${T}`)?.scrollIntoView({block:"nearest"})},[T,p]);let r=(0,Bt.useMemo)(()=>iv(s??[]),[s]),f=(0,Bt.useMemo)(()=>cv(r,p),[r,p]);if(!i)return null;let d=f.length+(t&&p.trim()?1:0),y=D=>{if(D.key==="ArrowDown"&&d>0)D.preventDefault(),v(M=>(M+1)%d);else if(D.key==="ArrowUp"&&d>0)D.preventDefault(),v(M=>(M-1+d)%d);else if(D.key==="Enter"){D.preventDefault();let M=T<f.length?f[T]:void 0;if(M){l();let b=lt(e,M.href);u?u(b):window.location.assign(b)}else t&&p.trim()&&a(p.trim())}};return(0,H.jsx)("div",{className:"documentation-modal-layer documentation-search-layer",role:"presentation",onMouseDown:D=>{D.currentTarget===D.target&&l()},children:(0,H.jsxs)("div",{className:"documentation-search-dialog",role:"dialog","aria-modal":"true","aria-label":"Search documentation",ref:c,children:[(0,H.jsxs)("label",{className:"documentation-search-input",children:[(0,H.jsx)(au,{}),(0,H.jsx)("input",{"aria-activedescendant":d>0?`documentation-search-option-${T}`:void 0,"aria-controls":"documentation-search-results","aria-expanded":"true","aria-label":`Search ${Nn(n)}`,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off","data-autofocus":!0,enterKeyHint:"go",onChange:D=>{S(D.target.value),v(0)},onKeyDown:y,placeholder:`Search ${n}`,role:"combobox",spellCheck:!1,value:p}),(0,H.jsx)("kbd",{children:"Esc"})]}),(0,H.jsxs)("div",{className:"documentation-search-results",id:"documentation-search-results",ref:o,role:"listbox","aria-label":"Search results",children:[!p.trim()&&(0,H.jsxs)("div",{className:"documentation-search-empty",children:[(0,H.jsx)(Ja,{}),(0,H.jsx)("strong",{children:"Find an answer in these docs"}),(0,H.jsx)("span",{children:"Search pages, headings, APIs, and examples."})]}),p.trim()&&h&&(0,H.jsx)("div",{className:"documentation-search-state",children:"Searching this documentation\u2026"}),p.trim()&&!h&&f.length===0&&(0,H.jsxs)("div",{className:"documentation-search-state",children:["No documentation matched \u201C",p.trim(),"\u201D."]}),f.map((D,M)=>(0,H.jsxs)("a",{"aria-selected":T===M,className:T===M?"documentation-search-result is-active":"documentation-search-result",href:lt(e,D.href),id:`documentation-search-option-${M}`,onClick:l,onMouseEnter:()=>v(M),role:"option",children:[(0,H.jsx)("span",{className:"documentation-search-kind",children:D.kind==="section"?(0,H.jsx)(ug,{}):(0,H.jsx)(Zi,{})}),(0,H.jsxs)("span",{className:"documentation-search-copy",children:[(0,H.jsx)("strong",{children:ov(D.title,p)}),D.kind==="section"?(0,H.jsxs)("span",{className:"documentation-search-crumbs",children:[D.context,(0,H.jsx)(zn,{}),D.title]}):(0,H.jsx)("small",{children:D.context})]}),(0,H.jsx)(zn,{})]},D.href)),t&&p.trim()&&(0,H.jsxs)("button",{"aria-selected":T===f.length,className:T===f.length?"documentation-search-assistant is-active":"documentation-search-assistant",id:`documentation-search-option-${f.length}`,onClick:()=>a(p.trim()),onMouseEnter:()=>v(f.length),role:"option",type:"button",children:[(0,H.jsx)(Xi,{}),(0,H.jsxs)("span",{children:[(0,H.jsx)("strong",{children:"Ask DeepSpace"}),(0,H.jsx)("small",{children:"Answer from the current documentation with citations"})]}),(0,H.jsx)(zn,{})]})]}),(0,H.jsxs)("footer",{children:[(0,H.jsxs)("span",{children:[(0,H.jsx)("kbd",{children:"\u2191"}),(0,H.jsx)("kbd",{children:"\u2193"})," select"]}),(0,H.jsxs)("span",{children:[(0,H.jsx)("kbd",{children:"\u21B5"})," open"]}),(0,H.jsxs)("span",{children:[(0,H.jsx)("kbd",{children:"esc"})," close"]})]})]})})}function iv(t){return t.map(e=>({entry:e,title:iu(e.title),headings:e.headings.map(n=>({heading:n,normalized:iu(n.text)})),headingText:iu(e.headings.map(n=>n.text).join(" ")),haystack:iu(`${e.description??""} ${e.text}`)}))}function cv(t,e){let n=iu(e);if(!n)return[];let a=n.split(" ").filter(Boolean),l=[];for(let{entry:u,title:i,headings:c,headingText:o,haystack:s}of t){let g=i===n?180:i.startsWith(n)?110:i.includes(n)?75:0;o.includes(n)&&(g+=55);for(let h of a)i.includes(h)?g+=24:o.includes(h)?g+=14:s.includes(h)?g+=5:g-=18;g>0&&l.push({route:u.route,score:g,result:{href:u.route,kind:"page",title:u.title,context:u.description??u.text.slice(0,150)}});for(let{heading:h,normalized:m}of c){let p=m===n?120:m.startsWith(n)?80:m.includes(n)?60:0;if(p===0)for(let S of a)m.includes(S)&&(p+=18);p<=0||l.push({route:`${u.route}#${h.id}`,score:p,result:{href:`${u.route}#${h.id}`,kind:"section",title:h.text,context:u.title}})}}return l.sort((u,i)=>i.score-u.score||u.route.localeCompare(i.route)).slice(0,10).map(u=>u.result)}function ov(t,e){let n=e.trim();if(!n)return t;let a=t.toLowerCase().indexOf(n.toLowerCase());return a<0?t:(0,H.jsxs)(H.Fragment,{children:[t.slice(0,a),(0,H.jsx)("mark",{children:t.slice(a,a+n.length)}),t.slice(a+n.length)]})}function iu(t){return t.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}var Ut=Y(ut(),1);function Hg({data:t,children:e,navigating:n=!1,onNavigate:a}){let[l,u]=(0,ve.useState)(!1),[i,c]=(0,ve.useState)(!1),[o,s]=(0,ve.useState)(!1),[g,h]=(0,ve.useState)(""),[m,p]=(0,ve.useState)({id:0,submit:!1}),S=t.config.assistant.access==="disabled"?null:t.config.assistant.access,T=S!==null,v=["documentation-app",T?"has-assistant":"",o?"is-assistant-open":"",n?"is-navigating":""].filter(Boolean).join(" "),r=(0,ve.useCallback)((f,d=!1)=>{f!==void 0&&h(f),p(y=>({id:y.id+1,submit:d,value:f})),c(!1),s(!0)},[]);return(0,ve.useEffect)(()=>{let f=d=>{(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k"&&(d.preventDefault(),c(!0)),(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="i"&&(d.preventDefault(),t.config.assistant.access!=="disabled"&&r())};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[t.config.assistant.access,r]),(0,ve.useEffect)(()=>{u(!1),c(!1)},[t.page.route]),(0,Ut.jsxs)("div",{"aria-busy":n||void 0,className:v,children:[(0,Ut.jsx)("a",{className:"documentation-skip-link",href:"#documentation-content",children:"Skip to main content"}),(0,Ut.jsx)(zg,{data:t,onMenuOpen:()=>u(!0),onSearchOpen:()=>c(!0)}),(0,Ut.jsxs)("div",{className:"documentation-frame",children:[(0,Ut.jsx)(Rg,{data:t}),(0,Ut.jsx)("main",{className:"documentation-main",id:"documentation-content",children:(0,Ut.jsxs)("div",{className:"documentation-reader-grid",children:[(0,Ut.jsx)("div",{className:"documentation-reader-column",children:(0,Ut.jsx)(hg,{data:t,launcher:S&&!o?(0,Ut.jsx)(Ag,{input:g,name:t.config.name,onInputChange:h,onSubmit:f=>r(f,!0)}):void 0,onAssistantOpen:r,children:e})}),(0,Ut.jsx)(bg,{data:t})]})})]}),(0,Ut.jsx)(Og,{data:t,onClose:()=>u(!1),open:l}),(0,Ut.jsx)(Ug,{assistantEnabled:T,basePath:t.basePath,name:t.config.name,onAssistantOpen:r,onClose:()=>c(!1),onNavigate:a,open:i}),S&&(0,Ut.jsx)(Cg,{access:S,basePath:t.basePath,input:g,name:t.config.name,onClose:()=>s(!1),onInputChange:h,open:o,route:t.page.route,seed:m,suggestions:t.config.assistant.suggestions})]})}var $e=Y(Zt(),1);var X=Y(ut(),1);function Ki({children:t,title:e,kind:n}){let a=e??n.charAt(0).toUpperCase()+n.slice(1);return(0,X.jsxs)("aside",{className:`documentation-callout documentation-callout-${n}`,children:[(0,X.jsx)("strong",{children:a}),t]})}function fv(t){return(0,X.jsx)(Ki,{...t,kind:"note"})}function sv(t){return(0,X.jsx)(Ki,{...t,kind:"tip"})}function rv(t){return(0,X.jsx)(Ki,{...t,kind:"warning"})}function dv(t){return(0,X.jsx)(Ki,{...t,kind:"info"})}function mv({children:t,href:e,label:n,title:a}){let l=(0,X.jsxs)(X.Fragment,{children:[a??n?(0,X.jsx)("strong",{children:a??n}):null,t]});return e?(0,X.jsxs)("a",{className:"documentation-card",href:e,children:[l,(0,X.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]}):(0,X.jsx)("div",{className:"documentation-card",children:l})}function pv({children:t,label:e,title:n}){return(0,X.jsxs)("details",{className:"documentation-accordion",children:[(0,X.jsx)("summary",{children:n??e??"Details"}),t]})}function gv({children:t}){return(0,X.jsx)("div",{className:"documentation-accordion-group",children:t})}function hv({children:t,label:e,title:n}){return(0,X.jsxs)("section",{className:"documentation-step",children:[n??e?(0,X.jsx)("h3",{children:n??e}):null,t]})}function yv({children:t}){return(0,X.jsx)("div",{className:"documentation-steps",children:t})}function vv({children:t,label:e,title:n}){return(0,X.jsx)("section",{className:"documentation-tab","data-tab":!0,"data-tab-title":n??e??"Tab",children:t})}function bv({children:t}){return(0,X.jsx)(Jf,{className:"documentation-tabs",panels:Ev(t)})}function Sv({children:t,label:e,title:n}){let a=$e.Children.toArray(t).map((l,u)=>({label:Dv(l)??`Example ${u+1}`,content:l}));return(0,X.jsx)(rg,{value:!0,children:(0,X.jsx)(Jf,{className:"documentation-code-group",panels:a,title:n??e?(0,X.jsx)("div",{className:"documentation-code-group-title",children:n??e}):void 0})})}function Ev(t){return $e.Children.toArray(t).map((e,n)=>{let a=(0,$e.isValidElement)(e)?e.props:void 0;return{label:a?.title??a?.label??`Tab ${n+1}`,content:a&&"children"in a?a.children:e}})}function Dv(t){if(!(0,$e.isValidElement)(t))return;let e=t.props.children;if(!(0,$e.isValidElement)(e))return;let n=e.props["data-code-title"];return typeof n=="string"&&n?n:void 0}function Ia({level:t,...e}){let n=e.id;return(0,$e.createElement)(`h${t}`,e,e.children,n?(0,X.jsx)("a",{"aria-label":"Link to this section",className:"documentation-heading-anchor",href:`#${n}`,children:"#"}):null)}var Lg={pre:dg,Accordion:pv,AccordionGroup:gv,Card:mv,CodeGroup:Sv,Info:dv,Note:fv,Step:hv,Steps:yv,Tab:vv,Tabs:bv,Tip:sv,Warning:rv,h1:t=>(0,X.jsx)(Ia,{...t,level:1}),h2:t=>(0,X.jsx)(Ia,{...t,level:2}),h3:t=>(0,X.jsx)(Ia,{...t,level:3}),h4:t=>(0,X.jsx)(Ia,{...t,level:4}),h5:t=>(0,X.jsx)(Ia,{...t,level:5}),h6:t=>(0,X.jsx)(Ia,{...t,level:6})};var Ji=Y(ut(),1),qg=Hg;function Bg({data:t,Page:e}){return e?(0,Ji.jsx)("div",{className:"documentation-prose","data-prose":"react",children:(0,Ji.jsx)(e,{components:Lg})}):(0,Ji.jsx)("div",{className:"documentation-prose","data-prose":"html",dangerouslySetInnerHTML:{__html:t.page.html}})}var Tv=new Set(["7z","avif","css","csv","gif","gz","ico","jpeg","jpg","js","json","map","md","mjs","mp3","mp4","pdf","png","svg","tar","txt","wasm","webm","webp","woff","woff2","xml","yaml","yml","zip"]);function wg(t){let e=t.slice(t.lastIndexOf("/")+1),n=e.includes(".")?e.slice(e.lastIndexOf(".")+1).toLowerCase():"";return n!==""&&Tv.has(n)}var Av=new Set(["/mcp"]),Cv=["/api/","/assets/","/data/","/media/","/.well-known/"];function Wf(t,e="/docs"){if(!t.startsWith("/")||t.startsWith("//"))return!1;let n=t.split(/[?#]/,1)[0]??"",a=wi(e,n);return!a||Av.has(a)||Cv.some(l=>a.startsWith(l))?!1:!wg(a)}var $i=Y(ut(),1);function Mv({initialData:t,loadPage:e,pages:n={},Site:a=qg}){let[l,u]=(0,St.useState)(t),i=t.basePath,[c,o]=(0,St.useState)(!1),s=(0,St.useRef)(new Map),g=(0,St.useRef)(new Map),h=(0,St.useRef)({config:t.config,navigation:t.navigation}),m=(0,St.useRef)(0),p=(0,St.useRef)(!1),S=(0,St.useRef)(null),T=(0,St.useRef)(Za(new URL(window.location.href)));(0,St.useEffect)(()=>{let y=document.getElementById("deepspace-documentation-root");y?.setAttribute("data-documentation-hydrated","true"),s.current.set(Za(new URL(window.location.href)),kp(t));let D=history.scrollRestoration;history.scrollRestoration="manual",Wn(window.scrollY);let M=()=>{p.current||S.current===null&&(S.current=window.requestAnimationFrame(()=>{S.current=null,Wn(window.scrollY)}))},b=()=>{let R=Qf().scrollY;p.current=!0,r(window.location.href,"none",R)};return window.addEventListener("scroll",M,{passive:!0}),window.addEventListener("popstate",b),()=>{window.removeEventListener("scroll",M),window.removeEventListener("popstate",b),S.current!==null&&window.cancelAnimationFrame(S.current),history.scrollRestoration=D,y?.removeAttribute("data-documentation-hydrated")}},[]);let v=(0,St.useCallback)(async y=>{let D=Za(y),M=s.current.get(D);if(M)return M;let b=g.current.get(D);if(b)return b;let R=(async()=>{let C=await fetch(Vp(y,i),{headers:{Accept:"application/json","x-deepspace-documentation-navigation":"true"}});if(!C.ok)throw new Error(`Route data returned ${C.status}`);let O=await C.json();if(!O?.data?.page||typeof O.title!="string")throw new Error("Navigation response did not contain valid DeepSpace documentation route data");let F={...O,data:{...h.current,...O.data}};return s.current.set(D,F),F})();g.current.set(D,R);try{return await R}finally{g.current.get(D)===R&&g.current.delete(D)}},[i]),r=(0,St.useCallback)(async(y,D="push",M)=>{let b=new URL(y,window.location.href);if(b.origin!==window.location.origin){window.location.assign(b.href);return}let R=new URL(window.location.href),C=Za(b);if(C===T.current){D==="push"&&b.href!==R.href&&(Wn(window.scrollY),history.pushState({deepspaceDocumentation:!0,scrollY:0},"",b.href)),Xf(b,D==="none"?M:void 0),p.current=!1,Wn(window.scrollY);return}let O=++m.current,F=window.setTimeout(()=>{O===m.current&&o(!0)},120);try{let rt=await v(b);if(await e?.(rt.data.page.route),O!==m.current)return;D==="push"&&(Wn(window.scrollY),history.pushState({deepspaceDocumentation:!0,scrollY:0},"",b.href)),Zp(rt,b),T.current=C,(0,Gg.flushSync)(()=>u(rt.data)),Xf(b,D==="none"?M:void 0),p.current=!1,Wn(window.scrollY);let Pa=document.activeElement;Pa instanceof Element&&Pa.closest(".documentation-assistant, .documentation-assistant-launcher, .documentation-search-dialog")||Kp(),O===m.current&&o(!1)}catch(rt){if(O!==m.current)return;p.current=!1,console.error("[DeepSpace Documentation] Client navigation failed; falling back to a document navigation",rt),D==="none"?window.location.reload():window.location.assign(b.href)}finally{window.clearTimeout(F)}},[v,e]),f=(0,St.useCallback)(y=>{let D=new URL(y,window.location.href);D.origin!==window.location.origin||s.current.has(Za(D))||v(D).then(M=>e?.(M.data.page.route)).catch(()=>{})},[v,e]);(0,St.useEffect)(()=>{let y=document.getElementById("deepspace-documentation-root");if(!y)return;let D=C=>C instanceof Element?C.closest("a[href]"):null,M=C=>{if(C.defaultPrevented||C.button!==0||C.metaKey||C.ctrlKey||C.shiftKey||C.altKey)return;let O=D(C.target);if(!O||O.target||O.hasAttribute("download"))return;let F=O.getAttribute("href");if(!F||!Wf(F,i))return;let rt=new URL(F,window.location.href);rt.origin===window.location.origin&&(rt.pathname===window.location.pathname&&rt.search===window.location.search&&rt.hash||(C.preventDefault(),r(`${rt.pathname}${rt.search}${rt.hash}`)))},b=C=>{let O=D(C.target)?.getAttribute("href");O&&Wf(O,i)&&f(O)},R=C=>{let O=C.target instanceof Element?C.target:null;!O||O.closest("[data-prose], .documentation-assistant-messages, input, textarea")||C.preventDefault()};return y.addEventListener("click",M),y.addEventListener("focusin",b),y.addEventListener("mouseover",b),y.addEventListener("pointerdown",b),y.addEventListener("dragstart",R),()=>{y.removeEventListener("click",M),y.removeEventListener("focusin",b),y.removeEventListener("mouseover",b),y.removeEventListener("pointerdown",b),y.removeEventListener("dragstart",R)}},[i,r,f]),(0,St.useEffect)(()=>{let y=window.setTimeout(()=>{l.previous&&f(lt(i,l.previous.route)),l.next&&f(lt(i,l.next.route))},350);return()=>window.clearTimeout(y)},[i,l.next,l.page.route,l.previous,f]);let d=(0,$i.jsx)(Bg,{Page:n[l.page.route],data:l});return(0,$i.jsx)(a,{data:l,navigating:c,onNavigate:y=>{r(y)},onPrefetch:f,children:d})}var Yg=!1;function Xg({loadPage:t,pages:e,Site:n}={}){let a=document.getElementById("deepspace-documentation-root"),l=document.getElementById("deepspace-documentation-data");if(!(Yg||!a||!l?.textContent))try{let u=JSON.parse(l.textContent);Yg=!0,(0,jg.hydrateRoot)(a,(0,$i.jsx)(Mv,{initialData:u,loadPage:t,pages:e,Site:n}))}catch(u){a.setAttribute("data-hydration-error","true"),console.error("[DeepSpace Documentation] Unable to hydrate the documentation surface",u)}}Xg();})();
|
|
14
|
+
`),a=[],l=0;for(;l<n.length;){let u=n[l]?.trim()??"";if(!u){l+=1;continue}let i=u.match(/^(#{1,4})\s+(.+)$/);if(i){a.push((0,x.jsx)("strong",{className:"documentation-assistant-heading",children:$f(i[2])},`${e}-heading-${l}`)),l+=1;continue}let c=/^[-*]\s+/.test(u),o=/^\d+[.)]\s+/.test(u);if(c||o){let g=[];for(;l<n.length;){let h=n[l]?.trim()??"",m=c?h.match(/^[-*]\s+(.+)$/):h.match(/^\d+[.)]\s+(.+)$/);if(!m)break;g.push((0,x.jsx)("li",{children:$f(m[1])},`${e}-item-${l}`)),l+=1}a.push(c?(0,x.jsx)("ul",{children:g},`${e}-list-${l}`):(0,x.jsx)("ol",{children:g},`${e}-list-${l}`));continue}let s=[u];for(l+=1;l<n.length;){let g=n[l]?.trim()??"";if(!g||/^(?:#{1,4}\s+|[-*]\s+|\d+[.)]\s+)/.test(g))break;s.push(g),l+=1}a.push((0,x.jsx)("p",{children:s.map((g,h)=>(0,x.jsxs)("span",{children:[$f(g),h<s.length-1&&" "]},`${h}:${g.slice(0,18)}`))},`${e}-paragraph-${l}`))}return a}function $f(t){let e=/(\[[^\]]+\]\((?:https?:\/\/|\/)[^)]+\)|`[^`]+`|\*\*[^*]+\*\*)/g;return t.split(e).filter(Boolean).map((n,a)=>{let l=n.match(/^\[([^\]]+)\]\(((?:https?:\/\/|\/)[^)]+)\)$/);return l?(0,x.jsx)("a",{href:l[2],...Je(l[2]),children:l[1]},`${a}:${n}`):n.startsWith("`")&&n.endsWith("`")?(0,x.jsx)("code",{children:n.slice(1,-1)},`${a}:${n}`):n.startsWith("**")&&n.endsWith("**")?(0,x.jsx)("strong",{children:n.slice(2,-2)},`${a}:${n}`):(0,x.jsx)("span",{children:n},`${a}:${n}`)})}var Fn=Y(Zt(),1);var Mg="0.22.1";var A=Y(ut(),1);function zg({data:t,onMenuOpen:e,onSearchOpen:n}){return(0,A.jsxs)("header",{className:"documentation-header",children:[(0,A.jsx)("a",{className:"documentation-brand",href:t.config.theme.logoHref??lt(t.basePath,"/"),"aria-label":`${Nn(t.config.name)} home`,...Je(t.config.theme.logoHref??lt(t.basePath,"/")),children:(0,A.jsx)(Ng,{data:t})}),(0,A.jsx)("div",{className:"documentation-header-center",children:(0,A.jsxs)("button",{className:"documentation-search-trigger",type:"button",onClick:n,"aria-label":"Search documentation",children:[(0,A.jsx)(au,{}),(0,A.jsx)("span",{children:"Search documentation"}),(0,A.jsx)("kbd",{children:"\u2318K"})]})}),(0,A.jsx)("nav",{className:"documentation-top-links","aria-label":"Product navigation",children:t.config.links.map(a=>(0,A.jsxs)("a",{href:a.href,...Je(a.href),children:[a.label,Yi(a.href)&&(0,A.jsx)(lu,{})]},`${a.label}:${a.href}`))}),(0,A.jsxs)("div",{className:"documentation-mobile-actions",children:[(0,A.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Search documentation",children:(0,A.jsx)(au,{})}),(0,A.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:e,"aria-label":"Open documentation navigation",children:(0,A.jsx)(Fp,{})})]})]})}function Ng({data:t}){let{logo:e,logoDark:n}=t.config.theme;return e?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-light",src:e,alt:""}),(0,A.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-dark",src:n??e,alt:""}),(0,A.jsx)("span",{className:"documentation-brand-product",children:"Documentation"})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("span",{className:"documentation-brand-mark",children:(0,A.jsx)(Ja,{})}),(0,A.jsx)("span",{className:"documentation-brand-name",children:t.config.name})]})}function Rg({data:t}){return(0,A.jsxs)("aside",{className:"documentation-sidebar","aria-label":"Documentation navigation",children:[(0,A.jsx)("nav",{className:"documentation-page-tree",children:(0,A.jsx)(Vi,{activeRoute:t.page.route,basePath:t.basePath,nodes:t.navigation})}),(0,A.jsxs)("div",{className:"documentation-sidebar-footer",children:[!t.config.theme.strictMode&&(0,A.jsx)(xg,{defaultMode:t.config.theme.defaultMode??"system"}),t.config.footer.length>0&&(0,A.jsx)("nav",{"aria-label":"Documentation footer",children:t.config.footer.map(e=>(0,A.jsx)("a",{href:e.href,...Je(e.href),children:e.label},`${e.label}:${e.href}`))}),(0,A.jsx)("span",{children:`Built with deepspace ${Mg}`})]})]})}function Vi({activeRoute:t,basePath:e,depth:n=0,nodes:a}){return(0,A.jsx)(A.Fragment,{children:a.map(l=>{if(l.kind==="group"){let c=_g(l,t);return n===0?(0,A.jsxs)("section",{className:"documentation-nav-section",children:[(0,A.jsx)("h2",{children:l.label}),(0,A.jsx)(Vi,{activeRoute:t,basePath:e,depth:n+1,nodes:l.items})]},`group:${l.label}`):(0,A.jsxs)("details",{className:"documentation-nav-folder",open:c,children:[(0,A.jsxs)("summary",{children:[(0,A.jsx)("span",{children:l.label}),(0,A.jsx)(ki,{})]}),(0,A.jsx)("div",{children:(0,A.jsx)(Vi,{activeRoute:t,basePath:e,depth:n+1,nodes:l.items})})]},`group:${l.label}`)}let u=l.kind==="page"?lt(e,l.route):l.href,i=l.kind==="page"&&l.route===t;return(0,A.jsxs)("a",{"aria-current":i?"page":void 0,className:i?"documentation-nav-link is-active":"documentation-nav-link",href:u,...Je(u),children:[(0,A.jsx)("span",{children:l.label}),Yi(u)&&(0,A.jsx)(lu,{})]},`${l.kind}:${u}`)})})}function Og({data:t,onClose:e,open:n}){let a=(0,Fn.useRef)(null);return Fa(n,a,e),n?(0,A.jsx)("div",{className:"documentation-modal-layer",role:"presentation",onMouseDown:l=>{l.currentTarget===l.target&&e()},children:(0,A.jsxs)("div",{className:"documentation-mobile-nav",role:"dialog","aria-modal":"true","aria-label":"Documentation navigation",ref:a,children:[(0,A.jsxs)("header",{children:[(0,A.jsx)("a",{"aria-label":`${Nn(t.config.name)} home`,className:"documentation-brand",href:t.config.theme.logoHref??lt(t.basePath,"/"),...Je(t.config.theme.logoHref??lt(t.basePath,"/")),children:(0,A.jsx)(Ng,{data:t})}),(0,A.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:e,"aria-label":"Close documentation navigation","data-autofocus":!0,children:(0,A.jsx)(Qi,{})})]}),(0,A.jsx)("nav",{className:"documentation-page-tree",children:(0,A.jsx)(Vi,{activeRoute:t.page.route,basePath:t.basePath,nodes:t.navigation})}),(0,A.jsxs)("footer",{children:[!t.config.theme.strictMode&&(0,A.jsx)(xg,{defaultMode:t.config.theme.defaultMode??"system"}),t.config.footer.map(l=>(0,A.jsx)("a",{href:l.href,...Je(l.href),children:l.label},`${l.label}:${l.href}`))]})]})}):null}function xg({defaultMode:t}){let[e,n]=(0,Fn.useState)(t);(0,Fn.useEffect)(()=>{let l=Va("deepspace-documentation-theme");(l==="light"||l==="dark"||l==="system")&&n(l)},[]),(0,Fn.useEffect)(()=>uv(e),[e]);let a=l=>{n(l),Ka("deepspace-documentation-theme",l)};return(0,A.jsxs)("div",{className:"documentation-theme-controls",role:"group","aria-label":"Theme preference",children:[(0,A.jsx)("button",{"aria-pressed":e==="system","aria-label":"Use system theme",onClick:()=>a("system"),type:"button",children:(0,A.jsx)(tg,{})}),(0,A.jsx)("button",{"aria-pressed":e==="light","aria-label":"Use light theme",onClick:()=>a("light"),type:"button",children:(0,A.jsx)(Ip,{})}),(0,A.jsx)("button",{"aria-pressed":e==="dark","aria-label":"Use dark theme",onClick:()=>a("dark"),type:"button",children:(0,A.jsx)(Pp,{})})]})}function _g(t,e){return t.items.some(n=>n.kind==="page"?n.route===e:n.kind==="group"&&_g(n,e))}function uv(t){let e=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>{document.documentElement.dataset.themeMode=t,document.documentElement.dataset.theme=t==="system"?e.matches?"dark":"light":t};return n(),e.addEventListener?.("change",n),()=>e.removeEventListener?.("change",n)}var Bt=Y(Zt(),1);var H=Y(ut(),1);function Ug({assistantEnabled:t,basePath:e,name:n,onAssistantOpen:a,onClose:l,onNavigate:u,open:i}){let c=(0,Bt.useRef)(null),o=(0,Bt.useRef)(null),[s,g]=(0,Bt.useState)(null),[h,m]=(0,Bt.useState)(!1),[p,S]=(0,Bt.useState)(""),[T,v]=(0,Bt.useState)(0);Fa(i,c,l),(0,Bt.useEffect)(()=>{!i||s||h||(m(!0),fetch(lt(e,"/search.json")).then(D=>D.ok?D.json():[]).then(g).catch(()=>g([])).finally(()=>m(!1)))},[e,s,h,i]),(0,Bt.useEffect)(()=>{i||(S(""),v(0))},[i]),(0,Bt.useEffect)(()=>{o.current?.querySelector(`#documentation-search-option-${T}`)?.scrollIntoView({block:"nearest"})},[T,p]);let r=(0,Bt.useMemo)(()=>iv(s??[]),[s]),f=(0,Bt.useMemo)(()=>cv(r,p),[r,p]);if(!i)return null;let d=f.length+(t&&p.trim()?1:0),y=D=>{if(D.key==="ArrowDown"&&d>0)D.preventDefault(),v(M=>(M+1)%d);else if(D.key==="ArrowUp"&&d>0)D.preventDefault(),v(M=>(M-1+d)%d);else if(D.key==="Enter"){D.preventDefault();let M=T<f.length?f[T]:void 0;if(M){l();let b=lt(e,M.href);u?u(b):window.location.assign(b)}else t&&p.trim()&&a(p.trim())}};return(0,H.jsx)("div",{className:"documentation-modal-layer documentation-search-layer",role:"presentation",onMouseDown:D=>{D.currentTarget===D.target&&l()},children:(0,H.jsxs)("div",{className:"documentation-search-dialog",role:"dialog","aria-modal":"true","aria-label":"Search documentation",ref:c,children:[(0,H.jsxs)("label",{className:"documentation-search-input",children:[(0,H.jsx)(au,{}),(0,H.jsx)("input",{"aria-activedescendant":d>0?`documentation-search-option-${T}`:void 0,"aria-controls":"documentation-search-results","aria-expanded":"true","aria-label":`Search ${Nn(n)}`,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off","data-autofocus":!0,enterKeyHint:"go",onChange:D=>{S(D.target.value),v(0)},onKeyDown:y,placeholder:`Search ${n}`,role:"combobox",spellCheck:!1,value:p}),(0,H.jsx)("kbd",{children:"Esc"})]}),(0,H.jsxs)("div",{className:"documentation-search-results",id:"documentation-search-results",ref:o,role:"listbox","aria-label":"Search results",children:[!p.trim()&&(0,H.jsxs)("div",{className:"documentation-search-empty",children:[(0,H.jsx)(Ja,{}),(0,H.jsx)("strong",{children:"Find an answer in these docs"}),(0,H.jsx)("span",{children:"Search pages, headings, APIs, and examples."})]}),p.trim()&&h&&(0,H.jsx)("div",{className:"documentation-search-state",children:"Searching this documentation\u2026"}),p.trim()&&!h&&f.length===0&&(0,H.jsxs)("div",{className:"documentation-search-state",children:["No documentation matched \u201C",p.trim(),"\u201D."]}),f.map((D,M)=>(0,H.jsxs)("a",{"aria-selected":T===M,className:T===M?"documentation-search-result is-active":"documentation-search-result",href:lt(e,D.href),id:`documentation-search-option-${M}`,onClick:l,onMouseEnter:()=>v(M),role:"option",children:[(0,H.jsx)("span",{className:"documentation-search-kind",children:D.kind==="section"?(0,H.jsx)(ug,{}):(0,H.jsx)(Zi,{})}),(0,H.jsxs)("span",{className:"documentation-search-copy",children:[(0,H.jsx)("strong",{children:ov(D.title,p)}),D.kind==="section"?(0,H.jsxs)("span",{className:"documentation-search-crumbs",children:[D.context,(0,H.jsx)(zn,{}),D.title]}):(0,H.jsx)("small",{children:D.context})]}),(0,H.jsx)(zn,{})]},D.href)),t&&p.trim()&&(0,H.jsxs)("button",{"aria-selected":T===f.length,className:T===f.length?"documentation-search-assistant is-active":"documentation-search-assistant",id:`documentation-search-option-${f.length}`,onClick:()=>a(p.trim()),onMouseEnter:()=>v(f.length),role:"option",type:"button",children:[(0,H.jsx)(Xi,{}),(0,H.jsxs)("span",{children:[(0,H.jsx)("strong",{children:"Ask DeepSpace"}),(0,H.jsx)("small",{children:"Answer from the current documentation with citations"})]}),(0,H.jsx)(zn,{})]})]}),(0,H.jsxs)("footer",{children:[(0,H.jsxs)("span",{children:[(0,H.jsx)("kbd",{children:"\u2191"}),(0,H.jsx)("kbd",{children:"\u2193"})," select"]}),(0,H.jsxs)("span",{children:[(0,H.jsx)("kbd",{children:"\u21B5"})," open"]}),(0,H.jsxs)("span",{children:[(0,H.jsx)("kbd",{children:"esc"})," close"]})]})]})})}function iv(t){return t.map(e=>({entry:e,title:iu(e.title),headings:e.headings.map(n=>({heading:n,normalized:iu(n.text)})),headingText:iu(e.headings.map(n=>n.text).join(" ")),haystack:iu(`${e.description??""} ${e.text}`)}))}function cv(t,e){let n=iu(e);if(!n)return[];let a=n.split(" ").filter(Boolean),l=[];for(let{entry:u,title:i,headings:c,headingText:o,haystack:s}of t){let g=i===n?180:i.startsWith(n)?110:i.includes(n)?75:0;o.includes(n)&&(g+=55);for(let h of a)i.includes(h)?g+=24:o.includes(h)?g+=14:s.includes(h)?g+=5:g-=18;g>0&&l.push({route:u.route,score:g,result:{href:u.route,kind:"page",title:u.title,context:u.description??u.text.slice(0,150)}});for(let{heading:h,normalized:m}of c){let p=m===n?120:m.startsWith(n)?80:m.includes(n)?60:0;if(p===0)for(let S of a)m.includes(S)&&(p+=18);p<=0||l.push({route:`${u.route}#${h.id}`,score:p,result:{href:`${u.route}#${h.id}`,kind:"section",title:h.text,context:u.title}})}}return l.sort((u,i)=>i.score-u.score||u.route.localeCompare(i.route)).slice(0,10).map(u=>u.result)}function ov(t,e){let n=e.trim();if(!n)return t;let a=t.toLowerCase().indexOf(n.toLowerCase());return a<0?t:(0,H.jsxs)(H.Fragment,{children:[t.slice(0,a),(0,H.jsx)("mark",{children:t.slice(a,a+n.length)}),t.slice(a+n.length)]})}function iu(t){return t.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}var Ut=Y(ut(),1);function Hg({data:t,children:e,navigating:n=!1,onNavigate:a}){let[l,u]=(0,ve.useState)(!1),[i,c]=(0,ve.useState)(!1),[o,s]=(0,ve.useState)(!1),[g,h]=(0,ve.useState)(""),[m,p]=(0,ve.useState)({id:0,submit:!1}),S=t.config.assistant.access==="disabled"?null:t.config.assistant.access,T=S!==null,v=["documentation-app",T?"has-assistant":"",o?"is-assistant-open":"",n?"is-navigating":""].filter(Boolean).join(" "),r=(0,ve.useCallback)((f,d=!1)=>{f!==void 0&&h(f),p(y=>({id:y.id+1,submit:d,value:f})),c(!1),s(!0)},[]);return(0,ve.useEffect)(()=>{let f=d=>{(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k"&&(d.preventDefault(),c(!0)),(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="i"&&(d.preventDefault(),t.config.assistant.access!=="disabled"&&r())};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[t.config.assistant.access,r]),(0,ve.useEffect)(()=>{u(!1),c(!1)},[t.page.route]),(0,Ut.jsxs)("div",{"aria-busy":n||void 0,className:v,children:[(0,Ut.jsx)("a",{className:"documentation-skip-link",href:"#documentation-content",children:"Skip to main content"}),(0,Ut.jsx)(zg,{data:t,onMenuOpen:()=>u(!0),onSearchOpen:()=>c(!0)}),(0,Ut.jsxs)("div",{className:"documentation-frame",children:[(0,Ut.jsx)(Rg,{data:t}),(0,Ut.jsx)("main",{className:"documentation-main",id:"documentation-content",children:(0,Ut.jsxs)("div",{className:"documentation-reader-grid",children:[(0,Ut.jsx)("div",{className:"documentation-reader-column",children:(0,Ut.jsx)(hg,{data:t,launcher:S&&!o?(0,Ut.jsx)(Ag,{input:g,name:t.config.name,onInputChange:h,onSubmit:f=>r(f,!0)}):void 0,onAssistantOpen:r,children:e})}),(0,Ut.jsx)(bg,{data:t})]})})]}),(0,Ut.jsx)(Og,{data:t,onClose:()=>u(!1),open:l}),(0,Ut.jsx)(Ug,{assistantEnabled:T,basePath:t.basePath,name:t.config.name,onAssistantOpen:r,onClose:()=>c(!1),onNavigate:a,open:i}),S&&(0,Ut.jsx)(Cg,{access:S,basePath:t.basePath,input:g,name:t.config.name,onClose:()=>s(!1),onInputChange:h,open:o,route:t.page.route,seed:m,suggestions:t.config.assistant.suggestions})]})}var $e=Y(Zt(),1);var X=Y(ut(),1);function Ki({children:t,title:e,kind:n}){let a=e??n.charAt(0).toUpperCase()+n.slice(1);return(0,X.jsxs)("aside",{className:`documentation-callout documentation-callout-${n}`,children:[(0,X.jsx)("strong",{children:a}),t]})}function fv(t){return(0,X.jsx)(Ki,{...t,kind:"note"})}function sv(t){return(0,X.jsx)(Ki,{...t,kind:"tip"})}function rv(t){return(0,X.jsx)(Ki,{...t,kind:"warning"})}function dv(t){return(0,X.jsx)(Ki,{...t,kind:"info"})}function mv({children:t,href:e,label:n,title:a}){let l=(0,X.jsxs)(X.Fragment,{children:[a??n?(0,X.jsx)("strong",{children:a??n}):null,t]});return e?(0,X.jsxs)("a",{className:"documentation-card",href:e,children:[l,(0,X.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]}):(0,X.jsx)("div",{className:"documentation-card",children:l})}function pv({children:t,label:e,title:n}){return(0,X.jsxs)("details",{className:"documentation-accordion",children:[(0,X.jsx)("summary",{children:n??e??"Details"}),t]})}function gv({children:t}){return(0,X.jsx)("div",{className:"documentation-accordion-group",children:t})}function hv({children:t,label:e,title:n}){return(0,X.jsxs)("section",{className:"documentation-step",children:[n??e?(0,X.jsx)("h3",{children:n??e}):null,t]})}function yv({children:t}){return(0,X.jsx)("div",{className:"documentation-steps",children:t})}function vv({children:t,label:e,title:n}){return(0,X.jsx)("section",{className:"documentation-tab","data-tab":!0,"data-tab-title":n??e??"Tab",children:t})}function bv({children:t}){return(0,X.jsx)(Jf,{className:"documentation-tabs",panels:Ev(t)})}function Sv({children:t,label:e,title:n}){let a=$e.Children.toArray(t).map((l,u)=>({label:Dv(l)??`Example ${u+1}`,content:l}));return(0,X.jsx)(rg,{value:!0,children:(0,X.jsx)(Jf,{className:"documentation-code-group",panels:a,title:n??e?(0,X.jsx)("div",{className:"documentation-code-group-title",children:n??e}):void 0})})}function Ev(t){return $e.Children.toArray(t).map((e,n)=>{let a=(0,$e.isValidElement)(e)?e.props:void 0;return{label:a?.title??a?.label??`Tab ${n+1}`,content:a&&"children"in a?a.children:e}})}function Dv(t){if(!(0,$e.isValidElement)(t))return;let e=t.props.children;if(!(0,$e.isValidElement)(e))return;let n=e.props["data-code-title"];return typeof n=="string"&&n?n:void 0}function Ia({level:t,...e}){let n=e.id;return(0,$e.createElement)(`h${t}`,e,e.children,n?(0,X.jsx)("a",{"aria-label":"Link to this section",className:"documentation-heading-anchor",href:`#${n}`,children:"#"}):null)}var Lg={pre:dg,Accordion:pv,AccordionGroup:gv,Card:mv,CodeGroup:Sv,Info:dv,Note:fv,Step:hv,Steps:yv,Tab:vv,Tabs:bv,Tip:sv,Warning:rv,h1:t=>(0,X.jsx)(Ia,{...t,level:1}),h2:t=>(0,X.jsx)(Ia,{...t,level:2}),h3:t=>(0,X.jsx)(Ia,{...t,level:3}),h4:t=>(0,X.jsx)(Ia,{...t,level:4}),h5:t=>(0,X.jsx)(Ia,{...t,level:5}),h6:t=>(0,X.jsx)(Ia,{...t,level:6})};var Ji=Y(ut(),1),qg=Hg;function Bg({data:t,Page:e}){return e?(0,Ji.jsx)("div",{className:"documentation-prose","data-prose":"react",children:(0,Ji.jsx)(e,{components:Lg})}):(0,Ji.jsx)("div",{className:"documentation-prose","data-prose":"html",dangerouslySetInnerHTML:{__html:t.page.html}})}var Tv=new Set(["7z","avif","css","csv","gif","gz","ico","jpeg","jpg","js","json","map","md","mjs","mp3","mp4","pdf","png","svg","tar","txt","wasm","webm","webp","woff","woff2","xml","yaml","yml","zip"]);function wg(t){let e=t.slice(t.lastIndexOf("/")+1),n=e.includes(".")?e.slice(e.lastIndexOf(".")+1).toLowerCase():"";return n!==""&&Tv.has(n)}var Av=new Set(["/mcp"]),Cv=["/api/","/assets/","/data/","/media/","/.well-known/"];function Wf(t,e="/docs"){if(!t.startsWith("/")||t.startsWith("//"))return!1;let n=t.split(/[?#]/,1)[0]??"",a=wi(e,n);return!a||Av.has(a)||Cv.some(l=>a.startsWith(l))?!1:!wg(a)}var $i=Y(ut(),1);function Mv({initialData:t,loadPage:e,pages:n={},Site:a=qg}){let[l,u]=(0,St.useState)(t),i=t.basePath,[c,o]=(0,St.useState)(!1),s=(0,St.useRef)(new Map),g=(0,St.useRef)(new Map),h=(0,St.useRef)({config:t.config,navigation:t.navigation}),m=(0,St.useRef)(0),p=(0,St.useRef)(!1),S=(0,St.useRef)(null),T=(0,St.useRef)(Za(new URL(window.location.href)));(0,St.useEffect)(()=>{let y=document.getElementById("deepspace-documentation-root");y?.setAttribute("data-documentation-hydrated","true"),s.current.set(Za(new URL(window.location.href)),kp(t));let D=history.scrollRestoration;history.scrollRestoration="manual",Wn(window.scrollY);let M=()=>{p.current||S.current===null&&(S.current=window.requestAnimationFrame(()=>{S.current=null,Wn(window.scrollY)}))},b=()=>{let R=Qf().scrollY;p.current=!0,r(window.location.href,"none",R)};return window.addEventListener("scroll",M,{passive:!0}),window.addEventListener("popstate",b),()=>{window.removeEventListener("scroll",M),window.removeEventListener("popstate",b),S.current!==null&&window.cancelAnimationFrame(S.current),history.scrollRestoration=D,y?.removeAttribute("data-documentation-hydrated")}},[]);let v=(0,St.useCallback)(async y=>{let D=Za(y),M=s.current.get(D);if(M)return M;let b=g.current.get(D);if(b)return b;let R=(async()=>{let C=await fetch(Vp(y,i),{headers:{Accept:"application/json","x-deepspace-documentation-navigation":"true"}});if(!C.ok)throw new Error(`Route data returned ${C.status}`);let O=await C.json();if(!O?.data?.page||typeof O.title!="string")throw new Error("Navigation response did not contain valid DeepSpace documentation route data");let F={...O,data:{...h.current,...O.data}};return s.current.set(D,F),F})();g.current.set(D,R);try{return await R}finally{g.current.get(D)===R&&g.current.delete(D)}},[i]),r=(0,St.useCallback)(async(y,D="push",M)=>{let b=new URL(y,window.location.href);if(b.origin!==window.location.origin){window.location.assign(b.href);return}let R=new URL(window.location.href),C=Za(b);if(C===T.current){D==="push"&&b.href!==R.href&&(Wn(window.scrollY),history.pushState({deepspaceDocumentation:!0,scrollY:0},"",b.href)),Xf(b,D==="none"?M:void 0),p.current=!1,Wn(window.scrollY);return}let O=++m.current,F=window.setTimeout(()=>{O===m.current&&o(!0)},120);try{let rt=await v(b);if(await e?.(rt.data.page.route),O!==m.current)return;D==="push"&&(Wn(window.scrollY),history.pushState({deepspaceDocumentation:!0,scrollY:0},"",b.href)),Zp(rt,b),T.current=C,(0,Gg.flushSync)(()=>u(rt.data)),Xf(b,D==="none"?M:void 0),p.current=!1,Wn(window.scrollY);let Pa=document.activeElement;Pa instanceof Element&&Pa.closest(".documentation-assistant, .documentation-assistant-launcher, .documentation-search-dialog")||Kp(),O===m.current&&o(!1)}catch(rt){if(O!==m.current)return;p.current=!1,console.error("[DeepSpace Documentation] Client navigation failed; falling back to a document navigation",rt),D==="none"?window.location.reload():window.location.assign(b.href)}finally{window.clearTimeout(F)}},[v,e]),f=(0,St.useCallback)(y=>{let D=new URL(y,window.location.href);D.origin!==window.location.origin||s.current.has(Za(D))||v(D).then(M=>e?.(M.data.page.route)).catch(()=>{})},[v,e]);(0,St.useEffect)(()=>{let y=document.getElementById("deepspace-documentation-root");if(!y)return;let D=C=>C instanceof Element?C.closest("a[href]"):null,M=C=>{if(C.defaultPrevented||C.button!==0||C.metaKey||C.ctrlKey||C.shiftKey||C.altKey)return;let O=D(C.target);if(!O||O.target||O.hasAttribute("download"))return;let F=O.getAttribute("href");if(!F||!Wf(F,i))return;let rt=new URL(F,window.location.href);rt.origin===window.location.origin&&(rt.pathname===window.location.pathname&&rt.search===window.location.search&&rt.hash||(C.preventDefault(),r(`${rt.pathname}${rt.search}${rt.hash}`)))},b=C=>{let O=D(C.target)?.getAttribute("href");O&&Wf(O,i)&&f(O)},R=C=>{let O=C.target instanceof Element?C.target:null;!O||O.closest("[data-prose], .documentation-assistant-messages, input, textarea")||C.preventDefault()};return y.addEventListener("click",M),y.addEventListener("focusin",b),y.addEventListener("mouseover",b),y.addEventListener("pointerdown",b),y.addEventListener("dragstart",R),()=>{y.removeEventListener("click",M),y.removeEventListener("focusin",b),y.removeEventListener("mouseover",b),y.removeEventListener("pointerdown",b),y.removeEventListener("dragstart",R)}},[i,r,f]),(0,St.useEffect)(()=>{let y=window.setTimeout(()=>{l.previous&&f(lt(i,l.previous.route)),l.next&&f(lt(i,l.next.route))},350);return()=>window.clearTimeout(y)},[i,l.next,l.page.route,l.previous,f]);let d=(0,$i.jsx)(Bg,{Page:n[l.page.route],data:l});return(0,$i.jsx)(a,{data:l,navigating:c,onNavigate:y=>{r(y)},onPrefetch:f,children:d})}var Yg=!1;function Xg({loadPage:t,pages:e,Site:n}={}){let a=document.getElementById("deepspace-documentation-root"),l=document.getElementById("deepspace-documentation-data");if(!(Yg||!a||!l?.textContent))try{let u=JSON.parse(l.textContent);Yg=!0,(0,jg.hydrateRoot)(a,(0,$i.jsx)(Mv,{initialData:u,loadPage:t,pages:e,Site:n}))}catch(u){a.setAttribute("data-hydration-error","true"),console.error("[DeepSpace Documentation] Unable to hydrate the documentation surface",u)}}Xg();})();
|
|
15
15
|
/*! Bundled license information:
|
|
16
16
|
|
|
17
17
|
react/cjs/react.production.js:
|
package/dist/documentation.js
CHANGED