PageSourceSearch

https://context7.com/_next/static/chunks/27434.eb7b7be7798b5da8.js

js context7.com collected 2026-10-02 03:41:05 UTC 34,268 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[27434],{3648:(e,t,s)=>{s.d(t,{_:()=>n});function n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}},10274:(e,t,s)=>{s.d(t,{A:()=>a});var n=s(95155);function a(e){let{url:t,title:s,scale:a,onLoad:i}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("iframe",{src:t,title:s,loading:"lazy",onLoad:i,sandbox:"allow-scripts allow-same-origin",scrolling:"no",tabIndex:-1,"aria-hidden":"true",className:"pointer-events-none origin-top-left border-0",style:{width:"calc(".concat(100/a,"% + 20px)"),height:"calc(".concat(100/a,"% + 8px)"),transform:"scale(".concat(a,")")}}),(0,n.jsx)("a",{href:t,target:"_blank",rel:"noreferrer","aria-label":"Open ".concat(t),className:"absolute inset-0 rounded-[inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"})]})}},19907:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","chart-bar","IconChartBar",[["path",{d:"M3 13a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M15 9a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M9 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M4 20h14",key:"svg-3"}]])},27042:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","history","IconHistory",[["path",{d:"M12 8l0 4l2 2",key:"svg-0"}],["path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5",key:"svg-1"}]])},28901:(e,t,s)=>{s.d(t,{ES:()=>i,gF:()=>a,yr:()=>l});var n=s(66020);function a(e){var t;return!!e&&(e.type===n.gM.PDF||e.type===n.gM.DOCX||e.type===n.gM.FILE||!!(null==(t=e.docsRepoUrl)?void 0:t.startsWith("uploaded://")))}function i(e){let{docsRepoUrl:t,docsSiteUrl:s,type:a,webUrl:i}=e.settings;if(a===n.gM.REPO)return t;if(a===n.gM.NOTION){var l,r;return function(e){let t=null==e?void 0:e.trim().replace(/-/g,"");if(t)return"https://www.notion.so/".concat(t)}(null==(r=e.notionSettings)||null==(l=r.pageIds)?void 0:l[0])||i||s||t}return i||s||t}function l(e){let t=i(e);if(t)return e.settings.type===n.gM.NOTION?"https://notion.so":t}},35722:(e,t,s)=>{s.r(t),s.d(t,{default:()=>ec});var n=s(95155),a=s(12746),i=s(89761),l=s(19332),r=s(80986),o=s(9516),d=s(14690),c=s(77962),u=s(37152),p=s(81805),h=s(98355),m=s(57102),x=s(20063),g=s(51693),v=s(72087),f=s(5869),b=s(68424),y=s(42029);function j(e){let{site:t}=e,s=(0,x.useRouter)(),{selectedProject:a}=(0,l.KT)(),[r,o]=(0,i.ZA)("connect",m.o5);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(f.A,{variant:"info",icon:(0,n.jsx)(g.Hk,{size:20}),children:[(0,n.jsx)("button",{type:"button","data-link":!0,className:"rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>void o(!0),children:"Connect GitHub"})," ","for automatic deployments, pull request previews, and Docs7 agents."]}),r&&(0,n.jsx)(v.A,{isOpen:!0,title:"Connect GitHub",onClose:()=>void o(!1),maxWidth:"lg",scrollable:!0,children:(0,n.jsx)(y.default,{kind:"interactive",teamspaceId:t.projectId,canPublish:!0,docs7ProEnabled:(null==a?void 0:a.docs7_pro_enabled)===!0,siteLimitReached:!1,localSite:t,oauthReturnUrl:(0,b.rj)({siteId:t.id,teamspaceId:t.projectId,connect:!0}),onConnected:e=>{let{site:n,deploymentId:a}=e;return s.replace((0,b.rj)({teamspaceId:t.projectId,siteId:n.id,deploymentId:null!=a?a:void 0}))}})})]})}var k=s(34308),A=s(56356),N=s(30928),w=s(63038);let C={uninstalled:{cause:"The Context7 GitHub App is not installed",link:"Install the app",variant:"error"},suspended:{cause:"The Context7 GitHub App is suspended",link:"Review on GitHub",variant:"error"},unreachable:{cause:"The Context7 GitHub App cannot reach this repository",link:"Review on GitHub",variant:"error"},incomplete:{cause:"Context7 needs new GitHub permissions",link:"Approve on GitHub",variant:"warning"}};function M(e){var t;let{teamspaceId:s,siteId:a,active:i,published:l}=e,r=(0,u.J4)(s,a,i).data;if(!r||"ok"===r.state)return null;let o=C[r.state],d="incomplete"===r.state?"".concat(o.cause,". ").concat(l?"Builds run":"The agent runs",", but some GitHub updates are unavailable."):"".concat(o.cause,", so ").concat(l?"new commits will not deploy":"the agent cannot open a pull request",".");return(0,n.jsxs)(f.A,{variant:o.variant,icon:(0,n.jsx)(N.A,{size:24,stroke:1.5}),children:[d," ",(0,n.jsx)("a",{href:null!=(t=r.manageUrl)?t:(0,w.Fu)(),target:"_blank",rel:"noreferrer",className:"whitespace-nowrap font-medium underline underline-offset-2",children:o.link})]})}var I=s(30313),D=(0,I.A)("outline","brand-intercom","IconBrandIntercom",[["path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M7 8v3",key:"svg-1"}],["path",{d:"M10 7v6",key:"svg-2"}],["path",{d:"M14 7v6",key:"svg-3"}],["path",{d:"M17 8v3",key:"svg-4"}],["path",{d:"M7 15c4 2.667 6 2.667 10 0",key:"svg-5"}]]),R=s(18720);function L(e){let{teamspaceId:t,siteId:s,notice:a,canEdit:i}=e,l=(0,u.bx)(t);if(!a)return null;let r="https://app.intercom.com/a/apps/".concat(encodeURIComponent(a.intercomAppId),"/messenger");return(0,n.jsxs)(f.A,{variant:"warning",title:"Finish Intercom setup",icon:(0,n.jsx)(D,{size:24,stroke:1.5}),children:[(0,n.jsxs)("span",{children:["Add ",(0,n.jsx)("code",{className:"font-mono text-[0.9em]",children:a.hostnames.join(", ")})," to your trusted domains so chat can appear on your docs."," "]}),(0,n.jsxs)("span",{className:"whitespace-nowrap",children:[(0,n.jsx)("a",{href:r,target:"_blank",rel:"noreferrer",children:"Open Intercom settings"})," \xb7 ",(0,n.jsx)("button",{type:"button","data-link":!0,disabled:!i||l.isPending,className:"rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",onClick:()=>l.mutate({siteId:s,noticeId:a.id},{onError:e=>R.oR.error("Unable to dismiss the setup notice",{description:e.message})}),children:"Dismiss"})]})]})}var z=s(69588),H=s(98131),O=s(17593),P=s(16810),U=s(38754);function S(e){var t,s,l;let{site:r,teamspaceId:o,active:d}=e,c=(0,u.cq)(o,r.id,d,"improve",P._J),p=(0,u.cq)(o,r.id,d,"review",P._J),[,h]=(0,i.ZA)("tab",m.pu),x=c.isLoading||p.isLoading,g=null!=(t=c.error)?t:p.error,v=[...null!=(s=c.data)?s:[],...null!=(l=p.data)?l:[]].sort((e,t)=>
1t.createdAt.localeCompare(e.createdAt)).slice(0,P._J),f=(0,H.u)(v.map(e=>e.id),!x),b=()=>void h("agent");return(0,n.jsx)(a.A,{title:"Recent agent runs",children:g?(0,n.jsx)(U.Fx,{children:g.message}):x?(0,n.jsxs)("div",{role:"status","aria-live":"polite",children:[(0,n.jsx)("span",{className:"sr-only",children:"Loading the agent runs"}),(0,n.jsx)(P._A,{})]}):0===v.length?(0,n.jsx)(U.Sv,{title:"No agent runs yet",children:"Runs of the Context7 Agent and the PR Review Agent show up here."}):(0,n.jsx)(O.Ll,{headers:["Run","Details","Status"],children:v.map(e=>(0,n.jsx)(O.Bs,{run:e,repoUrl:r.repoUrl,arrived:f.has(e.id),action:{kind:"open",onOpen:b}},e.id))})})}var T=s(84193),_=s(76184),F=s(19907),q=s(60649),G=s(94043),E=s(28901),Z=s(68034);function B(e){let{figures:t,notice:s}=e;return(0,n.jsxs)(a.A,{padding:"snug",children:[(0,n.jsx)("ul",{className:"grid grid-cols-2 gap-y-6 sm:grid-cols-4 sm:gap-y-0",children:t.map((e,t)=>{let s="?"!==e.value&&"—"!==e.value,a=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"flex items-center gap-1 text-sm text-muted-foreground transition-colors group-hover/stat:text-foreground",children:[e.label,e.opens&&(0,n.jsx)(Z.A,{size:14,stroke:1.75,"aria-hidden":"true",className:"shrink-0 -translate-x-0.5 translate-y-0.5 text-foreground opacity-0 transition-[opacity,transform] group-hover/stat:translate-x-0 group-hover/stat:translate-y-0 group-hover/stat:opacity-100 group-focus-visible/stat:translate-x-0 group-focus-visible/stat:translate-y-0 group-focus-visible/stat:opacity-100 motion-reduce:transition-none"})]}),(0,n.jsx)("span",{className:"flex h-7 items-center text-xl font-medium slashed-zero tabular-nums ".concat(s?"text-foreground":"text-muted-foreground"),children:e.value})]});return(0,n.jsx)("li",{className:0===t?"pr-4":"px-4 sm:border-l sm:border-stone-100 sm:dark:border-stone-800",children:e.opens?(0,n.jsx)("button",{type:"button",onClick:e.opens.onOpen,"aria-label":"".concat(e.label,": ").concat(e.value,". Open ").concat(e.opens.label),className:"group/stat -m-2 flex w-[calc(100%+1rem)] cursor-pointer flex-col-reverse gap-1 rounded-lg p-2 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:a}):(0,n.jsx)("div",{className:"flex flex-col-reverse gap-1",children:a})},e.label)})}),s&&(0,n.jsx)("div",{className:"mt-6",children:s})]})}var V=s(86985),J=s(52619),Q=s.n(J),Y=s(64519);function $(e){var t;let{site:s,canPublish:a,state:i,onPublish:l}=e,r=null!=(t=s.branch)?t:s.defaultBranch,o="."===s.docsPath?"":"".concat(s.docsPath,"/");return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)("div",{className:"flex flex-row flex-nowrap items-center justify-between gap-4",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-foreground sm:text-xl",children:"Host on Docs7"}),(0,n.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground sm:text-base",children:["Add ",(0,n.jsxs)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-foreground",children:[o,"docs.json"]})," on"," ",r?(0,n.jsx)("span",{className:"break-all font-medium text-foreground",children:r}):"your default branch","."," ",(0,n.jsx)(Q(),{href:"https://context7.com/docs/docs7/quickstart",target:"_blank",rel:"noopener noreferrer",className:"focus-orange rounded underline underline-offset-4 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Setup guide"})]})]}),(0,n.jsxs)(U.$n,{size:"md",disabled:!a||"checking"===i.kind,"aria-busy":"checking"===i.kind,onClick:l,children:["checking"===i.kind?(0,n.jsx)(Y.A,{size:16,className:"motion-safe:animate-spin","aria-hidden":"true"}):(0,n.jsx)(_.A,{size:16,stroke:1.75,"aria-hidden":"true"}),"checking"===i.kind?"Publishing...":"Publish docs"]})]}),"error"===i.kind&&(0,n.jsx)(U.Fx,{children:i.message})]})}function W(e){var t,s;let{site:i,onOpen:l}=e,r=(0,q.dc)(i.context7LibraryName).data,d=r?r.settings.webTitle||r.settings.title:(0,o.pf)(i.repoUrl),c=(null==r?void 0:r.settings.webDescription)||(null==r?void 0:r.settings.description)||"",u=null!=(t=r&&(0,E.ES)(r))?t:i.repoUrl,p=null!=(s=r&&(0,E.yr)(r))?s:i.repoUrl.replace(/^https:\/\//,"");return(0,n.jsx)(a.A,{children:(0,n.jsx)("div",{className:"flex flex-col gap-6",children:(0,n.jsxs)("div",{className:"flex flex-row flex-nowrap items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,n.jsx)("h2",{className:"text-balance text-xl font-semibold leading-tight text-foreground",children:d}),(0,n.jsx)("a",{href:u,target:"_blank",rel:"noopener noreferrer",title:u,className:"block truncate text-base text-muted-foreground underline decoration-from-font hover:text-foreground",children:p}),c&&(0,n.jsx)("p",{title:c,className:"mt-1 truncate text-base text-muted-foreground",children:c})]}),(0,n.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:(0,n.jsxs)(U.$n,{variant:"ghostPrimary",onClick:()=>l("agent"),children:[(0,n.jsx)(T.A,{size:15,stroke:1.75,"aria-hidden":"true"}),"Run agent"]})})]})})})}function K(e){var t,s,a;let{site:l,teamspaceId:r,canPublish:o,canEdit:d,active:c}=e,h=(0,u.yJ)(r),x=(0,p.Nd)(r,l.id,30,!1,c&&!!l.analyticsUrl,l.analyticsUrl),[,g]=(0,i.ZA)("tab",m.pu),[,v]=(0,i.ZA)("docs7Deploy",m.xz),b=async()=>{try{let{deploymentId:e}=await h.mutateAsync(l.id);e?(v(e),R.oR.success("The first build has started")):R.oR.warning("Hosting is enabled, but the first build could not start",{description:"Start a deployment from Overview."})}catch(e){}},y=!!(null==(t=x.data)?void 0:t.lastReceivedAt),j=!!l.analyticsUrl&&x.isPending,k=e=>()=>void g(e),A={label:"Analytics",onOpen:k("analytics")},N={label:"AI Visibility",onOpen:k("ai-visibility")},w=e=>y&&void 0!==e?(0,G.ZV)(e):j?"—":"?",C=[{label:"Visitors",value:w(null==(s=x.data)?void 0:s.totals.visitors),opens:A},{label:"Views",value:w(null==(a=x.data)?void 0:a.totals.pageViews),opens:A},{label:"AI Requests",value:"?",opens:N},{label:"AI Questions",value:"?",opens:N}],I=j?null:y?(0,n.jsx)(f.A,{variant:"info",icon:(0,n.jsx)(_.A,{size:20,"aria-hidden":"true"}),children:"Host on Docs7 to track AI requests and assistant questions."}):(0,n.jsxs)(f.A,{variant:"info",icon:(0,n.jsx)(F.A,{size:20,"aria-hidden":"true"}),children:[(0,n.jsx)("button",{type:"button","data-link":!0,onClick:k("analytics"),className:"focus-orange rounded",children:"Set up analytics"})," ","to track visits to your docs."]});return(0,n.jsxs)(U.BJ,{children:[(0,n.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,n.jsx)(M,{teamspaceId:r,siteId:l.id,active:c,published:!1}),(0,n.jsx)(W,{site:l,onOpen:e=>void g(e)})]}),(0,n.jsx)(B,{figures:C,notice:I}),(0,n.jsx)(S,{site:l,teamspaceId:r,active:c}
1),(0,n.jsx)(V.A,{site:l,teamspaceId:r,canEdit:d,before:(0,n.jsx)($,{site:l,canPublish:o,state:h.isPending?{kind:"checking"}:h.error?{kind:"error",message:h.error.message}:{kind:"ready"},onPublish:()=>void b()})})]})}var X=(0,I.A)("outline","world-off","IconWorldOff",[["path",{d:"M5.657 5.615a9 9 0 1 0 12.717 12.739m1.672 -2.322a9 9 0 0 0 -12.066 -12.084",key:"svg-0"}],["path",{d:"M3.6 9h5.4m4 0h7.4",key:"svg-1"}],["path",{d:"M3.6 15h11.4m4 0h1.4",key:"svg-2"}],["path",{d:"M11.5 3a17.001 17.001 0 0 0 -1.493 3.022m-.847 3.145c-.68 4.027 .1 8.244 2.34 11.833",key:"svg-3"}],["path",{d:"M12.5 3a16.982 16.982 0 0 1 2.549 8.005m-.207 3.818a16.979 16.979 0 0 1 -2.342 6.177",key:"svg-4"}],["path",{d:"M3 3l18 18",key:"svg-5"}]]),ee=s(1371),et=s(10274),es=s(92801);function en(e){var t,s,i,l,r,d;let{site:c,latest:u,publication:p,customDomainReady:h,canRedeploy:m,redeploying:x,onRedeploy:v,onOpenSettings:f,onConnect:b}=e,y="published"===p.kind,j=y?new URL(p.publicUrl).pathname:"",k="https://".concat(c.platformHostname).concat("/"===j?"":j),A=c.customDomain?"https://".concat(c.customDomain).concat(null!=(t=c.customDomainPath)?t:""):null,N=h&&A?A:k,w=u?(0,es.I)(u):null,C=null!=(l=null!=(i=null!=(s=null==u?void 0:u.completedAt)?s:null==u?void 0:u.startedAt)?i:null==u?void 0:u.createdAt)?l:null;return(0,n.jsx)(a.A,{children:(0,n.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:gap-10",children:[(0,n.jsx)("div",{className:"relative aspect-video w-96 max-w-full shrink-0 overflow-hidden rounded-xl border border-stone-200 bg-muted dark:border-stone-800 md:aspect-auto",children:y?(0,n.jsx)(et.A,{url:N,title:"".concat(c.platformHostname," preview"),scale:.24}):(0,n.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 px-6 text-center",children:[(0,n.jsx)(X,{size:24,stroke:1.5,"aria-hidden":"true",className:"text-muted-foreground/40"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Nothing published yet"})]})}),(0,n.jsxs)("div",{className:"relative flex min-w-0 flex-1 flex-col",children:[v&&(0,n.jsx)("div",{className:"absolute right-0 top-3",children:(0,n.jsxs)(U.$n,{className:"h-[30px] gap-1 rounded-lg px-2.5 leading-none",onClick:v,disabled:!m||x,children:[x?"Redeploying":"Redeploy",(0,n.jsx)(ee.A,{size:16,stroke:1.75,"aria-hidden":"true",className:x?"motion-safe:animate-spin motion-safe:direction-reverse":void 0})]})}),(0,n.jsxs)("dl",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1 border-b border-stone-100 pb-4 dark:border-stone-800 ".concat(v?"pr-40":""),children:[(0,n.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Deployment URL"}),(0,n.jsx)("dd",{className:"min-w-0",children:(0,n.jsx)(U.AS,{url:k})})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1 border-b border-stone-100 py-4 dark:border-stone-800",children:[(0,n.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Custom URL"}),(0,n.jsx)("dd",{children:c.customDomain?h?(0,n.jsx)(U.AS,{hostname:c.customDomain,path:null!=(r=c.customDomainPath)?r:""}):(0,n.jsx)("span",{className:"text-base text-muted-foreground",children:"https://".concat(c.customDomain).concat(null!=(d=c.customDomainPath)?d:"")}):f?(0,n.jsx)("button",{type:"button",onClick:f,className:"rounded-sm text-base text-muted-foreground underline underline-offset-4 hover:text-emerald-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:hover:text-emerald-400",children:"Add"}):(0,n.jsx)("span",{className:"text-base text-muted-foreground",children:"Connect GitHub to add a custom URL"})}),c.customDomain&&!h&&(0,n.jsxs)("dd",{className:"text-sm text-muted-foreground",children:["pending_proxy"===c.customDomainStatus?"Proxy setup is incomplete. Forward this path to the deployment URL.":"Custom URL setup is incomplete."," ",f&&(0,n.jsx)("button",{type:"button",onClick:f,className:"rounded-sm underline underline-offset-4 hover:text-emerald-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:hover:text-emerald-400",children:"Open setup instructions"})]})]}),(0,n.jsx)("div",{className:"py-4",children:(0,n.jsxs)(U.RA,{children:[(0,n.jsx)(U.dN,{label:"Build status",children:w?(0,n.jsx)(U.qs,{tone:w.tone,indicator:w.indicator,children:w.text}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"No builds yet"})}),(0,n.jsx)(U.dN,{label:"Github",children:"repoUrl"in c?(0,n.jsxs)("a",{href:c.repoUrl,target:"_blank",rel:"noreferrer",className:"inline-flex h-[26px] max-w-full items-center gap-1.5 rounded-lg border border-stone-200 bg-stone-50 px-2 text-base leading-6 text-stone-800 hover:bg-stone-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:border-stone-800 dark:bg-stone-950 dar
1k:text-stone-200 dark:hover:bg-stone-900",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"shrink-0",children:(0,n.jsx)(g.Hk,{size:16})}),(0,n.jsx)("span",{className:"truncate",children:(0,o.pf)(c.repoUrl)})]}):b?(0,n.jsxs)("button",{type:"button",onClick:b,className:"inline-flex h-[26px] items-center gap-1.5 rounded-lg border border-stone-200 bg-stone-50 px-2 text-base hover:bg-stone-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:border-stone-800 dark:bg-stone-950 dark:hover:bg-stone-900",children:[(0,n.jsx)("span",{"aria-hidden":"true",children:(0,n.jsx)(g.Hk,{size:16})}),"Connect GitHub"]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"Not connected"})}),(0,n.jsx)(U.dN,{label:"Update",children:C?(0,G.rA)(C):"—"})]})})]})]})]})})}var ea=s(92560),ei=s(47005),el=s(51815);function er(e){let{stats:t}=e;return(0,n.jsx)(a.A,{padding:"snug",children:(0,n.jsx)("ul",{className:"grid grid-cols-2 gap-y-6 sm:grid-cols-4 sm:gap-y-0",children:t.map((e,t)=>{let s=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"flex items-center gap-1 text-sm text-muted-foreground transition-colors group-hover/stat:text-foreground",children:[e.label,e.destination&&(0,n.jsx)(Z.A,{size:14,stroke:1.75,"aria-hidden":"true",className:"shrink-0 -translate-x-0.5 translate-y-0.5 text-foreground opacity-0 transition-[opacity,transform] group-hover/stat:translate-x-0 group-hover/stat:translate-y-0 group-hover/stat:opacity-100 group-focus-visible/stat:translate-x-0 group-focus-visible/stat:translate-y-0 group-focus-visible/stat:opacity-100 motion-reduce:transition-none"})]}),(0,n.jsxs)("span",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"flex h-7 items-center text-xl font-medium slashed-zero tabular-nums text-foreground",children:(0,n.jsx)(ea.Ay,{value:e.value,format:{notation:"compact"},spinTiming:el.m})}),e.trend&&(0,n.jsx)(ei.A,{percent:e.trend.percent,days:e.trend.half,className:"bg-stone-100"})]})]});return(0,n.jsx)("li",{className:0===t?"pr-4":"px-4 sm:border-l sm:border-stone-100 sm:dark:border-stone-800",children:e.destination?(0,n.jsx)("button",{type:"button",onClick:e.destination.onOpen,"aria-label":"".concat(e.label,": ").concat((0,G.ZV)(e.value),". Open ").concat(e.destination.label),className:"group/stat -m-2 flex w-[calc(100%+1rem)] cursor-pointer flex-col-reverse gap-1 rounded-lg p-2 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:s}):(0,n.jsx)("div",{className:"flex flex-col-reverse gap-1",children:s})},e.label)})})})}var eo=s(21693);function ed(e){return Object.entries(e).reduce((e,t)=>{let[s,n]=t;return"date"===s||"number"!=typeof n?e:e+n},0)}function ec(e){var t,s,x,g,v,f,b,y,N,w,C,I,D,H,O,P,T,_,F,q,G,E,Z,B,V,J,Q;let{teamspaceId:Y,active:$}=e,{role:W}=(0,l.Q4)(),{selectedProject:X}=(0,l.KT)(),ee=(null==X?void 0:X.docs7_pro_enabled)===!0?14:7,et=(0,d.su)(W,"edit"),{sites:es,selected:ea,siteId:ei}=(0,u.w9)(Y,$),el=ea&&!(0,c.Qs)(ea)?ea:void 0,ec=ea&&(0,c.Qs)(ea)?ea:void 0,eu=void 0===ea||"on"===ea.hosting,ep=(0,u.jF)({teamspaceId:Y,siteId:ei,enabled:$&&eu&&!ec}),eh=(0,u.DP)(Y,ei,void 0,$&&!!ec),em=ec?eh:ep,ex=$&&!!ei&&eu,eg=(0,p.Nd)(Y,ei,ee,!1,ex),ev=(0,p.uO)(Y,ei,ee,!1,ex),ef=(0,p.sf)(Y,ei,ee,!1,ex),eb=null!=(D=null==(t=em.data)?void 0:t.deployments)?D:[],ey=eb.slice(0,5),ej=(0,u.q$)(Y),[,ek]=(0,i.ZA)("tab",m.pu),[eA,eN]=(0,i.ZA)("docs7Deploy",m.xz),[,ew]=(0,i.ZA)("docs7SiteId",m.ix),[,eC]=(0,i.ZA)("connect",m.o5),eM={label:"Analytics",onOpen:()=>void ek("analytics")};if(es.isLoading||void 0!==ea&&em.isLoading)return(0,n.jsx)(eo.t,{});if(es.isError||!es.data)return(0,n.jsx)(a.A,{title:"Sites",children:(0,n.jsx)(U.pr,{})});if((null==ea?void 0:ea.hosting)==="off")return(0,n.jsx)(K,{site:ea,teamspaceId:Y,canPublish:(0,d.su)(W,"publish-site"),canEdit:et,active:$},ea.id);let eI=null!=(O=null!=(H=eb.filter(e=>"production"===e.target)[0])?H:eb[0])?O:null,eD=(null!=(P=null==(s=em.data)?void 0:s.targets)?P:[]).flatMap(e=>null===e.liveDeploymentId?[]:[e.liveDeploymentId]),eR=(null!=(T=null==(x=em.data)?void 0:x.targets)?T:[]).find(e=>null===e.branch&&null!==e.publicUrl),eL=!!((null==el?void 0:el.customDomain)&&"active"===el.customDomainStatus&&ep.data&&!ep.isPlaceholderData&&"ready"===(0,r.Y2)({publicUrl:"https://".concat(el.customDomain).concat(null!=(_=el.customDomainPath)?_:""),customDomainRouting:el.customDomainRouting,platformHostname:el.platformHostname,deployments:ep.data.deployments,targets:ep.data.targets})),ez=null!=(F=null==(g=eg.data)?void 0:g.dailySeries)?F:[],eH=null!=(q=null==(v=ev.data)?void 0:v.dailySeries)?q:[],eO=ea?Math.floor((Date.now()-new Date(ea.createdAt).getTime())/864e5)+1:ee,eP=e=>(0,h.Le)(e,7,eO),eU=[{label:"Visitors",destination:eM,value:null!=(G=null==(f=eg.data)?void 0:f.totals.visitors)?G:0,trend:eP(ez.map(e=>e.visitors))},{label:"Views",destination:eM,value:null!=(E=null==(b=eg.data)?void 0:b.totals.pageViews)?E:0,trend:eP(ez.map(e=>e.pageViews))},{label:"AI Requests",destination:{label:"AI Visibility",onOpen:()=>void ek("ai-visibility")},value:null!=(Z=null==(y=ev.data)?void 0:y.totals.totalRequests)?Z:0,trend:eP(eH.map(ed))},{label:"AI Questions",destination:eM,value:null!=(B=null==(N=ef.data)?void 0:N.questions)?B:0,trend:eP((null!=(V=null==(w=ef.data)?void 0:w.dailyQuestions)?V:[]).map(e=>e.questions))}];return(0,n.jsxs)(U.BJ,{children:[ec?!et&&(0,n.jsx)(z.A,{children:"Only teamspace owners and admins can connect GitHub or delete this site."}):!(0,d.su)(W,"redeploy-production")&&(0,n.jsx)(z.A,{children:"You do not have permission to redeploy this Docs7 site."}),ea?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[ec&&et?(0,n.jsx)(j,{site:ec}):null,el?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(M,{teamspaceId:Y,siteId:el.id,active:$,published:!0}),(0,n.jsx)(L,{teamspaceId:Y,siteId:el.id,notice:ep.isPlaceholderData?null:null!=(J=null==(C=ep.data)?void 0:C.setupNotice)?J:null,canEdit:et})]}):null,(0,n.jsx)(en,{site:ea,latest:eI,publication:(null==eR?void 0:eR.publicUrl)?{kind:"published",publicUrl:eR.publicUrl}:{kind:"unpublished"},customDomainReady:eL,canRedeploy:!!el&&(0,d.su)(W,"redeploy-production"),redeploying:ej.isPending,onRedeploy:el?()=>ej.mutate(el.id,{onSuccess:()=>R.oR.success("The deployment has started"),onError:e=>R.oR.error("Unable to start the deployment",{description:e.message})}):void 0,onOpenSettings:el?()=>{ea&&ew(ea.id),ek("settings")}:void 0,onConnect:ec&&et?()=>void eC(!0):void 0})]}),(0,n.jsx)(er,{stats:eU}),(0,n.jsx)(k.Ay,{title:"Recent builds",deployments:ey,status:(0,k.Z5)(em),refreshing:em.isPlaceholderData,productionBranch:el?(0,o.rh)(el):null,emptyMessage:ec?k.SO:void 0,liveDeploymentIds:eD,onOpen:e=>{eN(e)}}),el?(0,n.jsx)(S,{site:el,teamspaceId:Y,active:$}):null]}):null,(0,n.jsx)(A.A,{teamspaceId:Y,site:ea,deployments:eb,targets:null!=(Q=null==(I=em.data)?void 0:I.targets)?Q:[],deploymentId:eA,active:$,onClose:()=>void eN("")})]})}},45600:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","clock","IconClock",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]])},46268:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","git-merge","IconGitMerge",[["path",{d:"M7 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M7 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M17 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-2"}],["path",{d:"M7 8l0 8",key:"svg-3"}],["path",{d:"M7 8a4 4 0 0 0 4 4h4",key:"svg-4"}]])},47005:(e,t,s)=>{s.d(t,{A:()=>l});var n=s(95155),a=s(20676),i=s(25016);function l(e){let{percent:t,days:s,className:l}=e,r=Math.round(t);if(0===r)return null;let o=r>0,d=(0,n.jsxs)("span",{className:(0,i.cn)("inline-flex shrink-0 items-center rounded-md px-1.5 py-0.5 text-[12px] font-semibold slashed-zero tabular-nums leading-4",o?"bg-emerald-50 text-emerald-600 dark:bg-emerald-950 dark:text-emerald-400":"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",l),children:[(0,n.jsx)("span",{className:"sr-only",children:o?"up ":"down "}),(0,n.jsx)("span",{"aria-hidden":"true",children:o?"+":"−"}),Math.abs(r),"%"]});return(0,n.jsx)(a.default,{content:"".concat(o?"Up":"Down"," ").concat(Math.abs(r),"% vs the previous ").concat(s," days"),children:d})}},47619:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","message","IconMessage",[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]])},51693:(e,t,s)=>{s.d(t,{Bz:()=>l,Hk:()=>a,J7:()=>i});var n=s(95155);function a(e){let{size:t=20,className:s=""}=e;return(0,n.jsx)("svg",{role:"img",viewBox:"0 0 16 16",width:t,height:t,xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0 ".concat(s),children:(0,n.jsx)("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68.003 1.36.092 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function i(e){let{size:t=20,className:s=""}=e;return(0,n.jsx)("svg",{width:t,height:t,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0 ".concat(s),children:(0,n.jsx)("path",{d:"M29.8976 13.2233L29.8587 13.1238L26.0897 3.28739C26.013 3.0946 25.8772 2.93106 25.7018 2.82023C25.5263 2.71128 25.3216 2.6588 25.1153 2.66989C24.909 2.68098 24.7111 2.75509 24.5483 2.88223C24.3873 3.01301 24.2705 3.19023 24.2138 3.38976L21.6689 11.1758H11.3639L8.81897 3.38976C8.76378 3.18914 8.64672 3.01104 8.48446 2.88078C8.32164 2.75365 8.12373 2.67953 7.91746 2.66845C7.71118 2.65736 7.50647 2.70983 7.33096 2.81878C7.15596 2.93006 7.0203 3.09346 6.9431 3.28595L3.16685 13.118L3.12936 13.2175C2.58679 14.6352 2.51982 16.1908 2.93855 17.6498C3.35727 19.1089 4.23899 20.3922 5.45077 21.3064L5.46375 21.3165L5.49835 21.341L11.2399 25.6407L14.0803 27.7905L15.8106 29.0968C16.013 29.2505 16.2601 29.3337 16.5142 29.3337C16.7683 29.3337 17.0155 29.2505 17.2178 29.0968L18.9481 27.7905L21.7886 25.6407L27.5647 21.3151L27.5791 21.3035C28.7882 20.3892 29.6678 19.1071 30.0859 17.6501C30.504 16.193 30.4379 14.6396 29.8976 13.2233Z",fill:"currentColor"})})}function l(e){let{size:t=20,className:s=""}=e;return(0,n.jsxs)("svg",{width:t,height:t,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0 ".concat(s),children:[(0,n.jsx)("path",{d:"M23.4075 1.22656H8.59252C4.44837 1.22656 1.08887 4.56002 1.08887 8.67205V23.3722C1.08887 27.4842 4.44837 30.8176 8.59252 30.8176H23.4075C27.5516 30.8176 30.9111 27.4842 30.9111 23.3722V8.67205C30.9111 4.56002 27.5516 1.22656 23.4075 1.22656Z",fill:"currentColor"}
1),(0,n.jsx)("path",{d:"M22.6867 15.7532L21.558 22.5945C21.4844 23.0084 21.19 23.2518 20.7729 23.2518H11.2037C10.7865 23.2518 10.4921 23.0084 10.4185 22.5945L8.43105 10.397C8.35742 9.98313 8.57827 9.71533 8.97085 9.71533H23.0057C23.3983 9.71533 23.6191 9.98313 23.5455 10.397L23.0057 13.6107C22.9321 14.0733 22.6622 14.2681 22.2205 14.2681H13.78C13.6573 14.2681 13.5837 14.3411 13.6082 14.4872L14.2707 18.5286C14.2952 18.626 14.3688 18.6991 14.467 18.6991H17.5095C17.6077 18.6991 17.6813 18.626 17.7058 18.5286L18.172 15.6071C18.2211 15.2419 18.4664 15.0958 18.8099 15.0958H22.1224C22.6131 15.0958 22.7603 15.3393 22.6867 15.7532Z",fill:"white"})]})}},62544:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","git-pull-request-closed","IconGitPullRequestClosed",[["path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M6 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M18 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-2"}],["path",{d:"M6 8v8",key:"svg-3"}],["path",{d:"M18 11v5",key:"svg-4"}],["path",{d:"M16 4l4 4m0 -4l-4 4",key:"svg-5"}]])},65751:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","hand-click","IconHandClick",[["path",{d:"M8 13v-8.5a1.5 1.5 0 0 1 3 0v7.5",key:"svg-0"}],["path",{d:"M11 11.5v-2a1.5 1.5 0 0 1 3 0v2.5",key:"svg-1"}],["path",{d:"M14 10.5a1.5 1.5 0 0 1 3 0v1.5",key:"svg-2"}],["path",{d:"M17 11.5a1.5 1.5 0 0 1 3 0v4.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7l-.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47",key:"svg-3"}],["path",{d:"M5 3l-1 -1",key:"svg-4"}],["path",{d:"M4 7h-1",key:"svg-5"}],["path",{d:"M14 3l1 -1",key:"svg-6"}],["path",{d:"M15 6h1",key:"svg-7"}]])},76184:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","rocket","IconRocket",[["path",{d:"M4 13a8 8 0 0 1 7 7a6 6 0 0 0 3 -5a9 9 0 0 0 6 -8a3 3 0 0 0 -3 -3a9 9 0 0 0 -8 6a6 6 0 0 0 -5 3",key:"svg-0"}],["path",{d:"M7 14a6 6 0 0 0 -3 6a6 6 0 0 0 6 -3",key:"svg-1"}],["path",{d:"M15 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]])},80796:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","circle","IconCircle",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}]])},84193:(e,t,s)=>{s.d(t,{A:()=>n});var n=(0,s(30313).A)("outline","sparkles","IconSparkles",[["path",{d:"M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2zm0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2zm-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6z",key:"svg-0"}]])},86985:(e,t,s)=>{s.d(t,{A:()=>p});var n=s(95155),a=s(12115),i=s(61456),l=s(12746),r=s(72087),o=s(9516),d=s(37152),c=s(38754),u=s(18720);function p(e){var t;let{site:s,teamspaceId:p,canEdit:h,before:m}=e,[x,g]=(0,a.useState)(!1),v=(0,d.O3)(p),f="source"in s,b=f?s.name:(0,o.pf)(s.repoUrl),y="on"===s.hosting,j=(0,n.jsxs)(c.$n,{variant:"ghostDanger",size:"md",disabled:!h||v.isPending,onClick:()=>g(!0),children:[(0,n.jsx)(i.A,{size:16,stroke:1.75,"aria-hidden":"true"}),y?"Delete":"Remove"]});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.A,{before:m,title:y?"Delete this site":"Remove from Docs7",description:f?"This removes the site and its deployments. Your local files stay as they are.":y?"This removes the site, its previews, and any custom domain. Your repository stays as it is.":"The agent stops. Your repository and your Context7 library stay as they are.",headerActions:j}),(0,n.jsxs)(r.A,{isOpen:x,onClose:()=>g(!1),title:y?"Delete Docs7 site":"Remove from Docs7",maxWidth:"sm",preventClose:v.isPending,buttons:[{label:"Cancel",onClick:()=>g(!1),variant:"secondary",disabled:v.isPending},{label:y?"Delete site":"Remove repository",onClick:()=>v.mutate(s.id,{onSuccess:()=>{g(!1),u.oR.success(y?"The site is deleted":"The repository is removed")}}),variant:"danger",loading:v.isPending}],children:[(0,n.jsx)("p",{className:"text-base text-foreground",children:y?(0,n.jsxs)(n.Fragment,{children:["This deletes ",(0,n.jsx)("span",{className:"font-semibold",children:b}),", its production site, every branch preview",s.customDomain?", and the custom URL ".concat(s.customDomain).concat(null!=(t=s.customDomainPath)?t:""):"","."," ",f?"Your local files are not touched.":"The repository itself is not touched."]}):(0,n.jsxs)(n.Fragment,{children:["This takes ",(0,n.jsx)("span",{className:"font-semibold",children:b})," out of Docs7. Open pull requests stay open for you to merge or close, and you can add it again."]})}),v.isError&&(0,n.jsx)(c.Fx,{children:v.error.message})]})]})}},98355:(e,t,s)=>{function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,n=Math.max(0,Math.floor(s)),a=0===n?[]:e.slice(-n),i=Math.min(t,Math.floor(a.length/2));if(i<3)return null;let l=e=>e.reduce((e,t)=>
1e+t,0),r=l(a.slice(a.length-2*i,a.length-i));return 0===r?null:{percent:Math.round((l(a.slice(a.length-i))-r)/r*100),half:i}}function a(e,t){return{current:e.slice(-t),previous:e.slice(-(2*t),-t)}}function i(e,t){return 0===t?0===e?0:null:(e-t)/t*100}s.d(t,{Le:()=>n,Nx:()=>a,u5:()=>i})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.