@yuriai/web 0.3.2 → 0.3.3-beta.2

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.
Files changed (85) hide show
  1. package/dist/assets/{AgentAvatar-DmvbnnMh.js → AgentAvatar-tFfpSF5F.js} +1 -1
  2. package/dist/assets/{AssistantConversationSurface-DxmQrzax.js → AssistantConversationSurface-B-iO-AUW.js} +3 -3
  3. package/dist/assets/{AssistantSessionCard-CsZIdhOH.js → AssistantSessionCard-DTPufGP2.js} +2 -2
  4. package/dist/assets/{AssistantUnreadBadge-0K84uUof.js → AssistantUnreadBadge-BV2cbiJo.js} +1 -1
  5. package/dist/assets/{AssistantView-eo7zU0tW.js → AssistantView-iKt4ZcoR.js} +1 -1
  6. package/dist/assets/{DiagramView-CwgPnPU8.js → DiagramView-SHoXhtXa.js} +1 -1
  7. package/dist/assets/{FadeInOnReveal-CIabuv8E.js → FadeInOnReveal-4E61VUmD.js} +1 -1
  8. package/dist/assets/{GuiPluginPage-CBWlpM7-.js → GuiPluginPage-Bt5j7vkr.js} +1 -1
  9. package/dist/assets/{GuiPluginSurface-4piMFmC2.js → GuiPluginSurface-Bs9Pauc8.js} +1 -1
  10. package/dist/assets/{GuiPluginWindow-D02tLdop.js → GuiPluginWindow-cnUkWFge.js} +1 -1
  11. package/dist/assets/{Icon-Br-W35tz.js → Icon-DebSeH2D.js} +1 -1
  12. package/dist/assets/{ImageLoadingPlaceholder-EHe_20yz.js → ImageLoadingPlaceholder-BBMhxtKr.js} +1 -1
  13. package/dist/assets/{LoadingImage-DNt-_HCJ.js → LoadingImage-6BZsPXXb.js} +1 -1
  14. package/dist/assets/MarkdownRenderer-Bjl6sXps.js +2 -0
  15. package/dist/assets/{MarkdownRendererImpl-CxfAdy1l.js → MarkdownRendererImpl-tZSoVcrU.js} +1 -1
  16. package/dist/assets/{MarkstreamRendererImpl-B1ALcl04.js → MarkstreamRendererImpl-Br2_lE4f.js} +1 -1
  17. package/dist/assets/{MobileDetailNavigation-DNLOs1n6.js → MobileDetailNavigation-B7vAsqVU.js} +1 -1
  18. package/dist/assets/{MobileResizableSheet-Bp_8Cf4j.js → MobileResizableSheet-BJs0jEqn.js} +1 -1
  19. package/dist/assets/{MobileShareBridge-9zfdEyQ_.js → MobileShareBridge-Cb9GvxGv.js} +1 -1
  20. package/dist/assets/{MobileSurface-B1O-lCca.js → MobileSurface-BaT1L70D.js} +1 -1
  21. package/dist/assets/{MultiRunWindow-DMvB8O02.js → MultiRunWindow-DPM25lxz.js} +1 -1
  22. package/dist/assets/{OnboardingScreen-DgxRaKDc.js → OnboardingScreen-D7ns1Tb2.js} +1 -1
  23. package/dist/assets/{OverlayScrollbar-CcX4ZP8W.js → OverlayScrollbar-B1PH1Jtv.js} +1 -1
  24. package/dist/assets/{RemoteAssistantSessionCard-BJz_SKef.js → RemoteAssistantSessionCard-BLp9NZhL.js} +1 -1
  25. package/dist/assets/{SettingsView-D7Kb5iGY.js → SettingsView-CaC2DI4Z.js} +1 -1
  26. package/dist/assets/{SettingsWindow-YzVAr8Bo.js → SettingsWindow-gVPRXQDh.js} +1 -1
  27. package/dist/assets/{SetupTourDialog-Dw9q3oII.js → SetupTourDialog-BoQIvdEP.js} +1 -1
  28. package/dist/assets/{TerminalView-DZChxb-F.js → TerminalView-CxlIRxha.js} +1 -1
  29. package/dist/assets/{ToolOutputDialog-2F74CchZ.js → ToolOutputDialog-Bsx1wpVW.js} +1 -1
  30. package/dist/assets/{VoiceSettings-CJh5q7QP.js → VoiceSettings-DhA9feRU.js} +1 -1
  31. package/dist/assets/{capgoAdapter-Q9jzJN69.js → capgoAdapter-vj-M8YQp.js} +1 -1
  32. package/dist/assets/{checkbox-CqeGKP3Z.js → checkbox-DVMeOiMB.js} +1 -1
  33. package/dist/assets/{collapsible-BSOetNHq.js → collapsible-D_R6x2Q_.js} +1 -1
  34. package/dist/assets/{context-menu-r_DjszgU.js → context-menu-BFDbtdmK.js} +1 -1
  35. package/dist/assets/{diagram-CxwT-HHn.js → diagram-CrjNCLmc.js} +1 -1
  36. package/dist/assets/{dialog-rXqw-6ab.js → dialog-CHzvxSP4.js} +1 -1
  37. package/dist/assets/{fileMentionTouchSelection-C0O4_Efn.js → fileMentionTouchSelection-D9GbR7zD.js} +1 -1
  38. package/dist/assets/{gitApi-BA93t0ww.js → gitApi-i_uT8MNk.js} +1 -1
  39. package/dist/assets/{input-9Y3tNEd9.js → input-Ck9_Qln_.js} +1 -1
  40. package/dist/assets/{insertionBoundaries-Dl5RMmA3.js → insertionBoundaries-BFmZupL3.js} +1 -1
  41. package/dist/assets/{main-Cli25Koo.js → main-RbzEHxam.js} +4 -4
  42. package/dist/assets/{main-Dj1N_rUJ.js → main-_RMi6lwy.js} +2 -2
  43. package/dist/assets/{markdownHeightCache-CaBnqn2C.js → markdownHeightCache-CnLR3-I2.js} +1 -1
  44. package/dist/assets/{mcpQueries-DCgOzZ7g.js → mcpQueries-MmcRk0_G.js} +1 -1
  45. package/dist/assets/{miniChat-Ct0NeLs3.js → miniChat-CEE6OnLk.js} +2 -2
  46. package/dist/assets/{mobile-Kg6aWex1.js → mobile-Cc6EYN5S.js} +2 -2
  47. package/dist/assets/{mobileBackNavigation-XjzoONfU.js → mobileBackNavigation-C6UPWCkI.js} +1 -1
  48. package/dist/assets/{mobileConnections-plT2Z1fc.js → mobileConnections-D8TC3-vN.js} +2 -2
  49. package/dist/assets/{multirun-1YatqupB.js → multirun-BJgG4Ymw.js} +1 -1
  50. package/dist/assets/{native-config-C0CpO-0Q.js → native-config-JMwpif8a.js} +1 -1
  51. package/dist/assets/{navigation-Bz_aROXw.js → navigation-toBhZ-X8.js} +1 -1
  52. package/dist/assets/{openRemoteProjectSession-9kfNj2Jy.js → openRemoteProjectSession-BD2tHXKw.js} +1 -1
  53. package/dist/assets/{projectMeta-CBxwAjHm.js → projectMeta-Bh7dUtdB.js} +1 -1
  54. package/dist/assets/{pwa-1EqcEjis.js → pwa-B2AKIaf6.js} +1 -1
  55. package/dist/assets/{queue-abort-optimistic-C6AsLSmI.js → queue-abort-optimistic-BizaMpYT.js} +1 -1
  56. package/dist/assets/{react-B_qpic0Y.js → react-DeCzn0Uc.js} +1 -1
  57. package/dist/assets/{readiness-DcOz5lOE.js → readiness-CekKZ6au.js} +2 -2
  58. package/dist/assets/{reference-history-DOMZlJml.js → reference-history-cPgFTsku.js} +1 -1
  59. package/dist/assets/{remoteSessionReference-Cn7Wzrg6.js → remoteSessionReference-Da4ThgtH.js} +1 -1
  60. package/dist/assets/{renderElectronMiniChatApp-B-hPtyBl.js → renderElectronMiniChatApp-CmmEVsXV.js} +2 -2
  61. package/dist/assets/{renderMobileApp-CuOXMDN3.js → renderMobileApp-D1D1s_ia.js} +4 -4
  62. package/dist/assets/{runtimeConfig-C1A5pejN.js → runtimeConfig-CPU1CoUI.js} +1 -1
  63. package/dist/assets/{runtimeEndpointReset-oiLvIGYI.js → runtimeEndpointReset-Bwa7I9vS.js} +3 -3
  64. package/dist/assets/{select-CK1DjdEi.js → select-BnDfHG_T.js} +1 -1
  65. package/dist/assets/{sessionLookup-CmckqEe_.js → sessionLookup-mQtUvdep.js} +1 -1
  66. package/dist/assets/{sortable-tabs-strip-Bd9uV_sY.js → sortable-tabs-strip-BwnT5maB.js} +1 -1
  67. package/dist/assets/{speechSettingsQueries-BHZs2Dyf.js → speechSettingsQueries-mH-OoFPq.js} +1 -1
  68. package/dist/assets/src-2lmG4z55.css +2 -0
  69. package/dist/assets/{textarea-DvCd0eUo.js → textarea-CVswImHY.js} +1 -1
  70. package/dist/assets/{tooltip-B93KmoPh.js → tooltip-DovnVenD.js} +1 -1
  71. package/dist/assets/types-CnPxR5yQ.js +2 -0
  72. package/dist/assets/{useAppFontEffects-EXiDcoNt.js → useAppFontEffects-wm0ojvh7.js} +5 -5
  73. package/dist/assets/{useDesktopWindowControlsLayout-4TLDMOLv.js → useDesktopWindowControlsLayout-BBizNJUb.js} +1 -1
  74. package/dist/assets/{useEffectiveDirectory-DFe0GivQ.js → useEffectiveDirectory-BN5qbhev.js} +1 -1
  75. package/dist/assets/{useMobileNavigationStore-BtHQN423.js → useMobileNavigationStore-oveTY29a.js} +4 -4
  76. package/dist/assets/{usePluginsStore-Ch1DaoBM.js → usePluginsStore-DErHgEFY.js} +1 -1
  77. package/dist/assets/{useProjectRuntimeAPIs-CnTyVRex.js → useProjectRuntimeAPIs-B-ShHy6s.js} +1 -1
  78. package/dist/assets/{useStreamingTextThrottle-DAr0FPKI.js → useStreamingTextThrottle-BOvHQRrH.js} +1 -1
  79. package/dist/index.html +6 -6
  80. package/dist/mini-chat.html +6 -6
  81. package/dist/mobile.html +2 -2
  82. package/package.json +1 -1
  83. package/dist/assets/MarkdownRenderer-BjRyxBUx.js +0 -2
  84. package/dist/assets/src-aLILBedG.css +0 -2
  85. package/dist/assets/types-ClAbMq1_.js +0 -2
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,Q as n,et as r,ot as i,rt as a,st as o,tt as s}from"./vendor-base-ui-fom6orB6.js";import{n as c}from"./vendor-react-D5BntRmA.js";import{t as l}from"./i18n-BvjeIWrT.js";import{Rn as u}from"./useMobileNavigationStore-BtHQN423.js";import{t as d}from"./SettingsView-D7Kb5iGY.js";var f=c(),p=e(o(),1),m=i(),h=e=>{let i=(0,f.c)(19),{open:o,onOpenChange:c}=e,{t:h}=l(),_=p.useId(),v=g,y;i[0]===c?y=i[1]:(y=e=>{!e&&v()||c(e)},i[0]=c,i[1]=y);let b;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,m.jsx)(a,{className:u(`fixed inset-0 z-50 bg-black/50 dark:bg-black/75`,`transition-opacity duration-150 ease-out`,`data-[starting-style]:opacity-0 data-[ending-style]:opacity-0`)}),i[2]=b):b=i[2];let x;i[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=u(`relative pointer-events-auto`,`w-[90vw] max-w-[1200px] h-[85vh] max-h-[900px]`,`rounded-xl border shadow-none overflow-hidden origin-center`,`bg-background`,`transition-all duration-150 ease-out`,`data-[starting-style]:opacity-0 data-[starting-style]:scale-[0.98]`,`data-[ending-style]:opacity-0 data-[ending-style]:scale-[0.98]`,`data-[nested-dialog-open]:brightness-[0.55] dark:data-[nested-dialog-open]:brightness-[0.4]`),i[3]=x):x=i[3];let S;i[4]===h?S=i[5]:(S=h(`settings.window.description`),i[4]=h,i[5]=S);let C;i[6]!==_||i[7]!==S?(C=(0,m.jsx)(s,{id:_,className:`sr-only`,children:S}),i[6]=_,i[7]=S,i[8]=C):C=i[8];let w;i[9]===c?w=i[10]:(w=(0,m.jsx)(d,{onClose:()=>c(!1),isWindowed:!0}),i[9]=c,i[10]=w);let T;i[11]!==_||i[12]!==C||i[13]!==w?(T=(0,m.jsxs)(t,{children:[b,(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center pointer-events-none`,children:(0,m.jsxs)(r,{"aria-describedby":_,className:x,children:[C,w]})})]}),i[11]=_,i[12]=C,i[13]=w,i[14]=T):T=i[14];let E;return i[15]!==o||i[16]!==y||i[17]!==T?(E=(0,m.jsx)(n,{open:o,onOpenChange:y,children:T}),i[15]=o,i[16]=y,i[17]=T,i[18]=E):E=i[18],E};function g(){return typeof document>`u`?!1:!!document.querySelector(`[data-slot="dropdown-menu-content"][data-open], [data-slot="select-content"][data-open]`)}export{h as SettingsWindow};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,Q as n,et as r,ot as i,rt as a,st as o,tt as s}from"./vendor-base-ui-fom6orB6.js";import{n as c}from"./vendor-react-D5BntRmA.js";import{t as l}from"./i18n-BvjeIWrT.js";import{Rn as u}from"./useMobileNavigationStore-oveTY29a.js";import{t as d}from"./SettingsView-CaC2DI4Z.js";var f=c(),p=e(o(),1),m=i(),h=e=>{let i=(0,f.c)(19),{open:o,onOpenChange:c}=e,{t:h}=l(),_=p.useId(),v=g,y;i[0]===c?y=i[1]:(y=e=>{!e&&v()||c(e)},i[0]=c,i[1]=y);let b;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,m.jsx)(a,{className:u(`fixed inset-0 z-50 bg-black/50 dark:bg-black/75`,`transition-opacity duration-150 ease-out`,`data-[starting-style]:opacity-0 data-[ending-style]:opacity-0`)}),i[2]=b):b=i[2];let x;i[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=u(`relative pointer-events-auto`,`w-[90vw] max-w-[1200px] h-[85vh] max-h-[900px]`,`rounded-xl border shadow-none overflow-hidden origin-center`,`bg-background`,`transition-all duration-150 ease-out`,`data-[starting-style]:opacity-0 data-[starting-style]:scale-[0.98]`,`data-[ending-style]:opacity-0 data-[ending-style]:scale-[0.98]`,`data-[nested-dialog-open]:brightness-[0.55] dark:data-[nested-dialog-open]:brightness-[0.4]`),i[3]=x):x=i[3];let S;i[4]===h?S=i[5]:(S=h(`settings.window.description`),i[4]=h,i[5]=S);let C;i[6]!==_||i[7]!==S?(C=(0,m.jsx)(s,{id:_,className:`sr-only`,children:S}),i[6]=_,i[7]=S,i[8]=C):C=i[8];let w;i[9]===c?w=i[10]:(w=(0,m.jsx)(d,{onClose:()=>c(!1),isWindowed:!0}),i[9]=c,i[10]=w);let T;i[11]!==_||i[12]!==C||i[13]!==w?(T=(0,m.jsxs)(t,{children:[b,(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center pointer-events-none`,children:(0,m.jsxs)(r,{"aria-describedby":_,className:x,children:[C,w]})})]}),i[11]=_,i[12]=C,i[13]=w,i[14]=T):T=i[14];let E;return i[15]!==o||i[16]!==y||i[17]!==T?(E=(0,m.jsx)(n,{open:o,onOpenChange:y,children:T}),i[15]=o,i[16]=y,i[17]=T,i[18]=E):E=i[18],E};function g(){return typeof document>`u`?!1:!!document.querySelector(`[data-slot="dropdown-menu-content"][data-open], [data-slot="select-content"][data-open]`)}export{h as SettingsWindow};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-DEPKHgdL.js";import{ot as r,st as i}from"./vendor-base-ui-fom6orB6.js";import{n as a}from"./vendor-react-D5BntRmA.js";import{s as o}from"./vendor-tanstack-react-query-ChSd65dm.js";import{q as s}from"./runtime-file-resource-CKQQEwNv.js";import{r as c}from"./vendor-reactuses-core-B8s-Rcd-.js";import{t as ee}from"./i18n-BvjeIWrT.js";import{Fa as l,In as u,Rn as d,Zi as f}from"./useMobileNavigationStore-BtHQN423.js";import{n as p}from"./Icon-Br-W35tz.js";import{a as m,n as h,o as g,t as _}from"./dialog-rXqw-6ab.js";import{t as v}from"./checkbox-CqeGKP3Z.js";import{t as y}from"./YuriLogo-BKdnDJwl.js";import{n as b}from"./MarkdownRenderer-BjRyxBUx.js";import{g as x,h as S,l as C,p as w}from"./select-CK1DjdEi.js";import{n as T}from"./speechSettingsQueries-BHZs2Dyf.js";import{n as E,t as D}from"./YuriWordmark-D2e-o9nW.js";import{a as O,c as k,f as A,n as j,r as M,t as N}from"./usePluginsStore-Ch1DaoBM.js";import{c as P,i as F,n as I,r as L,s as R,t as z}from"./VoiceSettings-CJh5q7QP.js";import{a as B,c as te,d as ne,l as V,o as H,s as re,t as U,u as W}from"./historyImportQueries-DiGQ8duS.js";var G=e(i(),1),K=a(),q=[{name:`Magpie`,spec:`opencode-magpie-plugin`},{name:`Eficy`,spec:`@eficy/opencode2-plugin`},{name:`yee-profile`,spec:`@yee94/opencode-profile`}];function ie(e,t){return e.some(e=>e.parsedKind===`npm`&&R(e.spec).name===t)}async function J(e,t){let n=[];for(let r of new Set(e)){if(!t.current())throw Error(`Runtime changed`);try{let e=await t.list();if(!t.current())throw Error(`Runtime changed`);ie(e,r)||(await t.create(r)).ok||n.push(r)}catch{n.push(r)}}if(!t.current())throw Error(`Runtime changed`);return{failed:n}}function ae(e,r,i){let a=t(),o=n();return J(e,{current:()=>!i.aborted&&o===n()&&a===t(),list:async()=>(await s.fetchQuery({...M(r,a),staleTime:0})).entries,create:e=>N.getState().createEntry({spec:e,scope:`user`})})}var Y=`data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%20Code%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M20.998%2010.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6%2010.949h1.488V8.102H6v2.847zm10.51%200H18V8.102h-1.49v2.847z'%20fill='%23D97757'%20fill-rule='evenodd'/%3e%3c/svg%3e`,X=`data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20d='M19.503%200H4.496A4.496%204.496%200%20000%204.496v15.007A4.496%204.496%200%20004.496%2024h15.007A4.496%204.496%200%200024%2019.503V4.496A4.496%204.496%200%200019.503%200z'%20fill='%23fff'/%3e%3cpath%20d='M9.064%203.344a4.578%204.578%200%20012.285-.312c1%20.115%201.891.54%202.673%201.275.01.01.024.017.037.021a.09.09%200%2000.043%200%204.55%204.55%200%20013.046.275l.047.022.116.057a4.581%204.581%200%20012.188%202.399c.209.51.313%201.041.315%201.595a4.24%204.24%200%2001-.134%201.223.123.123%200%2000.03.115c.594.607.988%201.33%201.183%202.17.289%201.425-.007%202.71-.887%203.854l-.136.166a4.548%204.548%200%2001-2.201%201.388.123.123%200%2000-.081.076c-.191.551-.383%201.023-.74%201.494-.9%201.187-2.222%201.846-3.711%201.838-1.187-.006-2.239-.44-3.157-1.302a.107.107%200%2000-.105-.024c-.388.125-.78.143-1.204.138a4.441%204.441%200%2001-1.945-.466%204.544%204.544%200%2001-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81%205.81%200%2001-.37-.961%204.582%204.582%200%2001-.014-2.298.124.124%200%2000.006-.056.085.085%200%2000-.027-.048%204.467%204.467%200%2001-1.034-1.651%203.896%203.896%200%2001-.251-1.192%205.189%205.189%200%2001.141-1.6c.337-1.112.982-1.985%201.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098%200%2000.065-.066%204.51%204.51%200%2001.829-1.615%204.535%204.535%200%20011.837-1.388zm3.482%2010.565a.637.637%200%20000%201.272h3.636a.637.637%200%20100-1.272h-3.636zM8.462%209.23a.637.637%200%2000-1.106.631l1.272%202.224-1.266%202.136a.636.636%200%20101.095.649l1.454-2.455a.636.636%200%2000.005-.64L8.462%209.23z'%20fill='url(%23codex-gradient)'/%3e%3cdefs%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='codex-gradient'%20x1='12'%20x2='12'%20y1='3'%20y2='21'%3e%3cstop%20stop-color='%23B1A7FF'/%3e%3cstop%20offset='.5'%20stop-color='%237A9DFF'/%3e%3cstop%20offset='1'%20stop-color='%233941FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e`,Z=r(),oe={claude:Y,codex:X,cursor:x,dsh:S,opencode:w};function se({onBusy:e,directory:r=null,onPrimaryChange:i,onComplete:a}){let{t:o,locale:s}=ee(),l=t(),f=n(),[m,h]=G.useState([]),[g,_]=G.useState(!1),[y,b]=G.useState(null),x=H(),S=x.data?.state===`running`,C=re(x.isSuccess&&!S),w=te(C.data?.id,r,`${x.data?.id??``}:${x.data?.state??``}`,!S&&!C.isFetching&&!C.isError),T=G.useRef(null),E=G.useRef(!1),D=G.useRef(null),O=G.useRef(null),k=c(e),A=c(e=>i?.(e)),j=c((e,t)=>h(n=>t?n.includes(e)?n:[...n,e]:n.filter(t=>t!==e)));G.useEffect(()=>{let e=new AbortController;return T.current=e,()=>{e.abort(),k(!1)}},[l,f,k]);let M=G.useMemo(()=>{let e=V.map(e=>({...e,sessions:[]}));for(let t of C.data?.sessions??[]){let n=e.find(e=>e.id===t.source);n&&n.sessions.length<5&&n.sessions.push(t)}return e.filter(e=>e.sessions.length)},[C.data]),N=!!(D.current&&x.data?.id===D.current&&ne(x.data)),P=g||!S&&!N&&(C.isFetching||!C.data||C.isError||x.isError);G.useEffect(()=>{A({disabled:P,background:S})},[P,S,A]);let F=()=>!T.current?.signal.aborted&&l===t()&&f===n(),I=async e=>{if(!(E.current||!T.current)){E.current=!0,_(!0),k(!0),b(null);try{await e(T.current.signal)}catch(e){F()&&b(e instanceof Error&&/^[a-z_]+$/.test(e.message)?e.message:`import_failed`)}finally{E.current=!1,F()&&(_(!1),k(!1))}}},L=()=>I(async e=>{if(P)return;if(S||N){F()&&a?.();return}if(!m.length){F()&&a?.();return}let t=await B(m,r,e,l,f);F()&&(D.current=t.id,O.current?.scrollIntoView({block:`start`}))}),R=C.error??x.error,z=y||(R instanceof Error&&/^[a-z_]+$/.test(R.message)?R.message:C.isError||x.isError?`import_failed`:null),K=G.useMemo(()=>new Intl.DateTimeFormat(s,{month:`short`,day:`numeric`}),[s]),q=x.data?W(x.data):null,ie=G.useMemo(()=>new Intl.NumberFormat(s),[s]),J=(e,t)=>{let n=C.data?.counts?.[e],r=n?.value;if(r==null||C.isError)return null;let i=ie.format(r),a=o(n?.approximate?`historyImport.estimatedCount`:`historyImport.sourceCount`,{count:i});return(0,Z.jsx)(`span`,{id:t,"data-history-count":e,className:`yuri-import-source-count`,title:a,"aria-label":a,children:C.isFetching?(0,Z.jsx)(p,{name:`loader-4`,className:`size-3 animate-spin`,"aria-label":o(`historyImport.scanning`)}):`${n?.approximate?`≈ `:``}${i}`})};return(0,Z.jsxs)(`form`,{id:`yuri-tour-import`,className:`yuri-history-import`,"data-history-import":!0,onSubmit:e=>{e.preventDefault(),L()},children:[(0,Z.jsx)(`h2`,{ref:O,className:`yuri-import-heading`,children:o(`historyImport.heading`)}),(0,Z.jsx)(`p`,{className:`yuri-import-subtitle`,children:o(`historyImport.deduplication`)}),x.data&&!ne(x.data)&&(S||D.current===x.data.id)&&(0,Z.jsxs)(`div`,{className:`yuri-import-job`,role:`status`,children:[(0,Z.jsx)(p,{name:S?`loader-4`:`error-warning`,className:d(`size-4`,S&&`animate-spin`)}),(0,Z.jsx)(`span`,{children:o(S&&q?`historyImport.phase.${q.phase}`:`historyImport.state.${x.data.state}`)}),q&&q.total>0&&(0,Z.jsxs)(`span`,{className:`tabular-nums`,children:[q.completed,` / `,q.total]}),S&&(0,Z.jsx)(u,{variant:`ghost`,size:`icon`,disabled:g,"aria-label":o(`historyImport.cancel`),title:o(`historyImport.cancel`),onClick:()=>void I(async e=>{await U(x.data.id,e,l),F()&&await x.refetch()}),children:(0,Z.jsx)(p,{name:`stop`,className:`size-4`})}),S&&q&&(0,Z.jsx)(`progress`,{value:q.total?q.completed:void 0,max:q.total||1,"aria-label":o(`historyImport.progress`)}),x.data.progress?.code&&(0,Z.jsxs)(`p`,{role:`alert`,children:[o(`historyImport.failed`),` `,(0,Z.jsx)(`code`,{children:x.data.progress.code})]}),x.data.results.some(e=>e.status===`failed`||e.project===`failed`||e.index===`failed`)&&(0,Z.jsxs)(`p`,{role:`alert`,children:[o(`historyImport.failed`),[...new Set(x.data.results.filter(e=>e.status===`failed`&&e.code).map(e=>e.code))].map(e=>(0,Z.jsxs)(`code`,{children:[` `,e]},e))]})]}),(0,Z.jsx)(`div`,{className:`yuri-import-source-grid`,"aria-label":o(`historyImport.sources`),children:V.map(e=>{let t=C.data?.installations?.[e.id],n=o(t===!0?`historyImport.installed`:t===!1?`historyImport.notDetected`:`historyImport.installationUnknown`),r=C.data?.counts?.[e.id]?.value!=null&&!C.isError?` history-import-count-${e.id}`:``;return(0,Z.jsxs)(u,{variant:`ghost`,"data-history-source":e.id,className:d(`yuri-import-source-card`,(e.id===`cursor`||e.id===`opencode`)&&`yuri-import-source-cursor`),disabled:g||S,"aria-pressed":m.includes(e.id),"aria-label":e.name,"aria-describedby":`history-import-installed-${e.id}${r}`,onClick:()=>j(e.id,!m.includes(e.id)),children:[(0,Z.jsxs)(`span`,{className:`yuri-import-logo-wrap`,children:[(0,Z.jsx)(`img`,{src:oe[e.id],alt:``,draggable:!1,className:`yuri-import-source-logo`}),(0,Z.jsx)(`span`,{id:`history-import-installed-${e.id}`,role:`img`,"aria-label":n,title:n,"data-installed":t===!0?`true`:t===!1?`false`:`unknown`,className:`yuri-import-installation`})]}),(0,Z.jsx)(`span`,{className:`yuri-import-source-name`,children:e.name}),J(e.id,`history-import-count-${e.id}`),(0,Z.jsx)(`span`,{className:`yuri-import-source-check`,"aria-hidden":`true`,children:(0,Z.jsx)(p,{name:`check`,className:`size-3`})})]},e.id)})}),z&&(0,Z.jsxs)(`div`,{role:`alert`,className:`yuri-tour-feedback`,children:[(0,Z.jsxs)(`p`,{children:[o(z===`history_import_unsupported`?`historyImport.unsupported`:`historyImport.failed`),` `,(0,Z.jsx)(`code`,{children:z})]}),(C.isError||x.isError)&&(0,Z.jsx)(u,{variant:`ghost`,size:`xs`,disabled:C.isFetching||x.isFetching,onClick:()=>{Promise.all([C.refetch(),x.refetch()])},children:o(`settings.plugins.status.retry`)})]}),C.data&&!C.isFetching&&!C.isError&&!C.data.sessions.length&&!C.data.errors.length&&(0,Z.jsx)(`p`,{className:`yuri-tour-feedback`,children:o(`historyImport.empty`)}),M.length>0&&(0,Z.jsxs)(`section`,{"aria-label":o(`historyImport.sessions`),children:[(0,Z.jsx)(`div`,{className:`yuri-import-list-heading`,children:o(`historyImport.sessions`)}),(0,Z.jsx)(`div`,{className:`yuri-import-preview-groups`,children:M.map(e=>(0,Z.jsxs)(`section`,{"aria-label":e.name,"data-source-selected":m.includes(e.id),children:[(0,Z.jsxs)(`div`,{className:`yuri-import-preview-heading`,children:[(0,Z.jsx)(`h3`,{children:e.name}),J(e.id),(0,Z.jsx)(v,{checked:m.includes(e.id),disabled:g||S,ariaLabel:e.name,onChange:t=>j(e.id,t)})]}),(0,Z.jsx)(`ul`,{className:`yuri-import-session-grid`,children:e.sessions.map(e=>(0,Z.jsxs)(`li`,{"data-history-session":e.key,className:d(`yuri-import-session-card`,(e.source===`cursor`||e.source===`opencode`)&&`yuri-import-source-cursor`),title:e.title,children:[(0,Z.jsx)(`img`,{src:oe[e.source],alt:``,draggable:!1,className:`yuri-import-session-logo`}),(0,Z.jsxs)(`span`,{className:`yuri-import-session-copy`,children:[(0,Z.jsxs)(`span`,{className:`yuri-import-session-heading`,children:[(0,Z.jsx)(`span`,{className:`yuri-import-session-title`,children:e.title}),!w.isError&&w.data?.states[e.key]===`imported`&&(0,Z.jsx)(`span`,{className:`yuri-import-session-imported`,"data-history-imported":!0,children:o(`historyImport.alreadyImported`)}),e.updated&&e.updated>0?(0,Z.jsx)(`time`,{dateTime:new Date(e.updated).toISOString(),children:K.format(e.updated)}):null]}),e.excerpt&&(0,Z.jsx)(`span`,{className:`yuri-import-session-excerpt`,children:e.excerpt})]})]},e.key))})]},e.id))})]})]})}var Q=q.map(e=>e.spec),ce=[`tour.models`,`tour.plugins`,`tour.import`,`tour.voice`],le=[{id:`openai`,name:`OpenAI`},{id:`anthropic`,name:`Anthropic`},{id:`google`,name:`Google Gemini`},{id:`github-copilot`,name:`GitHub Copilot`},{id:`deepseek`,name:`DeepSeek`},{id:`openrouter`,name:`OpenRouter`}];function ue(e){let t=(0,K.c)(48),{index:n,info:r,installed:i,selected:a,onSelect:o,onReadme:s}=e,{t:c}=ee(),l=q[n],f=r?.kind===`npm-ok`?r:void 0,m=a&&`yuri-tour-card-selected`,h;t[0]===m?h=t[1]:(h=d(`yuri-tour-plugin yuri-tour-select-card`,m),t[0]=m,t[1]=h);let g;t[2]===a?g=t[3]:(g=a&&(0,Z.jsx)(p,{name:`check`,className:`size-5`}),t[2]=a,t[3]=g);let _;t[4]===g?_=t[5]:(_=(0,Z.jsx)(`span`,{className:`yuri-tour-card-check`,"aria-hidden":`true`,children:g}),t[4]=g,t[5]=_);let v;t[6]!==o||t[7]!==l.name||t[8]!==a||t[9]!==_?(v=(0,Z.jsx)(u,{variant:`ghost`,className:`yuri-tour-card-toggle`,"aria-label":l.name,"aria-pressed":a,onClick:o,children:_}),t[6]=o,t[7]=l.name,t[8]=a,t[9]=_,t[10]=v):v=t[10];let y=f?.icon,b;t[11]!==l.name||t[12]!==y?(b=(0,Z.jsx)(P,{name:l.name,src:y,size:30}),t[11]=l.name,t[12]=y,t[13]=b):b=t[13];let x;t[14]===l.name?x=t[15]:(x=(0,Z.jsx)(`h3`,{className:`typography-ui-label font-medium`,children:l.name}),t[14]=l.name,t[15]=x);let S;t[16]===l.spec?S=t[17]:(S=(0,Z.jsx)(`p`,{className:`break-all typography-micro text-muted-foreground`,children:l.spec}),t[16]=l.spec,t[17]=S);let C;t[18]!==x||t[19]!==S?(C=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[x,S]}),t[18]=x,t[19]=S,t[20]=C):C=t[20];let w;t[21]===f?w=t[22]:(w=f?.latestVersion&&(0,Z.jsx)(`span`,{className:`typography-micro text-muted-foreground`,children:f.latestVersion}),t[21]=f,t[22]=w);let T;t[23]!==C||t[24]!==w||t[25]!==b?(T=(0,Z.jsxs)(`div`,{className:`flex items-start gap-3 pr-10`,children:[b,C,w]}),t[23]=C,t[24]=w,t[25]=b,t[26]=T):T=t[26];let E;t[27]!==r||t[28]!==f?.description||t[29]!==c?(E=f?.description||c(r?`tour.metadataUnavailable`:`common.loading`),t[27]=r,t[28]=f?.description,t[29]=c,t[30]=E):E=t[30];let D;t[31]===E?D=t[32]:(D=(0,Z.jsx)(`p`,{className:`flex-1 typography-meta text-muted-foreground`,children:E}),t[31]=E,t[32]=D);let O=!f,k;t[33]!==s||t[34]!==O?(k=(0,Z.jsx)(u,{size:`xs`,variant:`ghost`,className:`yuri-tour-card-link`,disabled:O,onClick:s,children:`README`}),t[33]=s,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==i||t[37]!==c?(A=i&&(0,Z.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:c(`tour.saved`)}),t[36]=i,t[37]=c,t[38]=A):A=t[38];let j;t[39]!==k||t[40]!==A?(j=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[k,A]}),t[39]=k,t[40]=A,t[41]=j):j=t[41];let M;return t[42]!==T||t[43]!==D||t[44]!==j||t[45]!==h||t[46]!==v?(M=(0,Z.jsxs)(`section`,{className:h,children:[v,T,D,j]}),t[42]=T,t[43]=D,t[44]=j,t[45]=h,t[46]=v,t[47]=M):M=t[47],M}function de(e){let t=(0,K.c)(28),{settings:n,onComplete:r,onBusy:i}=e,{t:a}=ee(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={voiceProvider:`volcengine`,sttProvider:`volcengine`,dictationEnabled:!0,showMessageTTSButtons:!0},t[0]=o):o=t[0];let s=I(n,o),l=c(i),u,d;t[1]!==s.saving||t[2]!==l?(u=()=>(l(s.saving),()=>l(!1)),d=[s.saving,l],t[1]=s.saving,t[2]=l,t[3]=u,t[4]=d):(u=t[3],d=t[4]),G.useEffect(u,d);let f;t[5]!==s||t[6]!==r||t[7]!==n.configured?(f=async e=>{e.preventDefault(),!(!n.configured&&!s.draft.apiKey?.trim())&&(await s.save())?.configured&&r()},t[5]=s,t[6]=r,t[7]=n.configured,t[8]=f):f=t[8];let p=f,m;t[9]===p?m=t[10]:(m=e=>void p(e),t[9]=p,t[10]=m);let h;t[11]===a?h=t[12]:(h=a(`settings.voice.volcengine.name`),t[11]=a,t[12]=h);let g,_;t[13]===s?(g=t[14],_=t[15]):(g=(0,Z.jsx)(L,{mode:`tts`,form:s}),_=(0,Z.jsx)(L,{mode:`asr`,form:s,showCredentials:!1}),t[13]=s,t[14]=g,t[15]=_);let v;t[16]!==h||t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(A,{label:h,children:[g,_]}),t[16]=h,t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==s.draft||t[21]!==n.configured||t[22]!==a?(y=!n.configured&&!s.draft.apiKey?.trim()&&(0,Z.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:a(`settings.providers.page.toast.apiKeyRequired`)}),t[20]=s.draft,t[21]=n.configured,t[22]=a,t[23]=y):y=t[23];let b;return t[24]!==y||t[25]!==m||t[26]!==v?(b=(0,Z.jsxs)(`form`,{id:`yuri-tour-voice`,onSubmit:m,className:`yuri-settings-section-stack`,children:[v,y]}),t[24]=y,t[25]=m,t[26]=v,t[27]=b):b=t[27],b}function fe({runtime:e,onClose:r}){let{t:i}=ee(),a=O(),c=E(t=>t.progress[e]?.step??0),[v,x]=G.useState(`magpie`),[S,w]=G.useState(),[A,M]=G.useState(Q.slice(1)),[N,P]=G.useState(`tour`),[I,L]=G.useState(null),[R,B]=G.useState(!1),[te,ne]=G.useState({disabled:!0}),[V,H]=G.useState(null),re=n(),U=t(),W=G.useRef(null),K=G.useRef(!1);G.useEffect(()=>{let e=new AbortController;return W.current=e,()=>e.abort()},[]);let J=k(),Y=o({...j(a,Q.slice(1),!1,U,!0),enabled:c===1}),X=o({...T(U),enabled:c===3}),oe=J.data?.entries??[],fe=e=>{let t=f.getState(),n=e&&t.providers.some(t=>t.id===e);x(`other`),w(n?void 0:e),t.setSelectedProvider(n?e:`__add_provider__`),P(`providers`)},$=()=>!W.current?.signal.aborted&&re===n()&&U===t(),pe=t=>{P(`tour`),H(null),E.getState().move(e,t)},me=()=>{$()&&r()},he=()=>{c===3?me():pe(c+1)},ge=async()=>{if(c===2){he();return}if(!(K.current||R||!W.current)){K.current=!0,B(!0),H(null);try{let e=c===0?v===`magpie`?[Q[0]]:[]:A;if(e.length){let t=await ae(e,a,W.current.signal);if(!$())return;if(t.failed.length){H(i(`tour.saveFailed`,{names:t.failed.join(`, `)}));return}}if(c===0&&v===`other`){let e=await s.fetchQuery({...l(a,U),staleTime:0});if(!$())return;if(e.partial||!e.providers.some(e=>Object.keys(e.models).length>0)){H(i(`tour.noModels`));return}await f.getState().loadProviders({directory:a,forceRefresh:!0,source:`setup-tour`})}$()&&he()}catch{$()&&H(i(`tour.operationFailed`))}finally{K.current=!1,$()&&B(!1)}}},_e=()=>{I===null?N===`tour`?c>0&&pe(c-1):P(`tour`):L(null)},ve=I===null?void 0:Y.data?.[Q[I]],ye=ve?.kind===`npm-ok`?ve.readme:void 0;return(0,Z.jsx)(_,{open:!0,onOpenChange:e=>{!e&&!R&&(I!==null||N!==`tour`?_e():me())},children:(0,Z.jsxs)(h,{className:`yuri-setup-tour yuri-settings-workspace`,showCloseButton:!1,"aria-describedby":void 0,children:[(0,Z.jsx)(`div`,{className:`yuri-tour-watermark`,"aria-hidden":`true`,children:(0,Z.jsx)(y,{width:440,height:440})}),(0,Z.jsx)(m,{children:(0,Z.jsxs)(g,{className:`yuri-tour-title`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`👋`}),i(`tour.title`).split(`Yuri`).map((e,t)=>(0,Z.jsxs)(G.Fragment,{children:[t>0&&(0,Z.jsx)(D,{width:`2.05em`}),(0,Z.jsx)(`span`,{children:e.trim()})]},t))]})}),(0,Z.jsxs)(`div`,{className:`yuri-tour-body`,children:[(0,Z.jsx)(`nav`,{className:`yuri-tour-progress`,"aria-label":i(`tour.title`),children:ce.map((e,t)=>(0,Z.jsxs)(u,{variant:`ghost`,size:`lg`,disabled:R,"aria-current":c===t?`step`:void 0,onClick:()=>{L(null),pe(t)},children:[(0,Z.jsx)(`span`,{className:`yuri-tour-number`,"aria-hidden":`true`,children:String(t+1).padStart(2,`0`)}),(0,Z.jsx)(`span`,{children:i(e)})]},e))}),(0,Z.jsx)(`div`,{className:d(`yuri-tour-content`,N===`providers`&&I===null&&`yuri-tour-provider-content`),children:(0,Z.jsxs)(`fieldset`,{disabled:R,className:`contents`,children:[I===null?N===`providers`?(0,Z.jsx)(F,{initialConnectionId:S}):N===`voice`&&X.data?(0,Z.jsx)(de,{settings:X.data,onComplete:me,onBusy:B}):N===`asr`||N===`tts`?(0,Z.jsx)(z,{section:N}):(0,Z.jsxs)(Z.Fragment,{children:[c<2&&(c===1&&Y.isError||J.isError)&&(0,Z.jsxs)(`div`,{role:`alert`,className:`yuri-tour-feedback`,children:[(0,Z.jsx)(`p`,{children:i(`tour.metadataUnavailable`)}),(0,Z.jsx)(u,{size:`xs`,onClick:()=>{c===1&&Y.refetch(),J.refetch()},children:i(`settings.plugins.status.retry`)})]}),c===0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{className:d(`yuri-tour-magpie yuri-tour-select-card`,v===`magpie`&&`yuri-tour-card-selected`),children:[(0,Z.jsx)(u,{variant:`ghost`,className:`yuri-tour-card-toggle`,"aria-label":`Magpie`,"aria-pressed":v===`magpie`,onClick:()=>x(v===`magpie`?`other`:`magpie`),children:(0,Z.jsx)(`span`,{className:`yuri-tour-card-check`,"aria-hidden":`true`,children:v===`magpie`&&(0,Z.jsx)(p,{name:`check`,className:`size-5`})})}),(0,Z.jsxs)(`div`,{className:`flex w-full items-center gap-3 pr-10`,children:[(0,Z.jsx)(C,{providerId:`magpie`,alt:`Magpie`,className:`size-8 shrink-0`}),(0,Z.jsx)(`span`,{className:`typography-ui-label`,children:`Magpie`}),(0,Z.jsx)(`span`,{className:`yuri-tour-recommended`,children:i(`tour.recommended`)})]}),(0,Z.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:i(`tour.magpieDescription`)}),(0,Z.jsxs)(`a`,{className:`yuri-tour-card-link typography-meta text-muted-foreground underline`,href:`https://usemagpie.ai/docs/start`,target:`_blank`,rel:`noreferrer`,children:[i(`tour.docs`),` ↗`]})]}),(0,Z.jsxs)(`div`,{className:`yuri-tour-provider-heading`,children:[(0,Z.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:`OpenCode`}),(0,Z.jsxs)(`a`,{className:`typography-meta text-muted-foreground underline`,href:`https://opencode.ai/docs/providers/`,target:`_blank`,rel:`noreferrer`,children:[i(`tour.docs`),` ↗`]})]}),(0,Z.jsx)(`div`,{className:`yuri-tour-provider-grid`,children:le.map(e=>(0,Z.jsxs)(u,{variant:`ghost`,className:`yuri-tour-provider-choice`,onClick:()=>fe(e.id),children:[(0,Z.jsx)(C,{providerId:e.id,alt:e.name,className:`size-6 shrink-0`}),(0,Z.jsx)(`span`,{children:e.name})]},e.id))}),(0,Z.jsxs)(u,{className:`mt-3`,size:`sm`,variant:`ghost`,onClick:()=>fe(),children:[i(`tour.otherProvider`),(0,Z.jsx)(p,{name:`arrow-right-s`,className:`size-4`})]})]}),c===1&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`yuri-tour-plugins`,children:[1,2].map(e=>(0,Z.jsx)(ue,{index:e,info:Y.data?.[Q[e]],installed:ie(oe,Q[e]),selected:A.includes(Q[e]),onSelect:()=>M(t=>t.includes(Q[e])?t.filter(t=>t!==Q[e]):[...t,Q[e]]),onReadme:()=>L(e)},e))}),(0,Z.jsxs)(`a`,{className:`mt-4 inline-block typography-meta text-muted-foreground underline underline-offset-4 hover:text-foreground`,href:`https://opencode.ai/docs/ecosystem/#plugins`,target:`_blank`,rel:`noopener noreferrer`,children:[i(`tour.morePlugins`),` ↗`]})]}),c===2&&(0,Z.jsx)(se,{onBusy:B,directory:a,onPrimaryChange:ne,onComplete:()=>pe(3)}),c===3&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`yuri-tour-voice-intro`,children:[(0,Z.jsx)(`h2`,{children:i(`tour.voiceHeading`)}),(0,Z.jsx)(`p`,{children:i(`tour.voiceIntro`)})]}),(0,Z.jsxs)(`div`,{className:`yuri-tour-voice-capabilities`,children:[(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(p,{name:`mic`,className:`yuri-tour-voice-icon`}),(0,Z.jsx)(`h3`,{children:i(`settings.voice.page.section.speechRecognition`)}),(0,Z.jsx)(`p`,{children:i(`tour.dictationDescription`)}),(0,Z.jsxs)(`div`,{className:`yuri-tour-voice-services`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20height='24'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDoubao%3c/title%3e%3cpath%20d='M5.31%2015.756c.172-3.75%201.883-5.999%202.549-6.739-3.26%202.058-5.425%205.658-6.358%208.308v1.12C1.501%2021.513%204.226%2024%207.59%2024a6.59%206.59%200%20002.2-.375c.353-.12.7-.248%201.039-.378.913-.899%201.65-1.91%202.243-2.992-4.877%202.431-7.974.072-7.763-4.5l.002.001z'%20fill='%231E37FC'%3e%3c/path%3e%3cpath%20d='M22.57%2010.283c-1.212-.901-4.109-2.404-7.397-2.8.295%203.792.093%208.766-2.1%2012.773a12.782%2012.782%200%2001-2.244%202.992c3.764-1.448%206.746-3.457%208.596-5.219%202.82-2.683%203.353-5.178%203.361-6.66a2.737%202.737%200%2000-.216-1.084v-.002z'%20fill='%2337E1BE'%3e%3c/path%3e%3cpath%20d='M14.303%201.867C12.955.7%2011.248%200%209.39%200%207.532%200%205.883.677%204.545%201.807%202.791%203.29%201.627%205.557%201.5%208.125v9.201c.932-2.65%203.097-6.25%206.357-8.307.5-.318%201.025-.595%201.569-.829%201.883-.801%203.878-.932%205.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z'%20fill='%23A569FF'%3e%3c/path%3e%3cpath%20d='M17.305%204.961a199.47%20199.47%200%2001-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648%202.786.869%205.617%203.288.395%206.185%201.898%207.396%202.8-1.306-1.275-3.475-3.487-5.266-5.323z'%20fill='%231E37FC'%3e%3c/path%3e%3c/svg%3e`,alt:``,className:`size-4`}),i(`settings.voice.volcengine.name`)]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(p,{name:`computer`}),i(`settings.voice.page.provider.local`)]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(p,{name:`server`}),i(`settings.voice.page.provider.server`)]})]}),(0,Z.jsxs)(u,{size:`sm`,onClick:()=>P(`asr`),children:[i(`tour.configureInput`),(0,Z.jsx)(p,{name:`arrow-right-s`,className:`size-4`})]})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(p,{name:`volume-up`,className:`yuri-tour-voice-icon`}),(0,Z.jsx)(`h3`,{children:i(`tour.readAloudTitle`)}),(0,Z.jsx)(`p`,{children:i(`tour.readAloudDescription`)}),(0,Z.jsxs)(`div`,{className:`yuri-tour-voice-services`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20height='24'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDoubao%3c/title%3e%3cpath%20d='M5.31%2015.756c.172-3.75%201.883-5.999%202.549-6.739-3.26%202.058-5.425%205.658-6.358%208.308v1.12C1.501%2021.513%204.226%2024%207.59%2024a6.59%206.59%200%20002.2-.375c.353-.12.7-.248%201.039-.378.913-.899%201.65-1.91%202.243-2.992-4.877%202.431-7.974.072-7.763-4.5l.002.001z'%20fill='%231E37FC'%3e%3c/path%3e%3cpath%20d='M22.57%2010.283c-1.212-.901-4.109-2.404-7.397-2.8.295%203.792.093%208.766-2.1%2012.773a12.782%2012.782%200%2001-2.244%202.992c3.764-1.448%206.746-3.457%208.596-5.219%202.82-2.683%203.353-5.178%203.361-6.66a2.737%202.737%200%2000-.216-1.084v-.002z'%20fill='%2337E1BE'%3e%3c/path%3e%3cpath%20d='M14.303%201.867C12.955.7%2011.248%200%209.39%200%207.532%200%205.883.677%204.545%201.807%202.791%203.29%201.627%205.557%201.5%208.125v9.201c.932-2.65%203.097-6.25%206.357-8.307.5-.318%201.025-.595%201.569-.829%201.883-.801%203.878-.932%205.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z'%20fill='%23A569FF'%3e%3c/path%3e%3cpath%20d='M17.305%204.961a199.47%20199.47%200%2001-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648%202.786.869%205.617%203.288.395%206.185%201.898%207.396%202.8-1.306-1.275-3.475-3.487-5.266-5.323z'%20fill='%231E37FC'%3e%3c/path%3e%3c/svg%3e`,alt:``,className:`size-4`}),i(`settings.voice.volcengine.name`)]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(C,{providerId:`openai`,alt:`OpenAI`,className:`size-4`}),`OpenAI`]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(p,{name:`computer`}),i(`settings.voice.page.provider.browser`)]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(p,{name:`cloud`}),i(`settings.voice.page.provider.custom`)]})]}),(0,Z.jsxs)(u,{size:`sm`,onClick:()=>P(`tts`),children:[i(`tour.configureReadAloud`),(0,Z.jsx)(p,{name:`arrow-right-s`,className:`size-4`})]})]})]}),(0,Z.jsxs)(`section`,{className:`yuri-tour-voice-recommendation`,children:[(0,Z.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20height='24'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDoubao%3c/title%3e%3cpath%20d='M5.31%2015.756c.172-3.75%201.883-5.999%202.549-6.739-3.26%202.058-5.425%205.658-6.358%208.308v1.12C1.501%2021.513%204.226%2024%207.59%2024a6.59%206.59%200%20002.2-.375c.353-.12.7-.248%201.039-.378.913-.899%201.65-1.91%202.243-2.992-4.877%202.431-7.974.072-7.763-4.5l.002.001z'%20fill='%231E37FC'%3e%3c/path%3e%3cpath%20d='M22.57%2010.283c-1.212-.901-4.109-2.404-7.397-2.8.295%203.792.093%208.766-2.1%2012.773a12.782%2012.782%200%2001-2.244%202.992c3.764-1.448%206.746-3.457%208.596-5.219%202.82-2.683%203.353-5.178%203.361-6.66a2.737%202.737%200%2000-.216-1.084v-.002z'%20fill='%2337E1BE'%3e%3c/path%3e%3cpath%20d='M14.303%201.867C12.955.7%2011.248%200%209.39%200%207.532%200%205.883.677%204.545%201.807%202.791%203.29%201.627%205.557%201.5%208.125v9.201c.932-2.65%203.097-6.25%206.357-8.307.5-.318%201.025-.595%201.569-.829%201.883-.801%203.878-.932%205.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z'%20fill='%23A569FF'%3e%3c/path%3e%3cpath%20d='M17.305%204.961a199.47%20199.47%200%2001-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648%202.786.869%205.617%203.288.395%206.185%201.898%207.396%202.8-1.306-1.275-3.475-3.487-5.266-5.323z'%20fill='%231E37FC'%3e%3c/path%3e%3c/svg%3e`,alt:``,className:`size-6 shrink-0`}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`h3`,{children:i(`settings.voice.volcengine.name`)}),(0,Z.jsx)(`span`,{className:`yuri-tour-recommended`,children:i(`tour.recommended`)})]}),(0,Z.jsx)(`p`,{children:i(`tour.voiceAllowance`)})]}),(0,Z.jsx)(u,{disabled:!X.data,size:`sm`,onClick:()=>P(`voice`),children:i(`tour.configureVoice`)})]}),X.isError&&(0,Z.jsxs)(`div`,{role:`alert`,className:`yuri-tour-feedback`,children:[(0,Z.jsx)(`p`,{children:i(`settings.voice.volcengine.loadFailed`)}),(0,Z.jsx)(u,{size:`xs`,onClick:()=>void X.refetch(),children:i(`settings.voice.volcengine.retry`)})]})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`h3`,{className:`typography-ui-label mb-4`,children:[q[I].name,` · README`]}),ye?(0,Z.jsx)(b,{content:ye,enableFileReferences:!1}):(0,Z.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:i(`tour.metadataUnavailable`)})]}),V&&I===null&&(0,Z.jsx)(`p`,{role:`alert`,className:`yuri-tour-feedback`,children:V})]})})]}),(0,Z.jsxs)(`footer`,{className:`yuri-tour-footer`,children:[(N!==`tour`||I!==null)&&(0,Z.jsx)(u,{variant:`ghost`,size:`sm`,disabled:R,onClick:_e,children:i(`onboarding.common.actions.back`)}),I===null&&(0,Z.jsxs)(`div`,{className:`ml-auto flex flex-wrap justify-end gap-2`,children:[(0,Z.jsx)(u,{variant:`ghost`,size:`sm`,disabled:R,onClick:he,children:i(`tour.later`)}),c===2?(0,Z.jsxs)(u,{size:`sm`,type:`submit`,form:`yuri-tour-import`,disabled:R||te.disabled,"aria-busy":R,children:[R&&(0,Z.jsx)(p,{name:`loader-4`,className:`size-3 animate-spin`}),i(te.background?`historyImport.background`:`historyImport.next`)]}):c===3?(0,Z.jsx)(u,{size:`sm`,disabled:R,type:N===`voice`?`submit`:`button`,form:N===`voice`?`yuri-tour-voice`:void 0,onClick:N===`voice`?void 0:me,children:i(N===`voice`?`settings.common.actions.saveChanges`:`tour.finish`)}):(0,Z.jsxs)(u,{size:`sm`,disabled:R||c<2&&(!J.data||J.isError),"aria-busy":R,onClick:()=>void ge(),children:[R&&(0,Z.jsx)(p,{name:`loader-4`,className:`size-3 animate-spin`}),i(`tour.continue`)]})]})]})]})})}export{fe as SetupTourDialog};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-DEPKHgdL.js";import{ot as r,st as i}from"./vendor-base-ui-fom6orB6.js";import{n as a}from"./vendor-react-D5BntRmA.js";import{s as o}from"./vendor-tanstack-react-query-ChSd65dm.js";import{q as s}from"./runtime-file-resource-CKQQEwNv.js";import{r as c}from"./vendor-reactuses-core-B8s-Rcd-.js";import{t as ee}from"./i18n-BvjeIWrT.js";import{Fa as l,In as u,Rn as d,Zi as f}from"./useMobileNavigationStore-oveTY29a.js";import{n as p}from"./Icon-DebSeH2D.js";import{a as m,n as h,o as g,t as _}from"./dialog-CHzvxSP4.js";import{t as v}from"./checkbox-DVMeOiMB.js";import{t as y}from"./YuriLogo-BKdnDJwl.js";import{n as b}from"./MarkdownRenderer-Bjl6sXps.js";import{g as x,h as S,l as C,p as w}from"./select-BnDfHG_T.js";import{n as T}from"./speechSettingsQueries-mH-OoFPq.js";import{n as E,t as D}from"./YuriWordmark-D2e-o9nW.js";import{a as O,c as k,f as A,n as j,r as M,t as N}from"./usePluginsStore-DErHgEFY.js";import{c as P,i as F,n as I,r as L,s as R,t as z}from"./VoiceSettings-DhA9feRU.js";import{a as B,c as te,d as ne,l as V,o as H,s as re,t as U,u as W}from"./historyImportQueries-DiGQ8duS.js";var G=e(i(),1),K=a(),q=[{name:`Magpie`,spec:`opencode-magpie-plugin`},{name:`Eficy`,spec:`@eficy/opencode2-plugin`},{name:`yee-profile`,spec:`@yee94/opencode-profile`}];function ie(e,t){return e.some(e=>e.parsedKind===`npm`&&R(e.spec).name===t)}async function J(e,t){let n=[];for(let r of new Set(e)){if(!t.current())throw Error(`Runtime changed`);try{let e=await t.list();if(!t.current())throw Error(`Runtime changed`);ie(e,r)||(await t.create(r)).ok||n.push(r)}catch{n.push(r)}}if(!t.current())throw Error(`Runtime changed`);return{failed:n}}function ae(e,r,i){let a=t(),o=n();return J(e,{current:()=>!i.aborted&&o===n()&&a===t(),list:async()=>(await s.fetchQuery({...M(r,a),staleTime:0})).entries,create:e=>N.getState().createEntry({spec:e,scope:`user`})})}var Y=`data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%20Code%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M20.998%2010.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6%2010.949h1.488V8.102H6v2.847zm10.51%200H18V8.102h-1.49v2.847z'%20fill='%23D97757'%20fill-rule='evenodd'/%3e%3c/svg%3e`,X=`data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20d='M19.503%200H4.496A4.496%204.496%200%20000%204.496v15.007A4.496%204.496%200%20004.496%2024h15.007A4.496%204.496%200%200024%2019.503V4.496A4.496%204.496%200%200019.503%200z'%20fill='%23fff'/%3e%3cpath%20d='M9.064%203.344a4.578%204.578%200%20012.285-.312c1%20.115%201.891.54%202.673%201.275.01.01.024.017.037.021a.09.09%200%2000.043%200%204.55%204.55%200%20013.046.275l.047.022.116.057a4.581%204.581%200%20012.188%202.399c.209.51.313%201.041.315%201.595a4.24%204.24%200%2001-.134%201.223.123.123%200%2000.03.115c.594.607.988%201.33%201.183%202.17.289%201.425-.007%202.71-.887%203.854l-.136.166a4.548%204.548%200%2001-2.201%201.388.123.123%200%2000-.081.076c-.191.551-.383%201.023-.74%201.494-.9%201.187-2.222%201.846-3.711%201.838-1.187-.006-2.239-.44-3.157-1.302a.107.107%200%2000-.105-.024c-.388.125-.78.143-1.204.138a4.441%204.441%200%2001-1.945-.466%204.544%204.544%200%2001-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81%205.81%200%2001-.37-.961%204.582%204.582%200%2001-.014-2.298.124.124%200%2000.006-.056.085.085%200%2000-.027-.048%204.467%204.467%200%2001-1.034-1.651%203.896%203.896%200%2001-.251-1.192%205.189%205.189%200%2001.141-1.6c.337-1.112.982-1.985%201.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098%200%2000.065-.066%204.51%204.51%200%2001.829-1.615%204.535%204.535%200%20011.837-1.388zm3.482%2010.565a.637.637%200%20000%201.272h3.636a.637.637%200%20100-1.272h-3.636zM8.462%209.23a.637.637%200%2000-1.106.631l1.272%202.224-1.266%202.136a.636.636%200%20101.095.649l1.454-2.455a.636.636%200%2000.005-.64L8.462%209.23z'%20fill='url(%23codex-gradient)'/%3e%3cdefs%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='codex-gradient'%20x1='12'%20x2='12'%20y1='3'%20y2='21'%3e%3cstop%20stop-color='%23B1A7FF'/%3e%3cstop%20offset='.5'%20stop-color='%237A9DFF'/%3e%3cstop%20offset='1'%20stop-color='%233941FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e`,Z=r(),oe={claude:Y,codex:X,cursor:x,dsh:S,opencode:w};function se({onBusy:e,directory:r=null,onPrimaryChange:i,onComplete:a}){let{t:o,locale:s}=ee(),l=t(),f=n(),[m,h]=G.useState([]),[g,_]=G.useState(!1),[y,b]=G.useState(null),x=H(),S=x.data?.state===`running`,C=re(x.isSuccess&&!S),w=te(C.data?.id,r,`${x.data?.id??``}:${x.data?.state??``}`,!S&&!C.isFetching&&!C.isError),T=G.useRef(null),E=G.useRef(!1),D=G.useRef(null),O=G.useRef(null),k=c(e),A=c(e=>i?.(e)),j=c((e,t)=>h(n=>t?n.includes(e)?n:[...n,e]:n.filter(t=>t!==e)));G.useEffect(()=>{let e=new AbortController;return T.current=e,()=>{e.abort(),k(!1)}},[l,f,k]);let M=G.useMemo(()=>{let e=V.map(e=>({...e,sessions:[]}));for(let t of C.data?.sessions??[]){let n=e.find(e=>e.id===t.source);n&&n.sessions.length<5&&n.sessions.push(t)}return e.filter(e=>e.sessions.length)},[C.data]),N=!!(D.current&&x.data?.id===D.current&&ne(x.data)),P=g||!S&&!N&&(C.isFetching||!C.data||C.isError||x.isError);G.useEffect(()=>{A({disabled:P,background:S})},[P,S,A]);let F=()=>!T.current?.signal.aborted&&l===t()&&f===n(),I=async e=>{if(!(E.current||!T.current)){E.current=!0,_(!0),k(!0),b(null);try{await e(T.current.signal)}catch(e){F()&&b(e instanceof Error&&/^[a-z_]+$/.test(e.message)?e.message:`import_failed`)}finally{E.current=!1,F()&&(_(!1),k(!1))}}},L=()=>I(async e=>{if(P)return;if(S||N){F()&&a?.();return}if(!m.length){F()&&a?.();return}let t=await B(m,r,e,l,f);F()&&(D.current=t.id,O.current?.scrollIntoView({block:`start`}))}),R=C.error??x.error,z=y||(R instanceof Error&&/^[a-z_]+$/.test(R.message)?R.message:C.isError||x.isError?`import_failed`:null),K=G.useMemo(()=>new Intl.DateTimeFormat(s,{month:`short`,day:`numeric`}),[s]),q=x.data?W(x.data):null,ie=G.useMemo(()=>new Intl.NumberFormat(s),[s]),J=(e,t)=>{let n=C.data?.counts?.[e],r=n?.value;if(r==null||C.isError)return null;let i=ie.format(r),a=o(n?.approximate?`historyImport.estimatedCount`:`historyImport.sourceCount`,{count:i});return(0,Z.jsx)(`span`,{id:t,"data-history-count":e,className:`yuri-import-source-count`,title:a,"aria-label":a,children:C.isFetching?(0,Z.jsx)(p,{name:`loader-4`,className:`size-3 animate-spin`,"aria-label":o(`historyImport.scanning`)}):`${n?.approximate?`≈ `:``}${i}`})};return(0,Z.jsxs)(`form`,{id:`yuri-tour-import`,className:`yuri-history-import`,"data-history-import":!0,onSubmit:e=>{e.preventDefault(),L()},children:[(0,Z.jsx)(`h2`,{ref:O,className:`yuri-import-heading`,children:o(`historyImport.heading`)}),(0,Z.jsx)(`p`,{className:`yuri-import-subtitle`,children:o(`historyImport.deduplication`)}),x.data&&!ne(x.data)&&(S||D.current===x.data.id)&&(0,Z.jsxs)(`div`,{className:`yuri-import-job`,role:`status`,children:[(0,Z.jsx)(p,{name:S?`loader-4`:`error-warning`,className:d(`size-4`,S&&`animate-spin`)}),(0,Z.jsx)(`span`,{children:o(S&&q?`historyImport.phase.${q.phase}`:`historyImport.state.${x.data.state}`)}),q&&q.total>0&&(0,Z.jsxs)(`span`,{className:`tabular-nums`,children:[q.completed,` / `,q.total]}),S&&(0,Z.jsx)(u,{variant:`ghost`,size:`icon`,disabled:g,"aria-label":o(`historyImport.cancel`),title:o(`historyImport.cancel`),onClick:()=>void I(async e=>{await U(x.data.id,e,l),F()&&await x.refetch()}),children:(0,Z.jsx)(p,{name:`stop`,className:`size-4`})}),S&&q&&(0,Z.jsx)(`progress`,{value:q.total?q.completed:void 0,max:q.total||1,"aria-label":o(`historyImport.progress`)}),x.data.progress?.code&&(0,Z.jsxs)(`p`,{role:`alert`,children:[o(`historyImport.failed`),` `,(0,Z.jsx)(`code`,{children:x.data.progress.code})]}),x.data.results.some(e=>e.status===`failed`||e.project===`failed`||e.index===`failed`)&&(0,Z.jsxs)(`p`,{role:`alert`,children:[o(`historyImport.failed`),[...new Set(x.data.results.filter(e=>e.status===`failed`&&e.code).map(e=>e.code))].map(e=>(0,Z.jsxs)(`code`,{children:[` `,e]},e))]})]}),(0,Z.jsx)(`div`,{className:`yuri-import-source-grid`,"aria-label":o(`historyImport.sources`),children:V.map(e=>{let t=C.data?.installations?.[e.id],n=o(t===!0?`historyImport.installed`:t===!1?`historyImport.notDetected`:`historyImport.installationUnknown`),r=C.data?.counts?.[e.id]?.value!=null&&!C.isError?` history-import-count-${e.id}`:``;return(0,Z.jsxs)(u,{variant:`ghost`,"data-history-source":e.id,className:d(`yuri-import-source-card`,(e.id===`cursor`||e.id===`opencode`)&&`yuri-import-source-cursor`),disabled:g||S,"aria-pressed":m.includes(e.id),"aria-label":e.name,"aria-describedby":`history-import-installed-${e.id}${r}`,onClick:()=>j(e.id,!m.includes(e.id)),children:[(0,Z.jsxs)(`span`,{className:`yuri-import-logo-wrap`,children:[(0,Z.jsx)(`img`,{src:oe[e.id],alt:``,draggable:!1,className:`yuri-import-source-logo`}),(0,Z.jsx)(`span`,{id:`history-import-installed-${e.id}`,role:`img`,"aria-label":n,title:n,"data-installed":t===!0?`true`:t===!1?`false`:`unknown`,className:`yuri-import-installation`})]}),(0,Z.jsx)(`span`,{className:`yuri-import-source-name`,children:e.name}),J(e.id,`history-import-count-${e.id}`),(0,Z.jsx)(`span`,{className:`yuri-import-source-check`,"aria-hidden":`true`,children:(0,Z.jsx)(p,{name:`check`,className:`size-3`})})]},e.id)})}),z&&(0,Z.jsxs)(`div`,{role:`alert`,className:`yuri-tour-feedback`,children:[(0,Z.jsxs)(`p`,{children:[o(z===`history_import_unsupported`?`historyImport.unsupported`:`historyImport.failed`),` `,(0,Z.jsx)(`code`,{children:z})]}),(C.isError||x.isError)&&(0,Z.jsx)(u,{variant:`ghost`,size:`xs`,disabled:C.isFetching||x.isFetching,onClick:()=>{Promise.all([C.refetch(),x.refetch()])},children:o(`settings.plugins.status.retry`)})]}),C.data&&!C.isFetching&&!C.isError&&!C.data.sessions.length&&!C.data.errors.length&&(0,Z.jsx)(`p`,{className:`yuri-tour-feedback`,children:o(`historyImport.empty`)}),M.length>0&&(0,Z.jsxs)(`section`,{"aria-label":o(`historyImport.sessions`),children:[(0,Z.jsx)(`div`,{className:`yuri-import-list-heading`,children:o(`historyImport.sessions`)}),(0,Z.jsx)(`div`,{className:`yuri-import-preview-groups`,children:M.map(e=>(0,Z.jsxs)(`section`,{"aria-label":e.name,"data-source-selected":m.includes(e.id),children:[(0,Z.jsxs)(`div`,{className:`yuri-import-preview-heading`,children:[(0,Z.jsx)(`h3`,{children:e.name}),J(e.id),(0,Z.jsx)(v,{checked:m.includes(e.id),disabled:g||S,ariaLabel:e.name,onChange:t=>j(e.id,t)})]}),(0,Z.jsx)(`ul`,{className:`yuri-import-session-grid`,children:e.sessions.map(e=>(0,Z.jsxs)(`li`,{"data-history-session":e.key,className:d(`yuri-import-session-card`,(e.source===`cursor`||e.source===`opencode`)&&`yuri-import-source-cursor`),title:e.title,children:[(0,Z.jsx)(`img`,{src:oe[e.source],alt:``,draggable:!1,className:`yuri-import-session-logo`}),(0,Z.jsxs)(`span`,{className:`yuri-import-session-copy`,children:[(0,Z.jsxs)(`span`,{className:`yuri-import-session-heading`,children:[(0,Z.jsx)(`span`,{className:`yuri-import-session-title`,children:e.title}),!w.isError&&w.data?.states[e.key]===`imported`&&(0,Z.jsx)(`span`,{className:`yuri-import-session-imported`,"data-history-imported":!0,children:o(`historyImport.alreadyImported`)}),e.updated&&e.updated>0?(0,Z.jsx)(`time`,{dateTime:new Date(e.updated).toISOString(),children:K.format(e.updated)}):null]}),e.excerpt&&(0,Z.jsx)(`span`,{className:`yuri-import-session-excerpt`,children:e.excerpt})]})]},e.key))})]},e.id))})]})]})}var Q=q.map(e=>e.spec),ce=[`tour.models`,`tour.plugins`,`tour.import`,`tour.voice`],le=[{id:`openai`,name:`OpenAI`},{id:`anthropic`,name:`Anthropic`},{id:`google`,name:`Google Gemini`},{id:`github-copilot`,name:`GitHub Copilot`},{id:`deepseek`,name:`DeepSeek`},{id:`openrouter`,name:`OpenRouter`}];function ue(e){let t=(0,K.c)(48),{index:n,info:r,installed:i,selected:a,onSelect:o,onReadme:s}=e,{t:c}=ee(),l=q[n],f=r?.kind===`npm-ok`?r:void 0,m=a&&`yuri-tour-card-selected`,h;t[0]===m?h=t[1]:(h=d(`yuri-tour-plugin yuri-tour-select-card`,m),t[0]=m,t[1]=h);let g;t[2]===a?g=t[3]:(g=a&&(0,Z.jsx)(p,{name:`check`,className:`size-5`}),t[2]=a,t[3]=g);let _;t[4]===g?_=t[5]:(_=(0,Z.jsx)(`span`,{className:`yuri-tour-card-check`,"aria-hidden":`true`,children:g}),t[4]=g,t[5]=_);let v;t[6]!==o||t[7]!==l.name||t[8]!==a||t[9]!==_?(v=(0,Z.jsx)(u,{variant:`ghost`,className:`yuri-tour-card-toggle`,"aria-label":l.name,"aria-pressed":a,onClick:o,children:_}),t[6]=o,t[7]=l.name,t[8]=a,t[9]=_,t[10]=v):v=t[10];let y=f?.icon,b;t[11]!==l.name||t[12]!==y?(b=(0,Z.jsx)(P,{name:l.name,src:y,size:30}),t[11]=l.name,t[12]=y,t[13]=b):b=t[13];let x;t[14]===l.name?x=t[15]:(x=(0,Z.jsx)(`h3`,{className:`typography-ui-label font-medium`,children:l.name}),t[14]=l.name,t[15]=x);let S;t[16]===l.spec?S=t[17]:(S=(0,Z.jsx)(`p`,{className:`break-all typography-micro text-muted-foreground`,children:l.spec}),t[16]=l.spec,t[17]=S);let C;t[18]!==x||t[19]!==S?(C=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[x,S]}),t[18]=x,t[19]=S,t[20]=C):C=t[20];let w;t[21]===f?w=t[22]:(w=f?.latestVersion&&(0,Z.jsx)(`span`,{className:`typography-micro text-muted-foreground`,children:f.latestVersion}),t[21]=f,t[22]=w);let T;t[23]!==C||t[24]!==w||t[25]!==b?(T=(0,Z.jsxs)(`div`,{className:`flex items-start gap-3 pr-10`,children:[b,C,w]}),t[23]=C,t[24]=w,t[25]=b,t[26]=T):T=t[26];let E;t[27]!==r||t[28]!==f?.description||t[29]!==c?(E=f?.description||c(r?`tour.metadataUnavailable`:`common.loading`),t[27]=r,t[28]=f?.description,t[29]=c,t[30]=E):E=t[30];let D;t[31]===E?D=t[32]:(D=(0,Z.jsx)(`p`,{className:`flex-1 typography-meta text-muted-foreground`,children:E}),t[31]=E,t[32]=D);let O=!f,k;t[33]!==s||t[34]!==O?(k=(0,Z.jsx)(u,{size:`xs`,variant:`ghost`,className:`yuri-tour-card-link`,disabled:O,onClick:s,children:`README`}),t[33]=s,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==i||t[37]!==c?(A=i&&(0,Z.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:c(`tour.saved`)}),t[36]=i,t[37]=c,t[38]=A):A=t[38];let j;t[39]!==k||t[40]!==A?(j=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[k,A]}),t[39]=k,t[40]=A,t[41]=j):j=t[41];let M;return t[42]!==T||t[43]!==D||t[44]!==j||t[45]!==h||t[46]!==v?(M=(0,Z.jsxs)(`section`,{className:h,children:[v,T,D,j]}),t[42]=T,t[43]=D,t[44]=j,t[45]=h,t[46]=v,t[47]=M):M=t[47],M}function de(e){let t=(0,K.c)(28),{settings:n,onComplete:r,onBusy:i}=e,{t:a}=ee(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={voiceProvider:`volcengine`,sttProvider:`volcengine`,dictationEnabled:!0,showMessageTTSButtons:!0},t[0]=o):o=t[0];let s=I(n,o),l=c(i),u,d;t[1]!==s.saving||t[2]!==l?(u=()=>(l(s.saving),()=>l(!1)),d=[s.saving,l],t[1]=s.saving,t[2]=l,t[3]=u,t[4]=d):(u=t[3],d=t[4]),G.useEffect(u,d);let f;t[5]!==s||t[6]!==r||t[7]!==n.configured?(f=async e=>{e.preventDefault(),!(!n.configured&&!s.draft.apiKey?.trim())&&(await s.save())?.configured&&r()},t[5]=s,t[6]=r,t[7]=n.configured,t[8]=f):f=t[8];let p=f,m;t[9]===p?m=t[10]:(m=e=>void p(e),t[9]=p,t[10]=m);let h;t[11]===a?h=t[12]:(h=a(`settings.voice.volcengine.name`),t[11]=a,t[12]=h);let g,_;t[13]===s?(g=t[14],_=t[15]):(g=(0,Z.jsx)(L,{mode:`tts`,form:s}),_=(0,Z.jsx)(L,{mode:`asr`,form:s,showCredentials:!1}),t[13]=s,t[14]=g,t[15]=_);let v;t[16]!==h||t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(A,{label:h,children:[g,_]}),t[16]=h,t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==s.draft||t[21]!==n.configured||t[22]!==a?(y=!n.configured&&!s.draft.apiKey?.trim()&&(0,Z.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:a(`settings.providers.page.toast.apiKeyRequired`)}),t[20]=s.draft,t[21]=n.configured,t[22]=a,t[23]=y):y=t[23];let b;return t[24]!==y||t[25]!==m||t[26]!==v?(b=(0,Z.jsxs)(`form`,{id:`yuri-tour-voice`,onSubmit:m,className:`yuri-settings-section-stack`,children:[v,y]}),t[24]=y,t[25]=m,t[26]=v,t[27]=b):b=t[27],b}function fe({runtime:e,onClose:r}){let{t:i}=ee(),a=O(),c=E(t=>t.progress[e]?.step??0),[v,x]=G.useState(`magpie`),[S,w]=G.useState(),[A,M]=G.useState(Q.slice(1)),[N,P]=G.useState(`tour`),[I,L]=G.useState(null),[R,B]=G.useState(!1),[te,ne]=G.useState({disabled:!0}),[V,H]=G.useState(null),re=n(),U=t(),W=G.useRef(null),K=G.useRef(!1);G.useEffect(()=>{let e=new AbortController;return W.current=e,()=>e.abort()},[]);let J=k(),Y=o({...j(a,Q.slice(1),!1,U,!0),enabled:c===1}),X=o({...T(U),enabled:c===3}),oe=J.data?.entries??[],fe=e=>{let t=f.getState(),n=e&&t.providers.some(t=>t.id===e);x(`other`),w(n?void 0:e),t.setSelectedProvider(n?e:`__add_provider__`),P(`providers`)},$=()=>!W.current?.signal.aborted&&re===n()&&U===t(),pe=t=>{P(`tour`),H(null),E.getState().move(e,t)},me=()=>{$()&&r()},he=()=>{c===3?me():pe(c+1)},ge=async()=>{if(c===2){he();return}if(!(K.current||R||!W.current)){K.current=!0,B(!0),H(null);try{let e=c===0?v===`magpie`?[Q[0]]:[]:A;if(e.length){let t=await ae(e,a,W.current.signal);if(!$())return;if(t.failed.length){H(i(`tour.saveFailed`,{names:t.failed.join(`, `)}));return}}if(c===0&&v===`other`){let e=await s.fetchQuery({...l(a,U),staleTime:0});if(!$())return;if(e.partial||!e.providers.some(e=>Object.keys(e.models).length>0)){H(i(`tour.noModels`));return}await f.getState().loadProviders({directory:a,forceRefresh:!0,source:`setup-tour`})}$()&&he()}catch{$()&&H(i(`tour.operationFailed`))}finally{K.current=!1,$()&&B(!1)}}},_e=()=>{I===null?N===`tour`?c>0&&pe(c-1):P(`tour`):L(null)},ve=I===null?void 0:Y.data?.[Q[I]],ye=ve?.kind===`npm-ok`?ve.readme:void 0;return(0,Z.jsx)(_,{open:!0,onOpenChange:e=>{!e&&!R&&(I!==null||N!==`tour`?_e():me())},children:(0,Z.jsxs)(h,{className:`yuri-setup-tour yuri-settings-workspace`,showCloseButton:!1,"aria-describedby":void 0,children:[(0,Z.jsx)(`div`,{className:`yuri-tour-watermark`,"aria-hidden":`true`,children:(0,Z.jsx)(y,{width:440,height:440})}),(0,Z.jsx)(m,{children:(0,Z.jsxs)(g,{className:`yuri-tour-title`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`👋`}),i(`tour.title`).split(`Yuri`).map((e,t)=>(0,Z.jsxs)(G.Fragment,{children:[t>0&&(0,Z.jsx)(D,{width:`2.05em`}),(0,Z.jsx)(`span`,{children:e.trim()})]},t))]})}),(0,Z.jsxs)(`div`,{className:`yuri-tour-body`,children:[(0,Z.jsx)(`nav`,{className:`yuri-tour-progress`,"aria-label":i(`tour.title`),children:ce.map((e,t)=>(0,Z.jsxs)(u,{variant:`ghost`,size:`lg`,disabled:R,"aria-current":c===t?`step`:void 0,onClick:()=>{L(null),pe(t)},children:[(0,Z.jsx)(`span`,{className:`yuri-tour-number`,"aria-hidden":`true`,children:String(t+1).padStart(2,`0`)}),(0,Z.jsx)(`span`,{children:i(e)})]},e))}),(0,Z.jsx)(`div`,{className:d(`yuri-tour-content`,N===`providers`&&I===null&&`yuri-tour-provider-content`),children:(0,Z.jsxs)(`fieldset`,{disabled:R,className:`contents`,children:[I===null?N===`providers`?(0,Z.jsx)(F,{initialConnectionId:S}):N===`voice`&&X.data?(0,Z.jsx)(de,{settings:X.data,onComplete:me,onBusy:B}):N===`asr`||N===`tts`?(0,Z.jsx)(z,{section:N}):(0,Z.jsxs)(Z.Fragment,{children:[c<2&&(c===1&&Y.isError||J.isError)&&(0,Z.jsxs)(`div`,{role:`alert`,className:`yuri-tour-feedback`,children:[(0,Z.jsx)(`p`,{children:i(`tour.metadataUnavailable`)}),(0,Z.jsx)(u,{size:`xs`,onClick:()=>{c===1&&Y.refetch(),J.refetch()},children:i(`settings.plugins.status.retry`)})]}),c===0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{className:d(`yuri-tour-magpie yuri-tour-select-card`,v===`magpie`&&`yuri-tour-card-selected`),children:[(0,Z.jsx)(u,{variant:`ghost`,className:`yuri-tour-card-toggle`,"aria-label":`Magpie`,"aria-pressed":v===`magpie`,onClick:()=>x(v===`magpie`?`other`:`magpie`),children:(0,Z.jsx)(`span`,{className:`yuri-tour-card-check`,"aria-hidden":`true`,children:v===`magpie`&&(0,Z.jsx)(p,{name:`check`,className:`size-5`})})}),(0,Z.jsxs)(`div`,{className:`flex w-full items-center gap-3 pr-10`,children:[(0,Z.jsx)(C,{providerId:`magpie`,alt:`Magpie`,className:`size-8 shrink-0`}),(0,Z.jsx)(`span`,{className:`typography-ui-label`,children:`Magpie`}),(0,Z.jsx)(`span`,{className:`yuri-tour-recommended`,children:i(`tour.recommended`)})]}),(0,Z.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:i(`tour.magpieDescription`)}),(0,Z.jsxs)(`a`,{className:`yuri-tour-card-link typography-meta text-muted-foreground underline`,href:`https://usemagpie.ai/docs/start`,target:`_blank`,rel:`noreferrer`,children:[i(`tour.docs`),` ↗`]})]}),(0,Z.jsxs)(`div`,{className:`yuri-tour-provider-heading`,children:[(0,Z.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:`OpenCode`}),(0,Z.jsxs)(`a`,{className:`typography-meta text-muted-foreground underline`,href:`https://opencode.ai/docs/providers/`,target:`_blank`,rel:`noreferrer`,children:[i(`tour.docs`),` ↗`]})]}),(0,Z.jsx)(`div`,{className:`yuri-tour-provider-grid`,children:le.map(e=>(0,Z.jsxs)(u,{variant:`ghost`,className:`yuri-tour-provider-choice`,onClick:()=>fe(e.id),children:[(0,Z.jsx)(C,{providerId:e.id,alt:e.name,className:`size-6 shrink-0`}),(0,Z.jsx)(`span`,{children:e.name})]},e.id))}),(0,Z.jsxs)(u,{className:`mt-3`,size:`sm`,variant:`ghost`,onClick:()=>fe(),children:[i(`tour.otherProvider`),(0,Z.jsx)(p,{name:`arrow-right-s`,className:`size-4`})]})]}),c===1&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`yuri-tour-plugins`,children:[1,2].map(e=>(0,Z.jsx)(ue,{index:e,info:Y.data?.[Q[e]],installed:ie(oe,Q[e]),selected:A.includes(Q[e]),onSelect:()=>M(t=>t.includes(Q[e])?t.filter(t=>t!==Q[e]):[...t,Q[e]]),onReadme:()=>L(e)},e))}),(0,Z.jsxs)(`a`,{className:`mt-4 inline-block typography-meta text-muted-foreground underline underline-offset-4 hover:text-foreground`,href:`https://opencode.ai/docs/ecosystem/#plugins`,target:`_blank`,rel:`noopener noreferrer`,children:[i(`tour.morePlugins`),` ↗`]})]}),c===2&&(0,Z.jsx)(se,{onBusy:B,directory:a,onPrimaryChange:ne,onComplete:()=>pe(3)}),c===3&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`yuri-tour-voice-intro`,children:[(0,Z.jsx)(`h2`,{children:i(`tour.voiceHeading`)}),(0,Z.jsx)(`p`,{children:i(`tour.voiceIntro`)})]}),(0,Z.jsxs)(`div`,{className:`yuri-tour-voice-capabilities`,children:[(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(p,{name:`mic`,className:`yuri-tour-voice-icon`}),(0,Z.jsx)(`h3`,{children:i(`settings.voice.page.section.speechRecognition`)}),(0,Z.jsx)(`p`,{children:i(`tour.dictationDescription`)}),(0,Z.jsxs)(`div`,{className:`yuri-tour-voice-services`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20height='24'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDoubao%3c/title%3e%3cpath%20d='M5.31%2015.756c.172-3.75%201.883-5.999%202.549-6.739-3.26%202.058-5.425%205.658-6.358%208.308v1.12C1.501%2021.513%204.226%2024%207.59%2024a6.59%206.59%200%20002.2-.375c.353-.12.7-.248%201.039-.378.913-.899%201.65-1.91%202.243-2.992-4.877%202.431-7.974.072-7.763-4.5l.002.001z'%20fill='%231E37FC'%3e%3c/path%3e%3cpath%20d='M22.57%2010.283c-1.212-.901-4.109-2.404-7.397-2.8.295%203.792.093%208.766-2.1%2012.773a12.782%2012.782%200%2001-2.244%202.992c3.764-1.448%206.746-3.457%208.596-5.219%202.82-2.683%203.353-5.178%203.361-6.66a2.737%202.737%200%2000-.216-1.084v-.002z'%20fill='%2337E1BE'%3e%3c/path%3e%3cpath%20d='M14.303%201.867C12.955.7%2011.248%200%209.39%200%207.532%200%205.883.677%204.545%201.807%202.791%203.29%201.627%205.557%201.5%208.125v9.201c.932-2.65%203.097-6.25%206.357-8.307.5-.318%201.025-.595%201.569-.829%201.883-.801%203.878-.932%205.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z'%20fill='%23A569FF'%3e%3c/path%3e%3cpath%20d='M17.305%204.961a199.47%20199.47%200%2001-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648%202.786.869%205.617%203.288.395%206.185%201.898%207.396%202.8-1.306-1.275-3.475-3.487-5.266-5.323z'%20fill='%231E37FC'%3e%3c/path%3e%3c/svg%3e`,alt:``,className:`size-4`}),i(`settings.voice.volcengine.name`)]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(p,{name:`computer`}),i(`settings.voice.page.provider.local`)]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(p,{name:`server`}),i(`settings.voice.page.provider.server`)]})]}),(0,Z.jsxs)(u,{size:`sm`,onClick:()=>P(`asr`),children:[i(`tour.configureInput`),(0,Z.jsx)(p,{name:`arrow-right-s`,className:`size-4`})]})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(p,{name:`volume-up`,className:`yuri-tour-voice-icon`}),(0,Z.jsx)(`h3`,{children:i(`tour.readAloudTitle`)}),(0,Z.jsx)(`p`,{children:i(`tour.readAloudDescription`)}),(0,Z.jsxs)(`div`,{className:`yuri-tour-voice-services`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20height='24'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDoubao%3c/title%3e%3cpath%20d='M5.31%2015.756c.172-3.75%201.883-5.999%202.549-6.739-3.26%202.058-5.425%205.658-6.358%208.308v1.12C1.501%2021.513%204.226%2024%207.59%2024a6.59%206.59%200%20002.2-.375c.353-.12.7-.248%201.039-.378.913-.899%201.65-1.91%202.243-2.992-4.877%202.431-7.974.072-7.763-4.5l.002.001z'%20fill='%231E37FC'%3e%3c/path%3e%3cpath%20d='M22.57%2010.283c-1.212-.901-4.109-2.404-7.397-2.8.295%203.792.093%208.766-2.1%2012.773a12.782%2012.782%200%2001-2.244%202.992c3.764-1.448%206.746-3.457%208.596-5.219%202.82-2.683%203.353-5.178%203.361-6.66a2.737%202.737%200%2000-.216-1.084v-.002z'%20fill='%2337E1BE'%3e%3c/path%3e%3cpath%20d='M14.303%201.867C12.955.7%2011.248%200%209.39%200%207.532%200%205.883.677%204.545%201.807%202.791%203.29%201.627%205.557%201.5%208.125v9.201c.932-2.65%203.097-6.25%206.357-8.307.5-.318%201.025-.595%201.569-.829%201.883-.801%203.878-.932%205.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z'%20fill='%23A569FF'%3e%3c/path%3e%3cpath%20d='M17.305%204.961a199.47%20199.47%200%2001-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648%202.786.869%205.617%203.288.395%206.185%201.898%207.396%202.8-1.306-1.275-3.475-3.487-5.266-5.323z'%20fill='%231E37FC'%3e%3c/path%3e%3c/svg%3e`,alt:``,className:`size-4`}),i(`settings.voice.volcengine.name`)]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(C,{providerId:`openai`,alt:`OpenAI`,className:`size-4`}),`OpenAI`]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(p,{name:`computer`}),i(`settings.voice.page.provider.browser`)]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(p,{name:`cloud`}),i(`settings.voice.page.provider.custom`)]})]}),(0,Z.jsxs)(u,{size:`sm`,onClick:()=>P(`tts`),children:[i(`tour.configureReadAloud`),(0,Z.jsx)(p,{name:`arrow-right-s`,className:`size-4`})]})]})]}),(0,Z.jsxs)(`section`,{className:`yuri-tour-voice-recommendation`,children:[(0,Z.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20height='24'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDoubao%3c/title%3e%3cpath%20d='M5.31%2015.756c.172-3.75%201.883-5.999%202.549-6.739-3.26%202.058-5.425%205.658-6.358%208.308v1.12C1.501%2021.513%204.226%2024%207.59%2024a6.59%206.59%200%20002.2-.375c.353-.12.7-.248%201.039-.378.913-.899%201.65-1.91%202.243-2.992-4.877%202.431-7.974.072-7.763-4.5l.002.001z'%20fill='%231E37FC'%3e%3c/path%3e%3cpath%20d='M22.57%2010.283c-1.212-.901-4.109-2.404-7.397-2.8.295%203.792.093%208.766-2.1%2012.773a12.782%2012.782%200%2001-2.244%202.992c3.764-1.448%206.746-3.457%208.596-5.219%202.82-2.683%203.353-5.178%203.361-6.66a2.737%202.737%200%2000-.216-1.084v-.002z'%20fill='%2337E1BE'%3e%3c/path%3e%3cpath%20d='M14.303%201.867C12.955.7%2011.248%200%209.39%200%207.532%200%205.883.677%204.545%201.807%202.791%203.29%201.627%205.557%201.5%208.125v9.201c.932-2.65%203.097-6.25%206.357-8.307.5-.318%201.025-.595%201.569-.829%201.883-.801%203.878-.932%205.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z'%20fill='%23A569FF'%3e%3c/path%3e%3cpath%20d='M17.305%204.961a199.47%20199.47%200%2001-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648%202.786.869%205.617%203.288.395%206.185%201.898%207.396%202.8-1.306-1.275-3.475-3.487-5.266-5.323z'%20fill='%231E37FC'%3e%3c/path%3e%3c/svg%3e`,alt:``,className:`size-6 shrink-0`}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`h3`,{children:i(`settings.voice.volcengine.name`)}),(0,Z.jsx)(`span`,{className:`yuri-tour-recommended`,children:i(`tour.recommended`)})]}),(0,Z.jsx)(`p`,{children:i(`tour.voiceAllowance`)})]}),(0,Z.jsx)(u,{disabled:!X.data,size:`sm`,onClick:()=>P(`voice`),children:i(`tour.configureVoice`)})]}),X.isError&&(0,Z.jsxs)(`div`,{role:`alert`,className:`yuri-tour-feedback`,children:[(0,Z.jsx)(`p`,{children:i(`settings.voice.volcengine.loadFailed`)}),(0,Z.jsx)(u,{size:`xs`,onClick:()=>void X.refetch(),children:i(`settings.voice.volcengine.retry`)})]})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`h3`,{className:`typography-ui-label mb-4`,children:[q[I].name,` · README`]}),ye?(0,Z.jsx)(b,{content:ye,enableFileReferences:!1}):(0,Z.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:i(`tour.metadataUnavailable`)})]}),V&&I===null&&(0,Z.jsx)(`p`,{role:`alert`,className:`yuri-tour-feedback`,children:V})]})})]}),(0,Z.jsxs)(`footer`,{className:`yuri-tour-footer`,children:[(N!==`tour`||I!==null)&&(0,Z.jsx)(u,{variant:`ghost`,size:`sm`,disabled:R,onClick:_e,children:i(`onboarding.common.actions.back`)}),I===null&&(0,Z.jsxs)(`div`,{className:`ml-auto flex flex-wrap justify-end gap-2`,children:[(0,Z.jsx)(u,{variant:`ghost`,size:`sm`,disabled:R,onClick:he,children:i(`tour.later`)}),c===2?(0,Z.jsxs)(u,{size:`sm`,type:`submit`,form:`yuri-tour-import`,disabled:R||te.disabled,"aria-busy":R,children:[R&&(0,Z.jsx)(p,{name:`loader-4`,className:`size-3 animate-spin`}),i(te.background?`historyImport.background`:`historyImport.next`)]}):c===3?(0,Z.jsx)(u,{size:`sm`,disabled:R,type:N===`voice`?`submit`:`button`,form:N===`voice`?`yuri-tour-voice`:void 0,onClick:N===`voice`?void 0:me,children:i(N===`voice`?`settings.common.actions.saveChanges`:`tour.finish`)}):(0,Z.jsxs)(u,{size:`sm`,disabled:R||c<2&&(!J.data||J.isError),"aria-busy":R,onClick:()=>void ge(),children:[R&&(0,Z.jsx)(p,{name:`loader-4`,className:`size-3 animate-spin`}),i(`tour.continue`)]})]})]})]})})}export{fe as SetupTourDialog};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t}from"./runtime-fetch-V-iMWR8t.js";import{F as n,s as r}from"./platform-CiUKDeXd.js";import{it as i,ot as a,st as o}from"./vendor-base-ui-fom6orB6.js";import{f as s,p as c,r as l}from"./useUIStore-DjizmHAt.js";import{s as u}from"./terminalApi-CwTOFYhX.js";import{n as d,r as f,t as ee}from"./vendor-ghostty-web-DbBrwBII.js";import{t as p}from"./i18n-BvjeIWrT.js";import{In as m,Rn as h,Wi as g,p as _}from"./useMobileNavigationStore-BtHQN423.js";import{n as te}from"./useThemeSystem-D2YBbLma.js";import{n as v}from"./Icon-Br-W35tz.js";import{r as ne}from"./device-BlmHHWT1.js";import{n as y}from"./useEffectiveDirectory-DFe0GivQ.js";import{t as b}from"./OverlayScrollbar-CcX4ZP8W.js";import{n as x}from"./useProjectRuntimeAPIs-CnTyVRex.js";import{t as re}from"./sortable-tabs-strip-Bd9uV_sY.js";import{n as S,t as C}from"./useFontPreferences-DN1mCOsX.js";import{t as ie}from"./project-preview-BjTq299L.js";import{n as ae}from"./projectActions-BPmI9_mW.js";var w=e(o(),1);function oe(e){let{colors:t}=e,n=t.syntax.base;return{background:t.surface.background,foreground:n.foreground,cursor:t.interactive.cursor,cursorAccent:t.surface.background,selectionBackground:t.interactive.selection,selectionForeground:t.interactive.selectionForeground,selectionInactiveBackground:t.interactive.selection+`50`,black:t.surface.muted,red:t.status.error,green:t.status.success,yellow:t.status.warning,blue:n.function,magenta:n.keyword,cyan:n.type,white:n.foreground,brightBlack:n.comment,brightRed:t.status.error,brightGreen:t.status.success,brightYellow:t.status.warning,brightBlue:n.function,brightMagenta:n.keyword,brightCyan:n.type,brightWhite:t.surface.elevatedForeground}}function se(e,t,n,r,i=!1){return{cursorBlink:!1,cursorStyle:`bar`,fontSize:t,lineHeight:1.15,fontFamily:`${e}, "JetBrainsMonoNL Nerd Font", "FiraCode Nerd Font", "Cascadia Code PL", "Fira Code", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace`,allowTransparency:!1,theme:{background:n.background,foreground:n.foreground,cursor:n.cursor,cursorAccent:n.cursorAccent,selectionBackground:n.selectionBackground,selectionForeground:n.selectionForeground,black:n.black,red:n.red,green:n.green,yellow:n.yellow,blue:n.blue,magenta:n.magenta,cyan:n.cyan,white:n.white,brightBlack:n.brightBlack,brightRed:n.brightRed,brightGreen:n.brightGreen,brightYellow:n.brightYellow,brightBlue:n.brightBlue,brightMagenta:n.brightMagenta,brightCyan:n.brightCyan,brightWhite:n.brightWhite},scrollback:1e4,ghostty:r,disableStdin:i}}var ce=e(i(),1),T=a(),E=null;function D(){return E||=f.load(),E}function O(e){if(typeof window>`u`)return null;let t=[e,...Array.from(e.querySelectorAll(`*`))],n=null;for(let e of t){let t=window.getComputedStyle(e).overflowY;if(t===`auto`||t===`scroll`){if(e.scrollHeight-e.clientHeight>2)return e;n||=e}}return n}var k=w.forwardRef(({sessionKey:e,chunks:t,onInput:n,onResize:r,theme:i,fontFamily:a,fontSize:o,className:s,enableTouchScroll:c,autoFocus:l=!0,isVisible:u=!0},f)=>{let{t:m}=p(),_=w.useRef(null),te=w.useRef(null),v=w.useRef(null),ne=w.useRef(null),y=w.useRef(n),x=w.useRef(r),re=w.useRef(null),S=w.useRef(``),C=w.useRef(null),ie=w.useRef(!1),ae=w.useRef(null),oe=w.useRef(!0),E=w.useRef(null),k=w.useRef(null),le=w.useRef(0),ue=w.useRef(null),de=w.useRef(null),A=w.useRef(!1),j=w.useRef(!1),M=w.useRef(null),N=w.useRef(null),fe=w.useRef(null),pe=w.useRef(``),me=w.useRef(null),P=w.useRef(!c),he=w.useRef(u),[,ge]=w.useReducer(e=>e+1,0),[_e,ve]=w.useReducer(e=>e+1,0);y.current=n,x.current=r;let ye=typeof navigator<`u`&&(/Android/i.test(navigator.userAgent)||navigator.userAgentData?.platform===`Android`),F=!!c;w.useEffect(()=>{if(!c){P.current=!0,he.current=u;return}!he.current&&u&&(P.current=!1),he.current=u},[c,u]);let be=w.useCallback(()=>{if(!F)return;let e=_.current,t=ue.current;if(!e)return;let n=[];e.getAttribute(`contenteditable`)===`true`&&n.push(e),n.push(...Array.from(e.querySelectorAll(`[contenteditable="true"]`))),n.forEach(e=>{e.setAttribute(`data-terminal-disabled-contenteditable`,`true`),e.setAttribute(`contenteditable`,`false`),e.setAttribute(`aria-hidden`,`true`),e.tabIndex=-1,e.style.setProperty(`caret-color`,`transparent`),e.style.color=`transparent`,e.style.setProperty(`-webkit-text-fill-color`,`transparent`),e.style.background=`transparent`,e.style.outline=`none`,e.style.boxShadow=`none`,e.style.textShadow=`none`,e.style.setProperty(`user-select`,`none`),e.style.setProperty(`-webkit-user-select`,`none`)}),e.tabIndex=-1,e.removeAttribute(`role`),e.removeAttribute(`aria-multiline`),Array.from(e.querySelectorAll(`textarea`)).forEach(e=>{e.style.setProperty(`caret-color`,`transparent`),e.style.color=`transparent`,e.style.setProperty(`-webkit-text-fill-color`,`transparent`),e.style.background=`transparent`,e.style.border=`0`,e.style.outline=`none`,e.style.boxShadow=`none`,e.style.textShadow=`none`,e.style.fontSize=`0`,e.style.lineHeight=`0`,e!==t&&e.getAttribute(`data-terminal-disabled-input`)!==`true`&&(e.setAttribute(`data-terminal-disabled-input`,`true`),e.setAttribute(`aria-hidden`,`true`),e.tabIndex=-1,e.disabled=!0,e.style.position=`absolute`,e.style.opacity=`0`,e.style.width=`0px`,e.style.height=`0px`,e.style.pointerEvents=`none`,e.style.zIndex=`-1`)})},[F]),I=w.useCallback(e=>{if(me.current===e)return;let t=v.current;if(t)try{if(typeof t.setOption==`function`){t.setOption(`cursorBlink`,e),me.current=e;return}t.options&&(t.options.cursorBlink=e,me.current=e)}catch{}},[]),L=F&&ye,R=w.useCallback((e,t)=>{let n=L?de.current:ue.current,r=_.current;if(!n||!r)return;let i=r.getBoundingClientRect(),a=typeof window<`u`?window.innerWidth:i.width,o=typeof window<`u`?window.innerHeight:i.height,s=i.left+i.width/2,c=i.top+i.height-12,l=typeof e==`number`?e:s,u=typeof t==`number`?t:c,d=Math.max(8,Math.min(a-8,l)),f=Math.max(8,Math.min(o-8,u));n.style.left=`${d}px`,n.style.top=`${f}px`,n.style.bottom=``,(n instanceof HTMLTextAreaElement||n instanceof HTMLInputElement)&&(n.disabled=!1,n.readOnly=!1,n.removeAttribute(`disabled`),n.removeAttribute(`readonly`));try{n.focus({preventScroll:!0})}catch{try{n.focus()}catch{}}},[L]),z=w.useCallback(()=>{if(F){R(),I(!0);return}v.current?.focus(),I(!0)},[R,I,F]),B=w.useCallback(e=>e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement?e.value:e.textContent??``,[]),V=w.useCallback(e=>{if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){e.value=``;return}e.textContent=``},[]),xe=w.useCallback(e=>{if(typeof window>`u`||L)return;fe.current!==null&&(window.clearTimeout(fe.current),fe.current=null);let t=0,n=()=>{fe.current=window.setTimeout(()=>{fe.current=null;let r=B(e);if(!r){if(t+=1,t<3){n();return}return}let i=pe.current;pe.current=r;let a=r.startsWith(i)?r.slice(i.length):r;a&&y.current(a.replace(/\r\n|\r|\n/g,`\r`)),V(e),pe.current=``},t===0?0:24)};n()},[V,B,L]);w.useEffect(()=>{let e=_.current;if(!F||!e||c)return;let t=t=>{let n=t.target;if(n&&n.getAttribute(`data-terminal-hidden-input`)!==`true`&&e.contains(n)){try{n.blur()}catch{}R()}};return e.addEventListener(`focusin`,t,!0),()=>{e.removeEventListener(`focusin`,t,!0)}},[c,F,R]);let Se=w.useCallback(()=>{let e=v.current;if(!e||typeof e.getSelection!=`function`)return``;let t=e.getSelection();return typeof t==`string`?t:``},[]),H=w.useCallback(()=>{if(typeof window>`u`)return``;let e=window.getSelection();if(!e)return``;let t=e.toString();if(!t.trim())return``;let n=_.current;if(!n)return``;let r=e.anchorNode,i=e.focusNode;return r&&!n.contains(r)||i&&!n.contains(i)?``:t},[]),U=w.useCallback(async()=>{if(typeof document>`u`)return;let e=Se()||H();e.trim()&&await g(e)},[H,Se]),W=w.useCallback(()=>Se().trim()?!0:!!H().trim(),[H,Se]);w.useEffect(()=>{if(typeof window>`u`)return;let e=e=>{W()&&(e.preventDefault(),U())};return window.addEventListener(`yuri:copy`,e),()=>{window.removeEventListener(`yuri:copy`,e)}},[U,W]);let G=w.useCallback(()=>{S.current=``,C.current!==null&&typeof window<`u`&&window.cancelAnimationFrame(C.current),C.current=null,ie.current=!1,ae.current=null},[]),K=w.useCallback(()=>{let e=ne.current,t=v.current,n=_.current;if(!e||!t||!n)return;let r=n.getBoundingClientRect();if(!(r.width<24||r.height<24))try{e.fit();let n={cols:t.cols,rows:t.rows},r=re.current;(!r||r.cols!==n.cols||r.rows!==n.rows)&&(re.current=n,x.current(n.cols,n.rows))}catch{}},[]),Ce=w.useCallback(()=>{if(ie.current)return;let e=v.current;if(!e){G();return}if(!S.current)return;let t=S.current;S.current=``,ie.current=!0,e.write(t,()=>{ie.current=!1,S.current&&(typeof window<`u`?C.current=window.requestAnimationFrame(()=>{C.current=null,Ce()}):Ce())})},[G]),we=w.useCallback(()=>{C.current===null&&(typeof window<`u`?C.current=window.requestAnimationFrame(()=>{C.current=null,Ce()}):Ce())},[Ce]),Te=w.useCallback(e=>{e&&(S.current+=e,we())},[we]),Ee=w.useCallback(()=>{if(E.current?.(),E.current=null,k.current!==null&&typeof window<`u`&&(window.clearTimeout(k.current),k.current=null),!c){le.current=0;return}let e=_.current;if(!e)return;let t=v.current;if(!t)return;le.current=0;let n=2.2,r=2.8,i=.25,a=.05,s=.015,l={lastY:null,lastTime:null,velocity:0,rafId:null,startX:null,startY:null,didMove:!1},u=()=>typeof performance<`u`?performance.now():Date.now(),d=Math.max(12,Math.round(o*1.35)),f=0,ee=e=>{if(!e)return!1;let n=t.getViewportY(),r=f+e,i=Math.trunc(r/d);return f=r-i*d,i!==0&&t.scrollLines(i),t.getViewportY()!==n},p=()=>{l.rafId!==null&&typeof window<`u`&&window.cancelAnimationFrame(l.rafId),l.rafId=null},m={passive:!1,capture:!1};if(typeof window<`u`&&`PointerEvent`in window){let t=Object.assign(l,{pointerId:null,startX:null,startY:null,moved:!1}),o=n=>{if(n.pointerType===`touch`){p(),t.pointerId=n.pointerId,t.startX=n.clientX,t.startY=n.clientY,t.moved=!1,t.lastY=n.clientY,t.lastTime=u(),t.velocity=0;try{e.setPointerCapture(n.pointerId)}catch{}}},d=e=>{if(e.pointerType!==`touch`||t.pointerId!==e.pointerId)return;if(t.startX!==null&&t.startY!==null&&!t.moved){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>=6&&(t.moved=!0)}if(t.lastY===null){t.lastY=e.clientY,t.lastTime=u();return}let a=t.lastY,o=t.lastTime??u(),s=u();t.lastY=e.clientY,t.lastTime=s;let c=a-e.clientY;if(Math.abs(c)<1)return;let l=Math.max(s-o,8),d=c*(n+Math.min(r,Math.abs(c)/25)),f=d/l;t.velocity=t.velocity*.75+f*i,t.velocity>8?t.velocity=8:t.velocity<-8&&(t.velocity=-8),t.moved&&(e.cancelable&&e.preventDefault(),e.stopPropagation()),ee(d)},f=n=>{if(n.pointerType!==`touch`||t.pointerId!==n.pointerId)return;let r=!t.moved;t.pointerId=null,t.startX=null,t.startY=null,t.moved=!1,t.lastY=null,t.lastTime=null;try{e.releasePointerCapture(n.pointerId)}catch{}if(r){F?R(n.clientX,n.clientY):c&&!P.current&&(P.current=!0,v.current?.focus());return}if(typeof window>`u`)return;if(Math.abs(t.velocity)<a){t.velocity=0;return}let i=u(),o=()=>{let e=u(),n=Math.max(e-i,8);i=e;let r=ee(t.velocity*n)??!1,c=Math.sign(t.velocity),l=Math.max(0,Math.abs(t.velocity)-s*n);if(t.velocity=l*c,!r||l<=a){p(),t.velocity=0;return}t.rafId=window.requestAnimationFrame(o)};t.rafId=window.requestAnimationFrame(o)};e.addEventListener(`pointerdown`,o,m),e.addEventListener(`pointermove`,d,m),e.addEventListener(`pointerup`,f,m),e.addEventListener(`pointercancel`,f,m);let h=e.style.touchAction,g=e.style.overscrollBehaviorY;e.style.touchAction=`none`,e.style.overscrollBehaviorY=`contain`,E.current=()=>{p(),k.current!==null&&typeof window<`u`&&(window.clearTimeout(k.current),k.current=null),le.current=0,e.removeEventListener(`pointerdown`,o,m),e.removeEventListener(`pointermove`,d,m),e.removeEventListener(`pointerup`,f,m),e.removeEventListener(`pointercancel`,f,m),e.style.touchAction=h,e.style.overscrollBehaviorY=g};return}let h=e=>{e.touches.length===1&&(p(),l.lastY=e.touches[0].clientY,l.lastTime=u(),l.velocity=0,l.startX=e.touches[0].clientX,l.startY=e.touches[0].clientY,l.didMove=!1)},g=e=>{if(e.touches.length!==1){l.lastY=null,l.lastTime=null,l.velocity=0,l.startX=null,l.startY=null,l.didMove=!1,p();return}let t=e.touches[0].clientX,a=e.touches[0].clientY;if(l.startX!==null&&l.startY!==null&&!l.didMove){let e=t-l.startX,n=a-l.startY;Math.hypot(e,n)>=6&&(l.didMove=!0)}if(l.lastY===null){l.lastY=a,l.lastTime=u();return}let o=l.lastY,s=l.lastTime??u(),c=u();l.lastY=a,l.lastTime=c;let d=o-a;if(Math.abs(d)<1)return;let f=Math.max(c-s,8),m=d*(n+Math.min(r,Math.abs(d)/25)),h=m/f;l.velocity=l.velocity*.75+h*i,l.velocity>8?l.velocity=8:l.velocity<-8&&(l.velocity=-8),l.didMove&&(e.preventDefault(),e.stopPropagation()),ee(m)},te=e=>{let t=!l.didMove;l.lastY=null,l.lastTime=null;let n=l.velocity;if(l.startX=null,l.startY=null,l.didMove=!1,t){let t=e.changedTouches?.[0];F?R(t?.clientX,t?.clientY):c&&!P.current&&(P.current=!0,v.current?.focus());return}if(typeof window>`u`)return;if(Math.abs(n)<a){l.velocity=0;return}let r=u(),i=()=>{let e=u(),t=Math.max(e-r,8);r=e;let n=ee(l.velocity*t)??!1,o=Math.sign(l.velocity),c=Math.max(0,Math.abs(l.velocity)-s*t);if(l.velocity=c*o,!n||c<=a){p(),l.velocity=0;return}l.rafId=window.requestAnimationFrame(i)};l.rafId=window.requestAnimationFrame(i)};e.addEventListener(`touchstart`,h,m),e.addEventListener(`touchmove`,g,m),e.addEventListener(`touchend`,te,m),e.addEventListener(`touchcancel`,te,m);let ne=e.style.touchAction,y=e.style.overscrollBehaviorY;e.style.touchAction=`none`,e.style.overscrollBehaviorY=`contain`,E.current=()=>{p(),k.current!==null&&typeof window<`u`&&(window.clearTimeout(k.current),k.current=null),le.current=0,e.removeEventListener(`touchstart`,h,m),e.removeEventListener(`touchmove`,g,m),e.removeEventListener(`touchend`,te,m),e.removeEventListener(`touchcancel`,te,m),e.style.touchAction=ne,e.style.overscrollBehaviorY=y}},[c,F,R,o]);w.useEffect(()=>{let e=!1,t=null,n=null,r=null,s=[],l=null,u=null,f=null,p=_.current;if(!p)return;if(p.tabIndex=F?-1:0,F){let e=p.focus.bind(p),t=p;t.focus=((...e)=>{R()}),f=()=>{t.focus=e}}let m=()=>{I(!0)},h=()=>{I(!1)},g=e=>{let t=e.target;if(t&&p.contains(t)){if(F&&t instanceof HTMLElement){window.setTimeout(()=>{t.blur(),R()},0),I(!1);return}if(c&&!P.current&&t instanceof HTMLElement){window.setTimeout(()=>{t.blur()},0),I(!1);return}I(!0);return}I(!1)},b=()=>{I(!1)},x=null;return(async()=>{try{let f=await D();if(e)return;let g=se(a,o,i,f,!1),_=new d(g);oe.current=!0,F&&(_.focus=()=>{});let b=_;if(typeof b.scrollToBottom==`function`){let e=b.scrollToBottom.bind(b);b.scrollToBottom=()=>{oe.current&&e()},l=()=>{b.scrollToBottom=e}}let re=new ee;if(t=_,v.current=_,ne.current=re,_.loadAddon(re),_.open(p),c){let e=_.renderer;if(e&&typeof e.renderScrollbar==`function`){let t=e.renderScrollbar.bind(e);e.renderScrollbar=()=>{},u=()=>{e.renderScrollbar=t}}}ve(),me.current=!1,x=_.textarea??p.querySelector(`textarea`),x&&(x.addEventListener(`focus`,m),x.addEventListener(`blur`,h)),be(),typeof MutationObserver<`u`&&(r=new MutationObserver(()=>{be()}),r.observe(p,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`contenteditable`,`role`,`tabindex`,`aria-label`]}));let S=O(p);S?(S.classList.add(`overlay-scrollbar-target`,`overlay-scrollbar-container`),te.current=S,ge()):te.current=null,K();let C=re;typeof C.observeResize==`function`&&C.observeResize(),Ee(),s=[_.onData(e=>{y.current(e)}),_.onScroll(e=>{if(typeof e==`number`&&Number.isFinite(e)){let t=typeof _.hasSelection==`function`&&_.hasSelection();oe.current=!t&&e<=.5}}),_.onSelectionChange(()=>{if(typeof _.hasSelection==`function`&&_.hasSelection()){oe.current=!1;return}let e=typeof _.getViewportY==`function`?_.getViewportY():0;oe.current=e<=.5})],n=new ResizeObserver(()=>{K()}),n.observe(p),typeof window<`u`&&window.setTimeout(()=>{K()},0)}catch{}})(),document.addEventListener(`focusin`,g,!0),window.addEventListener(`blur`,b),()=>{e=!0,E.current?.(),E.current=null,document.removeEventListener(`focusin`,g,!0),window.removeEventListener(`blur`,b),s.forEach(e=>e.dispose()),l?.(),l=null,u?.(),u=null,x&&(x.removeEventListener(`focus`,m),x.removeEventListener(`blur`,h)),n?.disconnect(),r?.disconnect(),f?.(),t?.dispose(),v.current=null,ne.current=null,te.current=null,re.current=null,me.current=null,G()}},[be,c,K,R,a,o,Ee,i,G,I,F]),w.useEffect(()=>{let e=v.current;e&&(e.reset(),G(),re.current=null,K())},[e,_e,K,G]),w.useEffect(()=>{l&&v.current&&z()},[l,z,e,_e]),w.useEffect(()=>(Ee(),()=>{E.current?.(),E.current=null}),[Ee,e]),w.useEffect(()=>{let e=v.current;if(!e)return;if(t.length===0){ae.current!==null&&(e.reset(),G(),K());return}let n=ae.current,r;if(n===null)r=t;else{let e=t.findIndex(e=>e.id===n);r=e>=0?t.slice(e+1):t}r.length>0&&Te(r.map(e=>e.data).join(``)),ae.current=t[t.length-1].id},[t,_e,Te,K,G]),w.useImperativeHandle(f,()=>({focus:()=>{z()},clear:()=>{let e=v.current;e&&(e.reset(),G(),K())},fit:()=>{K()}}),[z,K,G]);let De=w.useCallback(e=>{if(!F)return;let t=_.current,n=e.relatedTarget,r=n?.tagName;r===`INPUT`||r===`TEXTAREA`||n?.isContentEditable,n?.getAttribute(`data-terminal-hidden-input`),n&&t?.contains(n)},[F]),q=w.useCallback(e=>{let t=e.nativeEvent,n=t?.inputType??``,r=typeof t?.data==`string`?t.data:``;if(N.current=typeof performance<`u`?performance.now():Date.now(),n===`insertCompositionText`){A.current=!0;return}if(!n&&r){if(A.current)return;e.preventDefault(),y.current(r),M.current={type:`insertText`,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0;return}if(n===`insertText`&&r){if(A.current)return;e.preventDefault(),y.current(r),M.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0;return}if(n===`insertLineBreak`){if(A.current)return;e.preventDefault(),y.current(`\r`),M.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0;return}if(n===`deleteContentBackward`){if(A.current)return;e.preventDefault(),y.current(``),M.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0}},[]),Oe=w.useCallback(e=>{let t=e.currentTarget;if(N.current=typeof performance<`u`?performance.now():Date.now(),A.current)return;if(j.current){let e=M.current,n=typeof performance<`u`?performance.now():Date.now();if(e&&n-e.at<50){j.current=!1,V(t);return}j.current=!1}let n=B(t);if(!n)return;pe.current=n;let r=n.replace(/\r\n|\r|\n/g,`\r`);y.current(r),V(t),pe.current=``},[V,B]),J=w.useCallback(e=>{e.stopPropagation();let t=e.key.toLowerCase(),n=e.metaKey&&!e.ctrlKey&&!e.altKey&&t===`c`,r=e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey&&t===`c`;if((n||r)&&W()){e.preventDefault(),U();return}if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1){let t=e.key.toUpperCase();if(t>=`A`&&t<=`Z`){e.preventDefault(),e.nativeEvent?.stopImmediatePropagation(),y.current(String.fromCharCode(t.charCodeAt(0)-64)),V(e.currentTarget);return}}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key.length===1){e.preventDefault(),e.nativeEvent?.stopImmediatePropagation(),y.current(`\x1B`+e.key),V(e.currentTarget);return}let i={ArrowUp:`\x1B[A`,ArrowDown:`\x1B[B`,ArrowRight:`\x1B[C`,ArrowLeft:`\x1B[D`,Escape:`\x1B`,Tab:` `,Delete:`\x1B[3~`,Home:`\x1B[H`,End:`\x1B[F`}[e.key];if(i){e.preventDefault(),y.current(i),V(e.currentTarget);return}let a=e.currentTarget;if(e.nativeEvent?.isComposing)return;let o=M.current,s=typeof performance<`u`?performance.now():Date.now(),c=!!(o&&s-o.at<50);if(e.key===`Enter`){if(c&&o?.type===`insertLineBreak`)return;e.preventDefault(),y.current(`\r`),V(a);return}if(e.key===`Backspace`){if(e.preventDefault(),c&&o?.type===`deleteContentBackward`)return;B(a)||y.current(``)}if(e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let t=N.current;t&&s-t<50||(e.preventDefault(),y.current(e.key),j.current=!0,M.current={type:`keydown-text`,at:s})}xe(a)},[V,U,W,B,xe]),ke=w.useCallback(e=>{e.stopPropagation();let t=e.currentTarget;e.nativeEvent?.isComposing||xe(t)},[xe]),Y=w.useCallback(e=>{let t=e.currentTarget;A.current=!1;let n=e.data||B(t);if(N.current=typeof performance<`u`?performance.now():Date.now(),!n)return;let r=n.replace(/\r\n|\r|\n/g,`\r`);y.current(r),V(t),M.current={type:`compositionend`,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0},[V,B]),X=w.useCallback(e=>{e.stopPropagation();let t=e.clipboardData?.getData(`text`)??``;if(!t)return;e.preventDefault();let n=v.current?.hasBracketedPaste?.()?`\x1b[200~${t}\x1b[201~`:t;y.current(n)},[]),Z={position:`fixed`,left:0,top:0,width:1,height:1,opacity:0,zIndex:-1,background:`transparent`,color:`transparent`,WebkitTextFillColor:`transparent`,caretColor:`transparent`,textShadow:`none`,WebkitAppearance:`none`,appearance:`none`,resize:`none`,overflow:`hidden`,whiteSpace:`nowrap`,border:`0`,padding:0,margin:0,outline:`none`,outlineOffset:0,fontSize:16,fontWeight:400,pointerEvents:`none`,WebkitUserSelect:`none`,userSelect:`none`};return(0,T.jsxs)(`div`,{ref:_,className:h(`relative h-full w-full terminal-viewport-container`,s),"data-hidden-input-overlay-active":F?`true`:void 0,style:{backgroundColor:i.background},onTouchStart:e=>{if(!(!F||c)&&!W()){let t=e.touches?.[0];R(t?.clientX,t?.clientY)}},onClick:e=>{if(!c)if(F){if(W())return;R(e.clientX,e.clientY)}else v.current?.focus()},onMouseUp:()=>{!c&&W()&&U()},onTouchEnd:()=>{!c&&W()&&U()},children:[F&&typeof document<`u`?(0,ce.createPortal)((0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`input`,{ref:de,type:`text`,inputMode:`text`,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,tabIndex:-1,enterKeyHint:`send`,"data-terminal-hidden-input":`true`,"aria-label":m(`terminalView.viewport.inputAria`),"aria-hidden":`true`,style:{...Z,display:L?`block`:`none`},onBlur:De,onBeforeInput:q,onCompositionStart:()=>{A.current=!0},onInput:Oe,onKeyDown:J,onKeyUp:ke,onCompositionEnd:Y,onPaste:X}),(0,T.jsx)(`textarea`,{ref:ue,inputMode:`text`,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,tabIndex:-1,enterKeyHint:`send`,"data-terminal-hidden-input":`true`,"aria-label":m(`terminalView.viewport.inputAria`),"aria-hidden":`true`,style:{...Z,display:L?`none`:`block`},onBlur:De,onBeforeInput:q,onCompositionStart:()=>{A.current=!0},onInput:Oe,onKeyDown:J,onKeyUp:ke,onCompositionEnd:Y,onPaste:X})]}),document.body):null,te.current&&!c?(0,T.jsx)(b,{containerRef:te,disableHorizontal:!0,className:`overlay-scrollbar--flush overlay-scrollbar--dense overlay-scrollbar--zero`}):null]})});k.displayName=`TerminalViewport`;var le=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),ue=/(https?:\/\/(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[(?:::1|::)\])(?::\d{2,5})?(?:\/[^\s<>'"`]*)?)/gi,de=/(?:➜\s*(?:Local|Network):)|\b(?:local|network|loopback|serving|listening|available|ready|started|running|server|vite|webpack|next\.js|astro|sveltekit|nuxt)\b/i,A=/Serving HTTP on .*? port (\d{2,5})/i,j=new Set([`.`,`,`,`;`,`:`,`!`,`?`]),M=e=>{let t=e;for(;t.length>0;){let e=t[t.length-1];if(e===`)`||e===`]`||e===`}`||e===`>`){let n=e===`)`?`(`:e===`]`?`[`:e===`}`?`{`:`<`,r=t.slice(0,-1);if((r.match(RegExp(`\\${n}`,`g`))||[]).length>(r.match(RegExp(`\\${e}`,`g`))||[]).length)break;t=r;continue}if(j.has(e)){t=t.slice(0,-1);continue}break}return t},N=e=>{let t=M(e);return t=t.replace(`0.0.0.0`,`127.0.0.1`),t=t.replace(`[::1]`,`127.0.0.1`),t=t.replace(`[::]`,`127.0.0.1`),t},fe=e=>{if(!e)return null;let t=e.replace(le,``),n=t.match(A);if(n?.[1]){let e=Number.parseInt(n[1],10);if(Number.isFinite(e)&&e>0&&e<=65535)return`http://127.0.0.1:${e}/`}let r=t.split(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t}from"./runtime-fetch-V-iMWR8t.js";import{F as n,s as r}from"./platform-CiUKDeXd.js";import{it as i,ot as a,st as o}from"./vendor-base-ui-fom6orB6.js";import{f as s,p as c,r as l}from"./useUIStore-DjizmHAt.js";import{s as u}from"./terminalApi-CwTOFYhX.js";import{n as d,r as f,t as ee}from"./vendor-ghostty-web-DbBrwBII.js";import{t as p}from"./i18n-BvjeIWrT.js";import{In as m,Rn as h,Wi as g,p as _}from"./useMobileNavigationStore-oveTY29a.js";import{n as te}from"./useThemeSystem-D2YBbLma.js";import{n as v}from"./Icon-DebSeH2D.js";import{r as ne}from"./device-BlmHHWT1.js";import{n as y}from"./useEffectiveDirectory-BN5qbhev.js";import{t as b}from"./OverlayScrollbar-B1PH1Jtv.js";import{n as x}from"./useProjectRuntimeAPIs-B-ShHy6s.js";import{t as re}from"./sortable-tabs-strip-BwnT5maB.js";import{n as S,t as C}from"./useFontPreferences-DN1mCOsX.js";import{t as ie}from"./project-preview-BjTq299L.js";import{n as ae}from"./projectActions-BPmI9_mW.js";var w=e(o(),1);function oe(e){let{colors:t}=e,n=t.syntax.base;return{background:t.surface.background,foreground:n.foreground,cursor:t.interactive.cursor,cursorAccent:t.surface.background,selectionBackground:t.interactive.selection,selectionForeground:t.interactive.selectionForeground,selectionInactiveBackground:t.interactive.selection+`50`,black:t.surface.muted,red:t.status.error,green:t.status.success,yellow:t.status.warning,blue:n.function,magenta:n.keyword,cyan:n.type,white:n.foreground,brightBlack:n.comment,brightRed:t.status.error,brightGreen:t.status.success,brightYellow:t.status.warning,brightBlue:n.function,brightMagenta:n.keyword,brightCyan:n.type,brightWhite:t.surface.elevatedForeground}}function se(e,t,n,r,i=!1){return{cursorBlink:!1,cursorStyle:`bar`,fontSize:t,lineHeight:1.15,fontFamily:`${e}, "JetBrainsMonoNL Nerd Font", "FiraCode Nerd Font", "Cascadia Code PL", "Fira Code", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace`,allowTransparency:!1,theme:{background:n.background,foreground:n.foreground,cursor:n.cursor,cursorAccent:n.cursorAccent,selectionBackground:n.selectionBackground,selectionForeground:n.selectionForeground,black:n.black,red:n.red,green:n.green,yellow:n.yellow,blue:n.blue,magenta:n.magenta,cyan:n.cyan,white:n.white,brightBlack:n.brightBlack,brightRed:n.brightRed,brightGreen:n.brightGreen,brightYellow:n.brightYellow,brightBlue:n.brightBlue,brightMagenta:n.brightMagenta,brightCyan:n.brightCyan,brightWhite:n.brightWhite},scrollback:1e4,ghostty:r,disableStdin:i}}var ce=e(i(),1),T=a(),E=null;function D(){return E||=f.load(),E}function O(e){if(typeof window>`u`)return null;let t=[e,...Array.from(e.querySelectorAll(`*`))],n=null;for(let e of t){let t=window.getComputedStyle(e).overflowY;if(t===`auto`||t===`scroll`){if(e.scrollHeight-e.clientHeight>2)return e;n||=e}}return n}var k=w.forwardRef(({sessionKey:e,chunks:t,onInput:n,onResize:r,theme:i,fontFamily:a,fontSize:o,className:s,enableTouchScroll:c,autoFocus:l=!0,isVisible:u=!0},f)=>{let{t:m}=p(),_=w.useRef(null),te=w.useRef(null),v=w.useRef(null),ne=w.useRef(null),y=w.useRef(n),x=w.useRef(r),re=w.useRef(null),S=w.useRef(``),C=w.useRef(null),ie=w.useRef(!1),ae=w.useRef(null),oe=w.useRef(!0),E=w.useRef(null),k=w.useRef(null),le=w.useRef(0),ue=w.useRef(null),de=w.useRef(null),A=w.useRef(!1),j=w.useRef(!1),M=w.useRef(null),N=w.useRef(null),fe=w.useRef(null),pe=w.useRef(``),me=w.useRef(null),P=w.useRef(!c),he=w.useRef(u),[,ge]=w.useReducer(e=>e+1,0),[_e,ve]=w.useReducer(e=>e+1,0);y.current=n,x.current=r;let ye=typeof navigator<`u`&&(/Android/i.test(navigator.userAgent)||navigator.userAgentData?.platform===`Android`),F=!!c;w.useEffect(()=>{if(!c){P.current=!0,he.current=u;return}!he.current&&u&&(P.current=!1),he.current=u},[c,u]);let be=w.useCallback(()=>{if(!F)return;let e=_.current,t=ue.current;if(!e)return;let n=[];e.getAttribute(`contenteditable`)===`true`&&n.push(e),n.push(...Array.from(e.querySelectorAll(`[contenteditable="true"]`))),n.forEach(e=>{e.setAttribute(`data-terminal-disabled-contenteditable`,`true`),e.setAttribute(`contenteditable`,`false`),e.setAttribute(`aria-hidden`,`true`),e.tabIndex=-1,e.style.setProperty(`caret-color`,`transparent`),e.style.color=`transparent`,e.style.setProperty(`-webkit-text-fill-color`,`transparent`),e.style.background=`transparent`,e.style.outline=`none`,e.style.boxShadow=`none`,e.style.textShadow=`none`,e.style.setProperty(`user-select`,`none`),e.style.setProperty(`-webkit-user-select`,`none`)}),e.tabIndex=-1,e.removeAttribute(`role`),e.removeAttribute(`aria-multiline`),Array.from(e.querySelectorAll(`textarea`)).forEach(e=>{e.style.setProperty(`caret-color`,`transparent`),e.style.color=`transparent`,e.style.setProperty(`-webkit-text-fill-color`,`transparent`),e.style.background=`transparent`,e.style.border=`0`,e.style.outline=`none`,e.style.boxShadow=`none`,e.style.textShadow=`none`,e.style.fontSize=`0`,e.style.lineHeight=`0`,e!==t&&e.getAttribute(`data-terminal-disabled-input`)!==`true`&&(e.setAttribute(`data-terminal-disabled-input`,`true`),e.setAttribute(`aria-hidden`,`true`),e.tabIndex=-1,e.disabled=!0,e.style.position=`absolute`,e.style.opacity=`0`,e.style.width=`0px`,e.style.height=`0px`,e.style.pointerEvents=`none`,e.style.zIndex=`-1`)})},[F]),I=w.useCallback(e=>{if(me.current===e)return;let t=v.current;if(t)try{if(typeof t.setOption==`function`){t.setOption(`cursorBlink`,e),me.current=e;return}t.options&&(t.options.cursorBlink=e,me.current=e)}catch{}},[]),L=F&&ye,R=w.useCallback((e,t)=>{let n=L?de.current:ue.current,r=_.current;if(!n||!r)return;let i=r.getBoundingClientRect(),a=typeof window<`u`?window.innerWidth:i.width,o=typeof window<`u`?window.innerHeight:i.height,s=i.left+i.width/2,c=i.top+i.height-12,l=typeof e==`number`?e:s,u=typeof t==`number`?t:c,d=Math.max(8,Math.min(a-8,l)),f=Math.max(8,Math.min(o-8,u));n.style.left=`${d}px`,n.style.top=`${f}px`,n.style.bottom=``,(n instanceof HTMLTextAreaElement||n instanceof HTMLInputElement)&&(n.disabled=!1,n.readOnly=!1,n.removeAttribute(`disabled`),n.removeAttribute(`readonly`));try{n.focus({preventScroll:!0})}catch{try{n.focus()}catch{}}},[L]),z=w.useCallback(()=>{if(F){R(),I(!0);return}v.current?.focus(),I(!0)},[R,I,F]),B=w.useCallback(e=>e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement?e.value:e.textContent??``,[]),V=w.useCallback(e=>{if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){e.value=``;return}e.textContent=``},[]),xe=w.useCallback(e=>{if(typeof window>`u`||L)return;fe.current!==null&&(window.clearTimeout(fe.current),fe.current=null);let t=0,n=()=>{fe.current=window.setTimeout(()=>{fe.current=null;let r=B(e);if(!r){if(t+=1,t<3){n();return}return}let i=pe.current;pe.current=r;let a=r.startsWith(i)?r.slice(i.length):r;a&&y.current(a.replace(/\r\n|\r|\n/g,`\r`)),V(e),pe.current=``},t===0?0:24)};n()},[V,B,L]);w.useEffect(()=>{let e=_.current;if(!F||!e||c)return;let t=t=>{let n=t.target;if(n&&n.getAttribute(`data-terminal-hidden-input`)!==`true`&&e.contains(n)){try{n.blur()}catch{}R()}};return e.addEventListener(`focusin`,t,!0),()=>{e.removeEventListener(`focusin`,t,!0)}},[c,F,R]);let Se=w.useCallback(()=>{let e=v.current;if(!e||typeof e.getSelection!=`function`)return``;let t=e.getSelection();return typeof t==`string`?t:``},[]),H=w.useCallback(()=>{if(typeof window>`u`)return``;let e=window.getSelection();if(!e)return``;let t=e.toString();if(!t.trim())return``;let n=_.current;if(!n)return``;let r=e.anchorNode,i=e.focusNode;return r&&!n.contains(r)||i&&!n.contains(i)?``:t},[]),U=w.useCallback(async()=>{if(typeof document>`u`)return;let e=Se()||H();e.trim()&&await g(e)},[H,Se]),W=w.useCallback(()=>Se().trim()?!0:!!H().trim(),[H,Se]);w.useEffect(()=>{if(typeof window>`u`)return;let e=e=>{W()&&(e.preventDefault(),U())};return window.addEventListener(`yuri:copy`,e),()=>{window.removeEventListener(`yuri:copy`,e)}},[U,W]);let G=w.useCallback(()=>{S.current=``,C.current!==null&&typeof window<`u`&&window.cancelAnimationFrame(C.current),C.current=null,ie.current=!1,ae.current=null},[]),K=w.useCallback(()=>{let e=ne.current,t=v.current,n=_.current;if(!e||!t||!n)return;let r=n.getBoundingClientRect();if(!(r.width<24||r.height<24))try{e.fit();let n={cols:t.cols,rows:t.rows},r=re.current;(!r||r.cols!==n.cols||r.rows!==n.rows)&&(re.current=n,x.current(n.cols,n.rows))}catch{}},[]),Ce=w.useCallback(()=>{if(ie.current)return;let e=v.current;if(!e){G();return}if(!S.current)return;let t=S.current;S.current=``,ie.current=!0,e.write(t,()=>{ie.current=!1,S.current&&(typeof window<`u`?C.current=window.requestAnimationFrame(()=>{C.current=null,Ce()}):Ce())})},[G]),we=w.useCallback(()=>{C.current===null&&(typeof window<`u`?C.current=window.requestAnimationFrame(()=>{C.current=null,Ce()}):Ce())},[Ce]),Te=w.useCallback(e=>{e&&(S.current+=e,we())},[we]),Ee=w.useCallback(()=>{if(E.current?.(),E.current=null,k.current!==null&&typeof window<`u`&&(window.clearTimeout(k.current),k.current=null),!c){le.current=0;return}let e=_.current;if(!e)return;let t=v.current;if(!t)return;le.current=0;let n=2.2,r=2.8,i=.25,a=.05,s=.015,l={lastY:null,lastTime:null,velocity:0,rafId:null,startX:null,startY:null,didMove:!1},u=()=>typeof performance<`u`?performance.now():Date.now(),d=Math.max(12,Math.round(o*1.35)),f=0,ee=e=>{if(!e)return!1;let n=t.getViewportY(),r=f+e,i=Math.trunc(r/d);return f=r-i*d,i!==0&&t.scrollLines(i),t.getViewportY()!==n},p=()=>{l.rafId!==null&&typeof window<`u`&&window.cancelAnimationFrame(l.rafId),l.rafId=null},m={passive:!1,capture:!1};if(typeof window<`u`&&`PointerEvent`in window){let t=Object.assign(l,{pointerId:null,startX:null,startY:null,moved:!1}),o=n=>{if(n.pointerType===`touch`){p(),t.pointerId=n.pointerId,t.startX=n.clientX,t.startY=n.clientY,t.moved=!1,t.lastY=n.clientY,t.lastTime=u(),t.velocity=0;try{e.setPointerCapture(n.pointerId)}catch{}}},d=e=>{if(e.pointerType!==`touch`||t.pointerId!==e.pointerId)return;if(t.startX!==null&&t.startY!==null&&!t.moved){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>=6&&(t.moved=!0)}if(t.lastY===null){t.lastY=e.clientY,t.lastTime=u();return}let a=t.lastY,o=t.lastTime??u(),s=u();t.lastY=e.clientY,t.lastTime=s;let c=a-e.clientY;if(Math.abs(c)<1)return;let l=Math.max(s-o,8),d=c*(n+Math.min(r,Math.abs(c)/25)),f=d/l;t.velocity=t.velocity*.75+f*i,t.velocity>8?t.velocity=8:t.velocity<-8&&(t.velocity=-8),t.moved&&(e.cancelable&&e.preventDefault(),e.stopPropagation()),ee(d)},f=n=>{if(n.pointerType!==`touch`||t.pointerId!==n.pointerId)return;let r=!t.moved;t.pointerId=null,t.startX=null,t.startY=null,t.moved=!1,t.lastY=null,t.lastTime=null;try{e.releasePointerCapture(n.pointerId)}catch{}if(r){F?R(n.clientX,n.clientY):c&&!P.current&&(P.current=!0,v.current?.focus());return}if(typeof window>`u`)return;if(Math.abs(t.velocity)<a){t.velocity=0;return}let i=u(),o=()=>{let e=u(),n=Math.max(e-i,8);i=e;let r=ee(t.velocity*n)??!1,c=Math.sign(t.velocity),l=Math.max(0,Math.abs(t.velocity)-s*n);if(t.velocity=l*c,!r||l<=a){p(),t.velocity=0;return}t.rafId=window.requestAnimationFrame(o)};t.rafId=window.requestAnimationFrame(o)};e.addEventListener(`pointerdown`,o,m),e.addEventListener(`pointermove`,d,m),e.addEventListener(`pointerup`,f,m),e.addEventListener(`pointercancel`,f,m);let h=e.style.touchAction,g=e.style.overscrollBehaviorY;e.style.touchAction=`none`,e.style.overscrollBehaviorY=`contain`,E.current=()=>{p(),k.current!==null&&typeof window<`u`&&(window.clearTimeout(k.current),k.current=null),le.current=0,e.removeEventListener(`pointerdown`,o,m),e.removeEventListener(`pointermove`,d,m),e.removeEventListener(`pointerup`,f,m),e.removeEventListener(`pointercancel`,f,m),e.style.touchAction=h,e.style.overscrollBehaviorY=g};return}let h=e=>{e.touches.length===1&&(p(),l.lastY=e.touches[0].clientY,l.lastTime=u(),l.velocity=0,l.startX=e.touches[0].clientX,l.startY=e.touches[0].clientY,l.didMove=!1)},g=e=>{if(e.touches.length!==1){l.lastY=null,l.lastTime=null,l.velocity=0,l.startX=null,l.startY=null,l.didMove=!1,p();return}let t=e.touches[0].clientX,a=e.touches[0].clientY;if(l.startX!==null&&l.startY!==null&&!l.didMove){let e=t-l.startX,n=a-l.startY;Math.hypot(e,n)>=6&&(l.didMove=!0)}if(l.lastY===null){l.lastY=a,l.lastTime=u();return}let o=l.lastY,s=l.lastTime??u(),c=u();l.lastY=a,l.lastTime=c;let d=o-a;if(Math.abs(d)<1)return;let f=Math.max(c-s,8),m=d*(n+Math.min(r,Math.abs(d)/25)),h=m/f;l.velocity=l.velocity*.75+h*i,l.velocity>8?l.velocity=8:l.velocity<-8&&(l.velocity=-8),l.didMove&&(e.preventDefault(),e.stopPropagation()),ee(m)},te=e=>{let t=!l.didMove;l.lastY=null,l.lastTime=null;let n=l.velocity;if(l.startX=null,l.startY=null,l.didMove=!1,t){let t=e.changedTouches?.[0];F?R(t?.clientX,t?.clientY):c&&!P.current&&(P.current=!0,v.current?.focus());return}if(typeof window>`u`)return;if(Math.abs(n)<a){l.velocity=0;return}let r=u(),i=()=>{let e=u(),t=Math.max(e-r,8);r=e;let n=ee(l.velocity*t)??!1,o=Math.sign(l.velocity),c=Math.max(0,Math.abs(l.velocity)-s*t);if(l.velocity=c*o,!n||c<=a){p(),l.velocity=0;return}l.rafId=window.requestAnimationFrame(i)};l.rafId=window.requestAnimationFrame(i)};e.addEventListener(`touchstart`,h,m),e.addEventListener(`touchmove`,g,m),e.addEventListener(`touchend`,te,m),e.addEventListener(`touchcancel`,te,m);let ne=e.style.touchAction,y=e.style.overscrollBehaviorY;e.style.touchAction=`none`,e.style.overscrollBehaviorY=`contain`,E.current=()=>{p(),k.current!==null&&typeof window<`u`&&(window.clearTimeout(k.current),k.current=null),le.current=0,e.removeEventListener(`touchstart`,h,m),e.removeEventListener(`touchmove`,g,m),e.removeEventListener(`touchend`,te,m),e.removeEventListener(`touchcancel`,te,m),e.style.touchAction=ne,e.style.overscrollBehaviorY=y}},[c,F,R,o]);w.useEffect(()=>{let e=!1,t=null,n=null,r=null,s=[],l=null,u=null,f=null,p=_.current;if(!p)return;if(p.tabIndex=F?-1:0,F){let e=p.focus.bind(p),t=p;t.focus=((...e)=>{R()}),f=()=>{t.focus=e}}let m=()=>{I(!0)},h=()=>{I(!1)},g=e=>{let t=e.target;if(t&&p.contains(t)){if(F&&t instanceof HTMLElement){window.setTimeout(()=>{t.blur(),R()},0),I(!1);return}if(c&&!P.current&&t instanceof HTMLElement){window.setTimeout(()=>{t.blur()},0),I(!1);return}I(!0);return}I(!1)},b=()=>{I(!1)},x=null;return(async()=>{try{let f=await D();if(e)return;let g=se(a,o,i,f,!1),_=new d(g);oe.current=!0,F&&(_.focus=()=>{});let b=_;if(typeof b.scrollToBottom==`function`){let e=b.scrollToBottom.bind(b);b.scrollToBottom=()=>{oe.current&&e()},l=()=>{b.scrollToBottom=e}}let re=new ee;if(t=_,v.current=_,ne.current=re,_.loadAddon(re),_.open(p),c){let e=_.renderer;if(e&&typeof e.renderScrollbar==`function`){let t=e.renderScrollbar.bind(e);e.renderScrollbar=()=>{},u=()=>{e.renderScrollbar=t}}}ve(),me.current=!1,x=_.textarea??p.querySelector(`textarea`),x&&(x.addEventListener(`focus`,m),x.addEventListener(`blur`,h)),be(),typeof MutationObserver<`u`&&(r=new MutationObserver(()=>{be()}),r.observe(p,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`contenteditable`,`role`,`tabindex`,`aria-label`]}));let S=O(p);S?(S.classList.add(`overlay-scrollbar-target`,`overlay-scrollbar-container`),te.current=S,ge()):te.current=null,K();let C=re;typeof C.observeResize==`function`&&C.observeResize(),Ee(),s=[_.onData(e=>{y.current(e)}),_.onScroll(e=>{if(typeof e==`number`&&Number.isFinite(e)){let t=typeof _.hasSelection==`function`&&_.hasSelection();oe.current=!t&&e<=.5}}),_.onSelectionChange(()=>{if(typeof _.hasSelection==`function`&&_.hasSelection()){oe.current=!1;return}let e=typeof _.getViewportY==`function`?_.getViewportY():0;oe.current=e<=.5})],n=new ResizeObserver(()=>{K()}),n.observe(p),typeof window<`u`&&window.setTimeout(()=>{K()},0)}catch{}})(),document.addEventListener(`focusin`,g,!0),window.addEventListener(`blur`,b),()=>{e=!0,E.current?.(),E.current=null,document.removeEventListener(`focusin`,g,!0),window.removeEventListener(`blur`,b),s.forEach(e=>e.dispose()),l?.(),l=null,u?.(),u=null,x&&(x.removeEventListener(`focus`,m),x.removeEventListener(`blur`,h)),n?.disconnect(),r?.disconnect(),f?.(),t?.dispose(),v.current=null,ne.current=null,te.current=null,re.current=null,me.current=null,G()}},[be,c,K,R,a,o,Ee,i,G,I,F]),w.useEffect(()=>{let e=v.current;e&&(e.reset(),G(),re.current=null,K())},[e,_e,K,G]),w.useEffect(()=>{l&&v.current&&z()},[l,z,e,_e]),w.useEffect(()=>(Ee(),()=>{E.current?.(),E.current=null}),[Ee,e]),w.useEffect(()=>{let e=v.current;if(!e)return;if(t.length===0){ae.current!==null&&(e.reset(),G(),K());return}let n=ae.current,r;if(n===null)r=t;else{let e=t.findIndex(e=>e.id===n);r=e>=0?t.slice(e+1):t}r.length>0&&Te(r.map(e=>e.data).join(``)),ae.current=t[t.length-1].id},[t,_e,Te,K,G]),w.useImperativeHandle(f,()=>({focus:()=>{z()},clear:()=>{let e=v.current;e&&(e.reset(),G(),K())},fit:()=>{K()}}),[z,K,G]);let De=w.useCallback(e=>{if(!F)return;let t=_.current,n=e.relatedTarget,r=n?.tagName;r===`INPUT`||r===`TEXTAREA`||n?.isContentEditable,n?.getAttribute(`data-terminal-hidden-input`),n&&t?.contains(n)},[F]),q=w.useCallback(e=>{let t=e.nativeEvent,n=t?.inputType??``,r=typeof t?.data==`string`?t.data:``;if(N.current=typeof performance<`u`?performance.now():Date.now(),n===`insertCompositionText`){A.current=!0;return}if(!n&&r){if(A.current)return;e.preventDefault(),y.current(r),M.current={type:`insertText`,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0;return}if(n===`insertText`&&r){if(A.current)return;e.preventDefault(),y.current(r),M.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0;return}if(n===`insertLineBreak`){if(A.current)return;e.preventDefault(),y.current(`\r`),M.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0;return}if(n===`deleteContentBackward`){if(A.current)return;e.preventDefault(),y.current(``),M.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0}},[]),Oe=w.useCallback(e=>{let t=e.currentTarget;if(N.current=typeof performance<`u`?performance.now():Date.now(),A.current)return;if(j.current){let e=M.current,n=typeof performance<`u`?performance.now():Date.now();if(e&&n-e.at<50){j.current=!1,V(t);return}j.current=!1}let n=B(t);if(!n)return;pe.current=n;let r=n.replace(/\r\n|\r|\n/g,`\r`);y.current(r),V(t),pe.current=``},[V,B]),J=w.useCallback(e=>{e.stopPropagation();let t=e.key.toLowerCase(),n=e.metaKey&&!e.ctrlKey&&!e.altKey&&t===`c`,r=e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey&&t===`c`;if((n||r)&&W()){e.preventDefault(),U();return}if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1){let t=e.key.toUpperCase();if(t>=`A`&&t<=`Z`){e.preventDefault(),e.nativeEvent?.stopImmediatePropagation(),y.current(String.fromCharCode(t.charCodeAt(0)-64)),V(e.currentTarget);return}}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key.length===1){e.preventDefault(),e.nativeEvent?.stopImmediatePropagation(),y.current(`\x1B`+e.key),V(e.currentTarget);return}let i={ArrowUp:`\x1B[A`,ArrowDown:`\x1B[B`,ArrowRight:`\x1B[C`,ArrowLeft:`\x1B[D`,Escape:`\x1B`,Tab:` `,Delete:`\x1B[3~`,Home:`\x1B[H`,End:`\x1B[F`}[e.key];if(i){e.preventDefault(),y.current(i),V(e.currentTarget);return}let a=e.currentTarget;if(e.nativeEvent?.isComposing)return;let o=M.current,s=typeof performance<`u`?performance.now():Date.now(),c=!!(o&&s-o.at<50);if(e.key===`Enter`){if(c&&o?.type===`insertLineBreak`)return;e.preventDefault(),y.current(`\r`),V(a);return}if(e.key===`Backspace`){if(e.preventDefault(),c&&o?.type===`deleteContentBackward`)return;B(a)||y.current(``)}if(e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let t=N.current;t&&s-t<50||(e.preventDefault(),y.current(e.key),j.current=!0,M.current={type:`keydown-text`,at:s})}xe(a)},[V,U,W,B,xe]),ke=w.useCallback(e=>{e.stopPropagation();let t=e.currentTarget;e.nativeEvent?.isComposing||xe(t)},[xe]),Y=w.useCallback(e=>{let t=e.currentTarget;A.current=!1;let n=e.data||B(t);if(N.current=typeof performance<`u`?performance.now():Date.now(),!n)return;let r=n.replace(/\r\n|\r|\n/g,`\r`);y.current(r),V(t),M.current={type:`compositionend`,at:typeof performance<`u`?performance.now():Date.now()},j.current=!0},[V,B]),X=w.useCallback(e=>{e.stopPropagation();let t=e.clipboardData?.getData(`text`)??``;if(!t)return;e.preventDefault();let n=v.current?.hasBracketedPaste?.()?`\x1b[200~${t}\x1b[201~`:t;y.current(n)},[]),Z={position:`fixed`,left:0,top:0,width:1,height:1,opacity:0,zIndex:-1,background:`transparent`,color:`transparent`,WebkitTextFillColor:`transparent`,caretColor:`transparent`,textShadow:`none`,WebkitAppearance:`none`,appearance:`none`,resize:`none`,overflow:`hidden`,whiteSpace:`nowrap`,border:`0`,padding:0,margin:0,outline:`none`,outlineOffset:0,fontSize:16,fontWeight:400,pointerEvents:`none`,WebkitUserSelect:`none`,userSelect:`none`};return(0,T.jsxs)(`div`,{ref:_,className:h(`relative h-full w-full terminal-viewport-container`,s),"data-hidden-input-overlay-active":F?`true`:void 0,style:{backgroundColor:i.background},onTouchStart:e=>{if(!(!F||c)&&!W()){let t=e.touches?.[0];R(t?.clientX,t?.clientY)}},onClick:e=>{if(!c)if(F){if(W())return;R(e.clientX,e.clientY)}else v.current?.focus()},onMouseUp:()=>{!c&&W()&&U()},onTouchEnd:()=>{!c&&W()&&U()},children:[F&&typeof document<`u`?(0,ce.createPortal)((0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`input`,{ref:de,type:`text`,inputMode:`text`,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,tabIndex:-1,enterKeyHint:`send`,"data-terminal-hidden-input":`true`,"aria-label":m(`terminalView.viewport.inputAria`),"aria-hidden":`true`,style:{...Z,display:L?`block`:`none`},onBlur:De,onBeforeInput:q,onCompositionStart:()=>{A.current=!0},onInput:Oe,onKeyDown:J,onKeyUp:ke,onCompositionEnd:Y,onPaste:X}),(0,T.jsx)(`textarea`,{ref:ue,inputMode:`text`,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,tabIndex:-1,enterKeyHint:`send`,"data-terminal-hidden-input":`true`,"aria-label":m(`terminalView.viewport.inputAria`),"aria-hidden":`true`,style:{...Z,display:L?`none`:`block`},onBlur:De,onBeforeInput:q,onCompositionStart:()=>{A.current=!0},onInput:Oe,onKeyDown:J,onKeyUp:ke,onCompositionEnd:Y,onPaste:X})]}),document.body):null,te.current&&!c?(0,T.jsx)(b,{containerRef:te,disableHorizontal:!0,className:`overlay-scrollbar--flush overlay-scrollbar--dense overlay-scrollbar--zero`}):null]})});k.displayName=`TerminalViewport`;var le=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),ue=/(https?:\/\/(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[(?:::1|::)\])(?::\d{2,5})?(?:\/[^\s<>'"`]*)?)/gi,de=/(?:➜\s*(?:Local|Network):)|\b(?:local|network|loopback|serving|listening|available|ready|started|running|server|vite|webpack|next\.js|astro|sveltekit|nuxt)\b/i,A=/Serving HTTP on .*? port (\d{2,5})/i,j=new Set([`.`,`,`,`;`,`:`,`!`,`?`]),M=e=>{let t=e;for(;t.length>0;){let e=t[t.length-1];if(e===`)`||e===`]`||e===`}`||e===`>`){let n=e===`)`?`(`:e===`]`?`[`:e===`}`?`{`:`<`,r=t.slice(0,-1);if((r.match(RegExp(`\\${n}`,`g`))||[]).length>(r.match(RegExp(`\\${e}`,`g`))||[]).length)break;t=r;continue}if(j.has(e)){t=t.slice(0,-1);continue}break}return t},N=e=>{let t=M(e);return t=t.replace(`0.0.0.0`,`127.0.0.1`),t=t.replace(`[::1]`,`127.0.0.1`),t=t.replace(`[::]`,`127.0.0.1`),t},fe=e=>{if(!e)return null;let t=e.replace(le,``),n=t.match(A);if(n?.[1]){let e=Number.parseInt(n[1],10);if(Number.isFinite(e)&&e>0&&e<=65535)return`http://127.0.0.1:${e}/`}let r=t.split(`
2
2
  `);for(let e of r){if(!de.test(e))continue;let t=Array.from(e.matchAll(ue));if(t.length!==0)return N((t.find(e=>{try{return!!new URL(N(e[1])).port}catch{return!1}})??t[0])[1])}return null},pe=async(e,n=1500)=>{if(!e||typeof window>`u`)return!1;let r;try{r=new URL(e)}catch{return!1}if(r.protocol!==`http:`&&r.protocol!==`https:`)return!1;let i=r.hostname.toLowerCase();if(i!==`localhost`&&i!==`127.0.0.1`&&i!==`0.0.0.0`&&i!==`::1`&&i!==`::`)return!1;let a=new AbortController,o=window.setTimeout(()=>a.abort(),n);try{let e=await t(`/api/system/probe-url`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:r.toString()}),cache:`no-store`,signal:a.signal});return e.ok?(await e.json().catch(()=>null))?.ok===!0:!1}catch{return!1}finally{window.clearTimeout(o)}},me={esc:`\x1B`,tab:` `,enter:`\r`,"arrow-up":`\x1B[A`,"arrow-down":`\x1B[B`,"arrow-left":`\x1B[D`,"arrow-right":`\x1B[C`},P={ctrl:`5`,cmd:`3`},he={retry:{maxRetries:3,initialDelayMs:500,maxDelayMs:8e3},connectionTimeoutMs:1e4},ge={retry:{maxRetries:8,initialDelayMs:400,maxDelayMs:8e3},connectionTimeoutMs:15e3},_e=(e,t)=>{if(t)switch(e){case`arrow-up`:return`\u001b[1;${P[t]}A`;case`arrow-down`:return`\u001b[1;${P[t]}B`;case`arrow-right`:return`\u001b[1;${P[t]}C`;case`arrow-left`:return`\u001b[1;${P[t]}D`}return me[e]??null},ve=()=>{let{t:e}=p(),{terminal:t,runtime:i,projectScope:a}=x(),{currentTheme:o}=te(),{monoFont:d}=C(),f=l(e=>e.terminalFontSize),ee=l(e=>e.bottomTerminalHeight),g=l(e=>e.isBottomTerminalExpanded),{isMobile:b,isTablet:se,hasTouchOnlyPointer:ce}=ne(),E=b||se,D=(E||ce)&&i.platform===`web`,O=i.platform!==`vscode`,le=l(e=>e.showTerminalQuickKeysOnDesktop),ue=!n()&&(E||le),de=_(e=>e.currentSessionId),A=_(e=>e.newSessionDraft),j=!!a||de!==null||A?.open===!0,M=y()??null??a?.location.directory??null,N=a?r({...a.location,directory:M??a.location.directory}):M,me=S(e=>e.sessions),P=S(e=>e.hasHydrated),ve=S(e=>e.ensureDirectory),ye=S(e=>e.createTab),F=S(e=>e.setActiveTab),be=S(e=>e.closeTab),I=w.useMemo(()=>a?async(e,n)=>{await be(e,n,t.close)}:be,[a,t,be]),L=S(e=>e.setTabSessionId),R=S(e=>e.setTabLifecycle),z=S(e=>e.setConnecting),B=S(e=>e.appendToBuffer),V=S(e=>e.setTabPreviewUrl),xe=S(e=>e.clearBuffer),Se=l(e=>e.openContextPreview),H=w.useMemo(()=>{if(N)return me.get(N)},[me,N]),U=w.useMemo(()=>H?O?H.activeTabId??H.tabs[0]?.id??null:H.tabs[0]?.id??null:null,[H,O]),W=w.useMemo(()=>{if(H)return U?H.tabs.find(e=>e.id===U)??H.tabs[0]:H.tabs[0]},[H,U]),G=w.useMemo(()=>(H?.tabs??[]).map(t=>({icon:(()=>{let e=t.iconKey?ae[t.iconKey]??`terminal`:`terminal`;return(0,T.jsx)(v,{name:e,className:`h-4 w-4`})})(),id:t.id,label:t.label,title:t.label,closeLabel:e(`terminalView.tabs.closeTabTitle`)})),[H?.tabs,e]),K=W?.terminalSessionId??null,Ce=W?.lifecycle??`idle`,we=W?.bufferChunks??[],Te=W?.isConnecting??!1,Ee=W?.previewUrl??null,[De,q]=w.useState(null),[Oe,J]=w.useState(!1),[ke,Y]=w.useState(!1),[X,Z]=w.useState(null),[Ae,je]=w.useState(!1),[Me,Ne]=w.useState(0),Pe=w.useRef(null),Fe=w.useRef(null),Ie=w.useRef(U),Le=w.useRef(K),Re=w.useRef(N),ze=w.useRef(null),Be=w.useRef(null),Ve=w.useRef(!1),He=w.useRef(!1),Ue=w.useRef(null),We=w.useRef(null),Ge=w.useRef(new Set),Ke=w.useRef(!1),qe=w.useRef(``),Je=w.useRef(new Set),Ye=w.useRef(0),Xe=w.useCallback(()=>{qe.current=``,Je.current.clear(),Ye.current+=1},[]),Ze=w.useCallback(()=>{D||typeof document<`u`&&!document.hasFocus()||ze.current?.focus()},[D]),Qe=w.useCallback(()=>{D||ze.current?.focus()},[D]);w.useEffect(()=>{if(!P||Ke.current)return;Ke.current=!0;let e=new Set;for(let[,t]of S.getState().sessions.entries())for(let n of t.tabs)n.terminalSessionId&&e.add(n.terminalSessionId);Ge.current=e},[P]);let $e=l(e=>e.activeMainTab),et=l(e=>e.isBottomTerminalOpen),tt=l(e=>e.setBottomTerminalOpen),nt=l(e=>e.setBottomTerminalExpanded),rt=$e===`terminal`,Q=rt||et,[it,at]=w.useState(Q);w.useEffect(()=>{!Q||i.platform===`vscode`||a||u()},[Q,i.platform,a]),w.useEffect(()=>{Q&&at(!0)},[Q]),w.useEffect(()=>{He.current=Q},[Q]),w.useEffect(()=>{Le.current=K},[K]),w.useEffect(()=>{Ie.current=U,Xe()},[U,Xe]),w.useEffect(()=>{Re.current=N},[N]),w.useEffect(()=>{!ue&&X!==null&&Z(null)},[ue,X,Z]),w.useEffect(()=>{!K&&X!==null&&Z(null)},[K,X,Z]);let $=w.useCallback(()=>{Pe.current?.(),Pe.current=null,Fe.current=null,Ue.current=null,Y(!1)},[]);w.useEffect(()=>()=>{$(),Le.current=null},[$]),w.useEffect(()=>($(),$),[t,$]);let ot=w.useCallback((e,t,n)=>{if(!n)return;let r=`${qe.current}${n}`.replace(/\r\n|\r/g,`
3
3
  `),i=r.split(`
4
4
  `),o=r.endsWith(`
@@ -1,4 +1,4 @@
1
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{_ as n,t as r,v as i,w as a}from"./runtime-auth-DA-qfGHk.js";import{c as o,i as s}from"./runtime-switch-DEPKHgdL.js";import{n as c}from"./runtime-fetch-V-iMWR8t.js";import{R as l,n as u}from"./platform-CiUKDeXd.js";import{t as d}from"./runtimeAPIRegistry-C2VogTny.js";import{it as f,ot as p,st as m}from"./vendor-base-ui-fom6orB6.js";import{n as h}from"./vendor-react-D5BntRmA.js";import{s as g}from"./vendor-tanstack-react-query-ChSd65dm.js";import{E as _,c as v,f as y,o as b,s as x}from"./runtime-file-resource-CKQQEwNv.js";import{r as S}from"./vendor-reactuses-core-B8s-Rcd-.js";import{a as C,n as w}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{S as T,x as E}from"./useUIStore-DjizmHAt.js";import{n as D,t as O}from"./runtime-file-download-DxL4XbME.js";import{a as k,i as A}from"./vendor-pierre-diffs-HJfPTtu2.js";import{t as j}from"./i18n-BvjeIWrT.js";import{In as M,Rn as N}from"./useMobileNavigationStore-BtHQN423.js";import{a as P,n as F,r as I}from"./toolHelpers-iEHVHQ9p.js";import{n as L,t as R}from"./useThemeSystem-D2YBbLma.js";import{l as ee,o as te,s as ne,u as re}from"./vendor-framer-motion-DiGWHm7K.js";import{n as z}from"./Icon-Br-W35tz.js";import{n as ie,t as ae}from"./dialog-rXqw-6ab.js";import{t as oe}from"./tap-LkQum5bB.js";import{r as se}from"./themes-BgDJcxRc.js";import{i as ce,n as B}from"./MarkdownRenderer-BjRyxBUx.js";import{t as le}from"./MobileWindowStack-DGLdgoGr.js";import{i as ue,n as de}from"./mobileBackNavigation-XjzoONfU.js";import{n as fe}from"./useEffectiveDirectory-DFe0GivQ.js";import{a as V,c as pe,i as H,o as U}from"./image-loading-Dlh4FIPJ.js";import{t as me}from"./ImageLoadingPlaceholder-EHe_20yz.js";import{t as W}from"./vendor-tanstack-react-virtual-WY42p6U6.js";import{n as G}from"./markdownTheme-C2LJ3cJo.js";import{n as K,t as he}from"./markdown-worker-oBGEB9Eg.js";var q=t(m(),1),J=h(),Y=p(),ge=e=>e===`in_progress`||e===`completed`||e===`cancelled`?e:`pending`,X=e=>e.status===`completed`||e.status===`cancelled`,Z={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},_e={in_progress:`text-foreground`,pending:`text-muted-foreground/60`,completed:`text-muted-foreground`,cancelled:`text-muted-foreground/60`},ve={in_progress:`text-foreground`,pending:`text-muted-foreground`,completed:`text-muted-foreground/60 line-through decoration-1`,cancelled:`text-muted-foreground/60 line-through decoration-1`},ye=1.2,be=24,xe=`1 1`,Se=e=>{let t=(0,J.c)(23),{status:n,className:r}=e,{t:i}=j(),a=Z[n],o;t[0]!==i||t[1]!==a?(o=i(a),t[0]=i,t[1]=a,t[2]=o):o=t[2];let s=_e[n],c;t[3]!==r||t[4]!==s?(c=N(`size-[1em] shrink-0 transition-colors duration-300`,s,r),t[3]=r,t[4]=s,t[5]=c):c=t[5];let l=n===`pending`?ye:void 0,u=n===`pending`?be:void 0,d=n===`pending`?xe:void 0,f;t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,Y.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:l,pathLength:u,strokeDasharray:d}),t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]===n?p=t[11]:(p=n===`in_progress`?(0,Y.jsx)(`path`,{d:`M4.8 8h6.4M8.6 5.4 11.2 8l-2.6 2.6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[10]=n,t[11]=p);let m;t[12]===n?m=t[13]:(m=n===`completed`?(0,Y.jsx)(`path`,{d:`M5 8 7.5 11 11 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[12]=n,t[13]=m);let h;t[14]===n?h=t[15]:(h=n===`cancelled`?(0,Y.jsx)(`path`,{d:`M3.5 12.5 12.5 3.5`,stroke:`currentColor`}):null,t[14]=n,t[15]=h);let g;return t[16]!==m||t[17]!==h||t[18]!==o||t[19]!==c||t[20]!==f||t[21]!==p?(g=(0,Y.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,role:`img`,"aria-label":o,className:c,children:[f,p,m,h]}),t[16]=m,t[17]=h,t[18]=o,t[19]=c,t[20]=f,t[21]=p,t[22]=g):g=t[22],g},Ce=3.2,we=e=>{let t=Math.PI*2*e,n=8+Ce*Math.sin(t),r=8-Ce*Math.cos(t);return`M8 8 L8 4.8 A${Ce} ${Ce} 0 ${+(e>.5)} 1 ${n.toFixed(3)} ${r.toFixed(3)} Z`},Te=e=>{let t=(0,J.c)(11),{done:n,total:r,spinning:i,className:a}=e,o=n===void 0?0:n,s=r===void 0?0:r,c=i!==void 0&&i,l=s>0?Math.min(1,o/s):0,u;t[0]===a?u=t[1]:(u=N(`size-[1.15em] shrink-0 text-foreground`,a),t[0]=a,t[1]=u);let d=c?`yuri-todo-spin`:void 0,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f={transformBox:`fill-box`,transformOrigin:`center`},t[2]=f):f=t[2];let p;t[3]===d?p=t[4]:(p=(0,Y.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:ye,pathLength:be,strokeDasharray:xe,className:d,style:f}),t[3]=d,t[4]=p);let m;t[5]===l?m=t[6]:(m=l>0?(0,Y.jsx)(`path`,{d:we(l),fill:`currentColor`,className:`transition-opacity duration-300`}):null,t[5]=l,t[6]=m);let h;return t[7]!==u||t[8]!==p||t[9]!==m?(h=(0,Y.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:u,children:[p,m]}),t[7]=u,t[8]=p,t[9]=m,t[10]=h):h=t[10],h},Ee=({done:e,total:t,className:n,animate:r=!0})=>{let i=q.useRef(e),a=r&&i.current!==e;return q.useEffect(()=>{i.current=e},[e]),(0,Y.jsxs)(`span`,{className:N(`shrink-0 tabular-nums`,n),children:[(0,Y.jsx)(`span`,{className:N(a&&`yuri-todo-count-tick`),children:e},e),`/${t}`]})},De=e=>{let t=(0,J.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=N(`flex size-[1.15em] shrink-0 items-center justify-center rounded-full bg-[var(--status-success)] text-[var(--status-success-foreground)]`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`size-[70%]`,children:(0,Y.jsx)(`path`,{d:`M4.5 8.2 7 10.8 11.5 5.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,Y.jsx)(`span`,{"data-todo-complete":!0,className:r,children:i}),t[3]=r,t[4]=a),a},Oe=e=>{let t=(0,J.c)(27),{todos:n,isWorking:r,animate:i,className:a,rowClassName:o,listRef:s,id:c}=e,l=r!==void 0&&r,u=i!==void 0&&i,{t:d}=j(),f=n.findIndex(ke),p;t[0]!==f||t[1]!==n?(p=f>=0?f:n.findIndex(Ae),t[0]=f,t[1]=n,t[2]=p):p=t[2];let m=p,h;t[3]===n?h=t[4]:(h=n.some(je),t[3]=n,t[4]=h);let g=h,_;t[5]===a?_=t[6]:(_=N(`m-0 flex min-w-0 list-none flex-col gap-[0.125em] p-0`,a),t[5]=a,t[6]=_);let v;if(t[7]!==m||t[8]!==u||t[9]!==g||t[10]!==l||t[11]!==o||t[12]!==d||t[13]!==n){let e;t[15]!==m||t[16]!==u||t[17]!==g||t[18]!==l||t[19]!==o||t[20]!==d?(e=(e,t)=>{let n=ge(e.status),r=l&&!g&&t===m&&n===`pending`?`in_progress`:n;return(0,Y.jsxs)(`li`,{"data-status":r,"aria-current":t===m?`step`:void 0,className:N(`grid min-w-0 shrink-0 grid-cols-[auto_minmax(0,1fr)] items-start py-[0.25em]`,o??`gap-[0.6em] px-[0.5em]`,u&&`yuri-todo-row-in`),children:[(0,Y.jsx)(`span`,{className:N(`flex h-[1.32em] w-[1.15em] items-center justify-center`,u&&`yuri-todo-icon-pop`),title:d(Z[r]),children:(0,Y.jsx)(Se,{status:r})},r),(0,Y.jsx)(`span`,{dir:`auto`,title:e.content,className:N(`line-clamp-3 min-w-0 whitespace-normal text-[0.88em] break-words leading-[1.5] transition-colors duration-300`,ve[r]),children:(0,Y.jsx)(`span`,{className:N(r===`in_progress`&&`animate-text-shimmer`),children:e.content})})]},e.id??`${t}:${e.content}`)},t[15]=m,t[16]=u,t[17]=g,t[18]=l,t[19]=o,t[20]=d,t[21]=e):e=t[21],v=n.map(e),t[7]=m,t[8]=u,t[9]=g,t[10]=l,t[11]=o,t[12]=d,t[13]=n,t[14]=v}else v=t[14];let y;return t[22]!==c||t[23]!==s||t[24]!==_||t[25]!==v?(y=(0,Y.jsx)(`ul`,{id:c,ref:s,className:_,children:v}),t[22]=c,t[23]=s,t[24]=_,t[25]=v,t[26]=y):y=t[26],y};function ke(e){return e.status===`in_progress`}function Ae(e){return e.status===`pending`}function je(e){return e.status===`in_progress`}var Me=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),Ne=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,Pe=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=Ne(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},Fe=e=>`<pre><code>${Me(e)}</code></pre>`,Ie=e=>{let t=(0,J.c)(21),{code:n,language:r,className:i,style:a,codeStyle:o,wrap:s}=e,c=s!==void 0&&s,{currentTheme:l}=L(),u=q.useRef(null),d;t[0]===l?d=t[1]:(d=G(l),t[0]=l,t[1]=d);let f=d,p,m;t[2]!==n||t[3]!==o||t[4]!==c?(p=()=>{let e=u.current;e&&(e.innerHTML=Fe(n),Pe(e,c,o))},m=[n,c,o],t[2]=n,t[3]=o,t[4]=c,t[5]=p,t[6]=m):(p=t[5],m=t[6]),q.useLayoutEffect(p,m);let h,g;t[7]!==n||t[8]!==o||t[9]!==r||t[10]!==c?(h=()=>{let e=u.current;if(!e)return;let t=!0,i=new AbortController;return he(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,Pe(e,c,o))}),()=>{t=!1,i.abort()}},g=[n,r,c,o],t[7]=n,t[8]=o,t[9]=r,t[10]=c,t[11]=h,t[12]=g):(h=t[11],g=t[12]),q.useEffect(h,g);let _;t[13]===i?_=t[14]:(_=N(`typography-code`,i),t[13]=i,t[14]=_);let v=f,y;t[15]!==a||t[16]!==v?(y={...v,...a},t[15]=a,t[16]=v,t[17]=y):y=t[17];let b;return t[18]!==_||t[19]!==y?(b=(0,Y.jsx)(`div`,{ref:u,className:_,style:y}),t[18]=_,t[19]=y,t[20]=b):b=t[20],b},Le=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},Re=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},ze=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,Be=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,Ve=(e,t)=>!e||typeof e!=`object`?String(e):I(e,t||``),He=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},Ue=e=>{if(!e||typeof e!=`object`)return;let t=He(e.patch)??He(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=He(e.patch)??He(e.diff);if(t)return t}},We=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},Ge=(e,t,n)=>{let r=Le(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&ze(r)&&(r=Be(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=Ue(n);if(e)return e}return r},Ke=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
1
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{_ as n,t as r,v as i,w as a}from"./runtime-auth-DA-qfGHk.js";import{c as o,i as s}from"./runtime-switch-DEPKHgdL.js";import{n as c}from"./runtime-fetch-V-iMWR8t.js";import{R as l,n as u}from"./platform-CiUKDeXd.js";import{t as d}from"./runtimeAPIRegistry-C2VogTny.js";import{it as f,ot as p,st as m}from"./vendor-base-ui-fom6orB6.js";import{n as h}from"./vendor-react-D5BntRmA.js";import{s as g}from"./vendor-tanstack-react-query-ChSd65dm.js";import{E as _,c as v,f as y,o as b,s as x}from"./runtime-file-resource-CKQQEwNv.js";import{r as S}from"./vendor-reactuses-core-B8s-Rcd-.js";import{a as C,n as w}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{S as T,x as E}from"./useUIStore-DjizmHAt.js";import{n as D,t as O}from"./runtime-file-download-DxL4XbME.js";import{a as k,i as A}from"./vendor-pierre-diffs-HJfPTtu2.js";import{t as j}from"./i18n-BvjeIWrT.js";import{In as M,Rn as N}from"./useMobileNavigationStore-oveTY29a.js";import{a as P,n as F,r as I}from"./toolHelpers-iEHVHQ9p.js";import{n as L,t as R}from"./useThemeSystem-D2YBbLma.js";import{l as ee,o as te,s as ne,u as re}from"./vendor-framer-motion-DiGWHm7K.js";import{n as z}from"./Icon-DebSeH2D.js";import{n as ie,t as ae}from"./dialog-CHzvxSP4.js";import{t as oe}from"./tap-LkQum5bB.js";import{r as se}from"./themes-BgDJcxRc.js";import{i as ce,n as B}from"./MarkdownRenderer-Bjl6sXps.js";import{t as le}from"./MobileWindowStack-DGLdgoGr.js";import{i as ue,n as de}from"./mobileBackNavigation-C6UPWCkI.js";import{n as fe}from"./useEffectiveDirectory-BN5qbhev.js";import{a as V,c as pe,i as H,o as U}from"./image-loading-Dlh4FIPJ.js";import{t as me}from"./ImageLoadingPlaceholder-BBMhxtKr.js";import{t as W}from"./vendor-tanstack-react-virtual-WY42p6U6.js";import{n as G}from"./markdownTheme-C2LJ3cJo.js";import{n as K,t as he}from"./markdown-worker-oBGEB9Eg.js";var q=t(m(),1),J=h(),Y=p(),ge=e=>e===`in_progress`||e===`completed`||e===`cancelled`?e:`pending`,X=e=>e.status===`completed`||e.status===`cancelled`,Z={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},_e={in_progress:`text-foreground`,pending:`text-muted-foreground/60`,completed:`text-muted-foreground`,cancelled:`text-muted-foreground/60`},ve={in_progress:`text-foreground`,pending:`text-muted-foreground`,completed:`text-muted-foreground/60 line-through decoration-1`,cancelled:`text-muted-foreground/60 line-through decoration-1`},ye=1.2,be=24,xe=`1 1`,Se=e=>{let t=(0,J.c)(23),{status:n,className:r}=e,{t:i}=j(),a=Z[n],o;t[0]!==i||t[1]!==a?(o=i(a),t[0]=i,t[1]=a,t[2]=o):o=t[2];let s=_e[n],c;t[3]!==r||t[4]!==s?(c=N(`size-[1em] shrink-0 transition-colors duration-300`,s,r),t[3]=r,t[4]=s,t[5]=c):c=t[5];let l=n===`pending`?ye:void 0,u=n===`pending`?be:void 0,d=n===`pending`?xe:void 0,f;t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,Y.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:l,pathLength:u,strokeDasharray:d}),t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]===n?p=t[11]:(p=n===`in_progress`?(0,Y.jsx)(`path`,{d:`M4.8 8h6.4M8.6 5.4 11.2 8l-2.6 2.6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[10]=n,t[11]=p);let m;t[12]===n?m=t[13]:(m=n===`completed`?(0,Y.jsx)(`path`,{d:`M5 8 7.5 11 11 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[12]=n,t[13]=m);let h;t[14]===n?h=t[15]:(h=n===`cancelled`?(0,Y.jsx)(`path`,{d:`M3.5 12.5 12.5 3.5`,stroke:`currentColor`}):null,t[14]=n,t[15]=h);let g;return t[16]!==m||t[17]!==h||t[18]!==o||t[19]!==c||t[20]!==f||t[21]!==p?(g=(0,Y.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,role:`img`,"aria-label":o,className:c,children:[f,p,m,h]}),t[16]=m,t[17]=h,t[18]=o,t[19]=c,t[20]=f,t[21]=p,t[22]=g):g=t[22],g},Ce=3.2,we=e=>{let t=Math.PI*2*e,n=8+Ce*Math.sin(t),r=8-Ce*Math.cos(t);return`M8 8 L8 4.8 A${Ce} ${Ce} 0 ${+(e>.5)} 1 ${n.toFixed(3)} ${r.toFixed(3)} Z`},Te=e=>{let t=(0,J.c)(11),{done:n,total:r,spinning:i,className:a}=e,o=n===void 0?0:n,s=r===void 0?0:r,c=i!==void 0&&i,l=s>0?Math.min(1,o/s):0,u;t[0]===a?u=t[1]:(u=N(`size-[1.15em] shrink-0 text-foreground`,a),t[0]=a,t[1]=u);let d=c?`yuri-todo-spin`:void 0,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f={transformBox:`fill-box`,transformOrigin:`center`},t[2]=f):f=t[2];let p;t[3]===d?p=t[4]:(p=(0,Y.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:ye,pathLength:be,strokeDasharray:xe,className:d,style:f}),t[3]=d,t[4]=p);let m;t[5]===l?m=t[6]:(m=l>0?(0,Y.jsx)(`path`,{d:we(l),fill:`currentColor`,className:`transition-opacity duration-300`}):null,t[5]=l,t[6]=m);let h;return t[7]!==u||t[8]!==p||t[9]!==m?(h=(0,Y.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:u,children:[p,m]}),t[7]=u,t[8]=p,t[9]=m,t[10]=h):h=t[10],h},Ee=({done:e,total:t,className:n,animate:r=!0})=>{let i=q.useRef(e),a=r&&i.current!==e;return q.useEffect(()=>{i.current=e},[e]),(0,Y.jsxs)(`span`,{className:N(`shrink-0 tabular-nums`,n),children:[(0,Y.jsx)(`span`,{className:N(a&&`yuri-todo-count-tick`),children:e},e),`/${t}`]})},De=e=>{let t=(0,J.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=N(`flex size-[1.15em] shrink-0 items-center justify-center rounded-full bg-[var(--status-success)] text-[var(--status-success-foreground)]`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`size-[70%]`,children:(0,Y.jsx)(`path`,{d:`M4.5 8.2 7 10.8 11.5 5.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,Y.jsx)(`span`,{"data-todo-complete":!0,className:r,children:i}),t[3]=r,t[4]=a),a},Oe=e=>{let t=(0,J.c)(27),{todos:n,isWorking:r,animate:i,className:a,rowClassName:o,listRef:s,id:c}=e,l=r!==void 0&&r,u=i!==void 0&&i,{t:d}=j(),f=n.findIndex(ke),p;t[0]!==f||t[1]!==n?(p=f>=0?f:n.findIndex(Ae),t[0]=f,t[1]=n,t[2]=p):p=t[2];let m=p,h;t[3]===n?h=t[4]:(h=n.some(je),t[3]=n,t[4]=h);let g=h,_;t[5]===a?_=t[6]:(_=N(`m-0 flex min-w-0 list-none flex-col gap-[0.125em] p-0`,a),t[5]=a,t[6]=_);let v;if(t[7]!==m||t[8]!==u||t[9]!==g||t[10]!==l||t[11]!==o||t[12]!==d||t[13]!==n){let e;t[15]!==m||t[16]!==u||t[17]!==g||t[18]!==l||t[19]!==o||t[20]!==d?(e=(e,t)=>{let n=ge(e.status),r=l&&!g&&t===m&&n===`pending`?`in_progress`:n;return(0,Y.jsxs)(`li`,{"data-status":r,"aria-current":t===m?`step`:void 0,className:N(`grid min-w-0 shrink-0 grid-cols-[auto_minmax(0,1fr)] items-start py-[0.25em]`,o??`gap-[0.6em] px-[0.5em]`,u&&`yuri-todo-row-in`),children:[(0,Y.jsx)(`span`,{className:N(`flex h-[1.32em] w-[1.15em] items-center justify-center`,u&&`yuri-todo-icon-pop`),title:d(Z[r]),children:(0,Y.jsx)(Se,{status:r})},r),(0,Y.jsx)(`span`,{dir:`auto`,title:e.content,className:N(`line-clamp-3 min-w-0 whitespace-normal text-[0.88em] break-words leading-[1.5] transition-colors duration-300`,ve[r]),children:(0,Y.jsx)(`span`,{className:N(r===`in_progress`&&`animate-text-shimmer`),children:e.content})})]},e.id??`${t}:${e.content}`)},t[15]=m,t[16]=u,t[17]=g,t[18]=l,t[19]=o,t[20]=d,t[21]=e):e=t[21],v=n.map(e),t[7]=m,t[8]=u,t[9]=g,t[10]=l,t[11]=o,t[12]=d,t[13]=n,t[14]=v}else v=t[14];let y;return t[22]!==c||t[23]!==s||t[24]!==_||t[25]!==v?(y=(0,Y.jsx)(`ul`,{id:c,ref:s,className:_,children:v}),t[22]=c,t[23]=s,t[24]=_,t[25]=v,t[26]=y):y=t[26],y};function ke(e){return e.status===`in_progress`}function Ae(e){return e.status===`pending`}function je(e){return e.status===`in_progress`}var Me=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),Ne=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,Pe=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=Ne(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},Fe=e=>`<pre><code>${Me(e)}</code></pre>`,Ie=e=>{let t=(0,J.c)(21),{code:n,language:r,className:i,style:a,codeStyle:o,wrap:s}=e,c=s!==void 0&&s,{currentTheme:l}=L(),u=q.useRef(null),d;t[0]===l?d=t[1]:(d=G(l),t[0]=l,t[1]=d);let f=d,p,m;t[2]!==n||t[3]!==o||t[4]!==c?(p=()=>{let e=u.current;e&&(e.innerHTML=Fe(n),Pe(e,c,o))},m=[n,c,o],t[2]=n,t[3]=o,t[4]=c,t[5]=p,t[6]=m):(p=t[5],m=t[6]),q.useLayoutEffect(p,m);let h,g;t[7]!==n||t[8]!==o||t[9]!==r||t[10]!==c?(h=()=>{let e=u.current;if(!e)return;let t=!0,i=new AbortController;return he(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,Pe(e,c,o))}),()=>{t=!1,i.abort()}},g=[n,r,c,o],t[7]=n,t[8]=o,t[9]=r,t[10]=c,t[11]=h,t[12]=g):(h=t[11],g=t[12]),q.useEffect(h,g);let _;t[13]===i?_=t[14]:(_=N(`typography-code`,i),t[13]=i,t[14]=_);let v=f,y;t[15]!==a||t[16]!==v?(y={...v,...a},t[15]=a,t[16]=v,t[17]=y):y=t[17];let b;return t[18]!==_||t[19]!==y?(b=(0,Y.jsx)(`div`,{ref:u,className:_,style:y}),t[18]=_,t[19]=y,t[20]=b):b=t[20],b},Le=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},Re=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},ze=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,Be=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,Ve=(e,t)=>!e||typeof e!=`object`?String(e):I(e,t||``),He=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},Ue=e=>{if(!e||typeof e!=`object`)return;let t=He(e.patch)??He(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=He(e.patch)??He(e.diff);if(t)return t}},We=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},Ge=(e,t,n)=>{let r=Le(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&ze(r)&&(r=Be(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=Ue(n);if(e)return e}return r},Ke=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),r=e=>/\(\s*File has more lines\..*offset.*\)/i.test(e.trim());return{type:t,lines:n.map(e=>{let n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);if(t!==`directory`){let t=e.match(/^(\d+):\s?(.*)$/);if(t){let e=t[2],n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);return{lineNumber:i?null:Number(t[1]),text:e,isInfo:i}}}return{lineNumber:null,text:e,isInfo:i}}).filter((e,t,n)=>{if(e.text.trim().length>0)return!0;let r=n[t-1],i=n[t+1],a=!!(r?.isInfo||i?.isInfo),o=e.lineNumber!==null;return!(a&&o)})}},qe=(e,t)=>{try{let n=e.trim().split(`
4
4
  `).filter(Boolean);if(n.length===0)return null;let r=[];return n.forEach(e=>{let t=e.match(/^(\s*)(.+)$/);if(t){let[,e,n]=t,i=Math.floor(e.length/2),a=!n.endsWith(`/`);r.push({name:n.replace(/\/$/,``),depth:i,isFile:a})}}),(0,Y.jsx)(`div`,{className:N(`w-full min-w-0 font-mono space-y-0.5`,t?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/30`),style:T.tool.popup,children:r.map((e,t)=>(0,Y.jsx)(`div`,{className:`min-w-0`,style:{paddingLeft:`${e.depth*20}px`},children:e.isFile?(0,Y.jsx)(`span`,{className:`text-foreground/90 block truncate`,children:e.name}):(0,Y.jsxs)(`span`,{className:`font-semibold text-foreground block truncate`,children:[e.name,`/`]})},t))})}catch{return null}},Je={backgroundColor:`var(--status-info)`,opacity:.6},Ye=(e,t,n)=>{try{let r=e.trim().split(`