@yuriai/web 0.2.36 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/assets/AgentAvatar-Dpot7DG_.js +1 -0
- package/dist/assets/AssistantContactStatus-DBUeAOcC.js +3 -0
- package/dist/assets/AssistantUnreadBadge-uMPRfRqu.js +1 -0
- package/dist/assets/AssistantView-9v8wufOH.js +1 -0
- package/dist/assets/DiagramView-D317a0U8.js +1 -0
- package/dist/assets/FadeInOnReveal-DlU4WRpc.js +1 -0
- package/dist/assets/GuiPluginSurface-DHMppLxf.js +1 -0
- package/dist/assets/GuiPluginWindow-CWP-ZcJj.js +1 -0
- package/dist/assets/Icon-3udlHlix.js +1 -0
- package/dist/assets/ImageLoadingPlaceholder-D2CKCkHe.js +1 -0
- package/dist/assets/LoadingImage-CzTb95Cn.js +1 -0
- package/dist/assets/MarkdownRenderer-C1KveBTm.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-DBaGpRQS.js → MarkdownRendererImpl-Dfj5yBQH.js} +2 -2
- package/dist/assets/MarkstreamRendererImpl-DBWfVjRS.js +3 -0
- package/dist/assets/MobileDetailNavigation-D6pHFCLd.js +1 -0
- package/dist/assets/MobileResizableSheet-B9lJQT-Q.js +1 -0
- package/dist/assets/MobileShareBridge-BJDkko0y.js +4 -0
- package/dist/assets/MobileTabPageHeader-BdZ4z7qY.js +2 -0
- package/dist/assets/MultiRunWindow-C4sUyQMj.js +1 -0
- package/dist/assets/OnboardingScreen-tF0G9FoO.js +1 -0
- package/dist/assets/OverlayScrollbar-BhUMMoCN.js +1 -0
- package/dist/assets/SettingsView-Dk2vpPHM.js +29 -0
- package/dist/assets/SettingsWindow-Cl_MVXqd.js +1 -0
- package/dist/assets/SetupTourDialog-BGvxww7E.js +1 -0
- package/dist/assets/TerminalView-DCVU9yPv.js +8 -0
- package/dist/assets/{ToolOutputDialog-BhD4QiRH.js → ToolOutputDialog-BSNWZM5u.js} +4 -4
- package/dist/assets/VoiceSettings-C3KZYlyP.js +2 -0
- package/dist/assets/YuriLogo-CMoJ3Apd.js +1 -0
- package/dist/assets/{YuriWordmark-CGDlDvEH.js → YuriWordmark-DiB7p_ho.js} +1 -1
- package/dist/assets/{appThemeRegistry-2DEQy44q.js → appThemeRegistry-axRbeIwY.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-oatc8F4t.js → assistant-attachment-cache-B7NHgRWA.js} +1 -1
- package/dist/assets/bootstrap-CH0Mo2ok.js +9 -0
- package/dist/assets/{capgoAdapter-Dz8eMW5Y.js → capgoAdapter-C8QhPFlX.js} +1 -1
- package/dist/assets/checkbox-C641Uk-q.js +1 -0
- package/dist/assets/collapsible-YNp0uGvK.js +1 -0
- package/dist/assets/context-menu-BHe5nbZ0.js +1 -0
- package/dist/assets/desktop-DLxQTjzu.js +1 -0
- package/dist/assets/desktopHosts-Dk0D5ATF.js +1 -0
- package/dist/assets/desktopRelayRestore-COTsQw8C.js +1 -0
- package/dist/assets/{device-w1ioiqv3.js → device-BGox1QjM.js} +1 -1
- package/dist/assets/diagram-DZJvm12J.js +1 -0
- package/dist/assets/dialog-So-nuji1.js +1 -0
- package/dist/assets/{es-CPoqPlVn.js → es-BC7jaA0J.js} +2 -2
- package/dist/assets/{fileMentionTouchSelection-B-oPBD2a.js → fileMentionTouchSelection-CcBab6jA.js} +1 -1
- package/dist/assets/fileQueries-BBcsALlC.js +1 -0
- package/dist/assets/{fileReferenceActions-DrAZHld4.js → fileReferenceActions-DRECILCs.js} +1 -1
- package/dist/assets/{fileReferenceParser-1HHDBUum.js → fileReferenceParser-BayaidRM.js} +1 -1
- package/dist/assets/{fr-F7aQyu3-.js → fr-BIvcfHvS.js} +2 -2
- package/dist/assets/{gitApi-Dy__-dVB.js → gitApi-CXUPuRTB.js} +5 -5
- package/dist/assets/historyImportQueries-MpkoiK56.js +1 -0
- package/dist/assets/host-CzMYcPbz.js +1 -0
- package/dist/assets/image-loading-2ppAWcFZ.js +1 -0
- package/dist/assets/input-BK1Dm9vD.js +1 -0
- package/dist/assets/insertionBoundaries-DQRAPE-y.js +1 -0
- package/dist/assets/{ja-BVQSzC4w.js → ja-Dx_d9fYc.js} +2 -2
- package/dist/assets/{ko-DW2WaBw6.js → ko-CLQ_FtRR.js} +2 -2
- package/dist/assets/main-BVl-5tBj.js +169 -0
- package/dist/assets/main-CM26G9n0.js +2 -0
- package/dist/assets/{markdownHeightCache-D0fP62uP.js → markdownHeightCache-DMZ5GgoP.js} +1 -1
- package/dist/assets/mcpQueries-BFbulSUU.js +1 -0
- package/dist/assets/miniChat-CD9Pz0ZW.js +2 -0
- package/dist/assets/mobile-B3bArIND.js +2 -0
- package/dist/assets/{mobileBackNavigation-B-dgoPw6.js → mobileBackNavigation-D3-dwiiY.js} +1 -1
- package/dist/assets/multirun-CEyNjbIS.js +3 -0
- package/dist/assets/{native-config-CLcCZ6JT.js → native-config-stLNU1o7.js} +1 -1
- package/dist/assets/path-utils-HRmerlyU.js +1 -0
- package/dist/assets/{pl-BWVfAt6z.js → pl-BkPum7Gu.js} +3 -3
- package/dist/assets/platform-h8km2dnF.js +1 -0
- package/dist/assets/projectActions-C-9Z8R7y.js +1 -0
- package/dist/assets/projectMeta-2FoNc0nP.js +1 -0
- package/dist/assets/{pt-BR-BifD1KYG.js → pt-BR-DfT7YLHn.js} +2 -2
- package/dist/assets/pwa-CCJwn58X.js +2 -0
- package/dist/assets/queue-abort-optimistic-BZd3gflI.js +1 -0
- package/dist/assets/readiness-Djew2NvN.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-DdvkzG1o.js +2 -0
- package/dist/assets/renderMobileApp-D4aaygxO.js +28 -0
- package/dist/assets/runtime-file-download-Bz4NbKDi.js +1 -0
- package/dist/assets/runtime-file-resource-Btl3euLf.js +2 -0
- package/dist/assets/runtimeConfig-D4pEnoIh.js +2 -0
- package/dist/assets/runtimeEndpointReset-6jhYadQt.css +1 -0
- package/dist/assets/runtimeEndpointReset-DvSz9Dmf.js +149 -0
- package/dist/assets/{scheduledTaskNavigation-7dD6PWMD.js → scheduledTaskNavigation-BhsMoXS3.js} +1 -1
- package/dist/assets/select-IPdYq29J.js +1 -0
- package/dist/assets/sessionLookup-7Ux2A4fS.js +1 -0
- package/dist/assets/sortable-tabs-strip-pQbSLRMg.js +1 -0
- package/dist/assets/{speechSettingsQueries-sb0ZHAri.js → speechSettingsQueries-Cl_-LtPL.js} +1 -1
- package/dist/assets/src-BHDTEDdR.css +2 -0
- package/dist/assets/{store-Dvb_y7vz.js → store-BKKodkCp.js} +3 -3
- package/dist/assets/terminalApi-D2kNkPrJ.js +1 -0
- package/dist/assets/textarea-DSOIfiVX.js +1 -0
- package/dist/assets/tooltip-BuZUnYeV.js +1 -0
- package/dist/assets/{types-DD3a5G5L.js → types-DAssRFbW.js} +1 -1
- package/dist/assets/{uk-3_q1FN3X.js → uk-DgzBKB1K.js} +2 -2
- package/dist/assets/url-DO6Zrx1P.js +1 -0
- package/dist/assets/{useAppFontEffects-BBRIHYET.js → useAppFontEffects-Cjtcc4Sq.js} +58 -58
- package/dist/assets/{useAssistantUIStore-cHle1U5H.js → useAssistantUIStore-Jmh6rESU.js} +1 -1
- package/dist/assets/useDesktopWindowControlsLayout-BJx2ijlY.js +1 -0
- package/dist/assets/useDictation-BafHajO_.js +1 -0
- package/dist/assets/useEffectiveDirectory-AQOtdYdf.js +1 -0
- package/dist/assets/{useFontPreferences-D-AOjd9H.js → useFontPreferences-OCLG7Btz.js} +1 -1
- package/dist/assets/useMobileNavigationStore-l2L-r3RJ.js +17 -0
- package/dist/assets/usePluginsStore-DaZr5OE_.js +1 -0
- package/dist/assets/{useStreamingTextThrottle-C2ORuOtg.js → useStreamingTextThrottle-C1Dm4frL.js} +1 -1
- package/dist/assets/{useUIStore-B61bCFEM.js → useUIStore-DPo791La.js} +1 -1
- package/dist/assets/useWorkerHighlightedLines-DhJbTxdK.js +7 -0
- package/dist/assets/vendor-reactuses-core-CuTmqEMK.js +1 -0
- package/dist/assets/{zh-CN-DvlJbsyJ.js → zh-CN-DTKScxtm.js} +2 -2
- package/dist/assets/{zh-TW-B4FmXnzP.js → zh-TW-JOn8l2o2.js} +2 -2
- package/dist/index.html +19 -23
- package/dist/mini-chat.html +19 -23
- package/dist/mobile.html +19 -23
- package/package.json +1 -1
- package/server/index.js +4 -3
- package/server/lib/assistants/DOCUMENTATION.md +37 -5
- package/server/lib/assistants/contact-store.js +8 -1
- package/server/lib/assistants/contact-tools.js +6 -6
- package/server/lib/assistants/contact-tools.test.js +4 -2
- package/server/lib/assistants/harness.js +14 -8
- package/server/lib/assistants/harness.test.js +33 -0
- package/server/lib/assistants/pi-tools.js +15 -2
- package/server/lib/assistants/pi-tools.test.js +35 -1
- package/server/lib/assistants/service.js +6 -9
- package/server/lib/assistants/service.test.js +90 -12
- package/server/lib/assistants/summary.js +2 -0
- package/server/lib/assistants/tool-execution.js +53 -0
- package/server/lib/assistants/tool-execution.test.js +82 -0
- package/server/lib/assistants/yuri-project.http.test.js +2 -3
- package/server/lib/assistants/yuri-tools.js +1 -1
- package/server/lib/git/DOCUMENTATION.md +3 -0
- package/server/lib/git/service.js +9 -3
- package/server/lib/git/worktrees.catalog.test.js +31 -0
- package/server/lib/notifications/DOCUMENTATION.md +34 -0
- package/server/lib/notifications/session-unread-runtime.js +101 -0
- package/server/lib/notifications/session-unread-store.js +93 -0
- package/server/lib/notifications/session-unread.test.js +176 -0
- package/server/lib/opencode/feature-routes-runtime.js +22 -1
- package/server/lib/opencode/session-directory-runtime.js +29 -3
- package/server/lib/opencode/session-directory-runtime.test.js +78 -0
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +12 -0
- package/server/lib/scheduled-tasks/runtime.js +24 -0
- package/server/lib/scheduled-tasks/runtime.test.js +41 -0
- package/server/lib/session-index/DOCUMENTATION.md +9 -0
- package/server/lib/session-index/sync-runtime.js +10 -1
- package/dist/assets/AgentAvatar-0zDTBIBH.js +0 -1
- package/dist/assets/AssistantContactStatus-CqBzrMI3.js +0 -3
- package/dist/assets/AssistantUnreadBadge-CqMHWeGm.js +0 -1
- package/dist/assets/AssistantView-DSnDwWGc.js +0 -1
- package/dist/assets/DiagramView-xGg1oS8b.js +0 -1
- package/dist/assets/FadeInOnReveal-C_UU65YY.js +0 -1
- package/dist/assets/GuiPluginSurface-Dpiaq__1.js +0 -1
- package/dist/assets/GuiPluginWindow-B0oHkEwj.js +0 -1
- package/dist/assets/Icon-BNzwtZlI.js +0 -1
- package/dist/assets/ImageLoadingPlaceholder-CH4TCRvH.js +0 -1
- package/dist/assets/LoadingImage-C6jr50EL.js +0 -1
- package/dist/assets/MarkdownRenderer-BonJRvHM.js +0 -2
- package/dist/assets/MarkstreamRendererImpl-DcxDrUW1.js +0 -3
- package/dist/assets/MobileDetailNavigation-DacHr77a.js +0 -1
- package/dist/assets/MobileResizableSheet-DZ7Kq3ZS.js +0 -1
- package/dist/assets/MobileShareBridge-CKDkjJIK.js +0 -4
- package/dist/assets/MobileTabPageHeader-CT5jeuHU.js +0 -2
- package/dist/assets/MultiRunWindow-GFioSTDw.js +0 -1
- package/dist/assets/OnboardingScreen-DAiSh2kq.js +0 -1
- package/dist/assets/OverlayScrollbar-5yODT_nG.js +0 -1
- package/dist/assets/SettingsView-BoDwWc6-.js +0 -29
- package/dist/assets/SettingsWindow-BGPVsXUi.js +0 -1
- package/dist/assets/SetupTourDialog-CM8-QHJ3.js +0 -1
- package/dist/assets/TerminalView-BnR50Mgm.js +0 -8
- package/dist/assets/VoiceSettings-BeMRGXfr.js +0 -2
- package/dist/assets/YuriLogo-D7QXHCf6.js +0 -1
- package/dist/assets/bootstrap-Bi91NjXG.js +0 -3
- package/dist/assets/button-CPRnAdlm.js +0 -1
- package/dist/assets/checkbox-DZkjNegP.js +0 -1
- package/dist/assets/collapsible-CP7z1jKL.js +0 -1
- package/dist/assets/context-menu-B8yin969.js +0 -1
- package/dist/assets/desktop-BAmoc_34.js +0 -1
- package/dist/assets/desktopHosts-BLU1tGSX.js +0 -1
- package/dist/assets/desktopRelayRestore-2BIIs8mZ.js +0 -1
- package/dist/assets/diagram-O7VUqG75.js +0 -1
- package/dist/assets/dialog-Dq8l3IQC.js +0 -1
- package/dist/assets/fileQueries-C2Rs6TPz.js +0 -1
- package/dist/assets/gitApiHttp-CKrsk1tw.js +0 -7
- package/dist/assets/historyImportQueries-C8VK9R5_.js +0 -1
- package/dist/assets/host-z9PU8q1e.js +0 -1
- package/dist/assets/image-loading-DKQOYtti.js +0 -1
- package/dist/assets/input-9A1m0Yjq.js +0 -1
- package/dist/assets/insertionBoundaries-DdpR3zaP.js +0 -1
- package/dist/assets/main-B2Bi3ueT.js +0 -2
- package/dist/assets/main-CpoO7VOS.js +0 -169
- package/dist/assets/mcpQueries-DcbmHgNY.js +0 -1
- package/dist/assets/miniChat-C52LB0Yu.js +0 -2
- package/dist/assets/mobile-U4WSU-8R.js +0 -2
- package/dist/assets/multirun-VckoCH5p.js +0 -3
- package/dist/assets/path-utils-jGozTg9d.js +0 -1
- package/dist/assets/pathNormalization-ewtPqJWn.js +0 -1
- package/dist/assets/platform-sEg2IOLZ.js +0 -1
- package/dist/assets/projectActions-BX0cjZoq.js +0 -1
- package/dist/assets/projectMeta-BYNpABmO.js +0 -1
- package/dist/assets/pwa--whpkoe7.js +0 -2
- package/dist/assets/queryRuntime-2dx7jbt9.js +0 -1
- package/dist/assets/queue-abort-optimistic-CsU9CtHa.js +0 -1
- package/dist/assets/readiness-CafO-iNt.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-BOZWsCQP.js +0 -2
- package/dist/assets/renderMobileApp-Cc6uK66H.js +0 -28
- package/dist/assets/runtime-file-download-D6bwc3Kj.js +0 -1
- package/dist/assets/runtime-file-resource-BP4P52ry.js +0 -2
- package/dist/assets/runtimeAPIRegistry-C2VogTny.js +0 -1
- package/dist/assets/runtimeConfig-Coh1hryT.js +0 -2
- package/dist/assets/runtimeEndpointReset-BP4JwHFJ.css +0 -1
- package/dist/assets/runtimeEndpointReset-Bwm_RwzE.js +0 -149
- package/dist/assets/select-BNDVM5KL.js +0 -1
- package/dist/assets/sessionLookup-BI6ygHcL.js +0 -1
- package/dist/assets/sortable-tabs-strip-lZ6K_9ug.js +0 -1
- package/dist/assets/src-B_i0g2Ca.css +0 -2
- package/dist/assets/terminalApi-Bo6KWljy.js +0 -1
- package/dist/assets/textarea-Ds63PD7U.js +0 -1
- package/dist/assets/tooltip-C25g1ojI.js +0 -1
- package/dist/assets/url-MRa-FtQa.js +0 -1
- package/dist/assets/useDesktopWindowControlsLayout-CTSEy8Ep.js +0 -1
- package/dist/assets/useDictation-ozXiBIfG.js +0 -1
- package/dist/assets/useEffectiveDirectory-DO311OTB.js +0 -1
- package/dist/assets/useMobileNavigationStore-D59MROJU.js +0 -17
- package/dist/assets/usePluginsStore-3VJgeLvf.js +0 -1
- package/dist/assets/useWorkerHighlightedLines-DaoXaYxw.js +0 -7
- package/dist/assets/vendor-reactuses-core-DWo5Wn6R.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
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-CzHs0bHY.js";import{n as c}from"./vendor-react-DlzBev0S.js";import{f as l,r as u}from"./button-CPRnAdlm.js";import{t as d}from"./SettingsView-BoDwWc6-.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 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-DEZ1K7qW.js";import{ot as r,st as i}from"./vendor-base-ui-CzHs0bHY.js";import{n as a}from"./vendor-react-DlzBev0S.js";import{s as o}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{a as s}from"./queryRuntime-2dx7jbt9.js";import{i as c}from"./vendor-reactuses-core-DWo5Wn6R.js";import{f as ee,r as l,t as u}from"./button-CPRnAdlm.js";import{Ei as d,la as f}from"./useMobileNavigationStore-D59MROJU.js";import{n as p}from"./Icon-BNzwtZlI.js";import{a as m,n as h,o as g,t as _}from"./dialog-Dq8l3IQC.js";import{t as v}from"./checkbox-DZkjNegP.js";import{t as y}from"./YuriLogo-D7QXHCf6.js";import{g as b,h as x,l as S,p as C}from"./select-BNDVM5KL.js";import{n as w}from"./MarkdownRenderer-BonJRvHM.js";import{n as T}from"./speechSettingsQueries-sb0ZHAri.js";import{n as E,t as D}from"./YuriWordmark-CGDlDvEH.js";import{a as O,c as k,f as A,n as j,r as M,t as N}from"./usePluginsStore-3VJgeLvf.js";import{c as P,i as F,n as I,r as L,s as R,t as z}from"./VoiceSettings-BeMRGXfr.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-C8VK9R5_.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:b,dsh:x,opencode:C};function se({onBusy:e,directory:r=null,onPrimaryChange:i,onComplete:a}){let{t:o,locale:s}=ee(),d=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)}},[d,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&&d===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,d,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:l(`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,d),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:l(`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:l(`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(),d=q[n],f=r?.kind===`npm-ok`?r:void 0,m=a&&`yuri-tour-card-selected`,h;t[0]===m?h=t[1]:(h=l(`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]!==d.name||t[8]!==a||t[9]!==_?(v=(0,Z.jsx)(u,{variant:`ghost`,className:`yuri-tour-card-toggle`,"aria-label":d.name,"aria-pressed":a,onClick:o,children:_}),t[6]=o,t[7]=d.name,t[8]=a,t[9]=_,t[10]=v):v=t[10];let y=f?.icon,b;t[11]!==d.name||t[12]!==y?(b=(0,Z.jsx)(P,{name:d.name,src:y,size:30}),t[11]=d.name,t[12]=y,t[13]=b):b=t[13];let x;t[14]===d.name?x=t[15]:(x=(0,Z.jsx)(`h3`,{className:`typography-ui-label font-medium`,children:d.name}),t[14]=d.name,t[15]=x);let S;t[16]===d.spec?S=t[17]:(S=(0,Z.jsx)(`p`,{className:`break-all typography-micro text-muted-foreground`,children:d.spec}),t[16]=d.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,b]=G.useState(`magpie`),[x,C]=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=d.getState(),n=e&&t.providers.some(t=>t.id===e);b(`other`),C(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({...f(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 d.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:l(`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:x}):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:l(`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:()=>b(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)(S,{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)(S,{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)(S,{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)(w,{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,8 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t}from"./runtime-fetch-D0YWp3FJ.js";import{S as n}from"./desktop-BAmoc_34.js";import{at as r,ot as i,st as a}from"./vendor-base-ui-CzHs0bHY.js";import{f as o,p as s,r as c}from"./useUIStore-B61bCFEM.js";import{u as l}from"./fileQueries-C2Rs6TPz.js";import{o as u}from"./terminalApi-Bo6KWljy.js";import{n as d,r as f,t as p}from"./vendor-ghostty-web-DbBrwBII.js";import{d as m,f as h,r as g,t as _}from"./button-CPRnAdlm.js";import{p as v}from"./useMobileNavigationStore-D59MROJU.js";import{n as y}from"./useThemeSystem-CNzUUkFn.js";import{n as b}from"./Icon-BNzwtZlI.js";import{r as ee}from"./device-w1ioiqv3.js";import{n as x}from"./useEffectiveDirectory-DO311OTB.js";import{t as te}from"./OverlayScrollbar-5yODT_nG.js";import{t as S}from"./sortable-tabs-strip-lZ6K_9ug.js";import{n as C,t as w}from"./useFontPreferences-D-AOjd9H.js";import{r as T}from"./projectActions-BX0cjZoq.js";var E=e(a(),1);function ne(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 re(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 ie=e(r(),1),D=i(),O=null;function k(){return O||=f.load(),O}function ae(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 oe=E.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:_}=h(),v=E.useRef(null),y=E.useRef(null),b=E.useRef(null),ee=E.useRef(null),x=E.useRef(n),S=E.useRef(r),C=E.useRef(null),w=E.useRef(``),T=E.useRef(null),ne=E.useRef(!1),O=E.useRef(null),oe=E.useRef(!0),A=E.useRef(null),j=E.useRef(null),se=E.useRef(0),ce=E.useRef(null),M=E.useRef(null),N=E.useRef(!1),P=E.useRef(!1),le=E.useRef(null),ue=E.useRef(null),de=E.useRef(null),F=E.useRef(``),fe=E.useRef(null),pe=E.useRef(!c),me=E.useRef(u),[,he]=E.useReducer(e=>e+1,0),[ge,_e]=E.useReducer(e=>e+1,0);x.current=n,S.current=r;let ve=typeof navigator<`u`&&(/Android/i.test(navigator.userAgent)||navigator.userAgentData?.platform===`Android`),I=!!c;E.useEffect(()=>{if(!c){pe.current=!0,me.current=u;return}!me.current&&u&&(pe.current=!1),me.current=u},[c,u]);let ye=E.useCallback(()=>{if(!I)return;let e=v.current,t=ce.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`)})},[I]),L=E.useCallback(e=>{if(fe.current===e)return;let t=b.current;if(t)try{if(typeof t.setOption==`function`){t.setOption(`cursorBlink`,e),fe.current=e;return}t.options&&(t.options.cursorBlink=e,fe.current=e)}catch{}},[]),R=I&&ve,z=E.useCallback((e,t)=>{let n=R?M.current:ce.current,r=v.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{}}},[R]),B=E.useCallback(()=>{if(I){z(),L(!0);return}b.current?.focus(),L(!0)},[z,L,I]),V=E.useCallback(e=>e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement?e.value:e.textContent??``,[]),H=E.useCallback(e=>{if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){e.value=``;return}e.textContent=``},[]),be=E.useCallback(e=>{if(typeof window>`u`||R)return;de.current!==null&&(window.clearTimeout(de.current),de.current=null);let t=0,n=()=>{de.current=window.setTimeout(()=>{de.current=null;let r=V(e);if(!r){if(t+=1,t<3){n();return}return}let i=F.current;F.current=r;let a=r.startsWith(i)?r.slice(i.length):r;a&&x.current(a.replace(/\r\n|\r|\n/g,`\r`)),H(e),F.current=``},t===0?0:24)};n()},[H,V,R]);E.useEffect(()=>{let e=v.current;if(!I||!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{}z()}};return e.addEventListener(`focusin`,t,!0),()=>{e.removeEventListener(`focusin`,t,!0)}},[c,I,z]);let U=E.useCallback(()=>{let e=b.current;if(!e||typeof e.getSelection!=`function`)return``;let t=e.getSelection();return typeof t==`string`?t:``},[]),xe=E.useCallback(()=>{if(typeof window>`u`)return``;let e=window.getSelection();if(!e)return``;let t=e.toString();if(!t.trim())return``;let n=v.current;if(!n)return``;let r=e.anchorNode,i=e.focusNode;return r&&!n.contains(r)||i&&!n.contains(i)?``:t},[]),Se=E.useCallback(async()=>{if(typeof document>`u`)return;let e=U()||xe();e.trim()&&await m(e)},[xe,U]),Ce=E.useCallback(()=>U().trim()?!0:!!xe().trim(),[xe,U]);E.useEffect(()=>{if(typeof window>`u`)return;let e=e=>{Ce()&&(e.preventDefault(),Se())};return window.addEventListener(`yuri:copy`,e),()=>{window.removeEventListener(`yuri:copy`,e)}},[Se,Ce]);let W=E.useCallback(()=>{w.current=``,T.current!==null&&typeof window<`u`&&window.cancelAnimationFrame(T.current),T.current=null,ne.current=!1,O.current=null},[]),G=E.useCallback(()=>{let e=ee.current,t=b.current,n=v.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=C.current;(!r||r.cols!==n.cols||r.rows!==n.rows)&&(C.current=n,S.current(n.cols,n.rows))}catch{}},[]),K=E.useCallback(()=>{if(ne.current)return;let e=b.current;if(!e){W();return}if(!w.current)return;let t=w.current;w.current=``,ne.current=!0,e.write(t,()=>{ne.current=!1,w.current&&(typeof window<`u`?T.current=window.requestAnimationFrame(()=>{T.current=null,K()}):K())})},[W]),we=E.useCallback(()=>{T.current===null&&(typeof window<`u`?T.current=window.requestAnimationFrame(()=>{T.current=null,K()}):K())},[K]),q=E.useCallback(e=>{e&&(w.current+=e,we())},[we]),Te=E.useCallback(()=>{if(A.current?.(),A.current=null,j.current!==null&&typeof window<`u`&&(window.clearTimeout(j.current),j.current=null),!c){se.current=0;return}let e=v.current;if(!e)return;let t=b.current;if(!t)return;se.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,p=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},m=()=>{l.rafId!==null&&typeof window<`u`&&window.cancelAnimationFrame(l.rafId),l.rafId=null},h={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`){m(),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()),p(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){I?z(n.clientX,n.clientY):c&&!pe.current&&(pe.current=!0,b.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=p(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){m(),t.velocity=0;return}t.rafId=window.requestAnimationFrame(o)};t.rafId=window.requestAnimationFrame(o)};e.addEventListener(`pointerdown`,o,h),e.addEventListener(`pointermove`,d,h),e.addEventListener(`pointerup`,f,h),e.addEventListener(`pointercancel`,f,h);let g=e.style.touchAction,_=e.style.overscrollBehaviorY;e.style.touchAction=`none`,e.style.overscrollBehaviorY=`contain`,A.current=()=>{m(),j.current!==null&&typeof window<`u`&&(window.clearTimeout(j.current),j.current=null),se.current=0,e.removeEventListener(`pointerdown`,o,h),e.removeEventListener(`pointermove`,d,h),e.removeEventListener(`pointerup`,f,h),e.removeEventListener(`pointercancel`,f,h),e.style.touchAction=g,e.style.overscrollBehaviorY=_};return}let g=e=>{e.touches.length===1&&(m(),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)},_=e=>{if(e.touches.length!==1){l.lastY=null,l.lastTime=null,l.velocity=0,l.startX=null,l.startY=null,l.didMove=!1,m();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),h=d*(n+Math.min(r,Math.abs(d)/25)),g=h/f;l.velocity=l.velocity*.75+g*i,l.velocity>8?l.velocity=8:l.velocity<-8&&(l.velocity=-8),l.didMove&&(e.preventDefault(),e.stopPropagation()),p(h)},y=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];I?z(t?.clientX,t?.clientY):c&&!pe.current&&(pe.current=!0,b.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=p(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){m(),l.velocity=0;return}l.rafId=window.requestAnimationFrame(i)};l.rafId=window.requestAnimationFrame(i)};e.addEventListener(`touchstart`,g,h),e.addEventListener(`touchmove`,_,h),e.addEventListener(`touchend`,y,h),e.addEventListener(`touchcancel`,y,h);let ee=e.style.touchAction,x=e.style.overscrollBehaviorY;e.style.touchAction=`none`,e.style.overscrollBehaviorY=`contain`,A.current=()=>{m(),j.current!==null&&typeof window<`u`&&(window.clearTimeout(j.current),j.current=null),se.current=0,e.removeEventListener(`touchstart`,g,h),e.removeEventListener(`touchmove`,_,h),e.removeEventListener(`touchend`,y,h),e.removeEventListener(`touchcancel`,y,h),e.style.touchAction=ee,e.style.overscrollBehaviorY=x}},[c,I,z,o]);E.useEffect(()=>{let e=!1,t=null,n=null,r=null,s=[],l=null,u=null,f=null,m=v.current;if(!m)return;if(m.tabIndex=I?-1:0,I){let e=m.focus.bind(m),t=m;t.focus=((...e)=>{z()}),f=()=>{t.focus=e}}let h=()=>{L(!0)},g=()=>{L(!1)},_=e=>{let t=e.target;if(t&&m.contains(t)){if(I&&t instanceof HTMLElement){window.setTimeout(()=>{t.blur(),z()},0),L(!1);return}if(c&&!pe.current&&t instanceof HTMLElement){window.setTimeout(()=>{t.blur()},0),L(!1);return}L(!0);return}L(!1)},te=()=>{L(!1)},S=null;return(async()=>{try{let f=await k();if(e)return;let _=re(a,o,i,f,!1),v=new d(_);oe.current=!0,I&&(v.focus=()=>{});let te=v;if(typeof te.scrollToBottom==`function`){let e=te.scrollToBottom.bind(te);te.scrollToBottom=()=>{oe.current&&e()},l=()=>{te.scrollToBottom=e}}let C=new p;if(t=v,b.current=v,ee.current=C,v.loadAddon(C),v.open(m),c){let e=v.renderer;if(e&&typeof e.renderScrollbar==`function`){let t=e.renderScrollbar.bind(e);e.renderScrollbar=()=>{},u=()=>{e.renderScrollbar=t}}}_e(),fe.current=!1,S=v.textarea??m.querySelector(`textarea`),S&&(S.addEventListener(`focus`,h),S.addEventListener(`blur`,g)),ye(),typeof MutationObserver<`u`&&(r=new MutationObserver(()=>{ye()}),r.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`contenteditable`,`role`,`tabindex`,`aria-label`]}));let w=ae(m);w?(w.classList.add(`overlay-scrollbar-target`,`overlay-scrollbar-container`),y.current=w,he()):y.current=null,G();let T=C;typeof T.observeResize==`function`&&T.observeResize(),Te(),s=[v.onData(e=>{x.current(e)}),v.onScroll(e=>{if(typeof e==`number`&&Number.isFinite(e)){let t=typeof v.hasSelection==`function`&&v.hasSelection();oe.current=!t&&e<=.5}}),v.onSelectionChange(()=>{if(typeof v.hasSelection==`function`&&v.hasSelection()){oe.current=!1;return}let e=typeof v.getViewportY==`function`?v.getViewportY():0;oe.current=e<=.5})],n=new ResizeObserver(()=>{G()}),n.observe(m),typeof window<`u`&&window.setTimeout(()=>{G()},0)}catch{}})(),document.addEventListener(`focusin`,_,!0),window.addEventListener(`blur`,te),()=>{e=!0,A.current?.(),A.current=null,document.removeEventListener(`focusin`,_,!0),window.removeEventListener(`blur`,te),s.forEach(e=>e.dispose()),l?.(),l=null,u?.(),u=null,S&&(S.removeEventListener(`focus`,h),S.removeEventListener(`blur`,g)),n?.disconnect(),r?.disconnect(),f?.(),t?.dispose(),b.current=null,ee.current=null,y.current=null,C.current=null,fe.current=null,W()}},[ye,c,G,z,a,o,Te,i,W,L,I]),E.useEffect(()=>{let e=b.current;e&&(e.reset(),W(),C.current=null,G())},[e,ge,G,W]),E.useEffect(()=>{l&&b.current&&B()},[l,B,e,ge]),E.useEffect(()=>(Te(),()=>{A.current?.(),A.current=null}),[Te,e]),E.useEffect(()=>{let e=b.current;if(!e)return;if(t.length===0){O.current!==null&&(e.reset(),W(),G());return}let n=O.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&&q(r.map(e=>e.data).join(``)),O.current=t[t.length-1].id},[t,ge,q,G,W]),E.useImperativeHandle(f,()=>({focus:()=>{B()},clear:()=>{let e=b.current;e&&(e.reset(),W(),G())},fit:()=>{G()}}),[B,G,W]);let J=E.useCallback(e=>{if(!I)return;let t=v.current,n=e.relatedTarget,r=n?.tagName;r===`INPUT`||r===`TEXTAREA`||n?.isContentEditable,n?.getAttribute(`data-terminal-hidden-input`),n&&t?.contains(n)},[I]),Y=E.useCallback(e=>{let t=e.nativeEvent,n=t?.inputType??``,r=typeof t?.data==`string`?t.data:``;if(ue.current=typeof performance<`u`?performance.now():Date.now(),n===`insertCompositionText`){N.current=!0;return}if(!n&&r){if(N.current)return;e.preventDefault(),x.current(r),le.current={type:`insertText`,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0;return}if(n===`insertText`&&r){if(N.current)return;e.preventDefault(),x.current(r),le.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0;return}if(n===`insertLineBreak`){if(N.current)return;e.preventDefault(),x.current(`\r`),le.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0;return}if(n===`deleteContentBackward`){if(N.current)return;e.preventDefault(),x.current(``),le.current={type:n,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0}},[]),X=E.useCallback(e=>{let t=e.currentTarget;if(ue.current=typeof performance<`u`?performance.now():Date.now(),N.current)return;if(P.current){let e=le.current,n=typeof performance<`u`?performance.now():Date.now();if(e&&n-e.at<50){P.current=!1,H(t);return}P.current=!1}let n=V(t);if(!n)return;F.current=n;let r=n.replace(/\r\n|\r|\n/g,`\r`);x.current(r),H(t),F.current=``},[H,V]),Ee=E.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)&&Ce()){e.preventDefault(),Se();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(),x.current(String.fromCharCode(t.charCodeAt(0)-64)),H(e.currentTarget);return}}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key.length===1){e.preventDefault(),e.nativeEvent?.stopImmediatePropagation(),x.current(`\x1B`+e.key),H(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(),x.current(i),H(e.currentTarget);return}let a=e.currentTarget;if(e.nativeEvent?.isComposing)return;let o=le.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(),x.current(`\r`),H(a);return}if(e.key===`Backspace`){if(e.preventDefault(),c&&o?.type===`deleteContentBackward`)return;V(a)||x.current(``)}if(e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let t=ue.current;t&&s-t<50||(e.preventDefault(),x.current(e.key),P.current=!0,le.current={type:`keydown-text`,at:s})}be(a)},[H,Se,Ce,V,be]),De=E.useCallback(e=>{e.stopPropagation();let t=e.currentTarget;e.nativeEvent?.isComposing||be(t)},[be]),Oe=E.useCallback(e=>{let t=e.currentTarget;N.current=!1;let n=e.data||V(t);if(ue.current=typeof performance<`u`?performance.now():Date.now(),!n)return;let r=n.replace(/\r\n|\r|\n/g,`\r`);x.current(r),H(t),le.current={type:`compositionend`,at:typeof performance<`u`?performance.now():Date.now()},P.current=!0},[H,V]),ke=E.useCallback(e=>{e.stopPropagation();let t=e.clipboardData?.getData(`text`)??``;if(!t)return;e.preventDefault();let n=b.current?.hasBracketedPaste?.()?`\x1b[200~${t}\x1b[201~`:t;x.current(n)},[]),Ae={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,D.jsxs)(`div`,{ref:v,className:g(`relative h-full w-full terminal-viewport-container`,s),"data-hidden-input-overlay-active":I?`true`:void 0,style:{backgroundColor:i.background},onTouchStart:e=>{if(!(!I||c)&&!Ce()){let t=e.touches?.[0];z(t?.clientX,t?.clientY)}},onClick:e=>{if(!c)if(I){if(Ce())return;z(e.clientX,e.clientY)}else b.current?.focus()},onMouseUp:()=>{!c&&Ce()&&Se()},onTouchEnd:()=>{!c&&Ce()&&Se()},children:[I&&typeof document<`u`?(0,ie.createPortal)((0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`input`,{ref:M,type:`text`,inputMode:`text`,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,tabIndex:-1,enterKeyHint:`send`,"data-terminal-hidden-input":`true`,"aria-label":_(`terminalView.viewport.inputAria`),"aria-hidden":`true`,style:{...Ae,display:R?`block`:`none`},onBlur:J,onBeforeInput:Y,onCompositionStart:()=>{N.current=!0},onInput:X,onKeyDown:Ee,onKeyUp:De,onCompositionEnd:Oe,onPaste:ke}),(0,D.jsx)(`textarea`,{ref:ce,inputMode:`text`,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,tabIndex:-1,enterKeyHint:`send`,"data-terminal-hidden-input":`true`,"aria-label":_(`terminalView.viewport.inputAria`),"aria-hidden":`true`,style:{...Ae,display:R?`none`:`block`},onBlur:J,onBeforeInput:Y,onCompositionStart:()=>{N.current=!0},onInput:X,onKeyDown:Ee,onKeyUp:De,onCompositionEnd:Oe,onPaste:ke})]}),document.body):null,y.current&&!c?(0,D.jsx)(te,{containerRef:y,disableHorizontal:!0,className:`overlay-scrollbar--flush overlay-scrollbar--dense overlay-scrollbar--zero`}):null]})});oe.displayName=`TerminalViewport`;var A=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),j=/(https?:\/\/(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[(?:::1|::)\])(?::\d{2,5})?(?:\/[^\s<>'"`]*)?)/gi,se=/(?:➜\s*(?:Local|Network):)|\b(?:local|network|loopback|serving|listening|available|ready|started|running|server|vite|webpack|next\.js|astro|sveltekit|nuxt)\b/i,ce=/Serving HTTP on .*? port (\d{2,5})/i,M=new Set([`.`,`,`,`;`,`:`,`!`,`?`]),N=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(M.has(e)){t=t.slice(0,-1);continue}break}return t},P=e=>{let t=N(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},le=e=>{if(!e)return null;let t=e.replace(A,``),n=t.match(ce);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
|
-
`);for(let e of r){if(!se.test(e))continue;let t=Array.from(e.matchAll(j));if(t.length!==0)return P((t.find(e=>{try{return!!new URL(P(e[1])).port}catch{return!1}})??t[0])[1])}return null},ue=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)}},de={esc:`\x1B`,tab:` `,enter:`\r`,"arrow-up":`\x1B[A`,"arrow-down":`\x1B[B`,"arrow-left":`\x1B[D`,"arrow-right":`\x1B[C`},F={ctrl:`5`,cmd:`3`},fe={retry:{maxRetries:3,initialDelayMs:500,maxDelayMs:8e3},connectionTimeoutMs:1e4},pe={retry:{maxRetries:8,initialDelayMs:400,maxDelayMs:8e3},connectionTimeoutMs:15e3},me=(e,t)=>{if(t)switch(e){case`arrow-up`:return`\u001b[1;${F[t]}A`;case`arrow-down`:return`\u001b[1;${F[t]}B`;case`arrow-right`:return`\u001b[1;${F[t]}C`;case`arrow-left`:return`\u001b[1;${F[t]}D`}return de[e]??null},he=()=>{let{t:e}=h(),{terminal:t,runtime:r}=l(),{currentTheme:i}=y(),{monoFont:a}=w(),d=c(e=>e.terminalFontSize),f=c(e=>e.bottomTerminalHeight),p=c(e=>e.isBottomTerminalExpanded),{isMobile:m,isTablet:te,hasTouchOnlyPointer:re}=ee(),ie=m||te,O=(ie||re)&&r.platform===`web`,k=r.platform!==`vscode`,ae=c(e=>e.showTerminalQuickKeysOnDesktop),A=!n()&&(ie||ae),j=v(e=>e.currentSessionId),se=v(e=>e.newSessionDraft),ce=j!==null||se?.open===!0,M=x()??null,N=C(e=>e.sessions),P=C(e=>e.hasHydrated),de=C(e=>e.ensureDirectory),F=C(e=>e.createTab),he=C(e=>e.setActiveTab),ge=C(e=>e.closeTab),_e=C(e=>e.setTabSessionId),ve=C(e=>e.setTabLifecycle),I=C(e=>e.setConnecting),ye=C(e=>e.appendToBuffer),L=C(e=>e.setTabPreviewUrl),R=C(e=>e.clearBuffer),z=c(e=>e.openContextPreview),B=E.useMemo(()=>{if(M)return N.get(M)},[N,M]),V=E.useMemo(()=>B?k?B.activeTabId??B.tabs[0]?.id??null:B.tabs[0]?.id??null:null,[B,k]),H=E.useMemo(()=>{if(B)return V?B.tabs.find(e=>e.id===V)??B.tabs[0]:B.tabs[0]},[B,V]),be=E.useMemo(()=>(B?.tabs??[]).map(t=>({icon:(()=>{let e=t.iconKey?T[t.iconKey]??`terminal`:`terminal`;return(0,D.jsx)(b,{name:e,className:`h-4 w-4`})})(),id:t.id,label:t.label,title:t.label,closeLabel:e(`terminalView.tabs.closeTabTitle`)})),[B?.tabs,e]),U=H?.terminalSessionId??null,xe=H?.lifecycle??`idle`,Se=H?.bufferChunks??[],Ce=H?.isConnecting??!1,W=H?.previewUrl??null,[G,K]=E.useState(null),[we,q]=E.useState(!1),[Te,J]=E.useState(!1),[Y,X]=E.useState(null),[Ee,De]=E.useState(!1),[Oe,ke]=E.useState(0),Ae=E.useRef(null),je=E.useRef(null),Me=E.useRef(V),Ne=E.useRef(U),Pe=E.useRef(M),Fe=E.useRef(null),Ie=E.useRef(null),Le=E.useRef(!1),Re=E.useRef(!1),ze=E.useRef(null),Be=E.useRef(null),Ve=E.useRef(new Set),He=E.useRef(!1),Ue=E.useRef(``),We=E.useRef(new Set),Ge=E.useRef(0),Ke=E.useCallback(()=>{Ue.current=``,We.current.clear(),Ge.current+=1},[]),qe=E.useCallback(()=>{O||typeof document<`u`&&!document.hasFocus()||Fe.current?.focus()},[O]),Je=E.useCallback(()=>{O||Fe.current?.focus()},[O]);E.useEffect(()=>{if(!P||He.current)return;He.current=!0;let e=new Set;for(let[,t]of C.getState().sessions.entries())for(let n of t.tabs)n.terminalSessionId&&e.add(n.terminalSessionId);Ve.current=e},[P]);let Ye=c(e=>e.activeMainTab),Xe=c(e=>e.isBottomTerminalOpen),Ze=c(e=>e.setBottomTerminalOpen),Qe=c(e=>e.setBottomTerminalExpanded),$e=Ye===`terminal`,Z=$e||Xe,[et,tt]=E.useState(Z);E.useEffect(()=>{!Z||r.platform===`vscode`||u()},[Z,r.platform]),E.useEffect(()=>{Z&&tt(!0)},[Z]),E.useEffect(()=>{Re.current=Z},[Z]),E.useEffect(()=>{Ne.current=U},[U]),E.useEffect(()=>{Me.current=V,Ke()},[V,Ke]),E.useEffect(()=>{Pe.current=M},[M]),E.useEffect(()=>{!A&&Y!==null&&X(null)},[A,Y,X]),E.useEffect(()=>{!U&&Y!==null&&X(null)},[U,Y,X]);let Q=E.useCallback(()=>{Ae.current?.(),Ae.current=null,je.current=null,ze.current=null,J(!1)},[]);E.useEffect(()=>()=>{Q(),Ne.current=null},[Q]);let nt=E.useCallback((e,t,n)=>{if(!n)return;let r=`${Ue.current}${n}`.replace(/\r\n|\r/g,`
|
|
3
|
-
`),i=r.split(`
|
|
4
|
-
`),a=r.endsWith(`
|
|
5
|
-
`)?i.join(`
|
|
6
|
-
`):i.slice(0,-1).join(`
|
|
7
|
-
`);if(Ue.current=r.endsWith(`
|
|
8
|
-
`)?``:(i[i.length-1]??``).slice(-1024),!a)return;let o=le(a);if(!o||We.current.has(o))return;let s=Ge.current;We.current.add(o),ue(o).then(n=>{if(We.current.delete(o),!n||Ge.current!==s)return;let r=C.getState().getDirectoryState(e)?.tabs.find(e=>e.id===t);!r||r.previewUrlLocked||r.previewUrl===o||L(e,t,o,{locked:!1,autoOpened:!1})})},[L]),rt=E.useCallback((n,r,i,a=fe,o=!1)=>{if(je.current===i)return;Q(),je.current=i;let s=t.connect(i,{onEvent:a=>{if(je.current===i)switch(a.type){case`connected`:ze.current=i,I(n,r,!1),K(null),q(!1),J(!1),qe(),Be.current===i&&(Be.current=null,t.sendInput(i,`\r`).catch(()=>{}));break;case`reconnecting`:K(null),q(!1),J(!0);break;case`data`:a.data&&(ye(n,r,a.data),nt(n,r,a.data));break;case`exit`:{let t=typeof a.exitCode==`number`?a.exitCode:null,i=typeof a.signal==`number`?a.signal:null,o=!!(C.getState().getDirectoryState(n)?.tabs.find(e=>e.id===r))?.label?.startsWith(`Action:`);ye(n,r,e(`terminalView.stream.processExitedMessage`,{exitCodeSegment:t===null?``:e(`terminalView.stream.processExitedWithCode`,{exitCode:t}),signalSegment:i===null?``:e(`terminalView.stream.processExitedWithSignal`,{signal:i})})),ve(n,r,`exited`),_e(n,r,null),I(n,r,!1),K(o?null:e(`terminalView.error.sessionEnded`)),q(!1),J(!1),Q();break}}},onError:(t,a)=>{if(je.current===i){if(!a){K(null),q(!1);return}if(/session not found/i.test(t.message)||o){J(!1),K(null),q(!1),I(n,r,!0),R(n,r),ve(n,r,`idle`),_e(n,r,null),Q();return}J(!1),K(e(`terminalView.error.connectionFailed`,{message:t.message})),q(!0),I(n,r,!1),R(n,r),ve(n,r,`exited`),_e(n,r,null),Q()}}},a);Ae.current=()=>{s.close(),je.current=null}},[ye,R,Q,qe,nt,I,ve,_e,e,t]);E.useEffect(()=>{let n=!1;if(!(!P||!et)){if(!M){K(e(ce?`terminalView.empty.noWorkingDirectory`:`terminalView.empty.selectSession`));return}return(async()=>{let r=M;if(!Pe.current||Pe.current!==r)return;de(r);let i=C.getState().getDirectoryState(r);if(!i||i.tabs.length===0)return;let a=k?i.activeTabId??i.tabs[0]?.id??null:i.tabs[0]?.id??null;if(!a)return;let o=i.tabs.find(e=>e.id===a)??i.tabs[0],s=o?.terminalSessionId??null,c=o?.lifecycle??`idle`,l=!!o?.label?.startsWith(`Action:`),u=(o?.bufferLength??0)>0||(o?.bufferChunks?.length??0)>0;if(s)return;if(c===`exited`){I(r,a,!1);return}if(l&&u){I(r,a,!1);return}let d=Ie.current;if(!(!d&&Re.current)){K(null),q(!1),J(!1),I(r,a,!0);try{let e=await t.createSession({cwd:r,cols:d?.cols,rows:d?.rows});if(!(!n&&Pe.current===r&&Me.current===a)){try{await t.close(e.sessionId)}catch{}return}if(C.getState().getDirectoryState(r)?.tabs.find(e=>e.id===a)?.terminalSessionId){try{await t.close(e.sessionId)}catch{}return}_e(r,a,e.sessionId)}catch(t){n||(K(t instanceof Error?t.message:e(`terminalView.error.startSessionFailed`)),q(!0),J(!1),I(r,a,!1))}}})(),()=>{n=!0}}},[ce,M,U,xe,V,et,Oe,k,P,de,I,_e,e,t]);let it=E.useRef(rt);it.current=rt;let at=E.useRef(Q);at.current=Q,E.useEffect(()=>{if(!P||!et)return;if(!M){at.current();return}let e=M,t=C.getState().getDirectoryState(e);if(!t||t.tabs.length===0){at.current();return}let n=k?t.activeTabId??t.tabs[0]?.id??null:t.tabs[0]?.id??null;if(!n){at.current();return}let r=t.tabs.find(e=>e.id===n)??t.tabs[0],i=r?.terminalSessionId??null;if(!i){at.current(),Ne.current=null;return}if(je.current===i&&Ae.current){Ne.current=i;return}Ne.current=i;let a=Ve.current.has(i),o=a&&(r?.bufferLength??0)===0&&(r?.bufferChunks?.length??0)===0;a&&Ve.current.delete(i),o&&(Be.current=i),it.current(e,n,i,a?pe:fe,a)},[M,U,V,k,et,P]),E.useEffect(()=>{if(!Z||O)return;if(typeof window>`u`){qe();return}let e=window.requestAnimationFrame(()=>{qe()});return()=>{window.cancelAnimationFrame(e)}},[V,qe,Z,O]);let ot=E.useCallback(async()=>{if(!M||Ee)return;let t=C.getState().getDirectoryState(M),n=k?V??t?.activeTabId??t?.tabs[0]?.id??null:t?.tabs[0]?.id??null;if(n){De(!0),K(null),q(!1),J(!1),Q(),R(M,n),Ke();try{await ge(M,n)}catch(t){K(t instanceof Error?t.message:e(`terminalView.error.restartFailed`)),q(!0),J(!1)}finally{De(!1)}}},[V,R,ge,Q,M,k,Ee,Ke,e]),st=E.useCallback(async()=>{await ot()},[ot]),ct=E.useCallback(()=>{if(!M)return;let e=F(M);he(M,e),K(null),q(!1),J(!1),Q()},[F,Q,M,he]),lt=E.useCallback(e=>{M&&(he(M,e),K(null),q(!1),J(!1),Q())},[Q,M,he]),ut=E.useCallback(e=>{M&&(e===V&&Q(),K(null),q(!1),J(!1),ge(M,e))},[V,ge,Q,M]),dt=E.useCallback(n=>{if(!n||Te)return;let r=n,i=!1;if(Y&&n.length>0){let e=n[0];if(e.length===1&&/[a-zA-Z]/.test(e)){let t=e.toUpperCase();(Y===`ctrl`||Y===`cmd`)&&(r=String.fromCharCode(t.charCodeAt(0)&31),i=!0)}i||=!0}let a=Ne.current;!a||ze.current!==a||(t.sendInput(a,r).catch(t=>{Te||K(t instanceof Error?t.message:e(`terminalView.error.sendInputFailed`))}),i&&(X(null),Je()))},[Y,Je,Te,X,e,t]),ft=E.useCallback((e,n)=>{let r=Ie.current;if((!r||r.cols!==e||r.rows!==n)&&(Ie.current={cols:e,rows:n}),Le.current||(Le.current=!0,ke(e=>e+1)),!Re.current)return;let i=Ne.current;!i||ze.current!==i||t.resize({sessionId:i,cols:e,rows:n}).catch(()=>{})},[t]),pt=E.useCallback(e=>{X(t=>t===e?null:e),Je()},[Je,X]),mt=E.useCallback(e=>{let t=me(e,Y);t&&(dt(t),X(null),Je())},[Y,Je,dt,X]);E.useEffect(()=>{if(!A||!Y||!U)return;let e=e=>{if(e.repeat)return;let t=e.key;if(!t||t===`Control`||t===`Meta`||t===`Alt`||t===`Shift`)return;let n=t.length===1?t.toLowerCase():t,r=e.code??``,i=r.startsWith(`Key`)&&r.length===4?r.slice(3).toUpperCase():null,a=t.length===1&&/[a-zA-Z]/.test(t)?t.toUpperCase():i,o={Tab:`tab`,Enter:`enter`,ArrowUp:`arrow-up`,ArrowDown:`arrow-down`,ArrowLeft:`arrow-left`,ArrowRight:`arrow-right`,Escape:`esc`,tab:`tab`,enter:`enter`,arrowup:`arrow-up`,arrowdown:`arrow-down`,arrowleft:`arrow-left`,arrowright:`arrow-right`,escape:`esc`};if(n in o){e.preventDefault(),e.stopPropagation(),mt(o[n]);return}if(Y===`ctrl`&&a&&a.length===1&&a>=`A`&&a<=`Z`){let t=String.fromCharCode(a.charCodeAt(0)&31);e.preventDefault(),e.stopPropagation(),dt(t),X(null),Je()}};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[Y,mt,dt,Je,A,X,U]);let ht=E.useMemo(()=>{let e=o[s].stack;if(typeof window>`u`)return(o[a]??o[`system-mono`]).stack;let t=window.getComputedStyle(document.documentElement).getPropertyValue(`--font-family-mono`);return t&&t.trim().length>0?t.trim():(o[a]??o[`system-mono`]).stack??e},[a]),gt=E.useMemo(()=>ne(i),[i]),_t=E.useMemo(()=>`${M??`no-dir`}::${V??`no-tab`}`,[M,V]);if(E.useEffect(()=>{if(!Z||O)return;let e=Fe.current;if(!e)return;let t=()=>{e.fit()};if(typeof window<`u`){let e=window.requestAnimationFrame(()=>{t(),qe()}),n=[220,400].map(e=>window.setTimeout(t,e));return()=>{window.cancelAnimationFrame(e),n.forEach(e=>window.clearTimeout(e))}}t()},[qe,Z,O,_t,U]),E.useEffect(()=>{if(O||!Z||!Xe)return;let e=Fe.current;if(!e)return;let t=()=>{e.fit()};if(typeof window<`u`){let e=window.requestAnimationFrame(()=>{t()}),n=[0,80,180,320].map(e=>window.setTimeout(t,e));return()=>{window.cancelAnimationFrame(e),n.forEach(e=>window.clearTimeout(e))}}t()},[f,p,Xe,Z,O]),!ce)return(0,D.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground`,children:e(`terminalView.empty.selectSession`)});if(!M)return(0,D.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 p-4 text-center text-sm text-muted-foreground`,children:[(0,D.jsx)(`p`,{children:e(`terminalView.empty.noWorkingDirectoryForSession`)}),(0,D.jsx)(_,{onClick:ot,size:`sm`,children:e(`terminalView.actions.retry`)})]});let $=!U||Ce||Ee||Te,vt=et,yt=!ie&&Xe&&!$e,bt=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 px-2 text-xs`,onClick:()=>mt(`esc`),disabled:$,children:e(`terminalView.quickKeys.escape`)}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`tab`),disabled:$,children:[(0,D.jsx)(b,{name:`arrow-right`,className:`h-4 w-4`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.tabAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`chip`,"aria-pressed":Y===`ctrl`,className:`h-6 w-9 p-0`,onClick:()=>pt(`ctrl`),disabled:$,children:[(0,D.jsx)(`span`,{className:`text-xs font-medium`,children:e(`terminalView.quickKeys.controlLabel`)}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.controlModifierAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`chip`,"aria-pressed":Y===`cmd`,className:`h-6 w-9 p-0`,onClick:()=>pt(`cmd`),disabled:$,children:[(0,D.jsx)(b,{name:`command`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.commandModifierAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`arrow-up`),disabled:$,children:[(0,D.jsx)(b,{name:`arrow-up`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.arrowUpAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`arrow-left`),disabled:$,children:[(0,D.jsx)(b,{name:`arrow-left`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.arrowLeftAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`arrow-down`),disabled:$,children:[(0,D.jsx)(b,{name:`arrow-down`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.arrowDownAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`arrow-right`),disabled:$,children:[(0,D.jsx)(b,{name:`arrow-right`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.arrowRightAria`)})]}),(0,D.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 w-9 p-0`,onClick:()=>mt(`enter`),disabled:$,children:[(0,D.jsx)(b,{name:`arrow-go-back`}),(0,D.jsx)(`span`,{className:`sr-only`,children:e(`terminalView.quickKeys.enterAria`)})]})]});return(0,D.jsxs)(`div`,{"data-terminal-view":`true`,className:`flex h-full flex-col overflow-hidden bg-[var(--surface-background)]`,children:[(0,D.jsxs)(`div`,{className:g(`app-region-no-drag sticky top-0 z-20 shrink-0 bg-[var(--surface-background)] text-xs`,ie?`px-3 py-1.5`:`pl-3 pr-1.5 py-1`),children:[k&&B?(0,D.jsxs)(`div`,{className:`flex items-center gap-2 pl-1 pr-1`,children:[(0,D.jsx)(`div`,{className:g(`min-w-0 flex-1`,ie?`h-8`:`h-7`),children:(0,D.jsx)(S,{items:be,activeId:V,onSelect:lt,onClose:ut,layoutMode:`scrollable`,variant:`default`,className:`h-full bg-transparent`})}),(0,D.jsx)(_,{type:`button`,size:`xs`,variant:`ghost`,className:g(`shrink-0`,ie?`h-8 w-8 p-0`:`h-7 w-7 p-0`),onClick:ct,title:e(`terminalView.tabs.newTabTitle`),children:(0,D.jsx)(b,{name:`add`,className:`${ie?`h-[18px] w-[18px]`:`h-4 w-4`}`})}),(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 overflow-visible`,children:[W?(0,D.jsxs)(_,{type:`button`,size:`xs`,variant:`outline`,className:`h-6 shrink-0 gap-1 px-2`,onClick:()=>{M&&z(M,W)},title:e(`terminalView.preview.openTitle`),children:[(0,D.jsx)(b,{name:`global`,className:`h-3.5 w-3.5 shrink-0`}),(0,D.jsx)(`span`,{className:`whitespace-nowrap`,children:e(`terminalView.preview.open`)})]}):null,yt?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>Qe(!p),className:g(`shrink-0 p-0`,m?`h-8 w-8`:`h-7 w-7`),title:e(p?`terminalView.bottomDock.restoreTitle`:`terminalView.bottomDock.expandTitle`),"aria-label":e(p?`terminalView.bottomDock.restoreAria`:`terminalView.bottomDock.expandAria`),children:p?(0,D.jsx)(b,{name:`fullscreen-exit`,className:`h-4 w-4`}):(0,D.jsx)(b,{name:`fullscreen`,className:`h-4 w-4`})}),(0,D.jsx)(_,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>Ze(!1),className:g(`shrink-0 p-0`,m?`h-8 w-8`:`h-7 w-7`),title:e(`terminalView.bottomDock.closeTitle`),"aria-label":e(`terminalView.bottomDock.closeAria`),children:(0,D.jsx)(b,{name:`close`,className:`h-4 w-4`})})]}):null]})]}):null,!m&&A&&k&&B?(0,D.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1 pl-1 pr-1`,children:bt}):null,A&&(m||!k||!B)?(0,D.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1`,children:bt}):null]}),(0,D.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,style:{backgroundColor:gt.background},children:[(0,D.jsx)(`div`,{className:`h-full w-full box-border pl-4 pr-1.5 pt-3 pb-4`,children:vt?(0,D.jsx)(oe,{ref:e=>{Fe.current=e},sessionKey:_t,chunks:Se,onInput:dt,onResize:ft,theme:gt,fontFamily:ht,fontSize:d,enableTouchScroll:O,autoFocus:!O&&Z,isVisible:Z},_t):null}),!Te&&G&&(0,D.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 bg-[var(--status-error-background)] px-3 py-2 text-xs text-[var(--status-error-foreground)] flex items-center justify-between gap-2`,children:[(0,D.jsx)(`span`,{children:G}),we&&m&&(0,D.jsx)(_,{size:`sm`,variant:`secondary`,className:`h-6 px-2 py-0 text-xs`,onClick:st,disabled:Ee,title:e(`terminalView.actions.hardRestartTitle`),type:`button`,children:e(`terminalView.actions.hardRestart`)})]})]})]})};export{he as TerminalView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,i as n,n as r}from"./runtime-switch-DEZ1K7qW.js";import{n as i}from"./runtime-fetch-D0YWp3FJ.js";import{ot as a,st as o}from"./vendor-base-ui-CzHs0bHY.js";import{At as s,bt as c}from"./gitApiHttp-CKrsk1tw.js";import{r as l}from"./useUIStore-B61bCFEM.js";import{n as u}from"./vendor-react-DlzBev0S.js";import{l as d,n as f,o as p,s as m}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{r as h}from"./vendor-sonner-BEHGipm5.js";import{a as g,i as _,n as v}from"./vendor-reactuses-core-DWo5Wn6R.js";import{d as y,f as b,p as x,r as S,t as C}from"./button-CPRnAdlm.js";import{Ei as w,Sa as T,Wi as E,ei as D}from"./useMobileNavigationStore-D59MROJU.js";import{n as O}from"./Icon-BNzwtZlI.js";import{a as k,i as A,n as j,o as M,r as N,t as ee}from"./dialog-Dq8l3IQC.js";import{t as P}from"./input-9A1m0Yjq.js";import{i as F,n as te,t as I}from"./tooltip-C25g1ojI.js";import{r as L}from"./device-w1ioiqv3.js";import{c as R,d as z,i as B,l as V,n as H,s as U,t as W}from"./select-BNDVM5KL.js";import{n as ne,t as re}from"./useDictation-ozXiBIfG.js";import{a as ie}from"./url-MRa-FtQa.js";import{n as ae,t as G}from"./textarea-Ds63PD7U.js";import{a as oe,i as se,o as ce,r as K,t as q}from"./speechSettingsQueries-sb0ZHAri.js";import{f as le,g as ue,h as de,m as fe,p as J}from"./usePluginsStore-3VJgeLvf.js";var pe=u(),Y=e(o(),1),X=a(),me=Y.memo(function(e){let t=(0,pe.c)(24),{checked:n,onChange:r,disabled:i,ariaLabel:a,className:o,iconClassName:s}=e,c=i!==void 0&&i,l;t[0]!==n||t[1]!==c||t[2]!==r?(l=e=>{e.preventDefault(),e.stopPropagation(),!c&&!n&&r()},t[0]=n,t[1]=c,t[2]=r,t[3]=l):l=t[3];let u=l,d;t[4]!==n||t[5]!==c||t[6]!==r?(d=e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),!c&&!n&&r())},t[4]=n,t[5]=c,t[6]=r,t[7]=d):d=t[7];let f=d,p=n?`bg-[color-mix(in_srgb,var(--primary-base)_80%,transparent)] shadow-none hover:bg-[var(--primary-base)]`:`bg-[var(--surface-muted)] shadow-[inset_0_0_0_1px_var(--interactive-border)] hover:bg-[var(--interactive-hover)]`,m;t[8]!==o||t[9]!==p?(m=S(`group/radio relative flex h-[14px] w-[14px] min-h-[14px] min-w-[14px] shrink-0 self-center items-center justify-center rounded-full outline-none`,`transition-[background-color,box-shadow] duration-200 ease-out`,p,`focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] focus-visible:ring-offset-1 focus-visible:ring-offset-background`,`disabled:cursor-not-allowed disabled:opacity-50`,o),t[8]=o,t[9]=p,t[10]=m):m=t[10];let h=!n&&`opacity-0`,g;t[11]!==s||t[12]!==h?(g=S(`block h-[5px] w-[5px] rounded-full bg-white`,h,s),t[11]=s,t[12]=h,t[13]=g):g=t[13];let _;t[14]===g?_=t[15]:(_=(0,X.jsx)(`span`,{"aria-hidden":!0,className:g}),t[14]=g,t[15]=_);let v;return t[16]!==a||t[17]!==n||t[18]!==c||t[19]!==u||t[20]!==f||t[21]!==m||t[22]!==_?(v=(0,X.jsx)(`button`,{type:`button`,role:`radio`,onClick:u,onKeyDown:f,disabled:c,"aria-checked":n,"aria-label":a,className:m,children:_}),t[16]=a,t[17]=n,t[18]=c,t[19]=u,t[20]=f,t[21]=m,t[22]=_,t[23]=v):v=t[23],v}),he=e=>(e.replace(/^@/,``).match(/[A-Za-z0-9]/)?.[0]??`?`).toUpperCase(),Z=e=>{let t=(0,pe.c)(26),{name:n,src:r,fallback:i,size:a,className:o,busy:s,marker:c}=e,l=a===void 0?20:a,u=s!==void 0&&s,[d,f]=Y.useState(null),p=!!r&&d!==r,m;t[0]===r?m=t[1]:(m=r&&(/^data:image\/svg\+xml[;,]/i.test(r)||/^https:\/\/[^?#]+\.svg(?:[?#]|$)/i.test(r)),t[0]=r,t[1]=m);let h=!!m,g;t[2]===l?g=t[3]:(g=Math.round(l*.3),t[2]=l,t[3]=g);let _;t[4]!==l||t[5]!==g?(_={width:l,height:l,minWidth:l,flexShrink:0,borderRadius:g},t[4]=l,t[5]=g,t[6]=_):_=t[6];let v=_,y;t[7]!==v||t[8]!==i||t[9]!==n||t[10]!==p||t[11]!==l||t[12]!==r||t[13]!==h?(y=p?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`img`,{src:r,alt:``,draggable:!1,referrerPolicy:`no-referrer`,loading:`lazy`,crossOrigin:h?`anonymous`:void 0,style:{...v,opacity:h?0:void 0},className:`object-contain`,onError:()=>f(r??null)},r),h?(0,X.jsx)(`span`,{"data-plugin-icon-mask":!0,"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{...v,backgroundColor:`currentColor`,maskImage:`url(${JSON.stringify(r)})`,WebkitMaskImage:`url(${JSON.stringify(r)})`,maskMode:`alpha`,maskSize:`contain`,WebkitMaskSize:`contain`,maskPosition:`center`,WebkitMaskPosition:`center`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`}}):null]}):i?(0,X.jsx)(`span`,{className:`yuri-plugin-icon-placeholder`,style:{...v,display:`grid`,placeItems:`center`,color:`var(--surface-muted-foreground)`},"aria-hidden":!0,children:(0,X.jsx)(O,{name:i,style:{width:l*.65,height:l*.65}})}):(0,X.jsx)(`span`,{className:`yuri-plugin-icon-placeholder`,style:{...v,display:`grid`,placeItems:`center`,color:`var(--surface-muted-foreground)`,fontFamily:`var(--font-mono, ui-monospace, monospace)`,fontSize:Math.round(l*.5),fontWeight:500,lineHeight:1},"aria-hidden":!0,children:he(n)}),t[7]=v,t[8]=i,t[9]=n,t[10]=p,t[11]=l,t[12]=r,t[13]=h,t[14]=y):y=t[14];let b=y,x;t[15]===o?x=t[16]:(x=S(`relative inline-flex shrink-0 align-middle`,o),t[15]=o,t[16]=x);let C=u||void 0,w;t[17]!==u||t[18]!==c?(w=u||c?(0,X.jsx)(`span`,{className:`absolute -bottom-[3px] -right-[3px] inline-flex rounded-full bg-[var(--surface-background)] p-[1.5px]`,"aria-hidden":!0,children:u?(0,X.jsx)(O,{name:`loader-4`,className:`size-2.5 animate-spin text-[var(--status-info)]`}):c}):null,t[17]=u,t[18]=c,t[19]=w):w=t[19];let T;return t[20]!==v||t[21]!==b||t[22]!==x||t[23]!==C||t[24]!==w?(T=(0,X.jsxs)(`span`,{className:x,style:v,"data-plugin-icon":!0,"data-plugin-busy":C,children:[b,w]}),t[20]=v,t[21]=b,t[22]=x,t[23]=C,t[24]=w,t[25]=T):T=t[25],T};function ge(e,t=!0){if(!t)return{name:e,version:null};let n=e.lastIndexOf(`@`);return n>0?{name:e.slice(0,n),version:e.slice(n+1)||null}:{name:e,version:null}}function _e(e,t,n){return Math.min(n,Math.max(t,e))}function ve(e){if(!Number.isFinite(e))return 0;let t=String(e);if(t.includes(`e-`)){let[,e]=t.split(`e-`);return Number(e)||0}let n=t.split(`.`);return n.length===2?n[1].length:0}function ye(e,t){let n=ve(t);return n<=0?e:Number(e.toFixed(n))}var be=Y.forwardRef(({value:e,onValueChange:t,min:n=-1/0,max:r=1/0,step:i=1,className:a,containerClassName:o,onBlur:s,disabled:c,fallbackValue:l,onClear:u,emptyLabel:d=`—`,...f},p)=>{let{t:m}=b(),[h,g]=Y.useState(()=>e===void 0?``:String(e)),{isMobile:_}=L(),v=Y.useRef(!1),y=Y.useRef(null),x=Y.useCallback(()=>{if(typeof document>`u`||typeof window>`u`)return;y.current?.();let e=e=>{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation?.(),y.current?.()},t=window.setTimeout(()=>{y.current?.()},700);y.current=()=>{window.clearTimeout(t),document.removeEventListener(`click`,e,!0),y.current=null},document.addEventListener(`click`,e,!0)},[]);Y.useEffect(()=>()=>{y.current?.()},[]),Y.useEffect(()=>{g(e===void 0?``:String(e))},[e]);let C=Y.useMemo(()=>e===void 0?l===void 0?Number.isFinite(n)?n:0:l:e,[l,n,e]),w=Y.useRef(C);Y.useEffect(()=>{w.current=C},[C]);let T=Y.useCallback(e=>{let a=ye(_e(e,n,r),i);w.current=a,t(a)},[r,n,t,i]),E=Y.useCallback(e=>{let t=e.target.value;if(g(t),t.trim()===``){u?.();return}let n=Number(t);Number.isFinite(n)&&T(n)},[T,u]),D=Y.useCallback(t=>{if(h.trim()===``){u||g(e===void 0?``:String(e)),s?.(t);return}let a=Number(h);if(!Number.isFinite(a))g(e===void 0?``:String(e));else{let t=ye(_e(a,n,r),i);t===e?w.current=t:T(a),g(String(t))}s?.(t)},[T,h,r,n,s,u,i,e]),k=!!(c||C>=r),A=!!(c||C<=n),j=()=>{A||T(w.current-i)},M=()=>{k||T(w.current+i)},N=e=>t=>{t.preventDefault(),t.stopPropagation(),v.current=!0,x(),e()},ee=e=>t=>{if(v.current){v.current=!1,t.preventDefault(),t.stopPropagation();return}e()};return _?(0,X.jsxs)(`div`,{"data-slot":`number-input`,className:S(`flex h-9 shrink-0 items-stretch overflow-x-hidden overflow-y-hidden rounded-lg border border-border bg-transparent select-none overscroll-contain`,`[-webkit-user-select:none] [-webkit-touch-callout:none]`,`disabled:pointer-events-none disabled:opacity-50`,o),children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":m(`numberInput.actions.decreaseAria`),disabled:A,onTouchStart:N(j),onClick:ee(j),className:S(`grid h-full min-h-0 w-9 place-items-center overflow-x-hidden overflow-y-hidden border-r border-border p-0 leading-none touch-none`,`text-muted-foreground`,`disabled:pointer-events-none disabled:opacity-50`,!A&&`active:bg-interactive-hover`),children:(0,X.jsx)(O,{name:`subtract`,className:`block h-4 w-4`})}),(0,X.jsx)(`div`,{"data-slot":`number-input-value`,className:S(`flex h-full min-w-0 w-14 items-center justify-center bg-transparent px-1.5`,`text-center text-[16px] leading-none text-foreground [font-variant-numeric:tabular-nums]`,a),"aria-live":`polite`,children:e===void 0?d:h}),(0,X.jsx)(`button`,{type:`button`,"aria-label":m(`numberInput.actions.increaseAria`),disabled:k,onTouchStart:N(M),onClick:ee(M),className:S(`grid h-full min-h-0 w-9 place-items-center overflow-x-hidden overflow-y-hidden border-l border-border p-0 leading-none touch-none`,`text-muted-foreground`,`disabled:pointer-events-none disabled:opacity-50`,!k&&`active:bg-interactive-hover`),children:(0,X.jsx)(O,{name:`add`,className:`block h-4 w-4`})})]}):(0,X.jsxs)(`div`,{"data-slot":`number-input`,className:S(`flex h-7 shrink-0 items-stretch overflow-x-hidden overflow-y-hidden rounded-lg border border-border bg-transparent`,`disabled:pointer-events-none disabled:opacity-50`,o),children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":m(`numberInput.actions.decreaseAria`),disabled:A,onClick:()=>T(w.current-i),className:S(`flex h-full w-7 items-center justify-center overflow-x-hidden overflow-y-hidden border-r border-border p-0 leading-none touch-manipulation`,`text-muted-foreground hover:bg-interactive-hover hover:text-foreground`,`disabled:pointer-events-none disabled:opacity-50`),children:(0,X.jsx)(O,{name:`subtract`,className:`block h-3.5 w-3.5`})}),(0,X.jsx)(`input`,{...f,"data-slot":`number-input-value`,ref:p,type:`text`,inputMode:f.inputMode??`numeric`,value:h,onChange:E,onBlur:D,disabled:c,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,className:S(`h-full min-w-0 w-14 bg-transparent px-1.5 text-center typography-ui-label leading-none text-foreground [font-variant-numeric:tabular-nums]`,`placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground`,`appearance-none outline-none [appearance:textfield] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,`disabled:pointer-events-none disabled:cursor-not-allowed`,a)}),(0,X.jsx)(`button`,{type:`button`,"aria-label":m(`numberInput.actions.increaseAria`),disabled:k,onClick:()=>T(w.current+i),className:S(`flex h-full w-7 items-center justify-center overflow-x-hidden overflow-y-hidden border-l border-border p-0 leading-none touch-manipulation`,`text-muted-foreground hover:bg-interactive-hover hover:text-foreground`,`disabled:pointer-events-none disabled:opacity-50`),children:(0,X.jsx)(O,{name:`add`,className:`block h-3.5 w-3.5`})})]})});be.displayName=`NumberInput`;var xe=(e=s.getDirectory())=>p({queryKey:[n(),r(),`provider-sources`,e??null],queryFn:async({signal:t})=>{let n=await i(`/api/config/providers/sources`,{signal:t,query:e?{directory:e}:void 0});if(!n.ok)throw Error(`Unable to read provider sources`);return await n.json()},staleTime:3e4}),Se=(e,t)=>e.flatMap((e,n)=>t(e)?[{method:e,methodIndex:n}]:[]),Ce=(e=s.getDirectory())=>p({queryKey:[n(),r(),`provider-connections`,e??null],queryFn:async({signal:t})=>{let n=s.getSdkClient(),r=e?{directory:e}:void 0,[i,a]=await Promise.all([n.provider.list({location:r},{signal:t}),n.integration.list({location:r},{signal:t})]);return{providers:i.data,integrations:a.data}}});function we(e){let t=s.getSdkClient(),n=r(),i=s.getDirectory(),a=i?{directory:i}:void 0,o=new AbortController,c,l,u,d=!1,f=!1,p=!1,m=()=>!o.signal.aborted&&n===r()&&i===s.getDirectory(),h=()=>{clearTimeout(l),clearTimeout(u)},g=()=>{c&&!f&&!p&&n===r()&&(p=!0,t.integration.oauth.cancel({integrationID:e.integrationID,attemptID:c.attemptID,location:a}).catch(()=>void 0))},_=()=>{o.abort(),h(),g()},v=t=>{m()&&(_(),e.onError(t))},y=async()=>{m()&&(f=!0,h(),await e.onSuccess())},b=async()=>{if(!(!m()||!c))try{let n=await t.integration.oauth.status({integrationID:e.integrationID,attemptID:c.attemptID,location:a},{signal:o.signal});if(!m())return;if(n.data.status===`complete`){await y();return}if(n.data.status!==`pending`){v(`complete`);return}l=setTimeout(()=>{b()},1500)}catch{v(`complete`)}};return{cancel:_,isCurrent:m,async start(n){u=setTimeout(()=>v(`start`),3e4);try{if(c=(await t.integration.oauth.connect({integrationID:e.integrationID,methodID:n,location:a},{signal:o.signal})).data,!m()){g();return}if(clearTimeout(u),!c.attemptID||![`auto`,`code`].includes(c.mode)){v(`start`);return}let r=Math.min(6e5,(c.time?.expires??Date.now()+6e5)-Date.now());if(r<=0){v(`complete`);return}u=setTimeout(()=>v(`complete`),r),e.onAttempt(c),c.mode===`auto`&&b()}catch{v(`start`)}},async complete(n){if(!(!m()||!c||c.mode!==`code`||d||!n.trim())){d=!0;try{await t.integration.oauth.complete({integrationID:e.integrationID,attemptID:c.attemptID,code:n.trim(),location:a},{signal:o.signal}),await y()}catch{v(`complete`)}}}}}var Te=`opencode`;function Ee(e){return e===`opencode-go`?Te:e}function De(e,t){let n=Ee(e);return t?.find(e=>e.id===n)}function Oe(e){return(e?.connections??[]).some(e=>e.type===`credential`&&e.method===`oauth`)}function ke(e,t){return t[Ee(e)]??t[e]??[]}function Ae(e,t){let n=Ee(e);return n===e?t[e]||e:t[n]||n}function je(e){let t=(0,pe.c)(129),{model:n,existingIds:r,isEditing:i,busy:a,saveError:o,fixedId:s,onSave:c,onClose:l}=e,u=a!==void 0&&a,d=s!==void 0&&s,{t:f}=b(),{isMobile:p}=L(),[m,h]=Y.useState(n),[g,_]=Y.useState(``),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>h(t=>({...t,...e})),t[0]=v):v=t[0];let y=v,x;t[1]!==u||t[2]!==m||t[3]!==r||t[4]!==c||t[5]!==f?(x=e=>{if(e.preventDefault(),u)return;let t=m.id.trim(),n=[m.context,m.output].filter(Boolean).map(Number);if(!t||/[\s#]/.test(t)||[`__proto__`,`constructor`,`prototype`].includes(t)||n.some(Me)||m.context&&m.output&&Number(m.output)>Number(m.context)){_(f(`settings.providers.custom.invalidModel`));return}if(r.includes(t)){_(f(`settings.providers.custom.invalidModels`));return}c({...m,id:t,name:m.name.trim()})},t[1]=u,t[2]=m,t[3]=r,t[4]=c,t[5]=f,t[6]=x):x=t[6];let S=x,w;t[7]!==u||t[8]!==l?(w=e=>{!e&&!u&&l()},t[7]=u,t[8]=l,t[9]=w):w=t[9];let T=`yuri-settings-workspace ${p?`yuri-settings-workspace-mobile`:`yuri-settings-workspace-desktop`} max-w-lg`,E=i?`settings.providers.custom.editModel`:`settings.providers.custom.addModel`,D;t[10]!==f||t[11]!==E?(D=f(E),t[10]=f,t[11]=E,t[12]=D):D=t[12];let O;t[13]===D?O=t[14]:(O=(0,X.jsx)(k,{children:(0,X.jsx)(M,{children:D})}),t[13]=D,t[14]=O);let N;t[15]===f?N=t[16]:(N=f(`settings.providers.custom.modelId`),t[15]=f,t[16]=N);let F;t[17]===f?F=t[18]:(F=f(`settings.providers.custom.modelId`),t[17]=f,t[18]=F);let te=!d,I;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>y({id:e.target.value}),t[19]=I):I=t[19];let R;t[20]!==m.id||t[21]!==d||t[22]!==F||t[23]!==te?(R=(0,X.jsx)(P,{"aria-label":F,autoFocus:te,readOnly:d,required:!0,pattern:`[^\\s#]+`,value:m.id,onChange:I}),t[20]=m.id,t[21]=d,t[22]=F,t[23]=te,t[24]=R):R=t[24];let z;t[25]!==N||t[26]!==R?(z=(0,X.jsx)(J,{label:N,children:R}),t[25]=N,t[26]=R,t[27]=z):z=t[27];let B;t[28]===f?B=t[29]:(B=f(`settings.providers.custom.modelName`),t[28]=f,t[29]=B);let V;t[30]===f?V=t[31]:(V=f(`settings.providers.custom.modelName`),t[30]=f,t[31]=V);let H;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>y({name:e.target.value}),t[32]=H):H=t[32];let U;t[33]!==m.id||t[34]!==m.name||t[35]!==V?(U=(0,X.jsx)(P,{"aria-label":V,value:m.name,placeholder:m.id,onChange:H}),t[33]=m.id,t[34]=m.name,t[35]=V,t[36]=U):U=t[36];let W;t[37]!==B||t[38]!==U?(W=(0,X.jsx)(J,{label:B,children:U}),t[37]=B,t[38]=U,t[39]=W):W=t[39];let ne;t[40]!==z||t[41]!==W?(ne=(0,X.jsxs)(le,{children:[z,W]}),t[40]=z,t[41]=W,t[42]=ne):ne=t[42];let re;t[43]===f?re=t[44]:(re=f(`settings.providers.custom.moreSettings`),t[43]=f,t[44]=re);let ie;t[45]===re?ie=t[46]:(ie=(0,X.jsx)(`summary`,{className:`cursor-pointer typography-meta text-muted-foreground marker:text-muted-foreground`,children:re}),t[45]=re,t[46]=ie);let ae;t[47]===f?ae=t[48]:(ae=f(`settings.providers.custom.context`),t[47]=f,t[48]=ae);let G;t[49]===f?G=t[50]:(G=f(`settings.providers.custom.context`),t[49]=f,t[50]=G);let oe=m.context?Number(m.context):void 0,se,ce;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>y({context:String(e)}),ce=()=>y({context:``}),t[51]=se,t[52]=ce):(se=t[51],ce=t[52]);let K;t[53]!==G||t[54]!==oe?(K=(0,X.jsx)(be,{"aria-label":G,min:1,step:1,value:oe,onValueChange:se,onClear:ce}),t[53]=G,t[54]=oe,t[55]=K):K=t[55];let q;t[56]!==ae||t[57]!==K?(q=(0,X.jsx)(J,{label:ae,children:K}),t[56]=ae,t[57]=K,t[58]=q):q=t[58];let ue;t[59]===f?ue=t[60]:(ue=f(`settings.providers.custom.output`),t[59]=f,t[60]=ue);let de;t[61]===f?de=t[62]:(de=f(`settings.providers.custom.output`),t[61]=f,t[62]=de);let me=m.output?Number(m.output):void 0,he=m.context?Number(m.context):void 0,Z,ge;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Z=e=>y({output:String(e)}),ge=()=>y({output:``}),t[63]=Z,t[64]=ge):(Z=t[63],ge=t[64]);let _e;t[65]!==de||t[66]!==me||t[67]!==he?(_e=(0,X.jsx)(be,{"aria-label":de,min:1,step:1,value:me,max:he,onValueChange:Z,onClear:ge}),t[65]=de,t[66]=me,t[67]=he,t[68]=_e):_e=t[68];let ve;t[69]!==ue||t[70]!==_e?(ve=(0,X.jsx)(J,{label:ue,children:_e}),t[69]=ue,t[70]=_e,t[71]=ve):ve=t[71];let ye;t[72]===f?ye=t[73]:(ye=f(`settings.providers.custom.tools`),t[72]=f,t[73]=ye);let xe;t[74]===f?xe=t[75]:(xe=f(`settings.providers.custom.tools`),t[74]=f,t[75]=xe);let Se;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Se=e=>y({tools:e}),t[76]=Se):Se=t[76];let Ce;t[77]!==m.tools||t[78]!==ye||t[79]!==xe?(Ce=(0,X.jsx)(fe,{label:ye,ariaLabel:xe,checked:m.tools,onChange:Se}),t[77]=m.tools,t[78]=ye,t[79]=xe,t[80]=Ce):Ce=t[80];let we;t[81]===f?we=t[82]:(we=f(`settings.providers.custom.vision`),t[81]=f,t[82]=we);let Te;t[83]===f?Te=t[84]:(Te=f(`settings.providers.custom.vision`),t[83]=f,t[84]=Te);let Ee;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=e=>y({vision:e}),t[85]=Ee):Ee=t[85];let De;t[86]!==m.vision||t[87]!==we||t[88]!==Te?(De=(0,X.jsx)(fe,{label:we,ariaLabel:Te,checked:m.vision,onChange:Ee}),t[86]=m.vision,t[87]=we,t[88]=Te,t[89]=De):De=t[89];let Oe;t[90]!==q||t[91]!==ve||t[92]!==Ce||t[93]!==De?(Oe=(0,X.jsxs)(le,{children:[q,ve,Ce,De]}),t[90]=q,t[91]=ve,t[92]=Ce,t[93]=De,t[94]=Oe):Oe=t[94];let ke;t[95]!==ie||t[96]!==Oe?(ke=(0,X.jsxs)(`details`,{className:`group yuri-settings-section-stack`,children:[ie,Oe]}),t[95]=ie,t[96]=Oe,t[97]=ke):ke=t[97];let Ae;t[98]!==g||t[99]!==o?(Ae=(g||o)&&(0,X.jsx)(`p`,{role:`alert`,className:`typography-meta text-status-error`,children:g||o}),t[98]=g,t[99]=o,t[100]=Ae):Ae=t[100];let je;t[101]===f?je=t[102]:(je=f(`settings.common.actions.cancel`),t[101]=f,t[102]=je);let Ne;t[103]!==u||t[104]!==l||t[105]!==je?(Ne=(0,X.jsx)(C,{type:`button`,disabled:u,onClick:l,children:je}),t[103]=u,t[104]=l,t[105]=je,t[106]=Ne):Ne=t[106];let Pe=u?`settings.providers.page.actions.saving`:i?`settings.common.actions.saveChanges`:`settings.providers.custom.addModel`,Fe;t[107]!==f||t[108]!==Pe?(Fe=f(Pe),t[107]=f,t[108]=Pe,t[109]=Fe):Fe=t[109];let Ie;t[110]!==u||t[111]!==Fe?(Ie=(0,X.jsx)(C,{type:`submit`,disabled:u,"aria-busy":u,children:Fe}),t[110]=u,t[111]=Fe,t[112]=Ie):Ie=t[112];let Le;t[113]!==Ne||t[114]!==Ie?(Le=(0,X.jsxs)(A,{children:[Ne,Ie]}),t[113]=Ne,t[114]=Ie,t[115]=Le):Le=t[115];let Q;t[116]!==S||t[117]!==ne||t[118]!==ke||t[119]!==Ae||t[120]!==Le?(Q=(0,X.jsxs)(`form`,{className:`yuri-settings-section-stack`,onSubmit:S,children:[ne,ke,Ae,Le]}),t[116]=S,t[117]=ne,t[118]=ke,t[119]=Ae,t[120]=Le,t[121]=Q):Q=t[121];let $;t[122]!==Q||t[123]!==T||t[124]!==O?($=(0,X.jsxs)(j,{presentation:`default`,className:T,"aria-describedby":void 0,children:[O,Q]}),t[122]=Q,t[123]=T,t[124]=O,t[125]=$):$=t[125];let Re;return t[126]!==w||t[127]!==$?(Re=(0,X.jsx)(ee,{open:!0,onOpenChange:w,children:$}),t[126]=w,t[127]=$,t[128]=Re):Re=t[128],Re}function Me(e){return!Number.isSafeInteger(e)||e<=0}function Ne({providerId:e,model:t,inputModalities:a,onClose:o}){let{t:c}=b(),l=d(),[u,f]=Y.useState(!1),[p,m]=Y.useState(``),h=Y.useRef(null),g=Y.useRef(!1);Y.useEffect(()=>{let e=new AbortController;return h.current=e,()=>e.abort()},[]);let v=_(async u=>{let d=h.current;if(g.current||!d||d.signal.aborted)return;let p=s.getDirectory(),_=r(),v=n(),y=()=>!d.signal.aborted&&r()===_&&n()===v&&s.getDirectory()===p;g.current=!0,f(!0),m(``);let b=!1;try{if(!(await i(`/api/config/providers/model`,{method:`PUT`,signal:d.signal,headers:{"Content-Type":`application/json`},body:JSON.stringify({directory:p,providerId:e,modelId:t.id,name:u.name,tools:u.tools,vision:u.vision,inputModalities:a,context:u.context?Number(u.context):null,output:u.output?Number(u.output):null})})).ok)throw Error(`save`);if(!y()||(b=!0,await E({scopes:[`providers`],mode:`active`,queryDirectory:p,transportIdentity:v}),!y()))return;l.invalidateQueries({queryKey:xe(p).queryKey,exact:!0}),o()}catch{y()&&m(c(b?`settings.providers.custom.refreshFailed`:`settings.providers.custom.saveFailed`))}finally{g.current=!1,y()&&f(!1)}});return(0,X.jsx)(je,{model:t,existingIds:[],isEditing:!0,fixedId:!0,busy:u,saveError:p,onSave:e=>void v(e),onClose:o})}function Pe(e){if(!e||typeof e!=`object`||!(`configured`in e)||typeof e.configured!=`boolean`)throw Error(`Invalid credential status`);return{configured:e.configured,...`workspaceId`in e&&typeof e.workspaceId==`string`?{workspaceId:e.workspaceId}:{}}}var Fe=e=>p({queryKey:[n(),r(),`quota-credentials`,e],queryFn:async({signal:t})=>{let n=await i(`/api/quota/credentials/${e}`,{signal:t});if(!n.ok)throw Error(`Unable to read credential status`);return Pe(await n.json())},staleTime:3e4});function Ie({providerId:e,providerName:t}){let{t:a}=b(),{isMobile:o}=L(),c=d(),l=Fe(e),u=m(l),[f,p]=Y.useState(!1),[h,g]=Y.useState({}),[v,y]=Y.useState(!1),[x,S]=Y.useState(``),[w,T]=Y.useState(!1),E=Y.useRef(null),F=Y.useRef(!1),te=`/api/quota/credentials/${e}`;Y.useEffect(()=>{let e=new AbortController;return E.current=e,()=>e.abort()},[e]);let I=_(e=>{F.current||(p(e),g(e&&u.data?.workspaceId?{workspaceId:u.data.workspaceId}:{}),S(``),T(!1))}),R=_(async e=>{if(F.current)return;let o=E.current;if(!o||o.signal.aborted)return;let u=r(),d=n(),f=s.getDirectory(),m=()=>!o.signal.aborted&&E.current===o&&r()===u&&n()===d&&s.getDirectory()===f;F.current=!0,y(!0),S(``);try{if(await c.cancelQueries({queryKey:l.queryKey,exact:!0}),!m())return;let n=await i(`${te}${e===`validate`||e===`import`?`/${e}`:``}`,{method:e===`save`?`PUT`:e===`delete`?`DELETE`:`POST`,signal:o.signal,...e===`save`?{headers:{"Content-Type":`application/json`},body:JSON.stringify(h)}:{}});if(!n.ok)throw Error(`Credential operation failed`);let r=await n.json();if(!m())return;if(e===`validate`&&(!r||typeof r!=`object`||!(`valid`in r)||r.valid!==!0))throw Error(`Invalid validation response`);e!==`validate`&&(c.setQueryData(l.queryKey,Pe(r)),g({}),T(!1),p(!1)),D.success(a(e===`validate`?`settings.providers.quota.validated`:e===`delete`?`settings.providers.quota.deleted`:`settings.providers.page.quotaCredentials.saved`,{provider:t}))}catch{m()&&S(a(`settings.providers.quota.failed`))}finally{F.current=!1,m()&&y(!1)}}),z=(e,t,n)=>(0,X.jsx)(J,{label:t,children:(0,X.jsx)(P,{"aria-label":t,required:e!==`refreshToken`,type:e===`workspaceId`?`text`:`password`,autoComplete:`off`,value:h[e]??``,disabled:v,onChange:t=>g(n=>({...n,[e]:t.target.value})),placeholder:n,className:`w-full font-mono text-xs`})},e);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(J,{itemId:`providers.${e}-credentials`,label:a(`settings.providers.quota.title`),children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[(0,X.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:a(u.isError?`settings.providers.quota.loadFailed`:u.isPending?`settings.providers.page.state.loading`:u.data.configured?`settings.providers.quota.configured`:`settings.providers.quota.optional`)}),(0,X.jsxs)(C,{variant:`ghost`,size:`xs`,disabled:u.isPending,onClick:()=>u.isError?void u.refetch():I(!0),children:[a(u.isError?`settings.providers.quota.retry`:`settings.providers.quota.manage`),(0,X.jsx)(O,{name:`arrow-right-s`,className:`size-3.5`})]})]})}),(0,X.jsx)(ee,{open:f,onOpenChange:I,children:(0,X.jsxs)(j,{className:`yuri-settings-workspace ${o?`yuri-settings-workspace-mobile`:`yuri-settings-workspace-desktop`} max-w-lg`,children:[(0,X.jsxs)(k,{children:[(0,X.jsxs)(M,{children:[t,` · `,a(`settings.providers.quota.title`)]}),(0,X.jsx)(N,{children:a(`settings.providers.quota.description`)})]}),(0,X.jsxs)(`form`,{className:`yuri-settings-section-stack`,onSubmit:e=>{e.preventDefault(),R(`save`)},children:[(0,X.jsxs)(le,{children:[e===`opencode-go`&&z(`workspaceId`,a(`settings.providers.page.openCodeGo.workspaceId`),`wrk_…`),e===`opencode-go`&&z(`authCookie`,a(`settings.providers.page.openCodeGo.authCookie`),`auth=…`),e===`ollama-cloud`&&z(`cookie`,a(`settings.providers.page.openCodeGo.authCookie`),`session=…`),e===`cursor`&&z(`accessToken`,a(`settings.providers.quota.accessToken`),``),e===`cursor`&&z(`refreshToken`,a(`settings.providers.quota.refreshToken`),``)]}),e===`opencode-go`&&(0,X.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:a(`settings.providers.page.openCodeGo.help`)}),(e===`cursor`||u.data?.configured)&&(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e===`cursor`&&(0,X.jsx)(C,{type:`button`,variant:`ghost`,size:`xs`,disabled:v,onClick:()=>void R(`import`),children:a(`settings.providers.quota.importCursor`)}),u.data?.configured&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(C,{type:`button`,variant:`ghost`,size:`xs`,disabled:v,onClick:()=>void R(`validate`),children:a(`settings.providers.page.openCodeGo.validate`)}),(0,X.jsx)(C,{type:`button`,variant:`ghost`,size:`xs`,disabled:v,onClick:()=>T(e=>!e),children:a(`settings.providers.page.openCodeGo.delete`)})]})]}),w&&(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 typography-meta`,children:[(0,X.jsx)(`span`,{children:a(`settings.providers.quota.deleteHint`)}),(0,X.jsx)(C,{type:`button`,variant:`destructive`,size:`xs`,disabled:v,onClick:()=>void R(`delete`),children:a(`settings.common.actions.delete`)})]}),x&&(0,X.jsx)(`p`,{role:`alert`,className:`typography-meta text-status-error`,children:x}),(0,X.jsxs)(A,{children:[(0,X.jsx)(C,{type:`button`,size:`sm`,disabled:v,onClick:()=>I(!1),children:a(`settings.common.actions.cancel`)}),(0,X.jsx)(C,{type:`submit`,size:`sm`,disabled:v,"aria-busy":v,children:a(v?`settings.providers.page.actions.saving`:`settings.providers.page.openCodeGo.save`)})]})]})]})})]})}function Le(e){let t=(0,pe.c)(47),{id:n,name:r,providerId:i,added:a,disabled:o,capabilities:s,detail:c,onSelect:l,onEdit:u,onToggle:d}=e,{t:f}=b(),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(O,{name:`stack`,className:`size-5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[0]=p):p=t[0];let m;t[1]!==n||t[2]!==i?(m=(0,X.jsx)(z,{modelId:n,providerId:i,className:`size-5 shrink-0`,alt:``,fallback:p}),t[1]=n,t[2]=i,t[3]=m):m=t[3];let h=o||!l,g=`${r||n} (${n})${typeof c==`string`?` · ${c}`:``}`,_=r||n,v;t[4]===_?v=t[5]:(v=(0,X.jsx)(`span`,{className:`truncate typography-ui-label text-foreground`,children:_}),t[4]=_,t[5]=v);let y;t[6]===c?y=t[7]:(y=c&&(0,X.jsx)(`span`,{className:`yuri-provider-model-detail truncate text-[10px] leading-4 text-muted-foreground`,children:c}),t[6]=c,t[7]=y);let x;t[8]!==v||t[9]!==y?(x=(0,X.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[v,y]}),t[8]=v,t[9]=y,t[10]=x):x=t[10];let S;t[11]!==l||t[12]!==h||t[13]!==g||t[14]!==x?(S=(0,X.jsx)(`button`,{type:`button`,disabled:h,onClick:l,title:g,className:`min-w-0 flex-1 rounded-sm text-left outline-none focus-visible:ring-2 focus-visible:ring-foreground/20 disabled:cursor-default`,children:x}),t[11]=l,t[12]=h,t[13]=g,t[14]=x,t[15]=S):S=t[15];let w;t[16]===s?w=t[17]:(w=s.map(Q),t[16]=s,t[17]=w);let T;t[18]===w?T=t[19]:(T=(0,X.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:w}),t[18]=w,t[19]=T);let E;t[20]!==a||t[21]!==o||t[22]!==u||t[23]!==f?(E=a&&u&&(0,X.jsx)(C,{type:`button`,variant:`ghost`,size:`icon`,disabled:o,"aria-label":f(`settings.providers.custom.editModel`),title:f(`settings.providers.custom.editModel`),onClick:u,children:(0,X.jsx)(O,{name:`settings-3`,className:`size-4`})}),t[20]=a,t[21]=o,t[22]=u,t[23]=f,t[24]=E):E=t[24];let D=a?`settings.providers.custom.removeModel`:`settings.providers.custom.addModel`,k;t[25]!==f||t[26]!==D?(k=f(D),t[25]=f,t[26]=D,t[27]=k):k=t[27];let A=a?`settings.providers.custom.removeModel`:`settings.providers.custom.addModel`,j;t[28]!==f||t[29]!==A?(j=f(A),t[28]=f,t[29]=A,t[30]=j):j=t[30];let M=a?`subtract`:`add`,N;t[31]===M?N=t[32]:(N=(0,X.jsx)(O,{name:M,className:`size-4`}),t[31]=M,t[32]=N);let ee;t[33]!==o||t[34]!==d||t[35]!==k||t[36]!==j||t[37]!==N?(ee=(0,X.jsx)(C,{type:`button`,variant:`ghost`,size:`icon`,disabled:o,"aria-label":k,title:j,onClick:d,children:N}),t[33]=o,t[34]=d,t[35]=k,t[36]=j,t[37]=N,t[38]=ee):ee=t[38];let P;return t[39]!==a||t[40]!==n||t[41]!==T||t[42]!==E||t[43]!==ee||t[44]!==m||t[45]!==S?(P=(0,X.jsxs)(`div`,{"data-provider-model":n,"data-added":a,className:`yuri-provider-model-row yuri-settings-group-row !min-h-0 !py-1.5 flex min-w-0 items-center gap-2`,children:[m,S,T,E,ee]}),t[39]=a,t[40]=n,t[41]=T,t[42]=E,t[43]=ee,t[44]=m,t[45]=S,t[46]=P):P=t[46],P}function Q(e){let{icon:t,label:n}=e;return(0,X.jsx)(`span`,{role:`img`,"aria-label":n,title:n,className:`yuri-provider-model-capability inline-flex items-center justify-center rounded-full bg-[var(--surface-muted)] px-2 py-1 text-muted-foreground`,children:(0,X.jsx)(O,{name:t,className:`size-3.5`})},t)}var $=e=>p({queryKey:[n(),r(),`custom-provider-models`,e.directory??null,e.draftId,e.revision,e.package,e.baseURL],gcTime:0,retry:!1,refetchOnWindowFocus:!1,queryFn:async({signal:t})=>{let n=await i(`/api/config/providers/custom/models`,{method:`POST`,signal:t,headers:{"Content-Type":`application/json`},body:JSON.stringify({package:e.package,baseURL:e.baseURL,apiKey:e.apiKey})});if(!n.ok)throw Error(`Provider model discovery failed`);let r=await n.json();if(!Array.isArray(r.models)||r.models.some(e=>typeof e?.id!=`string`||typeof e?.name!=`string`))throw Error(`Invalid provider model listing`);return r.models}});function Re(e){let t=(0,pe.c)(102),{input:n,enabled:r,models:i,onSelect:a,onAdd:o,onEdit:s,onRemove:c,onRemoveAll:l}=e,{t:u}=b(),d=v(n.revision,600),f=r&&d===n.revision&&!!n.baseURL,p;t[0]===n?p=t[1]:(p=$(n),t[0]=n,t[1]=p);let h;t[2]!==f||t[3]!==p?(h={...p,enabled:f},t[2]=f,t[3]=p,t[4]=h):h=t[4];let g=m(h),[_,y]=Y.useState(``),x;t[5]===i?x=t[6]:(x=new Map(i.map(Ve)),t[5]=i,t[6]=x);let S=x,w=g.data,T;t[7]===w?T=t[8]:(T=w??[],t[7]=w,t[8]=T);let E;if(t[9]!==S||t[10]!==T){let e;t[12]===S?e=t[13]:(e=e=>!S.has(e.id),t[12]=S,t[13]=e),E=T.filter(e),t[9]=S,t[10]=T,t[11]=E}else E=t[11];let D=E,k;if(t[14]!==i||t[15]!==D||t[16]!==_){let e=_.trim().toLowerCase();k=[...i.map(Be),...D.map(ze)].filter(t=>`${t.id} ${t.name}`.toLowerCase().includes(e)),t[14]=i,t[15]=D,t[16]=_,t[17]=k}else k=t[17];let A=k,j;t[18]===A?j=t[19]:(j=A.slice(0,100),t[18]=A,t[19]=j);let M=j,N;t[20]!==i.length||t[21]!==u?(N=u(`settings.providers.custom.modelsCount`,{count:i.length}),t[20]=i.length,t[21]=u,t[22]=N):N=t[22];let ee;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,X.jsx)(O,{name:`search`,className:`pointer-events-none absolute left-2 top-1/2 size-3 -translate-y-1/2 text-muted-foreground`}),t[23]=ee):ee=t[23];let F;t[24]===u?F=t[25]:(F=u(`settings.providers.page.models.filterPlaceholder`),t[24]=u,t[25]=F);let te;t[26]===u?te=t[27]:(te=u(`settings.providers.page.models.filterPlaceholder`),t[26]=u,t[27]=te);let I;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>y(e.target.value),t[28]=I):I=t[28];let L;t[29]!==_||t[30]!==F||t[31]!==te?(L=(0,X.jsxs)(`div`,{className:`relative w-28 min-w-0 sm:w-36`,children:[ee,(0,X.jsx)(P,{bordered:!0,"aria-label":F,placeholder:te,className:`!h-7 !min-h-0 !pl-7 !pr-2 !text-left !text-xs`,value:_,onChange:I})]}),t[29]=_,t[30]=F,t[31]=te,t[32]=L):L=t[32];let R=!f||g.isFetching||!D.length,z;t[33]!==w||t[34]!==a?(z=()=>a(w??[]),t[33]=w,t[34]=a,t[35]=z):z=t[35];let B;t[36]===u?B=t[37]:(B=u(`settings.providers.custom.addAllModels`),t[36]=u,t[37]=B);let V;t[38]!==R||t[39]!==z||t[40]!==B?(V=(0,X.jsx)(C,{type:`button`,size:`xs`,disabled:R,onClick:z,children:B}),t[38]=R,t[39]=z,t[40]=B,t[41]=V):V=t[41];let H=!r||!i.length,U;t[42]===u?U=t[43]:(U=u(`settings.providers.models.removeAll`),t[42]=u,t[43]=U);let W;t[44]!==l||t[45]!==H||t[46]!==U?(W=(0,X.jsx)(C,{type:`button`,size:`xs`,disabled:H,onClick:l,children:U}),t[44]=l,t[45]=H,t[46]=U,t[47]=W):W=t[47];let ne=!f||g.isFetching,re;t[48]===g?re=t[49]:(re=()=>void g.refetch(),t[48]=g,t[49]=re);let ie=g.isFetching?`size-3.5 motion-safe:animate-spin`:`size-3.5`,G;t[50]===ie?G=t[51]:(G=(0,X.jsx)(O,{name:`refresh`,className:ie}),t[50]=ie,t[51]=G);let oe;t[52]!==g.isFetching||t[53]!==u?(oe=g.isFetching?u(`settings.providers.page.state.loading`):u(`settings.providers.custom.fetchModels`),t[52]=g.isFetching,t[53]=u,t[54]=oe):oe=t[54];let se;t[55]!==ne||t[56]!==re||t[57]!==G||t[58]!==oe?(se=(0,X.jsxs)(C,{type:`button`,size:`xs`,disabled:ne,onClick:re,children:[G,oe]}),t[55]=ne,t[56]=re,t[57]=G,t[58]=oe,t[59]=se):se=t[59];let ce=!r,K;t[60]===u?K=t[61]:(K=u(`settings.providers.custom.addModel`),t[60]=u,t[61]=K);let q;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,X.jsx)(O,{name:`add`,className:`size-3.5`}),t[62]=q):q=t[62];let ue;t[63]!==o||t[64]!==ce||t[65]!==K?(ue=(0,X.jsx)(C,{type:`button`,size:`xs`,disabled:ce,"aria-label":K,onClick:o,children:q}),t[63]=o,t[64]=ce,t[65]=K,t[66]=ue):ue=t[66];let de;t[67]!==L||t[68]!==V||t[69]!==W||t[70]!==se||t[71]!==ue?(de=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1`,children:[L,V,W,se,ue]}),t[67]=L,t[68]=V,t[69]=W,t[70]=se,t[71]=ue,t[72]=de):de=t[72];let fe;t[73]!==g.isError||t[74]!==u||t[75]!==M.length?(fe=g.isError&&M.length>0&&(0,X.jsx)(`p`,{role:`alert`,className:`typography-meta text-status-error`,children:u(`settings.providers.custom.discoveryFailed`)}),t[73]=g.isError,t[74]=u,t[75]=M.length,t[76]=fe):fe=t[76];let J;t[77]!==r||t[78]!==s||t[79]!==c||t[80]!==a||t[81]!==f||t[82]!==u||t[83]!==M?(J=(0,X.jsx)(ae,{outerClassName:`max-h-96`,className:`divide-y divide-[var(--yuri-settings-row-divider)]`,children:M.map(e=>(0,X.jsx)(Le,{id:e.id,name:e.name,detail:e.name===e.id?void 0:e.id,added:!!e.configured,disabled:!r||!e.configured&&!f,capabilities:[...e.configured?.vision?[{icon:`eye`,label:u(`settings.providers.custom.vision`)}]:[],...e.configured?.tools?[{icon:`tools`,label:u(`settings.providers.custom.tools`)}]:[]],onSelect:()=>e.configured?s(e.configured):a([e.discovered]),onEdit:e.configured?()=>{e.configured&&s(e.configured)}:void 0,onToggle:()=>e.configured?c(e.configured.key):a([e.discovered])},e.id))}),t[77]=r,t[78]=s,t[79]=c,t[80]=a,t[81]=f,t[82]=u,t[83]=M,t[84]=J):J=t[84];let me;t[85]!==g.isError||t[86]!==g.isFetching||t[87]!==g.isSuccess||t[88]!==_||t[89]!==u||t[90]!==M.length?(me=!M.length&&(0,X.jsxs)(`div`,{className:`flex min-h-40 flex-col items-center justify-center gap-3 px-4 py-10 text-center text-muted-foreground`,children:[(0,X.jsx)(O,{name:g.isFetching?`refresh`:_.trim()?`search`:`stack`,"aria-hidden":`true`,className:`size-8 opacity-60${g.isFetching?` motion-safe:animate-spin`:``}`}),(0,X.jsx)(`p`,{role:g.isError&&!g.isFetching?`alert`:`status`,className:`typography-meta`,children:u(g.isFetching?`settings.providers.page.state.loading`:g.isError?`settings.providers.custom.discoveryFailed`:_.trim()?`settings.providers.page.models.noModelsMatchFilter`:g.isSuccess?`settings.providers.custom.discoveryEmpty`:`settings.providers.custom.emptyModels`)})]}),t[85]=g.isError,t[86]=g.isFetching,t[87]=g.isSuccess,t[88]=_,t[89]=u,t[90]=M.length,t[91]=me):me=t[91];let he;t[92]!==A.length||t[93]!==u?(he=A.length>100&&(0,X.jsx)(`p`,{className:`yuri-settings-group-row typography-meta text-muted-foreground`,children:u(`settings.providers.models.limit`,{count:A.length})}),t[92]=A.length,t[93]=u,t[94]=he):he=t[94];let Z;return t[95]!==de||t[96]!==fe||t[97]!==J||t[98]!==me||t[99]!==he||t[100]!==N?(Z=(0,X.jsxs)(le,{className:`[&_[data-settings-action-header]]:flex-wrap [&_[data-settings-action-header]>div:first-child]:flex-none [&_[data-settings-action-header]>div:last-child]:max-w-full`,label:N,actions:de,children:[fe,J,me,he]}),t[95]=de,t[96]=fe,t[97]=J,t[98]=me,t[99]=he,t[100]=N,t[101]=Z):Z=t[101],Z}function ze(e){return{id:e.id,name:e.name,configured:void 0,discovered:e}}function Be(e){return{id:e.id,name:e.name,configured:e,discovered:void 0}}function Ve(e){return[e.id,e]}var He=[{label:`OpenAI Chat Completions`,package:`@opencode/ai/providers/openai-compatible`,version:`v1`,path:`/chat/completions`},{label:`OpenAI Responses`,package:`@opencode/ai/providers/openai-compatible/responses`,version:`v1`,path:`/responses`},{label:`Anthropic Messages`,package:`@opencode/ai/providers/anthropic-compatible`,version:`v1`,path:`/messages`},{label:`Google Gemini`,package:`@opencode/ai/providers/google`,version:`v1beta`,path:`/models/{model}:streamGenerateContent?alt=sse`}];function Ue(e,t,n=`{model}`){let r=He.find(e=>e.package===t);if(!r||typeof e!=`string`||!e.trim()||e.includes(`\\`))return null;let i=e.trim().replace(/\/+$/,``),a=i.endsWith(`#`);a&&(i=i.slice(0,-1).replace(/\/+$/,``));try{let e=new URL(i);return![`https:`,`http:`].includes(e.protocol)||e.username||e.password||e.search||e.hash?null:(a&&!r.path.includes(`{model}`)&&i.endsWith(r.path)?i=i.slice(0,-r.path.length):!a&&!/\/v\d+(?:alpha|beta)?(?:\/|$)/i.test(e.pathname)&&(i+=`/${r.version}`),{baseURL:i,requestURL:`${i}${r.path.replace(`{model}`,n||`{model}`)}`,modelsURL:`${i}/models`,inferredVersion:!a&&!/\/v\d+(?:alpha|beta)?(?:\/|$)/i.test(e.pathname)})}catch{return null}}var We=()=>({key:crypto.randomUUID(),id:``,name:``,context:``,output:``,tools:!0,vision:!1}),Ge=e=>new Promise((t,n)=>{let r=()=>{clearTimeout(i),e.removeEventListener(`abort`,r),n(e.reason)},i=setTimeout(()=>{e.removeEventListener(`abort`,r),t()},250);e.addEventListener(`abort`,r,{once:!0}),e.aborted&&r()});function Ke({onCancel:e}){let{t}=b(),a=d(),[o]=Y.useState(()=>crypto.randomUUID()),[c,l]=Y.useState(0),[u,f]=Y.useState(``),[p,m]=Y.useState(``),[h,g]=Y.useState(``),[v,y]=Y.useState(!1),[x,S]=Y.useState(null),[T,D]=Y.useState([]),[k,A]=Y.useState(null),[j,M]=Y.useState(!1),[N,ee]=Y.useState(null),F=N!==null,[te,I]=Y.useState(``),[L,z]=Y.useState(0),V=Ue(p,He[c].package,T[0]?.id),ne=Y.useMemo(()=>({name:u.trim(),package:He[c].package,settings:{baseURL:V?.baseURL??``},models:Object.fromEntries(T.map(e=>[e.id.trim(),{...e.name.trim()?{name:e.name.trim()}:{},capabilities:{tools:e.tools,input:e.vision?[`text`,`image`]:[`text`],output:[`text`]},...e.context||e.output?{limit:{...e.context?{context:Number(e.context)}:{},...e.output?{output:Number(e.output)}:{}}}:{}}]))}),[u,c,V?.baseURL,T]),re=Y.useMemo(()=>T.filter(e=>e.key!==k?.key).map(e=>e.id),[T,k?.key]),ie=Y.useRef(null),ae=Y.useRef(!1);Y.useEffect(()=>{let e=new AbortController;return ie.current=e,()=>e.abort()},[]);let G=_(e=>{D(t=>{let n=new Set(t.map(e=>e.id)),r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push({...We(),id:t.id,name:t.name,context:t.context?String(t.context):``,output:t.output?String(t.output):``}));return r.length?[...t,...r]:t}),I(``)}),oe=_(async e=>{if(e.preventDefault(),ae.current||k)return;let o=ie.current;if(!o||o.signal.aborted)return;let c=s.getDirectory(),l=r(),u=n(),d=()=>!o.signal.aborted&&r()===l&&s.getDirectory()===c,f=N;I(``),ae.current=!0,M(!0);try{if(!f){if(!T.length){I(t(`settings.providers.custom.modelsEmpty`));return}if(new Set(T.map(e=>e.id.trim())).size!==T.length){I(t(`settings.providers.custom.invalidModels`));return}let e=await i(`/api/config/providers/custom`,{method:`POST`,signal:o.signal,headers:{"Content-Type":`application/json`},body:JSON.stringify({config:ne,...h.trim()?{apiKey:h.trim()}:{},directory:c})});if(!e.ok){let n=await e.json().catch(()=>null);if(d()&&n?.code===`PROVIDER_CLEANUP_FAILED`){I(t(`settings.providers.custom.cleanupFailed`));return}throw Error(`save`)}let n=await e.json();if(typeof n.providerId!=`string`||!n.providerId)throw Error(`save`);if(!d())return;f=n.providerId,ee(f),g(``)}for(let e=0;e<5;e++){if(await E({scopes:[`providers`],mode:`active`,queryDirectory:c,transportIdentity:u}),!d())return;if(w.getState().providers.some(e=>e.id===f))break;if(e===4)throw Error(`refresh`);if(await Ge(o.signal),!d())return}let e=Ce(c);a.invalidateQueries({queryKey:e.queryKey,exact:!0}),a.invalidateQueries({queryKey:xe(c).queryKey,exact:!0}),w.getState().setSelectedProvider(f)}catch{d()&&I(t(f?`settings.providers.custom.refreshFailed`:`settings.providers.custom.saveFailed`))}finally{ae.current=!1,d()&&M(!1)}});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`form`,{className:`yuri-settings-section-stack`,onSubmit:oe,children:[(0,X.jsx)(de,{actions:(0,X.jsxs)(X.Fragment,{children:[e&&(0,X.jsx)(C,{type:`button`,size:`sm`,disabled:j,onClick:e,children:t(`settings.common.actions.cancel`)}),(0,X.jsx)(C,{type:`submit`,size:`sm`,disabled:j,"aria-busy":j,children:t(j?`settings.providers.page.actions.saving`:F?`settings.providers.page.actions.reconnect`:`settings.common.actions.saveChanges`)})]}),children:e&&(0,X.jsxs)(C,{type:`button`,variant:`ghost`,size:`sm`,disabled:j,onClick:e,"data-settings-item":`providers.connect`,children:[(0,X.jsx)(O,{name:`arrow-left-s`,className:`size-4`}),t(`settings.providers.page.connect.selectProviderTitle`)]})}),(0,X.jsxs)(le,{label:t(`settings.providers.page.connectionDetails.title`),cardClassName:`yuri-settings-equal-controls`,children:[(0,X.jsx)(J,{label:t(`settings.providers.custom.name`),children:(0,X.jsx)(P,{"aria-label":t(`settings.providers.custom.name`),required:!0,value:u,onChange:e=>f(e.target.value),disabled:j||F})}),(0,X.jsx)(J,{label:t(`settings.providers.custom.protocol`),children:(0,X.jsxs)(W,{value:String(c),onValueChange:e=>{l(Number(e)),z(e=>e+1)},disabled:j||F,children:[(0,X.jsx)(U,{"aria-label":t(`settings.providers.custom.protocol`),children:(0,X.jsx)(R,{children:He[c].label})}),(0,X.jsx)(H,{children:He.map((e,t)=>(0,X.jsx)(B,{value:String(t),children:e.label},e.package))})]})}),(0,X.jsx)(J,{label:t(`settings.providers.custom.baseURL`),footer:V&&(0,X.jsx)(`p`,{className:`mt-1 break-all text-right typography-meta text-muted-foreground`,children:t(`settings.providers.custom.urlExact`,{url:V.requestURL})}),children:(0,X.jsx)(P,{"aria-label":t(`settings.providers.custom.baseURL`),type:`url`,required:!0,value:p,placeholder:`https://api.example.com`,onChange:e=>{m(e.target.value),z(e=>e+1)},disabled:j||F})}),(0,X.jsx)(J,{label:t(`settings.providers.page.auth.apiKeyLabel`),description:t(`settings.providers.custom.optionalKey`),children:(0,X.jsx)(P,{"aria-label":t(`settings.providers.page.auth.apiKeyLabel`),type:v?`text`:`password`,autoComplete:`off`,value:h,onChange:e=>{g(e.target.value),z(e=>e+1)},disabled:j||F,endAdornment:(0,X.jsx)(C,{type:`button`,size:`icon`,variant:`ghost`,disabled:j||F,"aria-label":t(`settings.providers.custom.toggleKey`),"aria-pressed":v,onClick:()=>y(e=>!e),children:(0,X.jsx)(O,{name:v?`eye-off`:`eye`,className:`size-4`})})})})]}),(0,X.jsx)(Re,{input:{draftId:o,revision:L,directory:s.getDirectory(),package:He[c].package,baseURL:V?.baseURL??``,apiKey:h},enabled:!j&&!F,models:T,onSelect:G,onAdd:()=>A(We()),onEdit:A,onRemoveAll:()=>{D([]),S(null)},onRemove:e=>{let t=T.findIndex(t=>t.key===e);t<0||(S({model:T[t],index:t}),D(t=>t.filter(t=>t.key!==e)))}}),x&&!T.some(e=>e.id===x.model.id)&&(0,X.jsxs)(`div`,{role:`status`,className:`flex items-center justify-between gap-2 typography-meta text-muted-foreground`,children:[(0,X.jsx)(`span`,{children:t(`settings.providers.models.removed`,{name:x.model.name||x.model.id})}),(0,X.jsx)(C,{type:`button`,variant:`ghost`,size:`xs`,disabled:j||F,onClick:()=>{D(e=>{let t=[...e];return t.splice(Math.min(x.index,t.length),0,x.model),t}),S(null)},children:t(`settings.providers.models.undo`)})]}),te&&(0,X.jsx)(`p`,{role:F?`status`:`alert`,className:`typography-meta ${F?`text-muted-foreground`:`text-status-error`}`,children:te})]}),k&&(0,X.jsx)(je,{model:k,existingIds:re,isEditing:T.some(e=>e.key===k.key),onClose:()=>A(null),onSave:e=>{D(t=>t.some(t=>t.key===e.key)?t.map(t=>t.key===e.key?e:t):[...t,e]),A(null),I(``)}},k.key)]})}function qe(e){let t=(0,pe.c)(60),{providerId:n,methods:r,apiKey:i,apiKeyEnabled:a,busyKey:o,pendingMethodIndex:s,details:c,codes:l,onKeyChange:u,onSaveKey:d,onStart:f,onCancel:p,onCodeChange:m,onComplete:h,onCopyCode:g,onOpen:_,onCopyLink:v}=e,y=a===void 0||a,{t:x}=b(),[S,w]=(0,Y.useState)(!1),[T,E]=(0,Y.useState)(r[0]?.methodIndex??`key`),D;t[0]!==r||t[1]!==T?(D=typeof T==`number`&&r.some(e=>e.methodIndex===T)?T:`key`,t[0]=r,t[1]=T,t[2]=D):D=t[2];let k=D;if(!r.length&&!y){let e;t[3]===x?e=t[4]:(e=x(`settings.providers.auth.noMethods`),t[3]=x,t[4]=e);let n;return t[5]===e?n=t[6]:(n=(0,X.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:e}),t[5]=e,t[6]=n),n}let A;t[7]!==k||t[8]!==y||t[9]!==o||t[10]!==r||t[11]!==p||t[12]!==x?(A=r.length+Number(y)>1&&(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,"aria-label":x(`settings.providers.page.auth.title`),children:[r.map((e,t)=>{let{method:n,methodIndex:r}=e;return(0,X.jsxs)(C,{variant:`chip`,size:`xs`,disabled:o?.startsWith(`api:`),"aria-pressed":k===r,onClick:()=>{k!==r&&(p(),E(r))},children:[(0,X.jsx)(O,{name:`global`,className:`size-3.5`}),n.label||n.name||x(`settings.providers.page.auth.oauthMethodFallback`,{index:String(t+1)})]},r)}),y&&(0,X.jsxs)(C,{variant:`chip`,size:`xs`,"aria-pressed":k===`key`,onClick:()=>{k!==`key`&&(p(),E(`key`))},children:[(0,X.jsx)(O,{name:`key`,className:`size-3.5`}),x(`settings.providers.page.auth.apiKeyLabel`)]})]}),t[7]=k,t[8]=y,t[9]=o,t[10]=r,t[11]=p,t[12]=x,t[13]=A):A=t[13];let j;if(t[14]!==k||t[15]!==o||t[16]!==l||t[17]!==c||t[18]!==r||t[19]!==p||t[20]!==m||t[21]!==h||t[22]!==g||t[23]!==v||t[24]!==_||t[25]!==f||t[26]!==s||t[27]!==n||t[28]!==x){let e;t[30]===k?e=t[31]:(e=e=>e.methodIndex===k,t[30]=k,t[31]=e);let i;t[32]!==o||t[33]!==l||t[34]!==c||t[35]!==p||t[36]!==m||t[37]!==h||t[38]!==g||t[39]!==v||t[40]!==_||t[41]!==f||t[42]!==s||t[43]!==n||t[44]!==x?(i=(e,t)=>{let{method:r,methodIndex:i}=e,a=`${n}:${i}`,u=c[a],d=s===i,y=o===`oauth:${n}:${i}`||o===`oauth-complete:${n}:${i}`;return(0,X.jsx)(le,{children:(0,X.jsxs)(`div`,{className:`yuri-provider-auth-panel`,children:[(0,X.jsx)(V,{providerId:n,className:`size-8`}),(0,X.jsx)(`span`,{className:`typography-ui-label text-foreground`,children:r.label||r.name||x(`settings.providers.page.auth.oauthMethodFallback`,{index:String(t+1)})}),(r.description||r.help)&&(0,X.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:r.description||r.help}),d&&(0,X.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 typography-meta text-muted-foreground`,children:[(0,X.jsx)(O,{name:`loader-4`,className:`size-4 motion-safe:animate-spin`}),x(`settings.providers.page.auth.waiting`)]}),u?.instructions&&(0,X.jsx)(`p`,{className:`max-w-full break-words typography-meta text-muted-foreground`,children:u.instructions}),u?.userCode&&(0,X.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-2`,children:[(0,X.jsx)(P,{"aria-label":x(`settings.providers.page.actions.copyCode`),value:u.userCode,readOnly:!0,className:`min-w-0 font-mono text-center tracking-widest`}),(0,X.jsx)(C,{variant:`ghost`,size:`xs`,onClick:()=>g(u.userCode),children:x(`settings.providers.page.actions.copyCode`)})]}),u?.url&&(0,X.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-center gap-2`,children:[(0,X.jsx)(P,{"aria-label":x(`settings.providers.page.actions.copy`),value:u.url,readOnly:!0,className:`w-full min-w-0 text-xs text-muted-foreground`}),(0,X.jsxs)(C,{size:`xs`,onClick:()=>_(u.url),children:[x(`settings.providers.page.actions.open`),(0,X.jsx)(O,{name:`external-link`,className:`size-3.5`})]}),(0,X.jsx)(C,{variant:`ghost`,size:`xs`,onClick:()=>v(u.url),children:x(`settings.providers.page.actions.copy`)})]}),d&&u?.mode===`code`&&(0,X.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-center gap-2`,children:[(0,X.jsx)(P,{"aria-label":x(`settings.providers.page.auth.pasteAuthorizationCodePlaceholder`),placeholder:x(`settings.providers.page.auth.pasteAuthorizationCodePlaceholder`),value:l[a]??``,onChange:e=>m(a,e.target.value),className:`font-mono text-xs`}),(0,X.jsx)(C,{size:`xs`,disabled:y||!l[a]?.trim(),onClick:()=>h(i),children:x(`settings.providers.page.actions.complete`)})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[!d&&(0,X.jsx)(C,{size:`sm`,disabled:!!o,onClick:()=>f(i),children:x(`settings.providers.page.actions.connect`)}),d&&(0,X.jsx)(C,{variant:`ghost`,size:`sm`,onClick:p,children:x(`settings.common.actions.cancel`)})]})]})},a)},t[32]=o,t[33]=l,t[34]=c,t[35]=p,t[36]=m,t[37]=h,t[38]=g,t[39]=v,t[40]=_,t[41]=f,t[42]=s,t[43]=n,t[44]=x,t[45]=i):i=t[45],j=r.filter(e).map(i),t[14]=k,t[15]=o,t[16]=l,t[17]=c,t[18]=r,t[19]=p,t[20]=m,t[21]=h,t[22]=g,t[23]=v,t[24]=_,t[25]=f,t[26]=s,t[27]=n,t[28]=x,t[29]=j}else j=t[29];let M;t[46]!==k||t[47]!==i||t[48]!==y||t[49]!==o||t[50]!==u||t[51]!==d||t[52]!==n||t[53]!==S||t[54]!==x?(M=k===`key`&&y&&(0,X.jsx)(le,{children:(0,X.jsxs)(`form`,{className:`yuri-settings-group-row flex min-w-0 flex-col gap-2`,onSubmit:e=>{e.preventDefault(),d()},children:[(0,X.jsx)(`label`,{htmlFor:`provider-key-${n}`,className:`typography-meta text-muted-foreground`,children:x(`settings.providers.page.auth.apiKeyLabel`)}),(0,X.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-2`,children:[(0,X.jsx)(P,{bordered:!0,type:S?`text`:`password`,autoComplete:`off`,"aria-label":x(`settings.providers.page.auth.apiKeyLabel`),id:`provider-key-${n}`,disabled:o?.startsWith(`api:`),value:i,onChange:e=>u(e.target.value),placeholder:x(`settings.providers.page.auth.apiKeyPlaceholder`),className:`min-w-0 flex-1 !text-left font-mono text-xs`,endAdornment:(0,X.jsx)(C,{type:`button`,variant:`ghost`,size:`icon`,disabled:o?.startsWith(`api:`),"aria-label":x(`settings.providers.custom.toggleKey`),"aria-pressed":S,onClick:()=>w(Je),children:(0,X.jsx)(O,{name:S?`eye-off`:`eye`,className:`size-4`})})}),(0,X.jsx)(C,{type:`submit`,size:`sm`,disabled:!!o||!i.trim(),children:x(o===`api:${n}`?`settings.providers.page.actions.saving`:`settings.providers.page.actions.saveKey`)})]})]})}),t[46]=k,t[47]=i,t[48]=y,t[49]=o,t[50]=u,t[51]=d,t[52]=n,t[53]=S,t[54]=x,t[55]=M):M=t[55];let N;return t[56]!==A||t[57]!==j||t[58]!==M?(N=(0,X.jsxs)(`div`,{className:`yuri-provider-auth yuri-settings-section-stack`,children:[A,j,M]}),t[56]=A,t[57]=j,t[58]=M,t[59]=N):N=t[59],N}function Je(e){return!e}function Ye(e){let t=(0,pe.c)(86),{providers:n,search:r,loading:i,error:a,onSearch:o,onSelect:s}=e,{t:c}=b(),l,u,d,f,p,m,h,g,_;if(t[0]!==o||t[1]!==s||t[2]!==n||t[3]!==r||t[4]!==c){let e;t[14]===r?e=t[15]:(e=e=>`${e.name} ${e.id}`.toLowerCase().includes(r.trim().toLowerCase()),t[14]=r,t[15]=e),u=n.filter(e);let i;t[16]===c?i=t[17]:(i=c(`settings.providers.page.connect.title`),t[16]=c,t[17]=i),t[18]===i?g=t[19]:(g=(0,X.jsx)(`h2`,{className:`typography-ui-header text-foreground`,children:i}),t[18]=i,t[19]=g);let a;t[20]===c?a=t[21]:(a=c(`settings.providers.custom.title`),t[20]=c,t[21]=a);let v;t[22]===s?v=t[23]:(v=()=>s(`__custom_provider__`),t[22]=s,t[23]=v);let y;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(O,{name:`settings-3`,className:`size-7 shrink-0 text-muted-foreground`}),t[24]=y):y=t[24];let b;t[25]===c?b=t[26]:(b=c(`settings.providers.custom.title`),t[25]=c,t[26]=b);let x;t[27]===b?x=t[28]:(x=(0,X.jsx)(`span`,{className:`block typography-ui-label text-foreground`,children:b}),t[27]=b,t[28]=x);let S;t[29]===c?S=t[30]:(S=c(`settings.providers.custom.description`),t[29]=c,t[30]=S);let C;t[31]===S?C=t[32]:(C=(0,X.jsx)(`span`,{className:`block typography-meta text-muted-foreground`,children:S}),t[31]=S,t[32]=C);let w;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsx)(`span`,{className:`block typography-micro text-muted-foreground`,children:`OpenAI · Anthropic · Gemini`}),t[33]=w):w=t[33];let T;t[34]!==x||t[35]!==C?(T=(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[x,C,w]}),t[34]=x,t[35]=C,t[36]=T):T=t[36];let E;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,X.jsx)(O,{name:`arrow-right-s`,className:`size-4 shrink-0 text-muted-foreground`}),t[37]=E):E=t[37],t[38]!==a||t[39]!==v||t[40]!==T?(_=(0,X.jsx)(le,{children:(0,X.jsxs)(`button`,{type:`button`,className:`yuri-provider-custom-choice`,"aria-label":a,onClick:v,children:[y,T,E]})}),t[38]=a,t[39]=v,t[40]=T,t[41]=_):_=t[41],l=le,t[42]===c?m=t[43]:(m=c(`settings.providers.page.connect.providerField`),t[42]=c,t[43]=m);let D;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,X.jsx)(O,{name:`search`,className:`pointer-events-none absolute left-2 top-1/2 size-3 -translate-y-1/2 text-muted-foreground`}),t[44]=D):D=t[44];let k;t[45]===c?k=t[46]:(k=c(`settings.providers.page.connect.searchProvidersPlaceholder`),t[45]=c,t[46]=k);let A;t[47]===c?A=t[48]:(A=c(`settings.providers.page.connect.searchProvidersPlaceholder`),t[47]=c,t[48]=A);let j;t[49]===o?j=t[50]:(j=e=>o(e.target.value),t[49]=o,t[50]=j),t[51]!==r||t[52]!==k||t[53]!==A||t[54]!==j?(h=(0,X.jsxs)(`div`,{className:`relative w-36 min-w-0`,children:[D,(0,X.jsx)(P,{"aria-label":k,placeholder:A,className:`!h-7 !min-h-0 !pl-7 !pr-2 !text-left !text-xs`,value:r,onChange:j})]}),t[51]=r,t[52]=k,t[53]=A,t[54]=j,t[55]=h):h=t[55],p=`yuri-provider-choices`,d=`yuri-provider-choice-grid`;let M;t[56]!==s||t[57]!==c?(M=e=>(0,X.jsxs)(`button`,{type:`button`,className:`yuri-provider-choice`,"aria-label":e.name||e.id,onClick:()=>s(e.id),children:[(0,X.jsx)(V,{providerId:e.id,className:`size-6 shrink-0`}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:`block truncate typography-ui-label`,children:e.name||e.id}),(0,X.jsx)(`span`,{className:`mt-1 block truncate typography-micro text-muted-foreground`,children:[...new Set(e.methods.map(e=>e.label||c(e.type===`oauth`?`settings.providers.auth.account`:e.type===`key`?`settings.providers.page.auth.apiKeyLabel`:e.type===`env`?`settings.providers.auth.environment`:`settings.providers.auth.managed`)))].join(` / `)||c(`settings.providers.auth.managed`)})]}),(0,X.jsx)(O,{name:`arrow-right-s`,className:`size-3.5 shrink-0 text-muted-foreground`})]},e.id),t[56]=s,t[57]=c,t[58]=M):M=t[58],f=u.map(M),t[0]=o,t[1]=s,t[2]=n,t[3]=r,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m,t[11]=h,t[12]=g,t[13]=_}else l=t[5],u=t[6],d=t[7],f=t[8],p=t[9],m=t[10],h=t[11],g=t[12],_=t[13];let v;t[59]!==d||t[60]!==f?(v=(0,X.jsx)(`div`,{className:d,children:f}),t[59]=d,t[60]=f,t[61]=v):v=t[61];let y;t[62]!==p||t[63]!==v?(y=(0,X.jsx)(`div`,{className:p,children:v}),t[62]=p,t[63]=v,t[64]=y):y=t[64];let x;t[65]!==i||t[66]!==c?(x=i&&(0,X.jsx)(`p`,{className:`yuri-settings-group-row typography-meta text-muted-foreground`,children:c(`settings.providers.page.state.loading`)}),t[65]=i,t[66]=c,t[67]=x):x=t[67];let S;t[68]!==i||t[69]!==u||t[70]!==c?(S=!i&&!u.length&&(0,X.jsx)(`p`,{className:`yuri-settings-group-row typography-meta text-muted-foreground`,children:c(`settings.providers.page.connect.noProvidersFound`)}),t[68]=i,t[69]=u,t[70]=c,t[71]=S):S=t[71];let C;t[72]!==l||t[73]!==x||t[74]!==S||t[75]!==m||t[76]!==h||t[77]!==y?(C=(0,X.jsxs)(l,{label:m,actions:h,children:[y,x,S]}),t[72]=l,t[73]=x,t[74]=S,t[75]=m,t[76]=h,t[77]=y,t[78]=C):C=t[78];let w;t[79]===a?w=t[80]:(w=a&&(0,X.jsx)(`p`,{role:`alert`,className:`typography-meta text-status-error`,children:a}),t[79]=a,t[80]=w);let T;return t[81]!==C||t[82]!==w||t[83]!==g||t[84]!==_?(T=(0,X.jsxs)(X.Fragment,{children:[g,_,C,w]}),t[81]=C,t[82]=w,t[83]=g,t[84]=_,t[85]=T):T=t[85],T}var Xe=e=>{let t=(0,pe.c)(11),{itemId:n,label:r,description:i,action:a,rows:o,children:s}=e,c=o!==void 0&&o,l;t[0]!==s||t[1]!==c?(l=c?s:(0,X.jsx)(`div`,{className:`yuri-settings-group-row`,children:s}),t[0]=s,t[1]=c,t[2]=l):l=t[2];let u;t[3]!==a||t[4]!==i||t[5]!==r||t[6]!==l?(u=(0,X.jsx)(le,{className:`yuri-settings-detail-group [&_[data-settings-action-header]]:flex-wrap [&_[data-settings-action-header]>div:first-child]:flex-none [&_[data-settings-action-header]>div:last-child]:max-w-full`,label:r,actions:a,description:i,children:l}),t[3]=a,t[4]=i,t[5]=r,t[6]=l,t[7]=u):u=t[7];let d;return t[8]!==n||t[9]!==u?(d=(0,X.jsx)(`div`,{"data-settings-item":n,children:u}),t[8]=n,t[9]=u,t[10]=d):d=t[10],d},Ze=e=>new Intl.NumberFormat(x(),{notation:`compact`,compactDisplay:`short`,maximumFractionDigits:1,minimumFractionDigits:0}).format(e),Qe=e=>{if(typeof e!=`number`||Number.isNaN(e))return null;if(e===0)return`0`;let t=Ze(e);return t.endsWith(`.0`)?t.slice(0,-2):t},$e=`__add_provider__`,et=`__custom_provider__`,tt=e=>{let t=typeof e.type==`string`?e.type:``,n=`${t} ${`${e.name??``} ${e.label??``}`.toLowerCase()}`.toLowerCase();return n.includes(`oauth`)?`oauth`:n.includes(`api`)?`api`:t.toLowerCase()},nt=(e,t,n)=>{let r=t.find(t=>t.id===e);return typeof r?.integrationID==`string`&&r.integrationID?r.integrationID:(n.some(t=>t.id===e),e)},rt=(e,t)=>{let n={},r={},i=new Map(t.filter(e=>typeof e.id==`string`&&e.id.length>0).map(e=>[e.id,e])),a=(e,t)=>{r[e]=t.id??e,n[e]=(t.methods??[]).map(e=>({type:e.type,id:e.id,name:e.label??e.name,label:e.label??e.name}))};for(let n of e){if(typeof n.id!=`string`||!n.id)continue;let r=nt(n.id,e,t),o=i.get(r);o&&a(n.id,o)}for(let e of t)typeof e.id!=`string`||!e.id||n[e.id]||a(e.id,e);return{methodsByProvider:n,integrationIdByProvider:r}},it=e=>{let n=(0,pe.c)(3),{initialConnectionId:i}=e,a=`${Y.useSyncExternalStore(t,r,r)}:${c(ot)}:${i??``}`,o;return n[0]!==i||n[1]!==a?(o=(0,X.jsx)(at,{initialConnectionId:i},a),n[0]=i,n[1]=a,n[2]=o):o=n[2],o},at=({initialConnectionId:e})=>{let{t}=b(),a=w(e=>e.providers),o=w(e=>e.selectedProviderId),c=w(e=>e.setSelectedProvider),u=w(e=>e.getModelMetadata),d=l(e=>e.hiddenModels),f=l(e=>e.toggleHiddenModel),p=l(e=>e.showAllModels),h=l(e=>e.hideAllModels),g=m(Ce()),v=m(xe()),{methodsByProvider:x,integrationIdByProvider:S}=Y.useMemo(()=>rt(g.data?.providers??[],g.data?.integrations??[]),[g.data]),T=g.isPending;Y.useEffect(()=>{g.isError&&D.error(t(`settings.providers.page.toast.authMethodsLoadFailed`))},[g.isError,t]);let[L,R]=Y.useState({}),[z,B]=Y.useState(null),[H,U]=Y.useState(``),[W,ne]=Y.useState(null),[re,G]=Y.useState(null),[oe,se]=Y.useState(!e&&o===$e),[ce,K]=Y.useState(!1),[q,le]=Y.useState(null),[ue,de]=Y.useState({}),[fe,pe]=Y.useState({}),me=g.isPending,he=g.isError?t(`settings.providers.page.state.unableToLoadProviderList`):null,[Z,ge]=Y.useState(e??et),[_e,ve]=Y.useState(``),[ye,be]=Y.useState(!1),Te=o===$e||o===et,Ee=Y.useRef(null);Y.useEffect(()=>{let e=new AbortController;return Ee.current=e,()=>e.abort()},[]);let je=_(()=>{let e=Ee.current;if(!e||e.signal.aborted)return null;let t=s.getDirectory(),i=r();return{directory:t,location:t?{directory:t}:void 0,transportIdentity:n(),signal:e.signal,isCurrent:()=>Ee.current===e&&!e.signal.aborted&&r()===i&&s.getDirectory()===t}}),Me=Y.useRef(null),Pe=_(()=>{Me.current?.cancel(),Me.current=null,le(null),pe({}),de({}),B(null)});Y.useEffect(()=>(Pe(),()=>{Me.current?.cancel(),Me.current=null}),[o,Z,Pe]),Y.useEffect(()=>{o||c($e)},[a,o,c]);let Fe=Y.useMemo(()=>(g.data?.integrations??[]).filter(e=>!e.id.startsWith(`mcp_`)&&e.connections.length===0).sort((e,t)=>{let n=(e.name||e.id).toLowerCase(),r=(t.name||t.id).toLowerCase();return n.localeCompare(r)}),[g.data]);Y.useEffect(()=>{(o===$e||o===et)&&g.isSuccess&&Z!==et&&!Fe.some(e=>e.id===Z)&&(ge(et),se(!0))},[o,Z,Fe,g.isSuccess]),Y.useEffect(()=>{if(U(``),ne(null),R({}),G(null),K(!1),o===$e||o===et){ge(e??et),se(!e&&o===$e),be(!0);return}be(!1)},[o,e]);let Q=a.find(e=>e.id===o),$=o?v.data?.[o]:void 0,Re=g.data?.integrations.find(e=>e.id===S[o]),ze=Re?.connections.some(e=>e.type===`env`)===!0,Be=!!$?.files.length||Re?.connections.some(e=>e.type===`credential`&&!!e.id)===!0,Ve=v.isPending||g.isPending,He=v.isError||g.isError,Ue=ze?t(`settings.providers.delete.environmentHint`):Be?null:t(`settings.providers.delete.runtimeHint`),We=!Ve&&!He&&!Ue,Ge=He?t(`settings.providers.page.toast.providerSourcesLoadFailed`):Ve?t(`settings.providers.page.state.loading`):Ue,Je=Oe(Re)||o===`opencode-go`&&Oe(De(`opencode-go`,g.data?.integrations))||$?.auth.type===`external`,Ze=Je?`settings.providers.auth.account`:$?.auth.type===`api`||Re?.connections.some(e=>e.type===`credential`&&e.method===`key`)?`settings.providers.page.auth.apiKeyLabel`:Re?.connections.some(e=>e.type===`env`)?`settings.providers.auth.environment`:`settings.providers.auth.managed`,nt=o===`opencode`||o===`opencode-go`?`opencode-go`:o===`ollama`||o===`ollama-cloud`?`ollama-cloud`:o===`cursor`?`cursor`:null,it=_(async e=>{let n=L[e]?.trim()??``;if(!n){D.error(t(`settings.providers.page.toast.apiKeyRequired`));return}let r=je();if(!r)return;let i=`api:${e}`;B(i);try{let i=S[e]||e;if(await s.getSdkClient().integration.connect.key({integrationID:i,key:n,location:r.location},{signal:r.signal}),!r.isCurrent()||(R(t=>({...t,[e]:``})),await E({scopes:[`providers`],mode:`active`,queryDirectory:r.directory,transportIdentity:r.transportIdentity}),!r.isCurrent()))return;let a=await g.refetch({throwOnError:!0});if(!r.isCurrent())return;v.refetch();let o=a.data?.providers.find(t=>t.id===e||t.integrationID===i);o&&c(o.id),D.success(t(`settings.providers.page.toast.apiKeySaved`))}catch{r.isCurrent()&&D.error(t(`settings.providers.page.toast.apiKeySaveFailed`))}finally{r.isCurrent()&&B(null)}}),at=_(async(e,n)=>{Pe();let r=`oauth:${e}:${n}`;B(r);let i=ke(e,x)[n],a=typeof i?.id==`string`?i.id:``;if(!a){B(null),D.error(t(`settings.providers.page.toast.oauthStartFailed`));return}let o=Ae(e,S),s=S[e]||e,l=we({integrationID:o,onAttempt:({attemptID:r,mode:i,url:s,instructions:c})=>{pe({[`${e}:${n}`]:{url:s,instructions:c,mode:i,userCode:/[A-Z0-9]{4}-[A-Z0-9]{4,5}/.exec(c)?.[0]}}),le({providerId:e,methodIndex:n,methodID:a,attemptID:r,mode:i}),i===`code`&&B(null),s&&o!==`claude-code`&&ie(s),D.message(t(`settings.providers.page.toast.completeOAuthInBrowser`))},onSuccess:async()=>{if(le(null),pe({}),de({}),await E({scopes:[`providers`],mode:`active`}),!l.isCurrent()||Me.current!==l)return;let n=await g.refetch({throwOnError:!0});if(!l.isCurrent()||Me.current!==l)return;v.refetch(),D.success(t(`settings.providers.page.toast.oauthCompleted`));let r=n.data?.providers.find(t=>t.id===e)??(o===s?n.data?.providers.find(e=>e.integrationID===o):void 0);r&&c(r.id),B(null)},onError:e=>{B(null),le(null),pe({}),de({}),D.error(t(e===`start`?`settings.providers.page.toast.oauthStartFailed`:`settings.providers.page.toast.oauthCompleteFailed`))}});Me.current=l,await l.start(a)}),ot=_(async(e,t)=>{let n=`${e}:${t}`,r=ue[n]?.trim();!r||q?.mode!==`code`||q.providerId!==e||q.methodIndex!==t||(B(`oauth-complete:${e}:${t}`),await Me.current?.complete(r))}),st=async e=>{if((await y(e)).ok){D.success(t(`settings.providers.page.toast.oauthLinkCopied`));return}D.error(t(`settings.providers.page.toast.oauthLinkCopyFailed`))},ct=async e=>{if((await y(e)).ok){D.success(t(`settings.providers.page.toast.deviceCodeCopied`));return}D.error(t(`settings.providers.page.toast.deviceCodeCopyFailed`))},lt=_(async e=>{if(!We||e!==o)return;let n=je();if(!n)return;let r=`delete:${e}`;B(r);try{let r=s.getSdkClient(),a=S[e],o=a?await r.integration.get({integrationID:a,location:n.location},{signal:n.signal}):void 0;if(!n.isCurrent())return;let l=o?.data.connections??[],u=l.flatMap(e=>e.type===`credential`&&typeof e.id==`string`&&e.id?[e.id]:[]);if(l.some(e=>e.type===`env`)||u.length===0&&!$?.files.length){D.error(t(`settings.providers.delete.unavailable`)),g.refetch();return}let d=await i(`/api/provider/${encodeURIComponent(e)}/auth`,{method:`DELETE`,signal:n.signal,query:{scope:`config`,...n.directory?{directory:n.directory}:{}}});if(!d.ok)throw Error(`Unable to delete provider configuration`);let f=await d.json();if(!n.isCurrent()||(await Promise.all(u.map(e=>r.credential.remove({credentialID:e},{signal:n.signal}))),!n.isCurrent())||(await E({scopes:[`providers`],mode:`active`,queryDirectory:n.directory,transportIdentity:n.transportIdentity}),!n.isCurrent()))return;let[p]=await Promise.all([g.refetch({throwOnError:!0}),v.refetch({throwOnError:!0})]);if(!n.isCurrent())return;if(p.data?.providers.some(t=>t.id===e)){if(u.length===0&&!f.removed){D.error(t(`settings.providers.delete.unavailable`));return}throw Error(`Provider is still registered after configuration and credential removal`)}K(!1),c($e),D.success(t(`settings.providers.delete.success`))}catch{n.isCurrent()&&D.error(t(`settings.providers.delete.failed`))}finally{n.isCurrent()&&B(null)}}),ut=e=>(0,X.jsx)(qe,{providerId:e,methods:Se(ke(e,x),e=>tt(e)===`oauth`),apiKey:L[e]??``,busyKey:z,apiKeyEnabled:x[e]?.some(e=>[`key`,`api`].includes(tt(e)))??!1,pendingMethodIndex:q?.providerId===e?q.methodIndex:void 0,details:fe,codes:ue,onKeyChange:t=>R(n=>({...n,[e]:t})),onSaveKey:()=>void it(e),onStart:t=>void at(e,t),onCancel:()=>{Pe(),R({})},onCodeChange:(e,t)=>de(n=>({...n,[e]:t})),onComplete:t=>void ot(e,t),onCopyCode:e=>void ct(e),onOpen:e=>void ie(e),onCopyLink:e=>void st(e)},e);if(!Te&&a.length===0)return(0,X.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,X.jsxs)(`div`,{className:`text-center text-muted-foreground`,children:[(0,X.jsx)(O,{name:`stack`,className:`mx-auto mb-3 h-12 w-12 opacity-50`}),(0,X.jsx)(`p`,{className:`typography-body`,children:t(`settings.providers.page.empty.noProvidersDetected`)}),(0,X.jsx)(`p`,{className:`typography-meta mt-1 opacity-75`,children:t(`settings.providers.page.empty.checkOpenCodeConfiguration`)})]})});if(Te)return(0,X.jsx)(ae,{outerClassName:`h-full`,className:`w-full`,children:(0,X.jsxs)(`div`,{className:`yuri-settings-section-stack mx-auto w-full max-w-3xl p-3 sm:p-6 sm:pt-8`,children:[!oe&&Z!==et&&(0,X.jsx)(`div`,{"data-settings-item":`providers.connect`,children:(0,X.jsxs)(C,{variant:`ghost`,size:`sm`,onClick:()=>{Pe(),R({}),se(!0)},children:[(0,X.jsx)(O,{name:`arrow-left-s`,className:`size-4`}),t(`settings.providers.page.connect.selectProviderTitle`)]})}),oe&&(0,X.jsx)(`div`,{"data-settings-item":`providers.connect`,className:`yuri-settings-section-stack`,children:(0,X.jsx)(Ye,{providers:Fe,search:_e,onSearch:ve,loading:me,error:he,onSelect:e=>{ge(e),ve(``),se(!1)}})}),!oe&&(Z===et?(0,X.jsx)(Ke,{onCancel:()=>se(!0)}):Z&&(0,X.jsxs)(`div`,{"data-settings-item":`providers.auth`,className:`yuri-settings-section-stack`,children:[(0,X.jsxs)(`header`,{className:`yuri-provider-identity`,children:[(0,X.jsx)(V,{providerId:Z,className:`size-10 shrink-0`}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h2`,{className:`typography-ui-header text-foreground`,children:Fe.find(e=>e.id===Z)?.name||Z}),(0,X.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:t(`settings.providers.page.auth.title`)})]})]}),T?(0,X.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:t(`settings.providers.page.auth.loadingMethods`)}):ut(Z)]}))]})});if(!Q)return(0,X.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,X.jsxs)(`div`,{className:`text-center text-muted-foreground`,children:[(0,X.jsx)(O,{name:`stack`,className:`mx-auto mb-3 h-12 w-12 opacity-50`}),(0,X.jsx)(`p`,{className:`typography-body`,children:t(`settings.providers.page.empty.selectProviderFromSidebar`)}),(0,X.jsx)(`p`,{className:`typography-meta mt-1 opacity-75`,children:t(`settings.providers.page.empty.reviewDetailsAndConfigureAuth`)})]})});let dt=Array.isArray(Q.models)?Q.models:[],ft=new Set(d.filter(e=>e.providerID===Q.id).map(e=>e.modelID)),pt=dt.filter(e=>!ft.has(e.id)).length,mt=dt.filter(e=>{let t=typeof e?.name==`string`?e.name:``,n=typeof e?.id==`string`?e.id:``,r=H.trim().toLowerCase();return!(r&&!t.toLowerCase().includes(r)&&!n.toLowerCase().includes(r))}).sort((e,t)=>Number(ft.has(e.id))-Number(ft.has(t.id)));return(0,X.jsx)(ae,{outerClassName:`h-full`,className:`w-full`,children:(0,X.jsxs)(`div`,{className:`yuri-settings-section-stack mx-auto w-full max-w-3xl p-3 sm:p-6 sm:pt-8`,children:[(0,X.jsxs)(`div`,{className:`yuri-provider-identity`,children:[(0,X.jsx)(V,{providerId:Q.id,className:`size-10 shrink-0`}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`h2`,{className:`typography-ui-header font-semibold text-foreground truncate`,children:Q.name||Q.id}),(0,X.jsx)(`p`,{className:`yuri-provider-identity-meta typography-meta text-muted-foreground`,children:(0,X.jsx)(`span`,{className:`min-w-0 break-all font-mono text-xs`,children:Q.id})})]}),(0,X.jsxs)(I,{delayDuration:0,children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsx)(`span`,{tabIndex:We?-1:0,"aria-disabled":!We||!!z,"aria-label":t(`settings.common.actions.delete`),className:`inline-flex shrink-0 ${!We||z?`cursor-not-allowed`:``}`,children:(0,X.jsx)(C,{variant:`ghost`,size:`icon`,"aria-label":t(`settings.common.actions.delete`),disabled:!!z||!We,onClick:()=>K(!0),children:(0,X.jsx)(O,{name:`delete-bin`,className:`size-4`})})})}),(0,X.jsx)(te,{side:`bottom`,align:`end`,sideOffset:6,className:`max-w-[min(22rem,calc(100vw-2rem))] text-left`,children:Ge||t(`settings.common.actions.delete`)})]})]}),(0,X.jsxs)(Xe,{itemId:`providers.auth`,rows:!0,label:t(`settings.providers.page.connectionDetails.title`),children:[(0,X.jsx)(J,{label:t(`settings.providers.page.auth.title`),children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5 typography-meta text-muted-foreground`,children:[(0,X.jsx)(O,{name:Je?`global`:`key`,className:`size-3.5 shrink-0`}),t(T?`settings.providers.page.state.loading`:Ze)]}),(0,X.jsxs)(C,{variant:`ghost`,size:`xs`,disabled:z?.startsWith(`api:`),"aria-expanded":ye,onClick:()=>{Pe(),R({}),be(e=>!e)},children:[t(ye?`settings.common.actions.cancel`:`settings.providers.page.actions.reconnect`),(0,X.jsx)(O,{name:`arrow-down-s`,className:ye?`size-3.5 rotate-180`:`size-3.5`})]})]})}),(0,X.jsx)(J,{itemId:`providers.connection-details`,label:t(`settings.providers.page.connectionDetails.configuredIn`),children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:`typography-meta text-muted-foreground break-all`,title:$?.files.map(e=>e.path).join(`
|
|
2
|
-
`),children:$?$.origin===`runtime`?t(`settings.providers.source.runtime`):$.origin===`builtin`?t(`settings.providers.source.builtin`):$.files.map(e=>`${t(e.scope===`project`?`settings.providers.page.connectionDetails.source.projectConfig`:e.scope===`custom`?`settings.providers.page.connectionDetails.source.customConfig`:`settings.providers.page.connectionDetails.source.userConfig`)} / ${e.path.split(/[\\/]/).pop()}`).join(`, `):t(v.isError?`settings.providers.page.toast.providerSourcesLoadFailed`:v.isPending?`settings.providers.page.state.loading`:`settings.providers.page.connectionDetails.noActiveSource`)}),v.isError&&$&&(0,X.jsx)(`span`,{role:`alert`,className:`typography-meta text-muted-foreground`,children:t(`settings.providers.page.toast.providerSourcesLoadFailed`)})]})}),nt&&(0,X.jsx)(Ie,{providerId:nt,providerName:nt===`opencode-go`?`OpenCode Go`:nt===`ollama-cloud`?`Ollama Cloud`:`Cursor`},nt)]}),ye&&(T?(0,X.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:t(`settings.providers.page.auth.loadingMethods`)}):ut(Q.id)),(0,X.jsx)(Xe,{itemId:`providers.models`,rows:!0,label:t(`settings.providers.custom.modelsCount`,{count:pt}),action:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[(0,X.jsxs)(`div`,{className:`relative w-28 min-w-0 sm:w-36`,children:[(0,X.jsx)(O,{name:`search`,className:`pointer-events-none absolute left-2 top-1/2 size-3 -translate-y-1/2 text-muted-foreground`}),(0,X.jsx)(P,{bordered:!0,value:H,onChange:e=>U(e.target.value),"aria-label":t(`settings.providers.page.models.filterPlaceholder`),placeholder:t(`settings.providers.page.models.filterPlaceholder`),className:`!h-7 !min-h-0 !pl-7 !pr-2 !text-left !text-xs`})]}),(0,X.jsx)(C,{size:`xs`,disabled:pt===dt.length,onClick:()=>p(Q.id),children:t(`settings.providers.custom.addAllModels`)}),(0,X.jsx)(C,{size:`xs`,disabled:pt===0,onClick:()=>{h(Q.id,dt.map(e=>e.id)),G(null)},children:t(`settings.providers.models.removeAll`)})]}),children:mt.length===0?(0,X.jsx)(`p`,{className:`typography-meta text-muted-foreground py-4 text-center`,children:t(`settings.providers.page.models.noModelsMatchFilter`)}):(0,X.jsx)(`div`,{className:`divide-y divide-[var(--yuri-settings-row-divider)]`,children:mt.slice(0,100).map(e=>{let n=typeof e?.id==`string`?e.id:``,r=typeof e?.name==`string`?e.name:n,i=n?u(Q.id,n):void 0,a=ft.has(n),o=()=>ne({providerId:Q.id,inputModalities:i?.modalities?.input??[`text`],model:{key:n,id:n,name:r,context:i?.limit?.context?String(i.limit.context):``,output:i?.limit?.output?String(i.limit.output):``,tools:i?.tool_call===!0,vision:i?.modalities?.input?.includes(`image`)===!0}}),s=Qe(i?.limit?.context),c=Qe(i?.limit?.output),l=[];return i?.tool_call&&l.push({key:`tools`,icon:`tools`,label:t(`settings.providers.page.models.capability.toolCalling`)}),i?.reasoning&&l.push({key:`reasoning`,icon:`brain-ai-3`,label:t(`settings.providers.page.models.capability.reasoning`)}),i?.modalities?.input?.includes(`image`)&&l.push({key:`image`,icon:`file-image`,label:t(`settings.providers.page.models.capability.imageInput`)}),(0,X.jsx)(Le,{id:n,name:r,providerId:Q.id,added:!a,capabilities:l,detail:[s?`${s} ${t(`settings.providers.page.models.tokenBadge.context`)}`:``,c?`${c} ${t(`settings.providers.page.models.tokenBadge.output`)}`:``].filter(Boolean).join(` · `),onSelect:a?()=>f(Q.id,n):o,onEdit:o,onToggle:()=>{f(Q.id,n),G(a?null:{providerId:Q.id,modelId:n})}},n)})})}),mt.length>100&&(0,X.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:t(`settings.providers.models.limit`,{count:mt.length})}),re?.providerId===Q.id&&ft.has(re.modelId)&&(0,X.jsxs)(`div`,{role:`status`,className:`flex items-center justify-between gap-2 typography-meta text-muted-foreground`,children:[(0,X.jsx)(`span`,{children:t(`settings.providers.models.removed`,{name:re.modelId})}),(0,X.jsx)(C,{variant:`ghost`,size:`xs`,onClick:()=>{f(re.providerId,re.modelId),G(null)},children:t(`settings.providers.models.undo`)})]}),W?.providerId===Q.id&&(0,X.jsx)(Ne,{...W,onClose:()=>ne(null)},`${Q.id}:${W.model.id}`),(0,X.jsx)(ee,{open:ce,onOpenChange:e=>{z||K(e)},children:(0,X.jsxs)(j,{children:[(0,X.jsxs)(k,{children:[(0,X.jsxs)(M,{children:[t(`settings.common.actions.delete`),` `,Q.name||Q.id]}),(0,X.jsx)(N,{children:t(`settings.providers.delete.description`)})]}),(0,X.jsxs)(A,{children:[(0,X.jsx)(C,{disabled:!!z,onClick:()=>K(!1),children:t(`settings.common.actions.cancel`)}),(0,X.jsx)(C,{variant:`destructive`,disabled:!!z||!We,onClick:()=>void lt(Q.id),children:t(`settings.common.actions.delete`)})]})]})})]})})};function ot(e){return e.currentDirectory}var st=e=>{if(!e)return;e.pause();let{src:t}=e;t.startsWith(`blob:`)&&URL.revokeObjectURL(t),e.removeAttribute(`src`),e.load()};function ct(e){let n=(0,pe.c)(82),{onClose:r}=e,{t:i}=b(),[a,o]=(0,Y.useState)(``),[s,c]=(0,Y.useState)(!1),l;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={onTranscript:o},n[0]=l):l=n[0];let u=re(l),d;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=ne(),n[1]=d):d=n[1];let f=d,p=u.status===`recording`,m=u.status===`uploading`,h=u.status===`failed`,v;n[2]!==u||n[3]!==h?(v=()=>{c(!1),o(``),h?u.discardFailedDictation():u.cancelDictation()},n[2]=u,n[3]=h,n[4]=v):v=n[4];let y=_(v),x;n[5]!==y||n[6]!==r?(x=()=>{y(),r()},n[5]=y,n[6]=r,n[7]=x):x=n[7];let w=_(x),T,E;n[8]===w?(T=n[9],E=n[10]):(T=()=>t(w),E=[w],n[8]=w,n[9]=T,n[10]=E),(0,Y.useEffect)(T,E);let D;n[11]===y?D=n[12]:(D=()=>{document.visibilityState===`hidden`&&y()},n[11]=y,n[12]=D),g(`visibilitychange`,D,document);let A=u.partialTranscript||a,P;n[13]!==u.error||n[14]!==s||n[15]!==m||n[16]!==p||n[17]!==i||n[18]!==A?(P=f?s&&!p&&!m&&!u.error&&!A?i(`settings.voice.volcengine.silence`):``:i(`settings.voice.volcengine.recordingUnsupported`),n[13]=u.error,n[14]=s,n[15]=m,n[16]=p,n[17]=i,n[18]=A,n[19]=P):P=n[19];let F=P,te=h?`chat.dictation.retry`:p?`settings.voice.volcengine.finishRecording`:m?`chat.dictation.processing`:`settings.voice.volcengine.startRecording`,I;n[20]!==i||n[21]!==te?(I=i(te),n[20]=i,n[21]=te,n[22]=I):I=n[22];let L=I,R;n[23]!==u||n[24]!==h||n[25]!==m||n[26]!==p?(R=()=>{if(!(m||!f)){if(h){u.retryFailedDictation();return}if(p){c(!0),u.confirmDictation();return}o(``),c(!1),u.startDictation()}},n[23]=u,n[24]=h,n[25]=m,n[26]=p,n[27]=R):R=n[27];let z=_(R),B;n[28]===w?B=n[29]:(B=e=>{e||w()},n[28]=w,n[29]=B);let V;n[30]===i?V=n[31]:(V=i(`settings.voice.volcengine.asrTest`),n[30]=i,n[31]=V);let H;n[32]===V?H=n[33]:(H=(0,X.jsx)(M,{className:`typography-ui-label font-medium`,children:V}),n[32]=V,n[33]=H);let U;n[34]===i?U=n[35]:(U=i(`settings.voice.volcengine.testHelp`),n[34]=i,n[35]=U);let W;n[36]===U?W=n[37]:(W=(0,X.jsx)(N,{className:`sr-only`,children:U}),n[36]=U,n[37]=W);let ie;n[38]!==H||n[39]!==W?(ie=(0,X.jsxs)(k,{className:`items-center pt-2 text-center`,children:[H,W]}),n[38]=H,n[39]=W,n[40]=ie):ie=n[40];let ae;n[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,X.jsx)(`circle`,{cx:`72`,cy:`72`,r:`68`,stroke:`currentColor`,strokeWidth:`0.75`,opacity:`0.12`}),n[41]=ae):ae=n[41];let G=p&&`text-[var(--primary-base)]`,oe;n[42]===G?oe=n[43]:(oe=S(G),n[42]=G,n[43]=oe);let se=p?.5:.18,ce;n[44]!==oe||n[45]!==se?(ce=(0,X.jsxs)(`svg`,{viewBox:`0 0 144 144`,className:`pointer-events-none absolute inset-0 size-full text-foreground`,fill:`none`,"aria-hidden":`true`,children:[ae,(0,X.jsx)(`circle`,{cx:`72`,cy:`72`,r:`59`,stroke:`currentColor`,strokeWidth:`0.75`,strokeDasharray:`24 161.35`,strokeLinecap:`round`,transform:`rotate(-102 72 72)`,className:oe,opacity:se})]}),n[44]=oe,n[45]=se,n[46]=ce):ce=n[46];let K=p&&`text-[var(--primary-base)]`,q;n[47]===K?q=n[48]:(q=S(`relative size-28 max-h-full rounded-full !bg-transparent text-foreground shadow-none transition-transform duration-200 hover:scale-105 active:scale-95 motion-reduce:transform-none motion-reduce:transition-none`,K),n[47]=K,n[48]=q);let le=!f||m,ue=m||h?`refresh`:p?`stop`:`mic`,de=m&&`animate-spin motion-reduce:animate-none`,fe;n[49]===de?fe=n[50]:(fe=S(`size-12`,de),n[49]=de,n[50]=fe);let J;n[51]!==ue||n[52]!==fe?(J=(0,X.jsx)(O,{name:ue,className:fe}),n[51]=ue,n[52]=fe,n[53]=J):J=n[53];let me;n[54]===L?me=n[55]:(me=(0,X.jsx)(`span`,{className:`sr-only`,children:L}),n[54]=L,n[55]=me);let he;n[56]!==z||n[57]!==L||n[58]!==p||n[59]!==q||n[60]!==le||n[61]!==J||n[62]!==me?(he=(0,X.jsxs)(C,{variant:`ghost`,size:`icon`,className:q,disabled:le,"aria-label":L,"aria-pressed":p,onClick:z,children:[J,me]}),n[56]=z,n[57]=L,n[58]=p,n[59]=q,n[60]=le,n[61]=J,n[62]=me,n[63]=he):he=n[63];let Z;n[64]!==ce||n[65]!==he?(Z=(0,X.jsxs)(`div`,{className:`relative flex size-36 shrink-0 items-center justify-center`,children:[ce,he]}),n[64]=ce,n[65]=he,n[66]=Z):Z=n[66];let ge;n[67]!==u.error||n[68]!==L||n[69]!==p||n[70]!==F||n[71]!==A?(ge=(0,X.jsx)(`div`,{className:`flex h-12 w-full shrink-0 items-center justify-center overflow-hidden px-2`,children:u.error?(0,X.jsx)(`p`,{role:`alert`,className:`max-h-full overflow-y-auto break-words text-center typography-meta text-[var(--status-error)]`,children:u.error}):(0,X.jsx)(`div`,{role:`log`,"aria-live":`polite`,title:A,className:`line-clamp-2 max-h-full break-words text-center typography-ui-label leading-6 text-muted-foreground`,children:A?p&&A.length>80?`…${A.slice(-80)}`:A:F||L})}),n[67]=u.error,n[68]=L,n[69]=p,n[70]=F,n[71]=A,n[72]=ge):ge=n[72];let _e;n[73]!==Z||n[74]!==ge?(_e=(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col items-center justify-center gap-3 overflow-y-auto pt-3`,children:[Z,ge]}),n[73]=Z,n[74]=ge,n[75]=_e):_e=n[75];let ve;n[76]!==ie||n[77]!==_e?(ve=(0,X.jsxs)(j,{className:`h-[min(19rem,calc(100dvh-2rem))] grid-rows-[auto_minmax(0,1fr)] gap-0 overflow-hidden rounded-3xl sm:max-w-[22rem]`,children:[ie,_e]}),n[76]=ie,n[77]=_e,n[78]=ve):ve=n[78];let ye;return n[79]!==B||n[80]!==ve?(ye=(0,X.jsx)(ee,{open:!0,onOpenChange:B,children:ve}),n[79]=B,n[80]=ve,n[81]=ye):ye=n[81],ye}var lt=[{value:`seed-tts-2.0`,label:`Seed TTS 2.0`},{value:`seed-icl-2.0`,label:`Seed ICL 2.0`}],ut=[{value:`zh_female_vv_uranus_bigtts`,label:`Vivi 2.0`},{value:`zh_female_xiaohe_uranus_bigtts`,label:`小何 2.0`},{value:`zh_male_m191_uranus_bigtts`,label:`云舟 2.0`},{value:`zh_male_taocheng_uranus_bigtts`,label:`小天 2.0`},{value:`zh_male_liufei_uranus_bigtts`,label:`刘飞 2.0`},{value:`zh_female_sophie_uranus_bigtts`,label:`魅力苏菲 2.0`},{value:`zh_female_qingxinnvsheng_uranus_bigtts`,label:`清新女声 2.0`},{value:`zh_female_cancan_uranus_bigtts`,label:`知性灿灿 2.0`},{value:`zh_female_sajiaoxuemei_uranus_bigtts`,label:`撒娇学妹 2.0`},{value:`zh_female_tianmeixiaoyuan_uranus_bigtts`,label:`甜美小源 2.0`},{value:`zh_female_tianmeitaozi_uranus_bigtts`,label:`甜美桃子 2.0`},{value:`zh_female_shuangkuaisisi_uranus_bigtts`,label:`爽快思思 2.0`},{value:`zh_female_peiqi_uranus_bigtts`,label:`佩奇猪 2.0`},{value:`zh_female_linjianvhai_uranus_bigtts`,label:`邻家女孩 2.0`},{value:`zh_male_shaonianzixin_uranus_bigtts`,label:`少年梓辛 2.0`},{value:`zh_male_sunwukong_uranus_bigtts`,label:`猴哥 2.0`},{value:`zh_female_yingyujiaoxue_uranus_bigtts`,label:`Tina老师 2.0`},{value:`zh_female_kefunvsheng_uranus_bigtts`,label:`暖阳女声 2.0`},{value:`zh_female_xiaoxue_uranus_bigtts`,label:`儿童绘本 2.0`},{value:`zh_male_dayi_uranus_bigtts`,label:`大壹 2.0`},{value:`zh_female_mizai_uranus_bigtts`,label:`黑猫侦探社咪仔 2.0`},{value:`zh_female_jitangnv_uranus_bigtts`,label:`鸡汤女 2.0`},{value:`zh_female_meilinvyou_uranus_bigtts`,label:`魅力女友 2.0`},{value:`zh_female_liuchangnv_uranus_bigtts`,label:`流畅女声 2.0`},{value:`zh_male_ruyayichen_uranus_bigtts`,label:`儒雅逸辰 2.0`},{value:`en_male_tim_uranus_bigtts`,label:`Tim`},{value:`en_female_dacey_uranus_bigtts`,label:`Dacey`},{value:`en_female_stokie_uranus_bigtts`,label:`Stokie`}],dt=`$custom`,ft=[{value:`volc.seedasr.sauc.duration`,label:`Seed ASR 2.0 · duration`},{value:`volc.seedasr.sauc.concurrent`,label:`Seed ASR 2.0 · concurrent`},{value:`volc.bigasr.sauc.duration`,label:`Big ASR 1.0 · duration`},{value:`volc.bigasr.sauc.concurrent`,label:`Big ASR 1.0 · concurrent`}];function pt(e){let t=(0,pe.c)(42),{value:n,onChange:r,options:i,label:a,allowCustom:o,disabled:s}=e,c=o===void 0||o,l=s!==void 0&&s,{t:u}=b(),[d,f]=(0,Y.useState)(!1),p;if(t[0]!==i||t[1]!==n){let e;t[3]===n?e=t[4]:(e=e=>e.value===n,t[3]=n,t[4]=e),p=i.some(e),t[0]=i,t[1]=n,t[2]=p}else p=t[2];let m=p,h=c&&(d||!m),g=h?dt:n,_;t[5]===r?_=t[6]:(_=e=>{f(e===dt),e!==dt&&r(e)},t[5]=r,t[6]=_);let v;t[7]!==i||t[8]!==u?(v=(0,X.jsx)(R,{children:e=>e===dt?u(`settings.voice.volcengine.custom`):i.find(t=>t.value===e)?.label??e}),t[7]=i,t[8]=u,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==v?(y=(0,X.jsx)(U,{className:`w-full min-w-0`,"aria-label":a,children:v}),t[10]=a,t[11]=v,t[12]=y):y=t[12];let x;t[13]===i?x=t[14]:(x=i.map(mt),t[13]=i,t[14]=x);let S;t[15]!==c||t[16]!==m||t[17]!==n?(S=!c&&!m&&n&&(0,X.jsx)(B,{value:n,children:n}),t[15]=c,t[16]=m,t[17]=n,t[18]=S):S=t[18];let C;t[19]!==c||t[20]!==u?(C=c&&(0,X.jsx)(B,{value:dt,children:u(`settings.voice.volcengine.custom`)}),t[19]=c,t[20]=u,t[21]=C):C=t[21];let w;t[22]!==C||t[23]!==x||t[24]!==S?(w=(0,X.jsxs)(H,{children:[x,S,C]}),t[22]=C,t[23]=x,t[24]=S,t[25]=w):w=t[25];let T;t[26]!==l||t[27]!==w||t[28]!==g||t[29]!==_||t[30]!==y?(T=(0,X.jsxs)(W,{disabled:l,value:g,onValueChange:_,children:[y,w]}),t[26]=l,t[27]=w,t[28]=g,t[29]=_,t[30]=y,t[31]=T):T=t[31];let E;t[32]!==h||t[33]!==l||t[34]!==a||t[35]!==r||t[36]!==u||t[37]!==n?(E=h&&(0,X.jsx)(P,{disabled:l,value:n,onChange:e=>r(e.target.value),"aria-label":`${a} (${u(`settings.voice.volcengine.custom`)})`}),t[32]=h,t[33]=l,t[34]=a,t[35]=r,t[36]=u,t[37]=n,t[38]=E):E=t[38];let D;return t[39]!==T||t[40]!==E?(D=(0,X.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-end gap-2`,children:[T,E]}),t[39]=T,t[40]=E,t[41]=D):D=t[41],D}function mt(e){return(0,X.jsx)(B,{value:e.value,children:(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{children:e.label}),(0,X.jsx)(`span`,{className:`break-all typography-meta text-muted-foreground`,children:e.description??e.value})]})},e.value)}function ht(e){let t=(0,pe.c)(42),{mode:n,form:r,showCredentials:i}=e,a=i===void 0||i,{t:o}=b(),s=(0,Y.useRef)(!0),c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>(s.current=!0,()=>{s.current=!1}),l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,Y.useEffect)(c,l);let{values:u,draft:d,saving:f,edit:p,save:m}=r,{voice:g,resourceId:_,asrResourceId:v}=u,y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y={enabled:!1},t[2]=y):y=t[2];let{speak:x,stop:S,isPlaying:w,error:T}=ce(y),[E,D]=(0,Y.useState)(!1),O;t[3]!==w||t[4]!==n||t[5]!==m||t[6]!==f||t[7]!==x||t[8]!==S||t[9]!==o?(O=async()=>{if(n===`tts`&&w){S();return}if(f)return;let e=await m();if(!(!e||!s.current)){if(!e.configured){h.error(o(`settings.providers.page.toast.apiKeyRequired`));return}n===`asr`?D(!0):x(o(`settings.voice.page.preview.voiceLine`,{voiceName:`Yuri`}))}},t[3]=w,t[4]=n,t[5]=m,t[6]=f,t[7]=x,t[8]=S,t[9]=o,t[10]=O):O=t[10];let k=O,A;t[11]!==d||t[12]!==p||t[13]!==n||t[14]!==f||t[15]!==u.configured||t[16]!==a||t[17]!==o?(A=a&&(0,X.jsx)(J,{itemId:`voice.volcengine-${n}-key`,label:o(`settings.voice.page.field.apiKey`),description:(0,X.jsxs)(X.Fragment,{children:[o(`settings.voice.volcengine.keyHelp`),` `,(0,X.jsx)(`a`,{href:`https://console.volcengine.com/speech/new`,target:`_blank`,rel:`noreferrer`,className:`text-primary underline`,children:o(`settings.voice.volcengine.openLink`)})]}),children:(0,X.jsx)(P,{type:`password`,autoComplete:`off`,disabled:f,placeholder:u.configured&&d.apiKey===void 0?`••••••••`:`API Key`,value:d.apiKey??``,onChange:e=>p({apiKey:e.target.value}),"aria-label":o(`settings.voice.page.field.apiKey`)})}),t[11]=d,t[12]=p,t[13]=n,t[14]=f,t[15]=u.configured,t[16]=a,t[17]=o,t[18]=A):A=t[18];let j;t[19]!==p||t[20]!==T||t[21]!==w||t[22]!==n||t[23]!==_||t[24]!==f||t[25]!==o||t[26]!==k||t[27]!==g?(j=n===`tts`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(J,{itemId:`voice.volcengine-resource`,label:o(`settings.voice.volcengine.resource`),children:(0,X.jsx)(pt,{value:_,disabled:f,onChange:e=>p({resourceId:e}),options:lt,label:o(`settings.voice.volcengine.resource`)})}),(0,X.jsx)(J,{itemId:`voice.volcengine-speaker`,label:o(`settings.voice.volcengine.speaker`),children:(0,X.jsx)(pt,{value:g,disabled:f,onChange:e=>p({voice:e}),options:_===`seed-tts-2.0`?ut:[],label:o(`settings.voice.volcengine.speaker`)},_)}),(0,X.jsxs)(J,{label:o(`settings.voice.page.actions.preview`),children:[(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:!w&&f,"aria-busy":f,onClick:()=>void k(),children:o(w?`settings.voice.volcengine.stop`:`settings.voice.page.actions.preview`)}),T&&(0,X.jsx)(`span`,{role:`alert`,className:`text-[var(--status-error)]`,children:T})]})]}),t[19]=p,t[20]=T,t[21]=w,t[22]=n,t[23]=_,t[24]=f,t[25]=o,t[26]=k,t[27]=g,t[28]=j):j=t[28];let M;t[29]!==v||t[30]!==p||t[31]!==n||t[32]!==f||t[33]!==u.asrContext||t[34]!==o||t[35]!==k||t[36]!==E?(M=n===`asr`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(J,{itemId:`voice.volcengine-asr-resource`,label:o(`settings.voice.volcengine.asrResource`),children:(0,X.jsx)(pt,{value:v,disabled:f,onChange:e=>p({asrResourceId:e}),options:ft.map(e=>({...e,description:o(e.value.endsWith(`.duration`)?`settings.voice.volcengine.durationHelp`:`settings.voice.volcengine.concurrentHelp`)})),label:o(`settings.voice.volcengine.asrResource`),allowCustom:!1})}),(0,X.jsx)(J,{itemId:`voice.volcengine-asr-context`,className:`yuri-settings-split-row-stacked`,controlClassName:`!w-full !max-w-none`,label:o(`settings.voice.volcengine.asrContext`),description:o(`settings.voice.volcengine.asrContextHelp`),children:(0,X.jsx)(G,{rows:5,maxLength:2e3,disabled:f,value:u.asrContext,onChange:e=>p({asrContext:e.target.value}),"aria-label":o(`settings.voice.volcengine.asrContext`)})}),(0,X.jsx)(J,{itemId:`voice.volcengine-asr-test`,label:o(`settings.voice.volcengine.asrTest`),description:o(`settings.voice.volcengine.testHelp`),children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:f,"aria-busy":f,onClick:()=>void k(),children:o(`settings.voice.volcengine.asrTest`)})}),E&&(0,X.jsx)(ct,{onClose:()=>D(!1)})]}),t[29]=v,t[30]=p,t[31]=n,t[32]=f,t[33]=u.asrContext,t[34]=o,t[35]=k,t[36]=E,t[37]=M):M=t[37];let N;return t[38]!==A||t[39]!==j||t[40]!==M?(N=(0,X.jsxs)(X.Fragment,{children:[A,j,M]}),t[38]=A,t[39]=j,t[40]=M,t[41]=N):N=t[41],N}function gt(e,t={}){let{t:i}=b(),[a,o]=(0,Y.useState)(()=>t),s=(0,Y.useRef)(!0);(0,Y.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let c=f({mutationFn:({patch:e,generation:t,transport:n})=>q(e,t,n),networkMode:`always`,retry:!1,gcTime:0}),l=async()=>{if(c.isPending)return null;let e=r(),t=a;try{let i=await c.mutateAsync({patch:a,generation:e,transport:n()});return!s.current||e!==r()?null:(o(e=>e===t?{}:Object.fromEntries(Object.entries(e).filter(([e,n])=>!Object.is(n,t[e])))),i)}catch{return s.current&&e===r()&&h.error(i(`settings.voice.volcengine.saveFailed`)),null}finally{c.reset()}};return{values:{...e,...a},draft:a,saving:c.isPending,edit:e=>o(t=>({...t,...e})),save:l}}var _t=[{id:`parakeet-tdt-0.6b-v2-int8`,labelKey:`settings.voice.page.stt.model.parakeetV2`,badgeKey:`settings.voice.page.stt.badge.bestForEnglish`,accuracy:5,speed:5,size:`460 MB`},{id:`parakeet-tdt-0.6b-v3-int8`,labelKey:`settings.voice.page.stt.model.parakeetV3`,badgeKey:`settings.voice.page.stt.badge.bestForMultilingual`,accuracy:5,speed:4,size:`465 MB`},{id:`whisper-base-int8`,labelKey:`settings.voice.page.stt.model.whisperBase`,badgeKey:null,accuracy:3,speed:3,size:`200 MB`},{id:`whisper-tiny-int8`,labelKey:`settings.voice.page.stt.model.whisperTiny`,badgeKey:null,accuracy:2,speed:4,size:`115 MB`}],vt=e=>{let t=(0,pe.c)(8),{value:n,label:r}=e,i=`${r}: ${n}/5`,a=`${n/5*100}%`,o;t[0]===a?o=t[1]:(o=(0,X.jsx)(`span`,{className:`h-1.5 w-12 flex-shrink-0 overflow-hidden rounded-full bg-[var(--interactive-border)]`,"aria-hidden":`true`,children:(0,X.jsx)(`span`,{className:`block h-full rounded-full bg-[var(--primary-base)]`,style:{width:a}})}),t[0]=a,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,X.jsx)(`span`,{className:`typography-ui-compact text-muted-foreground`,children:r}),t[2]=r,t[3]=s);let c;return t[4]!==i||t[5]!==o||t[6]!==s?(c=(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,title:i,children:[o,s]}),t[4]=i,t[5]=o,t[6]=s,t[7]=c):c=t[7],c},yt=({selectedModelId:e,onSelect:t})=>{let{t:n}=b(),r=(0,Y.useCallback)(e=>n(e),[n]),[a,o]=(0,Y.useState)(new Map),[s,c]=(0,Y.useState)(null),l=(0,Y.useCallback)(async()=>{try{let e=await i(`/api/dictation/status`,{query:{provider:`local`}});if(!e.ok)return;let t=await e.json();Array.isArray(t?.models)&&o(new Map(t.models.map(e=>[e.id,e])))}catch{}},[]);(0,Y.useEffect)(()=>{l()},[l]);let u=Array.from(a.values()).some(e=>e.downloading);(0,Y.useEffect)(()=>{if(!u)return;let e=setInterval(()=>{l()},2e3);return()=>clearInterval(e)},[u,l]);let d=async e=>{c(e);try{await i(`/api/dictation/models/${encodeURIComponent(e)}/download`,{method:`POST`}),await l()}catch{}finally{c(null)}},f=async e=>{c(e);try{await i(`/api/dictation/models/${encodeURIComponent(e)}`,{method:`DELETE`}),await l()}catch{}finally{c(null)}};return(0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":n(`settings.voice.page.field.model`),className:`mt-1 w-full min-w-0 space-y-0`,children:_t.map(i=>{let o=e===i.id,c=a.get(i.id)??null;return(0,X.jsxs)(`div`,{className:`flex w-full items-start gap-2 py-1.5`,children:[(0,X.jsx)(`div`,{className:`pt-0.5`,children:(0,X.jsx)(me,{checked:o,onChange:()=>t(i.id),ariaLabel:r(i.labelKey)})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 cursor-pointer`,role:`button`,tabIndex:0,onClick:()=>t(i.id),onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),t(i.id))},children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,X.jsx)(`span`,{className:S(`typography-ui-label font-normal`,o?`text-foreground`:`text-foreground/50`),children:r(i.labelKey)}),i.badgeKey?(0,X.jsx)(`span`,{className:`rounded px-1 text-[9px] font-medium uppercase leading-[14px] tracking-wide`,style:{backgroundColor:`var(--status-success-background)`,color:`var(--status-success)`,border:`1px solid var(--status-success-border)`},children:r(i.badgeKey)}):null]}),(0,X.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-x-4 gap-y-0.5`,children:[(0,X.jsx)(vt,{value:i.accuracy,label:n(`settings.voice.page.stt.meta.accuracy`)}),(0,X.jsx)(vt,{value:i.speed,label:n(`settings.voice.page.stt.meta.speed`)}),(0,X.jsx)(`span`,{className:`typography-ui-compact tabular-nums text-muted-foreground`,children:i.size})]}),c?.downloadError?(0,X.jsx)(`p`,{className:`mt-0.5 typography-meta text-[var(--status-error)]`,children:c.downloadError}):null]}),(0,X.jsx)(`div`,{className:`flex w-14 flex-shrink-0 items-center justify-end gap-1 pt-0.5`,children:c?.installed?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(C,{variant:`ghost`,size:`xs`,className:`h-6 w-6 p-0 text-muted-foreground hover:text-[var(--status-error)]`,disabled:s===i.id,onClick:()=>{f(i.id)},title:n(`settings.voice.page.stt.modelDelete`),"aria-label":n(`settings.voice.page.stt.modelDelete`),children:(0,X.jsx)(O,{name:`delete-bin`,className:`h-4 w-4`})}),(0,X.jsx)(O,{name:`checkbox-circle`,className:`h-4 w-4 flex-shrink-0 text-[var(--status-success)]`,"aria-label":n(`settings.voice.page.stt.modelInstalled`)})]}):c?.downloading?(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(O,{name:`loader-4`,className:`h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,X.jsx)(`span`,{className:`typography-ui-compact tabular-nums text-muted-foreground`,children:typeof c.downloadProgress==`number`?`${c.downloadProgress}%`:``})]}):(0,X.jsx)(C,{variant:`ghost`,size:`xs`,className:`h-6 w-6 p-0`,disabled:s===i.id,onClick:()=>{d(i.id)},title:n(`settings.voice.page.stt.modelDownload`),"aria-label":n(`settings.voice.page.stt.modelDownload`),children:(0,X.jsx)(O,{name:`download`,className:`h-4 w-4`})})})]},i.id)})})},bt=[{id:0,label:`Alloy (af)`},{id:1,label:`Bella (af)`},{id:2,label:`Nicole (af)`},{id:3,label:`Sarah (af)`},{id:4,label:`Sky (af)`},{id:5,label:`Adam (am)`},{id:6,label:`Michael (am)`},{id:7,label:`Emma (bf)`},{id:8,label:`Isabella (bf)`},{id:9,label:`George (bm)`},{id:10,label:`Lewis (bm)`}],xt=`kokoro-en-v0_19`,St=()=>{let{t:e}=b(),[t,n]=(0,Y.useState)(null),[r,a]=(0,Y.useState)(!1),o=(0,Y.useCallback)(async()=>{try{let e=await i(`/api/dictation/status`,{query:{provider:`local`}});if(!e.ok)return;let t=await e.json(),r=Array.isArray(t?.ttsModels)?t.ttsModels.find(e=>e.id===xt):null;r&&n(r)}catch{}},[]);(0,Y.useEffect)(()=>{o()},[o]),(0,Y.useEffect)(()=>{if(!t?.downloading)return;let e=setInterval(()=>{o()},2e3);return()=>clearInterval(e)},[t?.downloading,o]);let s=async e=>{a(!0);try{await i(e===`POST`?`/api/dictation/models/${xt}/download`:`/api/dictation/models/${xt}`,{method:e}),await o()}catch{}finally{a(!1)}};return t?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,X.jsx)(`span`,{className:`typography-ui-label text-foreground`,children:`Kokoro`}),(0,X.jsx)(`span`,{className:`typography-ui-compact tabular-nums text-muted-foreground`,children:`305 MB`}),t.installed?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(O,{name:`checkbox-circle`,className:`h-4 w-4 text-[var(--status-success)]`,"aria-label":e(`settings.voice.page.stt.modelInstalled`)}),(0,X.jsx)(C,{variant:`ghost`,size:`xs`,className:`h-6 w-6 p-0 text-muted-foreground hover:text-[var(--status-error)]`,disabled:r,onClick:()=>{s(`DELETE`)},title:e(`settings.voice.page.stt.modelDelete`),"aria-label":e(`settings.voice.page.stt.modelDelete`),children:(0,X.jsx)(O,{name:`delete-bin`,className:`h-4 w-4`})})]}):t.downloading?(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(O,{name:`loader-4`,className:`h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,X.jsx)(`span`,{className:`typography-ui-compact tabular-nums text-muted-foreground`,children:typeof t.downloadProgress==`number`?`${t.downloadProgress}%`:``})]}):(0,X.jsx)(C,{variant:`ghost`,size:`xs`,className:`h-6 w-6 p-0`,disabled:r,onClick:()=>{s(`POST`)},title:e(`settings.voice.page.stt.modelDownload`),"aria-label":e(`settings.voice.page.stt.modelDownload`),children:(0,X.jsx)(O,{name:`download`,className:`h-4 w-4`})}),t.downloadError?(0,X.jsx)(`span`,{className:`typography-meta text-[var(--status-error)]`,children:t.downloadError}):null]}):null},Ct=[{value:`alloy`,label:`Alloy`},{value:`ash`,label:`Ash`},{value:`ballad`,label:`Ballad`},{value:`coral`,label:`Coral`},{value:`echo`,label:`Echo`},{value:`fable`,label:`Fable`},{value:`nova`,label:`Nova`},{value:`onyx`,label:`Onyx`},{value:`sage`,label:`Sage`},{value:`shimmer`,label:`Shimmer`},{value:`verse`,label:`Verse`},{value:`marin`,label:`Marin`},{value:`cedar`,label:`Cedar`}],wt=e=>{let n=(0,pe.c)(3),{section:i}=e,a=`${(0,Y.useSyncExternalStore)(t,r,r)}:${i??`all`}`,o;return n[0]!==i||n[1]!==a?(o=(0,X.jsx)(Tt,{section:i},a),n[0]=i,n[1]=a,n[2]=o):o=n[2],o};function Tt(e){let t=(0,pe.c)(9),{section:n}=e,{t:r}=b(),i=K(),a;t[0]!==i||t[1]!==r?(a=i.isError&&(0,X.jsx)(J,{label:r(`settings.voice.volcengine.loadFailed`),children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,onClick:()=>void i.refetch(),children:r(`settings.voice.volcengine.retry`)})}),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=i.data??T,s;t[3]!==n||t[4]!==o?(s=(0,X.jsx)(Et,{settings:o,section:n}),t[3]=n,t[4]=o,t[5]=s):s=t[5];let c;return t[6]!==a||t[7]!==s?(c=(0,X.jsxs)(X.Fragment,{children:[a,s]}),t[6]=a,t[7]=s,t[8]=c):c=t[8],c}var Et=({settings:e,section:t})=>{let{t:n}=b(),{isMobile:r}=L(),a=gt(e),o=gt(e),{voiceProvider:s,speechRate:c,speechPitch:l,speechVolume:u,sayVoice:d,localTtsVoiceId:f,browserVoice:p,openaiVoice:m,openaiApiKey:h,openaiCompatibleUrl:g,openaiCompatibleApiKey:v,openaiCompatibleVoice:y,openaiCompatibleTtsModel:x,showMessageTTSButtons:w,ttsInputMode:T}=a.values,{sttProvider:E,sttServerUrl:D,sttApiKey:k,sttModel:A,sttLocalModel:j,sttLanguage:M,dictationEnabled:N}=o.values,ee=e=>a.edit({voiceProvider:e}),z=e=>a.edit({speechRate:e}),V=e=>a.edit({speechPitch:e}),ne=e=>a.edit({speechVolume:e}),re=e=>a.edit({sayVoice:e}),ie=e=>a.edit({localTtsVoiceId:e}),ae=e=>a.edit({browserVoice:e}),G=e=>a.edit({openaiVoice:e}),ce=e=>a.edit({openaiApiKey:e}),K=e=>a.edit({openaiCompatibleUrl:e}),q=e=>a.edit({openaiCompatibleApiKey:e}),de=e=>a.edit({openaiCompatibleVoice:e}),fe=e=>a.edit({openaiCompatibleTtsModel:e}),pe=e=>a.edit({ttsInputMode:e}),me=e=>a.edit({showMessageTTSButtons:e}),he=e=>o.edit({dictationEnabled:e}),Z=e=>o.edit({sttProvider:e}),ge=e=>o.edit({sttServerUrl:e}),_e=e=>o.edit({sttApiKey:e}),ve=e=>o.edit({sttModel:e}),ye=e=>o.edit({sttLocalModel:e}),xe=e=>o.edit({sttLanguage:e}),{speak:Se,stop:Ce,isPlaying:we,error:Te}=oe(),Ee=_(async()=>{if(we){Ce();return}if(!await a.save())return;let e=bt.find(e=>e.id===f)?.label??String(f);Se(n(`settings.voice.page.preview.voiceLine`,{voiceName:e}))}),[De,Oe]=(0,Y.useState)(!1),[ke,Ae]=(0,Y.useState)([]),[je,Me]=(0,Y.useState)(!1),[Ne,Pe]=(0,Y.useState)(null),[Fe,Ie]=(0,Y.useState)(!1),[Le,Q]=(0,Y.useState)(!1),[$,Re]=(0,Y.useState)(null),[ze,Be]=(0,Y.useState)(!1),[Ve,He]=(0,Y.useState)(null),[Ue,We]=(0,Y.useState)([]),[Ge,Ke]=(0,Y.useState)(!1);(0,Y.useEffect)(()=>((async()=>{let e=await se.waitForVoices();We(e)})(),`speechSynthesis`in window&&(window.speechSynthesis.onvoiceschanged=()=>{We(window.speechSynthesis.getVoices())}),()=>{`speechSynthesis`in window&&(window.speechSynthesis.onvoiceschanged=null)}),[]);let qe=(0,Y.useMemo)(()=>Ue.filter(e=>e.lang).sort((e,t)=>{let n=e.lang.startsWith(`en`),r=t.lang.startsWith(`en`);if(n&&!r)return-1;if(!n&&r)return 1;let i=e.lang.localeCompare(t.lang);return i===0?e.name.localeCompare(t.name):i}),[Ue]),Je=_(async()=>{if(Ge){se.cancelSpeech(),Ke(!1);return}if(!await a.save())return;let e=Ue.find(e=>e.name===p),t=e?.name??n(`settings.voice.page.preview.browserVoiceFallback`),r=n(`settings.voice.page.preview.voiceLine`,{voiceName:t});Ke(!0);let i=new SpeechSynthesisUtterance(r);i.rate=c,i.pitch=l,i.volume=u,e&&(i.voice=e,i.lang=e.lang),i.onend=()=>Ke(!1),i.onerror=()=>Ke(!1),window.speechSynthesis.cancel(),window.speechSynthesis.speak(i)});(0,Y.useEffect)(()=>()=>{Ge&&se.cancelSpeech()},[Ge]),(0,Y.useEffect)(()=>{if(!w||s!==`openai`&&s!==`openai-compatible`){Ie(h.trim().length>0||e.openaiApiKeyConfigured);return}(async()=>{try{let t=(await(await i(`/api/tts/status`)).json()).available,n=h.trim().length>0||e.openaiApiKeyConfigured;Ie(t||n)}catch{Ie(h.trim().length>0||e.openaiApiKeyConfigured)}})()},[h,e.openaiApiKeyConfigured,w,s]),(0,Y.useEffect)(()=>{if(!w){Oe(!1),Ae([]);return}i(`/api/tts/say/status`).then(e=>e.json()).then(e=>{if(Oe(e.available),e.voices){let t=e.voices.filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t).sort((e,t)=>e.name.localeCompare(t.name));Ae(t)}}).catch(()=>{Oe(!1)})},[w]);let Ye=_(async()=>{if(Ne){st(Ne),Pe(null),Me(!1);return}if(!await a.save())return;Me(!0);let e=null;try{let t=await i(`/api/tts/say/speak`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:n(`settings.voice.page.preview.voiceLine`,{voiceName:d})})});if(!t.ok)throw Error(`Preview failed`);let r=await t.blob(),a=URL.createObjectURL(r);e=new Audio(a),e.onended=()=>{st(e),Pe(null),Me(!1)},e.onerror=()=>{st(e),Pe(null),Me(!1)},Pe(e),await e.play()}catch{st(e),Pe(null),Me(!1)}});(0,Y.useEffect)(()=>()=>{st(Ne)},[Ne]);let Xe=_(async()=>{if($){st($),Re(null),Q(!1);return}if(!await a.save())return;Q(!0);let e=null;try{let t=await i(`/api/tts/speak`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:n(`settings.voice.page.preview.voiceLine`,{voiceName:m})})});if(!t.ok){let e=await t.json().catch(()=>({error:`Unknown error`}));throw Error(e.error||`HTTP ${t.status}`)}let r=await t.blob(),a=URL.createObjectURL(r);e=new Audio(a),e.onended=()=>{st(e),Re(null),Q(!1)},e.onerror=()=>{st(e),Re(null),Q(!1)},Re(e),await e.play()}catch{st(e),Re(null),Q(!1)}});(0,Y.useEffect)(()=>()=>{st($)},[$]);let Ze=_(async()=>{if(Ve){st(Ve),He(null),Be(!1);return}if(!g.trim()||!await a.save())return;Be(!0);let e=null;try{let t=await i(`/api/tts/speak`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:n(`settings.voice.page.preview.customServerLine`)})});if(!t.ok){let e=await t.json().catch(()=>({error:`Unknown error`}));throw Error(e.error||`HTTP ${t.status}`)}let r=await t.blob(),a=URL.createObjectURL(r);e=new Audio(a),e.onended=()=>{st(e),He(null),Be(!1)},e.onerror=()=>{st(e),He(null),Be(!1)},He(e),await e.play()}catch{st(e),He(null),Be(!1)}});(0,Y.useEffect)(()=>()=>{st(Ve)},[Ve]);let Qe=`flex-1 min-w-0 h-1.5 bg-[var(--interactive-border)] rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[var(--primary-base)] [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-[var(--primary-base)] [&::-moz-range-thumb]:border-0 disabled:opacity-50`;return(0,X.jsxs)(`div`,{className:`yuri-settings-section-stack`,children:[!t&&(0,X.jsx)(`div`,{className:`space-y-1`,children:(0,X.jsx)(`h2`,{className:`typography-ui-header font-semibold text-foreground`,children:n(`settings.page.voice.title`)})}),t!==`asr`&&(0,X.jsx)(`div`,{"data-settings-item":`voice.playback`,children:(0,X.jsxs)(le,{label:n(`settings.voice.page.section.playbackAndSummary`),actions:(0,X.jsx)(C,{size:`sm`,disabled:a.saving,"aria-busy":a.saving,onClick:()=>{a.saving||a.save()},children:n(`settings.voice.volcengine.save`)}),children:[(0,X.jsx)(J,{label:n(`settings.voice.page.field.messageReadAloudButton`),children:(0,X.jsx)(ue,{checked:w,onChange:me,ariaLabel:n(`settings.voice.page.field.messageReadAloudButtonAria`)})}),w&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(J,{label:(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`span`,{children:n(`settings.voice.page.field.provider`)}),(0,X.jsxs)(I,{children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsx)(O,{name:`information`,className:`h-3.5 w-3.5 text-muted-foreground/60 cursor-help`})}),(0,X.jsx)(te,{sideOffset:8,className:`max-w-xs`,children:(0,X.jsxs)(`ul`,{className:`space-y-1`,children:[(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:n(`settings.voice.page.provider.browser`)}),` `,n(`settings.voice.page.tooltip.browser`)]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:n(`settings.voice.page.provider.local`)}),` `,n(`settings.voice.page.tooltip.localTts`)]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:`OpenAI:`}),` `,n(`settings.voice.page.tooltip.openai`)]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:n(`settings.voice.page.provider.custom`)}),` `,n(`settings.voice.page.tooltip.custom`)]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:n(`settings.voice.page.provider.say`)}),` `,n(`settings.voice.page.tooltip.say`)]})]})})]})]}),children:(0,X.jsxs)(W,{value:s,onValueChange:e=>{(e===`browser`||e===`local`||e===`openai`||e===`openai-compatible`||e===`volcengine`||e===`say`&&De)&&ee(e)},children:[(0,X.jsx)(U,{"aria-label":n(`settings.voice.page.field.provider`),children:(0,X.jsx)(R,{children:{browser:n(`settings.voice.page.provider.browser`),volcengine:n(`settings.voice.volcengine.providerOption`),local:n(`settings.voice.page.provider.local`),openai:`OpenAI`,"openai-compatible":n(`settings.voice.page.provider.custom`),say:n(`settings.voice.page.provider.say`)}[s]})}),(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{value:`volcengine`,children:n(`settings.voice.volcengine.providerOption`)}),(0,X.jsx)(B,{value:`browser`,children:n(`settings.voice.page.provider.browser`)}),(0,X.jsx)(B,{value:`local`,children:n(`settings.voice.page.provider.local`)}),(0,X.jsx)(B,{value:`openai`,children:`OpenAI`}),(0,X.jsx)(B,{value:`openai-compatible`,children:n(`settings.voice.page.provider.custom`)}),De&&(0,X.jsx)(B,{value:`say`,children:n(`settings.voice.page.provider.say`)})]})]})}),s===`volcengine`&&(0,X.jsx)(ht,{mode:`tts`,form:a}),s===`openai`&&(0,X.jsx)(J,{label:(0,X.jsx)(`span`,{className:S(!Fe&&`text-[var(--status-error)]`),children:n(`settings.voice.page.field.apiKey`)}),description:(0,X.jsx)(`span`,{className:S(!Fe&&`text-[var(--status-error)]/80`),children:n(Fe&&!h?`settings.voice.page.field.apiKeyHintUsingConfig`:Fe?`settings.voice.page.field.apiKeyHintProvide`:`settings.voice.page.field.apiKeyHintRequired`)}),children:(0,X.jsxs)(`div`,{className:`relative w-full`,children:[(0,X.jsx)(P,{type:`password`,value:h,onChange:e=>ce(e.target.value),placeholder:e.openaiApiKeyConfigured&&a.draft.openaiApiKey===void 0?`••••••••`:`sk-...`,className:`w-full pr-8`}),h&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>ce(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,X.jsx)(O,{name:`close`,className:`w-3.5 h-3.5`})})]})}),s===`openai-compatible`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(J,{label:(0,X.jsx)(`span`,{className:S(!g.trim()&&`text-[var(--status-error)]`),children:n(`settings.voice.page.field.serverUrl`)}),description:n(`settings.voice.page.field.serverUrlHint`),children:(0,X.jsxs)(`div`,{className:`relative w-full`,children:[(0,X.jsx)(P,{type:`text`,value:g,onChange:e=>K(e.target.value),placeholder:`http://localhost:8880/v1`,className:`w-full pr-8`}),g&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>K(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,X.jsx)(O,{name:`close`,className:`w-3.5 h-3.5`})})]})}),(0,X.jsx)(J,{label:`API Key`,description:`Optional`,children:(0,X.jsxs)(`div`,{className:`relative w-full`,children:[(0,X.jsx)(P,{type:`password`,value:v,onChange:e=>q(e.target.value),placeholder:e.openaiCompatibleApiKeyConfigured&&a.draft.openaiCompatibleApiKey===void 0?`••••••••`:`sk-...`,className:`w-full pr-8`}),v&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>q(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,X.jsx)(O,{name:`close`,className:`w-3.5 h-3.5`})})]})}),(0,X.jsx)(J,{label:n(`settings.voice.page.field.model`),children:(0,X.jsx)(`div`,{className:`relative w-full`,children:(0,X.jsx)(P,{type:`text`,value:x,onChange:e=>fe(e.target.value),placeholder:`speaches-ai/Kokoro-82M-v1.0-ONNX`,className:`w-full`})})}),(0,X.jsx)(J,{label:n(`settings.voice.page.field.voice`),description:n(`settings.voice.page.field.voiceIdentifierHint`),children:(0,X.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[(0,X.jsx)(`div`,{className:`relative min-w-0 flex-1`,children:(0,X.jsx)(P,{type:`text`,value:y,onChange:e=>de(e.target.value),placeholder:`af_sky`,className:`w-full`})}),(0,X.jsx)(C,{size:`xs`,variant:`ghost`,onClick:Ze,title:n(`settings.voice.page.actions.preview`),disabled:!g.trim(),children:ze?(0,X.jsx)(O,{name:`stop`,className:`w-3.5 h-3.5`}):(0,X.jsx)(O,{name:`play`,className:`w-3.5 h-3.5`})})]})})]}),s===`local`&&(0,X.jsx)(St,{}),s!==`volcengine`&&(0,X.jsxs)(J,{label:n(`settings.voice.page.field.voice`),children:[s===`local`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(W,{value:String(f),onValueChange:e=>ie(Number.parseInt(e,10)||0),children:[(0,X.jsx)(U,{className:`w-fit`,children:(0,X.jsx)(R,{placeholder:n(`settings.voice.page.field.selectVoicePlaceholder`),children:e=>bt.find(t=>String(t.id)===e)?.label??e})}),(0,X.jsx)(H,{children:bt.map(e=>(0,X.jsx)(B,{value:String(e.id),children:e.label},e.id))})]}),(0,X.jsx)(C,{size:`xs`,variant:`ghost`,onClick:Ee,title:n(`settings.voice.page.actions.preview`),children:we?(0,X.jsx)(O,{name:`stop`,className:`w-3.5 h-3.5`}):(0,X.jsx)(O,{name:`play`,className:`w-3.5 h-3.5`})}),Te?(0,X.jsx)(`span`,{className:`typography-meta text-[var(--status-error)]`,children:Te}):null]}),s===`openai`&&Fe&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(W,{value:m,onValueChange:G,children:[(0,X.jsx)(U,{className:`w-fit`,children:(0,X.jsx)(R,{placeholder:n(`settings.voice.page.field.selectVoicePlaceholder`)})}),(0,X.jsx)(H,{children:Ct.map(e=>(0,X.jsx)(B,{value:e.value,children:e.label},e.value))})]}),(0,X.jsx)(C,{size:`xs`,variant:`ghost`,onClick:Xe,title:n(`settings.voice.page.actions.preview`),children:Le?(0,X.jsx)(O,{name:`stop`,className:`w-3.5 h-3.5`}):(0,X.jsx)(O,{name:`play`,className:`w-3.5 h-3.5`})})]}),s===`openai-compatible`&&(0,X.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:n(`settings.voice.page.field.configuredAbove`)}),s===`say`&&De&&ke.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(W,{value:d,onValueChange:re,children:[(0,X.jsx)(U,{className:`w-fit`,children:(0,X.jsx)(R,{placeholder:n(`settings.voice.page.field.selectVoicePlaceholder`)})}),(0,X.jsx)(H,{children:ke.map(e=>(0,X.jsx)(B,{value:e.name,children:e.name},e.name))})]}),(0,X.jsx)(C,{size:`xs`,variant:`ghost`,onClick:Ye,title:n(`settings.voice.page.actions.preview`),children:je?(0,X.jsx)(O,{name:`stop`,className:`w-3.5 h-3.5`}):(0,X.jsx)(O,{name:`play`,className:`w-3.5 h-3.5`})})]}),s===`browser`&&qe.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(W,{value:p||`$auto`,onValueChange:e=>ae(e===`$auto`?``:e),children:[(0,X.jsx)(U,{className:`w-fit max-w-[200px]`,children:(0,X.jsx)(R,{placeholder:n(`settings.voice.page.field.auto`)})}),(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{value:`$auto`,children:n(`settings.voice.page.field.auto`)}),qe.map(e=>(0,X.jsxs)(B,{value:e.name,children:[e.name,` (`,e.lang,`)`]},e.name))]})]}),(0,X.jsx)(C,{size:`xs`,variant:`ghost`,onClick:Je,title:n(`settings.voice.page.actions.preview`),children:Ge?(0,X.jsx)(O,{name:`stop`,className:`w-3.5 h-3.5`}):(0,X.jsx)(O,{name:`play`,className:`w-3.5 h-3.5`})})]})]}),(0,X.jsxs)(J,{label:n(`settings.voice.page.field.speechRate`),children:[!r&&(0,X.jsx)(`input`,{type:`range`,min:.5,max:2,step:.1,value:c,onChange:e=>z(Number(e.target.value)),className:Qe}),(0,X.jsx)(be,{value:c,onValueChange:z,min:.5,max:2,step:.1,className:`w-16 tabular-nums`})]}),(0,X.jsxs)(J,{label:n(`settings.voice.page.field.speechPitch`),children:[!r&&(0,X.jsx)(`input`,{type:`range`,min:.5,max:2,step:.1,value:l,onChange:e=>V(Number(e.target.value)),className:Qe}),(0,X.jsx)(be,{value:l,onValueChange:V,min:.5,max:2,step:.1,className:`w-16 tabular-nums`})]}),(0,X.jsxs)(J,{label:n(`settings.voice.page.field.speechVolume`),children:[!r&&(0,X.jsx)(`input`,{type:`range`,min:0,max:1,step:.1,value:u,onChange:e=>ne(Number(e.target.value)),className:Qe}),r?(0,X.jsx)(be,{value:Math.round(u*100),onValueChange:e=>ne(e/100),min:0,max:100,step:10,className:`w-16 tabular-nums`}):(0,X.jsxs)(`span`,{className:`typography-ui-label text-foreground tabular-nums min-w-[3rem] text-right`,children:[Math.round(u*100),`%`]})]}),(0,X.jsx)(J,{label:n(`settings.voice.page.field.ttsInputMode`),children:(0,X.jsxs)(W,{value:T,onValueChange:e=>{(e===`final`||e===`sanitized`||e===`raw`||e===`summarized`)&&pe(e)},children:[(0,X.jsx)(U,{className:`w-fit max-w-full`,"aria-label":n(`settings.voice.page.field.ttsInputMode`),children:(0,X.jsx)(R,{children:()=>n(T===`final`?`settings.voice.page.field.ttsInputModeFinal`:T===`raw`?`settings.voice.page.field.ttsInputModeRaw`:T===`summarized`?`settings.voice.page.field.ttsInputModeSummarized`:`settings.voice.page.field.ttsInputModeSanitized`)})}),(0,X.jsx)(H,{children:[[`final`,`settings.voice.page.field.ttsInputModeFinal`,`settings.voice.page.field.ttsInputModeFinalDescription`],[`sanitized`,`settings.voice.page.field.ttsInputModeSanitized`,`settings.voice.page.field.ttsInputModeSanitizedDescription`],[`raw`,`settings.voice.page.field.ttsInputModeRaw`,`settings.voice.page.field.ttsInputModeRawDescription`],[`summarized`,`settings.voice.page.field.ttsInputModeSummarized`,`settings.voice.page.field.ttsInputModeSummarizedDescription`]].map(([e,t,r])=>(0,X.jsx)(B,{value:e,children:(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1 text-left`,children:[(0,X.jsx)(`span`,{children:n(t)}),(0,X.jsx)(`span`,{className:`max-w-64 whitespace-normal typography-meta text-muted-foreground`,children:n(r)})]})},e))})]})})]})]})}),t!==`tts`&&(0,X.jsx)(`div`,{"data-settings-item":`voice.speech-recognition`,children:(0,X.jsxs)(le,{label:n(`settings.voice.page.section.speechRecognition`),actions:(0,X.jsx)(C,{size:`sm`,disabled:o.saving,"aria-busy":o.saving,onClick:()=>{o.saving||o.save()},children:n(`settings.voice.volcengine.save`)}),children:[(0,X.jsx)(J,{label:n(`settings.voice.page.field.enableVoiceInput`),children:(0,X.jsx)(ue,{checked:N,onChange:he,ariaLabel:n(`settings.voice.page.field.enableVoiceInputAria`)})}),N&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(J,{label:(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`span`,{children:n(`settings.voice.page.field.provider`)}),(0,X.jsxs)(I,{children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsx)(O,{name:`information`,className:`h-3.5 w-3.5 text-muted-foreground/60 cursor-help`})}),(0,X.jsx)(te,{sideOffset:8,className:`max-w-xs`,children:(0,X.jsxs)(`ul`,{className:`space-y-1`,children:[(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:n(`settings.voice.page.provider.local`)}),` `,n(`settings.voice.page.tooltip.sttLocal`)]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:n(`settings.voice.page.provider.server`)}),` `,n(`settings.voice.page.tooltip.sttServer`)]})]})})]})]}),children:(0,X.jsxs)(W,{value:E,onValueChange:e=>{(e===`local`||e===`openai-compatible`||e===`volcengine`)&&Z(e)},children:[(0,X.jsx)(U,{"aria-label":n(`settings.voice.page.field.provider`),children:(0,X.jsx)(R,{children:{local:n(`settings.voice.page.provider.local`),volcengine:n(`settings.voice.volcengine.providerOption`),"openai-compatible":n(`settings.voice.page.provider.server`)}[E]})}),(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{value:`volcengine`,children:n(`settings.voice.volcengine.providerOption`)}),(0,X.jsx)(B,{value:`local`,children:n(`settings.voice.page.provider.local`)}),(0,X.jsx)(B,{value:`openai-compatible`,children:n(`settings.voice.page.provider.server`)})]})]})}),E===`volcengine`&&(0,X.jsx)(ht,{mode:`asr`,form:o}),E===`local`&&(0,X.jsx)(J,{label:n(`settings.voice.page.field.model`),className:`yuri-settings-split-row-stacked`,children:(0,X.jsx)(yt,{selectedModelId:j,onSelect:ye})}),E===`openai-compatible`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(J,{label:(0,X.jsx)(`span`,{className:S(!D.trim()&&`text-[var(--status-error)]`),children:n(`settings.voice.page.field.serverUrl`)}),description:n(`settings.voice.page.field.sttServerUrlHint`),children:(0,X.jsxs)(`div`,{className:`relative w-full`,children:[(0,X.jsx)(P,{type:`text`,value:D,onChange:e=>ge(e.target.value),placeholder:`http://localhost:8001/v1`,className:`w-full pr-8`}),D&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>ge(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,X.jsx)(O,{name:`close`,className:`w-3.5 h-3.5`})})]})}),(0,X.jsx)(J,{label:`API Key`,description:`Optional`,children:(0,X.jsxs)(`div`,{className:`relative w-full`,children:[(0,X.jsx)(P,{type:`password`,value:k,onChange:e=>_e(e.target.value),placeholder:e.sttApiKeyConfigured&&o.draft.sttApiKey===void 0?`••••••••`:`sk-...`,className:`w-full pr-8`}),k&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>_e(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,X.jsx)(O,{name:`close`,className:`w-3.5 h-3.5`})})]})}),(0,X.jsx)(J,{label:n(`settings.voice.page.field.model`),children:(0,X.jsx)(`div`,{className:`relative w-full`,children:(0,X.jsx)(P,{type:`text`,value:A,onChange:e=>ve(e.target.value),placeholder:`deepdml/faster-whisper-large-v3-turbo-ct2`,className:`w-full`})})}),(0,X.jsx)(J,{label:n(`settings.voice.page.field.language`),description:n(`settings.voice.page.field.sttLanguageHint`),children:(0,X.jsx)(`div`,{className:`relative w-full`,children:(0,X.jsx)(P,{type:`text`,value:M,onChange:e=>xe(e.target.value),placeholder:`auto`,className:`w-full`})})})]})]})]})})]})};export{xe as a,Z as c,it as i,me as l,gt as n,be as o,ht as r,ge as s,wt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{n as r}from"./vendor-react-DlzBev0S.js";import{f as i}from"./button-CPRnAdlm.js";import{t as a}from"./useThemeSystem-CNzUUkFn.js";var o=r(),s=e(n(),1),c=(0,s.createContext)(null),l=t(),u=e=>{let t=(0,o.c)(22),{className:n,width:r,height:u,isAnimated:d}=e,f=n===void 0?``:n,p=r===void 0?70:r,m=u===void 0?70:u,h=d!==void 0&&d,{t:g}=i(),_=a(),v=s.useContext(c),y=_?_.currentTheme.metadata.variant!==`light`:typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;if(v?.logo){let e=v.logo,n;t[0]===g?n=t[1]:(n=g(`yuriLogo.aria.logo`),t[0]=g,t[1]=n);let r;return t[2]!==v.logo||t[3]!==f||t[4]!==m||t[5]!==n||t[6]!==p?(r=(0,l.jsx)(`img`,{src:e,width:p,height:m,className:f,alt:n,"data-yuri-logo":!0}),t[2]=v.logo,t[3]=f,t[4]=m,t[5]=n,t[6]=p,t[7]=r):r=t[7],r}let b;t[8]===g?b=t[9]:(b=g(`yuriLogo.aria.logo`),t[8]=g,t[9]=b);let x;t[10]===h?x=t[11]:(x=h?(0,l.jsx)(`style`,{children:`@keyframes yuri-logo-breathe{50%{opacity:.65}}.yuri-logo-breathe{animation:yuri-logo-breathe 1.8s ease-in-out infinite}@media(prefers-reduced-motion:reduce){.yuri-logo-breathe{animation:none}}`}):null,t[10]=h,t[11]=x);let S=y?`white`:`black`,C=h?`yuri-logo-breathe`:void 0,w;t[12]!==S||t[13]!==C?(w=(0,l.jsx)(`path`,{fill:S,fillRule:`evenodd`,className:C,d:`M48.34 6.03L47.62 6.07L46.95 6.12L46.64 6.15L46.20 6.21L45.36 6.34L44.97 6.42L44.61 6.48L43.53 6.73L43.27 6.79L43.01 6.86L42.16 7.13L41.77 7.24L41.22 7.41L40.38 7.70L39.25 8.13L38.84 8.30L38.28 8.57L37.62 8.85L37.30 9.01L36.95 9.20L36.25 9.59L35.44 10.06L34.74 10.46L34.40 10.67L33.76 11.16L33.51 11.34L32.95 11.71L32.41 12.10L31.98 12.42L31.81 12.56L31.64 12.71L31.06 13.26L30.53 13.75L29.89 14.37L29.30 14.91L29.11 15.10L28.90 15.33L28.71 15.57L28.17 16.29L27.78 16.77L27.42 17.22L27.26 17.44L26.87 17.99L26.58 18.43L26.27 18.87L25.98 19.32L25.77 19.71L25.04 21.09L24.83 21.54L24.51 22.27L24.32 22.73L24.11 23.31L23.97 23.69L23.84 24.11L23.62 24.79L23.45 25.39L23.37 25.79L23.26 26.22L23.20 26.52L23.10 27.10L23.04 27.49L22.92 28.38L22.88 28.87L22.85 29.36L22.84 29.89L22.83 30.38L22.83 31.01L22.84 31.45L22.87 31.85L22.89 32.21L23.02 33.41L23.08 33.89L23.14 34.20L23.24 34.63L23.36 35.06L23.46 35.50L23.62 36.10L23.79 36.66L23.96 37.16L24.14 37.67L24.41 38.37L24.55 38.70L24.93 39.51L25.38 40.48L25.73 41.20L25.85 41.44L26.10 41.86L26.38 42.32L26.89 43.21L27.25 43.83L27.50 44.30L27.83 44.88L27.96 45.16L28.19 45.65L28.34 46.02L28.52 46.48L28.66 46.90L28.85 47.54L29.02 48.19L29.06 48.41L29.14 48.89L29.23 49.42L29.27 49.82L29.30 50.58L29.30 51.24L29.27 52.09L29.25 52.45L29.23 52.67L29.15 53.38L29.06 53.99L28.78 55.40L28.71 55.79L28.52 56.62L28.36 57.22L28.11 57.93L27.59 59.31L27.47 59.60L27.33 59.88L26.73 61.12L26.64 61.28L26.25 61.92L25.96 62.38L25.53 63.10L25.31 63.44L24.96 63.96L23.92 65.41L23.70 65.69L23.25 66.19L23.05 66.42L22.89 66.64L22.52 67.14L22.14 67.58L21.72 68.10L21.36 68.56L21.25 68.70L21.23 68.74L21.23 68.78L21.26 68.82L21.30 68.83L21.34 68.83L22.18 68.73L23.16 68.63L23.38 68.61L24.10 68.60L25.08 68.60L25.43 68.61L25.97 68.64L26.63 68.72L27.08 68.75L27.25 68.78L28.22 68.92L29.19 69.11L29.41 69.15L30.10 69.33L30.70 69.49L31.08 69.61L31.72 69.81L32.23 69.99L32.97 70.28L33.75 70.61L34.40 70.92L34.80 71.11L35.31 71.38L36.00 71.79L36.55 72.09L36.85 72.28L37.58 72.79L38.10 73.14L38.46 73.41L38.70 73.60L39.82 74.49L40.06 74.68L40.49 75.00L40.77 75.22L41.10 75.52L41.55 75.96L41.98 76.35L42.17 76.53L42.39 76.76L42.72 77.18L42.90 77.38L43.02 77.51L43.47 77.94L43.74 78.24L44.15 78.71L44.64 79.29L44.98 79.71L45.13 79.92L45.26 80.16L45.28 80.20L45.29 80.24L45.27 80.27L45.23 80.29L45.19 80.27L44.95 80.08L44.75 79.90L44.40 79.56L44.07 79.26L43.64 78.87L43.44 78.70L42.77 78.16L42.42 77.89L41.51 77.25L40.74 76.64L39.96 76.05L39.26 75.58L38.54 75.12L37.39 74.44L36.59 73.96L36.31 73.81L35.95 73.63L34.83 73.09L33.89 72.67L33.57 72.52L33.11 72.34L31.78 71.84L31.61 71.78L31.23 71.66L30.79 71.55L29.81 71.27L29.20 71.11L29.03 71.07L28.33 70.93L27.71 70.84L27.32 70.77L27.10 70.74L26.83 70.71L26.39 70.68L25.86 70.61L25.28 70.57L24.96 70.56L24.52 70.56L24.03 70.56L23.76 70.58L23.10 70.64L22.30 70.73L22.08 70.76L21.15 70.92L20.72 71.03L20.33 71.12L19.74 71.31L19.15 71.51L18.77 71.64L18.40 71.80L17.87 72.03L17.71 72.11L17.55 72.20L17.21 72.41L16.74 72.75L16.22 73.09L15.90 73.33L15.61 73.54L15.30 73.80L14.97 74.09L14.52 74.53L14.27 74.78L13.90 75.23L13.34 75.92L13.09 76.24L12.89 76.53L12.31 77.49L12.16 77.76L12.06 77.96L11.97 78.16L11.86 78.45L11.84 78.49L11.84 78.54L11.85 78.58L11.88 78.61L11.93 78.62L12.88 78.37L13.40 78.26L14.01 78.14L14.54 78.03L14.84 77.97L15.59 77.87L16.57 77.77L17.32 77.67L17.50 77.66L17.72 77.65L18.52 77.63L19.82 77.63L20.58 77.63L21.87 77.67L22.31 77.70L22.62 77.72L23.65 77.82L24.00 77.86L24.57 77.95L25.24 78.04L25.98 78.16L26.42 78.24L26.91 78.33L27.26 78.39L27.65 78.47L28.13 78.56L28.57 78.67L28.96 78.74L29.31 78.83L29.74 78.92L30.12 79.04L30.94 79.26L31.54 79.44L32.18 79.64L32.98 79.91L33.79 80.15L33.96 80.21L35.30 80.71L36.63 81.22L37.04 81.39L37.58 81.60L38.49 81.98L39.48 82.39L39.92 82.59L40.36 82.81L40.60 82.92L41.18 83.18L41.92 83.49L42.44 83.73L42.84 83.92L43.73 84.34L44.42 84.66L45.15 85.00L45.51 85.18L46.29 85.60L46.66 85.77L47.13 86.01L47.74 86.29L48.22 86.52L49.54 87.17L50.10 87.46L50.94 87.87L52.09 88.45L53.85 89.22L54.05 89.31L54.52 89.56L54.88 89.74L55.21 89.89L55.58 90.05L56.65 90.50L57.21 90.77L57.70 90.99L58.15 91.17L58.48 91.31L58.94 91.47L59.54 91.67L59.92 91.79L60.30 91.92L60.88 92.13L61.59 92.40L62.01 92.55L62.78 92.78L63.99 93.10L64.68 93.28L65.12 93.37L65.55 93.47L66.25 93.62L67.39 93.81L67.75 93.85L68.06 93.88L69.17 93.95L69.70 93.99L70.02 94.00L70.24 93.99L70.28 93.98L70.32 93.96L70.31 93.92L70.28 93.89L70.21 93.84L70.09 93.79L69.55 93.57L69.06 93.35L68.46 93.06L66.66 92.08L66.00 91.71L65.73 91.55L65.35 91.31L64.91 91.01L64.23 90.58L63.75 90.25L63.32 89.94L63.03 89.73L61.99 88.89L61.42 88.46L61.01 88.12L60.74 87.88L60.22 87.39L59.66 86.82L59.10 86.24L58.62 85.78L58.43 85.59L58.24 85.40L57.95 85.06L57.51 84.56L57.09 84.04L56.42 83.25L56.03 82.77L55.87 82.56L55.64 82.23L55.40 81.91L54.98 81.28L54.78 80.98L54.25 80.10L54.00 79.68L53.37 78.55L53.20 78.23L52.81 77.43L52.64 77.07L52.48 76.66L52.12 75.69L51.96 75.23L51.85 74.89L51.76 74.60L51.60 74.04L51.41 73.21L51.34 72.82L51.25 72.38L51.14 71.77L50.98 71.03L50.79 70.29L50.61 69.65L50.45 69.14L50.26 68.59L50.00 67.97L49.91 67.77L49.82 67.61L49.60 67.23L49.21 66.63L49.05 66.42L48.85 66.17L48.71 66.00L48.56 65.84L48.18 65.46L47.95 65.25L47.74 65.08L46.72 64.29L46.52 64.11L46.12 63.75L45.29 62.94L45.10 62.75L44.65 62.26L44.37 61.91L43.99 61.41L43.64 60.90L43.38 60.48L43.16 60.10L43.03 59.86L42.63 59.06L42.31 58.33L42.23 58.12L42.16 57.91L42.15 57.87L42.15 57.82L42.17 57.78L42.21 57.77L42.25 57.78L42.32 57.84L42.41 57.94L42.49 58.04L42.67 58.30L42.80 58.48L43.19 58.96L43.99 59.86L44.18 60.05L44.38 60.24L44.55 60.38L45.02 60.78L45.97 61.60L46.35 61.91L46.63 62.13L46.99 62.39L47.56 62.75L47.79 62.88L49.13 63.59L49.77 63.91L50.54 64.27L51.31 64.62L51.59 64.74L51.97 64.89L53.02 65.27L53.77 65.53L54.40 65.77L55.12 66.01L55.67 66.18L56.58 66.42L57.52 66.70L59.15 67.14L59.84 67.35L60.30 67.51L60.75 67.69L60.96 67.78L61.20 67.90L61.40 68.00L61.59 68.11L61.81 68.26L62.10 68.47L62.28 68.61L62.41 68.72L62.66 68.97L62.81 69.14L62.93 69.28L63.06 69.46L63.21 69.68L64.12 71.16L64.32 71.46L64.45 71.64L64.65 71.88L65.19 72.53L65.49 72.86L65.84 73.20L66.11 73.44L66.31 73.61L66.91 74.08L67.41 74.45L67.67 74.63L68.04 74.87L68.23 74.98L68.28 74.99L68.32 74.97L68.32 74.92L68.32 74.88L68.31 74.84L68.23 74.67L67.56 73.27L67.47 73.06L67.27 72.52L67.16 72.23L66.93 71.46L66.89 71.28L66.85 71.06L66.81 70.75L66.79 70.49L66.78 70.27L66.77 70.00L66.77 69.60L66.78 69.37L66.81 68.97L66.84 68.71L66.90 68.40L66.95 68.14L67.06 67.75L67.12 67.54L67.27 67.12L67.44 66.66L67.51 66.49L67.61 66.29L67.98 65.58L68.38 64.78L68.51 64.50L68.57 64.38L68.64 64.27L68.74 64.12L68.77 64.09L68.81 64.08L68.85 64.11L68.86 64.16L68.85 64.20L68.83 64.33L68.79 64.46L68.73 64.67L68.60 65.05L68.51 65.35L68.39 65.78L68.33 66.04L68.21 66.61L68.07 67.49L68.01 67.98L67.98 68.29L67.96 68.87L67.96 69.31L67.98 69.76L68.01 70.11L68.06 70.47L68.18 71.03L68.22 71.21L68.37 71.72L68.43 71.89L68.53 72.14L68.75 72.63L68.93 72.98L69.39 73.80L69.56 74.11L69.75 74.51L70.07 75.20L70.25 75.71L70.69 76.97L71.04 77.88L71.14 78.18L71.28 78.65L71.46 79.20L71.58 79.54L71.69 79.78L71.78 79.98L71.94 80.30L72.22 80.81L72.62 81.56L72.82 81.91L72.98 82.17L73.30 82.66L73.62 83.14L73.81 83.39L74.24 83.96L74.41 84.17L74.58 84.37L74.83 84.63L75.05 84.84L75.26 85.02L75.30 85.04L75.34 85.05L75.37 85.02L75.37 84.98L75.36 84.94L75.24 84.65L74.99 84.08L74.62 83.21L74.43 82.67L74.06 81.57L73.92 81.01L73.69 79.91L73.57 79.26L73.52 78.90L73.37 77.53L73.33 77.17L73.32 76.86L73.29 76.06L73.28 75.75L73.29 75.44L73.32 74.81L73.34 74.55L73.57 72.78L73.69 72.07L73.82 71.46L73.98 70.54L74.02 70.28L74.10 69.70L74.17 69.04L74.20 68.64L74.22 68.14L74.21 67.83L74.20 67.61L74.19 67.39L74.14 66.99L74.01 66.20L73.95 65.94L73.83 65.51L73.67 65.05L73.51 64.68L73.27 64.19L72.81 63.28L72.70 63.04L72.65 62.91L72.59 62.75L72.54 62.53L72.51 62.35L72.50 62.18L72.50 62.00L72.50 61.86L72.52 61.69L72.55 61.56L72.58 61.43L72.65 61.26L72.72 61.10L72.81 60.94L72.93 60.76L73.02 60.66L73.11 60.56L73.31 60.38L73.69 60.08L73.82 59.95L73.93 59.82L73.98 59.74L74.02 59.66L74.06 59.58L74.10 59.46L74.12 59.33L74.14 59.24L74.14 59.15L74.14 59.06L74.12 58.97L74.09 58.84L74.05 58.72L74.02 58.63L73.96 58.52L73.91 58.44L73.83 58.33L73.78 58.27L73.68 58.18L73.61 58.13L73.53 58.08L73.45 58.05L73.28 58.00L73.06 57.97L72.74 57.96L72.48 57.97L72.25 57.99L71.86 58.03L71.59 58.08L70.33 58.35L70.11 58.41L69.47 58.59L69.17 58.69L68.58 58.87L68.44 58.89L68.31 58.91L68.27 58.90L68.25 58.87L68.26 58.83L68.28 58.80L68.46 58.66L68.67 58.50L68.93 58.32L69.20 58.16L69.59 57.95L69.79 57.85L70.00 57.76L70.20 57.69L71.26 57.34L71.78 57.19L71.95 57.15L72.56 57.02L72.78 56.98L73.14 56.94L73.71 56.90L73.85 56.88L73.97 56.85L74.10 56.81L74.22 56.75L74.34 56.69L74.46 56.62L74.57 56.55L74.67 56.47L74.77 56.38L74.83 56.31L74.89 56.25L74.97 56.14L75.05 55.98L75.11 55.81L75.13 55.73L75.15 55.60L75.16 55.46L75.16 55.33L75.14 54.93L75.10 54.49L75.07 54.31L75.05 54.18L75.00 54.01L74.92 53.80L74.85 53.64L74.76 53.48L74.61 53.26L74.44 53.05L74.23 52.82L73.98 52.57L73.89 52.47L73.86 52.43L73.85 52.39L73.86 52.35L73.88 52.31L73.92 52.29L73.96 52.28L74.09 52.26L74.27 52.26L74.58 52.26L74.94 52.29L75.11 52.31L75.29 52.35L75.59 52.41L75.94 52.48L76.51 52.61L76.86 52.67L77.17 52.70L77.48 52.72L77.75 52.71L77.97 52.68L78.19 52.64L78.36 52.59L78.53 52.53L78.69 52.45L78.85 52.37L79.00 52.27L79.10 52.19L79.20 52.10L79.29 52.00L79.36 51.89L79.45 51.73L79.50 51.61L79.54 51.48L79.57 51.35L79.58 51.22L79.57 51.09L79.56 50.91L79.53 50.78L79.50 50.65L79.36 50.13L79.25 49.75L79.13 49.27L78.88 48.47L78.48 47.14L78.34 46.72L78.08 45.86L77.99 45.57L77.89 45.22L77.64 44.41L77.48 43.86L77.37 43.42L77.27 43.08L77.11 42.48L76.94 41.83L76.86 41.44L76.77 41.09L76.69 40.66L76.56 40.09L76.39 39.21L76.25 38.47L76.18 38.16L76.14 38.04L76.08 37.87L75.99 37.72L75.88 37.53L75.59 37.13L75.39 36.88L75.28 36.75L75.04 36.49L74.65 36.12L74.48 35.97L74.30 35.84L73.80 35.47L73.35 35.17L72.97 34.95L72.42 34.66L71.81 34.38L70.44 33.83L69.90 33.62L69.39 33.45L68.28 33.11L67.77 32.98L67.64 32.93L67.48 32.86L67.44 32.84L67.41 32.81L67.41 32.78L67.44 32.75L67.49 32.74L67.71 32.73L67.98 32.74L68.20 32.77L68.82 32.86L69.30 32.93L70.14 33.07L70.84 33.21L71.10 33.28L72.17 33.58L72.72 33.75L72.94 33.81L73.44 33.99L73.65 34.07L73.86 34.15L74.54 34.48L74.94 34.67L75.30 34.86L75.69 35.08L75.99 35.27L76.28 35.48L76.58 35.74L76.98 36.10L77.21 36.30L77.32 36.38L77.40 36.40L77.48 36.41L77.56 36.39L77.63 36.35L77.74 36.28L77.84 36.19L77.96 36.06L78.07 35.92L78.14 35.80L78.20 35.69L78.26 35.56L78.30 35.44L78.33 35.31L78.35 35.18L78.36 35.04L78.34 34.73L78.31 34.51L78.28 34.34L78.03 33.25L77.92 32.64L77.82 32.20L77.79 32.02L77.77 31.80L77.72 31.27L77.65 30.16L77.57 29.18L77.39 27.94L77.36 27.72L77.28 27.33L77.20 26.89L77.04 26.20L77.00 26.02L76.85 25.51L76.69 24.95L76.49 24.36L76.40 24.11L76.31 23.81L76.23 23.60L76.14 23.39L76.05 23.19L75.61 22.27L75.23 21.51L74.93 20.96L74.38 19.99L73.64 18.82L73.18 18.17L72.96 17.89L72.11 16.91L71.27 15.87L70.77 15.30L70.49 15.02L70.16 14.71L69.60 14.20L69.17 13.81L68.94 13.60L68.54 13.25L68.16 12.94L67.75 12.59L67.54 12.42L67.22 12.18L66.68 11.79L65.94 11.29L65.20 10.79L64.71 10.48L64.05 10.10L62.65 9.33L62.29 9.14L62.01 9.01L61.73 8.87L60.87 8.51L60.34 8.27L59.93 8.08L59.61 7.94L59.15 7.77L58.13 7.42L57.79 7.32L57.50 7.23L56.86 7.03L56.26 6.86L55.39 6.64L54.74 6.49L54.34 6.42L53.86 6.33L53.29 6.24L52.58 6.15L52.36 6.12L51.11 6.04L50.53 6.01L50.13 6.00L49.38 6.00L48.66 6.01ZM84.78 23.79L84.64 23.81L84.51 23.84L84.08 23.95L83.87 24.03L83.63 24.14L83.51 24.21L83.40 24.28L83.18 24.44L82.99 24.62L82.84 24.79L82.66 25.04L82.52 25.27L82.46 25.39L82.39 25.55L82.33 25.72L82.28 25.84L82.18 26.23L82.13 26.49L82.12 26.63L82.11 26.76L82.12 26.89L82.13 27.07L82.15 27.20L82.18 27.38L82.23 27.60L82.28 27.77L82.36 27.98L82.49 28.26L82.55 28.38L82.62 28.49L82.70 28.60L82.79 28.70L82.97 28.90L83.07 28.99L83.20 29.10L83.42 29.26L83.54 29.32L83.66 29.39L84.06 29.57L84.19 29.61L84.32 29.65L84.58 29.70L84.71 29.72L84.84 29.73L85.16 29.74L85.33 29.73L85.47 29.71L85.82 29.65L86.03 29.60L86.16 29.55L86.36 29.47L86.61 29.35L86.76 29.26L86.91 29.16L87.16 28.98L87.43 28.74L87.52 28.65L87.61 28.55L87.73 28.36L87.88 28.09L87.99 27.84L88.04 27.67L88.08 27.55L88.13 27.28L88.15 27.11L88.16 26.97L88.16 26.66L88.14 26.35L88.10 26.09L88.07 25.95L88.03 25.83L87.92 25.53L87.87 25.41L87.78 25.25L87.72 25.14L87.64 25.03L87.48 24.82L87.29 24.63L87.08 24.46L86.83 24.28L86.59 24.15L86.35 24.04L86.10 23.95L85.62 23.83L85.40 23.79L85.27 23.78L85.09 23.77L84.91 23.78ZM63.90 37.84L63.95 37.83L63.99 37.83L64.15 37.92L64.63 38.23L65.01 38.47L65.60 38.87L66.10 39.16L66.54 39.39L66.78 39.50L67.02 39.61L67.44 39.77L68.36 40.10L68.88 40.25L69.05 40.30L69.22 40.34L69.92 40.46L70.15 40.49L70.37 40.52L71.66 40.61L72.15 40.63L72.59 40.62L72.68 40.63L72.72 40.65L72.75 40.68L72.77 40.72L72.76 40.77L72.74 40.81L72.71 40.84L72.60 40.91L72.41 41.03L72.22 41.13L72.01 41.22L71.68 41.35L71.51 41.41L71.00 41.56L70.87 41.59L70.65 41.62L70.25 41.67L69.98 41.69L69.63 41.68L69.31 41.66L69.00 41.62L68.83 41.59L68.66 41.55L68.11 41.37L67.78 41.24L67.41 41.07L67.09 40.91L66.82 40.76L66.63 40.64L66.45 40.51L65.95 40.13L65.68 39.90L65.38 39.64L65.05 39.33L64.77 39.04L64.51 38.74L64.11 38.26L63.92 38.01L63.90 37.98L63.88 37.93L63.88 37.89Z`}),t[12]=S,t[13]=C,t[14]=w):w=t[14];let T;return t[15]!==f||t[16]!==m||t[17]!==b||t[18]!==x||t[19]!==w||t[20]!==p?(T=(0,l.jsxs)(`svg`,{width:p,height:m,viewBox:`0 0 100 100`,xmlns:`http://www.w3.org/2000/svg`,className:f,role:`img`,"aria-label":b,"data-yuri-logo":!0,children:[x,w]}),t[15]=f,t[16]=m,t[17]=b,t[18]=x,t[19]=w,t[20]=p,t[21]=T):T=t[21],T};export{c as n,u as t};
|