@surething/cockpit 1.0.280 → 1.0.282
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +5 -5
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/cockpit-build.json +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +2 -2
- package/.next-prod/server/app/_not-found.rsc +4 -4
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +5 -5
- package/.next-prod/server/chunks/2493.js +2 -2
- package/.next-prod/server/chunks/5591.js +3 -3
- package/.next-prod/server/chunks/7438.js +7 -7
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +2 -2
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/{81016-71999ca5bd6a6b2f.js → 72550-456b4a8d1b8a0122.js} +16 -16
- package/.next-prod/static/chunks/{95313-af5cc33125d6c0ff.js → 95313-a6d8f9e8207d731c.js} +1 -1
- package/.next-prod/static/chunks/app/{layout-0c3dcac0764d9e97.js → layout-6641747151f1495e.js} +1 -1
- package/.next-prod/static/chunks/app/{page-b472e7f948959009.js → page-a196e139366e9958.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-b472e7f948959009.js → page-a196e139366e9958.js} +1 -1
- package/.next-prod/static/css/bc059ebeb7cf61ba.css +1 -0
- package/.next-prod/trace +15 -15
- package/.next-prod/trace-build +1 -1
- package/README.md +3 -3
- package/README.zh.md +3 -3
- package/dist/{chunk-N6CFCP2N.mjs → chunk-UIW3QM6E.mjs} +1 -1
- package/dist/{chunk-3LSLUAN6.mjs → chunk-YDI26AYY.mjs} +6 -2
- package/dist/httpApi.mjs +2 -2
- package/dist/scheduledTasks.mjs +1 -1
- package/dist/wsServer.mjs +2 -2
- package/package.json +13 -4
- package/.next-prod/static/css/e33280be1b23649f.css +0 -1
- /package/.next-prod/static/{_195_hPNVuma2vZS7bpTW → CzzbCJuWzqFF_23NMp7ya}/_buildManifest.js +0 -0
- /package/.next-prod/static/{_195_hPNVuma2vZS7bpTW → CzzbCJuWzqFF_23NMp7ya}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95313],{201:(e,t,n)=>{n.d(t,{M:()=>M});var r=n(95155),s=n(12115),l=n(83897),o=n(57125),a=n(49619);function i({bot:e}){return e?(0,r.jsx)("span",{className:"shrink-0 inline-flex items-center text-brand","data-tooltip":`@${e}`,"aria-label":`Bot session: @${e}`,role:"img",children:(0,r.jsx)(a.A,{className:"h-3.5 w-3.5"})}):null}var c=n(23883),d=n(1058),u=n(90717),h=n(89109),m=n(7320),f=n(79114),x=n(86957),p=n(83448),g=n(62111),b=n(64428);let v=/[,,]/;function w({initialRows:e,lang:t,isCustomized:n,onSave:l,onRestoreDefault:o,onClose:a}){let{t:i}=(0,f.Bd)(),[c,d]=(0,s.useState)(()=>e.map(e=>e.join("zh"===t?",":", ")).join("\n"));(0,g.E)(a);let u=(0,s.useCallback)(()=>{l(c.split("\n").map(e=>e.split(v).map(e=>e.trim().slice(0,200)).filter(Boolean).slice(0,8)).filter(e=>e.length>0).slice(0,12)),a()},[c,l,a]),h=(0,s.useCallback)(()=>{o(),a()},[o,a]);return(0,r.jsx)(b.ZL,{children:(0,r.jsx)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-scrim p-4",onClick:a,children:(0,r.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-lv3 w-full max-w-md flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,r.jsx)("h2",{className:"text-sm font-medium text-foreground",children:i("quickReply.editTitle")}),(0,r.jsx)("button",{onClick:a,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors","aria-label":i("quickReply.cancel"),children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsxs)("div",{className:"px-4 py-3 flex flex-col gap-2",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:i("quickReply.editHint")}),(0,r.jsx)("textarea",{autoFocus:!0,value:c,onChange:e=>d(e.target.value),placeholder:i("quickReply.editPlaceholder"),rows:6,spellCheck:!1,className:"w-full px-2 py-1.5 text-xs font-mono bg-background border border-border rounded text-foreground focus:outline-none focus:border-brand resize-y"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:i("quickReply.customizedFor",{lang:i("zh"===t?"quickReply.langZh":"quickReply.langEn")})})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-border",children:[(0,r.jsx)("button",{onClick:h,disabled:!n,className:"px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:i("quickReply.restoreDefault")}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:a,className:"px-3 py-1.5 text-xs border border-border text-foreground rounded-md hover:bg-hover transition-colors",children:i("quickReply.cancel")}),(0,r.jsx)("button",{onClick:u,className:"px-3 py-1.5 text-xs font-medium border border-brand text-brand rounded-md hover:bg-brand/10 transition-colors",children:i("quickReply.save")})]})]})]})})})}let y={mode:"follow",pinTop:null},k={mode:"free",pinTop:null};function j(e){return Math.max(0,e.scrollHeight-e.spacer)}function C(e){return Math.max(0,j(e)-e.clientHeight)}function N(e,t){return e<=0?0:Math.max(0,e+t.clientHeight-j(t))}function S(e){return j(e)-e.scrollTop-e.clientHeight<50}function L(e,t="auto"){return{owner:y,spacer:0,scrollTo:C(e),behavior:t}}function E({value:e}){let[t,n]=(0,s.useState)(e),l=(0,s.useRef)(e),o=(0,s.useRef)(null);return(0,s.useEffect)(()=>{null!==o.current&&(cancelAnimationFrame(o.current),o.current=null);let t=l.current;if(e<=t){l.current=e,n(e);return}let r=performance.now(),s=a=>{let i=Math.min(1,Math.ceil(12*Math.min(1,(a-r)/400))/12),c=Math.round(t+(e-t)*i);l.current=c,n(c),i<1?o.current=requestAnimationFrame(s):o.current=null};return o.current=requestAnimationFrame(s),()=>{null!==o.current&&cancelAnimationFrame(o.current),o.current=null}},[e]),(0,r.jsx)("span",{className:"tabular-nums",children:t})}let M=(0,s.forwardRef)(function({messages:e,isLoading:t,cwd:n,sessionId:a,engine:g,botName:b,apiRetryInfo:v,backgroundTasks:j,liveOutputTokens:M,runningStartedAt:R,hasMoreHistory:T,isLoadingMore:$,onLoadMore:I,onFork:A,onDeleteTurn:P,onSendToPeer:_,peerSide:F,isActive:B=!0,onContentSearch:D,onShowFileDiff:W,onOpenFileLink:V,onApprovePlan:O,onShowUserMessages:z},H){let U,{t:q,i18n:K}=(0,f.Bd)(),Z=(0,s.useRef)(null),J=(0,s.useRef)(null),X=(0,s.useRef)(null),G=(0,s.useRef)(null),Q=(0,s.useRef)(null),Y=(0,s.useRef)(null),[ee,et]=(0,s.useState)(null),en=(0,s.useRef)({mode:"follow",pinTop:null}),er=(0,s.useRef)(null),es=(0,s.useRef)(!1),el=(0,s.useRef)(B),eo=(0,s.useCallback)(()=>{let e=X.current;return e?{clientHeight:e.clientHeight,scrollHeight:e.scrollHeight,scrollTop:e.scrollTop,spacer:er.current?.offsetHeight??0}:null},[]),ea=(0,s.useRef)(null),ei=(0,s.useCallback)(e=>{let t=eo();if(!t)return!1;let n=function(e,t,n){if(!(n.clientHeight>0))return null;switch(t.type){case"reset":return{owner:y,spacer:0,scrollTo:null,behavior:"auto"};case"toEnd":return L(n,"smooth");case"readFrom":{let e=t.top;return{owner:{mode:"reading",pinTop:e},spacer:N(e,n),scrollTo:e,behavior:"auto"}}case"settle":{if("reading"===e.mode){let t=e.pinTop??n.scrollTop;return{owner:e,spacer:N(t,n),scrollTo:null,behavior:"auto"}}if(n.spacer<=0)return null;let t=Math.min(n.scrollTop,C(n));return{owner:t>=C(n)?y:k,spacer:0,scrollTo:t,behavior:"smooth",deferSpacer:!0}}case"pin":{let e=N(t.top,n);if(e<=0)return L(n);return{owner:{mode:"pinned",pinTop:t.top},spacer:e,scrollTo:t.top,behavior:"smooth"}}case"release":if("pinned"!==e.mode&&"reading"!==e.mode)return null;return{owner:k,spacer:N(n.scrollTop,n),scrollTo:null,behavior:"auto"};case"content":case"viewport":if("follow"===e.mode)return L(n);if("pinned"===e.mode){let r=e.pinTop??n.scrollTop,s=N(r,n);if(s<=0)return L(n);return{owner:e,spacer:s,scrollTo:"viewport"===t.type?r:null,behavior:"auto"}}if("reading"===e.mode){let r=e.pinTop??n.scrollTop;return{owner:e,spacer:N(r,n),scrollTo:"viewport"===t.type?r:null,behavior:"auto"}}return{owner:e,spacer:N(n.scrollTop,n),scrollTo:null,behavior:"auto"}}}(en.current,e,t);if(!n)return!1;ea.current?.(),en.current=n.owner;let r=()=>{er.current&&(er.current.style.height=`${n.spacer}px`)};n.deferSpacer||r();let s=X.current;if(null!==n.scrollTo&&s?.scrollTo({top:n.scrollTo,behavior:n.behavior}),n.deferSpacer&&s){let e=()=>{n(),r()},t=setTimeout(e,700),n=()=>{clearTimeout(t),s.removeEventListener("scrollend",e),ea.current=null};s.addEventListener("scrollend",e,{once:!0}),ea.current=n}return!0},[eo]);(0,s.useEffect)(()=>()=>ea.current?.(),[]);let[ec,ed]=(0,s.useState)(!1),[eu,eh]=(0,s.useState)(!1),[em,ef]=(0,s.useState)(null),[ex,ep]=(0,s.useState)(0);(0,s.useEffect)(()=>{et(Y.current)},[]),(0,s.useEffect)(()=>{if(!t||!R)return void ep(0);let e=()=>ep(Math.max(0,Math.floor((Date.now()-R)/1e3)));e();let n=setInterval(e,1e3);return()=>clearInterval(n)},[t,R]);let eg=(0,s.useMemo)(()=>(0,o.ch)(g)?o.H[g]:o.H.claude,[g]),eb=(0,o.ch)(g)?g:"claude",ev=(0,s.useMemo)(()=>{let e=Math.floor(ex/60),t=ex%60;return e>0?`${e}m${t}s`:`${t}s`},[ex]),{isSearchVisible:ew,searchQuery:ey,setSearchQuery:ek,matches:ej,currentMatchIndex:eC,goToNextMatch:eN,goToPrevMatch:eS,closeSearch:eL,searchInputRef:eE,handleSearchKeyDown:eM}=function(e){let[t,n]=(0,s.useState)(!1),[r,l]=(0,s.useState)(""),[o,a]=(0,s.useState)([]),[i,c]=(0,s.useState)(0),d=(0,s.useRef)(null),u=(0,s.useRef)([]),h=(0,s.useCallback)(()=>{let t=e.current;t&&(t.querySelectorAll("mark.chat-search-match, mark.chat-search-current").forEach(e=>{let t=e.parentNode;t&&(t.replaceChild(document.createTextNode(e.textContent||""),e),t.normalize())}),u.current=[])},[e]),m=(0,s.useCallback)(t=>{if(h(),!t||!e.current){a([]),c(0);return}let n=[],r=[],s=t.toLowerCase();e.current.querySelectorAll("[data-message-id]").forEach(e=>{let l,o=e.getAttribute("data-message-id")||"",a=0,i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),c=[];for(;l=i.nextNode();)c.push(l);for(let e of c){let l=(e.textContent||"").toLowerCase(),i=0,c=[];for(;;){let e=l.indexOf(s,i);if(-1===e)break;c.push({start:e,end:e+t.length}),i=e+1}if(0!==c.length)for(let t=c.length-1;t>=0;t--){let s=c[t];e.splitText(s.end);let l=e.splitText(s.start),i=document.createElement("mark");i.className="chat-search-match",i.textContent=l.textContent,l.parentNode.replaceChild(i,l),n.push({messageId:o,markIndex:a}),r.push(i),a++}}}),n.reverse(),r.reverse(),u.current=r,a(n),c(n.length>0?0:-1)},[e,h]);(0,s.useEffect)(()=>{queueMicrotask(()=>m(r))},[r,m]),(0,s.useEffect)(()=>{let e=u.current;e.forEach((e,t)=>{e.className=t===i?"chat-search-current":"chat-search-match"}),i>=0&&i<e.length&&e[i].scrollIntoView({behavior:"smooth",block:"center"})},[i,o]);let f=(0,s.useCallback)(()=>{0!==o.length&&c(e=>(e+1)%o.length)},[o.length]),x=(0,s.useCallback)(()=>{0!==o.length&&c(e=>(e-1+o.length)%o.length)},[o.length]),p=(0,s.useCallback)(()=>{n(!0),setTimeout(()=>d.current?.focus(),0)},[]),g=(0,s.useCallback)(()=>{n(!1),l(""),h(),a([]),c(0)},[h]),b=(0,s.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),e.shiftKey?x():f()),"Escape"===e.key&&g()},[f,x,g]);return(0,s.useEffect)(()=>{let t=e.current;if(!t)return;let n=e=>{(e.metaKey||e.ctrlKey)&&"f"===e.key&&(e.preventDefault(),e.stopPropagation(),p())};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[e,p]),{isSearchVisible:t,searchQuery:r,setSearchQuery:l,matches:o,currentMatchIndex:i,goToNextMatch:f,goToPrevMatch:x,openSearch:p,closeSearch:g,searchInputRef:d,handleSearchKeyDown:b}}(Y),eR=(0,l.nH)(),eT=(0,s.useRef)(null),e$=(0,s.useRef)(()=>{}),{addComment:eI,refresh:eA}=(0,d._)({cwd:n||"",filePath:u.Un}),[eP,e_]=(0,s.useState)(null),[eF,eB]=(0,s.useState)(null),eD=(0,s.useCallback)(e=>{if(eP||eF)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.rangeCount){eT.current=null,e$.current();return}let n=t.toString().trim();if(!n){eT.current=null,e$.current();return}let r=t.anchorNode instanceof HTMLElement?t.anchorNode:t.anchorNode?.parentElement;if(r?.closest('[data-role="user"]')){eT.current=null,e$.current();return}eT.current={x:e.clientX,y:e.clientY,range:{start:0,end:0},selectedText:n,lineSnapshot:n},e$.current()},[eP,eF]),eW=(0,s.useCallback)(e=>{let t=e.target;!(t.closest(".floating-toolbar")||t.closest('[class*="z-[200]"]'))&&eT.current&&(eT.current=null,e$.current())},[]),eV=(0,s.useCallback)(()=>{let e=eT.current;e&&(e_({x:e.x,y:e.y,text:e.selectedText}),eT.current=null,e$.current(),window.getSelection()?.removeAllRanges())},[]),eO=(0,s.useCallback)(()=>{let e=eT.current;e&&(eB({x:e.x,y:e.y,text:e.selectedText}),eT.current=null,e$.current(),window.getSelection()?.removeAllRanges())},[]),ez=(0,s.useCallback)(()=>{let e=eT.current;e&&eR&&(eT.current=null,e$.current(),window.getSelection()?.removeAllRanges(),(0,u.Ff)(eR.sendMessage,{filePath:u.Un,startLine:0,endLine:0,codeContent:e.selectedText},q("explain.selectionMessage")))},[eR,q]),eH=(0,s.useCallback)(()=>{let e=eT.current;if(!e||!D)return;let t=e.selectedText.trim();eT.current=null,e$.current(),window.getSelection()?.removeAllRanges(),t&&D(t)},[D]),eU=(0,s.useCallback)(async e=>{eP&&(await eI(0,0,e,eP.text),e_(null))},[eP,eI]),eq=(0,s.useCallback)(async(e,t)=>{if(eR&&n)try{let r=(await (0,u.$3)(n)).map(e=>({filePath:e.filePath,startLine:e.startLine,endLine:e.endLine,codeContent:e.codeContent,note:e.content||void 0}));r.push({filePath:u.Un,startLine:0,endLine:0,codeContent:e});let s=(0,u.Gw)(r,t);eR.sendMessage(s),await (0,u.RP)(n),eA()}catch(e){console.error("Failed to send to AI:",e)}},[eR,n,eA]),eK=(0,s.useCallback)((e,t)=>{let n=eT.current;if(!n)return;let r=n.selectedText;eT.current=null,e$.current(),window.getSelection()?.removeAllRanges(),"comment"===e?eI(0,0,t,r):eq(r,t)},[eI,eq]),eZ=(U=K.language,U?.toLowerCase().startsWith("zh")?"zh":"en"),[eJ,eX]=(0,s.useState)(null),[eG,eQ]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=!1;return x.t4.runPromiseExit((0,p.td)()).then(t=>{e||eX("Success"===t._tag?((e,t)=>{if(!e||"object"!=typeof e)return null;let n=e.quickReplies;return n&&"object"==typeof n?(e=>{if(!Array.isArray(e))return null;let t=[];for(let n of e.slice(0,12)){if(!Array.isArray(n))continue;let e=[];for(let t of n.slice(0,8)){if("string"!=typeof t)continue;let n=t.trim().slice(0,200);n&&e.push(n)}e.length&&t.push(e)}return t.length?t:null})(n[t]):null})(t.value,eZ):null)}),()=>{e=!0}},[eZ]);let eY=(0,s.useCallback)(e=>{x.t4.runPromiseExit((0,p.td)()).then(t=>{let n={..."Success"===t._tag?t.value.quickReplies??{}:{}};return e?n[eZ]=e:delete n[eZ],x.t4.runPromiseExit((0,p.em)({quickReplies:n})).then(t=>{"Success"===t._tag?eX(e):console.error("Failed to save quick replies:",t.cause)})})},[eZ]),e0=(0,s.useCallback)(()=>{eT.current=null,e$.current(),window.getSelection()?.removeAllRanges(),eQ(!0)},[]),e1=(0,s.useMemo)(()=>eJ??h.SZ.map(e=>e.map(e=>q(e))),[eJ,q]),e2=(0,s.useCallback)(e=>{eF&&eq(eF.text,e)},[eF,eq]),e5=(0,s.useCallback)(e=>{eP&&eq(eP.text,e)},[eP,eq]),e4=(0,s.useMemo)(()=>{let t=new Set;return e.filter(e=>!t.has(e.id)&&(t.add(e.id),"assistant"!==e.role||!!e.isStreaming||!!e.content||!!e.images?.length||!!e.toolCalls?.length||!!e.parts?.length))},[e]),e3=(0,s.useMemo)(()=>e4.filter(e=>"user"===e.role),[e4]),e8=(0,s.useMemo)(()=>e3.slice(-10),[e3]),e6=T||e3.length>10,e9=(0,s.useRef)(0),e7=(0,s.useRef)(!1),te=(0,s.useCallback)(()=>{let e=X.current;return!e||e.scrollTop<50},[]),tt=(0,s.useCallback)((e=!1)=>{let t=X.current;if(!t)return;if(e&&e8.length>0)return void ef(e8[e8.length-1].id);let n=t.getBoundingClientRect(),r=null,s=null;for(let e of e8){let l=t.querySelector(`[data-message-id="${CSS.escape(e.id)}"]`);if(!l)continue;let o=l.getBoundingClientRect().top;!s&&o<n.bottom&&(s=e.id),o<=n.top+12&&(r=e.id)}ef(r??s)},[e8]),tn=(0,s.useCallback)(()=>{let e=eo(),t=!e||S(e),n=te();if(e&&(en.current=function(e,t){return"pinned"===e.mode||"reading"===e.mode?e:50>Math.abs(t.scrollTop-C(t))?y:k}(en.current,e)),ed(!n),eh(!t),tt(t),n&&T&&!$&&I){let e=X.current;e&&(e9.current=e.scrollHeight,e7.current=!0),I()}},[te,eo,tt,T,$,I]),tr=(0,s.useCallback)(()=>{ei({type:"release"}),J.current?.scrollIntoView({behavior:"smooth"})},[ei]),ts=(0,s.useCallback)(()=>{ei({type:"toEnd"})},[ei]),tl=(0,s.useCallback)(e=>{let t=X.current;if(!t)return!1;let n=t.querySelector(`[data-message-id="${e}"]`);if(!n)return!1;let r=n.getBoundingClientRect().top-t.getBoundingClientRect().top;return t.scrollTo({top:t.scrollTop+r-8,behavior:"auto"}),ei({type:"release"}),G.current&&clearTimeout(G.current),Q.current?.classList.remove("flash-turn"),n.classList.remove("flash-turn"),n.offsetWidth,n.classList.add("flash-turn"),Q.current=n,G.current=setTimeout(()=>{n.classList.remove("flash-turn"),Q.current=null,G.current=null},2e3),!0},[ei]),to=(0,s.useRef)(!1),ta=(0,s.useCallback)(()=>{to.current=!0},[]);(0,s.useImperativeHandle)(H,()=>({scrollToMessage:tl,pinNextUserMessage:ta}),[tl,ta]),(0,s.useLayoutEffect)(()=>{let e;if(!to.current)return;let t=X.current;if(!t)return;for(let t=e4.length-1;t>=0;t-=1)if("user"===e4[t].role){e=e4[t];break}if(!e)return;let n=t.querySelector(`[data-message-id="${CSS.escape(e.id)}"]`);n&&(to.current=!1,ei({type:"pin",top:Math.max(0,n.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop-8)}))},[e4,ei]),(0,s.useLayoutEffect)(()=>{let e=el.current;el.current=B,e&&!B&&t&&(es.current=!0)},[B,t]),(0,s.useLayoutEffect)(()=>{e7.current||ei({type:"content"})},[e,t,ei]),(0,s.useEffect)(()=>{let e=X.current;if(!e)return;let t=new ResizeObserver(()=>ei({type:"viewport"}));return t.observe(e),()=>t.disconnect()},[ei]),(0,s.useEffect)(()=>{let e=X.current;if(!e)return;let t=()=>ei({type:"release"});return e.addEventListener("wheel",t,{passive:!0}),e.addEventListener("touchmove",t,{passive:!0}),e.addEventListener("keydown",t),()=>{e.removeEventListener("wheel",t),e.removeEventListener("touchmove",t),e.removeEventListener("keydown",t)}},[ei]);let ti=(0,s.useRef)(a);(0,s.useEffect)(()=>{let e=ti.current;ti.current=a,e&&e!==a&&(to.current=!1,es.current=!1,ei({type:"reset"}))},[a,ei]),(0,s.useLayoutEffect)(()=>{if(e7.current&&!$){let e=X.current;if(e){let t=e.scrollHeight-e9.current;e.scrollTop=t,e7.current=!1}}},[e,$]);let tc=(0,s.useRef)(t),td=(0,s.useRef)(!1);return(0,s.useEffect)(()=>{let e=tc.current;tc.current=t,e&&!t&&(td.current=!ei({type:"settle"}))},[t,ei]),(0,s.useLayoutEffect)(()=>{if(B){if(es.current){let e=X.current,t=e?.querySelectorAll('[data-role="user"]'),n=t?.item((t?.length??0)-1);if(e&&n&&ei({type:"readFrom",top:Math.max(0,n.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop-8)})){es.current=!1,td.current=!1;return}}ei({type:"viewport"}),td.current&&(td.current=!1,ei({type:"settle"}))}},[B,ei]),(0,s.useEffect)(()=>{if(!B)return;let e=eo();tt(!!e&&S(e))},[e,B,eo,tt]),(0,r.jsxs)("div",{ref:Y,className:"relative flex-1 min-h-0 overflow-hidden flex flex-col outline-none",tabIndex:-1,onMouseUp:eD,onMouseDown:eW,children:[ew&&(0,r.jsxs)("div",{className:"flex-shrink-0 flex items-center gap-2 px-3 py-2 border-b border-border",children:[(0,r.jsx)("input",{ref:eE,type:"text",value:ey,onChange:e=>ek(e.target.value),onKeyDown:eM,placeholder:q("codeViewer.searchChat"),className:"flex-1 max-w-xs px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:ej.length>0?`${eC+1}/${ej.length}`:q("common.noMatch")}),(0,r.jsx)("button",{onClick:eS,disabled:0===ej.length,className:"p-1 rounded hover:bg-hover disabled:opacity-50",title:q("codeViewer.prevShiftEnter"),children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})})}),(0,r.jsx)("button",{onClick:eN,disabled:0===ej.length,className:"p-1 rounded hover:bg-hover disabled:opacity-50",title:q("codeViewer.nextEnter"),children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})}),(0,r.jsx)("button",{onClick:eL,className:"p-1 rounded hover:bg-hover",title:q("codeViewer.closeEsc"),children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{ref:X,onScroll:tn,className:"relative flex-1 min-h-0 overflow-y-auto px-8 py-4",children:0!==e.length||t?(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[var(--chat-column)]",children:[(0,r.jsx)("div",{ref:J}),T&&(0,r.jsx)("div",{className:"flex justify-center py-3",children:$?(0,r.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[(0,r.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin"}),(0,r.jsx)("span",{children:q("chat.loadMoreHistory")})]}):(0,r.jsx)("button",{onClick:I,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:q("chat.scrollUpForMore")})}),e4.map(e=>(0,r.jsx)("div",{"data-message-id":e.id,"data-role":e.role,children:(0,r.jsx)(c.s,{message:e,cwd:n,sessionId:a,onFork:A,onDeleteTurn:P,forkSupported:!0,onSendToPeer:_,peerSide:F,onApprovePlan:O,isLoading:t,onContentSearch:D,onShowFileDiff:W,onOpenFileLink:V})},e.id)),t&&(0,r.jsx)("div",{className:"flex justify-start mb-4",children:(0,r.jsxs)("div",{className:"px-1 py-1 max-w-[90%]",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[(0,r.jsx)(i,{bot:b}),(0,r.jsx)("span",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center","aria-hidden":"true",children:(0,r.jsx)(o.eV,{engine:eb,className:"h-4 w-4"})}),(0,r.jsxs)("span",{className:"text-sm text-muted-foreground/80 text-shimmer",children:[eg," running ",ev," \xb7 processing"," ",(0,r.jsx)(E,{value:M?.outputTokens??0})]})]}),j&&j.length>0&&(0,r.jsxs)("div",{className:"mt-2 flex items-start gap-2 text-xs text-muted-foreground border-t border-border/50 pt-2",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{children:["Waiting on ",j.length," background task",j.length>1?"s":""]}),j.map(e=>(0,r.jsx)("div",{className:"text-muted-foreground/80 break-words",children:e.description},e.task_id))]})]}),v&&(0,r.jsxs)("div",{className:"mt-2 flex items-start gap-2 text-xs text-amber-11 border-t border-border/50 pt-2",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{children:["Retrying API call (attempt ",v.attempt,v.maxRetries>0?`/${v.maxRetries}`:"",v.delayMs>0?`, delay ${(v.delayMs/1e3).toFixed(1)}s`:"",")"]}),(v.errorStatus||v.error)&&(0,r.jsxs)("div",{className:"text-muted-foreground/80 break-words",children:[v.errorStatus?`${v.errorStatus}`:"",v.errorStatus&&v.error?" \xb7 ":"",v.error||""]})]})]})]})}),(0,r.jsx)("div",{ref:er,"aria-hidden":!0}),(0,r.jsx)("div",{ref:Z})]}):(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-foreground-subtle",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-4xl mb-4",children:"\uD83D\uDCAC"}),(0,r.jsx)("div",{children:q("chat.startConversation")})]})})}),(e8.length>0||ec||eu)&&(0,r.jsxs)("nav",{className:"absolute top-1/2 z-10 flex -translate-y-1/2 flex-col items-center gap-2",style:{right:"max(0.5rem, calc(50% - var(--chat-column) / 2 - 2.25rem))"},"aria-label":q("chat.recentUserMessages"),children:[ec&&e.length>0&&(0,r.jsx)("button",{onClick:tr,className:"mb-1 flex h-7 w-7 items-center justify-center rounded-full text-muted-foreground transition-all hover:bg-hover hover:text-foreground active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:q("chat.jumpToStart"),"aria-label":q("chat.jumpToStart"),children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":!0,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 5h14M12 19V9m-5 5l5-5 5 5"})})}),e6&&z&&(0,r.jsx)("button",{onClick:z,className:"mb-1 flex h-7 w-7 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:q("chat.moreUserMessages"),"aria-label":q("chat.moreUserMessages"),children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":!0,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e8.map((e,t)=>{let n=em===e.id,s=e.content.replace(/\s+/g," ").trim()||(e.images?.length?q("chat.imageMessage"):q("chat.userMessage"));return(0,r.jsxs)("div",{className:"group relative flex h-3 items-center",children:[(0,r.jsx)("button",{onClick:t=>{tl(e.id),t.detail>0&&t.currentTarget.blur()},className:"flex h-3 w-7 items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-current":n?"true":void 0,"aria-label":q("chat.recentUserMessageNumber",{index:t+1,total:e8.length}),children:(0,r.jsx)("span",{"aria-hidden":!0,className:`h-0.5 rounded-full transition-all ${n?"w-4 bg-foreground":"w-3 bg-foreground/20 group-hover:w-4 group-hover:bg-foreground/45"}`})}),(0,r.jsx)("div",{className:"pointer-events-none absolute right-8 top-1/2 hidden w-72 -translate-y-1/2 rounded-xl border border-border bg-card px-3 py-2.5 text-left shadow-lv2 group-hover:block group-focus-within:block",children:(0,r.jsx)("div",{className:"line-clamp-4 text-sm leading-5 text-foreground",children:s})})]},e.id)}),eu&&e.length>0&&(0,r.jsx)("button",{onClick:ts,className:"mt-1 flex h-7 w-7 items-center justify-center rounded-full text-muted-foreground transition-all hover:bg-hover hover:text-foreground active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:q("chat.jumpToLatest"),"aria-label":q("chat.jumpToLatest"),children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":!0,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 19H5m7-14v10m5-5l-5 5-5-5"})})})]}),ee&&(0,r.jsx)(h.fS,{floatingToolbarRef:eT,bumpRef:e$,container:ee,onAddComment:eV,onSendToAI:eO,onSearch:D?eH:void 0,onExplain:eR?ez:void 0,onQuickReply:eK,quickReplyRows:e1,onEditQuickReplies:e0,isChatLoading:eR?.isLoading}),eG&&(0,r.jsx)(w,{initialRows:e1,lang:eZ,isCustomized:null!==eJ,onSave:e=>eY(e.length?e:null),onRestoreDefault:()=>eY(null),onClose:()=>eQ(!1)}),eP&&ee&&(0,r.jsx)(m.t,{x:eP.x,y:eP.y,range:{start:0,end:0},lineSnapshot:eP.text,container:ee,onSubmit:eU,onSendToAI:eR?e5:void 0,onClose:()=>e_(null),isChatLoading:eR?.isLoading}),eF&&ee&&(0,r.jsx)(m.G,{x:eF.x,y:eF.y,range:{start:0,end:0},lineSnapshot:eF.text,container:ee,onSubmit:e2,onClose:()=>eB(null),isChatLoading:eR?.isLoading})]})})},1058:(e,t,n)=>{n.d(t,{_:()=>a});var r=n(12115),s=n(90717),l=n(86957),o=n(46456);function a({cwd:e,filePath:t}){let[n,i]=(0,r.useState)([]),[c,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(null),m=(0,r.useCallback)(async()=>{if(!e||!t)return;d(!0),h(null);let n=await l.t4.runPromiseExit((0,o.lb)(e,t));if("Success"===n._tag)i(n.value.comments??[]);else{let e="Fail"===n.cause._tag?n.cause.error:null,t=e?.cause;h(t instanceof Error?t.message:"Failed to load comments")}d(!1)},[e,t]);(0,r.useEffect)(()=>{m()},[m]),(0,r.useEffect)(()=>(0,s.zL)(()=>{m()}),[m]);let f=(0,r.useCallback)(async(n,r,s,a)=>{let c=await l.t4.runPromiseExit((0,o.BC)({cwd:e,filePath:t,startLine:n,endLine:r,content:s,...a?{selectedText:a}:{}}));if("Success"===c._tag&&c.value.comment){let e=c.value.comment;return i(t=>[...t,e]),e}return"Failure"===c._tag&&console.error("Failed to add comment:",c.cause),null},[e,t]),x=(0,r.useCallback)(async(t,n)=>{let r=await l.t4.runPromiseExit((0,o.vv)(e,t,n));if("Success"===r._tag&&r.value.comment){let e=r.value.comment;return i(n=>n.map(n=>n.id===t?e:n)),!0}return"Failure"===r._tag&&console.error("Failed to update comment:",r.cause),!1},[e]),p=(0,r.useCallback)(async t=>{let n=await l.t4.runPromiseExit((0,o.Tu)(e,t));return"Success"===n._tag?(i(e=>e.filter(e=>e.id!==t)),!0):(console.error("Failed to delete comment:",n.cause),!1)},[e]),g=(0,r.useCallback)(e=>n.filter(t=>e>=t.startLine&&e<=t.endLine),[n]);return{comments:n,isLoading:c,error:u,addComment:f,updateComment:x,deleteComment:p,refresh:m,getCommentsForLine:g}}},3292:(e,t,n)=>{n.d(t,{P:()=>c});var r=n(12115),s=n(95045),l=n(75346),o=n(49433),a=n(86957),i=n(82680);function c(){let[e,t]=(0,r.useState)([]),n=(0,r.useCallback)(()=>{let e=o.$mh({try:async()=>{let e=await fetch("/api/pinned-sessions");return await e.json()},catch:e=>new i.uV({message:"loadPinnedSessions failed",cause:e})});a.t4.runPromise(e.pipe(o.YWq({onSuccess:e=>t(e.sessions||[]),onFailure:()=>{}})))},[]);(0,r.useEffect)(()=>{n()},[n]),(0,r.useEffect)(()=>{let e=e=>{e.data?.type==="PINNED_SESSIONS_CHANGED"&&n()};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[n]);let c=(0,r.useCallback)(e=>{t(e);let n=o.$mh({try:async()=>{await fetch("/api/pinned-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessions:e})})},catch:e=>new i.uV({message:"savePinnedSessions failed",cause:e})});a.t4.runFork(n.pipe(o.NWQ(()=>o.rIH))),(0,s.F)(l.n.PinnedSessionsChanged,{})},[]),d=(0,r.useCallback)(t=>e.some(e=>e.sessionId===t),[e]),u=(0,r.useCallback)((t,n,r)=>{e.some(e=>e.sessionId===t)||c([...e,{sessionId:t,cwd:n,customTitle:r}])},[e,c]),h=(0,r.useCallback)(t=>{c(e.filter(e=>e.sessionId!==t))},[e,c]),m=(0,r.useCallback)((t,n)=>{c(e.map(e=>e.sessionId===t?{...e,customTitle:n}:e))},[e,c]);return{pinnedSessions:e,isPinned:d,pinSession:u,unpinSession:h,updateTitle:m,reorder:(0,r.useCallback)(e=>{c(e)},[c]),reload:n}}},4055:(e,t,n)=>{n.d(t,{h:()=>s});let r=new Set(["Read","Grep","Glob","LS","WebSearch","WebFetch","NotebookRead","TodoRead","AskUserQuestion","ExitPlanMode","TodoWrite","Skill"]),s=e=>!r.has(e)},5135:(e,t,n)=>{n.d(t,{M:()=>E});var r=n(95155),s=n(12115),l=n(79114),o=n(14341),a=n(47650),i=n(70188),c=n(34075),d=n(89109),u=n(7320),h=n(37614),m=n(1058),f=n(48347),x=n(90717),p=n(69809),g=n(95927),b=n(34582),v=n(97251),w=n(11890),y=n(47215),k=n(43595),j=n(88403),C=n(47176),N=n(79968),S=n(27570);let L=[v.W];function E({content:e,filePath:t,cwd:n,onClose:v,sourceFile:M,embedded:R=!1,onLocalMdLink:T,scrollToAnchor:$}){let I=M||(n&&t.startsWith(n)?t.slice(n.endsWith("/")?n.length:n.length+1):t),{t:A}=(0,l.Bd)(),P=(0,i.iN)(),_=(0,f.r)(),F=(0,k.U)(),B=(0,j.Q)(),{comments:D,addComment:W,updateComment:V,deleteComment:O,refresh:z}=(0,m._)({cwd:n,filePath:t}),[H,U]=(0,s.useState)(!1),[q,K]=(0,s.useState)(null),[Z,J]=(0,s.useState)(null),[X,G]=(0,s.useState)(null),Q=(0,s.useMemo)(()=>e.split("\n"),[e]),Y=(0,s.useMemo)(()=>(0,b.J4)(t,n),[t,n]);(0,s.useEffect)(()=>{queueMicrotask(()=>U(!0))},[]);let[ee,et]=(0,s.useState)(null),en=(0,s.useRef)(null);(0,s.useEffect)(()=>{en.current!==ee&&et(en.current)});let er=(0,s.useRef)({onLocalMdLink:T,sourceFile:I});er.current={onLocalMdLink:T,sourceFile:I};let es=(0,s.useRef)(e=>{let{onLocalMdLink:t,sourceFile:n}=er.current;if(!t||/^[a-z][a-z0-9+.-]*:/i.test(e))return!1;let r=e.indexOf("#"),s=r>=0?e.slice(0,r):e,l=r>=0?e.slice(r+1):null;if(!s)return!1;let o=s;try{o=decodeURIComponent(s)}catch{}return!!(0,y.e$)(o)&&(t((0,y.WU)(n,o),l),!0)}).current;(0,s.useEffect)(()=>{if(!$)return;let e=setTimeout(()=>{(0,w.O)(en.current,$)},80);return()=>clearTimeout(e)},[$,e]);let{toolbarRef:el,bumpRef:eo,clearToolbar:ea}=(0,S.L)({enabled:!0,container:ee,resolveLineRange:e=>{let t=function(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;if(!t||!("closest"in t))return null;let n=t.closest("[data-source-start]");if(!n)return null;let r=n.getAttribute("data-source-start"),s=n.getAttribute("data-source-end");return r&&s?{start:parseInt(r,10),end:parseInt(s,10)}:null}(e);return t?{start:t.start,end:t.end}:null},buildLineSnapshot:({start:e,end:t})=>{let n=Math.max(0,e-1),r=Math.min(Q.length,t);return Q.slice(n,r).join("\n")}}),ei=(0,s.useCallback)(()=>{let e=el.current;e&&(K({x:e.x,y:e.y,range:e.range,selectedText:e.selectedText,lineSnapshot:e.lineSnapshot}),ea())},[ea,el]),ec=(0,s.useCallback)(()=>{let e=el.current;e&&(J({x:e.x,y:e.y,range:e.range,selectedText:e.selectedText,lineSnapshot:e.lineSnapshot}),ea())},[ea,el]),ed=(0,s.useCallback)(()=>{let e=el.current;e&&_&&(ea(),(0,x.Ff)(_.sendMessage,{filePath:t,startLine:e.range.start,endLine:e.range.end,codeContent:e.lineSnapshot},p.A.t("explain.selectionMessage")))},[_,t,ea,el]),eu=(0,s.useCallback)(async e=>{q&&(await W(q.range.start,q.range.end,e,q.selectedText),K(null))},[q,W]),eh=(0,s.useCallback)(async(e,r)=>{if(_)try{let s=await (0,x.$3)(n),l=[];for(let e of s)l.push({filePath:e.filePath,startLine:e.startLine,endLine:e.endLine,codeContent:e.codeContent,note:e.content||void 0});l.push({filePath:t,startLine:e.range.start,endLine:e.range.end,codeContent:e.lineSnapshot});let o=(0,x.Gw)(l,r);_.sendMessage(o),await (0,x.RP)(n),z()}catch(e){console.error("Failed to send to AI:",e)}},[_,t,n,z]),em=(0,s.useCallback)(e=>{Z&&eh(Z,e)},[Z,eh]),ef=(0,s.useCallback)(e=>{q&&eh(q,e)},[q,eh]),ex=(0,s.useMemo)(()=>{if(0===D.length)return[];let e=new Map;for(let t of D){let n=`${t.startLine}-${t.endLine}`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return Array.from(e.entries()).map(([e,t])=>({key:e,startLine:t[0].startLine,endLine:t[0].endLine,comments:t}))},[D]),[ep,eg]=(0,s.useState)([]);return(0,s.useEffect)(()=>{if(0===ex.length||!en.current)return void queueMicrotask(()=>eg([]));let e=setTimeout(()=>{let e=en.current;if(!e)return;let t=[],n=e.querySelectorAll("[data-source-start]");for(let r of ex){let s=null,l=1/0;for(let e of n){let t=parseInt(e.getAttribute("data-source-start"),10),n=parseInt(e.getAttribute("data-source-end"),10);if(t<=r.startLine&&n>=r.endLine){let r=n-t;r<l&&(l=r,s=e)}}if(s){let n=e.getBoundingClientRect(),l=s.getBoundingClientRect();t.push({key:r.key,top:l.top-n.top+e.scrollTop,comments:r.comments})}}eg(t)},100);return()=>clearTimeout(e)},[ex,e]),(0,s.useEffect)(()=>{let e=e=>{if("Escape"===e.key){if(Z){J(null),e.stopPropagation();return}if(q){K(null),e.stopPropagation();return}if(el.current){el.current=null,eo.current(),e.stopPropagation();return}if(X){G(null),e.stopPropagation();return}v?.()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[Z,q,X,v]),(0,r.jsxs)(r.Fragment,{children:[!R&&(0,r.jsxs)("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between gap-3 flex-shrink-0",children:[(0,r.jsxs)("span",{className:"text-sm font-medium text-foreground truncate min-w-0 flex-1 cursor-pointer hover:text-brand transition-colors",style:{direction:"rtl",textAlign:"left"},"data-tooltip":t,onClick:()=>{navigator.clipboard.writeText(t),(0,c.oR)(A("common.copiedPath"))},children:["",t]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(N.ShareReviewToggle,{content:e,sourceFile:I}),((0,y.C_)(t)||(0,y.OG)(t))&&(0,r.jsx)("button",{onClick:()=>{let e=t.startsWith("/")||!n?t:`${n.replace(/\/$/,"")}/${t}`;(0,y.OG)(t)?B(e):F(e)},className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:A((0,y.OG)(t)?"bots.addTooltip":"skills.addTooltip"),children:(0,r.jsx)(o.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{onClick:v,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:A("common.close"),children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,r.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,r.jsx)(C.l,{content:e,containerRef:en}),(0,r.jsxs)("div",{className:"flex-1 overflow-auto relative",ref:en,children:[(0,r.jsx)("div",{className:"p-6",children:(0,r.jsx)(g.T,{content:e,basePath:Y,rehypePlugins:L,onLinkClick:es})}),ep.map(({key:e,top:t,comments:n})=>(0,r.jsx)("div",{className:"absolute right-3 cursor-pointer z-10",style:{top:t},onClick:e=>{e.stopPropagation(),G({comment:n[0],x:e.clientX,y:e.clientY})},children:(0,r.jsx)("div",{className:"w-5 h-5 rounded-full bg-amber-500/80 text-white text-xs flex items-center justify-center shadow-lv1 hover:bg-amber-500 transition-colors",children:n.length})},e))]})]}),H&&P&&(0,a.createPortal)((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.fS,{floatingToolbarRef:el,bumpRef:eo,container:P,onAddComment:ei,onSendToAI:ec,onExplain:_?ed:void 0,isChatLoading:_?.isLoading}),q&&(0,r.jsx)(u.t,{x:q.x,y:q.y,range:q.range,filePath:t,lineSnapshot:q.lineSnapshot,container:P,onSubmit:eu,onSendToAI:_?ef:void 0,onClose:()=>K(null),isChatLoading:_?.isLoading}),Z&&(0,r.jsx)(u.G,{x:Z.x,y:Z.y,range:Z.range,filePath:t,lineSnapshot:Z.lineSnapshot,container:P,onSubmit:em,onClose:()=>J(null),isChatLoading:_?.isLoading}),X&&(0,r.jsx)(h.t,{x:X.x,y:X.y,comment:X.comment,container:P,onClose:()=>G(null),onUpdateComment:V,onDeleteComment:O})]}),P)]})}},7320:(e,t,n)=>{n.d(t,{G:()=>a,t:()=>o});var r=n(95155),s=n(12115),l=n(79114);function o({x:e,y:t,range:n,filePath:a,lineSnapshot:i,container:c,onSubmit:d,onSendToAI:u,onClose:h,isChatLoading:m}){let{t:f}=(0,l.Bd)(),[x,p]=(0,s.useState)(""),[g,b]=(0,s.useState)(!1),v=(0,s.useRef)(null),w=(0,s.useRef)(null),[y,k]=(0,s.useState)({x:0,y:0}),j=i?.split("\n").slice(0,5).join("\n"),C=!!i&&i.split("\n").length>5;(0,s.useEffect)(()=>{if(v.current&&c){let n=c.getBoundingClientRect(),r=v.current.getBoundingClientRect(),s=e-n.left,l=t-n.top;s+r.width>n.width-16&&(s=n.width-r.width-16),s<16&&(s=16),l+r.height>n.height-16&&(l=l-r.height-8),l<16&&(l=16),queueMicrotask(()=>k({x:s,y:l}))}},[e,t,c]),(0,s.useEffect)(()=>{w.current?.focus()},[]),(0,s.useEffect)(()=>{let e=e=>{g||!v.current||v.current.contains(e.target)||h()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h,g]);let N=()=>{!g&&x.trim()&&(b(!0),d(x.trim()))};return(0,r.jsxs)("div",{ref:v,className:"absolute z-[200] w-[640px] bg-card border border-border rounded-lg shadow-lv2 overflow-hidden",style:{left:y.x,top:y.y},children:[(0,r.jsxs)("div",{className:"px-3 py-2 bg-amber-9/10 border-b border-border",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-amber-11",children:f("comments.addComment")}),(n.start>0||n.end>0)&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:f("comments.lineRange",{start:n.start,end:n.end})})]}),a&&(0,r.jsx)("div",{className:"mt-1 text-xs text-muted-foreground truncate",children:a})]}),i&&(0,r.jsx)("div",{className:"px-3 py-2 border-b border-border max-h-24 overflow-hidden",children:(0,r.jsxs)("pre",{className:"text-xs font-mono text-muted-foreground whitespace-pre-wrap break-all",children:[j,C&&(0,r.jsx)("span",{className:"text-muted-foreground/50",children:"..."})]})}),(0,r.jsxs)("div",{className:"p-2",children:[(0,r.jsx)("textarea",{ref:w,value:x,onChange:e=>p(e.target.value),placeholder:f("comments.inputPlaceholder"),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card resize-none focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",rows:2,disabled:g,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),N()),"Escape"!==e.key||g||h()}}),(0,r.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:f(g?"comments.submitting":"comments.enterSubmit")}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{className:"px-3 py-1 text-xs font-medium border border-amber-11 text-amber-11 rounded-md hover:bg-amber-9/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:N,disabled:g||!x.trim(),children:f("comments.submitComment")}),u&&(0,r.jsx)("button",{className:"px-3 py-1 text-xs font-medium border border-brand text-brand rounded-md hover:bg-brand/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{!g&&!m&&u&&x.trim()&&(b(!0),u(x.trim()),h())},disabled:g||m||!x.trim(),title:m?f("comments.aiResponding"):void 0,children:f("comments.sendToAI")})]})]})]})]})}function a({x:e,y:t,range:n,filePath:o,lineSnapshot:i,container:c,onSubmit:d,onClose:u,isChatLoading:h}){let{t:m}=(0,l.Bd)(),[f,x]=(0,s.useState)(""),p=(0,s.useRef)(null),g=(0,s.useRef)(null),[b,v]=(0,s.useState)({x:0,y:0});(0,s.useEffect)(()=>{if(p.current&&c){let n=c.getBoundingClientRect(),r=p.current.getBoundingClientRect(),s=e-n.left,l=t-n.top;s+r.width>n.width-16&&(s=n.width-r.width-16),s<16&&(s=16),l+r.height>n.height-16&&(l=l-r.height-8),l<16&&(l=16),queueMicrotask(()=>v({x:s,y:l}))}},[e,t,c]),(0,s.useEffect)(()=>{g.current?.focus()},[]),(0,s.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&u()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]);let w=i?.split("\n").slice(0,5).join("\n"),y=!!i&&i.split("\n").length>5;return(0,r.jsxs)("div",{ref:p,className:"absolute z-[200] w-[640px] bg-card border border-border rounded-lg shadow-lv2 overflow-hidden",style:{left:b.x,top:b.y},children:[(0,r.jsxs)("div",{className:"px-3 py-2 bg-brand/10 border-b border-border",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-brand",children:m("comments.askAI")}),(n.start>0||n.end>0)&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:m("comments.lineRange",{start:n.start,end:n.end})})]}),o&&(0,r.jsx)("div",{className:"mt-1 text-xs text-muted-foreground truncate",children:o})]}),i&&(0,r.jsx)("div",{className:"px-3 py-2 border-b border-border max-h-24 overflow-hidden",children:(0,r.jsxs)("pre",{className:"text-xs font-mono text-muted-foreground whitespace-pre-wrap break-all",children:[w,y&&(0,r.jsx)("span",{className:"text-muted-foreground/50",children:"..."})]})}),(0,r.jsxs)("div",{className:"p-2",children:[(0,r.jsx)("textarea",{ref:g,value:f,onChange:e=>x(e.target.value),placeholder:m("comments.inputQuestion"),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card resize-none focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",rows:2,disabled:h,onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),!h&&f.trim()&&(d(f.trim()),u())),"Escape"===e.key&&u()}}),(0,r.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:m(h?"comments.aiGenerating":"comments.enterSend")})]})]})}},9573:(e,t,n)=>{n.d(t,{Tt:()=>i,se:()=>a,xK:()=>o});var r=n(49433),s=n(82680);let l=e=>r.$mh({try:async()=>{let t=await fetch(e);if(!t.ok)throw Error(`HTTP ${t.status}`);return await t.json()},catch:t=>new s.uV({message:`GET ${e} failed`,cause:t})}),o=(e,t,n)=>l(`/api/snapshots?cwd=${encodeURIComponent(e)}&toolIds=${encodeURIComponent(t.join(","))}${n?`&sessionKey=${encodeURIComponent(n)}`:""}`).pipe(r.TjK(e=>e.commits??[])),a=(e,t,n)=>o(e,t,n).pipe(r.qIB(t=>r.Q7R(t.map(t=>{let n;return n=t.hash,l(`/api/snapshots/diff?cwd=${encodeURIComponent(e)}&commit=${encodeURIComponent(n)}`)}),{concurrency:4}))),i=(e,t,n)=>l(`/api/snapshots/range-diff?cwd=${encodeURIComponent(e)}&head=${encodeURIComponent(n)}${t?`&base=${encodeURIComponent(t)}`:""}`)},14575:(e,t,n)=>{n.d(t,{o:()=>o});var r=n(95155);n(12115);let s={ts:"#3178c6",tsx:"#3178c6",js:"#f1e05a",jsx:"#61dafb",mjs:"#f1e05a",cjs:"#f1e05a",html:"#e44d26",css:"#563d7c",scss:"#cd6799",sass:"#cd6799",less:"#1d365d",vue:"#41b883",svelte:"#ff3e00",json:"#cbcb41",yaml:"#cb171e",yml:"#cb171e",toml:"#9c4121",xml:"#e37933",env:"#ecd53f",md:"#519aba",mdx:"#519aba",txt:"#89898a",py:"#3572a5",go:"#00add8",rs:"#dea584",lean:"#448aff",java:"#b07219",kt:"#a97bff",kts:"#a97bff",c:"#555555",h:"#555555",cpp:"#f34b7d",hpp:"#f34b7d",rb:"#701516",php:"#4f5d95",sh:"#89e051",bash:"#89e051",zsh:"#89e051",png:"#a074c4",jpg:"#a074c4",jpeg:"#a074c4",gif:"#a074c4",svg:"#ffb13b",webp:"#a074c4",ico:"#a074c4",lock:"#89898a",gitignore:"#f14e32",dockerfile:"#2496ed",sql:"#e38c00",graphql:"#e535ab",gql:"#e535ab",default:"#8a8a8a"},l={"package.json":"#cb3837","package-lock.json":"#cb3837","tsconfig.json":"#3178c6","jsconfig.json":"#f1e05a",".gitignore":"#f14e32",".eslintrc":"#4b32c3",".eslintrc.js":"#4b32c3",".eslintrc.json":"#4b32c3",".prettierrc":"#56b3b4",dockerfile:"#2496ed",".env":"#ecd53f",".env.local":"#ecd53f",".env.development":"#ecd53f",".env.production":"#ecd53f","readme.md":"#519aba",license:"#d4af37",makefile:"#6d8086","cargo.toml":"#dea584","go.mod":"#00add8","go.sum":"#00add8","requirements.txt":"#3572a5","yarn.lock":"#2c8ebb","pnpm-lock.yaml":"#f9ad00","vite.config.ts":"#646cff","vite.config.js":"#646cff","next.config.js":"#000000","next.config.mjs":"#000000","tailwind.config.js":"#38bdf8","tailwind.config.ts":"#38bdf8"};function o({name:e,className:t="",size:n=16}){let a,i=l[a=e.toLowerCase()]?l[a]:s[e.split(".").pop()?.toLowerCase()||""]||s.default,c=e.split(".").pop()?.toLowerCase()||"";return["ts","tsx"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2",fill:i}),(0,r.jsx)("path",{d:"M7 10h10M12 10v8",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}):["js","jsx","mjs","cjs"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2",fill:i}),(0,r.jsx)("path",{d:"M10 10v6c0 1-1 2-2 2M14 10v4c0 2 4 2 4 0v-4",stroke:"#323330",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}):"jsx"===c||"tsx"===c&&e.includes("component")?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("ellipse",{cx:"12",cy:"12",rx:"10",ry:"4",stroke:"#61dafb",strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("ellipse",{cx:"12",cy:"12",rx:"10",ry:"4",stroke:"#61dafb",strokeWidth:"1.5",fill:"none",transform:"rotate(60 12 12)"}),(0,r.jsx)("ellipse",{cx:"12",cy:"12",rx:"10",ry:"4",stroke:"#61dafb",strokeWidth:"1.5",fill:"none",transform:"rotate(120 12 12)"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"2",fill:"#61dafb"})]}):"json"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M6 4C4 4 4 6 4 8v2c0 1-1 2-2 2 1 0 2 1 2 2v2c0 2 0 4 2 4",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M18 4c2 0 2 2 2 4v2c0 1 1 2 2 2-1 0-2 1-2 2v2c0 2 0 4-2 4",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"1.5",fill:i})]}):["md","mdx"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M5 15V9l3 4 3-4v6M17 12l-2-3v6M17 12l2-3v6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):["py","pyi","pyx"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M12 4c-4 0-4 2-4 3v2h5v1H6c-2 0-3 2-3 4s1 4 3 4h2v-2c0-2 1-3 3-3h4c1 0 2-1 2-2V7c0-2-2-3-5-3z",fill:"#3572a5"}),(0,r.jsx)("path",{d:"M12 20c4 0 4-2 4-3v-2h-5v-1h7c2 0 3-2 3-4s-1-4-3-4h-2v2c0 2-1 3-3 3h-4c-1 0-2 1-2 2v4c0 2 2 3 5 3z",fill:"#ffd43b"}),(0,r.jsx)("circle",{cx:"9",cy:"7",r:"1",fill:"white"}),(0,r.jsx)("circle",{cx:"15",cy:"17",r:"1",fill:"white"})]}):"go"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6",fill:i}),(0,r.jsx)("circle",{cx:"9",cy:"11",r:"1.5",fill:"white"}),(0,r.jsx)("circle",{cx:"15",cy:"11",r:"1.5",fill:"white"}),(0,r.jsx)("circle",{cx:"9",cy:"11",r:"0.7",fill:"#333"}),(0,r.jsx)("circle",{cx:"15",cy:"11",r:"0.7",fill:"#333"})]}):"rs"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:i,strokeWidth:"2",fill:"none"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3",fill:i}),(0,r.jsx)("path",{d:"M12 3v3M12 18v3M3 12h3M18 12h3",stroke:i,strokeWidth:"2",strokeLinecap:"round"})]}):"lean"===c?(0,r.jsx)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:(0,r.jsx)("path",{d:"M3.45 1.5 1.5 2.5 12 22.5 22.5 2.5 20.55 1.5 15.9 10.35H8.1ZM9 12h6l-3 6Z",fill:i,fillRule:"evenodd"})}):["png","jpg","jpeg","gif","webp","ico","bmp"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"9",r:"2",fill:i}),(0,r.jsx)("path",{d:"M3 16l5-5 3 3 4-4 6 6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):"svg"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M7 12 Q12 6 17 12 Q12 18 7 12",stroke:i,strokeWidth:"1.5",fill:"none"})]}):"html"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M4 3l1.5 17L12 22l6.5-2L20 3H4z",fill:i}),(0,r.jsx)("path",{d:"M8 7h8l-.5 6-3.5 1-3.5-1-.2-2",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}):["css","scss","sass","less"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M4 3l1.5 17L12 22l6.5-2L20 3H4z",fill:i}),(0,r.jsx)("path",{d:"M15 8H9l.3 3h5.2l-.4 4-2.1.7-2.1-.7-.1-2",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}):["yaml","yml"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M7 8l3 4v5M17 8l-3 4v5",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):["sh","bash","zsh","fish"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",fill:"#1e1e1e",stroke:"#555",strokeWidth:"1"}),(0,r.jsx)("path",{d:"M6 9l3 3-3 3M12 15h5",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):"gitignore"===c||".gitignore"===e.toLowerCase()?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:i}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3",fill:"white"}),(0,r.jsx)("path",{d:"M12 6v3M12 15v3M6 12h3M15 12h3",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}):"dockerfile"===c||"dockerfile"===e.toLowerCase()||e.toLowerCase().startsWith("dockerfile")?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M3 12h3v3H3zM7 12h3v3H7zM11 12h3v3h-3zM7 8h3v3H7zM11 8h3v3h-3zM11 4h3v3h-3zM15 12h3v3h-3z",fill:i}),(0,r.jsx)("path",{d:"M21 13c-1-2-3-2-4-2h-1c0-1 0-2-2-3h-1v1c0 1-1 2-2 2H3c-1 3 0 6 2 8s5 3 9 3c5 0 8-2 10-6",stroke:i,strokeWidth:"1.5",fill:"none"})]}):"env"===c||e.startsWith(".env")?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"2",fill:i}),(0,r.jsx)("path",{d:"M12 8h6M8 12h8M8 16h5",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]}):"sql"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("ellipse",{cx:"12",cy:"7",rx:"8",ry:"3",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M4 7v10c0 1.7 3.6 3 8 3s8-1.3 8-3V7",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3",stroke:i,strokeWidth:"1.5",fill:"none"})]}):"vue"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M2 4h4l6 10 6-10h4L12 22 2 4z",fill:i}),(0,r.jsx)("path",{d:"M6 4h4l2 4 2-4h4l-6 10L6 4z",fill:"#35495e"})]}):(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M6 3h8l5 5v13H6V3z",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M14 3v5h5",stroke:i,strokeWidth:"1.5",fill:"none"})]})}},14594:(e,t,n)=>{function r(e,t,n){return t?e?n?`${e.replace(/\n+$/,"")}
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95313],{201:(e,t,n)=>{n.d(t,{M:()=>M});var r=n(95155),s=n(12115),l=n(83897),o=n(57125),a=n(49619);function i({bot:e}){return e?(0,r.jsx)("span",{className:"shrink-0 inline-flex items-center text-brand","data-tooltip":`@${e}`,"aria-label":`Bot session: @${e}`,role:"img",children:(0,r.jsx)(a.A,{className:"h-3.5 w-3.5"})}):null}var c=n(23883),d=n(1058),u=n(90717),h=n(89109),m=n(7320),f=n(79114),x=n(86957),p=n(83448),g=n(62111),b=n(64428);let v=/[,,]/;function w({initialRows:e,lang:t,isCustomized:n,onSave:l,onRestoreDefault:o,onClose:a}){let{t:i}=(0,f.Bd)(),[c,d]=(0,s.useState)(()=>e.map(e=>e.join("zh"===t?",":", ")).join("\n"));(0,g.E)(a);let u=(0,s.useCallback)(()=>{l(c.split("\n").map(e=>e.split(v).map(e=>e.trim().slice(0,200)).filter(Boolean).slice(0,8)).filter(e=>e.length>0).slice(0,12)),a()},[c,l,a]),h=(0,s.useCallback)(()=>{o(),a()},[o,a]);return(0,r.jsx)(b.ZL,{children:(0,r.jsx)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-scrim p-4",onClick:a,children:(0,r.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-lv3 w-full max-w-md flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,r.jsx)("h2",{className:"text-sm font-medium text-foreground",children:i("quickReply.editTitle")}),(0,r.jsx)("button",{onClick:a,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors","aria-label":i("quickReply.cancel"),children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsxs)("div",{className:"px-4 py-3 flex flex-col gap-2",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:i("quickReply.editHint")}),(0,r.jsx)("textarea",{autoFocus:!0,value:c,onChange:e=>d(e.target.value),placeholder:i("quickReply.editPlaceholder"),rows:6,spellCheck:!1,className:"w-full px-2 py-1.5 text-xs font-mono bg-background border border-border rounded text-foreground focus:outline-none focus:border-brand resize-y"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:i("quickReply.customizedFor",{lang:i("zh"===t?"quickReply.langZh":"quickReply.langEn")})})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-border",children:[(0,r.jsx)("button",{onClick:h,disabled:!n,className:"px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:i("quickReply.restoreDefault")}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:a,className:"px-3 py-1.5 text-xs border border-border text-foreground rounded-md hover:bg-hover transition-colors",children:i("quickReply.cancel")}),(0,r.jsx)("button",{onClick:u,className:"px-3 py-1.5 text-xs font-medium border border-brand text-brand rounded-md hover:bg-brand/10 transition-colors",children:i("quickReply.save")})]})]})]})})})}let y={mode:"follow",pinTop:null},k={mode:"free",pinTop:null};function j(e){return Math.max(0,e.scrollHeight-e.spacer)}function C(e){return Math.max(0,j(e)-e.clientHeight)}function N(e,t){return e<=0?0:Math.max(0,e+t.clientHeight-j(t))}function S(e){return j(e)-e.scrollTop-e.clientHeight<50}function L(e,t="auto"){return{owner:y,spacer:0,scrollTo:C(e),behavior:t}}function E({value:e}){let[t,n]=(0,s.useState)(e),l=(0,s.useRef)(e),o=(0,s.useRef)(null);return(0,s.useEffect)(()=>{null!==o.current&&(cancelAnimationFrame(o.current),o.current=null);let t=l.current;if(e<=t){l.current=e,n(e);return}let r=performance.now(),s=a=>{let i=Math.min(1,Math.ceil(12*Math.min(1,(a-r)/400))/12),c=Math.round(t+(e-t)*i);l.current=c,n(c),i<1?o.current=requestAnimationFrame(s):o.current=null};return o.current=requestAnimationFrame(s),()=>{null!==o.current&&cancelAnimationFrame(o.current),o.current=null}},[e]),(0,r.jsx)("span",{className:"tabular-nums",children:t})}let M=(0,s.forwardRef)(function({messages:e,isLoading:t,cwd:n,sessionId:a,engine:g,botName:b,apiRetryInfo:v,backgroundTasks:j,liveOutputTokens:M,runningStartedAt:R,hasMoreHistory:T,isLoadingMore:$,onLoadMore:I,onFork:A,onDeleteTurn:P,onSendToPeer:_,peerSide:F,isActive:B=!0,onContentSearch:D,onShowFileDiff:W,onOpenFileLink:V,onApprovePlan:O,onShowUserMessages:z},H){let U,{t:q,i18n:K}=(0,f.Bd)(),Z=(0,s.useRef)(null),J=(0,s.useRef)(null),X=(0,s.useRef)(null),G=(0,s.useRef)(null),Q=(0,s.useRef)(null),Y=(0,s.useRef)(null),[ee,et]=(0,s.useState)(null),en=(0,s.useRef)({mode:"follow",pinTop:null}),er=(0,s.useRef)(null),es=(0,s.useRef)(!1),el=(0,s.useRef)(B),eo=(0,s.useCallback)(()=>{let e=X.current;return e?{clientHeight:e.clientHeight,scrollHeight:e.scrollHeight,scrollTop:e.scrollTop,spacer:er.current?.offsetHeight??0}:null},[]),ea=(0,s.useRef)(null),ei=(0,s.useCallback)(e=>{let t=eo();if(!t)return!1;let n=function(e,t,n){if(!(n.clientHeight>0))return null;switch(t.type){case"reset":return{owner:y,spacer:0,scrollTo:null,behavior:"auto"};case"toEnd":return L(n,"smooth");case"readFrom":{let e=t.top;return{owner:{mode:"reading",pinTop:e},spacer:N(e,n),scrollTo:e,behavior:"auto"}}case"settle":{if("reading"===e.mode){let t=e.pinTop??n.scrollTop;return{owner:e,spacer:N(t,n),scrollTo:null,behavior:"auto"}}if(n.spacer<=0)return null;let t=Math.min(n.scrollTop,C(n));return{owner:t>=C(n)?y:k,spacer:0,scrollTo:t,behavior:"smooth",deferSpacer:!0}}case"pin":{let e=N(t.top,n);if(e<=0)return L(n);return{owner:{mode:"pinned",pinTop:t.top},spacer:e,scrollTo:t.top,behavior:"smooth"}}case"release":if("pinned"!==e.mode&&"reading"!==e.mode)return null;return{owner:k,spacer:N(n.scrollTop,n),scrollTo:null,behavior:"auto"};case"content":case"viewport":if("follow"===e.mode)return L(n);if("pinned"===e.mode){let r=e.pinTop??n.scrollTop,s=N(r,n);if(s<=0)return L(n);return{owner:e,spacer:s,scrollTo:"viewport"===t.type?r:null,behavior:"auto"}}if("reading"===e.mode){let r=e.pinTop??n.scrollTop;return{owner:e,spacer:N(r,n),scrollTo:"viewport"===t.type?r:null,behavior:"auto"}}return{owner:e,spacer:N(n.scrollTop,n),scrollTo:null,behavior:"auto"}}}(en.current,e,t);if(!n)return!1;ea.current?.(),en.current=n.owner;let r=()=>{er.current&&(er.current.style.height=`${n.spacer}px`)};n.deferSpacer||r();let s=X.current;if(null!==n.scrollTo&&s?.scrollTo({top:n.scrollTo,behavior:n.behavior}),n.deferSpacer&&s){let e=()=>{n(),r()},t=setTimeout(e,700),n=()=>{clearTimeout(t),s.removeEventListener("scrollend",e),ea.current=null};s.addEventListener("scrollend",e,{once:!0}),ea.current=n}return!0},[eo]);(0,s.useEffect)(()=>()=>ea.current?.(),[]);let[ec,ed]=(0,s.useState)(!1),[eu,eh]=(0,s.useState)(!1),[em,ef]=(0,s.useState)(null),[ex,ep]=(0,s.useState)(0);(0,s.useEffect)(()=>{et(Y.current)},[]),(0,s.useEffect)(()=>{if(!t||!R)return void ep(0);let e=()=>ep(Math.max(0,Math.floor((Date.now()-R)/1e3)));e();let n=setInterval(e,1e3);return()=>clearInterval(n)},[t,R]);let eg=(0,s.useMemo)(()=>(0,o.ch)(g)?o.H[g]:o.H.claude,[g]),eb=(0,o.ch)(g)?g:"claude",ev=(0,s.useMemo)(()=>{let e=Math.floor(ex/60),t=ex%60;return e>0?`${e}m${t}s`:`${t}s`},[ex]),{isSearchVisible:ew,searchQuery:ey,setSearchQuery:ek,matches:ej,currentMatchIndex:eC,goToNextMatch:eN,goToPrevMatch:eS,closeSearch:eL,searchInputRef:eE,handleSearchKeyDown:eM}=function(e){let[t,n]=(0,s.useState)(!1),[r,l]=(0,s.useState)(""),[o,a]=(0,s.useState)([]),[i,c]=(0,s.useState)(0),d=(0,s.useRef)(null),u=(0,s.useRef)([]),h=(0,s.useCallback)(()=>{let t=e.current;t&&(t.querySelectorAll("mark.chat-search-match, mark.chat-search-current").forEach(e=>{let t=e.parentNode;t&&(t.replaceChild(document.createTextNode(e.textContent||""),e),t.normalize())}),u.current=[])},[e]),m=(0,s.useCallback)(t=>{if(h(),!t||!e.current){a([]),c(0);return}let n=[],r=[],s=t.toLowerCase();e.current.querySelectorAll("[data-message-id]").forEach(e=>{let l,o=e.getAttribute("data-message-id")||"",a=0,i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),c=[];for(;l=i.nextNode();)c.push(l);for(let e of c){let l=(e.textContent||"").toLowerCase(),i=0,c=[];for(;;){let e=l.indexOf(s,i);if(-1===e)break;c.push({start:e,end:e+t.length}),i=e+1}if(0!==c.length)for(let t=c.length-1;t>=0;t--){let s=c[t];e.splitText(s.end);let l=e.splitText(s.start),i=document.createElement("mark");i.className="chat-search-match",i.textContent=l.textContent,l.parentNode.replaceChild(i,l),n.push({messageId:o,markIndex:a}),r.push(i),a++}}}),n.reverse(),r.reverse(),u.current=r,a(n),c(n.length>0?0:-1)},[e,h]);(0,s.useEffect)(()=>{queueMicrotask(()=>m(r))},[r,m]),(0,s.useEffect)(()=>{let e=u.current;e.forEach((e,t)=>{e.className=t===i?"chat-search-current":"chat-search-match"}),i>=0&&i<e.length&&e[i].scrollIntoView({behavior:"smooth",block:"center"})},[i,o]);let f=(0,s.useCallback)(()=>{0!==o.length&&c(e=>(e+1)%o.length)},[o.length]),x=(0,s.useCallback)(()=>{0!==o.length&&c(e=>(e-1+o.length)%o.length)},[o.length]),p=(0,s.useCallback)(()=>{n(!0),setTimeout(()=>d.current?.focus(),0)},[]),g=(0,s.useCallback)(()=>{n(!1),l(""),h(),a([]),c(0)},[h]),b=(0,s.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),e.shiftKey?x():f()),"Escape"===e.key&&g()},[f,x,g]);return(0,s.useEffect)(()=>{let t=e.current;if(!t)return;let n=e=>{(e.metaKey||e.ctrlKey)&&"f"===e.key&&(e.preventDefault(),e.stopPropagation(),p())};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[e,p]),{isSearchVisible:t,searchQuery:r,setSearchQuery:l,matches:o,currentMatchIndex:i,goToNextMatch:f,goToPrevMatch:x,openSearch:p,closeSearch:g,searchInputRef:d,handleSearchKeyDown:b}}(Y),eR=(0,l.nH)(),eT=(0,s.useRef)(null),e$=(0,s.useRef)(()=>{}),{addComment:eI,refresh:eA}=(0,d._)({cwd:n||"",filePath:u.Un}),[eP,e_]=(0,s.useState)(null),[eF,eB]=(0,s.useState)(null),eD=(0,s.useCallback)(e=>{if(eP||eF)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.rangeCount){eT.current=null,e$.current();return}let n=t.toString().trim();if(!n){eT.current=null,e$.current();return}let r=t.anchorNode instanceof HTMLElement?t.anchorNode:t.anchorNode?.parentElement;if(r?.closest('[data-role="user"]')){eT.current=null,e$.current();return}eT.current={x:e.clientX,y:e.clientY,range:{start:0,end:0},selectedText:n,lineSnapshot:n},e$.current()},[eP,eF]),eW=(0,s.useCallback)(e=>{let t=e.target;!(t.closest(".floating-toolbar")||t.closest('[class*="z-[200]"]'))&&eT.current&&(eT.current=null,e$.current())},[]),eV=(0,s.useCallback)(()=>{let e=eT.current;e&&(e_({x:e.x,y:e.y,text:e.selectedText}),eT.current=null,e$.current(),window.getSelection()?.removeAllRanges())},[]),eO=(0,s.useCallback)(()=>{let e=eT.current;e&&(eB({x:e.x,y:e.y,text:e.selectedText}),eT.current=null,e$.current(),window.getSelection()?.removeAllRanges())},[]),ez=(0,s.useCallback)(()=>{let e=eT.current;e&&eR&&(eT.current=null,e$.current(),window.getSelection()?.removeAllRanges(),(0,u.Ff)(eR.sendMessage,{filePath:u.Un,startLine:0,endLine:0,codeContent:e.selectedText},q("explain.selectionMessage")))},[eR,q]),eH=(0,s.useCallback)(()=>{let e=eT.current;if(!e||!D)return;let t=e.selectedText.trim();eT.current=null,e$.current(),window.getSelection()?.removeAllRanges(),t&&D(t)},[D]),eU=(0,s.useCallback)(async e=>{eP&&(await eI(0,0,e,eP.text),e_(null))},[eP,eI]),eq=(0,s.useCallback)(async(e,t)=>{if(eR&&n)try{let r=(await (0,u.$3)(n)).map(e=>({filePath:e.filePath,startLine:e.startLine,endLine:e.endLine,codeContent:e.codeContent,note:e.content||void 0}));r.push({filePath:u.Un,startLine:0,endLine:0,codeContent:e});let s=(0,u.Gw)(r,t);eR.sendMessage(s),await (0,u.RP)(n),eA()}catch(e){console.error("Failed to send to AI:",e)}},[eR,n,eA]),eK=(0,s.useCallback)((e,t)=>{let n=eT.current;if(!n)return;let r=n.selectedText;eT.current=null,e$.current(),window.getSelection()?.removeAllRanges(),"comment"===e?eI(0,0,t,r):eq(r,t)},[eI,eq]),eZ=(U=K.language,U?.toLowerCase().startsWith("zh")?"zh":"en"),[eJ,eX]=(0,s.useState)(null),[eG,eQ]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=!1;return x.t4.runPromiseExit((0,p.td)()).then(t=>{e||eX("Success"===t._tag?((e,t)=>{if(!e||"object"!=typeof e)return null;let n=e.quickReplies;return n&&"object"==typeof n?(e=>{if(!Array.isArray(e))return null;let t=[];for(let n of e.slice(0,12)){if(!Array.isArray(n))continue;let e=[];for(let t of n.slice(0,8)){if("string"!=typeof t)continue;let n=t.trim().slice(0,200);n&&e.push(n)}e.length&&t.push(e)}return t.length?t:null})(n[t]):null})(t.value,eZ):null)}),()=>{e=!0}},[eZ]);let eY=(0,s.useCallback)(e=>{x.t4.runPromiseExit((0,p.td)()).then(t=>{let n={..."Success"===t._tag?t.value.quickReplies??{}:{}};return e?n[eZ]=e:delete n[eZ],x.t4.runPromiseExit((0,p.em)({quickReplies:n})).then(t=>{"Success"===t._tag?eX(e):console.error("Failed to save quick replies:",t.cause)})})},[eZ]),e0=(0,s.useCallback)(()=>{eT.current=null,e$.current(),window.getSelection()?.removeAllRanges(),eQ(!0)},[]),e1=(0,s.useMemo)(()=>eJ??h.SZ.map(e=>e.map(e=>q(e))),[eJ,q]),e2=(0,s.useCallback)(e=>{eF&&eq(eF.text,e)},[eF,eq]),e5=(0,s.useCallback)(e=>{eP&&eq(eP.text,e)},[eP,eq]),e4=(0,s.useMemo)(()=>{let t=new Set;return e.filter(e=>!t.has(e.id)&&(t.add(e.id),"assistant"!==e.role||!!e.isStreaming||!!e.content||!!e.images?.length||!!e.toolCalls?.length||!!e.parts?.length))},[e]),e3=(0,s.useMemo)(()=>e4.filter(e=>"user"===e.role),[e4]),e8=(0,s.useMemo)(()=>e3.slice(-10),[e3]),e6=T||e3.length>10,e9=(0,s.useRef)(0),e7=(0,s.useRef)(!1),te=(0,s.useCallback)(()=>{let e=X.current;return!e||e.scrollTop<50},[]),tt=(0,s.useCallback)((e=!1)=>{let t=X.current;if(!t)return;if(e&&e8.length>0)return void ef(e8[e8.length-1].id);let n=t.getBoundingClientRect(),r=null,s=null;for(let e of e8){let l=t.querySelector(`[data-message-id="${CSS.escape(e.id)}"]`);if(!l)continue;let o=l.getBoundingClientRect().top;!s&&o<n.bottom&&(s=e.id),o<=n.top+12&&(r=e.id)}ef(r??s)},[e8]),tn=(0,s.useCallback)(()=>{let e=eo(),t=!e||S(e),n=te();if(e&&(en.current=function(e,t){return"pinned"===e.mode||"reading"===e.mode?e:50>Math.abs(t.scrollTop-C(t))?y:k}(en.current,e)),ed(!n),eh(!t),tt(t),n&&T&&!$&&I){let e=X.current;e&&(e9.current=e.scrollHeight,e7.current=!0),I()}},[te,eo,tt,T,$,I]),tr=(0,s.useCallback)(()=>{ei({type:"release"}),J.current?.scrollIntoView({behavior:"smooth"})},[ei]),ts=(0,s.useCallback)(()=>{ei({type:"toEnd"})},[ei]),tl=(0,s.useCallback)(e=>{let t=X.current;if(!t)return!1;let n=t.querySelector(`[data-message-id="${e}"]`);if(!n)return!1;let r=n.getBoundingClientRect().top-t.getBoundingClientRect().top;return t.scrollTo({top:t.scrollTop+r-8,behavior:"auto"}),ei({type:"release"}),G.current&&clearTimeout(G.current),Q.current?.classList.remove("flash-turn"),n.classList.remove("flash-turn"),n.offsetWidth,n.classList.add("flash-turn"),Q.current=n,G.current=setTimeout(()=>{n.classList.remove("flash-turn"),Q.current=null,G.current=null},2e3),!0},[ei]),to=(0,s.useRef)(!1),ta=(0,s.useCallback)(()=>{to.current=!0},[]);(0,s.useImperativeHandle)(H,()=>({scrollToMessage:tl,pinNextUserMessage:ta}),[tl,ta]),(0,s.useLayoutEffect)(()=>{let e;if(!to.current)return;let t=X.current;if(!t)return;for(let t=e4.length-1;t>=0;t-=1)if("user"===e4[t].role){e=e4[t];break}if(!e)return;let n=t.querySelector(`[data-message-id="${CSS.escape(e.id)}"]`);n&&(to.current=!1,ei({type:"pin",top:Math.max(0,n.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop-8)}))},[e4,ei]),(0,s.useLayoutEffect)(()=>{let e=el.current;el.current=B,e&&!B&&t&&(es.current=!0)},[B,t]),(0,s.useLayoutEffect)(()=>{e7.current||ei({type:"content"})},[e,t,ei]),(0,s.useEffect)(()=>{let e=X.current;if(!e)return;let t=new ResizeObserver(()=>ei({type:"viewport"}));return t.observe(e),()=>t.disconnect()},[ei]),(0,s.useEffect)(()=>{let e=X.current;if(!e)return;let t=()=>ei({type:"release"});return e.addEventListener("wheel",t,{passive:!0}),e.addEventListener("touchmove",t,{passive:!0}),e.addEventListener("keydown",t),()=>{e.removeEventListener("wheel",t),e.removeEventListener("touchmove",t),e.removeEventListener("keydown",t)}},[ei]);let ti=(0,s.useRef)(a);(0,s.useEffect)(()=>{let e=ti.current;ti.current=a,e&&e!==a&&(to.current=!1,es.current=!1,ei({type:"reset"}))},[a,ei]),(0,s.useLayoutEffect)(()=>{if(e7.current&&!$){let e=X.current;if(e){let t=e.scrollHeight-e9.current;e.scrollTop=t,e7.current=!1}}},[e,$]);let tc=(0,s.useRef)(t),td=(0,s.useRef)(!1);return(0,s.useEffect)(()=>{let e=tc.current;tc.current=t,e&&!t&&(td.current=!ei({type:"settle"}))},[t,ei]),(0,s.useLayoutEffect)(()=>{if(B){if(es.current){let e=X.current,t=e?.querySelectorAll('[data-role="user"]'),n=t?.item((t?.length??0)-1);if(e&&n&&ei({type:"readFrom",top:Math.max(0,n.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop-8)})){es.current=!1,td.current=!1;return}}ei({type:"viewport"}),td.current&&(td.current=!1,ei({type:"settle"}))}},[B,ei]),(0,s.useEffect)(()=>{if(!B)return;let e=eo();tt(!!e&&S(e))},[e,B,eo,tt]),(0,r.jsxs)("div",{ref:Y,className:"relative flex-1 min-h-0 overflow-hidden flex flex-col outline-none",tabIndex:-1,onMouseUp:eD,onMouseDown:eW,children:[ew&&(0,r.jsxs)("div",{className:"flex-shrink-0 flex items-center gap-2 px-3 py-2 border-b border-border",children:[(0,r.jsx)("input",{ref:eE,type:"text",value:ey,onChange:e=>ek(e.target.value),onKeyDown:eM,placeholder:q("codeViewer.searchChat"),className:"flex-1 max-w-xs px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:ej.length>0?`${eC+1}/${ej.length}`:q("common.noMatch")}),(0,r.jsx)("button",{onClick:eS,disabled:0===ej.length,className:"p-1 rounded hover:bg-hover disabled:opacity-50",title:q("codeViewer.prevShiftEnter"),children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})})}),(0,r.jsx)("button",{onClick:eN,disabled:0===ej.length,className:"p-1 rounded hover:bg-hover disabled:opacity-50",title:q("codeViewer.nextEnter"),children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})}),(0,r.jsx)("button",{onClick:eL,className:"p-1 rounded hover:bg-hover",title:q("codeViewer.closeEsc"),children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{ref:X,onScroll:tn,className:"relative flex-1 min-h-0 overflow-y-auto px-8 py-4",children:0!==e.length||t?(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[var(--chat-column)]",children:[(0,r.jsx)("div",{ref:J}),T&&(0,r.jsx)("div",{className:"flex justify-center py-3",children:$?(0,r.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[(0,r.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin"}),(0,r.jsx)("span",{children:q("chat.loadMoreHistory")})]}):(0,r.jsx)("button",{onClick:I,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:q("chat.scrollUpForMore")})}),e4.map(e=>(0,r.jsx)("div",{"data-message-id":e.id,"data-role":e.role,children:(0,r.jsx)(c.s,{message:e,cwd:n,sessionId:a,onFork:A,onDeleteTurn:P,forkSupported:!0,onSendToPeer:_,peerSide:F,onApprovePlan:O,isLoading:t,onContentSearch:D,onShowFileDiff:W,onOpenFileLink:V})},e.id)),t&&(0,r.jsx)("div",{className:"flex justify-start mb-4",children:(0,r.jsxs)("div",{className:"px-1 py-1 max-w-[90%]",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[(0,r.jsx)(i,{bot:b}),(0,r.jsx)("span",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center","aria-hidden":"true",children:(0,r.jsx)(o.eV,{engine:eb,className:"h-4 w-4"})}),(0,r.jsxs)("span",{className:"text-sm text-muted-foreground/80 text-shimmer",children:[eg," running ",ev," \xb7 processing"," ",(0,r.jsx)(E,{value:M?.outputTokens??0})]})]}),j&&j.length>0&&(0,r.jsxs)("div",{className:"mt-2 flex items-start gap-2 text-xs text-muted-foreground border-t border-border/50 pt-2",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{children:["Waiting on ",j.length," background task",j.length>1?"s":""]}),j.map(e=>(0,r.jsx)("div",{className:"text-muted-foreground/80 break-words",children:e.description},e.task_id))]})]}),v&&(0,r.jsxs)("div",{className:"mt-2 flex items-start gap-2 text-xs text-amber-11 border-t border-border/50 pt-2",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{children:["Retrying API call (attempt ",v.attempt,v.maxRetries>0?`/${v.maxRetries}`:"",v.delayMs>0?`, delay ${(v.delayMs/1e3).toFixed(1)}s`:"",")"]}),(v.errorStatus||v.error)&&(0,r.jsxs)("div",{className:"text-muted-foreground/80 break-words",children:[v.errorStatus?`${v.errorStatus}`:"",v.errorStatus&&v.error?" \xb7 ":"",v.error||""]})]})]})]})}),(0,r.jsx)("div",{ref:er,"aria-hidden":!0}),(0,r.jsx)("div",{ref:Z})]}):(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-foreground-subtle",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-4xl mb-4",children:"\uD83D\uDCAC"}),(0,r.jsx)("div",{children:q("chat.startConversation")})]})})}),(e8.length>0||ec||eu)&&(0,r.jsxs)("nav",{className:"absolute top-1/2 z-10 flex -translate-y-1/2 flex-col items-center gap-2",style:{right:"max(0.5rem, calc(50% - var(--chat-column) / 2 - 2.25rem))"},"aria-label":q("chat.recentUserMessages"),children:[ec&&e.length>0&&(0,r.jsx)("button",{onClick:tr,className:"mb-1 flex h-7 w-7 items-center justify-center rounded-full text-muted-foreground transition-all hover:bg-hover hover:text-foreground active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:q("chat.jumpToStart"),"aria-label":q("chat.jumpToStart"),children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":!0,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 5h14M12 19V9m-5 5l5-5 5 5"})})}),e6&&z&&(0,r.jsx)("button",{onClick:z,className:"mb-1 flex h-7 w-7 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:q("chat.moreUserMessages"),"aria-label":q("chat.moreUserMessages"),children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":!0,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e8.map((e,t)=>{let n=em===e.id,s=e.content.replace(/\s+/g," ").trim()||(e.images?.length?q("chat.imageMessage"):q("chat.userMessage"));return(0,r.jsxs)("div",{className:"group relative flex h-3 items-center",children:[(0,r.jsx)("button",{onClick:t=>{tl(e.id),t.detail>0&&t.currentTarget.blur()},className:"flex h-3 w-7 items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-current":n?"true":void 0,"aria-label":q("chat.recentUserMessageNumber",{index:t+1,total:e8.length}),children:(0,r.jsx)("span",{"aria-hidden":!0,className:`h-0.5 rounded-full transition-all ${n?"w-4 bg-foreground":"w-3 bg-foreground/20 group-hover:w-4 group-hover:bg-foreground/45"}`})}),(0,r.jsx)("div",{className:"pointer-events-none absolute right-8 top-1/2 hidden w-72 -translate-y-1/2 rounded-xl border border-border bg-card px-3 py-2.5 text-left shadow-lv2 group-hover:block group-focus-within:block",children:(0,r.jsx)("div",{className:"line-clamp-4 text-sm leading-5 text-foreground",children:s})})]},e.id)}),eu&&e.length>0&&(0,r.jsx)("button",{onClick:ts,className:"mt-1 flex h-7 w-7 items-center justify-center rounded-full text-muted-foreground transition-all hover:bg-hover hover:text-foreground active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:q("chat.jumpToLatest"),"aria-label":q("chat.jumpToLatest"),children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":!0,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 19H5m7-14v10m5-5l-5 5-5-5"})})})]}),ee&&(0,r.jsx)(h.fS,{floatingToolbarRef:eT,bumpRef:e$,container:ee,onAddComment:eV,onSendToAI:eO,onSearch:D?eH:void 0,onExplain:eR?ez:void 0,onQuickReply:eK,quickReplyRows:e1,onEditQuickReplies:e0,isChatLoading:eR?.isLoading}),eG&&(0,r.jsx)(w,{initialRows:e1,lang:eZ,isCustomized:null!==eJ,onSave:e=>eY(e.length?e:null),onRestoreDefault:()=>eY(null),onClose:()=>eQ(!1)}),eP&&ee&&(0,r.jsx)(m.t,{x:eP.x,y:eP.y,range:{start:0,end:0},lineSnapshot:eP.text,container:ee,onSubmit:eU,onSendToAI:eR?e5:void 0,onClose:()=>e_(null),isChatLoading:eR?.isLoading}),eF&&ee&&(0,r.jsx)(m.G,{x:eF.x,y:eF.y,range:{start:0,end:0},lineSnapshot:eF.text,container:ee,onSubmit:e2,onClose:()=>eB(null),isChatLoading:eR?.isLoading})]})})},1058:(e,t,n)=>{n.d(t,{_:()=>a});var r=n(12115),s=n(90717),l=n(86957),o=n(46456);function a({cwd:e,filePath:t}){let[n,i]=(0,r.useState)([]),[c,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(null),m=(0,r.useCallback)(async()=>{if(!e||!t)return;d(!0),h(null);let n=await l.t4.runPromiseExit((0,o.lb)(e,t));if("Success"===n._tag)i(n.value.comments??[]);else{let e="Fail"===n.cause._tag?n.cause.error:null,t=e?.cause;h(t instanceof Error?t.message:"Failed to load comments")}d(!1)},[e,t]);(0,r.useEffect)(()=>{m()},[m]),(0,r.useEffect)(()=>(0,s.zL)(()=>{m()}),[m]);let f=(0,r.useCallback)(async(n,r,a,c)=>{let d=await l.t4.runPromiseExit((0,o.BC)({cwd:e,filePath:t,startLine:n,endLine:r,content:a,...c?{selectedText:c}:{}}));if("Success"===d._tag&&d.value.comment){let e=d.value.comment;return i(t=>[...t,e]),(0,s.Cm)(),e}return"Failure"===d._tag&&console.error("Failed to add comment:",d.cause),null},[e,t]),x=(0,r.useCallback)(async(t,n)=>{let r=await l.t4.runPromiseExit((0,o.vv)(e,t,n));if("Success"===r._tag&&r.value.comment){let e=r.value.comment;return i(n=>n.map(n=>n.id===t?e:n)),!0}return"Failure"===r._tag&&console.error("Failed to update comment:",r.cause),!1},[e]),p=(0,r.useCallback)(async t=>{let n=await l.t4.runPromiseExit((0,o.Tu)(e,t));return"Success"===n._tag?(i(e=>e.filter(e=>e.id!==t)),(0,s.Cm)(),!0):(console.error("Failed to delete comment:",n.cause),!1)},[e]),g=(0,r.useCallback)(e=>n.filter(t=>e>=t.startLine&&e<=t.endLine),[n]);return{comments:n,isLoading:c,error:u,addComment:f,updateComment:x,deleteComment:p,refresh:m,getCommentsForLine:g}}},3292:(e,t,n)=>{n.d(t,{P:()=>c});var r=n(12115),s=n(95045),l=n(75346),o=n(49433),a=n(86957),i=n(82680);function c(){let[e,t]=(0,r.useState)([]),n=(0,r.useCallback)(()=>{let e=o.$mh({try:async()=>{let e=await fetch("/api/pinned-sessions");return await e.json()},catch:e=>new i.uV({message:"loadPinnedSessions failed",cause:e})});a.t4.runPromise(e.pipe(o.YWq({onSuccess:e=>t(e.sessions||[]),onFailure:()=>{}})))},[]);(0,r.useEffect)(()=>{n()},[n]),(0,r.useEffect)(()=>{let e=e=>{e.data?.type==="PINNED_SESSIONS_CHANGED"&&n()};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[n]);let c=(0,r.useCallback)(e=>{t(e);let n=o.$mh({try:async()=>{await fetch("/api/pinned-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessions:e})})},catch:e=>new i.uV({message:"savePinnedSessions failed",cause:e})});a.t4.runFork(n.pipe(o.NWQ(()=>o.rIH))),(0,s.F)(l.n.PinnedSessionsChanged,{})},[]),d=(0,r.useCallback)(t=>e.some(e=>e.sessionId===t),[e]),u=(0,r.useCallback)((t,n,r)=>{e.some(e=>e.sessionId===t)||c([...e,{sessionId:t,cwd:n,customTitle:r}])},[e,c]),h=(0,r.useCallback)(t=>{c(e.filter(e=>e.sessionId!==t))},[e,c]),m=(0,r.useCallback)((t,n)=>{c(e.map(e=>e.sessionId===t?{...e,customTitle:n}:e))},[e,c]);return{pinnedSessions:e,isPinned:d,pinSession:u,unpinSession:h,updateTitle:m,reorder:(0,r.useCallback)(e=>{c(e)},[c]),reload:n}}},4055:(e,t,n)=>{n.d(t,{h:()=>s});let r=new Set(["Read","Grep","Glob","LS","WebSearch","WebFetch","NotebookRead","TodoRead","AskUserQuestion","ExitPlanMode","TodoWrite","Skill"]),s=e=>!r.has(e)},5135:(e,t,n)=>{n.d(t,{M:()=>E});var r=n(95155),s=n(12115),l=n(79114),o=n(14341),a=n(47650),i=n(70188),c=n(34075),d=n(89109),u=n(7320),h=n(37614),m=n(1058),f=n(48347),x=n(90717),p=n(69809),g=n(95927),b=n(34582),v=n(97251),w=n(11890),y=n(47215),k=n(43595),j=n(88403),C=n(47176),N=n(79968),S=n(27570);let L=[v.W];function E({content:e,filePath:t,cwd:n,onClose:v,sourceFile:M,embedded:R=!1,onLocalMdLink:T,scrollToAnchor:$}){let I=M||(n&&t.startsWith(n)?t.slice(n.endsWith("/")?n.length:n.length+1):t),{t:A}=(0,l.Bd)(),P=(0,i.iN)(),_=(0,f.r)(),F=(0,k.U)(),B=(0,j.Q)(),{comments:D,addComment:W,updateComment:V,deleteComment:O,refresh:z}=(0,m._)({cwd:n,filePath:t}),[H,U]=(0,s.useState)(!1),[q,K]=(0,s.useState)(null),[Z,J]=(0,s.useState)(null),[X,G]=(0,s.useState)(null),Q=(0,s.useMemo)(()=>e.split("\n"),[e]),Y=(0,s.useMemo)(()=>(0,b.J4)(t,n),[t,n]);(0,s.useEffect)(()=>{queueMicrotask(()=>U(!0))},[]);let[ee,et]=(0,s.useState)(null),en=(0,s.useRef)(null);(0,s.useEffect)(()=>{en.current!==ee&&et(en.current)});let er=(0,s.useRef)({onLocalMdLink:T,sourceFile:I});er.current={onLocalMdLink:T,sourceFile:I};let es=(0,s.useRef)(e=>{let{onLocalMdLink:t,sourceFile:n}=er.current;if(!t||/^[a-z][a-z0-9+.-]*:/i.test(e))return!1;let r=e.indexOf("#"),s=r>=0?e.slice(0,r):e,l=r>=0?e.slice(r+1):null;if(!s)return!1;let o=s;try{o=decodeURIComponent(s)}catch{}return!!(0,y.e$)(o)&&(t((0,y.WU)(n,o),l),!0)}).current;(0,s.useEffect)(()=>{if(!$)return;let e=setTimeout(()=>{(0,w.O)(en.current,$)},80);return()=>clearTimeout(e)},[$,e]);let{toolbarRef:el,bumpRef:eo,clearToolbar:ea}=(0,S.L)({enabled:!0,container:ee,resolveLineRange:e=>{let t=function(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;if(!t||!("closest"in t))return null;let n=t.closest("[data-source-start]");if(!n)return null;let r=n.getAttribute("data-source-start"),s=n.getAttribute("data-source-end");return r&&s?{start:parseInt(r,10),end:parseInt(s,10)}:null}(e);return t?{start:t.start,end:t.end}:null},buildLineSnapshot:({start:e,end:t})=>{let n=Math.max(0,e-1),r=Math.min(Q.length,t);return Q.slice(n,r).join("\n")}}),ei=(0,s.useCallback)(()=>{let e=el.current;e&&(K({x:e.x,y:e.y,range:e.range,selectedText:e.selectedText,lineSnapshot:e.lineSnapshot}),ea())},[ea,el]),ec=(0,s.useCallback)(()=>{let e=el.current;e&&(J({x:e.x,y:e.y,range:e.range,selectedText:e.selectedText,lineSnapshot:e.lineSnapshot}),ea())},[ea,el]),ed=(0,s.useCallback)(()=>{let e=el.current;e&&_&&(ea(),(0,x.Ff)(_.sendMessage,{filePath:t,startLine:e.range.start,endLine:e.range.end,codeContent:e.lineSnapshot},p.A.t("explain.selectionMessage")))},[_,t,ea,el]),eu=(0,s.useCallback)(async e=>{q&&(await W(q.range.start,q.range.end,e,q.selectedText),K(null))},[q,W]),eh=(0,s.useCallback)(async(e,r)=>{if(_)try{let s=await (0,x.$3)(n),l=[];for(let e of s)l.push({filePath:e.filePath,startLine:e.startLine,endLine:e.endLine,codeContent:e.codeContent,note:e.content||void 0});l.push({filePath:t,startLine:e.range.start,endLine:e.range.end,codeContent:e.lineSnapshot});let o=(0,x.Gw)(l,r);_.sendMessage(o),await (0,x.RP)(n),z()}catch(e){console.error("Failed to send to AI:",e)}},[_,t,n,z]),em=(0,s.useCallback)(e=>{Z&&eh(Z,e)},[Z,eh]),ef=(0,s.useCallback)(e=>{q&&eh(q,e)},[q,eh]),ex=(0,s.useMemo)(()=>{if(0===D.length)return[];let e=new Map;for(let t of D){let n=`${t.startLine}-${t.endLine}`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return Array.from(e.entries()).map(([e,t])=>({key:e,startLine:t[0].startLine,endLine:t[0].endLine,comments:t}))},[D]),[ep,eg]=(0,s.useState)([]);return(0,s.useEffect)(()=>{if(0===ex.length||!en.current)return void queueMicrotask(()=>eg([]));let e=setTimeout(()=>{let e=en.current;if(!e)return;let t=[],n=e.querySelectorAll("[data-source-start]");for(let r of ex){let s=null,l=1/0;for(let e of n){let t=parseInt(e.getAttribute("data-source-start"),10),n=parseInt(e.getAttribute("data-source-end"),10);if(t<=r.startLine&&n>=r.endLine){let r=n-t;r<l&&(l=r,s=e)}}if(s){let n=e.getBoundingClientRect(),l=s.getBoundingClientRect();t.push({key:r.key,top:l.top-n.top+e.scrollTop,comments:r.comments})}}eg(t)},100);return()=>clearTimeout(e)},[ex,e]),(0,s.useEffect)(()=>{let e=e=>{if("Escape"===e.key){if(Z){J(null),e.stopPropagation();return}if(q){K(null),e.stopPropagation();return}if(el.current){el.current=null,eo.current(),e.stopPropagation();return}if(X){G(null),e.stopPropagation();return}v?.()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[Z,q,X,v]),(0,r.jsxs)(r.Fragment,{children:[!R&&(0,r.jsxs)("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between gap-3 flex-shrink-0",children:[(0,r.jsxs)("span",{className:"text-sm font-medium text-foreground truncate min-w-0 flex-1 cursor-pointer hover:text-brand transition-colors",style:{direction:"rtl",textAlign:"left"},"data-tooltip":t,onClick:()=>{navigator.clipboard.writeText(t),(0,c.oR)(A("common.copiedPath"))},children:["",t]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(N.ShareReviewToggle,{content:e,sourceFile:I}),((0,y.C_)(t)||(0,y.OG)(t))&&(0,r.jsx)("button",{onClick:()=>{let e=t.startsWith("/")||!n?t:`${n.replace(/\/$/,"")}/${t}`;(0,y.OG)(t)?B(e):F(e)},className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:A((0,y.OG)(t)?"bots.addTooltip":"skills.addTooltip"),children:(0,r.jsx)(o.A,{className:"w-4 h-4"})}),(0,r.jsx)("button",{onClick:v,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:A("common.close"),children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,r.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,r.jsx)(C.l,{content:e,containerRef:en}),(0,r.jsxs)("div",{className:"flex-1 overflow-auto relative",ref:en,children:[(0,r.jsx)("div",{className:"p-6",children:(0,r.jsx)(g.T,{content:e,basePath:Y,rehypePlugins:L,onLinkClick:es})}),ep.map(({key:e,top:t,comments:n})=>(0,r.jsx)("div",{className:"absolute right-3 cursor-pointer z-10",style:{top:t},onClick:e=>{e.stopPropagation(),G({comment:n[0],x:e.clientX,y:e.clientY})},children:(0,r.jsx)("div",{className:"w-5 h-5 rounded-full bg-amber-500/80 text-white text-xs flex items-center justify-center shadow-lv1 hover:bg-amber-500 transition-colors",children:n.length})},e))]})]}),H&&P&&(0,a.createPortal)((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.fS,{floatingToolbarRef:el,bumpRef:eo,container:P,onAddComment:ei,onSendToAI:ec,onExplain:_?ed:void 0,isChatLoading:_?.isLoading}),q&&(0,r.jsx)(u.t,{x:q.x,y:q.y,range:q.range,filePath:t,lineSnapshot:q.lineSnapshot,container:P,onSubmit:eu,onSendToAI:_?ef:void 0,onClose:()=>K(null),isChatLoading:_?.isLoading}),Z&&(0,r.jsx)(u.G,{x:Z.x,y:Z.y,range:Z.range,filePath:t,lineSnapshot:Z.lineSnapshot,container:P,onSubmit:em,onClose:()=>J(null),isChatLoading:_?.isLoading}),X&&(0,r.jsx)(h.t,{x:X.x,y:X.y,comment:X.comment,container:P,onClose:()=>G(null),onUpdateComment:V,onDeleteComment:O})]}),P)]})}},7320:(e,t,n)=>{n.d(t,{G:()=>a,t:()=>o});var r=n(95155),s=n(12115),l=n(79114);function o({x:e,y:t,range:n,filePath:a,lineSnapshot:i,container:c,onSubmit:d,onSendToAI:u,onClose:h,isChatLoading:m}){let{t:f}=(0,l.Bd)(),[x,p]=(0,s.useState)(""),[g,b]=(0,s.useState)(!1),v=(0,s.useRef)(null),w=(0,s.useRef)(null),[y,k]=(0,s.useState)({x:0,y:0}),j=i?.split("\n").slice(0,5).join("\n"),C=!!i&&i.split("\n").length>5;(0,s.useEffect)(()=>{if(v.current&&c){let n=c.getBoundingClientRect(),r=v.current.getBoundingClientRect(),s=e-n.left,l=t-n.top;s+r.width>n.width-16&&(s=n.width-r.width-16),s<16&&(s=16),l+r.height>n.height-16&&(l=l-r.height-8),l<16&&(l=16),queueMicrotask(()=>k({x:s,y:l}))}},[e,t,c]),(0,s.useEffect)(()=>{w.current?.focus()},[]),(0,s.useEffect)(()=>{let e=e=>{g||!v.current||v.current.contains(e.target)||h()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h,g]);let N=()=>{!g&&x.trim()&&(b(!0),d(x.trim()))};return(0,r.jsxs)("div",{ref:v,className:"absolute z-[200] w-[640px] bg-card border border-border rounded-lg shadow-lv2 overflow-hidden",style:{left:y.x,top:y.y},children:[(0,r.jsxs)("div",{className:"px-3 py-2 bg-amber-9/10 border-b border-border",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-amber-11",children:f("comments.addComment")}),(n.start>0||n.end>0)&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:f("comments.lineRange",{start:n.start,end:n.end})})]}),a&&(0,r.jsx)("div",{className:"mt-1 text-xs text-muted-foreground truncate",children:a})]}),i&&(0,r.jsx)("div",{className:"px-3 py-2 border-b border-border max-h-24 overflow-hidden",children:(0,r.jsxs)("pre",{className:"text-xs font-mono text-muted-foreground whitespace-pre-wrap break-all",children:[j,C&&(0,r.jsx)("span",{className:"text-muted-foreground/50",children:"..."})]})}),(0,r.jsxs)("div",{className:"p-2",children:[(0,r.jsx)("textarea",{ref:w,value:x,onChange:e=>p(e.target.value),placeholder:f("comments.inputPlaceholder"),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card resize-none focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",rows:2,disabled:g,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),N()),"Escape"!==e.key||g||h()}}),(0,r.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:f(g?"comments.submitting":"comments.enterSubmit")}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{className:"px-3 py-1 text-xs font-medium border border-amber-11 text-amber-11 rounded-md hover:bg-amber-9/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:N,disabled:g||!x.trim(),children:f("comments.submitComment")}),u&&(0,r.jsx)("button",{className:"px-3 py-1 text-xs font-medium border border-brand text-brand rounded-md hover:bg-brand/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{!g&&!m&&u&&x.trim()&&(b(!0),u(x.trim()),h())},disabled:g||m||!x.trim(),title:m?f("comments.aiResponding"):void 0,children:f("comments.sendToAI")})]})]})]})]})}function a({x:e,y:t,range:n,filePath:o,lineSnapshot:i,container:c,onSubmit:d,onClose:u,isChatLoading:h}){let{t:m}=(0,l.Bd)(),[f,x]=(0,s.useState)(""),p=(0,s.useRef)(null),g=(0,s.useRef)(null),[b,v]=(0,s.useState)({x:0,y:0});(0,s.useEffect)(()=>{if(p.current&&c){let n=c.getBoundingClientRect(),r=p.current.getBoundingClientRect(),s=e-n.left,l=t-n.top;s+r.width>n.width-16&&(s=n.width-r.width-16),s<16&&(s=16),l+r.height>n.height-16&&(l=l-r.height-8),l<16&&(l=16),queueMicrotask(()=>v({x:s,y:l}))}},[e,t,c]),(0,s.useEffect)(()=>{g.current?.focus()},[]),(0,s.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&u()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]);let w=i?.split("\n").slice(0,5).join("\n"),y=!!i&&i.split("\n").length>5;return(0,r.jsxs)("div",{ref:p,className:"absolute z-[200] w-[640px] bg-card border border-border rounded-lg shadow-lv2 overflow-hidden",style:{left:b.x,top:b.y},children:[(0,r.jsxs)("div",{className:"px-3 py-2 bg-brand/10 border-b border-border",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-brand",children:m("comments.askAI")}),(n.start>0||n.end>0)&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:m("comments.lineRange",{start:n.start,end:n.end})})]}),o&&(0,r.jsx)("div",{className:"mt-1 text-xs text-muted-foreground truncate",children:o})]}),i&&(0,r.jsx)("div",{className:"px-3 py-2 border-b border-border max-h-24 overflow-hidden",children:(0,r.jsxs)("pre",{className:"text-xs font-mono text-muted-foreground whitespace-pre-wrap break-all",children:[w,y&&(0,r.jsx)("span",{className:"text-muted-foreground/50",children:"..."})]})}),(0,r.jsxs)("div",{className:"p-2",children:[(0,r.jsx)("textarea",{ref:g,value:f,onChange:e=>x(e.target.value),placeholder:m("comments.inputQuestion"),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card resize-none focus:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",rows:2,disabled:h,onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),!h&&f.trim()&&(d(f.trim()),u())),"Escape"===e.key&&u()}}),(0,r.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:m(h?"comments.aiGenerating":"comments.enterSend")})]})]})}},9573:(e,t,n)=>{n.d(t,{Tt:()=>i,se:()=>a,xK:()=>o});var r=n(49433),s=n(82680);let l=e=>r.$mh({try:async()=>{let t=await fetch(e);if(!t.ok)throw Error(`HTTP ${t.status}`);return await t.json()},catch:t=>new s.uV({message:`GET ${e} failed`,cause:t})}),o=(e,t,n)=>l(`/api/snapshots?cwd=${encodeURIComponent(e)}&toolIds=${encodeURIComponent(t.join(","))}${n?`&sessionKey=${encodeURIComponent(n)}`:""}`).pipe(r.TjK(e=>e.commits??[])),a=(e,t,n)=>o(e,t,n).pipe(r.qIB(t=>r.Q7R(t.map(t=>{let n;return n=t.hash,l(`/api/snapshots/diff?cwd=${encodeURIComponent(e)}&commit=${encodeURIComponent(n)}`)}),{concurrency:4}))),i=(e,t,n)=>l(`/api/snapshots/range-diff?cwd=${encodeURIComponent(e)}&head=${encodeURIComponent(n)}${t?`&base=${encodeURIComponent(t)}`:""}`)},14575:(e,t,n)=>{n.d(t,{o:()=>o});var r=n(95155);n(12115);let s={ts:"#3178c6",tsx:"#3178c6",js:"#f1e05a",jsx:"#61dafb",mjs:"#f1e05a",cjs:"#f1e05a",html:"#e44d26",css:"#563d7c",scss:"#cd6799",sass:"#cd6799",less:"#1d365d",vue:"#41b883",svelte:"#ff3e00",json:"#cbcb41",yaml:"#cb171e",yml:"#cb171e",toml:"#9c4121",xml:"#e37933",env:"#ecd53f",md:"#519aba",mdx:"#519aba",txt:"#89898a",py:"#3572a5",go:"#00add8",rs:"#dea584",lean:"#448aff",java:"#b07219",kt:"#a97bff",kts:"#a97bff",c:"#555555",h:"#555555",cpp:"#f34b7d",hpp:"#f34b7d",rb:"#701516",php:"#4f5d95",sh:"#89e051",bash:"#89e051",zsh:"#89e051",png:"#a074c4",jpg:"#a074c4",jpeg:"#a074c4",gif:"#a074c4",svg:"#ffb13b",webp:"#a074c4",ico:"#a074c4",lock:"#89898a",gitignore:"#f14e32",dockerfile:"#2496ed",sql:"#e38c00",graphql:"#e535ab",gql:"#e535ab",default:"#8a8a8a"},l={"package.json":"#cb3837","package-lock.json":"#cb3837","tsconfig.json":"#3178c6","jsconfig.json":"#f1e05a",".gitignore":"#f14e32",".eslintrc":"#4b32c3",".eslintrc.js":"#4b32c3",".eslintrc.json":"#4b32c3",".prettierrc":"#56b3b4",dockerfile:"#2496ed",".env":"#ecd53f",".env.local":"#ecd53f",".env.development":"#ecd53f",".env.production":"#ecd53f","readme.md":"#519aba",license:"#d4af37",makefile:"#6d8086","cargo.toml":"#dea584","go.mod":"#00add8","go.sum":"#00add8","requirements.txt":"#3572a5","yarn.lock":"#2c8ebb","pnpm-lock.yaml":"#f9ad00","vite.config.ts":"#646cff","vite.config.js":"#646cff","next.config.js":"#000000","next.config.mjs":"#000000","tailwind.config.js":"#38bdf8","tailwind.config.ts":"#38bdf8"};function o({name:e,className:t="",size:n=16}){let a,i=l[a=e.toLowerCase()]?l[a]:s[e.split(".").pop()?.toLowerCase()||""]||s.default,c=e.split(".").pop()?.toLowerCase()||"";return["ts","tsx"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2",fill:i}),(0,r.jsx)("path",{d:"M7 10h10M12 10v8",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}):["js","jsx","mjs","cjs"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2",fill:i}),(0,r.jsx)("path",{d:"M10 10v6c0 1-1 2-2 2M14 10v4c0 2 4 2 4 0v-4",stroke:"#323330",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}):"jsx"===c||"tsx"===c&&e.includes("component")?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("ellipse",{cx:"12",cy:"12",rx:"10",ry:"4",stroke:"#61dafb",strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("ellipse",{cx:"12",cy:"12",rx:"10",ry:"4",stroke:"#61dafb",strokeWidth:"1.5",fill:"none",transform:"rotate(60 12 12)"}),(0,r.jsx)("ellipse",{cx:"12",cy:"12",rx:"10",ry:"4",stroke:"#61dafb",strokeWidth:"1.5",fill:"none",transform:"rotate(120 12 12)"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"2",fill:"#61dafb"})]}):"json"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M6 4C4 4 4 6 4 8v2c0 1-1 2-2 2 1 0 2 1 2 2v2c0 2 0 4 2 4",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M18 4c2 0 2 2 2 4v2c0 1 1 2 2 2-1 0-2 1-2 2v2c0 2 0 4-2 4",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"1.5",fill:i})]}):["md","mdx"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M5 15V9l3 4 3-4v6M17 12l-2-3v6M17 12l2-3v6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):["py","pyi","pyx"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M12 4c-4 0-4 2-4 3v2h5v1H6c-2 0-3 2-3 4s1 4 3 4h2v-2c0-2 1-3 3-3h4c1 0 2-1 2-2V7c0-2-2-3-5-3z",fill:"#3572a5"}),(0,r.jsx)("path",{d:"M12 20c4 0 4-2 4-3v-2h-5v-1h7c2 0 3-2 3-4s-1-4-3-4h-2v2c0 2-1 3-3 3h-4c-1 0-2 1-2 2v4c0 2 2 3 5 3z",fill:"#ffd43b"}),(0,r.jsx)("circle",{cx:"9",cy:"7",r:"1",fill:"white"}),(0,r.jsx)("circle",{cx:"15",cy:"17",r:"1",fill:"white"})]}):"go"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6",fill:i}),(0,r.jsx)("circle",{cx:"9",cy:"11",r:"1.5",fill:"white"}),(0,r.jsx)("circle",{cx:"15",cy:"11",r:"1.5",fill:"white"}),(0,r.jsx)("circle",{cx:"9",cy:"11",r:"0.7",fill:"#333"}),(0,r.jsx)("circle",{cx:"15",cy:"11",r:"0.7",fill:"#333"})]}):"rs"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:i,strokeWidth:"2",fill:"none"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3",fill:i}),(0,r.jsx)("path",{d:"M12 3v3M12 18v3M3 12h3M18 12h3",stroke:i,strokeWidth:"2",strokeLinecap:"round"})]}):"lean"===c?(0,r.jsx)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:(0,r.jsx)("path",{d:"M3.45 1.5 1.5 2.5 12 22.5 22.5 2.5 20.55 1.5 15.9 10.35H8.1ZM9 12h6l-3 6Z",fill:i,fillRule:"evenodd"})}):["png","jpg","jpeg","gif","webp","ico","bmp"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"9",r:"2",fill:i}),(0,r.jsx)("path",{d:"M3 16l5-5 3 3 4-4 6 6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):"svg"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M7 12 Q12 6 17 12 Q12 18 7 12",stroke:i,strokeWidth:"1.5",fill:"none"})]}):"html"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M4 3l1.5 17L12 22l6.5-2L20 3H4z",fill:i}),(0,r.jsx)("path",{d:"M8 7h8l-.5 6-3.5 1-3.5-1-.2-2",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}):["css","scss","sass","less"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M4 3l1.5 17L12 22l6.5-2L20 3H4z",fill:i}),(0,r.jsx)("path",{d:"M15 8H9l.3 3h5.2l-.4 4-2.1.7-2.1-.7-.1-2",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}):["yaml","yml"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M7 8l3 4v5M17 8l-3 4v5",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):["sh","bash","zsh","fish"].includes(c)?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",fill:"#1e1e1e",stroke:"#555",strokeWidth:"1"}),(0,r.jsx)("path",{d:"M6 9l3 3-3 3M12 15h5",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):"gitignore"===c||".gitignore"===e.toLowerCase()?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:i}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3",fill:"white"}),(0,r.jsx)("path",{d:"M12 6v3M12 15v3M6 12h3M15 12h3",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}):"dockerfile"===c||"dockerfile"===e.toLowerCase()||e.toLowerCase().startsWith("dockerfile")?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M3 12h3v3H3zM7 12h3v3H7zM11 12h3v3h-3zM7 8h3v3H7zM11 8h3v3h-3zM11 4h3v3h-3zM15 12h3v3h-3z",fill:i}),(0,r.jsx)("path",{d:"M21 13c-1-2-3-2-4-2h-1c0-1 0-2-2-3h-1v1c0 1-1 2-2 2H3c-1 3 0 6 2 8s5 3 9 3c5 0 8-2 10-6",stroke:i,strokeWidth:"1.5",fill:"none"})]}):"env"===c||e.startsWith(".env")?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"2",fill:i}),(0,r.jsx)("path",{d:"M12 8h6M8 12h8M8 16h5",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]}):"sql"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("ellipse",{cx:"12",cy:"7",rx:"8",ry:"3",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M4 7v10c0 1.7 3.6 3 8 3s8-1.3 8-3V7",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3",stroke:i,strokeWidth:"1.5",fill:"none"})]}):"vue"===c?(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M2 4h4l6 10 6-10h4L12 22 2 4z",fill:i}),(0,r.jsx)("path",{d:"M6 4h4l2 4 2-4h4l-6 10L6 4z",fill:"#35495e"})]}):(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M6 3h8l5 5v13H6V3z",stroke:i,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M14 3v5h5",stroke:i,strokeWidth:"1.5",fill:"none"})]})}},14594:(e,t,n)=>{function r(e,t,n){return t?e?n?`${e.replace(/\n+$/,"")}
|
|
2
2
|
|
|
3
3
|
${t}`:e+t:t:e}function s(e,t,n=!1){let r=e||[];if(!t)return r;let l=r[r.length-1];return n||l?.type!=="text"?[...r,{type:"text",text:t}]:[...r.slice(0,-1),{type:"text",text:l.text+t}]}function l(e){return null!=e.parent_tool_use_id}n.d(t,{FM:()=>d,Nn:()=>l,A7:()=>a,Uy:()=>i,fD:()=>c});let o=["task_started","task_progress","task_notification"];function a(e){return"system"===e.type&&o.includes(e.subtype??"")}function i(e,t){let n={status:"running",...e};return"task_notification"===t.subtype&&(n.status=t.status??"completed"),t.task_id&&(n.id=t.task_id),t.last_tool_name&&(n.lastToolName=t.last_tool_name),t.summary&&(n.summary=t.summary),"number"==typeof t.usage?.tool_uses&&(n.toolUses=t.usage.tool_uses),"number"==typeof t.usage?.duration_ms&&(n.durationMs=t.usage.duration_ms),n}function c(e){let t=!1,n=e.map(e=>e.toolCalls?.some(e=>e.task?.status==="running")?(t=!0,{...e,toolCalls:e.toolCalls.map(e=>e.task?.status==="running"?{...e,task:{...e.task,status:"unknown"}}:e)}):e);return t?n:e}function d(e,t,n){let{engine:o,assistantId:c}=n;if(l(t))return e;if(a(t)){let n=t.tool_use_id;if(!n||t.ambient)return e;let r=!1,s=e.map(e=>e.toolCalls?.some(e=>e.id===n)?(r=!0,{...e,toolCalls:e.toolCalls.map(e=>e.id===n?{...e,task:i(e.task,t)}:e)}):e);return r?s:e}if("stream_event"===t.type){let n=t.event;if(n?.type==="content_block_delta"&&n.delta?.type==="text_delta"&&n.delta.text){let t=n.delta.text;return e.map(e=>e.id===c?{...e,content:r(e.content||"",t,!!e.pendingTextBreak),parts:s(e.parts,t,!!e.pendingTextBreak),pendingTextBreak:!1}:e)}return e}if("assistant"===t.type){let n=t.message?.content;if(!Array.isArray(n))return e;let l=e,a=t.message?.model==="<synthetic>";if("codex"===o||"ollama"===o||a){let e=n.filter(e=>"text"===e.type&&e.text).map(e=>e.text).join("");e&&(l=l.map(t=>t.id===c?{...t,content:r(t.content||"",e,!!t.pendingTextBreak),parts:s(t.parts,e,!!t.pendingTextBreak),pendingTextBreak:!1}:t))}for(let e of n)if(e.name){let t={id:e.id||`tool-${c}-${e.name}`,name:e.name,input:e.input||{},isLoading:!0};l=l.map(e=>e.id!==c||e.toolCalls?.some(e=>e.id===t.id)?e:{...e,toolCalls:[...e.toolCalls||[],t],parts:function(e,t){let n=e||[];return n.some(e=>"tool"===e.type&&e.id===t)?n:[...n,{type:"tool",id:t}]}(e.parts,t.id),pendingTextBreak:!0})}return l}if("user"===t.type){let n=t.message?.content;if(!Array.isArray(n))return e;let r=e;for(let e of n)if(e.tool_use_id){let t=e.tool_use_id,n="string"==typeof e.content?e.content:JSON.stringify(e.content);r=r.map(e=>e.id===c?{...e,toolCalls:e.toolCalls?.map(e=>e.id===t?{...e,result:n,isLoading:!1}:e)}:e)}return r}if("error"===t.type){let n=t.error||"An error occurred. Please try again.",l=`⚠️ ${n}`;return e.map(e=>e.id===c?{...e,content:r(e.content||"",l,!0),parts:s(e.parts,l,!0),isStreaming:!1}:e)}if("result"===t.type){let n="string"==typeof t.result?t.result.trim():"";return e.map(e=>e.id===c?{...e,content:!e.content&&n?n:e.content,parts:!e.content&&n?s(e.parts,n):e.parts,isStreaming:!1,toolCalls:e.toolCalls?.map(e=>({...e,isLoading:!1}))}:e)}return e}},17196:(e,t,n)=>{n.d(t,{Np:()=>d,ZD:()=>a,ZR:()=>i,b8:()=>c,kS:()=>l,sQ:()=>o});let r=null,s=["typescript","tsx","javascript","jsx","html","css","scss","json","yaml","python","go","rust","java","ruby","php","bash","shell","markdown","sql","c","cpp","swift","kotlin","dart","lua","graphql","xml","lean4"];function l(){return r||(r=Promise.all([n.e(49304),n.e(64523)]).then(n.bind(n,64523)).then(({createHighlighter:e})=>e({themes:["github-dark","github-light"],langs:[...s]}))),r}function o(e){let t=e.split("/").pop()?.toLowerCase()||"",n=t.split(".").pop()?.toLowerCase();if(".env"===t||t.startsWith(".env.")||"dockerfile"===t||t.startsWith("dockerfile.")||"makefile"===t)return"bash";let r={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",mjs:"javascript",cjs:"javascript",html:"html",htm:"html",css:"css",scss:"scss",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",py:"python",go:"go",rs:"rust",java:"java",kt:"kotlin",rb:"ruby",php:"php",cs:"cpp",cpp:"cpp",c:"c",h:"c",sh:"bash",bash:"bash",zsh:"bash",md:"markdown",mdx:"markdown",sql:"sql",swift:"swift",dart:"dart",lua:"lua",graphql:"graphql",gql:"graphql",lean:"lean4",toml:"yaml",sass:"scss",less:"css",scala:"java",r:"python",vim:"bash",env:"bash"}[n||""]||"text";return s.includes(r)?r:"text"}function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}let i=2e3;function c(e){return e.length>i?a(e.map(e=>e.content).join("")):e.map(e=>e.color?`<span style="color:${e.color}">${a(e.content)}</span>`:a(e.content)).join("")}function d(e,t,n,r){if(!t)return[];let s=[],l=n?t:t.toLowerCase();for(let t=0;t<e.length;t++){let o=n?e[t]:e[t].toLowerCase(),a=0;for(;;){let e=o.indexOf(l,a);if(-1===e)break;let n=e+l.length;if(r){let r=e>0?o[e-1]:" ",l=n<o.length?o[n]:" ",a=!/\w/.test(r),i=!/\w/.test(l);a&&i&&s.push({lineIndex:t,startCol:e,endCol:n})}else s.push({lineIndex:t,startCol:e,endCol:n});a=e+1}}return s}},19095:(e,t,n)=>{n.d(t,{r:()=>r});function r(e){let t=0,n=0;for(let r of e)/[\u3040-\u30ff\u3400-\u9fff\uf900-\ufaff\u{20000}-\u{2a6df}\uac00-\ud7af]/u.test(r)?t+=1:n+=1;return Math.max(1,Math.ceil(t+n/4))}},19502:(e,t,n)=>{n.d(t,{YO:()=>s,aj:()=>r,pU:()=>l});let r=3,s=20;function l(e,t,n,o=[]){let a=e.length,i=n=>"unchanged"!==e[n].type||"unchanged"!==t[n].type,c=new Set;for(let e=0;e<a;e++){if(!i(e))continue;let t=Math.max(0,e-r),n=Math.min(a-1,e+r);for(let e=t;e<=n;e++)c.add(e)}let d=[];for(let e=0;e<a;e++){if(c.has(e))continue;let t=e;for(;e<a&&!c.has(e);)e++;d.push({id:d.length,startIdx:t,endIdx:e-1}),e--}for(let e of d){let t=n.get(e.id)??{topRevealed:0,bottomRevealed:0},r=e.endIdx-e.startIdx+1,s=Math.max(0,Math.min(t.topRevealed,r)),l=Math.max(0,Math.min(t.bottomRevealed,r-s));for(let t=e.startIdx;t<e.startIdx+s;t++)c.add(t);for(let t=e.endIdx-l+1;t<=e.endIdx;t++)c.add(t)}let u=[];for(let e=0;e<a;e++){let n;if(c.has(e)){u.push({kind:"diff",idx:e});continue}let r=e;for(;e<a&&!c.has(e);)e++;let l=e-1;e--;let i=d.find(e=>e.startIdx<=r&&l<=e.endIdx);if(!i)continue;let h=l-r+1,m=Math.min(s,h);if(o.length>0&&l+1<a)for(let e=l+1;e<a;e++){let r=t[e].lineNum;if(!(r<=0)){n=function(e,t){let n=null;for(let r of e)r.startLine<=t&&t<=r.endLine&&(!n||r.endLine-r.startLine<n.endLine-n.startLine)&&(n=r);return n}(o,r)??void 0;break}}u.push({kind:"gap-expand",gapId:i.id,direction:"up",revealCount:m}),u.push({kind:"gap-label",gapId:i.id,hiddenCount:h,enclosingFn:n}),u.push({kind:"gap-expand",gapId:i.id,direction:"down",revealCount:m})}return{rows:u,gaps:d}}},20080:(e,t,n)=>{n.d(t,{K:()=>a});var r=n(95155),s=n(12115),l=n(79114);function o({label:e,labelClassName:t,src:n,node:a,alt:i}){let{t:c}=(0,l.Bd)(),[d,u]=(0,s.useState)(!1);return(0,r.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col items-center gap-2",children:[(0,r.jsx)("div",{className:`text-xs font-medium ${t}`,children:e}),(0,r.jsx)("div",{className:"w-full flex-1 flex items-center justify-center rounded border border-border bg-secondary p-3 min-h-[8rem]",children:a?(0,r.jsx)("div",{className:"w-full min-w-0",children:a}):d?(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:c("diffViewer.imageLoadFailed")}):(0,r.jsx)("img",{src:n,alt:i,onError:()=>u(!0),className:"max-w-full max-h-[60vh] object-contain"})})]})}function a({filePath:e,oldSrc:t,newSrc:n,oldNode:s,newNode:i}){let{t:c}=(0,l.Bd)(),d=!!s||!!t,u=!!i||!!n;return(0,r.jsxs)("div",{className:"h-full overflow-auto p-4",children:[(0,r.jsx)("div",{className:"text-xs font-mono text-muted-foreground mb-3 truncate",children:e}),d||u?(0,r.jsxs)("div",{className:"flex flex-wrap items-stretch gap-4",children:[d&&(0,r.jsx)(o,{label:c(u?"diffViewer.imageBefore":"diffViewer.imageDeleted"),labelClassName:"text-red-11",src:t,node:s,alt:`${e} (before)`}),u&&(0,r.jsx)(o,{label:c(d?"diffViewer.imageAfter":"diffViewer.imageAdded"),labelClassName:"text-green-11",src:n,node:i,alt:`${e} (after)`})]}):(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:c("diffViewer.imageUnavailable")})]})}},20917:(e,t,n)=>{n.d(t,{R:()=>c,e:()=>d});var r=n(12115),s=n(19095),l=n(14594),o=n(98245),a=n(69809),i=n(2111);let c=[];function d(e,t,{sessionId:n,cwd:u,engine:h,planMode:m,noHistory:f,outputStyleId:x,ollamaModel:p,engineModel:g,claudeModel:b,claudeEffort:v,claudeFastMode:w,claudeThinking:y,codexModel:k,codexReasoningEffort:j,onSessionId:C,onFetchTitle:N,onRunComplete:S,taskStore:L}){let[E,M]=(0,r.useState)(!1),[R,T]=(0,r.useState)(null),[$,I]=(0,r.useState)(null),[A,P]=(0,r.useState)(null),[_,F]=(0,r.useState)(null),[B,D]=(0,r.useState)(null),[W,V]=(0,r.useState)(c),O=(0,r.useRef)(null),[z,H]=(0,r.useState)(null),U=(0,r.useRef)(z);U.current=z;let q=(0,r.useRef)(!1),K=(0,r.useRef)(S);K.current=S;let Z=(0,r.useRef)(L);Z.current=L;let J=(0,r.useRef)(!1),X=(0,r.useRef)(null),G=(0,r.useRef)(n);G.current=n;let Q=(0,r.useRef)(null),Y=(0,r.useRef)(null),ee=(0,r.useRef)(null),et=(0,r.useRef)(!1),en=(0,r.useRef)(!1),er=(0,r.useRef)(0),es=(0,r.useCallback)(()=>{let e=Q.current;if(e&&e.text){let{messageId:n,text:r}=e;t(e=>(0,l.FM)(e,{type:"stream_event",event:{type:"content_block_delta",delta:{type:"text_delta",text:r}}},{engine:h,assistantId:n})),Q.current={messageId:n,text:""}}Y.current=null},[t,h]),el=(0,r.useCallback)(()=>{Y.current&&(clearTimeout(Y.current),Y.current=null),X.current&&(clearTimeout(X.current),X.current=null),es(),t(l.fD),Z.current?.settleRunning(),M(!1),I(null),P(null),V(c);let e=U.current,n=ee.current;e&&t(t=>t.map(t=>t.id===e.assistantId||t.id===n?{...t,isStreaming:!1}:t)),H(null),K.current?.()},[es,t]),eo=(0,r.useCallback)(()=>{let e=U.current;fetch("/api/chat/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:G.current,runId:e?.runKey})}).catch(()=>{}),el()},[el]),ea=(0,r.useCallback)((e,n)=>{let r=e.type;if((0,l.Nn)(e))return;let i=e=>{if(q.current||"string"!=typeof e||!e)return;let t=(0,s.r)(e);I(e=>({outputTokens:(e?.outputTokens||0)+t}))};if("system"===r&&"init"===e.subtype){let n=e.session_id,r=et.current;if(C(n),G.current=n,r||(P(e=>e??Date.now()),I(null),q.current=!1),D(null),r){let e=`auto-asst-${++er.current}`;ee.current=e,t(t=>[...t,{id:e,role:"assistant",content:"",toolCalls:[],isStreaming:!0,runKey:U.current?.runKey}])}en.current=!0;return}if("system"===r&&"background_tasks_changed"===e.subtype){let t=(e.tasks??[]).filter(e=>!e.ambient).map(e=>({task_id:e.task_id,description:e.description}));V(t.length?t:c);return}if(!(0,l.A7)(e)||(Z.current?.applyEvent(e),t(t=>(0,l.FM)(t,e,{engine:h,assistantId:n})),"task_notification"===e.subtype)){if("system"===r&&"task_notification"===e.subtype){if(!en.current){let n=e.status,r=e.summary||"",s=e.task_id,l=`<task-notification>
|
|
4
4
|
`+(s?`<task-id>${s}</task-id>
|
package/.next-prod/static/chunks/app/{layout-0c3dcac0764d9e97.js → layout-6641747151f1495e.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{7815:e=>{e.exports={style:{fontFamily:"'Lora', 'Lora Fallback'",fontStyle:"normal"},className:"
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{7815:e=>{e.exports={style:{fontFamily:"'Lora', 'Lora Fallback'",fontStyle:"normal"},className:"__className_c19f6d",variable:"__variable_c19f6d"}},36791:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_d8ebd1",variable:"__variable_d8ebd1"}},51743:()=>{},66924:e=>{e.exports={style:{fontFamily:"'JetBrains Mono', 'JetBrains Mono Fallback'",fontStyle:"normal"},className:"__className_4dc837",variable:"__variable_4dc837"}},75563:(e,s,o)=>{Promise.resolve().then(o.t.bind(o,36791,23)),Promise.resolve().then(o.t.bind(o,7815,23)),Promise.resolve().then(o.t.bind(o,66924,23)),Promise.resolve().then(o.bind(o,1767)),Promise.resolve().then(o.bind(o,76288)),Promise.resolve().then(o.bind(o,47617)),Promise.resolve().then(o.bind(o,60865)),Promise.resolve().then(o.bind(o,76043)),Promise.resolve().then(o.bind(o,2228)),Promise.resolve().then(o.bind(o,4426)),Promise.resolve().then(o.bind(o,27068)),Promise.resolve().then(o.bind(o,52153)),Promise.resolve().then(o.bind(o,21484)),Promise.resolve().then(o.bind(o,24058)),Promise.resolve().then(o.bind(o,95608)),Promise.resolve().then(o.bind(o,76412)),Promise.resolve().then(o.bind(o,54356)),Promise.resolve().then(o.bind(o,84204)),Promise.resolve().then(o.t.bind(o,51743,23))}},e=>{e.O(0,[98225,58653,73334,97330,88216,74281,75004,60277,1332,15546,21829,99092,95313,82032,72550,28441,93794,77358],()=>e(e.s=75563)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58974,76500],{54695:(e,s,n)=>{Promise.resolve().then(n.bind(n,1767)),Promise.resolve().then(n.bind(n,76288)),Promise.resolve().then(n.bind(n,47617)),Promise.resolve().then(n.bind(n,60865)),Promise.resolve().then(n.bind(n,76043)),Promise.resolve().then(n.bind(n,2228)),Promise.resolve().then(n.bind(n,4426)),Promise.resolve().then(n.bind(n,27068)),Promise.resolve().then(n.bind(n,52153)),Promise.resolve().then(n.bind(n,21484)),Promise.resolve().then(n.bind(n,24058)),Promise.resolve().then(n.bind(n,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58974,76500],{54695:(e,s,n)=>{Promise.resolve().then(n.bind(n,1767)),Promise.resolve().then(n.bind(n,76288)),Promise.resolve().then(n.bind(n,47617)),Promise.resolve().then(n.bind(n,60865)),Promise.resolve().then(n.bind(n,76043)),Promise.resolve().then(n.bind(n,2228)),Promise.resolve().then(n.bind(n,4426)),Promise.resolve().then(n.bind(n,27068)),Promise.resolve().then(n.bind(n,52153)),Promise.resolve().then(n.bind(n,21484)),Promise.resolve().then(n.bind(n,24058)),Promise.resolve().then(n.bind(n,95608)),Promise.resolve().then(n.bind(n,76412)),Promise.resolve().then(n.bind(n,54356)),Promise.resolve().then(n.bind(n,84204))}},e=>{e.O(0,[58653,97330,88216,74281,75004,60277,1332,15546,21829,99092,95313,82032,72550,28441,93794,77358],()=>e(e.s=54695)),_N_E=e.O()}]);
|
package/.next-prod/static/chunks/app/project/{page-b472e7f948959009.js → page-a196e139366e9958.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58974,76500],{54695:(e,s,n)=>{Promise.resolve().then(n.bind(n,1767)),Promise.resolve().then(n.bind(n,76288)),Promise.resolve().then(n.bind(n,47617)),Promise.resolve().then(n.bind(n,60865)),Promise.resolve().then(n.bind(n,76043)),Promise.resolve().then(n.bind(n,2228)),Promise.resolve().then(n.bind(n,4426)),Promise.resolve().then(n.bind(n,27068)),Promise.resolve().then(n.bind(n,52153)),Promise.resolve().then(n.bind(n,21484)),Promise.resolve().then(n.bind(n,24058)),Promise.resolve().then(n.bind(n,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58974,76500],{54695:(e,s,n)=>{Promise.resolve().then(n.bind(n,1767)),Promise.resolve().then(n.bind(n,76288)),Promise.resolve().then(n.bind(n,47617)),Promise.resolve().then(n.bind(n,60865)),Promise.resolve().then(n.bind(n,76043)),Promise.resolve().then(n.bind(n,2228)),Promise.resolve().then(n.bind(n,4426)),Promise.resolve().then(n.bind(n,27068)),Promise.resolve().then(n.bind(n,52153)),Promise.resolve().then(n.bind(n,21484)),Promise.resolve().then(n.bind(n,24058)),Promise.resolve().then(n.bind(n,95608)),Promise.resolve().then(n.bind(n,76412)),Promise.resolve().then(n.bind(n,54356)),Promise.resolve().then(n.bind(n,84204))}},e=>{e.O(0,[58653,97330,88216,74281,75004,60277,1332,15546,21829,99092,95313,82032,72550,28441,93794,77358],()=>e(e.s=54695)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/ba9851c3c22cd980-s.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c8a,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/21350d82a1f187e9-s.woff2) format("woff2");unicode-range:u+0301,u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/c5fe6dc8356a8c31-s.woff2) format("woff2");unicode-range:u+1f??}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/19cfc7226ec3afaa-s.woff2) format("woff2");unicode-range:u+0370-0377,u+037a-037f,u+0384-038a,u+038c,u+038e-03a1,u+03a3-03ff}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/df0a9ae256c0569c-s.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+0300-0301,u+0303-0304,u+0308-0309,u+0323,u+0329,u+1ea0-1ef9,u+20ab}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/8e9860b6e62d6359-s.woff2) format("woff2");unicode-range:u+0100-02ba,u+02bd-02c5,u+02c7-02cc,u+02ce-02d7,u+02dd-02ff,u+0304,u+0308,u+0329,u+1d00-1dbf,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c4,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/e4af272ccee01ff0-s.p.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-family:Inter Fallback;src:local("Arial");ascent-override:90.44%;descent-override:22.52%;line-gap-override:0.00%;size-adjust:107.12%}.__className_d8ebd1{font-family:Inter,Inter Fallback;font-style:normal}.__variable_d8ebd1{--font-inter:"Inter","Inter Fallback"}@font-face{font-family:Lora;font-style:normal;font-weight:400 700;font-display:swap;src:url(/_next/static/media/03b436aa846269de-s.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c8a,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-family:Lora;font-style:normal;font-weight:400 700;font-display:swap;src:url(/_next/static/media/0086f8992871c45b-s.woff2) format("woff2");unicode-range:u+0301,u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-family:Lora;font-style:normal;font-weight:400 700;font-display:swap;src:url(/_next/static/media/ab00a911ac2adf48-s.woff2) format("woff2");unicode-range:u+0302-0303,u+0305,u+0307-0308,u+0310,u+0312,u+0315,u+031a,u+0326-0327,u+032c,u+032f-0330,u+0332-0333,u+0338,u+033a,u+0346,u+034d,u+0391-03a1,u+03a3-03a9,u+03b1-03c9,u+03d1,u+03d5-03d6,u+03f0-03f1,u+03f4-03f5,u+2016-2017,u+2034-2038,u+203c,u+2040,u+2043,u+2047,u+2050,u+2057,u+205f,u+2070-2071,u+2074-209f,u+20d0-20dc,u+20e1,u+20e5-20ef,u+2100-2112,u+2114-2115,u+2117-2121,u+2123-214f,u+2190,u+2192,u+2194-21ae,u+21b0-21e5,u+21f1-21f2,u+21f4-2211,u+2213-2214,u+2216-22ff,u+2308-230b,u+2310,u+2319,u+231c-2321,u+2336-237a,u+237c,u+2395,u+239b-23b7,u+23d0,u+23dc-23e1,u+2474-2475,u+25af,u+25b3,u+25b7,u+25bd,u+25c1,u+25ca,u+25cc,u+25fb,u+266d-266f,u+27c0-27ff,u+2900-2aff,u+2b0e-2b11,u+2b30-2b4c,u+2bfe,u+3030,u+ff5b,u+ff5d,u+1d400-1d7ff,u+1ee??}@font-face{font-family:Lora;font-style:normal;font-weight:400 700;font-display:swap;src:url(/_next/static/media/36008747766f78c6-s.woff2) format("woff2");unicode-range:u+0001-000c,u+000e-001f,u+007f-009f,u+20dd-20e0,u+20e2-20e4,u+2150-218f,u+2190,u+2192,u+2194-2199,u+21af,u+21e6-21f0,u+21f3,u+2218-2219,u+2299,u+22c4-22c6,u+2300-243f,u+2440-244a,u+2460-24ff,u+25a0-27bf,u+28??,u+2921-2922,u+2981,u+29bf,u+29eb,u+2b??,u+4dc0-4dff,u+fff9-fffb,u+10140-1018e,u+10190-1019c,u+101a0,u+101d0-101fd,u+102e0-102fb,u+10e60-10e7e,u+1d2c0-1d2d3,u+1d2e0-1d37f,u+1f0??,u+1f100-1f1ae,u+1f1e6-1f1ff,u+1f30d-1f30f,u+1f315,u+1f31c,u+1f31e,u+1f320-1f32c,u+1f336,u+1f378,u+1f37d,u+1f382,u+1f393-1f39f,u+1f3a7-1f3a8,u+1f3ac-1f3af,u+1f3c2,u+1f3c4-1f3c6,u+1f3ca-1f3ce,u+1f3d4-1f3e0,u+1f3ed,u+1f3f1-1f3f3,u+1f3f5-1f3f7,u+1f408,u+1f415,u+1f41f,u+1f426,u+1f43f,u+1f441-1f442,u+1f444,u+1f446-1f449,u+1f44c-1f44e,u+1f453,u+1f46a,u+1f47d,u+1f4a3,u+1f4b0,u+1f4b3,u+1f4b9,u+1f4bb,u+1f4bf,u+1f4c8-1f4cb,u+1f4d6,u+1f4da,u+1f4df,u+1f4e3-1f4e6,u+1f4ea-1f4ed,u+1f4f7,u+1f4f9-1f4fb,u+1f4fd-1f4fe,u+1f503,u+1f507-1f50b,u+1f50d,u+1f512-1f513,u+1f53e-1f54a,u+1f54f-1f5fa,u+1f610,u+1f650-1f67f,u+1f687,u+1f68d,u+1f691,u+1f694,u+1f698,u+1f6ad,u+1f6b2,u+1f6b9-1f6ba,u+1f6bc,u+1f6c6-1f6cf,u+1f6d3-1f6d7,u+1f6e0-1f6ea,u+1f6f0-1f6f3,u+1f6f7-1f6fc,u+1f700-1f80b,u+1f810-1f847,u+1f850-1f859,u+1f860-1f887,u+1f890-1f8ad,u+1f8b0-1f8bb,u+1f8c0-1f8c1,u+1f8d0-1f8d8,u+1f900-1f90b,u+1f93b,u+1f946,u+1f984,u+1f996,u+1f9e9,u+1fa00-1fa6f,u+1fa70-1fa7c,u+1fa80-1fac6,u+1fac8,u+1facc-1fadd,u+1fadf-1faeb,u+1faef-1fafa,u+1fb??}@font-face{font-family:Lora;font-style:normal;font-weight:400 700;font-display:swap;src:url(/_next/static/media/6d38f9d4e0f4772b-s.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+0300-0301,u+0303-0304,u+0308-0309,u+0323,u+0329,u+1ea0-1ef9,u+20ab}@font-face{font-family:Lora;font-style:normal;font-weight:400 700;font-display:swap;src:url(/_next/static/media/08aedeceaf1dcd57-s.woff2) format("woff2");unicode-range:u+0100-02ba,u+02bd-02c5,u+02c7-02cc,u+02ce-02d7,u+02dd-02ff,u+0304,u+0308,u+0329,u+1d00-1dbf,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c4,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-family:Lora;font-style:normal;font-weight:400 700;font-display:swap;src:url(/_next/static/media/5c0c2bcbaa4149ca-s.p.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-family:Lora Fallback;src:local("Times New Roman");ascent-override:87.33%;descent-override:23.78%;line-gap-override:0.00%;size-adjust:115.20%}.__className_c19f6d{font-family:Lora,Lora Fallback;font-style:normal}.__variable_c19f6d{--font-lora:"Lora","Lora Fallback"}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(/_next/static/media/886030b0b59bc5a7-s.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c8a,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(/_next/static/media/0aa834ed78bf6d07-s.woff2) format("woff2");unicode-range:u+0301,u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(/_next/static/media/67957d42bae0796d-s.woff2) format("woff2");unicode-range:u+0370-0377,u+037a-037f,u+0384-038a,u+038c,u+038e-03a1,u+03a3-03ff}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(/_next/static/media/f911b923c6adde36-s.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+0300-0301,u+0303-0304,u+0308-0309,u+0323,u+0329,u+1ea0-1ef9,u+20ab}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(/_next/static/media/939c4f875ee75fbb-s.woff2) format("woff2");unicode-range:u+0100-02ba,u+02bd-02c5,u+02c7-02cc,u+02ce-02d7,u+02dd-02ff,u+0304,u+0308,u+0329,u+1d00-1dbf,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c4,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:100 800;font-display:swap;src:url(/_next/static/media/bb3ef058b751a6ad-s.p.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-family:JetBrains Mono Fallback;src:local("Arial");ascent-override:75.79%;descent-override:22.29%;line-gap-override:0.00%;size-adjust:134.59%}.__className_4dc837{font-family:JetBrains Mono,JetBrains Mono Fallback;font-style:normal}.__variable_4dc837{--font-jetbrains-mono:"JetBrains Mono","JetBrains Mono Fallback"}
|