Хорошо Мистраль, проанализируй пожалуйста этот скрипт и расскажи что он может делать?
```js
;!function(){
try {
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;
n&&((e._debugIds|| (e._debugIds={}))[n]="472d5fc6-51c4-0c22-bcec-9b94804680fc")}catch(e){}}();
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push([
"object"==typeof document?document.currentScript:void 0,
823186,
e=>{
"use strict";
var s=e.i(207478);
e.i(305374);
var t=e.i(603909);
function i({children:e,className:a,containerRef:n,wrapperRef:l,wrapperClassName:r}){
return(0,s.jsx)("div",{
ref:l,
className:(0,t.cn)("w-full grow self-start overflow-y-auto",r),
children:(0,s.jsx)(
"div",
{
ref:n,
className:(0,t.cn)("@min-screen-md/layout:px-8 @min-screen-xl/layout:max-w-6xl mx-auto min-h-full w-full max-w-5xl px-4 pb-20",a),
children:e
}
)
}
)}
e.s(["PageContainer",0,i,"PageContainerWithDesktopTopPadding",0,function({className:e,...a}){return(0,s.jsx)(i,{...a,className:(0,t.cn)(e,"md:pt-8 xl:pt-16")})}])},
649531,e=>{"use strict";var s=e.i(207478);
e.i(880349);
var t=e.i(917641),i=e.i(679142);
e.s(["ChatInputSkeleton",0,function({className:e,layout:a="one-row"}){return"two-row"===a?(0,s.jsx)(i.ChatInputCard,{className:e,children:(0,s.jsxs)("div",{className:"flex min-h-0 flex-col gap-3 p-3 shadow",children:[(0,s.jsx)("div",{className:"flex min-h-0 min-w-0",children:(0,s.jsx)(t.Skeleton,{className:"h-6 flex-1 rounded-md"})}),(0,s.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,s.jsx)(t.Skeleton,{className:"h-10 w-fit min-w-[200px] shrink-0 rounded-md"}),(0,s.jsx)(t.Skeleton,{className:"size-8 shrink-0 rounded-lg"}),(0,s.jsx)(t.Skeleton,{className:"h-8 flex-1 rounded-lg"}),(0,s.jsx)(t.Skeleton,{className:"size-8 shrink-0 rounded-lg"}),(0,s.jsx)(t.Skeleton,{className:"size-8 shrink-0 rounded-full"})]})]})}):(0,s.jsx)(i.ChatInputCard,{className:e,children:(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3",children:[(0,s.jsx)(t.Skeleton,{className:"size-8 shrink-0 rounded-lg"}),(0,s.jsx)(t.Skeleton,{className:"h-6 flex-1 rounded-md"}),(0,s.jsx)(t.Skeleton,{className:"size-8 shrink-0 rounded-lg"}),(0,s.jsx)(t.Skeleton,{className:"size-8 shrink-0 rounded-full"})]})})}])},259317,e=>{"use strict";
var s=e.i(418974),t=e.i(462333),i=e.i(653972);
e.s(["useReducedMotion",0,function(){s.hasReducedMotionListener.current||(0,t.initPrefersReducedMotion)();
let[e]=(0,i.useState)(s.prefersReducedMotion.current);
return e}])},195088,e=>{e.q("/_next/static/media/animated-sitting-cat.0rmqnxnd8h5~h.gif")},364565,e=>{e.q("/_next/static/media/pdf.worker.min.0wghn0~9oxou6.mjs")},48393,e=>{e.q("/_next/static/media/illustration.15ryi_78idaod.svg")},98912,e=>{"use strict";
var s=e.i(207478),t=e.i(743881),i=e.i(197259),a=e.i(653972),n=e.i(907390);
let l=({...e})=>a.default.createElement(n.Icon,{size:"24px",...e},a.default.createElement("path",{d:"M5 16L5.80474 16.503C7.80916 17.7557 10.2963 17.9599 12.4782 17.0508C14.1043 16.3732 15.9206 16.3069 17.5918 16.8639L19.5 17.5",stroke:"currentColor",strokeWidth:"2","data-color":"color-2",fill:"none"}),a.default.createElement("path",{d:"M8 2H10V11C6.3228 12.8386 4 16.597 4 20.7082V22H20V20.7082C20 16.597 17.6772 12.8386 14 11V2H16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",fill:"none"}));
e.i(880349);
var r=e.i(116588);
e.i(461122);
var o=e.i(374666);
let c={src:e.i(48393).default,width:335,height:165,blurWidth:0,blurHeight:0};
e.s(["CodeSessionNotificationContent",0,function({onHide:e,onContinue:n,notificationMessage:d,modalTitle:u,description:m,continueButtonLabel:x}){let h=(0,t.useTranslations)("Code.beta_notification"),[p,g]=(0,a.useState)(!1);
return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 items-center rounded-b-xl px-3 py-2 sm:grid-cols-[1fr_auto]",children:[(0,s.jsx)("div",{className:"text-white-default text-sm",children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-2 font-semibold",children:[(0,s.jsx)(l,{className:"size-4 shrink-0"}),d]})}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-0.5",children:[(0,s.jsx)(o.Button,{variant:"ghost",size:"xs",className:"text-white-default font-bold",onClick:()=>{g(!0)},children:h("learn_more")}),e&&(0,s.jsx)(o.Button,{variant:"ghost",size:"xs",className:"text-white-subtle",onClick:e,children:h("hide")})]})]}),(0,s.jsx)(r.Dialog,{open:p,onOpenChange:g,children:(0,s.jsxs)(r.DialogContent,{className:"max-w-[486px] gap-3 p-3",hideX:!0,children:[(0,s.jsx)(i.default,{src:c,alt:"",className:"w-full rounded-sm"}),(0,s.jsxs)("div",{className:"flex flex-col gap-6 p-3",children:[(0,s.jsxs)(r.DialogHeader,{children:[(0,s.jsx)(r.DialogTitle,{className:"font-medium",children:u}),(0,s.jsx)(r.DialogDescription,{children:m})]}),(0,s.jsx)(r.DialogFooter,{children:(0,s.jsx)(o.Button,{className:"w-full",onClick:()=>{g(!1),n?.()},children:x??h("modal.continue")})})]})]})})]})}],98912)},565813,e=>{"use strict";
var s=e.i(653972);
e.s(["useElementHeightCssVariable",0,function(e){let t=(0,s.useRef)(null);
return(0,s.useCallback)(s=>{if(t.current?.(),t.current=null,!s)return void document.body.style.removeProperty(e);
let i=new ResizeObserver(([s])=>{let t=s?.contentRect.height;
t&&document.body.style.setProperty(e,`${t}px`)});
i.observe(s),t.current=()=>{i.unobserve(s),document.body.style.removeProperty(e)}},[e])}])},181536,e=>{"use strict";
var s=e.i(207478),t=e.i(586725),i=e.i(689891);
let a={chat:"/lawdhethic.png",code:"/ohhecoding.png",work:"/ohlawdheworkin.png"};
e.s(["LeChatonFatLandingLogo",0,function({defaultLogo:e,variant:n}){let l=(0,i.useSession)();
return l?.session.organization.featureFlags.vibe_work_le_chaton_fat!==!0?e:(0,s.jsx)(t.LandingLogo,{size:34,fallback:(0,s.jsx)("img",{src:a[n],alt:"logo",className:"h-[80px] w-[80px] object-contain"})})}])},966819,e=>{"use strict";
var s=e.i(207478);
e.i(305374);
var t=e.i(603909);
e.s(["INPUT_CENTERED_LANDING_CONTENT_CLASSNAME",0,"flex-1 pb-0","ScrollableLandingPageLayout",0,function({children:e,className:i,contentClassName:a,footer:n}){return(0,s.jsx)("div",{className:(0,t.cn)("min-h-0 w-full flex-1 overflow-y-auto overscroll-contain",i),children:(0,s.jsxs)("div",{className:"flex min-h-full w-full flex-col",children:[(0,s.jsx)("div",{className:(0,t.cn)("mx-auto w-full max-w-(--breakpoint-md) min-w-0 px-2 pb-6 md:px-4",a),children:e}),n?(0,s.jsx)("div",{className:"mt-auto w-full px-2 pt-6 pb-3 sm:px-8 md:px-12",children:n}):null]})})}])},148594,e=>{"use strict";
var s=e.i(207478),t=e.i(563356),i=e.i(259317);
e.s(["GreetingLandingLayout",0,function({logo:e,title:a,children:n,inputCentered:l=!1,suggestions:r=[],suggestionsHeader:o}){let c=(0,i.useReducedMotion)(),d=(0,s.jsx)(t.motion.h1,{className:"text-default text-3xl font-medium",initial:c?{opacity:0}:{opacity:0,y:8},animate:c?{opacity:1}:{opacity:1,y:0},transition:{duration:.4,ease:"easeInOut",delay:.15},children:a}),u=r.length>0||o?(0,s.jsxs)("div",{children:[o,r.length>0?(0,s.jsx)("ul",{className:"w-full space-y-1",children:r.map((e,i)=>(0,s.jsx)(t.motion.li,{initial:c?{opacity:0}:{opacity:0,y:4},animate:c?{opacity:1}:{opacity:1,y:0},transition:{delay:.035*i,duration:.18,ease:"easeOut"},children:(0,s.jsxs)("button",{type:"button",className:"text-default hover:bg-state-ghost-hover focus-visible:bg-state-ghost-hover flex min-h-9 w-full items-center gap-3 rounded-md px-2 text-start text-sm focus-visible:outline-none",onClick:e.onClick,children:[e.icon,(0,s.jsx)("span",{className:"min-w-0 truncate",children:e.prompt})]})},e.prompt))}):null]}):null;
return l?(0,s.jsxs)("div",{className:"grid h-dvh min-h-dvh grid-rows-[1fr_auto_1fr]",children:[(0,s.jsxs)("div",{className:"flex flex-col justify-end gap-5 pb-5",children:[(0,s.jsx)("div",{"aria-hidden":"true",children:e}),d]}),n,(0,s.jsx)("div",{className:"pt-5",children:u})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,s.jsx)("div",{"aria-hidden":"true",children:e}),d,n,u]})}])},805045,e=>{e.q("/_next/static/media/repos-icon.13e~0ebs46mpd.svg")},592182,624651,e=>{"use strict";
var s=e.i(207478),t=e.i(743881),i=e.i(215929);
e.s(["GithubSetupFetchError",0,function({isLoading:e,onRetry:a}){let n=(0,t.useTranslations)("Code");
return(0,s.jsx)(i.FetchErrorState,{title:n("github_setup.fetch_error_title"),description:n("github_setup.fetch_error_description"),retryLabel:n("github_setup.retry"),isLoading:e,onRetry:a})}],592182),e.i(658854);
var a=e.i(498342);
e.s(["SectionHeader",0,function({title:e,subtitle:t}){return(0,s.jsxs)("div",{className:"flex max-w-[340px] flex-col items-center gap-1",children:[(0,s.jsx)(a.Typography,{size:"default",weight:"semibold",variant:"default",children:e}),(0,s.jsx)(a.Typography,{size:"sm",variant:"muted",children:t})]})}],624651)},794635,e=>{"use strict";
var s=e.i(207478),t=e.i(197259),i=e.i(694164);
let a={sm:{width:36,height:25},md:{width:49,height:34}};
function n({size:e}){let l=a[e];
return(0,s.jsx)(t.default,{src:i.default,alt:"",width:l.width,height:l.height})}e.s(["VibeCodeLogo",0,function({size:e="md"}){return(0,s.jsxs)("div",{className:"flex flex-row items-center gap-5",children:[(0,s.jsx)(n,{size:e}),(0,s.jsx)("p",{className:"text-default text-5xl font-medium",children:"Vibe Code"})]})},"VibeCodeMark",0,n])},328793,e=>{"use strict";
var s=e.i(207478),t=e.i(586725),i=e.i(181536),a=e.i(794635);
e.s(["CodeLandingLogo",0,function(){return(0,s.jsx)(i.LeChatonFatLandingLogo,{variant:"code",defaultLogo:(0,s.jsx)(t.LandingLogo,{size:34,fallback:(0,s.jsx)(a.VibeCodeMark,{size:"md"})})})}])},246589,763186,743323,483094,461077,e=>{"use strict";
var s=e.i(207478),t=e.i(824997);
let i=(0,t.tv)({slots:{root:"flex flex-col"}}),a=(0,t.tv)({slots:{root:"flex w-full flex-col items-end gap-2",header:"flex w-fit flex-row items-center gap-2",bubble:"flex w-fit max-w-full min-w-0 flex-col rounded-3xl bg-basic-gray-alpha-4 px-5 py-2.5",footer:"flex w-fit flex-row items-center gap-2"}}),n=(0,t.tv)({slots:{root:"flex w-full items-start gap-3",avatarWrapper:"relative flex flex-col items-center",avatar:"relative flex size-[28px] items-center justify-center overflow-hidden",content:"flex min-w-0 flex-1 flex-col gap-2",header:"flex min-h-[28px] w-fit flex-row items-center gap-2",footer:"flex flex-row items-center gap-2"}}),l=i(),r=({children:e,className:t})=>(0,s.jsx)("div",{className:l.root({className:t}),children:e});
r.displayName="MessageThread",e.s(["MessageThread",0,r],763186);
var o=e.i(603909);
let c=a(),d=({header:e,footer:t,children:i,className:a,headerClassName:n,bubbleClassName:l,footerClassName:r,...d})=>(0,s.jsxs)("div",{className:c.root({className:a}),...d,children:[e&&(0,s.jsx)("div",{className:(0,o.cn)(c.header(),n),children:e}),(0,s.jsx)("div",{className:(0,o.cn)(c.bubble(),l),children:i}),t&&(0,s.jsx)("div",{className:(0,o.cn)(c.footer(),r),children:t})]});
d.displayName="MessageThreadUserMessage",e.s(["MessageThreadUserMessage",0,d],743323);
var u=e.i(748240),m=e.i(563356);
let x=n(),h=({header:e,footer:t,children:i,avatar:a,isLoading:n=!1,className:l,avatarWrapperClassName:r,avatarClassName:c,contentClassName:d,headerClassName:h,footerClassName:p,...g})=>(0,s.jsxs)("div",{className:x.root({className:l}),...g,children:[(0,s.jsx)("div",{className:(0,o.cn)(x.avatarWrapper(),r),children:void 0!==a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.motion.div,{animate:{borderRadius:n?"50%":"25%"},transition:{duration:.3,ease:"easeInOut",delay:.15*!n},className:(0,o.cn)(x.avatar(),c),children:a}),(0,s.jsx)(u.AnimatePresence,{children:n&&(0,s.jsx)(m.motion.div,{initial:{opacity:0},animate:{opacity:1,transition:{delay:.3,duration:.15}},exit:{opacity:0,transition:{duration:.15}},className:"absolute",style:{top:-3,right:-3,bottom:-3,left:-3},children:(0,s.jsx)(m.motion.div,{animate:{rotate:360},transition:{duration:1.5,repeat:1/0,ease:"linear"},className:"size-full rounded-full border-2 border-[--divide] will-change-transform",style:{borderTopColor:"currentColor"}})},"spinner")})]})}),(0,s.jsxs)("div",{className:(0,o.cn)(x.content(),!e&&"mt-0.5",d),children:[e&&(0,s.jsx)("div",{className:(0,o.cn)(x.header(),h),children:e}),i,t&&(0,s.jsx)("div",{className:(0,o.cn)(x.footer(),p),children:t})]})]});
h.displayName="MessageThreadAssistantMessage",e.s(["MessageThreadAssistantMessage",0,h],483094),e.s([],246589);
var p=e.i(743881),g=e.i(653972),f=e.i(520234);
e.i(576623);
var j=e.i(68454);
let v=["brewing","simmering","vibing","cooking"];
function _(){let e=Math.floor(Math.random()*v.length);
return v[e]??"brewing"}let b={brewing:"session.thread.submitting.brewing",simmering:"session.thread.submitting.simmering",vibing:"session.thread.submitting.vibing",cooking:"session.thread.submitting.cooking"};
e.s(["ThinkingMessage",0,function({variant:e}){let t=(0,p.useTranslations)("Code"),[i]=(0,g.useState)(_),a=(0,f.match)(e).with("submitting",()=>t(b[i])).with("thinking",()=>t("session.thread.thinking")).exhaustive();
return(0,s.jsx)(h,{children:(0,s.jsxs)("div",{className:"flex items-center gap-2 py-1",children:[(0,s.jsx)(j.TaskLoader,{className:"size-4",variant:"thinking"}),(0,s.jsx)("span",{role:"status","aria-live":"polite",className:"text-subtle animate-shimmer-mask text-sm leading-5 font-medium",children:a})]})})}],461077)},827857,e=>{e.q("/_next/static/media/agent-client-protocol-logo.0-thd3o35tpzv.svg")},676341,e=>{e.q("/_next/static/media/vscode-logo.0~ll_31k46vt4.svg")},457421,e=>{e.q("/_next/static/media/github-logo.08ps412capk6q.svg")},721121,e=>{"use strict";
var s=e.i(207478);
e.i(305374);
var t=e.i(603909),i=e.i(823186);
e.s(["PageCodeContainer",0,({className:e,...a})=>(0,s.jsx)(i.PageContainer,{className:(0,t.cn)("flex flex-col pt-8 pb-8",e),...a})])},842053,e=>{"use strict";
var s=e.i(207478),t=e.i(743881);
e.i(658854);
var i=e.i(498342);
e.i(305374);
var a=e.i(603909);
let n={src:e.i(827857).default,width:160,height:61,blurWidth:0,blurHeight:0},l={src:e.i(676341).default,width:100,height:100,blurWidth:0,blurHeight:0};
var r=e.i(721121),o=e.i(197259),c=e.i(746623);
function d({logo:e,title:t,creator:n,description:l,href:r,className:u,logoClassName:m}){return(0,s.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:(0,a.cn)("flex max-w-82 flex-col items-center justify-start gap-3 rounded-xl border border-transparent bg-(--bg-card) p-6 shadow-sm sm:items-start","hover:border-(--bg-basic-orangebright-accent)","transition-colors duration-200","cursor-pointer",u),children:[(0,s.jsxs)("div",{className:"flex w-full items-start justify-between gap-3",children:[(0,s.jsx)(o.default,{src:e,alt:t,className:(0,a.cn)("object-contain",m),height:48}),(0,s.jsx)(c.IconArrowUpRight,{"aria-hidden":"true",className:"size-6"})]}),(0,s.jsx)(i.Typography,{tag:"h2",size:"lg",weight:"semibold",children:t}),(0,s.jsx)(i.Typography,{size:"xs",weight:"medium",variant:"hint",className:"min-h-[1lh]",children:n}),(0,s.jsx)(i.Typography,{size:"sm",weight:"normal",children:l})]})}var u=e.i(522507),m=e.i(264918),x=e.i(653972);
e.i(34490);
var h=e.i(841207);
e.i(847762);
var p=e.i(294110);
e.i(581147);
var g=e.i(540101),f=e.i(394612),j=e.i(592e3);
let v={src:e.i(457421).default,width:16,height:16,blurWidth:0,blurHeight:0};
var _=e.i(694164),b=e.i(350825);
let N={focus:(0,e.i(998617).parseAsStringLiteral)(["key"])};
var y=e.i(464102);
e.i(538172);
var C=e.i(912868),w=e.i(912518),k=e.i(520234);
e.i(880349);
var T=e.i(917641);
e.i(461122);
var S=e.i(374666);
e.i(620606);
var E=e.i(246532),I=e.i(549164),A=e.i(152772),L=e.i(24404);
async function P(e){return await e.apiKey.getApiKey.cancel(),{apiKeySnapshot:e.apiKey.getApiKey.getData(void 0)}}function D(e,s){s&&e.apiKey.getApiKey.setData(void 0,s.apiKeySnapshot)}function O(e,s){e.apiKey.getApiKey.setData(void 0,s)}async function R(e){await Promise.allSettled([e.apiKey.getApiKey.invalidate()])}var K=e.i(248064),M=e.i(99615),z=e.i(243142),H=e.i(791839),B=e.i(202001),F=e.i(560053),V=e.i(817360);
let U=({content:e,children:i,onCopy:a})=>{let n=(0,t.useTranslations)("Code"),[l,r]=(0,x.useState)(!1),o=(0,x.useRef)(null);
(0,x.useEffect)(()=>()=>{null!==o.current&&clearTimeout(o.current)},[]);
let c=async()=>{try{await (0,V.writeClipboardItem)((0,V.createClipboardItem)({"text/plain":e}),e),r(!0),L.toast.success(n("extensions.cli.actions.copy_success")),a?.(),null!==o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(!1),o.current=null},2e3)}catch{L.toast.error(n("extensions.cli.actions.copy_error"))}};
return(0,s.jsxs)("div",{className:"flex flex-1 items-center gap-2",children:[(0,s.jsx)("div",{className:"bg-muted flex-1 rounded-md px-3 py-1 font-mono text-sm break-all",children:i??e}),(0,s.jsx)(S.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-1",onClick:c,"aria-label":n("extensions.cli.actions.copy_action"),children:l?(0,s.jsx)(B.IconCheck,{className:"text-success h-4 w-4"}):(0,s.jsx)(F.IconCopy,{className:"h-4 w-4"})})]})},q=({vibeApiKey:e,isDeleting:i,isRotating:a,isGenerating:n,isMutationPending:l,onCopy:r,onDelete:o,onGenerate:c,onRotate:d})=>{let u=(0,t.useTranslations)("Code"),{confirm:m}=(0,H.useConfirmDialog)(),h=Math.max(0,(e?.length??0)-4),p=e?"*".repeat(h)+e.slice(-4):"",g=(0,x.useCallback)(()=>{m({title:u("extensions.cli.api_key_management.rotate_dialog.title"),description:u("extensions.cli.api_key_management.rotate_dialog.description"),confirm:{label:u("extensions.cli.api_key_management.rotate_dialog.confirm"),onClick:d,isDestructive:!0}})},[m,d,u]),f=(0,x.useCallback)(()=>{m({title:u("extensions.cli.api_key_management.delete_dialog.title"),description:u("extensions.cli.api_key_management.delete_dialog.description"),confirm:{label:u("extensions.cli.api_key_management.delete_dialog.confirm"),onClick:o,isDestructive:!0}})},[m,o,u]);
return(0,s.jsx)("div",{className:"mt-3 flex flex-col gap-3",children:e?(0,s.jsxs)("div",{className:"flex h-8 w-full flex-row items-center gap-1",children:[(0,s.jsx)(U,{content:e,onCopy:r,children:p}),(0,s.jsx)(S.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-1",onClick:g,isLoading:a,isDisabled:l,"aria-label":u("extensions.cli.api_key_management.rotate_aria_label"),children:(0,s.jsx)(K.IconArrowRotateClockwise,{className:"h-4 w-4"})}),(0,s.jsx)(S.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-1",onClick:f,isLoading:i,isDisabled:l,"aria-label":u("extensions.cli.api_key_management.delete_aria_label"),children:(0,s.jsx)(z.IconTrash,{className:"h-4 w-4"})})]}):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:(0,s.jsxs)(S.Button,{variant:"secondary",size:"sm",onClick:c,isLoading:n,isDisabled:l,children:[(0,s.jsx)(M.IconPlus,{size:16,className:"me-1"}),u("extensions.cli.api_key_management.generate")]})})})},G=()=>{let e=(0,t.useTranslations)("Code"),i=function(){let e=(0,C.useCodeTRPC)(),{data:s,error:t,isError:i,isPending:a,refetch:n}=(0,y.useQuery)(e.apiKey.getApiKey.queryOptions(void 0,{retry:!1})),l=s?.vibeApiKey??null;return{vibeApiKey:l,vibeApiKeyId:s?.vibeApiKeyId??null,vibeApiKeyErrorReason:i?"FORBIDDEN"===t.data?.code?"forbidden":"fetch_failed":null,isVibeApiKeyError:i,isPending:a,refetchVibeApiKey:n}}(),a=function(e={}){let s=(0,C.useCodeTRPC)(),i=(0,t.useTranslations)("Code"),a=(0,C.useCodeCacheUtils)(),{track:n}=(0,b.useTrack)(),l=(0,I.useMutation)(s.apiKey.deleteApiKey.mutationOptions((0,A.composeMutationHandlers)({async onMutate(){let e=await P(a);return O(a,{vibeApiKey:null,vibeApiKeyId:null}),e},onSuccess:(e,s,t)=>{n(b.TrackingEventName.VIBE_CLI_API_KEY_DELETE,{api_key_id:t.apiKeySnapshot?.vibeApiKeyId??null}),(0,L.toast)(i("extensions.cli.api_key_management.delete_success"))},onError:(e,s,t)=>{D(a,t),L.toast.error(i("extensions.cli.api_key_management.delete_error"))},onSettled:()=>{R(a)}},e))),{mutate:r,mutateAsync:o}=l,c=(0,x.useCallback)(()=>r(),[r]),d=(0,x.useCallback)(()=>o(),[o]);return{...l,mutate:c,mutateAsync:d}}(),n=function(e={}){let s=(0,C.useCodeTRPC)(),i=(0,t.useTranslations)("Code"),a=(0,C.useCodeCacheUtils)(),{track:n}=(0,b.useTrack)(),l=(0,I.useMutation)(s.apiKey.generateApiKey.mutationOptions((0,A.composeMutationHandlers)({onSuccess:e=>{O(a,{vibeApiKey:e.vibeApiKey,vibeApiKeyId:e.vibeApiKeyId}),n(b.TrackingEventName.VIBE_CLI_API_KEY_GENERATE,{api_key_id:e.vibeApiKeyId}),(0,L.toast)(i("extensions.cli.api_key_management.generate_success"))},onError:()=>{L.toast.error(i("extensions.cli.api_key_management.generate_error"))},onSettled:()=>{R(a)}},e))),{mutate:r,mutateAsync:o}=l,c=(0,x.useCallback)(()=>r(),[r]),d=(0,x.useCallback)(()=>o(),[o]);return{...l,mutate:c,mutateAsync:d}}(),l=function(e={}){let s=(0,C.useCodeTRPC)(),i=(0,t.useTranslations)("Code"),a=(0,C.useCodeCacheUtils)(),{track:n}=(0,b.useTrack)(),l=(0,I.useMutation)(s.apiKey.rotateApiKey.mutationOptions((0,A.composeMutationHandlers)({onMutate:()=>P(a),onSuccess:(e,s,t)=>{O(a,{vibeApiKey:e.vibeApiKey,vibeApiKeyId:e.vibeApiKeyId}),n(b.TrackingEventName.VIBE_CLI_API_KEY_REGENERATE,{old_api_key_id:t.apiKeySnapshot?.vibeApiKeyId??null,new_api_key_id:e.vibeApiKeyId}),(0,L.toast)(i("extensions.cli.api_key_management.rotate_success"))},onError:(e,s,t)=>{D(a,t),L.toast.error(i("extensions.cli.api_key_management.rotate_error"))},onSettled:()=>{R(a)}},e))),{mutate:r,mutateAsync:o}=l,c=(0,x.useCallback)(()=>r(),[r]),d=(0,x.useCallback)(()=>o(),[o]);return{...l,mutate:c,mutateAsync:d}}(),r=a.isPending||n.isPending||l.isPending,{track:o}=(0,b.useTrack)(),c=(0,x.useCallback)(()=>o(b.TrackingEventName.VIBE_CLI_COPY_API_KEY,{api_key_id:i.vibeApiKeyId}),[i.vibeApiKeyId,o]),d=(0,k.match)({isPending:i.isPending,isVibeApiKeyError:i.isVibeApiKeyError}).with({isPending:!0},()=>(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(T.Skeleton,{className:"h-8 w-full"})})).with({isPending:!1,isVibeApiKeyError:!0},()=>(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[(0,s.jsx)(E.InlineTip,{state:"error",className:"w-full",children:(0,s.jsxs)("div",{className:"flex items-start gap-2 text-sm",children:[(0,s.jsx)(w.IconTriangleWarning,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,s.jsx)("span",{children:e("forbidden"===i.vibeApiKeyErrorReason?"extensions.cli.api_key_management.forbidden_error":"extensions.cli.api_key_management.fetch_error")})]})}),(0,s.jsx)("div",{children:(0,s.jsx)(S.Button,{variant:"secondary",size:"sm",onClick:()=>void i.refetchVibeApiKey(),children:e("extensions.cli.api_key_management.retry")})})]})).with({isPending:!1,isVibeApiKeyError:!1},()=>(0,s.jsx)(q,{vibeApiKey:i.vibeApiKey,isDeleting:a.isPending,isGenerating:n.isPending,isRotating:l.isPending,isMutationPending:r,onCopy:c,onDelete:a.mutate,onGenerate:n.mutate,onRotate:l.mutate})).exhaustive();return(0,s.jsxs)(s.Fragment,{children:[d,(0,s.jsx)("div",{className:"text-muted text-xs",children:i.isPending?(0,s.jsx)(T.Skeleton,{className:"h-4 w-48"}):e("extensions.cli.api_key_management.rotate_keys_often_message")})]})};var W=e.i(862290),Y=e.i(292746);let Q=({usageData:e,isPending:a,isError:n,errorReason:l})=>{let r=(0,t.useTranslations)("Code"),o=(0,W.useLocale)();if(a)return(0,s.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,s.jsx)(T.Skeleton,{className:"h-4 w-full"}),(0,s.jsx)(T.Skeleton,{className:"h-2 w-full"}),(0,s.jsx)(T.Skeleton,{className:"h-4 w-3/4"})]});if(n||!e)return(0,s.jsx)("div",{className:"text-destructive mt-3 text-sm",children:r("quota_unavailable"===l?"extensions.cli.usage.quota_unavailable":"extensions.cli.usage.loading_error")});let c=Math.min(100,Math.max(0,e.usagePercentage)),d=Intl.DateTimeFormat().resolvedOptions().timeZone,u=new Date(e.resetAt),m=Number.isNaN(u.getTime())?e.resetAt:new Intl.DateTimeFormat(o,{dateStyle:"medium",timeStyle:"short",timeZone:d}).format(u);return(0,s.jsxs)("div",{className:"flex flex-1 flex-col justify-start space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 text-sm",children:[(0,s.jsx)(i.Typography,{tag:"h2",size:"sm",weight:"semibold",children:r("extensions.cli.usage.monthly_usage")}),(0,s.jsxs)("span",{children:[c.toFixed(2),"%"]})]}),(0,s.jsx)(Y.Progress,{value:c,className:"bg-muted h-2 w-full"}),(0,s.jsx)("div",{className:"text-muted text-xs",children:r("extensions.cli.usage.resets_on",{date:m})}),(0,s.jsx)(E.InlineTip,{state:"warning",children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("span",{children:r(e.paygEnabled?"extensions.cli.usage.payg_applies_beyond_limit":"extensions.cli.usage.usage_stops_at_limit")}),e.quotaChangedThisMonth?(0,s.jsx)("span",{children:r("extensions.cli.usage.quota_changed_notice")}):null]})})]})},$=({canSeeUsage:e,shouldHighlightApiKey:n})=>{let l=(0,t.useTranslations)("Code"),r=function({enabled:e}){let s=(0,C.useCodeTRPC)(),t=(0,y.useQuery)(s.apiKey.getUsage.queryOptions(void 0,{enabled:e})),i=t.isError?"CONFLICT"===t.error.data?.code?"quota_unavailable":"fetch_failed":null;return{usageData:t.data,isPending:t.isPending,isError:t.isError,errorReason:i}}({enabled:e});return(0,s.jsxs)("div",{className:"flex flex-col gap-8 lg:flex-row lg:justify-start",children:[(0,s.jsxs)("div",{className:(0,a.cn)("flex flex-1 flex-col gap-1 rounded-lg bg-transparent p-4",{"animate-vibe-api-key-highlight":n}),children:[(0,s.jsx)(i.Typography,{tag:"h2",size:"sm",weight:"semibold",children:l("extensions.cli.api_key_management.title")}),(0,s.jsx)(G,{})]}),e?(0,s.jsx)("div",{className:"flex flex-1 flex-col gap-1",children:(0,s.jsx)(Q,{usageData:r.usageData,isPending:r.isPending,isError:r.isError,errorReason:r.errorReason})}):null]})};function X({canSeeVibeUsage:e}){let a=(0,t.useTranslations)("Code"),[{focus:n}]=(0,m.useQueryStates)(N),l="key"===n,{track:r}=(0,b.useTrack)(),[c,d]=(0,x.useState)(l);return(0,x.useEffect)(()=>{l&&d(!0)},[l]),(0,s.jsxs)("div",{className:"flex flex-col justify-center gap-12 rounded-xl bg-(--bg-card) p-[42px] shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center gap-1 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-6 sm:items-start",children:[(0,s.jsx)(o.default,{src:_.default,alt:a("extensions.cli.title"),width:50,height:48}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)(i.Typography,{tag:"h2",size:"2xl",weight:"semibold",children:a("extensions.cli.title")}),(0,s.jsx)(i.Typography,{size:"sm",weight:"medium",variant:"hint",children:a("extensions.cli.creator")})]})]}),(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 sm:flex-row",children:[(0,s.jsxs)(h.ButtonLink,{href:"https://github.com/mistralai/mistral-vibe",target:"_blank",rel:"noopener noreferrer",variant:"ghost",onClick:()=>r(b.TrackingEventName.VIBE_CLI_GITHUB_LINK_CLICK),children:[(0,s.jsx)(o.default,{src:v,alt:"",width:16,height:16,className:"size-4 dark:invert"}),a("extensions.cli.header_links.github")]}),(0,s.jsxs)(h.ButtonLink,{href:"https://docs.mistral.ai/mistral-vibe/introduction",target:"_blank",rel:"noopener noreferrer",variant:"ghost",onClick:()=>r(b.TrackingEventName.VIBE_CLI_DOCS_LINK_CLICK),children:[(0,s.jsx)(u.IconExternalLink,{className:"size-4"}),a("extensions.cli.header_links.documentation")]})]})]}),(0,s.jsx)(i.Typography,{size:"sm",weight:"normal",children:a("extensions.cli.description")})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-6 lg:flex-row",children:[(0,s.jsxs)("div",{className:"flex flex-1 flex-col gap-2",children:[(0,s.jsx)(i.Typography,{size:"sm",weight:"medium",children:a("extensions.cli.actions.step",{number:1,label:a("extensions.cli.actions.install_vibe_cli")})}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(p.CodeSnippet,{code:"curl -LsSf https://mistral.ai/vibe/install.sh | bash",language:"bash",hideHeader:!0,wrapLines:!1,onCopy:()=>r(b.TrackingEventName.VIBE_CLI_COPY_INSTALL_COMMAND)})})]}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col gap-2",children:[(0,s.jsx)(i.Typography,{size:"sm",weight:"medium",children:a("extensions.cli.actions.step",{number:2,label:a("extensions.cli.actions.launch_vibe_cli")})}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(p.CodeSnippet,{code:"vibe --setup",language:"bash",hideHeader:!0,wrapLines:!1,onCopy:()=>r(b.TrackingEventName.VIBE_CLI_COPY_LAUNCH_COMMAND)})})]})]}),(0,s.jsxs)(g.Collapsible,{fullWidth:!0,className:"group/advanced",open:c,onOpenChange:d,children:[(0,s.jsx)(j.CollapsibleTrigger,{className:"flex w-full items-center justify-start gap-1.5 text-left",children:(0,s.jsx)(i.Typography,{size:"sm",weight:"medium",children:a("extensions.cli.advanced.title")})}),(0,s.jsx)(f.CollapsibleContent,{className:"flex flex-col gap-6 group-data-[state=open]/advanced:pt-6",children:(0,s.jsx)($,{canSeeUsage:e,shouldHighlightApiKey:l})})]})]})}e.s(["ExtensionsPageContent",0,({canSeeVibeUsage:e,vibeCodeEnabled:o})=>{let c=(0,t.useTranslations)("Code");return(0,s.jsxs)(r.PageCodeContainer,{className:(0,a.cn)("gap-12",!o&&"justify-center"),wrapperClassName:"min-h-0 flex-1 self-stretch ",children:[o&&(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(i.Typography,{tag:"h1",size:"2xl",weight:"semibold",children:c("extensions.title")}),(0,s.jsx)(i.Typography,{tag:"p",size:"default",weight:"normal",variant:"hint",children:c("extensions.cli.subtitle")})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(i.Typography,{tag:"h3",size:"sm",weight:"semibold",variant:"muted",children:c("extensions.featured")}),(0,s.jsx)(X,{canSeeVibeUsage:e})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(i.Typography,{tag:"h3",size:"sm",weight:"semibold",variant:"muted",children:c("extensions.all")}),(0,s.jsxs)("div",{className:"flex flex-col gap-6 sm:flex-row",children:[(0,s.jsx)(d,{logo:l,title:c("extensions.cards.vs_code.title"),creator:c("extensions.cards.vs_code.creator"),description:c("extensions.cards.vs_code.description"),href:"https://marketplace.visualstudio.com/items?itemName=mistralai.mistral-vibe-code",className:"w-full max-w-full sm:max-w-none sm:flex-1",logoClassName:"max-w-6"}),(0,s.jsx)(d,{logo:n,title:c("extensions.cards.acp.title"),creator:c("extensions.cards.acp.creator"),description:c("extensions.cards.acp.description"),href:"https://agentclientprotocol.com/get-started/clients",className:"w-full max-w-full sm:max-w-none sm:flex-1",logoClassName:"dark:invert max-w-16"})]})]})]})}],842053)},184015,e=>{"use strict";var s=e.i(459490);let t="vibe_code_web.first_session_pending_project_ids",i="vibe_code_web.first_session_tracked_project_ids";function a(e){return e??(0,s.getWindowStorage)("local")}e.s(["consumeFirstSessionStepPending",0,function(e,n){let l=a(n);return null!==l&&((0,s.hasInStoredStringSet)(l,i,e)?((0,s.removeFromStoredStringSet)(l,t,e),!1):!!(0,s.removeFromStoredStringSet)(l,t,e)&&((0,s.addToStoredStringSet)(l,i,e),!0))},"markFirstSessionStepPending",0,function(e,i){let n=a(i);null!==n&&(0,s.addToStoredStringSet)(n,t,e)}])},158917,e=>{"use strict";e.i(410428),e.i(515844),e.s([])},106570,818353,e=>{"use strict";var s=e.i(653972);let t=["connectors"];var i=e.i(689891);function a(e,s){if("connectors"===s)return e?.vcw_connectors===!0;throw Error(`Unsupported code feature: ${s}`)}e.s(["useCodeFeatures",0,function(){let e=(0,i.useSession)()?.session.organization.featureFlags??null;return(0,s.useMemo)(()=>t.filter(s=>a(e,s)),[e])},"useHasCodeFeature",0,function(e){return a((0,i.useSession)()?.session.organization.featureFlags??null,e)}],106570);var n=e.i(288130),l=e.i(504298);function r(e){let s=e.trim();return s.length>0?s:null}function o(e){let s=r(e.id),t=r(e.dbName);return t?{type:"connector",name:t}:s?{type:"connector",id:s}:null}e.s(["getContentFromFormData",0,function(e){var s;let t,i,a=(0,l.getTextContentFromMessage)(e.message);return a.trim()?{content:[{type:"text",text:a}],toolsets:(t=new Set(e.connectors.flatMap(e=>[e.id,e.dbName].map(r).filter(n.isTruthy))),s=[...e.connectors.map(o),...e.message.map(e=>{if("slash"!==e.type||"connection"!==e.content.subType)return null;let s=r(e.content.selectedValue);return!s||t.has(s)?null:{type:"connector",id:s}})].filter(n.isTruthy),i=new Set,s.filter(e=>{let s=void 0!==e.id?`connector:id:${e.id}`:`connector:name:${e.name}`;return!i.has(s)&&(i.add(s),!0)}))}:null},"getMessageFromTextContent",0,function(e){return e.map(({text:e})=>({type:"text",content:e}))}],818353)},599457,470270,e=>{"use strict";var s=e.i(207478),t=e.i(743881),i=e.i(98912),a=e.i(653972),n=e.i(921743),l=e.i(656288);let r={hour:36e5,day:864e5,week:6048e5};e.s(["useBetaNotification",0,function(){var e;let o,c,d,u,{isLoading:m,isDismissed:x,dismiss:h}=(e="code-beta-notification",c=(o=(0,l.usePersistentStore)()).isLoaded,d=o.setDismissedItem,u=(0,a.useMemo)(()=>{let s=o.dismissedItems[e];return!!s&&(s.dismissDuration?s.dismissed&&s.dismissedAt+s.dismissDuration>new Date().getTime():s.dismissed)},[e,o.dismissedItems]),c?{isLoading:!1,isDismissed:u,dismiss:s=>{let t="string"==typeof s?r[s]:s;d(e,{dismissed:!0,dismissedAt:new Date().getTime(),dismissDuration:t??null})}}:{isLoading:!0,isDismissed:void 0,dismiss:n.noop}),p=(0,t.useTranslations)("Code");return{id:"code-beta",type:"highlight",active:!m&&!x,element:(0,s.jsx)(i.CodeSessionNotificationContent,{onHide:()=>h(),modalTitle:p("beta_notification.modal.title"),notificationMessage:p("beta_notification.message"),description:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("span",{children:p("beta_notification.modal.description_1")}),(0,s.jsx)("span",{children:p.rich("beta_notification.modal.description_2",{link:e=>(0,s.jsx)("a",{href:"https://docs.mistral.ai/vibe/code/cli/teleport-cli-web",target:"_blank",rel:"noopener noreferrer",className:"underline",children:e})})})]}),continueButtonLabel:p("beta_notification.modal.start_coding"),onContinue:()=>h()})}}],599457),e.i(305374);var o=e.i(603909),c=e.i(565813);let d=(0,o.cn)("[mask-image:linear-gradient(to_top,black_60%,transparent),linear-gradient(to_right,transparent,black_2%,black_98%,transparent)]","[-webkit-mask-image:linear-gradient(to_top,black_60%,transparent),linear-gradient(to_right,transparent,black_2%,black_98%,transparent)]");function u({className:e}){return(0,s.jsx)("div",{"aria-hidden":!0,className:(0,o.cn)("bg-subtle/60 pointer-events-none absolute inset-x-0 inset-y-0 backdrop-blur-md","[mask-composite:intersect] [-webkit-mask-composite:source-in]",d,e)})}let m="--code-chat-input-height",x=`var(${m}, 180px)`,h="px-2 md:px-4",p="mx-auto w-full max-w-(--breakpoint-md) min-w-0";e.s(["CODE_CHAT_INPUT_HEIGHT_CSS_VALUE",0,x,"CODE_CHAT_RAIL_CONTENT_CLASSNAME",0,p,"CODE_CHAT_RAIL_PADDING_CLASSNAME",0,h,"ChatInputContainer",0,function({children:e,floatingAction:t,className:i}){let a=(0,c.useElementHeightCssVariable)(m);return(0,s.jsxs)("div",{ref:a,className:(0,o.cn)("sticky bottom-0 z-30",i),children:[(0,s.jsx)(u,{className:"@min-screen-md/layout:-inset-x-8 -inset-x-4"}),t?(0,s.jsx)("div",{className:(0,o.cn)("pointer-events-none absolute inset-x-0 bottom-full flex justify-center pb-3",h),children:(0,s.jsx)("div",{className:(0,o.cn)("pointer-events-auto",p),children:t})}):null,(0,s.jsx)("div",{className:(0,o.cn)("relative w-full py-5",h),children:(0,s.jsxs)("div",{className:(0,o.cn)("relative",p),children:[(0,s.jsx)("div",{"aria-hidden":!0,className:"bg-subtle pointer-events-none absolute -inset-0.5 rounded-lg blur"}),(0,s.jsx)("div",{className:"relative",children:e})]})})]})}],470270)},342176,406850,239872,178329,e=>{"use strict";let s={interactionMode:"default",libraries:{access:"hidden"},skills:{access:"hidden"},mode:(0,e.i(312271).createModeSettings)({}),projects:{access:"hidden"},agents:{access:"hidden",sources:[]},connectors:{access:"write"},workflows:{access:"hidden"},fileUpload:{access:"hidden"},tools:{access:"hidden",details:{"beta-code-interpreter":"hidden","beta-imagegen":"hidden","beta-trampoline":"hidden","beta-websearch":"hidden"}},message:{access:"write",mode:"rich-content"}};e.s(["CODE_CHAT_INPUT_SETTINGS",0,s,"CODE_TEXT_ONLY_CHAT_INPUT_SETTINGS",0,{interactionMode:"text-only"}],342176);var t=e.i(653972),i=e.i(464102),a=e.i(912868);e.s(["useSelectedHost",0,function(){let e,{data:s}=(e=(0,a.useCodeTRPC)(),(0,i.useQuery)(e.hosts.list.queryOptions())),[n,l]=(0,t.useState)(null),r=s?.hosts??[],o=s?.currentHostKind??"cloud-sandbox";return{hostKind:n&&r.some(e=>e.kind===n)?n:o,hosts:r,onSelectHostKind:l}}],406850);var n=e.i(432188);e.s(["CREATE_SESSION_ERROR_TRANSLATION_KEYS",0,{home:{default:"home.submit_error",quota:"home.submit_quota_error",concurrentQuota:"home.submit_concurrent_quota_error"},project:{default:"project.create_session_error",quota:"project.create_session_quota_error",concurrentQuota:"project.create_session_concurrent_quota_error"}},"getCreateSessionErrorTranslationKey",0,function(e,s){return(0,n.isTooManyRequestsError)(e)?(0,n.getTrpcRateLimitReason)(e)?.kind==="user_concurrent_limit"?s.concurrentQuota:s.quota:s.default}],239872),e.s([],178329)},56530,e=>{"use strict";var s=e.i(207478),t=e.i(743881),i=e.i(653972),a=e.i(907390);let n=({...e})=>i.default.createElement(a.Icon,{size:"24px",...e},i.default.createElement("path",{d:"M18 20H13H6C3.23858 20 1 17.7614 1 15C1 12.2386 3.23858 10 6 10C6 6.68629 8.68629 4 12 4C15.3137 4 18 6.68629 18 10C20.7614 10 23 12.2386 23 15C23 17.7614 20.7614 20 18 20Z",stroke:"currentColor",strokeWidth:"2",fill:"none"}));var l=e.i(867883);e.i(461122);var r=e.i(374666);e.i(802494);var o=e.i(720802);function c({kind:e}){let t="cloud-sandbox"===e?n:l.IconLaptop;return(0,s.jsx)(t,{className:"text-icon-default-subtle size-4 shrink-0"})}e.s(["HostKindSelector",0,function({hosts:e,value:a,onChange:n}){let l=(0,t.useTranslations)("Code"),[d,u]=(0,i.useState)(!1),m=e=>"cloud-sandbox"===e?l("host_selector.cloud_sandbox"):l("host_selector.local");if(e.length<=1)return null;let x=e.find(e=>e.kind===a)??e[0];return x?(0,s.jsxs)(o.Combobox,{open:d,onOpenChange:u,value:x.kind,onChange:e=>{("cloud-sandbox"===e||"local"===e)&&n(e)},children:[(0,s.jsx)(o.ComboboxTrigger,{className:"w-fit",asChild:!0,"aria-label":l("host_selector.aria_label"),children:(0,s.jsxs)(r.Button,{mode:"default",variant:"secondary",size:"sm",className:"text-subtle",children:[(0,s.jsx)(c,{kind:x.kind}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:m(x.kind)})]})}),(0,s.jsx)(o.ComboboxContent,{className:"w-fit min-w-[180px]",children:(0,s.jsx)(o.ComboboxList,{children:e.map(e=>(0,s.jsxs)(o.ComboboxItem,{value:e.kind,contentClassName:"flex min-w-0 flex-1 items-center gap-2",children:[(0,s.jsx)(c,{kind:e.kind}),(0,s.jsx)("span",{className:"min-w-0 truncate font-medium",children:m(e.kind)})]},e.kind))})})]}):null}],56530)},928839,e=>{"use strict";var s=e.i(207478),t=e.i(653972),i=e.i(649531);e.i(880349);var a=e.i(917641);e.i(305374);var n=e.i(603909),l=e.i(966819);function r({logo:e,inputSkeleton:t=(0,s.jsx)(i.ChatInputSkeleton,{className:"w-full"}),titleClassName:o}){return(0,s.jsx)(l.ScrollableLandingPageLayout,{contentClassName:l.INPUT_CENTERED_LANDING_CONTENT_CLASSNAME,children:(0,s.jsxs)("div",{className:"grid h-dvh min-h-dvh grid-rows-[1fr_auto_1fr]",children:[(0,s.jsxs)("div",{className:"flex flex-col justify-end gap-5 pb-5",children:[(0,s.jsx)("div",{"aria-hidden":"true",children:e}),(0,s.jsx)(a.Skeleton,{className:(0,n.cn)("h-9 w-52 rounded-md",o)})]}),t,(0,s.jsx)("div",{className:"pt-5"})]})})}e.i(140038);var o=e.i(935164),c=e.i(690838),d=e.i(328793),u=e.i(592182);e.i(337361);var m=e.i(167591),x=e.i(199714),h=e.i(743881),p=e.i(197259),g=e.i(99615);e.i(461122);var f=e.i(374666);e.i(884633);var j=e.i(464460),v=e.i(350825),_=e.i(182330),b=e.i(184015);let N={src:e.i(805045).default,width:48,height:51,blurWidth:0,blurHeight:0};var y=e.i(52501),C=e.i(624651);function w(){let e=(0,h.useTranslations)("Code"),{trackCodeEvent:i}=(0,_.useCodeTelemetry)(),[a,n]=(0,t.useState)(!1),l=(0,t.useCallback)(e=>{i(v.TrackingEventName.VIBE_ONBOARDING_STEP_COMPLETED,{step:"pick_repo",repo_provider:"github",nb_repos_selected:e.repositories.length},{projectId:e.id}),(0,b.markFirstSessionStepPending)(e.id)},[i]);return(0,s.jsxs)("div",{className:"flex flex-col items-center gap-6 px-6 py-8 text-center",children:[(0,s.jsx)(p.default,{src:N,alt:"",width:48,height:51}),(0,s.jsx)(j.Divider,{variant:"dashed",className:"w-full"}),(0,s.jsx)(C.SectionHeader,{title:e("github_onboarding.first_project_title"),subtitle:e("github_onboarding.first_project_description")}),(0,s.jsxs)(f.Button,{onClick:()=>{i(v.TrackingEventName.VIBE_CREATE_PROJECT_DIALOG_OPENED,{source:"empty_state"}),n(!0)},children:[(0,s.jsx)(f.ButtonLeadIcon,{icon:g.IconPlus}),e("github_onboarding.create_project_button")]}),(0,s.jsx)(y.CreateProjectDialog,{isOpen:a,onOpenChange:n,onCreated:l})]})}var k=e.i(296439),T=e.i(182939),S=e.i(24404),E=e.i(297697),I=e.i(925595),A=e.i(385293),L=e.i(148594),P=e.i(689891);e.i(158917);var D=e.i(304443),O=e.i(993343),R=e.i(34334),K=e.i(342176),M=e.i(406850);e.i(873203);var z=e.i(377093),H=e.i(106570);e.i(178329);var B=e.i(239872),F=e.i(818353),V=e.i(599457),U=e.i(470270),q=e.i(56530),G=e.i(563356);let W={top:"40%",y:0},Y={top:"calc(100% - 1.25rem)",y:"-100%"};function Q({children:e,isAtBottom:t,onAnimationComplete:i}){return(0,s.jsx)(G.motion.div,{initial:W,animate:t?Y:W,transition:{duration:.4,ease:"easeInOut"},className:(0,n.cn)("absolute flex w-full justify-center",U.CODE_CHAT_RAIL_PADDING_CLASSNAME),onAnimationComplete:i,children:(0,s.jsx)("div",{className:(0,n.cn)("relative flex flex-col gap-3",U.CODE_CHAT_RAIL_CONTENT_CLASSNAME),children:e})})}e.i(246589);var $=e.i(743323);function X({text:e}){return(0,s.jsx)(G.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,ease:"easeInOut"},children:(0,s.jsx)($.MessageThreadUserMessage,{className:"text-subtle",children:(0,s.jsx)("span",{className:"min-w-0 break-words whitespace-pre-wrap",children:e})})})}var Z=e.i(550629);e.i(802494);var J=e.i(720802),ee=e.i(827675),es=e.i(942832);e.i(135636);var et=e.i(179747);e.i(297531);var ei=e.i(340141);e.i(658854);var ea=e.i(498342);function en(){let e=(0,h.useTranslations)("Code");return(0,s.jsx)("div",{className:"flex flex-col items-center justify-center gap-3 px-6 py-8 text-center",children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(ea.Typography,{size:"default",weight:"semibold",children:e("project_selector.no_projects_title")}),(0,s.jsx)(ea.Typography,{size:"sm",variant:"muted",children:e("project_selector.no_projects_description")})]})})}var el=e.i(446039);function er({selectedProject:e,onSelect:i}){let n=(0,h.useTranslations)("Code"),{trackCodeEvent:l}=(0,_.useCodeTelemetry)(),[r,o]=t.useState(!1),[c,d]=t.useState(!1),{data:u,isPending:x,isFetchingNextPage:p,hasNextPage:j,fetchNextPage:b}=(0,m.useListProjects)(),[N,C]=t.useState(""),w=u??[],k=t.useMemo(()=>{if(!N)return w;let e=N.toLowerCase();return w.filter(s=>s.name.toLowerCase().includes(e))},[w,N]);return x?(0,s.jsx)(a.Skeleton,{className:"h-10 w-fit min-w-[200px]"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(J.Combobox,{open:r,onOpenChange:o,value:e.id,onChange:e=>{let s=k.find(s=>s.id===e);s&&!s.isReadOnly&&i(s)},children:[(0,s.jsx)(J.ComboboxTrigger,{className:"w-fit",asChild:!0,"aria-label":n("project_selector.aria_label"),children:(0,s.jsxs)(f.Button,{mode:"default",variant:"secondary",size:"sm",className:"text-subtle",children:[(0,s.jsx)(el.ProjectAvatar,{repositories:e.repositories,className:"size-4"}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.name}),e.isReadOnly?(0,s.jsx)(Z.IconLock,{className:"text-muted size-3.5 shrink-0","aria-label":n("read_only_project.selector_disabled")}):null]})}),(0,s.jsxs)(J.ComboboxContent,{className:"w-fit min-w-[350px]",children:[(0,s.jsx)(J.ComboboxSearch,{searchTerm:N,onSearchTermChange:C,placeholder:n("project_selector.search_placeholder")}),(0,s.jsx)(J.ComboboxList,{children:0===k.length?(0,s.jsx)(en,{}):(0,s.jsxs)(s.Fragment,{children:[k.map(i=>{let a=(0,s.jsxs)(J.ComboboxItem,{value:i.id,disabled:i.isReadOnly,className:"group rounded-none p-3 [&>div:first-child]:flex [&>div:first-child]:min-w-0 [&>div:first-child]:flex-1 [&>div:first-child]:items-center [&>div:first-child]:gap-2 [&>svg:last-child]:hidden",children:[(0,s.jsx)(el.ProjectAvatar,{repositories:i.repositories,className:"size-4"}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate font-semibold",children:i.name}),i.isReadOnly?(0,s.jsx)(Z.IconLock,{className:"text-icon-default-muted size-3.5 shrink-0","aria-hidden":!0}):null,(0,s.jsx)(et.Radio,{checked:i.id===e.id,value:i.id,className:"pointer-events-none ms-2 flex-shrink-0"})]});return i.isReadOnly?(0,s.jsxs)(ei.Tooltip,{children:[(0,s.jsx)(ei.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("div",{children:a})}),(0,s.jsx)(ei.TooltipContent,{className:"max-w-64",children:n("read_only_project.composer_disabled")})]},i.id):(0,s.jsx)(t.Fragment,{children:a},i.id)}),p&&(0,s.jsx)(ee.ComboboxLoading,{className:"py-2",children:n("loading")}),j&&!p&&!N&&(0,s.jsx)(es.ComboboxSentinel,{onLoadMore:b})]})}),(0,s.jsx)("div",{className:"border-t",children:(0,s.jsxs)(f.Button,{variant:"ghost",className:"w-full rounded-none p-3 font-semibold",onClick:()=>{l(v.TrackingEventName.VIBE_CREATE_PROJECT_DIALOG_OPENED,{source:"project_selector"}),o(!1),d(!0)},children:[(0,s.jsx)(f.ButtonLeadIcon,{icon:g.IconPlus}),n("project_selector.new_project")]})})]})]}),(0,s.jsx)(y.CreateProjectDialog,{isOpen:c,onOpenChange:d})]})}var eo=e.i(461077);let ec="size-4 shrink-0 text-icon-default-subtle";function ed({selectedProject:e,onSelectProject:i,onUseProject:a}){let r=(0,h.useTranslations)("Code"),o=(0,P.useSession)(),{navigate:u}=(0,c.useNavigation)(),m=(0,V.useBetaNotification)(),{defaultValues:x,saveDraftFields:p}=(0,D.useCodeChatInputDraft)(),{moveChatInputDraft:g}=(0,D.useCodeChatInputDraftActions)(),f=(0,O.useVibeUsageLimitDialog)(),{mutateAsync:j,isPending:v}=(0,z.useCreateSession)(),{hostKind:_,hosts:b,onSelectHostKind:N}=(0,M.useSelectedHost)(),[y,C]=(0,t.useState)(null),[w,G]=(0,t.useState)(null),[W,Y]=(0,t.useState)(!1),$=null!==y,Z=!e.isReadOnly,J=(0,H.useHasCodeFeature)("connectors"),ee=J?K.CODE_CHAT_INPUT_SETTINGS:K.CODE_TEXT_ONLY_CHAT_INPUT_SETTINGS;(0,t.useEffect)(()=>{w&&W&&u("session",{projectId:e.id,sessionId:w})},[W,w,u,e.id]);let es=async s=>{if(!e.isReadOnly){C(s.content.map(e=>e.text).join("")),Y(!1),G(null);try{let t=await j({projectId:e.id,hostKind:_,...s});g(R.SHARED_DRAFT_KEY,t.id),a(e.id),G(t.id)}catch(e){if(C(null),Y(!1),p({message:(0,F.getMessageFromTextContent)(s.content)}),f(e))return;S.toast.error(r((0,B.getCreateSessionErrorTranslationKey)(e,B.CREATE_SESSION_ERROR_TRANSLATION_KEYS.home)))}}},et=async e=>{await es({content:[{type:"text",text:e}],toolsets:[]})},ei=async e=>{let s=(0,F.getContentFromFormData)(e);s&&await es(J?s:{...s,toolsets:[]})},ea=(0,t.useMemo)(()=>({message:e=>p({message:e}),connectors:e=>p({connectors:e})}),[p]),en=(0,t.useMemo)(()=>e.isReadOnly?(0,I.makeNotification)({id:"code-project-read-only",type:"blocker",active:!0,element:(0,s.jsx)(A.Notification,{className:"text-inverted-default",disableAnimation:!0,children:(0,s.jsx)(A.NotificationMessage,{children:r("read_only_project.composer_disabled")})})}):null,[e.isReadOnly,r]),el=en?[en,m]:[m],eu=o?.session.user.firstName?.trim(),em=eu?r("home.title_with_name",{firstName:eu}):r("home.title"),ex=[{icon:(0,s.jsx)(k.IconCode,{className:ec}),prompt:r("home.prompt_suggestions.review_repo"),onClick:()=>void et(r("home.prompt_suggestions.review_repo"))},{icon:(0,s.jsx)(k.IconCode,{className:ec}),prompt:r("home.prompt_suggestions.testing_strategy"),onClick:()=>void et(r("home.prompt_suggestions.testing_strategy"))},{icon:(0,s.jsx)(k.IconCode,{className:ec}),prompt:r("home.prompt_suggestions.project_roadmap"),onClick:()=>void et(r("home.prompt_suggestions.project_roadmap"))}];return $?(0,s.jsxs)("div",{className:"relative flex min-h-0 w-full flex-1 flex-col",children:[(0,s.jsxs)("div",{className:"absolute inset-x-0 top-0 flex flex-col",children:[(0,s.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)(T.NavigationBar.barContainerStyle,"desktop:pt-8 min-w-0"),children:(0,s.jsx)(T.NavigationBar.Section,{className:"ps-6 pt-5",children:(0,s.jsx)("div",{className:"h-9"})})}),(0,s.jsx)("div",{className:(0,n.cn)("flex w-full justify-center",U.CODE_CHAT_RAIL_PADDING_CLASSNAME),children:(0,s.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-2",U.CODE_CHAT_RAIL_CONTENT_CLASSNAME),children:[(0,s.jsx)(X,{text:y}),(0,s.jsx)(eo.ThinkingMessage,{variant:"submitting"})]})})]}),(0,s.jsx)(Q,{isAtBottom:!0,onAnimationComplete:()=>Y(!0),children:(0,s.jsx)(E.ChatInput,{defaultValues:x,onSubmit:ei,onChange:ea,placeholder:r("session.placeholder"),settings:ee,notifications:[m],isGenerating:v,productType:"chat"})})]}):(0,s.jsx)(l.ScrollableLandingPageLayout,{contentClassName:l.INPUT_CENTERED_LANDING_CONTENT_CLASSNAME,children:(0,s.jsx)(L.GreetingLandingLayout,{logo:(0,s.jsx)(d.CodeLandingLogo,{}),title:em,inputCentered:!0,suggestions:Z?ex:[],suggestionsHeader:Z?(0,s.jsx)("p",{className:"text-muted mb-3 px-1 text-sm",children:r("home.prompt_suggestions.title")}):void 0,children:(0,s.jsx)("div",{className:"flex flex-col gap-3",children:(0,s.jsx)(E.ChatInput,{defaultValues:x,onSubmit:ei,onBeforeSubmit:()=>p({message:[]}),onChange:ea,placeholder:r("home.placeholder"),settings:ee,notifications:el,isGenerating:v,disableSubmit:!Z,productType:"chat",secondRowLeadingElement:(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,s.jsx)(er,{selectedProject:e,onSelect:i}),(0,s.jsx)(q.HostKindSelector,{hosts:b,value:_,onChange:N})]})})})})})}function eu(){let{data:e,isLoading:t}=(0,m.useListProjects)(),{selectedProject:i,isLoadingSelectedProject:a,selectProject:n}=(0,x.useSelectedProject)(),r=e??[],o=i??r.find(e=>!e.isReadOnly)??r[0];return t||a?(0,s.jsx)(em,{}):o?(0,s.jsx)(ed,{selectedProject:o,onSelectProject:e=>n(e.id),onUseProject:n}):(0,s.jsx)(l.ScrollableLandingPageLayout,{contentClassName:"flex flex-1 items-center justify-center",children:(0,s.jsx)(w,{})})}function em(){return(0,s.jsx)(r,{logo:(0,s.jsx)(d.CodeLandingLogo,{}),inputSkeleton:(0,s.jsx)(i.ChatInputSkeleton,{className:"w-full",layout:"two-row"})})}function ex(){return(0,s.jsx)(r,{logo:(0,s.jsx)(d.CodeLandingLogo,{}),inputSkeleton:(0,s.jsx)(i.ChatInputSkeleton,{className:"w-full",layout:"two-row"})})}e.s(["CodeHomePageClient",0,function(){let{isConnected:e,isPending:i,isError:a,isFetching:n,refetch:r}=(0,o.useIsGithubAppConnected)(),{navigate:m}=(0,c.useNavigation)();return((0,t.useEffect)(()=>{i||a||e||m("setup",{method:"replace"})},[e,a,i,m]),i)?(0,s.jsx)(ex,{}):a?(0,s.jsx)(l.ScrollableLandingPageLayout,{contentClassName:"mt-[25vh]",children:(0,s.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,s.jsx)(d.CodeLandingLogo,{}),(0,s.jsx)(u.GithubSetupFetchError,{isLoading:n,onRetry:r})]})}):e?(0,s.jsx)(eu,{}):null}],928839)},515041,e=>{e.v(s=>Promise.all(["static/chunks/169jsijmk~_zg.js"].map(s=>e.l(s))).then(()=>s(65467)))}]);
//# debugId=472d5fc6-51c4-0c22-bcec-9b94804680fc
//# sourceMappingURL=0wvl3~60gs~af.js.map
```