@yuriai/web 0.3.2-beta.1 → 0.3.2-beta.3
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/dist/assets/{AgentAvatar-B4_d0rQt.js → AgentAvatar-DEFsZEmz.js} +1 -1
- package/dist/assets/AssistantConversationSurface-Dv5EUOyi.js +3 -0
- package/dist/assets/AssistantSessionCard-Bltga-i7.js +2 -0
- package/dist/assets/{AssistantUnreadBadge-DzxFnL8M.js → AssistantUnreadBadge-CTXv15Hu.js} +1 -1
- package/dist/assets/{AssistantView-TODFoL2I.js → AssistantView-jFFTgQjt.js} +1 -1
- package/dist/assets/{DiagramView-x3sdXc97.js → DiagramView-BWmLp7hy.js} +1 -1
- package/dist/assets/{FadeInOnReveal-C5qpH3TY.js → FadeInOnReveal-CAUN0CLN.js} +1 -1
- package/dist/assets/{GuiPluginPage-D5ajS2AA.js → GuiPluginPage-C-ba8EBi.js} +1 -1
- package/dist/assets/{GuiPluginSurface-bwXAUscV.js → GuiPluginSurface-BXD7VSy-.js} +1 -1
- package/dist/assets/{GuiPluginWindow-SsWHnc4g.js → GuiPluginWindow-DrBQ8ig5.js} +1 -1
- package/dist/assets/{Icon-DBOSvb4U.js → Icon-CWw2bUr_.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-CrJp1f5y.js → ImageLoadingPlaceholder-BunwTGdg.js} +1 -1
- package/dist/assets/{LoadingImage-zXRrm9H9.js → LoadingImage-BwuyM06-.js} +1 -1
- package/dist/assets/{MarkdownRenderer-eeOXke_U.js → MarkdownRenderer-DBiJPyID.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-BeJCqK7P.js → MarkdownRendererImpl-DVYVKsuL.js} +2 -2
- package/dist/assets/{MarkstreamRendererImpl-DOYwdhQ_.js → MarkstreamRendererImpl-DZX9o9OO.js} +2 -2
- package/dist/assets/{MobileDetailNavigation-DVbLG15P.js → MobileDetailNavigation-CYqota_p.js} +1 -1
- package/dist/assets/{MobileResizableSheet-WTfrQdK8.js → MobileResizableSheet-Be4ev9vj.js} +1 -1
- package/dist/assets/{MobileShareBridge-CgVEGvAL.js → MobileShareBridge-CbtO4v1w.js} +1 -1
- package/dist/assets/MobileSurface-BsNRnAku.js +2 -0
- package/dist/assets/{MultiRunWindow-CMBcfCOh.js → MultiRunWindow-lwPMnpaH.js} +1 -1
- package/dist/assets/{OnboardingScreen-DLMYQLFn.js → OnboardingScreen-CNLtVzgH.js} +1 -1
- package/dist/assets/{OverlayScrollbar-CwmXL6W2.js → OverlayScrollbar-dFYzZtN7.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-vCSOg3_8.js → RemoteAssistantSessionCard-BJYmBRJm.js} +1 -1
- package/dist/assets/{SettingsView-DeS2ph7b.js → SettingsView-CHApPouO.js} +13 -13
- package/dist/assets/{SettingsWindow-CBh8oudq.js → SettingsWindow-lhGgHfD5.js} +1 -1
- package/dist/assets/{SetupTourDialog-C6SfskP3.js → SetupTourDialog-B46Tyvcn.js} +1 -1
- package/dist/assets/{TerminalView-CJDYSJWP.js → TerminalView-D8V8eOVt.js} +1 -1
- package/dist/assets/ToolOutputDialog-Cwlx7FjV.js +16 -0
- package/dist/assets/{VoiceSettings-C-W8KWvQ.js → VoiceSettings-CB9qkMjr.js} +2 -2
- package/dist/assets/{YuriLogo-VXtP1vhh.js → YuriLogo-DNvrroBa.js} +1 -1
- package/dist/assets/{YuriWordmark-B7lmpLRB.js → YuriWordmark-bJX68f2Y.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-D-LmCflm.js → assistant-attachment-cache-zu9sz4ex.js} +1 -1
- package/dist/assets/{capgoAdapter-vPx0i-Ad.js → capgoAdapter-DmQmlaD4.js} +1 -1
- package/dist/assets/{checkbox-QxG9Mpbu.js → checkbox-BF6Ew27G.js} +1 -1
- package/dist/assets/{client-1Fk5IbQR.js → client-CgAFd1ew.js} +1 -1
- package/dist/assets/{collapsible-BvteRbPh.js → collapsible-D6SmW6dp.js} +1 -1
- package/dist/assets/context-menu-0FkJFPFb.js +1 -0
- package/dist/assets/{device-QL8KNSLM.js → device-C8ZHblkr.js} +1 -1
- package/dist/assets/{diagram-D6B_k7M5.js → diagram-BBuHtBwt.js} +1 -1
- package/dist/assets/dialog-Ctkzc2Zz.js +1 -0
- package/dist/assets/dialog-DYOEW9DC.css +1 -0
- package/dist/assets/{fileMentionTouchSelection-DiKjZQEm.js → fileMentionTouchSelection-Ctt4StcZ.js} +1 -1
- package/dist/assets/{fileReferenceActions-cYqdsXFz.js → fileReferenceActions-DX-Stroq.js} +1 -1
- package/dist/assets/{gitApi-CtJXK0WM.js → gitApi-DBBc9J6o.js} +1 -1
- package/dist/assets/{gitApiHttp-B0FJaIhU.js → gitApiHttp-BEMPJCIG.js} +1 -1
- package/dist/assets/{historyImportQueries-D_9RlrLp.js → historyImportQueries-eR7Bj6VN.js} +1 -1
- package/dist/assets/{host-Bx9gj-ju.js → host-iM7aLAip.js} +1 -1
- package/dist/assets/{i18n-qHllte6P.js → i18n-OsFhnlRH.js} +1 -1
- package/dist/assets/{image-loading-DBqnxgDH.js → image-loading-ZB1bYt51.js} +1 -1
- package/dist/assets/{input-C16jIASm.js → input-dbArHWaP.js} +1 -1
- package/dist/assets/{input-store-CsY-uaSj.js → input-store-DRTu4uZc.js} +1 -1
- package/dist/assets/{insertionBoundaries-62IwW9Ka.js → insertionBoundaries-BGTaMvws.js} +1 -1
- package/dist/assets/{main-DZedJhQx.js → main-BF3h13M0.js} +2 -2
- package/dist/assets/main-D-BEO915.js +169 -0
- package/dist/assets/{markdownHeightCache-CDcoG7oI.js → markdownHeightCache-B9zDETOW.js} +1 -1
- package/dist/assets/{markdownTheme-DFDWa8Gh.js → markdownTheme-C2LJ3cJo.js} +1 -1
- package/dist/assets/{mcpQueries-CQjcxaDQ.js → mcpQueries-CVzK-E8k.js} +1 -1
- package/dist/assets/miniChat-DaSVRLIT.js +2 -0
- package/dist/assets/mobile-BxYzuzvw.js +2 -0
- package/dist/assets/{mobileBackNavigation-BPncsZvR.js → mobileBackNavigation-CKLNMUuZ.js} +1 -1
- package/dist/assets/mobileConnections-TY8B_vJJ.js +2 -0
- package/dist/assets/{multirun-B5DvrZRF.js → multirun-YEb0yxyy.js} +1 -1
- package/dist/assets/{native-config-1ijMxxRj.js → native-config-iKs3QC84.js} +1 -1
- package/dist/assets/{navigation-guYHqUd5.js → navigation-DwodsHzA.js} +2 -2
- package/dist/assets/openRemoteProjectSession-B7tp7K6E.js +1 -0
- package/dist/assets/{project-preview-2H-TmJkd.js → project-preview-BhNspxqe.js} +1 -1
- package/dist/assets/projectMeta-b96xwStQ.js +1 -0
- package/dist/assets/{prompt-attachment-upload-9fjmgafL.js → prompt-attachment-upload-8bssUUT3.js} +1 -1
- package/dist/assets/pwa-CXclRR5h.js +2 -0
- package/dist/assets/{queue-abort-optimistic-BuYzwR0N.js → queue-abort-optimistic-CxSpYsNp.js} +1 -1
- package/dist/assets/{react-DEouUmkV.js → react-BcKSvwr4.js} +1 -1
- package/dist/assets/{readiness-CzHlOvNr.js → readiness-CjM_fPUz.js} +2 -2
- package/dist/assets/{reference-history-Dyzfrmw-.js → reference-history-BhDcCRSh.js} +1 -1
- package/dist/assets/{remote-input-store-84i8uDyM.js → remote-input-store-DFBMyVS-.js} +1 -1
- package/dist/assets/{remoteProjectQueries-Dfms-cCx.js → remoteProjectQueries-8giIAvzL.js} +1 -1
- package/dist/assets/{remoteSessionReference-CqNXv4Qg.js → remoteSessionReference-CcAQSJBP.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-S8GzGGR7.js → renderElectronMiniChatApp-D7LRyQ0q.js} +2 -2
- package/dist/assets/renderMobileApp-CoKCXfEA.js +29 -0
- package/dist/assets/{runtime-file-download-D11Nnedg.js → runtime-file-download-Dc459c9e.js} +1 -1
- package/dist/assets/{runtime-file-resource-CuLP3xp7.js → runtime-file-resource-DnhWnndu.js} +1 -1
- package/dist/assets/{runtimeConfig-oElsA8Cz.js → runtimeConfig-XD_Q8p-7.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-BUGfn7y0.css → runtimeEndpointReset-BIrMtGn5.css} +1 -1
- package/dist/assets/{runtimeEndpointReset-DT9dHdmQ.js → runtimeEndpointReset-CLOWf55R.js} +9 -9
- package/dist/assets/{scheduledTaskNavigation-y5g8D2ee.js → scheduledTaskNavigation-Bi7sRiFW.js} +1 -1
- package/dist/assets/{select-DpKqX1V6.js → select-DpIon12c.js} +1 -1
- package/dist/assets/{sessionLookup-BHJgGHf0.js → sessionLookup-Bgl1T8Xy.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-a2sshnFf.js → sortable-tabs-strip-BNUSKRdi.js} +1 -1
- package/dist/assets/{speechSettingsQueries-DKesZuQ3.js → speechSettingsQueries-Qp_K7NEi.js} +1 -1
- package/dist/assets/src-DRyZ4dLj.css +2 -0
- package/dist/assets/{store-BOD3jjMl.js → store-Dj5cSf8B.js} +1 -1
- package/dist/assets/{terminalApi-Cq0vjFe1.js → terminalApi-eR_918UZ.js} +1 -1
- package/dist/assets/{textarea-DPrUh2E_.js → textarea-Cl9UwJTL.js} +1 -1
- package/dist/assets/{tooltip-JO7-ziD9.js → tooltip-Pge3VQEi.js} +1 -1
- package/dist/assets/{types-CxdhW05G.js → types-zQujo_Lh.js} +1 -1
- package/dist/assets/{useAppFontEffects-DhmTAaeq.js → useAppFontEffects-CA0RAFjg.js} +62 -61
- package/dist/assets/{useAssistantUIStore-jOKVcBK8.js → useAssistantUIStore-CphyXHEY.js} +1 -1
- package/dist/assets/{useDesktopWindowControlsLayout-C3Bhl4tF.js → useDesktopWindowControlsLayout-xvFTC44C.js} +1 -1
- package/dist/assets/{useDictation-De8WB_Z7.js → useDictation-Do12BpsS.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DsQiUzq0.js → useEffectiveDirectory-DUB24zcV.js} +1 -1
- package/dist/assets/{useFontPreferences-CO-L-Gd7.js → useFontPreferences-DFF-uEAD.js} +1 -1
- package/dist/assets/{useMobileHtmlPreviewStore-EOAzZiAy.js → useMobileHtmlPreviewStore-DUquFMmd.js} +1 -1
- package/dist/assets/useMobileNavigationStore-CU0KrVK0.js +13 -0
- package/dist/assets/{usePluginsStore-nTVPoJCl.js → usePluginsStore-Cdk11zAA.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-CHhK626l.js → useProjectRuntimeAPIs-LShklsHL.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-CNJGj-_8.js → useStreamingTextThrottle-4QIDm_ui.js} +1 -1
- package/dist/assets/{useThemeSystem-C57Z9mV2.js → useThemeSystem-D2YBbLma.js} +1 -1
- package/dist/assets/{useUIStore-Cfmg-aDQ.js → useUIStore-CYex4rbF.js} +1 -1
- package/dist/assets/{vendor-base-ui-z2M4boRm.js → vendor-base-ui-fom6orB6.js} +1 -1
- package/dist/assets/{vendor-cmdk-BgHvMv5l.js → vendor-cmdk-BKc6RGpL.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-accessibility-gVi9ga0x.js → vendor-dnd-kit-accessibility-Cf9EEJvm.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-core-Dd5yS2-T.js → vendor-dnd-kit-core-DRyd7I0I.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-sortable-CV-SGi8y.js → vendor-dnd-kit-sortable-C8S8cyRO.js} +1 -1
- package/dist/assets/{vendor-framer-motion-CF9BQLta.js → vendor-framer-motion-DiGWHm7K.js} +1 -1
- package/dist/assets/{vendor-markstream-react-TwEpkgfP.js → vendor-markstream-react-Cwc-VXWM.js} +3 -3
- package/dist/assets/vendor-motion-DtmZZeEm.js +1 -0
- package/dist/assets/{vendor-pierre-diffs-tqo4Z3TC.js → vendor-pierre-diffs-HJfPTtu2.js} +1 -1
- package/dist/assets/{vendor-react-P8wFrkcT.js → vendor-react-D5BntRmA.js} +1 -1
- package/dist/assets/{vendor-react-drawio-CQW1YP2l.js → vendor-react-drawio-DXADKcSU.js} +1 -1
- package/dist/assets/{vendor-reactuses-core-Dyjw5sZR.js → vendor-reactuses-core-B8s-Rcd-.js} +1 -1
- package/dist/assets/{vendor-sonner-B5HgJenP.js → vendor-sonner-Y-KPX915.js} +1 -1
- package/dist/assets/{vendor-stream-diffs-DCMtZcS3.js → vendor-stream-diffs-BMT21f-n.js} +2 -2
- package/dist/assets/{vendor-tanstack-react-query-B-KblYBV.js → vendor-tanstack-react-query-ChSd65dm.js} +1 -1
- package/dist/assets/{vendor-tanstack-react-virtual-BkuqzrEV.js → vendor-tanstack-react-virtual-WY42p6U6.js} +1 -1
- package/dist/assets/{vendor-zustand-Cwko4FG1.js → vendor-zustand-CNn3HHhT.js} +1 -1
- package/dist/index.html +19 -19
- package/dist/mini-chat.html +19 -19
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/server/lib/notifications/DOCUMENTATION.md +11 -1
- package/server/lib/notifications/session-unread-store.js +20 -6
- package/server/lib/notifications/session-unread.test.js +80 -0
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +14 -5
- package/server/lib/scheduled-tasks/runtime.js +29 -25
- package/server/lib/scheduled-tasks/runtime.test.js +88 -1
- package/dist/assets/AssistantConversationSurface-BlrOfc3x.js +0 -3
- package/dist/assets/AssistantSessionCard-B7cmrLAe.js +0 -2
- package/dist/assets/MobileSurface-BL4nGTY5.js +0 -2
- package/dist/assets/ToolOutputDialog-DF8dWVTm.js +0 -16
- package/dist/assets/context-menu-BYPUMFAX.js +0 -1
- package/dist/assets/dialog-BfjbsTOP.js +0 -1
- package/dist/assets/dialog-CTYD3Sbr.css +0 -1
- package/dist/assets/main-CAyhodbD.js +0 -169
- package/dist/assets/miniChat-DFXcicxI.js +0 -2
- package/dist/assets/mobile-CKNvVIUj.js +0 -2
- package/dist/assets/mobileConnections-BBNhczt8.js +0 -2
- package/dist/assets/openRemoteProjectSession-Dvg3pCz-.js +0 -1
- package/dist/assets/projectMeta-BOcz1XpN.js +0 -1
- package/dist/assets/pwa-D4vcI8VD.js +0 -2
- package/dist/assets/renderMobileApp-Bbs497wM.js +0 -29
- package/dist/assets/src-INJJ62RE.css +0 -2
- package/dist/assets/useMobileNavigationStore-2N3dS8vX.js +0 -13
- package/dist/assets/vendor-motion-Dv27UnOI.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-z2M4boRm.js";import{n as r}from"./vendor-react-P8wFrkcT.js";import{t as i}from"./i18n-qHllte6P.js";import{t as a}from"./useThemeSystem-C57Z9mV2.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};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-fom6orB6.js";import{n as r}from"./vendor-react-D5BntRmA.js";import{t as i}from"./i18n-OsFhnlRH.js";import{t as a}from"./useThemeSystem-D2YBbLma.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-hePW80VL.js";import{c as e,s as t}from"./runtime-switch-BMjl5Y5W.js";import{a as n,i as r}from"./vendor-zustand-
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{c as e,s as t}from"./runtime-switch-BMjl5Y5W.js";import{a as n,i as r}from"./vendor-zustand-CNn3HHhT.js";import{ot as i,st as a}from"./vendor-base-ui-fom6orB6.js";import{vr as o}from"./client-CgAFd1ew.js";import{n as s}from"./vendor-react-D5BntRmA.js";var c=n()(r(e=>({progress:{},openedRuntime:null,open:t=>e(e=>({openedRuntime:t,progress:{...e.progress,[t]:e.progress[t]??{step:0,dismissed:!1}}})),move:(t,n)=>e(e=>({progress:{...e.progress,[t]:{step:n,dismissed:e.progress[t]?.dismissed??!1}}})),dismiss:t=>e(e=>({openedRuntime:e.openedRuntime===t?null:e.openedRuntime,progress:{...e.progress,[t]:{step:e.progress[t]?.step??0,dismissed:!0}}}))}),{name:`yuri-setup-tour`,version:1,migrate:e=>({progress:Object.fromEntries(Object.entries(e?.progress??{}).map(([e,t])=>[e,t&&typeof t==`object`?{...t,step:t.step===2?3:t.step}:t]))}),storage:o(),partialize:e=>({progress:e.progress}),merge:(e,t)=>{let n=e,r={};if(n?.progress&&typeof n.progress==`object`)for(let[e,t]of Object.entries(n.progress))t&&[0,1,2,3].includes(t.step)&&typeof t.dismissed==`boolean`&&(r[e]={step:t.step,dismissed:t.dismissed});return{...t,progress:r,openedRuntime:null}}}));e(e=>{t(e)&&c.persist.rehydrate()}),a();var l=s(),u=`/assets/yuri-wordmark-DSJqXYVo.svg`,d=i();function f(e){let t=(0,l.c)(5),{className:n,width:r}=e,i=n===void 0?``:n,a=r===void 0?112:r,o=`inline-block shrink-0 ${i}`,s;t[0]===a?s=t[1]:(s={width:a,aspectRatio:`626.723 / 280`,backgroundColor:`currentColor`,mask:`url("${u}") center / contain no-repeat`,WebkitMask:`url("${u}") center / contain no-repeat`},t[0]=a,t[1]=s);let c;return t[2]!==o||t[3]!==s?(c=(0,d.jsx)(`span`,{role:`img`,"aria-label":`Yuri`,className:o,style:s}),t[2]=o,t[3]=s,t[4]=c):c=t[4],c}export{c as n,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{_ as t,c as n,d as r,s as i}from"./runtime-auth-mjIpsk3N.js";import{c as a,i as o}from"./runtime-switch-BMjl5Y5W.js";import{n as s}from"./runtime-fetch-DKZOpfzo.js";import{d as c,g as l,h as u,i as d,l as f,m as p,n as m,p as h,u as g}from"./runtime-file-resource-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{_ as t,c as n,d as r,s as i}from"./runtime-auth-mjIpsk3N.js";import{c as a,i as o}from"./runtime-switch-BMjl5Y5W.js";import{n as s}from"./runtime-fetch-DKZOpfzo.js";import{d as c,g as l,h as u,i as d,l as f,m as p,n as m,p as h,u as g}from"./runtime-file-resource-DnhWnndu.js";var _=26214400,v=class extends Error{status;code;constructor(e,t,n=`Failed to upload assistant attachment`){super(n),this.name=`AssistantAttachmentUploadError`,this.status=e,this.code=t}},y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),b=e=>[...new Uint8Array(e)].map(e=>e.toString(16).padStart(2,`0`)).join(``),x=async e=>{let t;if(e instanceof ArrayBuffer)t=e;else if(ArrayBuffer.isView(e)){let n=e;t=n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}else t=await e.arrayBuffer();return b(await crypto.subtle.digest(`SHA-256`,t))},S=e=>typeof e==`string`?e.split(`;`)[0]?.trim().toLowerCase():``,C=e=>{if(!Number.isSafeInteger(e)||e<0)throw new v(0,`rejected`,`Invalid attachment size`);if(e>26214400)throw new v(413,`too-large`)},w=(e,t,n={})=>{if(!y(e))throw new v(0,`integrity`,`Attachment response was not a JSON object`);if(e.type!==`file`)throw new v(0,`integrity`,`Attachment response type must be file`);let r=typeof e.attachmentID==`string`?e.attachmentID.trim():``,i=typeof e.sha256==`string`?e.sha256.trim().toLowerCase():``,a=typeof e.size==`number`&&Number.isSafeInteger(e.size)?e.size:NaN,o=S(typeof e.mime==`string`?e.mime:``),s=typeof e.filename==`string`&&e.filename.trim()?e.filename.trim():void 0;if(!r)throw new v(0,`integrity`,`Attachment response missing attachmentID`);if(!/^[a-f0-9]{64}$/i.test(i))throw new v(0,`integrity`,`Attachment response missing sha256`);if(!Number.isSafeInteger(a)||a<0)throw new v(0,`integrity`,`Attachment response missing size`);if(!o)throw new v(0,`integrity`,`Attachment response missing mime`);if((n.enforceUploadLimit===!0||t)&&C(a),t){if(i!==t.sha256.toLowerCase())throw new v(0,`integrity`,`Attachment SHA-256 mismatch`);if(a!==t.size)throw new v(0,`integrity`,`Attachment size mismatch`);if(o!==t.mime)throw new v(0,`integrity`,`Attachment mime mismatch`)}return{type:`file`,attachmentID:r,sha256:i,size:a,mime:o,...s?{filename:s}:{}}},T=async(e,t,n,r)=>{let i=m(),a=typeof e==`string`?e.trim():``,o=typeof n==`string`?n.trim():``;if(!a||!o)throw new v(0,`rejected`,`assistantID and uploadID are required`);if(!(t instanceof Blob))throw new v(0,`rejected`,`file must be a File or Blob`);let c=S(t.type||t.type)||`application/octet-stream`,l=t.type===c?t:new Blob([t],{type:c});C(l.size);let u=await x(l),d=typeof t.name==`string`&&t.name.trim()?t.name.trim():void 0,f;try{f=await s(`/api/yuri/assistants/${encodeURIComponent(a)}/contact/attachments/${encodeURIComponent(o)}`,{method:`PUT`,headers:{"Content-Type":c,"X-Content-SHA256":u,"X-Content-Size":String(l.size),...d?{"X-Attachment-Filename":encodeURIComponent(d)}:{}},body:l,signal:r})}catch{throw new v(0,`unavailable`)}if(f.status===204||f.status===205)throw new v(f.status,`integrity`,`Attachment upload returned empty status`);if(f.status===413)throw new v(413,`too-large`);if(!f.ok)throw new v(f.status,f.status>=500||f.status===0?`unavailable`:`rejected`);let p=f.headers.get(`content-type`)?.toLowerCase()??``;if(p.includes(`text/html`)||p.includes(`text/plain`))throw new v(f.status,`integrity`,`Attachment upload returned non-JSON body`);let h;try{let e=await f.text();if(!e.trim())throw new v(f.status,`integrity`,`Attachment upload returned empty body`);if(!p.includes(`application/json`)&&!e.trim().startsWith(`{`))throw new v(f.status,`integrity`,`Attachment upload returned non-JSON body`);h=JSON.parse(e)}catch(e){throw e instanceof v?e:new v(f.status,`integrity`,`Attachment upload response was not valid JSON`)}let g=w(h,{sha256:u,size:l.size,mime:c});return await i(l,u),g},E=e=>{try{return w(e,void 0,{enforceUploadLimit:!1}),!0}catch{return!1}},D=e({clearAssistantAttachmentCacheAll:()=>G,clearAssistantAttachmentCacheForBearer:()=>W,clearAssistantAttachmentCacheScope:()=>U,getAssistantAttachmentBlob:()=>J,getAssistantAttachmentDisplay:()=>Y,resolveAssistantAttachmentCacheScope:()=>R}),O=g,k=class extends Error{status;code;constructor(e,t,n=`Assistant attachment cache error`){super(n),this.status=e,this.code=t,this.name=`AssistantAttachmentCacheError`}},A=async e=>[...new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e)))].map(e=>e.toString(16).padStart(2,`0`)).join(``),j=0,M,N,P=!1,F=new Map,I=new Map,L=new Set,R=async(e={})=>{let t=e.transportIdentity??o(),r=e.authGeneration??i(),a=(e.bearer??n()).trim();return{transportIdentity:t,authGeneration:r,authScope:a?`b:${await A(a)}`:`m:${r}`,authScopeKind:a?`bearer-hash`:`memory-ephemeral`}},z=e=>`assistant:${e.transportIdentity}:${e.authScope}`,B=e=>`assistant-auth:${e}`,V=()=>{j++;for(let e of L)e.abort();L.clear();for(let e of I.values())e.controller.abort(),e.url&&p(e.url);I.clear();for(let e of F.values()){for(let t=0;t<e.refs;t++)h(e.url);p(e.url)}F.clear()},H=()=>{if(!P&&globalThis.indexedDB){P=!0;for(let e of[`yuri-assistant-attachments`,`openchamber-assistant-attachments`,`openchambery-assistant-attachments`])try{globalThis.indexedDB.deleteDatabase(e)}catch{}}M||=a(V),N||=t(e=>{V(),e.reason!==`endpoint-switch`&&d(e.previousBearerDigest?B(`b:${e.previousBearerDigest}`):void 0)})},U=async(e,t=`scope-cleared`)=>{let n=typeof e==`object`?e:await R();V(),await d(z(n))},W=async(e,t=`forget-bearer`)=>{if(!e.trim())return;let n=B(`b:${await A(e.trim())}`);V(),await d(n)},G=async(e=`cleared`)=>{V(),await d()},K=(e,t,n)=>{if(!e.trim()||!E(t))throw new k(0,`rejected`);if(t.size>n)throw new k(413,`too-large`)},q=async(e,t,n,a)=>{H(),K(e,t,n),a?.throwIfAborted();let o=j,c=await R();if(o!==j)throw new k(0,`stale`);let l=new AbortController,u=()=>l.abort(a?.reason);a?.addEventListener(`abort`,u,{once:!0}),L.add(l);let d;try{a?.throwIfAborted();let u=await f({identity:`/api/yuri/assistants/${encodeURIComponent(e.trim())}/contact/attachments/${encodeURIComponent(t.attachmentID)}`,sha256:t.sha256.toLowerCase(),size:t.size,mime:t.mime,filename:t.filename,persistent:c.authScopeKind===`bearer-hash`,tags:[z(c),B(c.authScope)],signal:l.signal,maxBytes:n,load:async n=>{let a=await s(`/api/yuri/assistants/${encodeURIComponent(e.trim())}/contact/attachments/${encodeURIComponent(t.attachmentID)}`,{method:`GET`,cache:`no-store`,signal:n});if(a.status===401||a.status===403)throw d=new k(a.status,`unauthorized`),await U(c,`unauthorized`),i()===c.authGeneration&&r(),new k(a.status,`unauthorized`);if(!a.ok)throw new k(a.status,a.status===413?`too-large`:a.status>=500?`unavailable`:`rejected`);return a}});if(o!==j)throw new k(0,`stale`);return u}catch(e){throw d||(e instanceof k?e:o===j?l.signal.aborted?new k(0,`aborted`):/descriptor limit|streaming destination/i.test(String(e))?new k(413,`too-large`):new k(0,/fingerprint|size|changed|truncated/i.test(String(e))?`integrity`:`unavailable`):new k(0,`stale`))}finally{L.delete(l),a?.removeEventListener(`abort`,u)}},J=(e,t,n={})=>q(e,t,_,n.signal),Y=async(e,t,n={})=>{H(),K(e,t,O),n.signal?.throwIfAborted();let r=j,i=await R(),a=JSON.stringify([z(i),e,t.attachmentID,t.sha256]),o=e=>{if(r!==j||!c(e)||!u(e))throw p(e),new k(0,`stale`);let t=F.get(a)?.url===e?F.get(a):{url:e,refs:0};t.refs++,F.set(a,t);let n=!1;return{url:e,release:()=>{n||(n=!0,F.get(a)===t&&(h(e),--t.refs===0&&(F.delete(a),p(e))))}}},s=F.get(a);if(s&&c(s.url))return o(s.url);let d=I.get(a);if(!d){let n=new AbortController,i={controller:n,refs:0,promise:Promise.resolve(``)};i.promise=q(e,t,O,n.signal).then(e=>l(e,n.signal,{mimeType:t.mime||e.type})).then(e=>{if(i.url=e,r!==j||n.signal.aborted||i.refs===0)throw p(e),new k(0,`stale`);return e}).catch(e=>{throw I.get(a)===i&&I.delete(a),e}),d=i,I.set(a,d)}let f=d;return f.refs++,new Promise((e,t)=>{let r=!1,i=e=>{--f.refs===0&&(e&&f.controller.abort(),I.get(a)===f&&I.delete(a),e&&f.url&&!F.has(a)&&p(f.url))},s=()=>{r||(r=!0,i(!0),t(new k(0,`aborted`)))};n.signal?.addEventListener(`abort`,s,{once:!0}),n.signal?.aborted&&s(),f.promise.then(a=>{if(n.signal?.removeEventListener(`abort`,s),!r){r=!0;try{e(o(a))}catch(e){t(e)}i(!1)}},e=>{n.signal?.removeEventListener(`abort`,s),!r&&(r=!0,i(!1),t(e))})})};export{T as i,J as n,Y as r,D as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t as n}from"./types-
|
|
1
|
+
import{a as e,n as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t as n}from"./types-zQujo_Lh.js";var r=e(`CapacitorUpdater`),i=()=>{if(typeof window>`u`)return!1;try{return t.isNativePlatform()&&t.isPluginAvailable(`CapacitorUpdater`)}catch{return!1}},a=()=>{throw new n},o=()=>({async notifyAppReady(){return i()||a(),r.notifyAppReady()},async download(e){return i()||a(),r.download(e)},async next(e){return i()||a(),r.next(e)},async reload(){return i()||a(),r.reload()},async current(){return i()||a(),r.current()},async getDeviceId(){return i()||a(),r.getDeviceId()},async list(){return i()||a(),r.list()},addListener:(async(e,t)=>(i()||a(),r.addListener(e,t)))}),s,c=async()=>s===void 0?i()?(s=o(),s):(s=null,null):s,l=()=>i();export{l as n,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{J as t,Y as n,ot as r,st as i}from"./vendor-base-ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{J as t,Y as n,ot as r,st as i}from"./vendor-base-ui-fom6orB6.js";import{n as a}from"./vendor-react-D5BntRmA.js";import{Rn as o}from"./useMobileNavigationStore-CU0KrVK0.js";import{n as s}from"./Icon-CWw2bUr_.js";var c=a(),l=e(i(),1),u=r(),d=l.memo(function(e){let r=(0,c.c)(20),{checked:i,onChange:a,disabled:l,indeterminate:d,ariaLabel:f,className:p,iconClassName:m}=e,h=l!==void 0&&l,g=i||d,_;r[0]===a?_=r[1]:(_=e=>a(!!e),r[0]=a,r[1]=_);let v=g?`border-[color:color-mix(in_srgb,var(--primary-base)_65%,var(--interactive-border))] bg-transparent shadow-none hover:bg-[var(--interactive-hover)] hover:border-[color:color-mix(in_srgb,var(--primary-base)_75%,var(--interactive-border))]`:`border-[var(--interactive-border)] bg-transparent shadow-none hover:bg-[var(--interactive-hover)] hover:border-[var(--interactive-border)]`,y;r[2]!==p||r[3]!==v?(y=o(`group/checkbox relative flex shrink-0 self-center items-center justify-center rounded-[4px] border outline-none`,`h-[14px] w-[14px] min-h-[14px] min-w-[14px]`,`transition-[background-color,border-color,box-shadow] duration-200 ease-out`,v,`focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] focus-visible:ring-offset-1 focus-visible:ring-offset-transparent`,`disabled:cursor-not-allowed disabled:opacity-50`,p),r[2]=p,r[3]=v,r[4]=y):y=r[4];let b;r[5]===m?b=r[6]:(b=o(`flex items-center justify-center text-[var(--primary-base)]`,`data-[unchecked]:hidden`,m),r[5]=m,r[6]=b);let x;r[7]===d?x=r[8]:(x=d?(0,u.jsx)(s,{name:`subtract`,className:o(`h-[10px] w-[10px] min-h-[10px] min-w-[10px]`,`text-[var(--primary-base)]`)}):(0,u.jsx)(s,{name:`check`,className:o(`h-[10px] w-[10px] min-h-[10px] min-w-[10px]`,`text-[var(--primary-base)]`)}),r[7]=d,r[8]=x);let S;r[9]!==b||r[10]!==x?(S=(0,u.jsx)(t,{keepMounted:!0,className:b,children:x}),r[9]=b,r[10]=x,r[11]=S):S=r[11];let C;return r[12]!==f||r[13]!==i||r[14]!==h||r[15]!==d||r[16]!==_||r[17]!==y||r[18]!==S?(C=(0,u.jsx)(n,{checked:i,onCheckedChange:_,disabled:h,indeterminate:d,"aria-label":f,className:y,children:S}),r[12]=f,r[13]=i,r[14]=h,r[15]=d,r[16]=_,r[17]=y,r[18]=S,r[19]=C):C=r[19],C});export{d as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-heic2any-DgJnLT1Y.js","assets/rolldown-runtime-hePW80VL.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{f as t,i as n,n as r,r as i,t as a}from"./runtime-switch-BMjl5Y5W.js";import{n as o}from"./runtime-fetch-DKZOpfzo.js";import{S as s,a as c,c as l,o as u,s as d}from"./platform-wF65ZFgV.js";import{t as f}from"./runtimeAPIRegistry-C2VogTny.js";import{a as p}from"./vendor-zustand-
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{f as t,i as n,n as r,r as i,t as a}from"./runtime-switch-BMjl5Y5W.js";import{n as o}from"./runtime-fetch-DKZOpfzo.js";import{S as s,a as c,c as l,o as u,s as d}from"./platform-wF65ZFgV.js";import{t as f}from"./runtimeAPIRegistry-C2VogTny.js";import{a as p}from"./vendor-zustand-CNn3HHhT.js";import{st as m}from"./vendor-base-ui-fom6orB6.js";import{B as h,H as g,R as ee}from"./vendor-opencode-client-BM2r1f0o.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{i as te}from"./safeStorage-DTOhKN0V.js";import{T as ne,a as re,d as ie,i as ae,n as oe,r as se,t as ce,u as le,y as ue}from"./prompt-attachment-upload-8bssUUT3.js";import{n as de}from"./vendor-react-D5BntRmA.js";import{o as fe}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";var pe=`yuri.inst.`,me=e=>{try{return btoa(unescape(encodeURIComponent(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/g,``)}catch{return encodeURIComponent(e)}},he=e=>{let t=(e??i()).trim();return t.length>0?t:`default`},ge=()=>{if(typeof window>`u`)return``;let e=window.__YURI_LOCAL_ORIGIN__;return typeof e==`string`?e.trim().replace(/\/+$/,``):``},_=(e,t=i())=>`${pe}${me(he(t))}.${e}`,_e=(e=i())=>he(e).startsWith(`relay:`),ve=(e=i())=>{let t=he(e);if(t==="default"||t===`local`)return!0;if(_e(t)||!t.startsWith(`url:`))return!1;let n=ge();if(!n)return!1;try{return new URL(t.slice(4)).origin===new URL(n).origin}catch{return!1}},ye=(e=i())=>!_e(e),be=(e,t=a())=>{let n=t.trim().replace(/\/+$/,``);return n?`${e}:${encodeURIComponent(n)}`:null},xe=(e,t)=>{let n=t?.storage??(typeof localStorage<`u`?localStorage:{getItem:()=>null}),r=t?.runtimeKey??i(),a=n.getItem(_(e,r));if(a!==null)return a;if(ye(r)){let t=be(e),r=t?n.getItem(t):null;if(r!==null)return r}return ve(r)?n.getItem(e):null},Se=(e,t,n)=>{let r=n?.storage??(typeof localStorage<`u`?localStorage:{setItem:()=>void 0}),a=n?.runtimeKey??i();r.setItem(_(e,a),t)},Ce=e=>({getItem:t=>xe(t,{storage:e}),setItem:(t,n)=>{Se(t,n,{storage:e})},removeItem:t=>{we(t,{storage:e})}}),we=(e,t)=>{let n=t?.storage??(typeof localStorage<`u`?localStorage:{removeItem:()=>void 0}),r=t?.runtimeKey??i();n.removeItem(_(e,r))},Te=e=>{let t;try{t=te()}catch{return}let n=t=>t===null?null:JSON.parse(t,e?.reviver),r=e=>t.getItem(e);return{getItem:e=>{let t=i(),a=_(e,t),o=r(a);if(o instanceof Promise)return o.then(i=>{if(i!==null)return n(i);if(!ve(t))return null;let a=r(e);return a instanceof Promise?a.then(n):n(a)});if(o!==null)return n(o);if(!ve(t))return null;let s=r(e);return s instanceof Promise?s.then(n):n(s)},setItem:(n,r)=>{let a=_(n,i());t.setItem(a,JSON.stringify(r,e?.replacer))},removeItem:e=>{let n=_(e,i());t.removeItem(n)}}},v=e=>{if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0};function Ee(e){let t=v(e.id),n=v(e.name),r=v(e.displayName),i=t??n;if(!i)return{...e,id:``,name:``,displayName:r??``};if(n===i&&r)return{...e,id:i,name:i,displayName:r};let a=r??n??i;return{...e,id:i,name:i,displayName:a}}function De(e){return e?v(e.displayName)??v(e.name)??v(e.id)??``:``}function Oe(e,t){let n=v(t);if(!n||!e?.length)return;let r=e.find(e=>v(e.name)===n);if(r)return r;let i=e.find(e=>v(e.id)===n);if(i)return i;let a=e.find(e=>v(e.displayName)===n);if(a)return a}function ke(e,t){let n=v(t);if(!n)return;let r=Oe(e,n);return r?v(r.name)??v(r.id)??n:n}function Ae(e){return Array.from(new Set(Array.from(e.matchAll(ne()),e=>e[1])),e=>({id:e,name:e}))}function y(e){return{...e,directory:e.location?.directory}}function je(e){let t={};for(let n of e){let e=n;!e||e.type!==`document`||!e.info||typeof e.info!=`object`||Object.assign(t,e.info)}return t}var b=e(m(),1),Me=de();function x(e,t){return e.findIndex(e=>e.id===t)}function Ne(e,t){if(!t)return e.slice();let n=x(e,t);return n<0?e.slice():e.slice(0,n)}function Pe(e,t,n){let r=x(e,n);return r<0?!1:x(e,t)>=r}function Fe(e,t){if(!t){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.role===`user`)return n}return}let n=x(e,t);if(!(n<0))for(let t=n-1;t>=0;--t){let n=e[t];if(n?.role===`user`)return n}}function Ie(e,t){let n=x(e,t);if(!(n<0))for(let t=n+1;t<e.length;t+=1){let n=e[t];if(n?.role===`user`)return n}}var Le=`yuri:sync:debug`,Re;function ze(){if(Re!==void 0)return Re;try{Re=typeof localStorage<`u`&&localStorage.getItem(Le)===`1`}catch{Re=!1}return Re}function S(e,...t){ze()&&(`${e}`,[...t])}var C={pipeline:{coalesced:(e,t)=>S(`pipeline`,`coalesced`,e,t),flush:e=>S(`pipeline`,`flush`,`${e} events`)},reducer:{messageUpdatedUnchanged:(e,t,n,r,i)=>S(`reducer`,`message.updated UNCHANGED (skipped)`,{sessionID:e,messageID:t,role:n,finish:r,completed:i}),partUpdatedNoExistingParts:(e,t,n)=>S(`reducer`,`message.part.updated NO EXISTING PARTS`,{messageID:e,partID:t,partType:n}),partDeltaNoParts:(e,t)=>S(`reducer`,`message.part.delta DROPPED (no parts array)`,{messageID:e,partID:t}),partDeltaNotFound:(e,t)=>S(`reducer`,`message.part.delta DROPPED (partID not found)`,{messageID:e,partID:t}),partSkipped:(e,t,n)=>S(`reducer`,`message.part.updated SKIPPED (type filtered)`,{messageID:e,partID:t,partType:n})},dispatch:{eventNoChange:(e,t,n)=>S(`dispatch`,`event → no change`,{eventType:e,sessionID:t,messageID:n}),eventApplied:(e,t,n)=>S(`dispatch`,`event → applied`,{eventType:e,sessionID:t,messageID:n})},recovery:{materializing:e=>S(`recovery`,`materializing session`,e)}};function Be(e,t){let n=new Set(t),r=new Map,i=[],a;for(let t of e){if(!n.has(t)){i.push(t);continue}i.length>0&&r.set(t,i),i=[],a=t}let o=[],s=new Set,c=e=>{s.has(e)||(s.add(e),o.push(e))};for(let e of t){for(let t of r.get(e)??[])c(t);if(c(e),e===a)for(let e of i)c(e)}if(!a)for(let e of i)c(e);return o}var Ve=`desc`;function He(e){return!w(e)||e.type!==`compaction`?!1:e.status===`running`||e.status===`completed`||e.status===`failed`}function Ue(e){if(e)return e.find(He)}var We=e=>e?e.toLowerCase().includes(`application/json`):!1,Ge=e=>e?e.toLowerCase().includes(`text/html`):!1;function w(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function T(e){return typeof e==`string`&&e.length>0?e:void 0}function Ke(e){if(!w(e))return null;let t=T(e.id);return t?{...e,id:t}:null}function qe(e,t,n){return`${e}:${t}:${n}`}function Je(e,t,n,r,i=`text`,a){return i===`reasoning`?{id:qe(t,i,n),sessionID:e,messageID:t,type:`reasoning`,text:r}:{id:qe(t,i,n),sessionID:e,messageID:t,type:`text`,text:r,...a?.synthetic===!0?{synthetic:!0}:{}}}function Ye(e){return e?e.nativeType===`synthetic`||e.type===`synthetic`:!1}function Xe(e,t){return!e?.id||Ye(e)||(e.clientRole??e.role)!==`user`?!1:!Array.isArray(t)||t.length===0||!(t.some(e=>e.type===`subtask`||e.type===`compaction`)||t.every(e=>!!e.synthetic))}function Ze(e){if(typeof e==`string`&&e.length!==0)return e.replace(/^evt_/,`msg_`)}function Qe(e){let t=e.content;return Array.isArray(t)?t.flatMap(e=>w(e)&&e.type===`text`&&typeof e.text==`string`?[e.text]:[]).join(`
|
|
3
3
|
`):typeof e.output==`string`?e.output:void 0}function $e(e){return e===`patch`?`apply_patch`:e}function et(e,t,n){let r=T(n.id)??`${t}:tool`,i=$e(T(n.name))??`tool`,a=w(n.state)?n.state:{},o=T(a.status)??`completed`,s=o===`streaming`?`pending`:o,c=w(n.time)?n.time:{};return{id:r,sessionID:e,messageID:t,type:`tool`,tool:i,callID:r,state:{status:s,input:a.input??{},output:Qe(a),error:w(a.error)?T(a.error.message):T(a.error),metadata:w(a.metadata)?a.metadata:{},time:{...typeof c.ran==`number`&&Number.isFinite(c.ran)?{start:c.ran}:{},...typeof c.completed==`number`&&Number.isFinite(c.completed)?{end:c.completed}:{}}}}}function tt(e){return w(e)?{created:typeof e.created==`number`?e.created:0,...typeof e.streamed==`number`?{streamed:e.streamed}:{},...typeof e.completed==`number`?{completed:e.completed}:{},...typeof e.start==`number`?{start:e.start}:{},...typeof e.end==`number`?{end:e.end}:{}}:{created:0}}function nt(e){if(!w(e))return;let t=w(e.cache)?{...typeof e.cache.read==`number`?{read:e.cache.read}:{},...typeof e.cache.write==`number`?{write:e.cache.write}:{}}:void 0,n={...typeof e.input==`number`?{input:e.input}:{},...typeof e.output==`number`?{output:e.output}:{},...typeof e.reasoning==`number`?{reasoning:e.reasoning}:{},...t&&(t.read!==void 0||t.write!==void 0)?{cache:t}:{}};return Object.keys(n).length>0?n:void 0}function rt(e,t){let n=w(t.metadata)?t.metadata:void 0,r=n&&w(n.model)?n.model:void 0,i=w(t.model)?t.model:r,a=i?T(i.id)??T(i.modelID)??T(t.modelID):T(t.modelID),o=i?T(i.providerID)??T(t.providerID):T(t.providerID),s=(i?T(i.variant):void 0)??T(t.variant)??(n?T(n.variant):void 0);a&&(e.modelID=a),o&&(e.providerID=o),s&&(e.variant=s),(a||o||s)&&(e.model={...o?{providerID:o}:{},...a?{modelID:a}:{},...s?{variant:s}:{}});let c=T(t.agent)??T(t.mode)??(n?T(n.agent):void 0);c&&(e.agent=c)}function it(e,t,n){return{id:t.id,sessionID:e,role:n,time:tt(t.time)}}function at(e,t){let n=Ke(t);if(!n)return null;let r=n.id,i=T(n.type)??`unknown`,a=T(n.role)??T(n.clientRole);if(i===`idle`||i===`model-switched`||i===`agent-selected`||i===`agent-switched`||i===`location-switched`||a===`idle`)return null;if(i===`user`){let t=it(e,n,`user`);rt(t,n);let i=[],a=T(n.text);a&&i.push(Je(e,r,0,a));let o=n.files;return Array.isArray(o)&&o.forEach((t,n)=>{if(!w(t))return;let a=T(t.mime)??`application/octet-stream`,o=w(t.source)?t.source:{},s=o.type===`uri`?T(o.uri):void 0,c=T(t.data),l=s||(c?`data:${a};base64,${c}`:``),u={id:`${r}:file:${n}`,sessionID:e,messageID:r,type:`file`,mime:a,filename:T(t.name),url:l};i.push(u)}),{info:t,parts:i}}if(i===`assistant`){let t=it(e,n,`assistant`);if(w(n.model)){t.modelID=T(n.model.id)??T(n.model.modelID)??T(n.modelID),t.providerID=T(n.model.providerID)??T(n.providerID);let e=T(n.model.variant)??T(n.variant);(t.modelID||t.providerID||e)&&(t.model={...t.providerID?{providerID:t.providerID}:{},...t.modelID?{modelID:t.modelID}:{},...e?{variant:e}:{}})}else{let e=T(n.modelID),r=T(n.providerID),i=T(n.variant);e&&(t.modelID=e),r&&(t.providerID=r),(e||r||i)&&(t.model={...r?{providerID:r}:{},...e?{modelID:e}:{},...i?{variant:i}:{}})}let i=T(n.agent);i&&(t.agent=i);let a=T(n.finish)??T(n.rawFinish);a&&(t.finish=a),w(n.error)&&(t.error={type:T(n.error.type)??`error`,message:T(n.error.message)??``,...typeof n.error.status==`number`?{status:n.error.status}:{}}),typeof n.cost==`number`&&Number.isFinite(n.cost)&&(t.cost=n.cost);let o=nt(n.tokens);o&&(t.tokens=o);let s=[],c=Array.isArray(n.content)?n.content:[],l=0,u=0;for(let t of c){if(!w(t))continue;let n=T(t.type);if(n===`text`&&typeof t.text==`string`){s.push(Je(e,r,l++,t.text));continue}if(n===`reasoning`&&typeof t.text==`string`){s.push(Je(e,r,u++,t.text,`reasoning`));continue}n===`tool`&&s.push(et(e,r,t))}return{info:t,parts:s}}if(i===`shell`){let t=it(e,n,`user`),i=T(n.command)??``,a=w(n.output)&&typeof n.output.output==`string`?n.output.output:``,o=n.status===`running`?`running`:n.status===`exited`&&n.exit===0?`completed`:`error`;return{info:t,parts:[{id:qe(r,`text`,0),sessionID:e,messageID:r,type:`text`,text:i,shellAction:{command:i,output:a,status:o,shellID:T(n.shellID)}}]}}if(i===`synthetic`){let t={...it(e,n,`user`),nativeType:`synthetic`},i=T(n.description);i&&(t.description=i),w(n.metadata)&&(t.metadata=n.metadata);let a=T(n.shellID);a&&(t.shellID=a);let o=T(n.sessionID)&&n.sessionID!==e?T(n.sessionID):T(n.childSessionID)??T(n.taskSessionID);o&&(t.childSessionID=o);let s=T(n.text)??i??``;return{info:t,parts:s?[Je(e,r,0,s,`text`,{synthetic:!0})]:[{id:qe(r,`text`,0),sessionID:e,messageID:r,type:`text`,text:``,synthetic:!0}]}}if(i===`system`)return null;if(i===`compaction`){let t=n.status===`failed`?`failed`:n.status===`completed`?`completed`:`running`,i={...it(e,n,`assistant`),clientRole:`compaction`},a=w(n.error)?{type:T(n.error.type)??`error`,message:T(n.error.message)??``,...typeof n.error.status==`number`?{status:n.error.status}:{}}:void 0;return{info:i,parts:[{id:`${r}:compaction`,sessionID:e,messageID:r,type:`compaction`,status:t,reason:n.reason===`auto`?`auto`:`manual`,...typeof n.summary==`string`?{summary:n.summary}:{},...typeof n.recent==`string`?{recent:n.recent}:{},...a?{error:a}:{}}]}}return{info:it(e,n,`assistant`),parts:[Je(e,r,0,T(n.text)??`[${i}]`)]}}function ot(e,t,n=Ve,r=20){if(!w(e))throw Error(`session projection: expected JSON object`);if(!Array.isArray(e.data))throw Error(`session projection: data must be an array`);let i=[];for(let n of e.data){let e=at(t,n);e&&i.push(e)}n===`desc`&&i.reverse();let a=w(e.cursor)?e.cursor:void 0,o=T(a?n===`asc`?a.previous:a.next:e.cursor),s=!o||e.data.length<r,c=i.filter(e=>Xe(e.info,e.parts)).length;return{records:i,cursor:s?void 0:o,complete:s,turnCount:c}}async function st(e){let t=e.limit??20,n=e.order??`desc`,r=`/api/session/${encodeURIComponent(e.sessionID)}/message`,i={directory:e.scope?.location.directory??e.directory,limit:String(t)};e.cursor?i.cursor=/^msg_[A-Za-z0-9_]+$/.test(e.cursor)?btoa(JSON.stringify({id:e.cursor,order:n,direction:n===`desc`?`next`:`previous`})).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``):e.cursor:i.order=n;let a=await(e.scope?e.scope.fetch:o)(r,{method:`GET`,query:i,signal:e.signal});if(!a.ok)throw Error(`session projection failed (${a.status})`);let s=a.headers.get(`content-type`);if(Ge(s))throw Error(`session projection: unexpected HTML response`);We(s);let c;try{c=await a.json()}catch{throw Error(`session projection: malformed JSON`)}return ot(c,e.sessionID,n,t)}function ct(e){let t=e.fetched.filter(e=>!!e.info?.id),n=e.previous.filter(e=>!!e.info?.id),r=e.touched??new Set,i=new Map(t.map(e=>[e.info.id,e])),a=new Map(n.map(e=>[e.info.id,e])),o=new Set(e.coverageMessageIDs??t.map(e=>e.info.id)),s=n.findIndex(e=>o.has(e.info.id));if(!e.completeTail)for(let[e,t]of n.entries())i.has(t.info.id)||(s===-1||e<s)&&i.set(t.info.id,t);for(let e of r){let t=a.get(e);t?i.set(e,t):i.delete(e)}let c=n.map(e=>e.info.id).filter(e=>i.has(e)),l=t.map(e=>e.info.id).filter(e=>i.has(e)),u=l.some(e=>a.has(e));return(!e.completeTail&&!u?[...new Set([...c,...l])]:Be(c,l)).map(e=>i.get(e))}var lt=e=>e?e.toLowerCase().includes(`application/json`):!1,ut=e=>e?e.toLowerCase().includes(`text/html`):!1;function dt(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function ft(e){return typeof e==`string`&&e.length>0?e:void 0}function pt(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function mt(e,t,n){let r=n?`: ${n}`:``,i=Error(`${e} (${t})${r}`);throw i.status=t,i}async function ht(e){try{return(await e.text()).trim()}catch{return``}}async function gt(e,t){let n=e.headers.get(`content-type`);if(ut(n))throw Error(`${t}: unexpected HTML response`);let r;try{r=await e.json()}catch{throw Error(`${t}: malformed JSON`)}if(!lt(n)&&r==null)throw Error(`${t}: empty response`);return r}var _t=new Map,vt=e=>_t.get(e)??0,yt=p((e,t)=>({runningBySession:{},setRunning(t,n){_t.set(t,vt(t)+1),e(e=>{let r={...e.runningBySession};return n?r[t]=!0:delete r[t],{runningBySession:r}})},isRunning(e){return t().runningBySession[e]===!0},reset(){_t.clear(),e({runningBySession:{}})}}));function E(e,t){yt.getState().setRunning(e,t)}function bt(e){return yt.getState().isRunning(e)}function xt(e){return!bt(e.sessionID)}function St(e){let t=dt(e)?e:null,n=t&&dt(t.data)?t.data:t;if(!n)throw Error(`session compact: expected inbox item`);let r=ft(n.id),i=ft(n.sessionID);if(!r||!i)throw Error(`session compact: inbox item missing id`);if(n.type&&n.type!==`compaction`)throw Error(`session compact: expected compaction inbox item`);return{id:r,sessionID:i,type:`compaction`,delivery:n.delivery===`queue`?`queue`:n.delivery===`steer`?`steer`:void 0,timeCreated:pt(n.timeCreated)}}function Ct(e){let t=dt(e)?e:null,n=t&&Array.isArray(t.data)?t.data:Array.isArray(e)?e:null;if(!n)throw Error(`session inbox: expected list`);let r=[];for(let e of n)!dt(e)||e.type!==`compaction`||r.push(St(e));return r}function wt(e,t){t.some(e=>e.type===`compaction`)&&E(e,!0)}function Tt(e,t){for(let n=t.length-1;n>=0;--n){let r=(t[n]?.parts??[]).find(He);if(r){E(e,r.status===`running`);return}}}async function Et(e){let t=`/api/session/${encodeURIComponent(e.sessionID)}/compact`,n={};e.messageID&&(n.id=e.messageID),e.delivery&&(n.delivery=e.delivery);let r=await(e.scope?e.scope.fetch:o)(t,{method:`POST`,headers:{"Content-Type":`application/json`},query:{directory:e.scope?.location.directory??e.directory},body:JSON.stringify(n),signal:e.signal});r.ok||mt(`session compact`,r.status,await ht(r));let i=St(await gt(r,`session compact`));if(e.scope&&(e.scope.sdk(),i.sessionID!==e.sessionID))throw Error(`Remote compaction session mismatch`);return E(e.scope?l(e.scope.location,i.sessionID):i.sessionID,!0),i}var Dt=`compaction:`;function Ot(e,t){return t&&t.length>0?t:`${Dt}${e}`}function kt(e,t){let n=e.message[t]??[];for(let t=n.length-1;t>=0;--t){let r=n[t];if((e.part[r.id]??[]).some(e=>He(e)&&e.status===`running`))return r.id}}function At(e,t,n,r,i=Date.now()){let a=e.message[t]?[...e.message[t]]:[];a.some(e=>e.id===n)||(a.push({id:n,sessionID:t,role:`assistant`,clientRole:`compaction`,time:{created:i}}),e.message[t]=a);let o=e.part[n]?[...e.part[n]]:[],s=o.findIndex(He),c=r(s>=0?o[s]:{id:`${n}:compaction`,sessionID:t,messageID:n,type:`compaction`,status:`running`,reason:`manual`});s>=0?o[s]=c:o.push(c),e.part[n]=o}function jt(e,t){let n=String(t.type??``);if(!n.startsWith(`session.compaction.`))return!1;let r=dt(t.properties)?t.properties:null;if(!r)return!1;let i=ft(r.sessionID);if(!i)return!1;let a=t.clientLocation?l(t.clientLocation,i):i,o=ft(r.inputID),s=kt(e,i),c=n===`session.compaction.started`?o??Ze(t.id)??Ot(i):o??s??Ze(t.id)??Ot(i);if(n===`session.compaction.started`)return!e.part[c]?.some(He)&&(At(e,i,c,e=>({...e,status:`running`,reason:r.reason===`auto`?`auto`:`manual`,...typeof r.recent==`string`?{recent:r.recent}:{}}),pt(r.eventCreated)),E(a,!0),!0);if(n===`session.compaction.delta`){if(!s)return!1;let t=typeof r.text==`string`?r.text:``;return t?(At(e,i,c,e=>({...e,status:`running`,summary:(e.summary??``)+t})),E(a,!0),!0):!1}if(n===`session.compaction.ended`)return E(a,!1),s?(At(e,i,c,e=>({...e,status:`completed`,reason:r.reason===`auto`?`auto`:`manual`,summary:typeof r.text==`string`?r.text:e.summary,...typeof r.recent==`string`?{recent:r.recent}:{}}),pt(r.eventCreated)),!0):!1;if(n===`session.compaction.failed`){if(E(a,!1),!s&&!o)return!1;let t=dt(r.error)?r.error:{};return At(e,i,c,e=>({...e,status:`failed`,reason:r.reason===`auto`?`auto`:`manual`,error:{type:ft(t.type)??`error`,message:ft(t.message)??``,...typeof t.status==`number`?{status:t.status}:{}}}),pt(r.eventCreated)),!0}return!1}var Mt=new Set([`patch`,`step-start`,`step-finish`]),Nt=[`text`,`output`],Pt=new Set([`completed`,`error`,`aborted`,`failed`,`timeout`,`cancelled`]);function Ft(e,t){if(!e||t.length===0)return(e??``)+t;if(e.endsWith(t))return e;let n=Math.min(e.length,t.length);for(let r=n;r>0;r--)if(e.endsWith(t.slice(0,r)))return e+t.slice(r);return e+t}function It(e,t){let n=[];for(let r of Nt){let i=e[r],a=t[r];typeof i==`string`&&typeof a==`string`&&i.length!==0&&a.length!==0&&(a===i||a.startsWith(i)||i.startsWith(a))&&n.push(r)}return n}function Lt(e){let t=e.state?.time?.end;if(typeof t==`number`)return t;let n=e.time?.end;return typeof n==`number`?n:void 0}function Rt(e){if(e.type!==`tool`)return;let t=e.state?.status;return typeof t==`string`?t:void 0}function zt(e,t){if(e.type!==`tool`||t.type!==`tool`)return!1;let n=Rt(e),r=Rt(t);if(n&&Pt.has(n)&&(!r||!Pt.has(r)))return!0;let i=Lt(e),a=Lt(t);return typeof i==`number`&&typeof a!=`number`}function Bt(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return e===t;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}var Vt=[`agent`,`mode`,`providerID`,`modelID`,`variant`],Ht=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ut=[`input`,`output`,`reasoning`];function Wt(e){if(!e||typeof e!=`object`)return!1;let t=e;return Ut.some(e=>typeof t[e]==`number`&&Number.isFinite(t[e])&&t[e]>0)}function Gt(e){if(!e||typeof e!=`object`)return!1;let t=e;return Ut.every(e=>typeof t[e]!=`number`||!Number.isFinite(t[e])||t[e]<=0)}function Kt(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function qt(e,t){let n={...e,...t},r=e,i=t,a=n;for(let e of Vt){let t=Kt(i[e]),n=Kt(r[e]);t?a[e]=t:n?a[e]=n:delete a[e]}let o=i.model,s=r.model;return Ht(o)?a.model=o:Ht(s)?a.model=s:delete a.model,(e.time||t.time)&&(n.time={...e.time,...t.time}),Wt(r.tokens)&&Gt(i.tokens)&&(a.tokens=r.tokens),n}function Jt(e,t){if(e.time.streamed!==t.time.streamed||e.role!==t.role||e.finish!==t.finish||e.time?.completed!==t.time?.completed)return!1;for(let n of[`summary`,`error`,`cost`,`tokens`,`structured`,`model`,`tools`,`format`,`variant`,`agent`,`mode`,`providerID`,`modelID`,`system`])if(!Bt(e[n],t[n]))return!1;return!0}function Yt(e,t,n){if(!t)return!1;let r=e.message[t];return r?x(r,n)>=0:!1}function Xt(e,t){switch(t.type){case`message.updated`:{let n=t.properties.info,r=n,i=typeof r.type==`string`?r.type:void 0,a=typeof r.role==`string`?r.role:void 0;if(i===`idle`||i===`model-switched`||i===`agent-selected`||i===`agent-switched`||i===`location-switched`||a===`idle`)return!1;let o=e.message[n.sessionID],s=!!o&&o.every(t=>t.role!==`assistant`||e.part[t.id]!==void 0);if(n.role===`assistant`&&s&&e.part[n.id]===void 0&&(e.part[n.id]=[]),!o)return e.message[n.sessionID]=[n],!0;let c=x(o,n.id);if(c>=0){let t=o[c],r=qt(t,n);if(Jt(t,r))return C.reducer.messageUpdatedUnchanged(n.sessionID,n.id,n.role,n.finish,n.time?.completed),!1;let i=[...o];i[c]=r,e.message[n.sessionID]=i}else e.message[n.sessionID]=[...o,n];return!0}case`message.removed`:{let n=t.properties,r=e.message[n.sessionID];if(r){let t=x(r,n.messageID);if(t>=0){let i=[...r];i.splice(t,1),e.message[n.sessionID]=i}}return delete e.part[n.messageID],!0}case`message.part.updated`:{let n=t.properties,r=n.part;if(Mt.has(r.type))return C.reducer.partSkipped(r.messageID,r.id,r.type),!1;let i=r.messageID,a=n.sessionID??r.sessionID;if(!i)return!1;let o=!Yt(e,a,i),s=e.part[i];if(!s)return C.reducer.partUpdatedNoExistingParts(i,r.id,r.type),e.part[i]=[r],!o||{changed:!0,materialization:{type:`incomplete-session-snapshot`,reason:`missing-owning-message`,sessionID:a,messageID:i,partID:r.id}};let c=[...s],l=c.findIndex(e=>e.id===r.id);if(l>=0){let e=c[l];if(zt(e,r))return!1;let t=It(e,r);c[l]=t.length>0?{...r,__dedupeNextDeltaFields:t}:r}else{let e=r.type===`text`||r.type===`file`?c.findIndex(e=>e.type===r.type&&e.__yuriOptimistic===!0):-1;e>=0?c[e]=r:c.push(r)}return e.part[i]=c,!o||{changed:!0,materialization:{type:`incomplete-session-snapshot`,reason:`missing-owning-message`,sessionID:a,messageID:i,partID:r.id}}}case`message.part.removed`:{let n=t.properties,r=e.part[n.messageID];if(!r)return!1;let i=r.findIndex(e=>e.id===n.partID);if(i>=0){let t=[...r];return t.splice(i,1),t.length===0?delete e.part[n.messageID]:e.part[n.messageID]=t,!0}return!1}case`message.part.delta`:{let n=t.properties,r=e.part[n.messageID];if(!r)return C.reducer.partDeltaNoParts(n.messageID,n.partID),{changed:!1,materialization:{type:`incomplete-session-snapshot`,reason:`orphan-delta`,sessionID:n.sessionID,messageID:n.messageID,partID:n.partID}};let i=r.findIndex(e=>e.id===n.partID);if(i<0)return C.reducer.partDeltaNotFound(n.messageID,n.partID),{changed:!1,materialization:{type:`incomplete-session-snapshot`,reason:`missing-delta-part`,sessionID:n.sessionID,messageID:n.messageID,partID:n.partID}};let a=r[i],o=a[n.field],s=a.__dedupeNextDeltaFields??[],c=s.includes(n.field),l=[...r];return l[i]={...a,[n.field]:c?Ft(o,n.delta):(o??``)+n.delta,__dedupeNextDeltaFields:s.filter(e=>e!==n.field)},e.part[n.messageID]=l,!0}default:return dn(e,t)}}function D(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function O(e){return typeof e==`string`&&e.length>0?e:void 0}function Zt(e,t,n){return`${e}:${t}:${n}`}function Qt(e){return typeof e?.created==`number`&&Number.isFinite(e.created)&&e.created>0?e.created:Date.now()}function k(e){let t=e.eventCreated;return typeof t==`number`&&Number.isFinite(t)&&t>0?t:void 0}function $t(e,t,n,r){let i=e.message[t],a=i?x(i,n):-1;if(a>=0&&i){let n=i[a],o=n.time?.created,s=!1,c={...n,time:{...n.time}};if((o===void 0||o<=0)&&typeof r?.created==`number`&&r.created>0&&(c.time={...c.time,created:r.created},s=!0),!Kt(n.agent)&&r?.agent&&(c.agent=r.agent,s=!0),!Kt(n.modelID)&&r?.modelID&&(c.modelID=r.modelID,s=!0),!Kt(n.providerID)&&r?.providerID&&(c.providerID=r.providerID,s=!0),!Kt(n.variant)&&r?.variant&&(c.variant=r.variant,s=!0),!n.model&&r?.model&&(c.model=r.model,s=!0),!s)return!1;let l=[...i];return l[a]=c,e.message[t]=l,!0}let o={id:n,sessionID:t,role:`assistant`,time:{created:Qt(r)},...r?.agent?{agent:r.agent}:{},...r?.modelID?{modelID:r.modelID}:{},...r?.providerID?{providerID:r.providerID}:{},...r?.variant?{variant:r.variant}:{},...r?.model?{model:r.model}:{}};return e.message[t]=i?[...i,o]:[o],!0}function en(e){let t=O(e.agent),n=D(e.model),r=n?O(n.id)??O(n.modelID):void 0,i=n?O(n.providerID):void 0,a=n?O(n.variant):void 0;return{...t?{agent:t}:{},...r?{modelID:r}:{},...i?{providerID:i}:{},...a?{variant:a}:{},...r||i||a?{model:{...i?{providerID:i}:{},...r?{modelID:r}:{},...a?{variant:a}:{}}}:{}}}function tn(e){let t=D(e);if(!t)return;let n=D(t.cache),r={...typeof t.input==`number`?{input:t.input}:{},...typeof t.output==`number`?{output:t.output}:{},...typeof t.reasoning==`number`?{reasoning:t.reasoning}:{},...n?{cache:{...typeof n.read==`number`?{read:n.read}:{},...typeof n.write==`number`?{write:n.write}:{}}}:{}};return Object.keys(r).length>0?r:void 0}function nn(e,t,n,r){let i=e.message[t];if(!i)return e.message[t]=[r],!0;let a=x(i,n);if(a<0)return e.message[t]=[...i,r],!0;let o=i[a],s=qt(o,r);if(Jt(o,s)&&o.time?.created===s.time?.created)return!1;let c=[...i];return c[a]=s,e.message[t]=c,!0}function rn(e,t,n){let r=e.message[t];if(!r)return;let i=x(r,n);if(i<0)return;let a=r[i]?.time?.created;return typeof a==`number`&&Number.isFinite(a)&&a>0?a:void 0}function an(e,t,n,r,i){let a=k(i);if(t===`session.step.started`)return $t(e,n,r,{created:a,...en(i)});if(t===`session.step.streamed`)return a?($t(e,n,r,{created:a}),nn(e,n,r,{id:r,sessionID:n,role:`assistant`,time:{created:rn(e,n,r)??a,streamed:a}})):!1;if(t===`session.step.ended`){$t(e,n,r,{created:a});let t=O(i.finish),o=tn(i.tokens),s=typeof i.cost==`number`&&Number.isFinite(i.cost)?i.cost:void 0;return nn(e,n,r,{id:r,sessionID:n,role:`assistant`,time:{created:rn(e,n,r)??Qt({created:a}),...a?{completed:a}:{}},...t?{finish:t}:{},...o?{tokens:o}:{},...s===void 0?{}:{cost:s}})}if(t===`session.step.failed`){$t(e,n,r,{created:a});let t=D(i.error),o=tn(i.tokens),s=typeof i.cost==`number`&&Number.isFinite(i.cost)?i.cost:void 0;return nn(e,n,r,{id:r,sessionID:n,role:`assistant`,time:{created:rn(e,n,r)??Qt({created:a}),...a?{completed:a}:{}},finish:`error`,...t?{error:{type:O(t.type)??`error`,message:O(t.message)??``,...typeof t.status==`number`?{status:t.status}:{}}}:O(i.error)?{error:{type:`error`,message:O(i.error)}}:{},...o?{tokens:o}:{},...s===void 0?{}:{cost:s}})}return!1}function on(e){if(Array.isArray(e))return e.flatMap(e=>{let t=D(e);return t&&t.type===`text`&&typeof t.text==`string`?[t.text]:[]}).join(`
|
|
4
4
|
`)}function sn(e,t,n,r){let i=Zt(n,t,r),a=e.findIndex(e=>e.id===i);return a>=0?a:e.map((e,t)=>({part:e,index:t})).filter(e=>e.part.type===t)[r]?.index??-1}function cn(e,t,n,r,i,a,o){$t(e,t,n,o);let s=e.part[n]?[...e.part[n]]:[],c=sn(s,r,n,i);if(c<0){let e={id:Zt(n,r,i),sessionID:t,messageID:n,type:r,text:``};s.push(e),c=s.length-1}let l=s[c],u=typeof a==`function`?a(l.text??``):a;return s[c]={...l,text:u},e.part[n]=s,!0}function ln(e,t){return e.findIndex(e=>e.id===t||e.callID===t||e.type===`tool`&&e.id===t)}function A(e,t,n,r,i,a,o){$t(e,t,n,o);let s=e.part[n]?[...e.part[n]]:[],c=ln(s,r);return c<0&&(s.push({id:r,sessionID:t,messageID:n,type:`tool`,tool:$e(i)??`tool`,callID:r,state:{status:`pending`,input:``,output:void 0,metadata:{}}}),c=s.length-1),s[c]=a(s[c]),e.part[n]=s,!0}function un(e,t,n){return e.message[t]?.find(t=>e.part[t.id]?.some(e=>e.type===`text`&&e.shellAction?.shellID===n))?.id}function dn(e,t){let n=String(t.type);if(n.startsWith(`session.compaction.`))return jt(e,t);let r=D(t.properties);if(!r)return!1;let i=O(r.sessionID);if(i&&(n===`session.shell.started`||n===`session.shell.ended`)){let a=D(r.shell),o=O(a?.id);if(!a||!o)return!1;let s=e.message[i]??[],c=un(e,i,o),l=c?s.find(e=>e.id===c):void 0,u=l?.id??(n===`session.shell.started`?Ze(t.id):void 0);if(!u||n===`session.shell.started`&&l)return!1;let d=at(i,{id:u,type:`shell`,shellID:o,command:a.command,status:a.status,exit:a.exit,output:r.output,time:{created:l?.time.created??k(r),...n===`session.shell.ended`?{completed:k(r)}:{}}});return!d||l&&Bt(l,d.info)&&Bt(e.part[u],d.parts)?!1:(e.message[i]=l?s.map(e=>e.id===u?d.info:e):[...s,d.info],e.part[u]=d.parts,!0)}if(i&&n===`session.synthetic`){let n=Ze(t.id);if(!n)return!1;let a=at(i,{id:n,type:`synthetic`,text:r.text,description:r.description,metadata:r.metadata,time:{created:k(r)}});if(!a)return!1;let o=e.message[i]??[],s=o.find(e=>e.id===n);return s&&Bt(s,a.info)&&Bt(e.part[n],a.parts)?!1:(e.message[i]=s?o.map(e=>e.id===n?a.info:e):[...o,a.info],e.part[n]=a.parts,!0)}if(n===`session.revert.committed`)return!1;let a=O(r.assistantMessageID);if(!i||!a)return!1;let o=typeof r.ordinal==`number`?r.ordinal:0,s={created:k(r)};if(n===`session.step.started`||n===`session.step.streamed`||n===`session.step.ended`||n===`session.step.failed`)return an(e,n,i,a,r);if(n===`session.text.started`)return cn(e,i,a,`text`,o,``,s);if(n===`session.text.delta`){let t=typeof r.delta==`string`?r.delta:``;return t?cn(e,i,a,`text`,o,e=>e+t,s):!1}if(n===`session.text.ended`)return cn(e,i,a,`text`,o,typeof r.text==`string`?r.text:``,s);if(n===`session.reasoning.started`)return cn(e,i,a,`reasoning`,o,``,s);if(n===`session.reasoning.delta`){let t=typeof r.delta==`string`?r.delta:``;return t?cn(e,i,a,`reasoning`,o,e=>e+t,s):!1}if(n===`session.reasoning.ended`)return cn(e,i,a,`reasoning`,o,typeof r.text==`string`?r.text:``,s);let c=O(r.id);if(!c)return!1;let l=O(r.name);if(n===`session.tool.input.started`)return A(e,i,a,c,l,e=>e,s);if(n===`session.tool.input.delta`){let t=typeof r.delta==`string`?r.delta:``;return t?A(e,i,a,c,l,e=>{let n=D(e.state)??{};if(O(n.status)&&n.status!==`pending`&&n.status!==`streaming`)return e;let r=typeof n.input==`string`?n.input+t:t;return{...e,state:{...n,status:`pending`,input:r}}},s):!1}if(n===`session.tool.input.ended`){let t=typeof r.text==`string`?r.text:``;return A(e,i,a,c,l,e=>{let n=D(e.state)??{};return{...e,state:{...n,input:t}}},s)}return n===`session.tool.called`?A(e,i,a,c,l,e=>{let t=D(e.state)??{},n=k(r);return{...e,state:{...t,status:`pending`,input:r.input??t.input??{},metadata:D(t.metadata)??{},...n===void 0?{}:{time:{...D(t.time),start:n}}}}},s):n===`session.tool.progress`?A(e,i,a,c,l,e=>{let t=D(e.state)??{};return{...e,state:{...t,metadata:D(r.metadata)??D(t.metadata)??{}}}},s):n===`session.tool.success`?A(e,i,a,c,l,e=>{let t=D(e.state)??{},n=k(r);return{...e,state:{...t,status:`completed`,input:t.input??r.input??{},output:on(r.content),metadata:D(r.metadata)??D(t.metadata)??{},...n===void 0?{}:{time:{...D(t.time),end:n}}}}},s):n===`session.tool.failed`&&A(e,i,a,c,l,e=>{let t=D(e.state)??{},n=k(r),i=D(r.error);return{...e,state:{...t,status:`error`,input:t.input??{},output:on(r.content),error:i?O(i.message)??O(r.error):O(r.error),metadata:D(r.metadata)??D(t.metadata)??{},...n===void 0?{}:{time:{...D(t.time),end:n}}}}},s)}function fn(e){if(typeof e.time?.completed==`number`)return!1;let t=e.finish;return!(typeof t==`string`&&t.length>0)}function pn(e){let t=e.id;return typeof t==`string`&&t.length>0?t:void 0}function j(e){return e.slim===!0}function mn(e,t){if(!e||e.length===0||!t.some(e=>j(e)))return t;let n=new Map;for(let t of e){let e=pn(t);e&&!j(t)&&n.set(e,t)}if(n.size===0)return t;let r=!1,i=t.map(e=>{if(!j(e))return e;let t=pn(e);if(!t)return e;let i=n.get(t);return i?(r=!0,i):e});return r?i:t}function hn(e,t){return e===t||e.length===t.length&&e.every((e,n)=>e===t[n])?t:e}function gn(e){let t=e.clientRole??e.role;return typeof t==`string`?t:``}function _n(e){return gn(e)!==`assistant`||!fn(e)}function vn(e,t,n){if(!e||e.length===0)return t;let r=mn(e,t);if(_n(n))return hn(r,e);let i=new Set;for(let e of r){let t=pn(e);t&&i.add(t)}let a=new Map,o=[],s,c=0;for(let t of e){let e=pn(t);if(e&&i.has(e)){s=e;continue}if(!e)continue;if(c+=1,!s){o.push(t);continue}let n=a.get(s);if(n){n.push(t);continue}a.set(s,[t])}if(c===0)return hn(r,e);let l=[...o];for(let e of r){l.push(e);let t=pn(e);if(!t)continue;let n=a.get(t);n&&l.push(...n)}return hn(l,e)}var M=e=>Object.freeze(e),yn=Object.freeze({initial:M({id:`initial`,onStale:`backfill`,messages:`insert-only`,parts:`replace`,preserveStreaming:`assistant`,protectOptimistic:`none`}),prepend:M({id:`history`,onStale:`drop`,messages:`insert-only`,parts:`skip-existing`,preserveStreaming:`assistant`,protectOptimistic:`none`}),recovery:M({id:`recovery`,onStale:`backfill`,messages:`upsert`,parts:`replace`,preserveStreaming:`assistant`,protectOptimistic:`none`}),"reconcile-page":M({id:`reconcile-page`,onStale:`backfill`,messages:`upsert`,parts:`replace`,preserveStreaming:`assistant`,protectOptimistic:`keep-unless-full`}),materialize:M({id:`materialize`,onStale:`backfill`,messages:`insert-only`,parts:`replace`,preserveStreaming:`assistant`,protectOptimistic:`none`})}),bn=M({id:`recovery-backfill`,onStale:`backfill`,messages:`insert-only`,parts:`skip-existing`,preserveStreaming:`assistant`,protectOptimistic:`none`}),xn=M({id:`send-gap-fill`,onStale:`backfill`,messages:`insert-only`,parts:`skip-existing`,preserveStreaming:`assistant`,protectOptimistic:`none`}),Sn=yn.initial;function Cn(e){let t=yn[e.purpose]??Sn;return!e.stale||t.onStale===`drop`?t:bn}function wn(e,t){return e.preserveStreaming===`none`?!1:e.preserveStreaming===`all`||t===`assistant`}var Tn=e=>structuredClone(e),En=e=>({transport:e.transport,generation:e.generation,directory:e.directory,sessionID:e.sessionID});function Dn(e){return JSON.stringify([e.transport,e.generation,e.directory,e.sessionID])}function On(e,t){return JSON.stringify([e.transport,e.generation,e.directory,e.sessionID,t])}function kn(e){return JSON.stringify([e.transport,e.generation])}function An(e,t){return e.created===t.created?e.messageID<t.messageID?-1:+(e.messageID>t.messageID):e.created-t.created}function jn(e){let t=e.time?.created;return{created:typeof t==`number`&&Number.isFinite(t)?t:0,messageID:e.id}}function Mn(e){return _n(e)}function Nn(e){return j(e)?`slim`:`full`}function Pn(e){return e.some(e=>j(e))?`slim`:`full`}var Fn=e=>{if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(Fn);let t=e,n={};for(let e of Object.keys(t).sort()){let r=t[e];r!==void 0&&(n[e]=Fn(r))}return n},In=e=>{let t=new Uint8Array(e),n=``;for(let e of t)n+=e.toString(16).padStart(2,`0`);return n};async function Ln(e,t){let n=JSON.stringify(Fn({info:e,parts:t})),r=new TextEncoder().encode(n);return{hash:In(await crypto.subtle.digest(`SHA-256`,r)),byteSize:r.byteLength}}var Rn=e=>({scope:En(e.scope),messageID:e.messageID,info:Tn(e.info),parts:Tn(e.parts),partCompleteness:e.partCompleteness.slice(),completeness:e.completeness,contentHash:e.contentHash,byteSize:e.byteSize,lastAccessedAt:e.lastAccessedAt,sortKey:{created:e.sortKey.created,messageID:e.sortKey.messageID}}),zn=e=>{let t=0;return()=>{let n=e();return t=n>t?n:t+1,t}},Bn=(e,t)=>{let n=t.slice().sort((e,t)=>An(e.sortKey,t.sortKey)).map(Rn);return{scope:En(e),records:n,byteSize:n.reduce((e,t)=>e+t.byteSize,0)}},Vn=e=>Tn(e),Hn=e=>En(e),Un=(e=Date.now)=>zn(e),Wn=e=>Rn(e),Gn=(e,t)=>Bn(e,t.slice());function Kn(e){return Mn(e.info)?e.existing?.completeness===`full`&&e.incomingCompleteness===`slim`?{status:`skipped`,reason:`slim-downgrade`}:e.incomingHash!==void 0&&e.existing?.contentHash===e.incomingHash?{status:`skipped`,reason:`unchanged`}:{status:`written`}:{status:`skipped`,reason:`not-settled`}}var qn=[`text`,`output`],Jn={pending:1,started:2,running:3,completed:4,error:4};function Yn(e,t){return e.filter(e=>!!e?.id&&!t.has(e.type))}function Xn(e,t){if(!e||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||JSON.stringify(r)!==JSON.stringify(i))return!1}return!0}function Zn(e){let t=e.state?.time?.end;if(typeof t==`number`)return t;let n=e.time?.end;return typeof n==`number`?n:void 0}function Qn(e,t){let n=e[t];return typeof n==`string`?n:void 0}function $n(e){return Zn(e)===void 0&&qn.some(t=>{let n=Qn(e,t);return typeof n==`string`&&n.length>0})}function er(e){let t=e.state;if(!(!t||typeof t!=`object`))return t}function tr(e){let t=er(e)?.status;return typeof t==`string`?t:void 0}function nr(e){return e?Jn[e]??0:0}function rr(e,t){if($n(e))return!0;if(Zn(e)===void 0){if(e.type===`tool`){let n=tr(e);return n===`completed`||n===`error`?t:!0}return!0}return t}function ir(e){let t=e.state?.time;if(!t||typeof t!=`object`)return;let n=typeof t.start==`number`?t.start:void 0,r=typeof t.end==`number`?t.end:void 0;if(n!==void 0||r!==void 0)return{start:n,end:r}}function ar(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length>0}function or(e,t,n){if(e.type!==`tool`||t.type!==`tool`)return n;let r=er(e);if(!r)return n;let i=er(n)??{},a=er(t)??{},o={...i},s=!1,c=tr(e),l=tr(t);nr(c)>nr(l)&&c&&(o={...o,status:c},s=!0);let u=r.input,d=a.input;ar(u)&&!ar(d)&&(o={...o,input:u},s=!0);let f=r.output,p=a.output;typeof f==`string`&&f.length>0?(typeof p!=`string`||p.length<f.length)&&(typeof p!=`string`||p.length===0||f.startsWith(p))&&(o={...o,output:f},s=!0):f!==void 0&&p===void 0&&(o={...o,output:f},s=!0);let m=r.metadata;return ar(m)&&!ar(a.metadata)&&(o={...o,metadata:m},s=!0),s?n===t?{...t,state:o}:{...n,state:o}:n}function sr(e,t){if(!e||Zn(t)!==void 0)return t;let n=t;for(let r of qn){let i=Qn(e,r);if(!i)continue;let a=Qn(t,r);if(typeof a==`string`&&a.length>=i.length||typeof a==`string`&&a.length>0&&!i.startsWith(a))continue;n===t&&(n={...t});let o=n;o[r]=i}let r=ir(e);if(r){let e=ir(t),i=e?.start??r.start,a=e?.end??r.end;if(i!==e?.start||a!==e?.end){n===t&&(n={...t});let e=n;e.state={...n.state??{},time:{start:i,end:a}}}}return n=or(e,t,n),n}function cr(e,t){if(!e||e.length===0||!t.some(e=>j(e)))return t;let n=new Map;for(let t of e)t.id&&!j(t)&&n.set(t.id,t);if(n.size===0)return t;let r=!1,i=t.map(e=>{if(!j(e)||!e.id)return e;let t=n.get(e.id);return t?(r=!0,t):e});return r?i:t}function lr(e){return e.__yuriOptimistic===!0}function ur(e){return!!(e&&e.length>0&&e.some(lr))}function dr(e){return e.length===0||e.some(e=>j(e))}function fr(e,t,n,r,i,a){if(a===`keep-unless-full`&&e&&ur(e)&&dr(t))return e;let o=cr(e,t);if(!e||e.length===0||!r)return o;let s=new Map(e.map(e=>[e.id,e])),c=o,l=!1;for(let e=0;e<o.length;e+=1){let t=o[e],n=sr(s.get(t.id),t);n!==t&&(l||(c=[...o]),c[e]=n,l=!0)}let u=new Set(o.map(e=>e.id)),d=o.some(e=>j(e)),f=e.filter(e=>!!e?.id&&!u.has(e.id)&&!n.has(e.type)&&(rr(e,i)||d&&!j(e)));if(f.length===0)return c;let p=new Set(f.map(e=>e.id)),m=new Map,h=[];for(let t of e)p.has(t.id)?h.push(t):u.has(t.id)&&h.length>0&&(m.set(t.id,h),h=[]);let g=[];for(let e of c){for(let t of m.get(e.id)??[])g.push(t);g.push(e)}for(let e of h)g.push(e);return g}var pr=e=>e,mr=e=>{let t=pr(e).finish;return typeof t==`string`&&t.length>0},hr=e=>typeof pr(e).time?.completed==`number`,gr=e=>!!pr(e).error;function _r(e,t){let n=pr(t),r=n.finish,i=n.time?.completed,a=n.time?.streamed,o=n.error,s=e.tokens,c=t.tokens,l=!mr(e)&&typeof r==`string`&&r.length>0,u=!hr(e)&&typeof i==`number`,d=e.time.streamed===void 0&&typeof a==`number`&&Number.isFinite(a),f=!gr(e)&&!!o,p=!Wt(s)&&Wt(c);if(!l&&!u&&!d&&!f&&!p)return e;let m={...e};return l&&(m.finish=r),(u||d)&&(m.time={...pr(e).time,...u?{completed:i}:{},...d?{streamed:a}:{}}),f&&(m.error=o),p&&(m.tokens=c),m}function vr(e,t,n,r){if(t.length===0)return e;let i=new Map(t.map(e=>[e.id,e])),a=!1,o=[];for(let t of e){let e=n(t,i.get(t.id));e!==t&&(a=!0),o.push(e)}let s=new Set(e.map(e=>e.id));if(!t.some(e=>s.has(e.id)))return r===`prepend`?[...t,...o]:r===`by-created`?yr(o,t):[...o,...t];let c=new Map(t.map(e=>[e.id,e]));for(let e of o)c.set(e.id,e);let l=Be(e.map(e=>e.id),t.map(e=>e.id)).map(e=>c.get(e));return!a&&l.length===e.length&&l.every((t,n)=>t===e[n])?e:l}function yr(e,t){let n=e.slice();for(let e of t){let t=jn(e),r=n.length;for(let e=0;e<n.length;e+=1)if(An(t,jn(n[e]))<0){r=e;break}n.splice(r,0,e)}return n}function br(e,t,n){return vr(e,t,(e,t)=>t?_r(e,t):e,n)}function xr(e,t,n){return vr(e,t,(e,t)=>!t||JSON.stringify(e)===JSON.stringify(t)?e:qt(e,t),n)}function Sr(e,t,n,r={}){let i=r.skipPartTypes??new Set,a=r.merge??Sn,o=r.placeUnanchoredNewMessages??`append`,s=n.filter(e=>!!e?.info?.id),c=s.map(e=>e.info),l=e.message[t],u=l??[],d=a.messages===`upsert`?xr(u,c,o):br(u,c,o),f=d!==u||l===void 0&&s.length===0,p=!1,m={...e.part},h=a.parts===`skip-existing`;for(let e of s){let t=e.info.id;if(h&&m[t])continue;let n=e.info.role===`assistant`,r=m[t],o=fr(r,Yn(e.parts??[],i),i,wn(a,e.info.role),fn(e.info),a.protectOptimistic);(r?Xn(r,o):o.length===0&&!n)||o.length===0&&!n||(m[t]=o,p=!0)}return{message:f?{...e.message,[t]:d}:e.message,part:p?m:e.part,messages:d,messagesChanged:f,partsChanged:p}}function Cr(e){if(typeof e.time?.completed==`number`)return!1;let t=e.finish;return!(typeof t==`string`&&t.length>0)}function wr(e){let t=e.messages;if(!t)return{hasMessages:!1,renderable:!1,missingPartMessageIDs:[]};let n=t.length>0?t[t.length-1]?.id:void 0,r=[];for(let i of t)i.role===`assistant`&&(e.parts[i.id]||i.id===n&&Cr(i)||r.push(i.id));return{hasMessages:!0,renderable:r.length===0,missingPartMessageIDs:r}}var Tr=(e,t)=>e<t?-1:+(e>t);function Er(e){return e.filter(e=>!!e?.id)}function Dr(e,t){if(t.length===0)return{...e,confirmed:[]};let n=[...e.session],r=new Map(e.part.map(e=>[e.id,Er(e.part)])),i=[];for(let e of t){if(n.findIndex(t=>t.id===e.message.id)<0){n.push(e.message),r.set(e.message.id,Er(e.parts));continue}let t=r.get(e.message.id);if(t&&t.length>0){i.push(e.message.id);continue}r.set(e.message.id,Er(e.parts))}return{cursor:e.cursor,complete:e.complete,session:n,part:[...r.entries()].sort((e,t)=>Tr(e[0],t[0])).map(([e,t])=>({id:e,part:t})),confirmed:i}}var Or={kind:`unknown`,loadedTurns:0},kr=3e4,Ar=12e5,jr={project:``,projectMeta:void 0,icon:void 0,provider:{all:[],connected:[],default:{}},config:{},path:{state:``,config:``,worktree:``,directory:``,home:``},status:`loading`,agent:[],command:[],session:[],sessionTotal:0,session_status:{},session_status_observed_at:{},session_status_event_at:{},session_status_event_sequence:{},session_interrupt_acknowledged_at:{},session_execution_version:{},session_status_snapshot_at:void 0,session_error_at:{},session_execution_recovery:{},session_diff:{},todo:{},permission:{},question:{},lsp:[],vcs:void 0,limit:20},Mr={ready:!1,path:{state:``,config:``,worktree:``,directory:``,home:``},projects:[],providers:{all:[],connected:[],default:{}},providerAuth:{},config:{},reload:void 0,sessionTodo:{}};function Nr(e,t){return e===void 0||t===void 0?!1:t>e}var Pr=class extends Error{};function Fr(e,t,n){if(n===`reconcile-page`)return e??Or;let r=0;typeof t.turnCount==`number`&&Number.isFinite(t.turnCount)?r=Math.max(0,Math.floor(t.turnCount)):typeof t.requestedTurnLimit==`number`&&Number.isFinite(t.requestedTurnLimit)?r=Math.max(0,Math.floor(t.requestedTurnLimit)):t.records.length>0&&(r=1);let i=e?.loadedTurns??0,a=n===`prepend`?i+r:r;if(t.complete)return{kind:`exhausted`,loadedTurns:a};let o=typeof t.cursor==`string`&&t.cursor.length>0?t.cursor:void 0;if(!o)throw new Pr(`session message page: complete=false requires non-empty cursor`);if(n===`prepend`&&e?.kind===`has-more`&&e.cursor===o)throw new Pr(`session message page: prepend returned the same cursor without progress`);if(t.records.length===0&&(n!==`prepend`||e?.kind!==`has-more`||e.cursor===o)&&n!==`initial`)throw new Pr(`session message page: complete=false with zero records makes no progress`);return{kind:`has-more`,cursor:o,loadedTurns:a}}function Ir(e,t){return!e||!t?e===t:e.kind!==t.kind||e.loadedTurns!==t.loadedTurns?!1:e.kind===`has-more`&&t.kind===`has-more`?e.cursor===t.cursor:!0}function Lr(e,t,n,r){let i=Nr(r.capturedRevision,r.liveRevision),a=Cn({purpose:r.purpose,stale:i}),o=e.session_history_boundary?.[t];if(!n.ok)return{applied:!1,merge:a,changed:!1,messagesChanged:!1,partsChanged:!1,boundaryChanged:!1,message:e.message,part:e.part,messages:e.message[t]??[],boundary:void 0,meta:void 0,confirmedOptimisticIDs:[],commands:[],error:n.error};if(i&&a.onStale===`drop`){let n=e.message[t]??[];if(n.length>0)return{applied:!1,merge:a,changed:!1,messagesChanged:!1,partsChanged:!1,boundaryChanged:!1,message:e.message,part:e.part,messages:n,boundary:void 0,meta:void 0,confirmedOptimisticIDs:[],commands:[]}}let s=r.optimistic??[],c=Dr({session:n.records.map(e=>e.info),part:n.records.map(e=>({id:e.info.id,part:e.parts??[]})),cursor:n.cursor,complete:n.complete},s),l=Sr(e,t,c.session.map(e=>({info:e,parts:c.part.find(t=>t.id===e.id)?.part??[]})),{skipPartTypes:r.skipPartTypes,merge:a,placeUnanchoredNewMessages:r.purpose===`prepend`?`prepend`:r.purpose===`reconcile-page`?`by-created`:`append`}),u;try{u=Fr(o,{ok:!0,records:n.records,cursor:c.cursor,complete:c.complete,turnCount:n.turnCount,requestedTurnLimit:n.requestedTurnLimit},r.purpose)}catch(n){if(!(n instanceof Pr))throw n;return{applied:!1,merge:a,changed:!1,messagesChanged:!1,partsChanged:!1,boundaryChanged:!1,message:e.message,part:e.part,messages:e.message[t]??[],boundary:void 0,meta:void 0,confirmedOptimisticIDs:[],commands:[],error:n.message}}let d=!Ir(o,u),f=l.messagesChanged,p=l.partsChanged,m=f||p||d,h=[];c.confirmed.length>0&&h.push({type:`clear-optimistic`,messageIDs:c.confirmed});let g=d||!o?u:o;return{applied:!0,merge:a,changed:m,messagesChanged:f,partsChanged:p,boundaryChanged:d,message:l.message,part:l.part,messages:l.messages,boundary:g,meta:{limit:g.loadedTurns,cursor:g.kind===`has-more`?g.cursor:void 0,complete:g.kind===`exhausted`},confirmedOptimisticIDs:c.confirmed,commands:h}}var Rr=new Set([`tool`,`reasoning`,`file`,`text`]),zr=new Set([`tool`,`reasoning`,`file`]);function Br(e){return e.some(e=>j(e)&&Rr.has(e.type))}function Vr(e,t){let n=!1,r=!1;for(let t of e)zr.has(t.type)&&(n=!0,j(t)&&(r=!0));return n?r?!0:t?fn(t):!1:!1}var Hr=e=>{if(!e)return``;let t=e.clientRole??e.role;return typeof t==`string`?t:``};function Ur(e,t){return Xe(e,t)}function Wr(e){let t=0;for(let n of e.messageOrder)Ur(e.messagesByID[n],e.partsByMessageID[n])&&(t+=1);return t}var Gr=(e,t)=>{let n=e.messageOrder.lastIndexOf(t);if(n<0)return[];let r=[];for(let i=n+1;i<e.messageOrder.length;i+=1){let n=e.messageOrder[i],a=e.messagesByID[n];if(!a)continue;if(Ur(a,e.partsByMessageID[n]))break;if(Hr(a)!==`assistant`)continue;let o=a.parentID;typeof o==`string`&&o.length>0&&o!==t||r.push(a)}return r},Kr=(e,t)=>fn(e)?!0:Array.isArray(t)&&t.length>0;function qr(e){let t;for(let n=e.messageOrder.length-1;n>=0;--n){let r=e.messageOrder[n];if(Ur(e.messagesByID[r],e.partsByMessageID[r])){t=r;break}}return t?Gr(e,t).some(t=>Kr(t,e.partsByMessageID[t.id])):!1}function Jr(e){return e.materializeActive?`p2`:e.prependActive||e.earlierHistoryLoaded?`p1`:e.p0Satisfied?`p0`:`idle`}var Yr=new Set([`stop`,`length`]);function Xr(e){let t=e.messageOrder[e.messageOrder.length-1];if(!t)return!1;let n=e.messagesByID[t];if(!n||Hr(n)!==`assistant`||n.error)return!1;let r=n.finish;return typeof r!=`string`||!Yr.has(r)?!1:typeof n.time?.completed!=`number`||r===`stop`&&!Wt(n.tokens)}function Zr(e,t){return t.kind===`has-more`?{sessionID:e,boundary:t,hasPreviousPage:!0,isComplete:!1,cursor:t.cursor,loadedTurns:t.loadedTurns}:t.kind===`exhausted`?{sessionID:e,boundary:t,hasPreviousPage:!1,isComplete:!0,cursor:null,loadedTurns:t.loadedTurns}:{sessionID:e,boundary:t,hasPreviousPage:!1,isComplete:!1,cursor:null,loadedTurns:t.loadedTurns}}function Qr(e){let t={},n={},r=[];for(let i of e.messages){if(!i?.id)continue;r.push(i.id),t[i.id]=i;let a=e.parts[i.id];a&&(n[i.id]=a)}return{sessionID:e.sessionID,messageOrder:r,messagesByID:t,partsByMessageID:n,boundary:e.boundary,liveRevision:e.liveRevision??0}}var $r=`message.updated,message.removed,message.part.updated,message.part.removed,message.part.delta,session.step.started,session.step.streamed,session.shell.started,session.shell.ended,session.step.ended,session.step.failed,session.text.started,session.text.delta,session.text.ended,session.reasoning.started,session.reasoning.delta,session.reasoning.ended,session.tool.input.started,session.tool.input.delta,session.tool.input.ended,session.tool.called,session.tool.progress,session.tool.success,session.tool.failed,session.compaction.started,session.compaction.delta,session.compaction.ended,session.compaction.failed,session.synthetic,session.revert.committed`.split(`,`);function ei(e){return $r.includes(e)}function N(e){return e.trim()}function ti(e){return`${N(e.directory)}\n${e.sessionID}`}function ni(e,t){return e.session_history_boundary?.[t]??Or}function ri(e){return e.filter(e=>!!e?.id)}function ii(e,t){return e.kind!==t.kind||e.loadedTurns!==t.loadedTurns?!1:e.kind===`has-more`&&t.kind===`has-more`?e.cursor===t.cursor:!0}function ai(e,t,n){n.applied&&e.setState(e=>{let r={};if(n.messagesChanged&&(r.message=n.message),n.partsChanged&&(r.part=n.part),n.boundary&&(n.boundaryChanged||!e.session_history_boundary?.[t]))r.session_history_boundary={...e.session_history_boundary??{},[t]:n.boundary};else if(n.boundary&&n.boundaryChanged===!1){let i=e.session_history_boundary?.[t];(!i||!ii(i,n.boundary))&&(r.session_history_boundary={...e.session_history_boundary??{},[t]:n.boundary})}return!r.message&&!r.part&&!r.session_history_boundary&&n.boundary&&(r.session_history_boundary={...e.session_history_boundary??{},[t]:n.boundary}),!r.message&&!r.part&&!r.session_history_boundary?{}:r})}function oi(e,t,n){let r=e.getState(),i=n.page,a=Lr(r,t,{ok:!0,records:i.records.map(e=>({info:e.info,parts:e.parts?[...e.parts]:[]})),cursor:i.cursor,complete:i.complete,turnCount:i.turnCount,requestedTurnLimit:i.requestedTurnLimit},{purpose:n.purpose,skipPartTypes:n.skipPartTypes,optimistic:n.optimistic?n.optimistic.map(e=>({message:e.message,parts:[...e.parts]})):void 0,capturedRevision:n.capturedLiveRevision,liveRevision:n.liveRevision});return a.applied?(ai(e,t,a),{applied:!0,changed:a.changed,boundary:a.boundary,meta:a.meta,confirmedOptimisticIDs:a.confirmedOptimisticIDs}):{applied:!1,changed:!1,error:a.error}}function si(e,t){if(t.length===0)return{applied:!1,changed:!1};let n=e.getState(),r={message:{...n.message??{}},part:{...n.part??{}}},i=!1,a=!1,o;for(let e of t){if(!ei(e.type))continue;i=!0;let t=Xt(r,e),n=typeof t==`boolean`?t:t.changed,s=typeof t==`boolean`?void 0:t.materialization;s&&!o&&(o=s),n&&(a=!0)}return i?a?(e.setState({message:r.message,part:r.part}),{applied:!0,changed:!0,...o?{materialization:o}:{}}):{applied:!0,changed:!1,...o?{materialization:o}:{}}:{applied:!1,changed:!1}}function ci(e,t){return si(e,[t.event])}function li(e,t){return si(e,t.events)}function ui(e,t,n){if(n.records.length===0)return{applied:!1,changed:!1};let r=e.getState(),i=Sr({message:r.message??{},part:r.part??{}},t,n.records.map(e=>({info:e.info,parts:e.parts?[...e.parts]:[]})),{skipPartTypes:n.skipPartTypes,merge:n.merge});return!i.messagesChanged&&!i.partsChanged?{applied:!0,changed:!1}:(e.setState({...i.messagesChanged?{message:i.message}:{},...i.partsChanged?{part:i.part}:{}}),{applied:!0,changed:!0})}function di(e,t,n){let r=e.getState(),i=r.message?.[t],a=r.part?.[n]!==void 0;if(!i&&!a)return{applied:!0,changed:!1};let o={...r.message??{}},s=!1;if(i){let e=[...i],r=e.findIndex(e=>e.id===n);r>=0&&(e.splice(r,1),o[t]=e,s=!0)}let c={...r.part??{}},l=!1;return c[n]!==void 0&&(delete c[n],l=!0),!s&&!l?{applied:!0,changed:!1}:(e.setState({...s?{message:o}:{},...l?{part:c}:{}}),{applied:!0,changed:!0})}function fi(e,t,n,r,i){r.setOptimisticShadow?.({directory:i,sessionID:t,message:n.message,parts:n.parts});let a=e.getState(),o={...a.message??{}},s={...a.part??{}},c=o[t]?[...o[t]]:[];return c.some(e=>e.id===n.message.id)||c.push(n.message),o[t]=c,s[n.message.id]=ri(n.parts),e.setState({message:o,part:s}),{applied:!0,changed:!0}}function pi(e,t,n,r,i){r.clearOptimisticShadow?.({directory:i,sessionID:t,messageID:n});let a=e.getState(),o={...a.message??{}},s={...a.part??{}},c=!1,l=o[t];if(l){let e=[...l],r=e.findIndex(e=>e.id===n);r>=0&&(e.splice(r,1),o[t]=e,c=!0)}return s[n]!==void 0&&(delete s[n],c=!0),c&&e.setState({message:o,part:s}),{applied:!0,changed:c}}function mi(e,t,n,r){return n.clearOptimisticShadow?.({directory:r,sessionID:e,messageID:t}),{applied:!0,changed:!1}}function hi(e,t){let n=e.getState(),r=n.message?.[t],i=n.session_history_boundary?.[t],a=!!(r&&r.length>0),o=i!==void 0,s=new Set;if(r)for(let e of r)e?.id&&s.add(e.id);let c=!1,l={...n.part??{}};for(let e of s)l[e]!==void 0&&(delete l[e],c=!0);for(let[e,n]of Object.entries(l))s.has(e)||n?.some(e=>e.sessionID===t)&&(delete l[e],c=!0);if(!a&&!o&&!c)return!1;let u={...n.message??{}};delete u[t];let d={...n.session_history_boundary??{}};return delete d[t],e.setState({message:u,part:l,session_history_boundary:d}),!0}function gi(e,t,n){let r=hi(e,t);if(!n.page)return{applied:!0,changed:r};let i=oi(e,t,{type:`http-page`,purpose:`initial`,page:n.page,capturedLiveRevision:n.capturedLiveRevision,liveRevision:n.liveRevision,skipPartTypes:n.skipPartTypes});return{...i,changed:r||i.changed,applied:i.applied||r}}function _i(e){let t=new Map,n=new Map,r=r=>{let i=ti(r);if(n.has(i))return;let a=N(r.directory),o=e.getStore(a),s=r.sessionID,c=o.getState().message?.[s],l=ni(o.getState(),s),u=new Map;for(let e of c??[])u.set(e.id,o.getState().part?.[e.id]);let d=o.subscribe(e=>{let n=e.message?.[s],a=ni(e,s),o=!1,d=new Map;for(let t of n??[]){let n=e.part?.[t.id];d.set(t.id,n),u.get(t.id)!==n&&(o=!0)}u.size!==d.size&&(o=!0);let f=n!==c,p=ii(a,l);if(c=n,l=a,u=d,!f&&!o&&p)return;let m=t.get(i);if(!(!m||m.size===0))for(let e of m)e(r)});n.set(i,d)},i=e=>{let r=t.get(e);if(r&&r.size>0)return;let i=n.get(e);i&&(i(),n.delete(e)),t.delete(e)},a={getTranscript(t){let n=N(t.directory),r=e.getStore(n).getState(),i=t.sessionID,a=r.message?.[i]??[],o=e.getLiveRevision?.(n,i)??0;return Qr({sessionID:i,messages:a,parts:r.part??{},boundary:ni(r,i),liveRevision:o})},getPagination(t){let n=N(t.directory),r=e.getStore(n).getState();return Zr(t.sessionID,ni(r,t.sessionID))},getRequestState(t){let n=N(t.directory);return e.getRequestState?.(n,t.sessionID)??{sessionID:t.sessionID,status:`idle`}},getHydrationState(e){let t=a.getTranscript(e),n=qr(t);return{sessionID:e.sessionID,p0Satisfied:n,phase:Jr({p0Satisfied:n,earlierHistoryLoaded:Wr(t)>1})}},getMessage(e,t){return a.getTranscript(e).messagesByID[t]},getParts(t,n){let r=N(t.directory);return e.getStore(r).getState().part?.[n]??[]},hasSession(t){let n=N(t.directory),r=e.getStore(n).getState().message;return r?Object.prototype.hasOwnProperty.call(r,t.sessionID):!1},apply(t,n){let r=N(t.directory),i=e.getStore(r),a=t.sessionID;switch(n.type){case`http-page`:return oi(i,a,n);case`sse-event`:return ci(i,n);case`sse-event-batch`:return li(i,n);case`optimistic-add`:return fi(i,a,n,e,r);case`optimistic-confirm`:return mi(a,n.messageID,e,r);case`optimistic-remove`:return pi(i,a,n.messageID,e,r);case`reset`:return gi(i,a,n);case`materialize-snapshots`:return ui(i,a,n);case`remove-message`:return di(i,a,n.messageID);case`revert-committed`:{let e=i.getState(),t=e.message?.[a];if(!Array.isArray(t)||t.length===0)return{applied:!0,changed:!1};let r=t.findIndex(e=>e.id===n.to);if(r<0)return{applied:!0,changed:!1};let o=t.slice(r),s=t.slice(0,r),c={...e.message??{}};c[a]=s;let l={...e.part??{}};for(let e of o)delete l[e.id];return i.setState({message:c,part:l}),{applied:!0,changed:o.length>0}}default:return{applied:!1,changed:!1}}},subscribe(e,n){let a=ti(e),o=t.get(a);return o||(o=new Set,t.set(a,o)),o.add(n),r(e),()=>{let e=t.get(a);e&&(e.delete(n),i(a))}}};return a}var vi=new Set,yi=new Set;function bi(e,t){return`${e}\n${t}`}function xi(){for(let e of yi)e()}function Si(e,t){!e||!t||(vi.add(bi(e,t)),xi())}function Ci(e,t){!e||!t||vi.delete(bi(e,t))&&xi()}function wi(e,t){if(!e)return!1;if(t)return vi.has(bi(t,e));let n=`\n${e}`;for(let e of vi)if(e.endsWith(n))return!0;return!1}function Ti(e){return yi.add(e),()=>{yi.delete(e)}}var Ei=[],Di=new Map,Oi=new Map,ki=0,Ai=()=>{let e=Ei.findIndex(e=>e.priority===`user`);if(e>=0){let[t]=Ei.splice(e,1);return t}return Ei.shift()},ji=()=>{for(;ki<4;){let e=Ai();if(!e)return;Di.delete(e.key),ki+=1,Promise.resolve().then(()=>e.run()).then(t=>{e.resolve(t)},t=>{e.reject(t)}).finally(()=>{--ki,Oi.delete(e.key),ji()})}};function Mi(e,t,n){let r=n?.priority??`background`,i=Oi.get(e);if(i){let t=Di.get(e);return t&&r===`user`&&t.priority!==`user`&&(t.priority=`user`),i}let a,o,s=new Promise((e,t)=>{a=e,o=t}),c={key:e,priority:r,run:()=>t(),resolve:e=>{a(e)},reject:o};return Ei.push(c),Di.set(e,c),Oi.set(e,s),ji(),s}var Ni=null,Pi=new Map,Fi=e=>Pi.get(e)?.at(-1);function Ii(e,t,n){if(!e.hostId)throw Error(`Local transcripts use the SyncProvider binding`);let r=d(e),i={repository:t,scope:n},a=Pi.get(r)??[];return a.push(i),Pi.set(r,a),zi(),()=>{let e=Pi.get(r),t=e?.indexOf(i)??-1;if(!e||t<0)return;let n=t===e.length-1;e.splice(t,1),e.length||Pi.delete(r),n&&zi()}}var Li=0,Ri=new Set;function zi(){Li+=1;for(let e of Ri)e()}function Bi(e){return e}function Vi(e){return Ri.add(e),()=>{Ri.delete(e)}}function Hi(){return Li}function Ui(e){return Ni?.repository===e?e:(Ni={kind:`query`,repository:e},zi(),e)}function Wi(){Ni&&(Ni=null,zi())}function P(e){return e?.hostId?Fi(d(e))?.repository??null:Ni?.repository??null}function Gi(e){let t=P(e);if(!t)throw Error(`TranscriptRepository is not bound — SyncProvider must mount first`);return t}function F(e,t){let n=P();if(n)return n;let r=Bi(t);return _i({getStore:e=>r})}function I(e,t,n){if(typeof e!=`string`){if(e.hostId){let n=Fi(d(e));if(!n)throw Error(`Remote transcript Location is not bound`);return n.scope(t)}e=e.directory}return{directory:e.trim(),sessionID:t,...n?.transport===void 0?{}:{transport:n.transport},...n?.generation===void 0?{}:{generation:n.generation}}}function Ki(e){try{let t=P(),i=n(),a=r();return t?.getCacheBudget?.().listCanonicalScopesForSession(e,{transport:i,generation:a})?.map(e=>I(e.directory,e.sessionID,{transport:e.transport,generation:e.generation}))??[]}catch{return[]}}function qi(e,t){let n=P(e.location);return n?n.apply(e,t):null}async function Ji(e,t,n){let r=Gi(typeof e==`string`?void 0:e);if(typeof r.fetchPreviousPage!=`function`)throw Error(`TranscriptRepository does not support fetchPreviousPage`);await r.fetchPreviousPage(I(e,t),n)}async function Yi(e,t){let n=Gi(typeof e==`string`?void 0:e);if(typeof n.ensureInitial!=`function`)throw Error(`TranscriptRepository does not support ensureInitial`);await n.ensureInitial(I(e,t))}async function Xi(e,t){let n=Gi(typeof e==`string`?void 0:e),r=I(e,t);if(typeof n.destructiveReset==`function`){await n.destructiveReset(r);return}if(typeof n.ensureInitial!=`function`)throw Error(`TranscriptRepository does not support retryInitial`);await n.ensureInitial(r)}async function Zi(e,t,n){let r=Gi(typeof e==`string`?void 0:e);if(typeof r.refreshFromAuthority!=`function`)throw Error(`TranscriptRepository does not support refreshFromAuthority`);if(n?.background){await r.refreshFromAuthority(I(e,t));return}let i=typeof e==`string`?e:d(e);Si(i,t);try{await r.refreshFromAuthority(I(e,t))}finally{Ci(i,t)}}async function Qi(e,t,n,r){let i=Gi(typeof e==`string`?void 0:e);if(typeof i.materializeMessage!=`function`)throw Error(`TranscriptRepository does not support materializeMessage`);let a=I(e,t);await Mi(`${typeof e==`string`?e:d(e)}\n${t}\n${n}`,()=>i.materializeMessage(a,n),{priority:r?.priority??`background`})}function $i(e,t,n){let r=P(typeof e==`string`?void 0:e);return!r||typeof r.getMessageMaterializationState!=`function`?{sessionID:t,messageID:n,status:`idle`}:r.getMessageMaterializationState(I(e,t),n)}function ea(e,t){P(typeof e==`string`?void 0:e)?.purgeSession?.(I(e,t))}var L=null;function ta(e){L&&L!==e&&L.cancelAll(`reregister`),L=e}function na(e){L?.captureCheckpoints(e)}function ra(e){L?.onCompensation(e)}async function ia(e){return L?L.ensureOnObserve(e):null}function aa(e){L?.cancelAll(e)}var oa=e=>typeof e==`number`&&Number.isFinite(e)?e:0,sa=e=>oa(e.input)+oa(e.output)+oa(e.reasoning)+oa(e.cache?.read)+oa(e.cache?.write),ca=e=>e?.type===`compaction`,la=e=>!!e&&e.some(ca),ua=(e,t)=>e.clientRole===`compaction`||e.type===`compaction`||la(t),da=(e,t)=>{for(let n=e.length-1;n>=0;--n){let r=e[n],i=r.id?t(r.id):void 0;if(ua(r,i)){let e=i?.find(ca)?.status??r.status;if(e===`running`||e===`failed`)continue;return{compacted:!0}}if(r.role!==`assistant`)continue;let a=r.tokens;if(!a)continue;let o=sa(a);if(o>0)return{messageId:r.id??``,totalTokens:o,tokens:a}}return null},fa=(e,t,n)=>{if(!e)return null;let r=`compacted`in e,i=r?0:e.totalTokens;return{...r?{pending:!0}:{},totalTokens:i,percentage:t>0?Math.round(i/t*100):0,contextLimit:t||0,outputLimit:n||void 0,normalizedOutput:!r&&n>0?Math.round(oa(e.tokens.output)/n*100):void 0,thresholdLimit:t>0?t:2e5,lastMessageId:r?void 0:e.messageId}},pa=[],ma=[],ha={sessionID:``,messageOrder:[],messagesByID:{},partsByMessageID:{},boundary:Or,liveRevision:0};Zr(``,Or);var ga={sessionID:``,phase:`idle`,p0Satisfied:!1};function R(e,t){return F(e,t)}var _a=new Set;function va(e,t){return`${e}\n${t}`}function ya(e,t){if(!t)return;let n=va(e,t);_a.has(n)||(_a.add(n),ia(I(e,t)).catch(()=>{}).finally(()=>{_a.delete(n)}))}function ba(e,t){if(e&&t){_a.delete(va(e,t));return}_a.clear()}function z(e,t,n,r,i=Object.is,a){let o=(0,b.useRef)(r);o.current=r;let s=(0,b.useRef)(i);s.current=i;let c=(0,b.useRef)(void 0),l=(0,b.useRef)(null),u=a?.enabled!==!1,d=(0,b.useMemo)(()=>()=>{let r=Hi(),i=e&&u?R(t,n):null,a=i?.getTranscript(I(t,e))??ha,d=i?.hasSession?.(I(t,e)),f=o.current,p=s.current,m=l.current;if(m?.data===a&&m.select===f&&m.isEqual===p&&m.repository===i&&m.bindingRevision===r&&m.directory===t&&m.sessionID===e&&m.enabled===u&&m.resolved===d)return c.current;let h=f(a);return(c.current===void 0||!p(c.current,h))&&(c.current=h),l.current={data:a,select:f,isEqual:p,repository:i,bindingRevision:r,directory:t,sessionID:e,enabled:u,resolved:d},c.current},[t,u,e,n]),f=(0,b.useMemo)(()=>r=>{if(!e||!u)return()=>void 0;ya(t,e);let i=R(t,n).subscribe(I(t,e),()=>{r()}),a=Vi(()=>{i(),c.current=void 0,l.current=null,ba(t,e),ya(t,e),i=R(t,n).subscribe(I(t,e),()=>{r()}),r()});return()=>{a(),i()}},[t,u,e,n]);return b.useSyncExternalStore(f,d,d)}function xa(e,t,n,r,i,a){return z(e,t,n,r,i===void 0?Object.is:i,a)}function Sa(e,t){if(e.messageOrder.length===0)return pa;if(t&&t.length>0){let n=!0,r=0;for(let i of e.messageOrder){let a=e.messagesByID[i];if(a){if(r>=t.length||t[r]!==a){n=!1;break}r+=1}}if(n&&r===t.length)return t}let n=[];for(let t of e.messageOrder){let r=e.messagesByID[t];r&&n.push(r)}return n}function Ca(e,t){return e.messageOrder.length===0?t?.resolved===!0?wr({messages:pa,parts:e.partsByMessageID}):{hasMessages:!1,renderable:!1,missingPartMessageIDs:[]}:wr({messages:Sa(e),parts:e.partsByMessageID})}var wa=(e,t)=>e.hasMessages===t.hasMessages&&e.renderable===t.renderable&&e.missingPartMessageIDs.length===t.missingPartMessageIDs.length&&e.missingPartMessageIDs.every((e,n)=>e===t.missingPartMessageIDs[n]);function Ta(e,t,n,r){let i=(0,Me.c)(4),a;return i[0]!==t||i[1]!==e||i[2]!==n?(a=r=>{if(!e)return{hasMessages:!1,renderable:!1,missingPartMessageIDs:[]};let i=R(t,n).hasSession?.(I(t,e));return Ca(r,{resolved:i===!0||void 0})},i[0]=t,i[1]=e,i[2]=n,i[3]=a):a=i[3],z(e,t,n,a,wa,r)}function Ea(e,t,n,r,i){let a=(0,Me.c)(3),o;return a[0]!==r||a[1]!==i?(o=e=>fa(da(Sa(e),t=>e.partsByMessageID[t]),r,i),a[0]=r,a[1]=i,a[2]=o):o=a[2],z(e,t,n,o,Da)}function Da(e,t){return e===t||!!(e&&t&&e.pending===t.pending&&e.totalTokens===t.totalTokens&&e.percentage===t.percentage&&e.contextLimit===t.contextLimit&&e.outputLimit===t.outputLimit&&e.normalizedOutput===t.normalizedOutput&&e.lastMessageId===t.lastMessageId)}var Oa=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0};function ka(e,t,n,r){return z(e,t,n,Sa,Oa,r)}function Aa(e,t){if(e===t)return!0;if(e.sessionID!==t.sessionID||e.liveRevision!==t.liveRevision||e.boundary.kind!==t.boundary.kind||e.boundary.loadedTurns!==t.boundary.loadedTurns||e.boundary.kind===`has-more`&&t.boundary.kind===`has-more`&&e.boundary.cursor!==t.boundary.cursor||e.messageOrder.length!==t.messageOrder.length)return!1;for(let n=0;n<e.messageOrder.length;n+=1){let r=e.messageOrder[n];if(r!==t.messageOrder[n]||e.messagesByID[r]!==t.messagesByID[r]||e.partsByMessageID[r]!==t.partsByMessageID[r])return!1}return!0}function ja(e,t,n,r){return z(e,t,n,Ma,Aa,r)}function Ma(e){return e}function Na(e,t,n,r){if(e.length===0)return()=>void 0;let i=[],a=()=>{for(let e of i)e();i=[]},o=()=>{let r=new Set;for(let a of e){let e=`${a.directory}\n${a.sessionID}`;if(r.has(e))continue;r.add(e);let o=P();if(o){i.push(o.subscribe(I(a.directory,a.sessionID),t));continue}let s=n?.(a.directory);if(!s)continue;let c=F(a.directory,s);i.push(c.subscribe(I(a.directory,a.sessionID),t))}},s=()=>{a(),o(),t()};o();let c=Vi(s),l=r?.subscribeRebuild?.(s);return()=>{l?.(),c(),a()}}function Pa(e,t){return e.length===0?``:e.map(e=>{let n=Ka(e.directory,e.sessionID,t?.(e.directory)),r=n[n.length-1];return`${e.sessionID}:${r?.id??``}:${r?.role??``}:${r?.time?.completed??``}`}).join(`\0`)}function Fa(e,t,n){return z(e,t,n,Ia)}function Ia(e){return e.messageOrder.length}function La(e,t,n){let r=(0,Me.c)(8),i=(0,b.useRef)(!1),a;r[0]!==t||r[1]!==e||r[2]!==n?(a=()=>{if(!e)return i.current=!1,!1;let r=R(t,n),a=r.hasSession?.(I(t,e))??r.getTranscript(I(t,e)).messageOrder.length>0;return i.current=a,i.current},r[0]=t,r[1]=e,r[2]=n,r[3]=a):a=r[3];let o=a,s;r[4]!==t||r[5]!==e||r[6]!==n?(s=r=>e?R(t,n).subscribe(I(t,e),()=>{r()}):Ra,r[4]=t,r[5]=e,r[6]=n,r[7]=s):s=r[7];let c=s;return b.useSyncExternalStore(c,o,o)}function Ra(){}function za(e,t,n,r){let i=(0,Me.c)(10),a=(0,b.useRef)(void 0),o;i[0]!==t||i[1]!==e||i[2]!==r||i[3]!==n?(o=()=>{if(!e)return a.current=ma,ma;let i=R(t,n),o=r||e,s=i.getParts(I(t,o),e),c=s.length===0?ma:s;if(a.current===void 0||a.current!==c){if(a.current&&a.current.length===c.length&&a.current.every((e,t)=>e===c[t]))return a.current;a.current=c}return a.current},i[0]=t,i[1]=e,i[2]=r,i[3]=n,i[4]=o):o=i[4];let s=o,c;i[5]!==t||i[6]!==e||i[7]!==r||i[8]!==n?(c=i=>{if(!e)return Va;let a=R(t,n);return r?a.subscribe(I(t,r),()=>{i()}):Ba},i[5]=t,i[6]=e,i[7]=r,i[8]=n,i[9]=c):c=i[9];let l=c;return b.useSyncExternalStore(l,s,s)}function Ba(){}function Va(){}function Ha(e,t,n){let r=(0,Me.c)(8),i=(0,b.useRef)(ga),a;r[0]!==t||r[1]!==e||r[2]!==n?(a=()=>{if(!e)return i.current!==ga&&(i.current=ga),i.current;let r=R(t,n).getHydrationState?.(I(t,e))??{sessionID:e,phase:`idle`,p0Satisfied:!1},a=i.current;return a.sessionID===r.sessionID&&a.phase===r.phase&&a.p0Satisfied===r.p0Satisfied?a:(i.current=r,r)},r[0]=t,r[1]=e,r[2]=n,r[3]=a):a=r[3];let o=a,s;r[4]!==t||r[5]!==e||r[6]!==n?(s=r=>{if(!e)return Ua;ya(t,e);let a=R(t,n).subscribe(I(t,e),()=>{r()}),o=Vi(()=>{a(),i.current=ga,ba(t,e),ya(t,e),a=R(t,n).subscribe(I(t,e),()=>{r()}),r()});return()=>{o(),a()}},r[4]=t,r[5]=e,r[6]=n,r[7]=s):s=r[7];let c=s;return b.useSyncExternalStore(c,o,o)}function Ua(){}function Wa(e,t,n){let r=(0,Me.c)(2),i;return r[0]===e?i=r[1]:(i=t=>Zr(e,t.boundary),r[0]=e,r[1]=i),z(e,t,n,i,Ga)}function Ga(e,t){return e.sessionID===t.sessionID&&e.hasPreviousPage===t.hasPreviousPage&&e.isComplete===t.isComplete&&e.cursor===t.cursor&&e.loadedTurns===t.loadedTurns&&e.boundary.kind===t.boundary.kind&&e.boundary.loadedTurns===t.boundary.loadedTurns&&(e.boundary.kind!==`has-more`||t.boundary.kind!==`has-more`||e.boundary.cursor===t.boundary.cursor)}function Ka(e,t,n){if(!t)return[];let r=P();if(r){let n=r.getTranscript(I(e,t));return n.messageOrder.map(e=>n.messagesByID[e]).filter(e=>!!e)}if(!n)return[];let i=F(e,n).getTranscript(I(e,t));return i.messageOrder.map(e=>i.messagesByID[e]).filter(e=>!!e)}var B=null,qa=``,Ja=null,Ya=new Set,Xa=null,Za=new Map,Qa=new Map;function $a(e,t,n,r){B=t,Xa!==t&&(Xa=null,Za=new Map,Qa=new Map),qa=n,r&&(Ja=r)}function eo(e,t){Ja?.(e,t)}function to(){if(!B)throw Error(`ChildStoreManager not initialized — is SyncProvider mounted?`);return B}function no(e){let t=B;if(!t)return;let n=e||qa;if(n)return t.getState(n)}function ro(e){let t=no(e)?.config;return t&&Object.keys(t).length>0?t:void 0}function io(e){return Ya.add(e),()=>{Ya.delete(e)}}function ao(e,t){if(e)for(let n of Ya)n(e,t)}function oo(e){return no(e)?.session??[]}function so(){return Array.from(co().values())}function co(){let e=B;if(!e)return Qa;let t=Xa!==e||Za.size!==e.children.size;for(let[n,r]of e.children)if(Za.get(n)!==r.getState().session){t=!0;break}if(!t)return Qa;let n=new Map,r=new Map;for(let[t,i]of e.children){let e=i.getState().session;n.set(t,e);for(let t of e)t?.id&&r.set(t.id,t)}return Xa=e,Za=n,Qa=r,Qa}function lo(e,t,n){if(n){let r=[];for(let[i,a]of n)if(a.session.some(t=>t.id===e)&&a.hasTranscript===!0){if(i===t)return i;r.push(i)}return r.length===1?r[0]:void 0}let r=[];try{let n=P();if(B){for(let[i,a]of B.children)if(a.getState().session.some(t=>t.id===e)&&(n??F(i,a)).hasSession?.(I(i,e))){if(i===t)return i;r.push(i)}}if(r.length===0&&n){let i=n.getCacheBudget?.().listCanonical();if(i){for(let n of i)if(n.scope.sessionID===e){if(n.scope.directory===t)return n.scope.directory;r.push(n.scope.directory)}}}}catch{}let i=[...new Set(r)];return i.length===1?i[0]:void 0}function uo(e,t){if(!e)return[];if(t&&typeof t!=`string`){let n=P(t);if(!n)return[];let r=n.getTranscript(I(t,e));return r.messageOrder.map(e=>r.messagesByID[e]).filter(e=>!!e)}try{let n=P(),r=t??qa;if(n){let t=n.getTranscript(I(r,e));return t.messageOrder.map(e=>t.messagesByID[e]).filter(e=>!!e)}if(B){let t=B.getChild(r);if(t){let n=F(r,t).getTranscript(I(r,e));return n.messageOrder.map(e=>n.messagesByID[e]).filter(e=>!!e)}}}catch{}return[]}function fo(e,t,n){if(!e)return[];if(t&&typeof t!=`string`){let r=P(t);return!r||!n?[]:[...r.getParts(I(t,n),e)]}try{let n=P(),r=t??qa;if(n)return[...n.getParts(I(r,e),e)];if(B){let t=B.getChild(r);if(t)return[...F(r,t).getParts(I(r,e),e)]}}catch{}return[]}var V=e=>{if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0},po=`default`;function mo(e){let t=V(e);if(t&&t!==po)return t}function ho(e){let t=e?.model;return V(t?.id)??V(t?.modelID)}function go(e){let t=e?.model;return V(t?.providerID)}function _o(e){let t=e?.model;return mo(t?.variant)}function vo(e){let t=mo(e.variant);return{id:e.modelID.trim(),providerID:e.providerID.trim(),...t?{variant:t}:{}}}function yo(e,t,n){let r=V(n.providerID),i=V(n.modelID);if(!r||!i)return{agent:V(n.agent)};let a=(no(t)?.session??so()).find(t=>t.id===e),o=vo({providerID:r,modelID:i,variant:n.variant}),s=ho(a),c=go(a),l=_o(a),u=mo(o.variant),d=!a||!s||!c||c!==o.providerID||s!==o.id||l!==u,f=V(n.agent),p=V(a?.agent);return{model:d?o:void 0,agent:f&&p!==f?f:void 0}}function bo(e,t,n){if(e&&!(!n.model&&!n.agent))try{let r=to(),i=typeof t==`string`&&t.length>0?t:void 0;if(!i)return;let a=r.getChild?.(i)??r.ensureChild?.(i,{bootstrap:!1});if(!a?.getState||!a?.setState)return;a.setState(t=>{let r=t.session;if(!Array.isArray(r))return t;let i=r.findIndex(t=>t.id===e);if(i<0)return t;let a=r[i];if(!a)return t;let o=n.model?{id:n.model.id??n.model.modelID??``,providerID:n.model.providerID,...n.model.variant?{variant:n.model.variant}:{}}:a.model,s={...a,...n.model&&o?.id&&o.providerID?{model:o}:{},...n.agent?{agent:n.agent}:{}};if(s===a)return t;let c=r.slice();return c[i]=s,{...t,session:c}})}catch{}}var xo=new Set([`image/heic`,`image/heif`]),So=!1,Co=()=>{let e=globalThis.window?.Capacitor;return e&&typeof e==`object`?e:null},wo=e=>xo.has((e.type||``).toLowerCase()),To=async e=>{let t=new Uint8Array(await e.arrayBuffer()),n=``,r=32768;for(let e=0;e<t.byteLength;e+=r){let i=t.subarray(e,Math.min(e+r,t.byteLength));n+=String.fromCharCode(...i)}return btoa(n)},Eo=(e,t)=>{let n=atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return new Blob([r],{type:t})},Do=async e=>{if(!wo(e)||So)return null;let t=Co();if(!t||typeof t.isNativePlatform!=`function`||!t.isNativePlatform())return null;let n=t.Plugins?.YuriMedia?.transcode;if(typeof n!=`function`)return null;try{let t=await n({data:await To(e),mime:e.type.toLowerCase(),quality:.9});if(typeof t?.data!=`string`||!t.data)return null;let r=typeof t.mime==`string`&&t.mime?t.mime:`image/jpeg`;return Eo(t.data,r)}catch(e){return So=!0,console.warn(`Native HEIC transcode failed`,e),null}},Oo=new Set([`image`,`screenshot`,`screen-shot`,`clipboard`,`pasted-image`,`pastedimage`,`untitled`,`unknown`,`file`,`blob`]),ko={"image/avif":`avif`,"image/bmp":`bmp`,"image/gif":`gif`,"image/heic":`heic`,"image/heif":`heif`,"image/jpeg":`jpg`,"image/jpg":`jpg`,"image/png":`png`,"image/svg+xml":`svg`,"image/tiff":`tiff`,"image/webp":`webp`},Ao=e=>e.trim().toLowerCase(),jo=e=>e.charCodeAt(0)<32||`<>:"/\\|?*[]`.includes(e),Mo=e=>{let t=e.replace(/\\/g,`/`).split(`/`).pop()??``;return Array.from(t).map(e=>jo(e)?`-`:e).join(``).replace(/\s+/g,` `).replace(/-+/g,`-`).trim()},No=e=>ko[e?.trim().toLowerCase()??``]??`png`,Po=e=>{let t=Mo(e.name),n=No(e.type),r=t.lastIndexOf(`.`);if(r>0&&r<t.length-1){let e=t.slice(r+1).toLowerCase();if(/^[a-z0-9]{1,10}$/.test(e))return{base:t.slice(0,r).trim()||`image`,ext:e}}return{base:t.trim()||`image`,ext:n}},Fo=e=>{let{base:t}=Po({name:e}),n=t.trim().toLowerCase().replace(/[\s_]+/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``);if(Oo.has(n))return!0;let r=n.replace(/-\(\d+\)$/g,``);return r!==n&&Oo.has(r)?!0:/^(image|file|unknown|untitled|blob)-\d+$/.test(n)},Io=(e,t)=>`${e}.${t}`,Lo=(e,t,n)=>{let r=Io(e,t);if(!n.has(Ao(r)))return r;for(let r=2;r<2**53-1;r+=1){let i=Io(`${e}-${r}`,t);if(!n.has(Ao(i)))return i}return Io(`${e}-${Date.now()}`,t)},Ro=(e,t)=>{for(let n=1;n<2**53-1;n+=1){let r=Io(`image-${n}`,e);if(!Array.from(t).some(e=>e.startsWith(`image-${n}.`))&&!t.has(Ao(r)))return r}return Io(`image-${Date.now()}`,e)},zo=(e,t)=>{let n=new Set(t.map(Ao));return e.map(e=>{let{base:t,ext:r}=Po(e),i=Fo(Io(t,r))?Ro(r,n):Lo(t,r,n);return n.add(Ao(i)),i})},Bo=e=>e.map(e=>ie(e)).join(` `),Vo=(e,t,n)=>{if(t===n)return[];let r=[];for(let i of e){let e=[ie(i),`[${i}]`],a=e.some(e=>t.includes(e)),o=e.some(e=>n.includes(e));a&&!o&&r.push(i)}return r},Ho=(e,t)=>{if(t.length>=e.length)return null;let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n+=1;let i=0;for(;i<e.length-n&&i<t.length-n&&e[e.length-1-i]===t[t.length-1-i];)i+=1;let a=e.length-i;return t.length-i!==n||a<=n?null:{start:n,end:a}},Uo=(e,t,n)=>{if(e===t||n.length===0)return null;let r=[...n],i=Ho(e,t);if(i){let t=es(e,r,{key:`Backspace`,selectionStart:i.start,selectionEnd:i.end});if(t)return t}let a=Vo(r,e,t);return a.length===0?null:{text:t,caret:t.length,removedFilenames:a}},Wo=e=>e.replaceAll(`[${le}`,`[`),Go=/\.(?:png|jpe?g|gif|webp|svg|avif|bmp|heic|heif|tiff?)$/i,Ko=e=>{let t=e.trim();return t.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(`\\\\`)},qo=(e,t)=>{let n=e;for(let e of t){let t=e.filename.trim(),r=e.path.trim();if(!t||!r||t===r||Ko(t)||!Go.test(t)&&!Go.test(r))continue;let i=`[${r}]`;n=n.split(ie(t)).join(i).split(`[${t}]`).join(i)}return n},Jo=(e,t)=>{let n=e;for(let e of t??[]){if(e.source!==`vscode`||e.vscodeSource!==`selection`||!e.vscodePath)continue;let t=e.filename.match(/:(\d+(?:-\d+)?)$/)?.[1];if(!t)continue;let r=`[${e.vscodePath}:${t}]`;n=n.split(ie(e.filename)).join(r).split(`[${e.filename}]`).join(r)}return n},Yo=e=>e.mime===`text/plain`&&typeof e.filename==`string`&&/:\d+(?:-\d+)?$/.test(e.filename),Xo=`application/x-directory`,Zo=e=>typeof e==`string`&&e.trim().toLowerCase()===`application/x-directory`,Qo=e=>typeof e==`string`&&/[/\\]$/.test(e.trim()),$o=(e,t,n)=>{if(t===`Backspace`){let t=n;for(;t>0&&/\s/.test(e[t-1]);)--t;for(;t>0&&!/\s/.test(e[t-1]);)--t;return{start:t,end:n}}let r=n;for(;r<e.length&&/\s/.test(e[r]);)r+=1;for(;r<e.length&&!/\s/.test(e[r]);)r+=1;return{start:n,end:r}},es=(e,t,n)=>{let r=Math.max(0,Math.min(n.selectionStart,e.length)),i=Math.max(r,Math.min(n.selectionEnd,e.length)),a;if(a=r===i?n.altKey?$o(e,n.key,r):n.key===`Backspace`?{start:Math.max(0,r-1),end:r}:{start:r,end:Math.min(e.length,r+1)}:{start:r,end:i},a.start===a.end)return null;let o=re(e,t).filter(e=>e.start<a.end&&e.end>a.start);if(o.length===0)return null;let s=Math.min(a.start,...o.map(e=>e.start)),c=Math.max(a.end,...o.map(e=>e.end));return c<e.length&&/\s/.test(e[c])&&(s===0||/\s/.test(e[s-1]))?c+=1:c===e.length&&s>0&&/\s/.test(e[s-1])&&--s,{text:`${e.slice(0,s)}${e.slice(c)}`,caret:s,removedFilenames:o.map(t=>ue(e.slice(t.start+1,t.end-1)).trim())}},ts=`<system-reminder>`,ns=`</system-reminder>`,rs=/[ \t]*<system-reminder>[\s\S]*?<\/system-reminder>[ \t]*/g,is=/[ \t]*<system-reminder>[\s\S]*$/,as=e=>{let t=e.trim();return t?t.startsWith(ts)&&t.endsWith(ns)?t:`${ts}\n${t}\n${ns}`:``},os=e=>e.includes(ts)?e.replace(rs,``).replace(is,``).trim():e,ss=500,cs=()=>{if(typeof window>`u`)return!1;try{return new URLSearchParams(window.location.search).get(`startupTrace`)===`1`||window.localStorage?.getItem(`YURI_STARTUP_TRACE`)===`1`}catch{return!1}},ls=()=>cs(),H=(e,t)=>{if(!cs())return;let n=typeof performance<`u`?performance.now():Date.now();window.__YURI_STARTUP_TRACE_START__??=n,window.__YURI_STARTUP_TRACE__??=[],window.__YURI_STARTUP_TRACE__.push({t:Math.round(n-window.__YURI_STARTUP_TRACE_START__),name:e,...t?{data:t}:{}}),window.__YURI_STARTUP_TRACE__.length>ss&&window.__YURI_STARTUP_TRACE__.splice(0,window.__YURI_STARTUP_TRACE__.length-ss)};typeof window<`u`&&(window.__YURI_STARTUP_TRACE_SUMMARY__=()=>{let e=typeof window<`u`?window.__YURI_STARTUP_TRACE__??[]:[],t=e.findIndex(e=>e.name===`ModelControls:ready`),n=t>=0?Math.min(e.length,t+8):e.length;return e.slice(0,n).filter(e=>e.name.includes(`checkConnection`)||e.name.includes(`checkHealth`)||e.name.includes(`initializeApp`)||e.name.includes(`initApp`)||e.name.includes(`loadProviders`)||e.name.includes(`loadAgents`)||e.name.includes(`config.defaults`)||e.name.includes(`ModelControls`)||e.name.includes(`activateDirectory`)||e.name.includes(`opencodeClient:setDirectory`))});var us=async(e,t,n)=>{let r=typeof performance<`u`?performance.now():Date.now();H(`${e}:start`,n);try{let n=await t(),i=typeof performance<`u`?performance.now():Date.now();return H(`${e}:end`,{durationMs:Math.round(i-r)}),n}catch(t){let n=typeof performance<`u`?performance.now():Date.now();throw H(`${e}:error`,{durationMs:Math.round(n-r),error:t instanceof Error?t.message:String(t)}),t}},ds=0n,fs=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,ps=14;function ms(e){let t=``;for(let n=0;n<e;n++)t+=fs[Math.floor(Math.random()*62)];return t}var hs=/^[0-9a-f]{12}$/,gs=/^[0-9A-Za-z]{14}$/,_s=(1n<<48n)-1n,vs=(e,t)=>{if(typeof t!=`string`||!t.startsWith(`${e}_`))return;let n=t.slice(e.length+1),r=n.slice(0,12);if(!(!hs.test(r)||!gs.test(n.slice(12))))return BigInt(`0x${r}`)},ys=(e,t)=>{let n=BigInt(Date.now())*4096n&_s,r=vs(e,t)??0n,i=[n,ds,r].reduce((e,t)=>e>t?e:t);if(i>=_s)throw Error(`Ascending ID space exhausted`);let a=i+1n;ds=a;let o=new Uint8Array(6);for(let e=0;e<6;e++)o[e]=Number(a>>BigInt(40-8*e)&BigInt(255));let s=``;for(let e=0;e<o.length;e++)s+=o[e].toString(16).padStart(2,`0`);return`${e}_${s}${ms(ps)}`},bs=e=>ys(e),xs=e=>({kind:`session-inbox`,requestID:e.requestID,queueItemID:e.id,operationID:e.id,messageID:e.id,content:e.payload.text,createdAt:e.timeCreated,delivery:e.delivery,attachmentCount:Array.isArray(e.payload.files)?e.payload.files.length:0}),Ss=[],Cs=[],U=new Map,ws=512,Ts=0;function Es(){return Ts}function W(){return{transportIdentity:n(),generation:r()}}function Ds(e){return n()===e.transportIdentity&&r()===e.generation}function Os(e,t,i){return`${i?.transportIdentity??n()}\0${i?.generation??r()}\0${e}\0${t}`}function ks(e=W()){if(U.size===0)return;let t=`${e.transportIdentity}\0${e.generation}\0`;for(let e of U.keys())e.startsWith(t)||U.delete(e);for(;U.size>ws;){let e=U.keys().next().value;if(e===void 0)break;U.delete(e)}}function As(e,t,n,r){let i=r??W();ks(i),Ts+=1,U.set(Os(e,t,i),{kind:n,mark:Ts})}function js(e,t,n){let r=n?.scope;ks(r??W());let i=U.get(Os(e,t,r));if(!i)return!0;let a=n?.startedMark;return a!==void 0&&i.mark>a?!1:(U.delete(Os(e,t,r)),!0)}function Ms(e,t,n){return ks(n??W()),U.get(Os(e,t,n))?.kind??null}var Ns=(e,t,n)=>{let r={...e};return n.length===0?delete r[t]:r[t]=n,r},G=p((e,t)=>({bySession:{},remember(t){let n=t.location?l(t.location,t.sessionID):t.sessionID;return!Ms(n,t.id)&&(e(e=>{let r=e.bySession[n]??[],i=r.findIndex(e=>e.id===t.id),a={...t,requestID:t.id};if(i>=0){let t=r.slice();return t[i]=a,{bySession:{...e.bySession,[n]:t}}}return{bySession:{...e.bySession,[n]:[...r,a]}}}),!0)},forget(t,n,r){r&&As(t,n,r),e(e=>{let r=e.bySession[t];if(!r?.length)return e;let i=r.filter(e=>e.id!==n);return i.length===r.length?e:{bySession:Ns(e.bySession,t,i)}})},forgetSession(t){e(e=>{if(!e.bySession[t])return e;let n={...e.bySession};return delete n[t],{bySession:n}})},forgetPromoted(t,n){let r=new Set(n);e(e=>{let n=e.bySession[t];if(!n?.length)return e;let i=new Set(n.filter(e=>r.has(e.id)).map(e=>e.id));if(i.size===0)return e;for(let e of i)As(t,e,`consumed`);return{bySession:Ns(e.bySession,t,n.filter(e=>!i.has(e.id)))}})},replaceFromAuthority(t,n,r){let i=r?.startedMark,a=[];for(let e of n)js(t,e.id,{startedMark:i})&&a.push(e);e(e=>{let n=new Map((e.bySession[t]??[]).map(e=>[e.id,e])),i=r?.observedItems&&new Map(r.observedItems.map(e=>[e.id,e])),o=a.map(e=>({...e,requestID:e.id}));if(i){let e=new Map(o.map((e,t)=>[e.id,t]));for(let t of n.values()){if(i.get(t.id)===t)continue;let n=e.get(t.id);n===void 0?o.push(t):o[n]=t}}return{bySession:Ns(e.bySession,t,o)}})},updateDelivery(t,n,r){e(e=>{if(Ms(t,n))return e;let i=e.bySession[t];if(!i?.length)return e;let a=i.findIndex(e=>e.id===n);if(a<0||i[a].delivery===r)return e;let o=i.slice();return o[a]={...i[a],delivery:r},{bySession:{...e.bySession,[t]:o}}})},list(e){return t().bySession[e]??Ss}}));function Ps(e){return G.getState().remember(e)}function Fs(e,t){return js(e.location?l(e.location,e.sessionID):e.sessionID,e.id,t)?G.getState().remember(e):!1}function Is(e,t,n){G.getState().forget(e,t,n)}function Ls(e,t){G.getState().forgetPromoted(e,t)}function Rs(e,t,n){G.getState().replaceFromAuthority(e,t,n)}function zs(e,t,n){G.getState().updateDelivery(e,t,n)}function Bs(e){return!!e&&typeof e==`object`&&e.kind===`session-inbox`}var Vs=e=>e?e.toLowerCase().includes(`application/json`):!1,Hs=e=>e?e.toLowerCase().includes(`text/html`):!1;function K(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function q(e){return typeof e==`string`&&e.length>0?e:void 0}function Us(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function Ws(e,t,n){let r=n?`: ${n}`:``,i=Error(`${e} (${t})${r}`);throw i.status=t,i}async function Gs(e){try{let t=(await e.text()).trim();if(!t)return``;try{let e=JSON.parse(t);if(typeof e.error==`string`&&e.error.trim())return e.error.trim();if(typeof e.message==`string`&&e.message.trim())return e.message.trim()}catch{}return t}catch{return``}}function Ks(e){return e?{directory:e}:{}}function qs(e,t){let n=`/api/session/${encodeURIComponent(e)}/inbox`;return t?`${n}/${encodeURIComponent(t)}`:n}function Js(e,t){return t?l(t.location,e):e}async function Ys(e,t){let n=e.headers.get(`content-type`);if(Hs(n))throw Error(`${t}: unexpected HTML response`);let r;try{r=await e.json()}catch{throw Error(`${t}: malformed JSON`)}if(!Vs(n)&&r==null)throw Error(`${t}: empty response`);return r}function Xs(e){let t=K(e)?e:null,n=t&&K(t.data)?t.data:t;if(!n)throw Error(`session prompt: expected inbox item`);let r=q(n.type);if(r&&r!==`user`)throw Error(`session prompt: expected user inbox item, got ${r}`);let i=q(n.id),a=q(n.sessionID);if(!i||!a)throw Error(`session prompt: inbox item missing id`);let o=K(n.payload)?n.payload:{},s=n.delivery===`queue`?`queue`:`steer`,c=K(n.time)?n.time:null;return{id:i,sessionID:a,timeCreated:Us(n.timeCreated)??Us(c?.created)??Date.now(),type:`user`,delivery:s,payload:{text:q(o.text)??q(n.text)??``,...o.files===void 0?{}:{files:o.files},...o.agents===void 0?{}:{agents:o.agents},...o.skills===void 0?{}:{skills:o.skills},...K(o.metadata)?{metadata:o.metadata}:{}}}}function Zs(e){let t=K(e)?e:null,n=t&&Array.isArray(t.data)?t.data:Array.isArray(e)?e:null;if(!n)throw Error(`session inbox: expected list`);let r=[];for(let e of n)K(e)&&(e.type&&e.type!==`user`||r.push(Xs(e)));return r}function Qs(e,t){return{runtimeKey:i(),generation:r(),directory:t?.location.directory??e,hostScope:t,overlay:W()}}function J(e){try{e.hostScope?.sdk()}catch{return!1}return i()===e.runtimeKey&&r()===e.generation&&Ds(e.overlay)}function $s(e){let t=Error(`${e}: runtime switched`);throw t.name=`RuntimeGenerationMismatchError`,t}async function ec(e){let t=e.commit??Qs(e.directory,e.scope);if(e.scope&&t.hostScope!==e.scope)throw Error(`Prompt scope mismatch`);J(t)||$s(`session prompt`);let n=`/api/session/${encodeURIComponent(e.sessionID)}/prompt`,r={id:e.messageID,text:e.text,delivery:e.delivery===`queue`?`queue`:`steer`};e.files?.length&&(r.files=e.files),e.agents?.length&&(r.agents=e.agents),e.skills?.length&&(r.skills=e.skills),r.metadata={...e.metadata,client:{...K(e.metadata?.client)?e.metadata.client:{},id:`yuri`}};let i=await(t.hostScope?t.hostScope.fetch:o)(n,{method:`POST`,headers:{"Content-Type":`application/json`},query:{directory:t.directory},body:JSON.stringify(r),signal:e.signal});if(J(t)||$s(`session prompt`),!i.ok){let e=await Gs(i);Ws(`Failed to send message`,i.status,e)}let a=Xs(await Ys(i,`session prompt`));if(t.hostScope&&a.sessionID!==e.sessionID)throw Error(`Session prompt response scope mismatch`);return t.hostScope&&(a.location=t.hostScope.location),J(t)||$s(`session prompt`),Ps(a),a}function tc(e){let t=e?.status;return typeof t!=`number`||!Number.isFinite(t)||t===408||t===429?!1:t>=400&&t<500}async function nc(e){let t=e.inputID.trim();if(!t)return{status:`unknown`};let n=e.commit??Qs(e.directory??``,e.scope);if(!J(n))return{status:`unknown`};try{let r=await ic({scope:n.hostScope,sessionID:e.sessionID,directory:n.directory||e.directory,signal:e.signal});if(!J(n)||!r.current)return{status:`unknown`};let i=r.items.find(e=>e.id===t);if(i)return Fs(i,{startedMark:r.startedMark})?{status:`pending`,item:i}:{status:`unknown`}}catch{}if(!J(n))return{status:`unknown`};try{let r=await st({scope:n.hostScope,sessionID:e.sessionID,directory:n.directory||e.directory||``,limit:40,...e.signal?{signal:e.signal}:{}});if(!J(n))return{status:`unknown`};if(r.records.some(e=>e?.info?.id===t))return Is(Js(e.sessionID,n.hostScope),t,`consumed`),{status:`promoted`,id:t}}catch{}return{status:`unknown`}}function rc(e,t){let n=typeof e.type==`string`?e.type:``,r=e.properties&&typeof e.properties==`object`?e.properties:null;if(!r)return!1;let i=q(r.sessionID),a=q(r.inboxID)??q(r.id);if(!i||!a)return!1;let o=Js(i,t);if(n===`session.inbox.enqueued`){let e=r.item,n=K(e)?q(e.type):void 0;if(n&&n!==`user`)return!1;try{let r=Xs(K(e)?{...e,id:a,sessionID:i,type:n??`user`}:{id:a,sessionID:i,type:`user`,delivery:`steer`,payload:{text:``}});return t&&(r.location=t.location),Fs(r),!0}catch{return!1}}if(n===`session.inbox.cancelled`)return Is(o,a,`cancelled`),!0;if(n===`session.inbox.delivered`)return Is(o,a,`consumed`),!0;if(n===`session.inbox.delivery.changed`){let e=r.delivery===`queue`?`queue`:r.delivery===`steer`?`steer`:null;return e?(zs(o,a,e),!0):!1}return!1}async function ic(e){let t=W(),n=Qs(e.directory??``,e.scope),r=Es(),i=Js(e.sessionID,e.scope),a=vt(i),s={method:`GET`,query:Ks(e.scope?.location.directory??e.directory),signal:e.signal},c=e.scope?e.scope.fetch:o,l=await c(`/api/sessions/${encodeURIComponent(e.sessionID)}/delivery`,s);(l.status===404||l.status===501||Hs(l.headers.get(`content-type`)))&&(l=await c(qs(e.sessionID),s)),l.ok||Ws(`session inbox`,l.status,await Gs(l));let u=await Ys(l,`session inbox`),d=Zs(u);if(e.scope&&d.some(t=>t.sessionID!==e.sessionID))throw Error(`Session inbox response scope mismatch`);if(e.scope)for(let t of d)t.location=e.scope.location;let f=Ds(t)&&J(n);return f&&vt(i)===a&&(K(u)&&typeof u.compactionRunning==`boolean`?E(i,u.compactionRunning):wt(i,Ct(u))),{items:d,startedMark:r,scope:t,current:f}}async function ac(e){let t=W(),n=Qs(e.directory??``,e.scope),r=await(e.scope?e.scope.fetch:o)(qs(e.sessionID,e.inboxID),{method:`PATCH`,headers:{"Content-Type":`application/json`},query:Ks(e.scope?.location.directory??e.directory),body:JSON.stringify({delivery:e.delivery}),signal:e.signal});if(r.ok||Ws(e.delivery===`steer`?`session inbox steer`:`session inbox queue`,r.status,await Gs(r)),!Ds(t)||!J(n))return;let i=Js(e.sessionID,e.scope);Ms(i,e.inboxID)||zs(i,e.inboxID,e.delivery)}async function oc(e){await ac({...e,delivery:`steer`})}async function sc(e){await ac({...e,delivery:`queue`})}async function cc(e){let t=await(e.scope?e.scope.fetch:o)(qs(e.sessionID,e.inboxID),{method:`DELETE`,query:Ks(e.scope?.location.directory??e.directory),signal:e.signal});t.ok||Ws(`session inbox cancel`,t.status,await Gs(t))}function lc(e,t,n){Rs(e,t,n)}async function uc(e){let t=W(),n=Qs(e.directory??``,e.scope),r=Js(e.sessionID,e.scope);if(await cc(e),!Ds(t)||!J(n))return{overlay:G.getState().list(r),transcriptRows:[]};Is(r,e.inboxID,`cancelled`);try{let i=await ic({scope:e.scope,sessionID:e.sessionID,directory:e.directory,signal:e.signal});if(!Ds(t)||!J(n)||!i.current)return{overlay:G.getState().list(r),transcriptRows:[]};lc(r,i.items,{startedMark:i.startedMark})}catch{}return{overlay:G.getState().list(r),transcriptRows:[]}}async function dc(e){let t=`/api/session/${encodeURIComponent(e.sessionID)}/interrupt`,n={},r=e.scope?.location.directory??e.directory;r&&(n.directory=r),e.resume!==void 0&&(n.resume=String(e.resume));let i=await(e.scope?e.scope.fetch:o)(t,{method:`POST`,query:n,signal:e.signal});if(!i.ok)throw Error(`Session interrupt failed (${i.status})`)}async function fc(e){return e.promotedIDs.includes(e.optimisticID)?`confirmed`:(e.removeOptimistic(e.optimisticID),await e.refreshFromAuthority(),`refreshed`)}var pc=`session-revert-busy`,mc=e=>e?e.toLowerCase().includes(`text/html`):!1;function hc(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Y(e){return typeof e==`string`&&e.length>0?e:void 0}function gc(e,t,n){if(t===409)throw _c();let r=n?`: ${n}`:``,i=Error(`${e} (${t})${r}`);if(i.status=t,t===404&&n)try{let e=JSON.parse(n);hc(e)&&e._tag===`MessageNotFoundError`&&(i.name=`MessageNotFoundError`)}catch{}throw i}function _c(){let e=Error(pc);return e.name=`SessionRevertBusyError`,e}function vc(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.name===`SessionRevertBusyError`||t.message===`session-revert-busy`}async function yc(e){try{return(await e.text()).trim()}catch{return``}}async function bc(e,t){if(mc(e.headers.get(`content-type`)))throw Error(`${t}: unexpected HTML response`);if(e.status===204)return null;let n=await e.text();if(!n.trim()){if(e.ok)return null;throw Error(`${t}: empty response`)}try{return JSON.parse(n)}catch{throw Error(`${t}: malformed JSON`)}}function xc(e){return e?{directory:e}:{}}function Sc(e,t){return`/api/session/${encodeURIComponent(e)}/revert/${t}`}function Cc(e){let t=hc(e)?e:null,n=t&&hc(t.data)?t.data:t;if(!n)throw Error(`session revert: expected revert payload`);let r=Y(n.messageID);if(!r)throw Error(`session revert: missing messageID`);let i=Array.isArray(n.files)?n.files.flatMap(e=>{if(!hc(e))throw Error(`session revert: invalid file diff`);let t=Y(e.file)??Y(e.path);if(!t||e.status!==`added`&&e.status!==`deleted`&&e.status!==`modified`||typeof e.additions!=`number`||typeof e.deletions!=`number`||typeof e.patch!=`string`)throw Error(`session revert: invalid file diff`);return[{file:t,status:e.status,additions:e.additions,deletions:e.deletions,patch:e.patch}]}):void 0;return{messageID:r,...Y(n.partID)?{partID:Y(n.partID)}:{},...Y(n.snapshot)?{snapshot:Y(n.snapshot)}:{},...i?{files:i}:{}}}function wc(e){return e?.files?e.files.flatMap(e=>{let t=typeof e.file==`string`&&e.file.length>0?e.file:typeof e.path==`string`&&e.path.length>0?e.path:``;return t?[t]:[]}):[]}async function Tc(e){let t=await(e.scope?e.scope.fetch:o)(Sc(e.sessionID,`stage`),{method:`POST`,headers:{"Content-Type":`application/json`},query:xc(e.scope?.location.directory??e.directory),body:JSON.stringify({messageID:e.messageID,files:e.files!==!1}),signal:e.signal});t.ok||gc(`session revert stage`,t.status,await yc(t));let n=Cc(await bc(t,`session revert stage`));return e.scope?.sdk(),n}async function Ec(e){let t=await(e.scope?e.scope.fetch:o)(`/api/session/${encodeURIComponent(e.sessionID)}/revert`,{method:`DELETE`,query:xc(e.scope?.location.directory??e.directory),signal:e.signal});t.ok||gc(`session revert clear`,t.status,await yc(t)),e.scope?.sdk()}async function Dc(e){let t=await(e.scope?e.scope.fetch:o)(Sc(e.sessionID,`commit`),{method:`POST`,query:xc(e.scope?.location.directory??e.directory),signal:e.signal});t.ok||gc(`session revert commit`,t.status,await yc(t)),e.scope?.sdk()}var Oc=e=>e?e.toLowerCase().includes(`text/html`):!1;function kc(e,t,n){let r=n?`: ${n}`:``,i=Error(`${e} (${t})${r}`);throw i.status=t,i}async function Ac(e){try{return(await e.text()).trim()}catch{return``}}function jc(e){return e?{directory:e}:{}}function Mc(e,t){return`/api/session/${encodeURIComponent(e)}/permission/${encodeURIComponent(t)}/reply`}async function Nc(e){let t=await(e.scope?e.scope.fetch:o)(Mc(e.sessionID,e.requestID),{method:`POST`,headers:{"Content-Type":`application/json`},query:jc(e.scope?.location.directory??e.directory),body:JSON.stringify({decision:e.reply,...e.message?{message:e.message}:{}}),signal:e.signal});if(t.ok||kc(`session permission reply`,t.status,await Ac(t)),t.status!==204&&Oc(t.headers.get(`content-type`)))throw Error(`session permission reply: unexpected HTML response`);e.scope?.sdk()}function Pc(e){let t=Error(`${e} is not available on OpenCode v2`);return t.name=`V2CapabilityUnavailableError`,t}function Fc(e){let t=typeof e.directory==`string`?e.directory:``;return{state:``,config:``,worktree:typeof e.project?.directory==`string`?e.project.directory:t,directory:t,home:``}}function Ic(e){return e.worktree||e.canonical||``}function Lc(e,t){let n={};if(t.size===0)return n;for(let[r,i]of Object.entries(e))t.has(r)&&i?.type===`running`&&(n[r]={type:`busy`});return n}function Rc(e){return{id:e.id,sessionID:e.sessionID,permission:e.action,patterns:Array.isArray(e.resources)?e.resources:[],metadata:e.metadata??{},always:Array.isArray(e.save)?e.save:[],...e.source?.messageID?{tool:{messageID:e.source.messageID,callID:e.source.id??``}}:{}}}function zc(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&e.kind===`question`}function Bc(e){let t=e.metadata&&typeof e.metadata.tool==`object`&&e.metadata.tool&&!Array.isArray(e.metadata.tool)?e.metadata.tool:void 0,n=typeof e.tool?.messageID==`string`&&e.tool.messageID.length>0?e.tool.messageID:typeof t?.messageID==`string`&&t.messageID.length>0?t.messageID:void 0;if(n)return{messageID:n,callID:typeof e.tool?.id==`string`?e.tool.id:typeof t?.id==`string`?t.id:``}}function Vc(e){let t=e.fields;if(!t||t.length===0){let t=typeof e.title==`string`&&e.title.length>0?e.title:`Form`;return[{question:t,header:t,options:[]}]}return t.map(t=>{let n=typeof t.title==`string`&&t.title.length>0?t.title:t.key;return{question:typeof t.description==`string`&&t.description.length>0?t.description:typeof e.title==`string`&&e.title.length>0?e.title:n,header:n,options:(t.options??[]).map(e=>({label:e.label||e.value||``,description:typeof e.description==`string`?e.description:``})).filter(e=>e.label.length>0),...t.type===`multiselect`?{multiple:!0}:{}}})}function Hc(e){let t=e.questions&&e.questions.length>0?e.questions.map(e=>({question:e.question,header:e.header,options:e.options??[],...e.multiple?{multiple:!0}:{}})):Vc(e),n=Bc(e);return{id:e.id,sessionID:e.sessionID,questions:t,...n?{tool:n}:{}}}function Uc(e,t){let n={};for(let r=0;r<t.length;r+=1){let i=t[r],a=(e[r]??[]).map(e=>i.options?.find(t=>(t.label||t.value)===e)?.value??e),o=a[0]??``;if(i.type===`multiselect`)n[i.key]=a;else if(i.type===`number`||i.type===`integer`){let e=Number(o);if(!o.trim()||!Number.isFinite(e)||i.type===`integer`&&!Number.isInteger(e))throw Error(`Invalid numeric answer for ${i.key}`);n[i.key]=e}else if(i.type===`boolean`){if(o!==`true`&&o!==`false`)throw Error(`Invalid boolean answer for ${i.key}`);n[i.key]=o===`true`}else n[i.key]=o}return n}var Wc=3,Gc=3e4,Kc=32e3,qc=36e5,Jc=6e5,Yc=new Set([429,502,503,504]),Xc=new Map,Zc=(e,t)=>t?JSON.stringify([t,e]):e;function Qc(){let e=Date.now();for(let[t,n]of Xc)n.consecutiveErrors===0&&e-n.lastErrorAt>qc&&Xc.delete(t)}typeof setInterval<`u`&&setInterval(Qc,Jc).unref?.();function $c(e){let t=Xc.get(e);return t||(t={consecutiveErrors:0,lastErrorAt:0,circuitOpen:!1,circuitOpenAt:0,circuitCooldownMs:Gc},Xc.set(e,t)),t}function el(e,t){if(!e)return;let n=Xc.get(Zc(e,t));n&&(n.consecutiveErrors=0,n.lastErrorAt=0)}function tl(e,t,n){if(!e)return;let r=$c(Zc(e,n));r.consecutiveErrors+=1,r.lastErrorAt=Date.now(),nl(t)&&r.consecutiveErrors>=Wc&&(r.circuitOpen=!0,r.circuitOpenAt=Date.now(),console.warn(`[provider-tracker] Circuit opened for ${e} after ${r.consecutiveErrors} consecutive errors`))}function nl(e){return e!==void 0&&Yc.has(e)}function rl(e){let t=Xc.get(e);return t?.circuitOpen?Date.now()-t.circuitOpenAt>=t.circuitCooldownMs?(t.circuitOpen=!1,t.consecutiveErrors=0,t.circuitCooldownMs=Math.min(t.circuitCooldownMs*2,Kc*4),!1):!0:!1}function il(e,t){if(!(!e||!rl(Zc(e,t))))throw Error(`Provider ${e} is temporarily unavailable after repeated errors. Please retry shortly.`)}var al=`/api`,ol=1e4,sl=4e3,cl=3e3,ll=1e3,ul=1500,dl=12e3;function X(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;if(e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function Z(e){let t=Error(`${e} is not available on OpenCode v2`);return t.name=`V2CapabilityUnavailableError`,t}function fl(e){if(e instanceof g&&e.reason===`UnexpectedStatus`){let t=e.cause;if(t&&typeof t==`object`&&`status`in t){let e=t.status;if(typeof e==`number`)return e}}if(e&&typeof e==`object`&&`status`in e){let t=e.status;if(typeof t==`number`)return t}}function pl(e){return e===404||e===405||e===501}function Q(e){if(typeof e!=`string`)return;let t=e.trim();if(t)return{location:{directory:t}}}function ml(e){let t=e.replace(/\/+$/,``);if(t.endsWith(`/api`)){let e=t.slice(0,-4);if(e.length>0)return e}return _l(yl()||`/`)}function hl(e){return!e||typeof e.id!=`string`||e.id.length===0||typeof e.sessionID!=`string`||e.sessionID.length===0?null:{id:e.id,sessionID:e.sessionID,permission:e.action,patterns:Array.isArray(e.resources)?e.resources:[],metadata:e.metadata??{},always:Array.isArray(e.save)?e.save:[],...e.source?{tool:{messageID:e.source.messageID,callID:e.source.id}}:{}}}var gl=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//,_l=e=>{let t=typeof e==`string`&&e.trim().length>0?e.trim():`/api`;if(gl.test(t)||typeof window>`u`)return t;let n=window.location?.href||window.location?.origin;if(!n)return t;try{return new URL(t,n).toString()}catch(e){return console.warn(`Failed to normalize OpenCode base URL:`,e),t}},vl=()=>{try{return t().api(`/api`)}catch{return null}},yl=()=>{try{return t().api(`/`)}catch{return null}},bl=e=>{let t=typeof AbortSignal<`u`?AbortSignal:void 0;if(typeof t?.timeout==`function`)return{signal:t.timeout(e),cleanup:()=>void 0};let n=new AbortController,r=setTimeout(()=>n.abort(),e);return{signal:n.signal,cleanup:()=>clearTimeout(r)}},xl=e=>{let t=e.filter(e=>e!=null);if(t.length===0)return{signal:new AbortController().signal,cleanup:()=>void 0};if(t.length===1)return{signal:t[0],cleanup:()=>void 0};let n=typeof AbortSignal<`u`?AbortSignal:void 0;if(typeof n?.any==`function`)return{signal:n.any(t),cleanup:()=>void 0};let r=new AbortController,i=()=>r.abort();for(let e of t){if(e.aborted){r.abort();break}e.addEventListener(`abort`,i)}return{signal:r.signal,cleanup:()=>{for(let e of t)e.removeEventListener(`abort`,i)}}},Sl=e=>{let t=e.session?.message,n=t&&typeof t==`object`&&typeof t.get==`function`?t.get.bind(t):null;if(!n)return e;let r=Object.assign((e,t)=>n(e,t),t);return{...e,session:{...e.session,message:r}}},Cl=e=>{let n=e.hostId?i():void 0,a=e.hostId?r():void 0;return Sl(ee.make({baseUrl:e.baseUrl,...e.headers?{headers:e.headers}:{},fetch:(s,l)=>{if(e.hostId&&(n!==i()||a!==r()||e.isCurrentHost?.()===!1))return Promise.reject(Error(`Remote Host client belongs to an inactive Hub transport`));let u=new URL(s instanceof Request?s.url:s.toString()),d=c(e.hostId,`${u.pathname}${u.search}`);if(e.hostId&&e.instanceId){let t=new Headers(l?.headers??(s instanceof Request?s.headers:void 0));t.set(`x-yuri-target-instance`,e.instanceId),l={...l,headers:t}}let f;if(s instanceof Request){let e=_l(t().api(d));f=o(new Request(e,s),l)}else f=o(d,l);return e.hostId?f.then(t=>{if(n!==i()||a!==r()||e.isCurrentHost?.()===!1)throw Error(`Remote Host connection changed during SDK request`);return t}):f}}))},wl=20971520,Tl=e=>{let{referenceOnly:t,...n}=e;return El(e)&&!t?n:{type:`text`,synthetic:!0,text:as(`Attachment ${JSON.stringify(e.filename||`file`)}: ${JSON.stringify(se(e.url))}\nRead or process this file with tools as needed; its contents are not included in the message.`.replace(/</g,`\\u003c`))}},El=e=>typeof e.mime==`string`&&e.mime.startsWith(`image/`)?!0:typeof e.filename==`string`&&/\.(?:png|jpe?g|gif|webp|svg|avif|bmp|heic|heif|tiff?)$/i.test(e.filename),Dl=e=>{let t=[];for(let n of e){if(!El(n))continue;let e=typeof n.filename==`string`?n.filename.trim():``,r=typeof n.url==`string`?n.url:``;if(!e||!r.toLowerCase().startsWith(`file://`))continue;let i=se(r).trim();i&&t.push({filename:e,path:i})}return t},Ol=async(e,t)=>{let n=[],r=e.files?.length?await Promise.all(e.files.map(e=>t(e))):[],i=e.additionalParts?.length?await Promise.all(e.additionalParts.map(async e=>({text:e.text,synthetic:e.synthetic,files:e.files?.length?await Promise.all(e.files.map(e=>t(e))):[]}))):[],a=e=>qo(e,Dl([...r,...i.flatMap(e=>e.files)]));if(e.prefaceText&&e.prefaceText.trim()&&n.push({type:`text`,text:a(e.prefaceText),synthetic:e.prefaceTextSynthetic!==!1}),e.text&&e.text.trim()&&n.push({type:`text`,text:a(e.text)}),n.push(...r.map(Tl)),i.length>0)for(let e of i){if(e.text&&e.text.trim()){let t={type:`text`,text:a(e.text)};e.synthetic&&(t.synthetic=!0),n.push(t)}n.push(...e.files.map(Tl))}if(e.agentMentions&&e.agentMentions.length>0)for(let t of e.agentMentions){if(!t?.name)continue;let e={type:`agent`,name:t.name};t.source&&(e.source=t.source),n.push(e)}if(n.length===0)throw Error(`Message must have at least one part (text or file)`);return n},kl=e=>e.replace(/\\/g,`/`),Al=400,jl=()=>{let e=f();return e&&e.runtime?.isDesktop&&e.files?e.files:null},Ml=class{client;baseUrl;scopedClients=new Map;currentDirectory=void 0;directoryContextQueue=Promise.resolve();listDirectoryInFlight=new Map;configProvidersInFlight=new Map;listAgentsInFlight=new Map;configInFlight=new Map;configCache=new Map;configCacheGeneration=0;listDirectoryCache=new Map;healthInFlight=new Map;healthCache=new Map;healthCacheGeneration=0;liveLocationsFlight=null;sessionBoundaryQueues=new Map;hostScope;hostRuntimeKey;hostRuntimeGeneration;isCurrentHost;hostEntry;constructor(e=al,t,a,o){let s=vl()||e;if(this.baseUrl=_l(s),this.hostScope=t?.hostId?Object.freeze({...t}):void 0,this.hostRuntimeKey=this.hostScope?i():void 0,this.hostRuntimeGeneration=this.hostScope?r():void 0,this.isCurrentHost=a,this.hostEntry=o,this.currentDirectory=t?.directory,this.client=Cl({baseUrl:ml(this.baseUrl),hostId:this.hostScope?.hostId,instanceId:this.hostScope?.instanceId,isCurrentHost:a}),this.hostScope&&!this.hostEntry){let e=this.hostScope,t=d(e);this.hostEntry=Object.freeze({location:e,key:t,cachePartition:u(e),connectionGeneration:0,queryScope:Object.freeze([n(),e.hubId,e.hostId,t,0]),sdk:()=>(this.assertHostScopeCurrent(),this.client),service:()=>(this.assertHostScopeCurrent(),this),fetch:(e,t)=>this.runtimeFetch(e,t)})}}getHostRuntimeEntry(){return this.assertHostScopeCurrent(),this.hostEntry}assertHostScopeCurrent(){if(this.hostScope&&(this.hostRuntimeKey!==i()||this.hostRuntimeGeneration!==r()||this.isCurrentHost?.()===!1))throw Error(`Remote Host service belongs to an inactive Hub transport`)}async runtimeFetch(e,t){this.assertHostScopeCurrent();let n=e;if(this.hostScope?.hostId&&gl.test(n)){let e=new URL(n);n=`${e.pathname}${e.search}`}let r=new Headers(t?.headers);this.hostScope?.instanceId&&r.set(`x-yuri-target-instance`,this.hostScope.instanceId);let i=await o(c(this.hostScope?.hostId,n),this.hostScope?.instanceId?{...t,headers:r}:t);return this.assertHostScopeCurrent(),i}getBaseUrl(){return _l(vl()||this.baseUrl)}reconnectToRuntimeBaseUrl(){this.assertHostScopeCurrent();let e=_l(vl()||al);e!==this.baseUrl&&(this.baseUrl=e,this.client=Cl({baseUrl:ml(this.baseUrl),hostId:this.hostScope?.hostId,instanceId:this.hostScope?.instanceId,isCurrentHost:this.isCurrentHost}),this.scopedClients.clear(),this.listDirectoryInFlight.clear(),this.configProvidersInFlight.clear(),this.listAgentsInFlight.clear(),this.clearConfigCache(),this.listDirectoryCache.clear(),this.clearHealthCache(),this.liveLocationsFlight=null)}getSdkClient(){return this.client}getScopedSdkClient(e){return this.getScopedApiClient(e)}getLocationSdkClient(e){if(!e.hostId)return this.getScopedSdkClient(e.directory);let t=JSON.stringify([i(),r(),d(e),e.instanceId??null]),n=this.scopedClients.get(t);if(n)return n;let a=Cl({baseUrl:ml(this.baseUrl),hostId:e.hostId,instanceId:e.instanceId});return this.scopedClients.set(t,a),a}async checkLocationReleaseUse(e,t){let n=this.normalizeCandidatePath(e),r=await this.listLiveLocationDirectories();if(!r)throw Error(`Live Location inventory unavailable`);if(r&&n&&!r.has(n))return`free`;let i=this.getScopedSdkClient(e),a={location:{directory:e}},[o,s]=await Promise.all([i.shell.list(a,{signal:t}),i.form.list(a,{signal:t})]);return o.data.some(e=>e.status===`running`)||s.data.length>0?`busy`:`free`}listLiveLocationDirectories(){let e=Date.now();if(this.liveLocationsFlight&&this.liveLocationsFlight.expiresAt>e)return this.liveLocationsFlight.promise;let t=this.client.debug.location.list().then(e=>{if(!Array.isArray(e))return null;let t=new Set;for(let n of e){let e=this.normalizeCandidatePath(n?.directory??null);e&&t.add(e)}return t}).catch(()=>null);return this.liveLocationsFlight={promise:t,expiresAt:e+ul},t}async resolveBlockingRequestDirectories(e){let t=new Set;for(let n of e??[]){let e=this.normalizeCandidatePath(n??null);e&&t.add(e)}if(t.size===0)return[];let n=await this.listLiveLocationDirectories();if(!n)throw Error(`Live Location inventory unavailable`);return Array.from(t).filter(e=>n.has(e))}async releaseLocation(e,t){await this.getScopedSdkClient(e).debug.location.evict({location:{directory:e}},{signal:t})}getScopedApiClient(e){this.assertHostScopeCurrent();let t=(this.normalizeCandidatePath(e)??e)||``,n=this.scopedClients.get(t);if(n)return n;let r=Cl({baseUrl:ml(this.baseUrl),hostId:this.hostScope?.hostId,instanceId:this.hostScope?.instanceId,isCurrentHost:this.isCurrentHost});return this.scopedClients.set(t,r),r}normalizeCandidatePath(e){if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=t.replace(/\\/g,`/`).replace(/^([a-z]):/,(e,t)=>t.toUpperCase()+`:`);return(n.length>1?n.replace(/\/+$/,``):n)||null}deriveHomeDirectory(e){let t=e.match(/^([A-Za-z]:)(?:\/|$)/);if(t){let n=t[1],r=e.slice(n.length+ +(e.charAt(n.length)===`/`)).split(`/`).filter(Boolean);return r.length>=2?{homeDirectory:`${n}/${r[0]}/${r[1]}`,username:r[1]}:r.length===1?{homeDirectory:`${n}/${r[0]}`,username:r[0]}:{homeDirectory:n,username:void 0}}let n=e.startsWith(`/`),r=e.split(`/`).filter(Boolean);return r.length>=2&&(r[0]===`Users`||r[0]===`home`)?{homeDirectory:`${n?`/`:``}${r[0]}/${r[1]}`,username:r[1]}:n?r.length===0?{homeDirectory:`/`,username:void 0}:{homeDirectory:`/${r.join(`/`)}`,username:r[r.length-1]}:r.length>0?{homeDirectory:`/${r.join(`/`)}`,username:r[r.length-1]}:{homeDirectory:`/`,username:void 0}}setDirectory(e){let t=this.normalizeCandidatePath(e)??e;this.currentDirectory!==t&&H(`opencodeClient:setDirectory`,{previous:this.currentDirectory??null,next:t??null}),this.currentDirectory=t}getDirectory(){return this.currentDirectory}runSessionBoundary(e,t){let n=e.trim();if(!n)return t();let r=this.sessionBoundaryQueues.get(n)??Promise.resolve(),i,a,o=new Promise((e,t)=>{i=e,a=t}),s=()=>t().then(i,a),c=r.then(s,s);return this.sessionBoundaryQueues.set(n,c.then(()=>void 0,()=>void 0)),o}assertCapturedRuntime(e,t,n){if(this.assertHostScopeCurrent(),r()!==e||i()!==t){let e=Error(`${n}: runtime switched`);throw e.name=`RuntimeGenerationMismatchError`,e}}async switchSessionModel(e,t,n){let a=r(),o=i(),s=`id`in t&&typeof t.id==`string`&&t.id?t.id:t.modelID,c=t.providerID;if(!e||!s||!c)throw Error(`switchSessionModel requires sessionID, model.id, and providerID`);let l=typeof t.variant==`string`&&t.variant.trim()?t.variant.trim():void 0,u={id:s,providerID:c,...l?{variant:l}:{}},d=this.normalizeCandidatePath(n)??this.currentDirectory??``,f=this.getScopedSdkClient(d);this.assertCapturedRuntime(a,o,`session model switch`),await f.session.switchModel({sessionID:e,model:u}),this.assertCapturedRuntime(a,o,`session model switch`),bo(e,d||n,{model:u})}async switchSessionAgent(e,t,n){let a=r(),o=i(),s=typeof t==`string`?t.trim():``;if(!e||!s)throw Error(`switchSessionAgent requires sessionID and agent`);let c=this.normalizeCandidatePath(n)??this.currentDirectory??``,l=this.getScopedSdkClient(c);this.assertCapturedRuntime(a,o,`session agent switch`),await l.session.switchAgent({sessionID:e,agent:s}),this.assertCapturedRuntime(a,o,`session agent switch`),bo(e,c||n,{agent:s})}async generateSessionAside(e){let t=typeof e.sessionId==`string`?e.sessionId.trim():``;if(!t)throw Error(`generateSessionAside requires sessionId`);let n=typeof e.prompt==`string`?e.prompt:``,r=this.normalizeCandidatePath(e.directory)??this.currentDirectory??``,i=await this.getScopedSdkClient(r).session.generate({sessionID:t,prompt:n},e.signal?{signal:e.signal}:void 0);if(!i||typeof i.text!=`string`)throw Error(`session.generate returned invalid payload`);return{text:i.text}}async applySendSelection(e,t,n){t.model&&await this.switchSessionModel(e,t.model,n),t.agent&&await this.switchSessionAgent(e,t.agent,n)}async withDirectory(e,t){let n=async()=>{if(e==null)return t();let n=this.currentDirectory,r=this.normalizeCandidatePath(e)??e;this.currentDirectory=r;try{return await t()}finally{this.currentDirectory===r&&(this.currentDirectory=n)}},r=this.directoryContextQueue.then(n,n);return this.directoryContextQueue=r.then(()=>void 0,()=>void 0),r}getApiClient(){return this.client}async getSystemInfo(){let e=new Set,t=t=>{let n=this.normalizeCandidatePath(t);n&&e.add(n)};try{let e=await this.client.location.get(Q(this.currentDirectory));e&&(t(e.directory),t(e.project?.directory),t(e.project?.canonical))}catch{}if(!e.size)try{let e=await this.client.location.get(Q(this.currentDirectory));t(e?.project?.directory),t(e?.project?.canonical)}catch{}if(!e.size)try{(await this.listSessions()).forEach(e=>t(e.directory))}catch{}if(t(this.currentDirectory),typeof window<`u`)try{t(xe(`lastDirectory`)),t(xe(`homeDirectory`))}catch{}if(!e.size&&typeof process<`u`&&typeof process.cwd==`function`&&t(process.cwd()),!e.size)return{homeDirectory:`/`,username:void 0};let[n]=Array.from(e);return this.deriveHomeDirectory(n)}async probeDirectory(e){let t=this.normalizeCandidatePath(e);if(!t)return!1;try{let e=await this.client.location.get({location:{directory:t}}),n=typeof e?.directory==`string`?e.directory:null;return!!(n&&n.trim().length>0)}catch{return!1}}async listSessions(){let e=await this.client.session.list(this.currentDirectory?{directory:this.currentDirectory}:void 0);return Array.isArray(e.data)?e.data.map(y):[]}async searchSessionsByTitle(e){let t=e.search.trim(),n=await this.client.session.list({search:t||void 0,parentID:null,limit:e.limit??30,order:`desc`},e.signal?{signal:e.signal}:void 0);if(!Array.isArray(n?.data))throw Error(`session.list search returned no data`);return n.data.map(y)}async createSession(e,t){let n=this.normalizeCandidatePath(t)??this.currentDirectory;if(e?.metadata,e?.parentID){let t=await this.client.session.fork({sessionID:e.parentID});return e.title?(await this.client.session.update({sessionID:t.id,title:e.title}),y(await this.client.session.get({sessionID:t.id}))):y(t)}return y(await this.client.session.create({...n?{location:{directory:n}}:{},title:e?.title}))}async getSession(e,t){return y(await this.client.session.get({sessionID:e}))}async deleteSession(e,t){return await this.client.session.remove({sessionID:e}),!0}async deleteSessionMessage(e,t,n){throw Z(`session.deleteMessage`)}async updateSession(e,t,n){let a=t.title!==void 0,o=t.metadata!==void 0,s=t.time!==void 0&&Object.prototype.hasOwnProperty.call(t.time,`archived`);if(!a&&!o&&!s)throw Z(`session.update`);let c=this.normalizeCandidatePath(n)??this.currentDirectory,l=r(),u=i(),d=()=>{if(r()!==l||i()!==u){let e=Error(`session.update discarded: runtime switched`);throw e.name=`RuntimeGenerationMismatchError`,e}},f=[],p=null,m=null,h=e=>{if(f.length===0)throw e;let t=X(e),n=Error(`session.update partial failure after ${f.join(`,`)}: ${t}`);throw n.name=`SessionUpdatePartialFailureError`,n.cause=e,n.completed=[...f],n};try{if(a&&(await this.client.session.update({sessionID:e,title:t.title}),d(),f.push(`title`),p=y(await this.client.session.get({sessionID:e})),d()),o){let n={patch:t.metadata};c&&(n.directory=c);let r=await this.runtimeFetch(`/api/yuri/sessions/${encodeURIComponent(e)}/metadata`,{method:`PUT`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(n)});if(d(),!r.ok){let e=Error(`session.metadata update failed (${r.status})`);throw e.status=r.status,e}let i=await r.json().catch(()=>null);d(),m=typeof i==`object`&&i&&!Array.isArray(i)&&`metadata`in i&&i.metadata!==null&&typeof i.metadata==`object`&&!Array.isArray(i.metadata)?i.metadata:null,f.push(`metadata`)}if(s){let n=t.time?.archived,r;if(n==null)r=0;else if(typeof n==`number`&&Number.isFinite(n))r=n>0?Math.trunc(n):0;else throw Error(`archivedAt must be a finite number or null`);let i={archivedAt:r};c&&(i.directory=c);let a=await this.runtimeFetch(`/api/yuri/sessions/${encodeURIComponent(e)}/archive`,{method:`PUT`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(i)});if(d(),!a.ok){let e=Error(`session.archive update failed (${a.status})`);throw e.status=a.status,e}let o=await a.json().catch(()=>null);d();let s=typeof o==`object`&&o&&!Array.isArray(o)&&`session`in o?o.session:null;if(!s||typeof s!=`object`||Array.isArray(s))throw Error(`session.archive update failed: empty response`);p=y(s),f.push(`archive`)}return p||(p=await this.getSession(e,n),d()),m&&!s?{...p,metadata:m}:p}catch(e){return h(e)}}async getSessionMessages(e,t){return(await st({scope:this.hostEntry,sessionID:e,directory:this.currentDirectory??``,...typeof t==`number`?{limit:t}:{}})).records}async getSessionDiff(e,t){let n=this.normalizeCandidatePath(e.directory)??this.currentDirectory,r=typeof e.messageID==`string`&&e.messageID.trim().length>0?e.messageID.trim():void 0,i=new URLSearchParams;n&&i.set(`directory`,n),r&&i.set(`messageID`,r);let a=i.toString(),o=await this.runtimeFetch(`/api/session/${encodeURIComponent(e.sessionID)}/diff${a?`?${a}`:``}`,{method:`GET`,headers:{Accept:`application/json`},signal:t?.signal});if(!o.ok){let e=Error(`session.diff failed (${o.status})`);throw e.status=o.status,e}let s=await o.json().catch(()=>null),c=typeof s==`object`&&s&&Array.isArray(s.data)?s.data:null;if(!c)throw Error(`session.diff failed: empty response`);return c}async getSessionTodos(e){throw Z(`session.todo`)}shouldNormalizeToTextPlain(e){if(!e)return!1;let t=e.toLowerCase();return t.startsWith(`text/`)&&t!==`text/plain`?!0:[`application/json`,`application/xml`,`application/javascript`,`application/typescript`,`application/x-yaml`,`application/yaml`,`application/toml`,`application/x-sh`,`application/x-shellscript`,`application/octet-stream`,`image/svg+xml`].includes(t)}isHeicMime(e){if(!e)return!1;let t=e.toLowerCase();return t===`image/heic`||t===`image/heif`}async convertHeicToJpeg(t){try{let n=ce(t.url,t.mime);if(!n)return t;let r=await Do(n)??await(await fe(async()=>{let{default:t}=await import(`./vendor-heic2any-DgJnLT1Y.js`).then(t=>e(t.t(),1));return{default:t}},__vite__mapDeps([0,1]))).default({blob:n,toType:`image/jpeg`,quality:.9}),i=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsDataURL(r)}),a=t.filename;return a&&=a.replace(/\.heic$/i,`.jpg`).replace(/\.heif$/i,`.jpg`),{mime:`image/jpeg`,filename:a,url:i}}catch(e){return console.warn(`Failed to convert HEIC to JPEG:`,e),t}}async normalizeFilePart(e){if(this.isHeicMime(e.mime))return this.convertHeicToJpeg(e);if(!this.shouldNormalizeToTextPlain(e.mime))return e;let t=e.url;if(e.url.startsWith(`data:`)){let n=e.url.indexOf(`,`);if(n!==-1){let r=e.url.substring(5,n),i=e.url.substring(n);t=`data:${r.replace(/^[^;,]+/,`text/plain`)}${i}`}}return{mime:`text/plain`,filename:e.filename,url:t}}async toNormalizedFilePartInput(e,t){let n=t?.generation??r(),a=t?.runtimeKey??i(),o=El(e)?await this.normalizeFilePart(e):e;this.assertCapturedRuntime(n,a,`prompt attachment normalize`);let s=o.url,c;if(oe(s)){let e=s.startsWith(`blob:`)?await fetch(s).then(e=>e.blob()):ce(s,o.mime);if(!e)throw Error(`Failed to materialize attachment bytes for ${o.filename??`file`}`);this.assertCapturedRuntime(n,a,`prompt attachment upload`);let t=await ae({scope:this.hostEntry,body:e,mime:o.mime,filename:o.filename});this.assertCapturedRuntime(n,a,`prompt attachment upload`),s=t.url,c=t.size}if(El(o)&&c===void 0&&s.toLowerCase().startsWith(`file://`)){let e=se(s),t=this.hostScope?void 0:f()?.files;if(t?.statFile)c=(await t.statFile(e)).size;else{let t=await this.runtimeFetch(`/api/fs/stat`,{query:{path:e}});if(!t.ok)throw Error(`Failed to inspect prompt attachment`);c=(await t.json()).size}this.assertCapturedRuntime(n,a,`prompt attachment stat`)}return{...e.id?{id:e.id}:{},type:`file`,mime:o.mime,filename:o.filename,url:s,...El(o)&&(c===void 0||!Number.isSafeInteger(c)||c<0||c>wl)?{referenceOnly:!0}:{}}}async buildMessageParts(e,t){let n=t?.generation??r(),a=t?.runtimeKey??i();return Ol(e,e=>this.toNormalizedFilePartInput(e,{generation:n,runtimeKey:a}))}async sendMessage(e){let t=r(),n=i(),a=()=>{this.assertCapturedRuntime(t,n,`session prompt discarded`)};a();let o=e.messageId??bs(`msg`),s=this.normalizeCandidatePath(e.directory??null)??this.currentDirectory,c=Qs(s??``,this.hostEntry),l=await this.buildMessageParts({text:e.text,prefaceText:e.prefaceText,prefaceTextSynthetic:e.prefaceTextSynthetic,files:e.files,additionalParts:e.additionalParts,agentMentions:e.agentMentions},{generation:t,runtimeKey:n});a(),J(c)||this.assertCapturedRuntime(t,n,`session prompt discarded`),e.format&&(e.id,e.providerID,e.modelID,e.agent,e.variant,this.baseUrl,e.format.type);let d=this.hostScope?u(this.hostScope):void 0;il(e.providerID,d);let f=l.flatMap(e=>e.type===`text`&&typeof e.text==`string`?[e.text]:[]).join(`
|
|
5
5
|
`)||e.text,p=l.flatMap(e=>e.type!==`file`||typeof e.url!=`string`?[]:[{uri:e.url,...e.filename?{name:e.filename}:{}}]),m=l.flatMap(e=>e.type===`agent`&&typeof e.name==`string`?[{name:e.name}]:[]),h=Ae(l.flatMap(e=>e.type===`text`&&!e.synthetic?[e.text]:[]).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,ot as n,r,st as i,t as a}from"./vendor-base-ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,ot as n,r,st as i,t as a}from"./vendor-base-ui-fom6orB6.js";import{n as o}from"./vendor-react-D5BntRmA.js";import{Rn as s}from"./useMobileNavigationStore-CU0KrVK0.js";var c=o(),l=e(i(),1),u=n(),d=r,f=e=>{let n=(0,c.c)(14),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:a,asChild:r,children:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let d;n[5]!==r||n[6]!==i?(d=r&&l.isValidElement(i)?{render:i}:{children:i},n[5]=r,n[6]=i,n[7]=d):d=n[7];let f=d,p;n[8]===a?p=n[9]:(p=s(`flex w-full items-center justify-between rounded-lg px-2 py-1.5 text-left text-foreground hover:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,a),n[8]=a,n[9]=p);let m;return n[10]!==o||n[11]!==f||n[12]!==p?(m=(0,u.jsx)(t,{className:p,...o,...f}),n[10]=o,n[11]=f,n[12]=p,n[13]=m):m=n[13],m},p=e=>{let t=(0,c.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`overflow-hidden data-[closed]:animate-collapsible-up data-[open]:animate-collapsible-down`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,u.jsx)(a,{className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o};export{p as n,f as r,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{A as e,C as t,M as n,N as r,a as i,i as a,j as o,ot as s,st as c}from"./vendor-base-ui-fom6orB6.js";import{n as l}from"./vendor-react-D5BntRmA.js";import{Rn as u}from"./useMobileNavigationStore-CU0KrVK0.js";import{n as d,r as f,t as p}from"./dropdown-menu.styles-BDla58Rm.js";var m=l();c();var h=s();function g(e){let t=(0,m.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,h.jsx)(i,{...n}),t[2]=n,t[3]=r),r}function _(e){let t=(0,m.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,h.jsx)(a,{...n}),t[2]=n,t[3]=r),r}function v(t){let r=(0,m.c)(20),i,a,s,c,l;r[0]===t?(i=r[1],a=r[2],s=r[3],c=r[4],l=r[5]):({className:a,positionerClassName:s,children:i,style:l,...c}=t,r[0]=t,r[1]=i,r[2]=a,r[3]=s,r[4]=c,r[5]=l);let f;r[6]===s?f=r[7]:(f=u(`app-region-no-drag z-50`,s),r[6]=s,r[7]=f);let p;r[8]===l?p=r[9]:(p={color:`var(--surface-elevated-foreground)`,...l},r[8]=l,r[9]=p);let g;r[10]===a?g=r[11]:(g=u(d,a),r[10]=a,r[11]=g);let _;r[12]!==i||r[13]!==c||r[14]!==p||r[15]!==g?(_=(0,h.jsx)(n,{"data-slot":`dropdown-menu-content`,style:p,className:g,...c,children:i}),r[12]=i,r[13]=c,r[14]=p,r[15]=g,r[16]=_):_=r[16];let v;return r[17]!==f||r[18]!==_?(v=(0,h.jsx)(o,{children:(0,h.jsx)(e,{className:f,children:_})}),r[17]=f,r[18]=_,r[19]=v):v=r[19],v}function y(e){let t=(0,m.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=u(p,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,h.jsx)(r,{className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function b(e){let n=(0,m.c)(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(f,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=(0,h.jsx)(t,{className:a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o}export{_ as a,b as i,v as n,y as r,g as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/rolldown-runtime-hePW80VL.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t,R as n,n as r}from"./platform-wF65ZFgV.js";import{st as i}from"./vendor-base-ui-
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t,R as n,n as r}from"./platform-wF65ZFgV.js";import{st as i}from"./vendor-base-ui-fom6orB6.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{n as a}from"./vendor-react-D5BntRmA.js";import{o}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";var s=e(i(),1),c=a(),l=.85,u=1.2,d=10/9*1.05,f=.9,p=1.029,m=p/f,h=`yuri.designPtScale.v9`;function g(e){return!Number.isFinite(e)||e<=0?1:Math.min(u,Math.max(l,e))}function _(e){if(!e)return p;let t=e.density,n=(e.xdpi+e.ydpi)/2;if(!(t>0)||!(n>=50)||n>800)return p;let r=g(n/t/163);return Math.min(p,r*m)}function v(){if(typeof window>`u`)return 1;try{let e=Number.parseFloat(window.localStorage.getItem(`yuri.designPtScale.v9`)??``),t=window.Capacitor?.getPlatform?.();return t===`android`?!Number.isFinite(e)||e<=0?p:Math.min(p,g(e)):t===`ios`?d:g(e)}catch{return 1}}function y(e){if(!(typeof window>`u`))try{window.localStorage.setItem(h,String(e))}catch{}}function b(e,t=document.documentElement){let n=g(e);t.style.setProperty(`--dpt`,`${n}px`),t.style.setProperty(`--dpt-n`,String(n))}async function x(){if(typeof document>`u`)return 1;b(v());let{Capacitor:e,registerPlugin:t}=await o(async()=>{let{Capacitor:e,registerPlugin:t}=await import(`./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js`).then(e=>e.i);return{Capacitor:e,registerPlugin:t}},__vite__mapDeps([0,1]));if(!e.isNativePlatform())return b(1),1;if(e.getPlatform()===`ios`)return b(d),y(d),d;if(e.getPlatform()!==`android`)return b(1),1;if(!e.isPluginAvailable(`YuriPhysicalScale`))return b(p),y(p),p;try{let e=_(await t(`YuriPhysicalScale`).getMetrics());return y(e),b(e),e}catch{return b(p),y(p),p}}var S=({screenWidth:e,...t})=>t,C={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},w={isMobile:!1,isTablet:!1,isDesktop:!0,deviceType:`desktop`,screenWidth:1024,breakpoint:`lg`,hasTouchInput:!1,hasTouchOnlyPointer:!1},T=S(w),E=()=>typeof window>`u`?!1:new URLSearchParams(window.location.search).get(`surface`)===`desktop`,D=e=>{if(typeof navigator>`u`)return{isExplicitTablet:!1};let t=navigator.userAgent||``,n=navigator.platform||``,r=/iPad/i.test(t)||(/Macintosh|MacIntel/i.test(t)||/MacIntel/i.test(n))&&e>1,i=/Android/i.test(t)&&!/Mobile/i.test(t),a=/Tablet/i.test(t);return{isExplicitTablet:r||i||a}},O=(e,t,n)=>{if(typeof window>`u`)return;let r=document.documentElement,i=t===`mobile`,a=t===`tablet`,o=(e,t)=>{r.classList.contains(e)!==t&&r.classList.toggle(e,t)},s=(e,t)=>{r.style.getPropertyValue(e)!==t&&r.style.setProperty(e,t)};o(`device-mobile`,i),o(`device-tablet`,a),o(`device-desktop`,t===`desktop`),o(`desktop-runtime`,e),o(`mobile-pointer`,!e&&n),e?(s(`--is-mobile`,`0`),s(`--device-type`,`desktop`),s(`--font-scale`,`1`),s(`--has-coarse-pointer`,`0`),s(`--has-touch-input`,`0`)):(s(`--is-mobile`,i?`1`:`0`),s(`--device-type`,t),s(`--font-scale`,i?`0.9`:a?`0.95`:`1`),s(`--has-coarse-pointer`,n?`1`:`0`),s(`--has-touch-input`,n?`1`:`0`));let c=e?1:v();(r.style.getPropertyValue(`--dpt`)!==`${c}px`||r.style.getPropertyValue(`--dpt-n`)!==String(c))&&b(c,r)};function k(){let e=window.innerWidth,i=typeof window.matchMedia==`function`,a=i?window.matchMedia(`(pointer: coarse)`):null,o=i?window.matchMedia(`(hover: none)`):null,s=a?.matches??!1,c=o?.matches??!1,l=typeof navigator<`u`?navigator.maxTouchPoints??0:0,u=t()||n()||E(),{isExplicitTablet:d}=D(l),f=s||c||l>0,p=s||c,m=e>C.md&&e<=C.lg,h=e<=C.md,g=f&&h,_=f&&!g&&(m||d),v=!f||!_&&e>C.lg,y=`desktop`;u?(g=!1,_=!1,v=!0,y=`desktop`):r()?(g=!0,_=!1,v=!1,y=`mobile`):g?y=`mobile`:_?y=`tablet`:(v=!0,y=`desktop`),O(u,y,f);let b=`xs`;for(let[t,n]of Object.entries(C))e>=n&&(b=t);return{isMobile:g,isTablet:_,isDesktop:v,deviceType:y,screenWidth:e,breakpoint:b,hasTouchInput:f,hasTouchOnlyPointer:p}}var A=(e,t)=>e.isMobile===t.isMobile&&e.isTablet===t.isTablet&&e.isDesktop===t.isDesktop&&e.deviceType===t.deviceType&&e.breakpoint===t.breakpoint&&e.hasTouchInput===t.hasTouchInput&&e.hasTouchOnlyPointer===t.hasTouchOnlyPointer,j=new Set,M=new Set,N=null,P=null,F,I=null,L=()=>typeof window>`u`?w:(N||=k(),N),R=()=>typeof window>`u`?T:(P||=S(L()),P),z=()=>{F=void 0;let e=k(),t=!P||!A(P,e);if(!(!t&&N?.screenWidth===e.screenWidth)){if(N=e,t){P=S(e);for(let e of M)e()}for(let e of j)e()}},B=()=>{typeof window>`u`||F!==void 0||(F=window.requestAnimationFrame(z))},V=(e,t)=>e?typeof e.addEventListener==`function`?(e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)):typeof e.addListener==`function`?(e.addListener(t),()=>e.removeListener(t)):()=>{}:()=>{},H=()=>{if(typeof window>`u`)return()=>{};z(),window.addEventListener(`resize`,B);let e=typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null,t=typeof window.matchMedia==`function`?window.matchMedia(`(hover: none)`):null,n=V(e,B),r=V(t,B);return()=>{window.removeEventListener(`resize`,B),n(),r(),F!==void 0&&(window.cancelAnimationFrame(F),F=void 0)}},U=(e,t)=>typeof window>`u`?()=>{}:(e.add(t),I||=H(),()=>{e.delete(t),j.size===0&&M.size===0&&I&&(I(),I=null,N=null,P=null)}),W=e=>U(j,e),G=e=>U(M,e);function K(){if(typeof window>`u`||typeof window<`u`&&t())return!1;let e=document.documentElement,n=e.style.getPropertyValue(`--is-mobile`)||getComputedStyle(e).getPropertyValue(`--is-mobile`);return n===`1`||n===`true`}var q=()=>typeof window>`u`?!1:!!(navigator.standalone===!0||window.matchMedia?.(`(display-mode: standalone)`)?.matches||window.matchMedia?.(`(display-mode: fullscreen)`)?.matches),J=()=>{if(typeof window>`u`||t())return!1;let e=typeof navigator<`u`?navigator.maxTouchPoints??0:0;return q()&&e>0&&window.innerWidth>C.md};function Y(){let e=(0,c.c)(2),[t,n]=s.useState(X),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`)return;let e=()=>n(J()),t=window.matchMedia?.(`(display-mode: standalone)`),r=window.matchMedia?.(`(display-mode: fullscreen)`);e(),window.addEventListener(`resize`,e),window.addEventListener(`focus`,e);let i=t=>{t&&(typeof t.addEventListener==`function`?t.addEventListener(`change`,e):typeof t.addListener==`function`&&t.addListener(e))},a=t=>{t&&(typeof t.removeEventListener==`function`?t.removeEventListener(`change`,e):typeof t.removeListener==`function`&&t.removeListener(e))};return i(t),i(r),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`focus`,e),a(t),a(r)}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),s.useEffect(r,i),t}function X(){return J()}var Z=()=>typeof window>`u`?`portrait`:window.matchMedia?.(`(orientation: landscape)`)?.matches?`landscape`:`portrait`;function Q(){let e=(0,c.c)(2),[t,n]=s.useState(Z),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(orientation: landscape)`),t=()=>n(e.matches?`landscape`:`portrait`);return t(),V(e,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),s.useEffect(r,i),t}function $(e){let t=(0,c.c)(2),n;return t[0]===e?.includeScreenWidth?n=t[1]:(n=()=>e?.includeScreenWidth?w:T,t[0]=e?.includeScreenWidth,t[1]=n),s.useSyncExternalStore(e?.includeScreenWidth?W:G,e?.includeScreenWidth?L:R,n)}export{Y as a,Q as i,K as n,x as o,$ as r,k as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-fom6orB6.js";import{Rn as r}from"./useMobileNavigationStore-CU0KrVK0.js";import{t as i}from"./vendor-react-drawio-DXADKcSU.js";var a=e(n(),1),o=t(),s=`<mxfile><diagram id="new" name="Page-1"><mxGraphModel dx="0" dy="0" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel></diagram></mxfile>`;function c(){if(typeof document>`u`)return!1;let e=document.documentElement.getAttribute(`data-theme`);return e===`dark`||!e&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}var l=a.forwardRef(function({xml:e,readOnly:t,className:n,onChange:l},u){let d=a.useRef(e),f=a.useRef(null),p=a.useRef(!1),[m,h]=a.useState(c),g=a.useRef(e),_=a.useRef(e);_.current!==e&&(_.current=e,g.current=e,d.current=e);let v=a.useRef(m);v.current!==m&&(v.current=m,g.current=d.current);let y=a.useRef(null);a.useEffect(()=>{let e=()=>h(c());e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()},[]),a.useEffect(()=>{let e=setTimeout(()=>{y.current?.querySelector(`.diagrams-iframe`)?.focus()},600);return()=>clearTimeout(e)},[]),a.useImperativeHandle(u,()=>({getXml:()=>d.current}));let b=a.useCallback(()=>{!e&&!p.current&&(p.current=!0,setTimeout(()=>{f.current?.template({})},500))},[e]),x=a.useCallback(e=>{d.current=e.xml,l?.(e.xml)},[l]);return(0,o.jsx)(`div`,{ref:y,className:r(`h-full w-full`,n),children:(0,o.jsx)(i,{ref:f,xml:g.current||s,autosave:!0,urlParameters:{ui:t?`simple`:m?`dark`:`kennedy`,spin:!0,libraries:!t,chrome:t,nav:t,layers:t,noSaveBtn:!0,noExitBtn:!0,saveAndExit:!1},onLoad:b,onAutoSave:x},m?`dark`:`light`)})});export{l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,Q as n,X as r,Z as i,et as a,nt as o,ot as s,rt as c,st as l,tt as u}from"./vendor-base-ui-fom6orB6.js";import{n as d}from"./vendor-react-D5BntRmA.js";import{t as f}from"./i18n-OsFhnlRH.js";import{Rn as p}from"./useMobileNavigationStore-CU0KrVK0.js";import{n as m}from"./Icon-CWw2bUr_.js";var h=e(l(),1),g=d(),_=s(),v=0;function y(e,t){return e&&h.isValidElement(t)?{render:t}:{children:t}}function b(e){let t=(0,g.c)(4),r;t[0]===e?r=t[1]:({...r}=e,t[0]=e,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,_.jsx)(n,{...r}),t[2]=r,t[3]=i),i}function x(e){let t=(0,g.c)(10),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({asChild:n,children:i,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let o;t[4]!==n||t[5]!==i?(o=y(n,i),t[4]=n,t[5]=i,t[6]=o):o=t[6];let s=o,c;return t[7]!==a||t[8]!==s?(c=(0,_.jsx)(r,{"data-slot":`dialog-trigger`,...a,...s}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function S(e){let n=(0,g.c)(4),r;n[0]===e?r=n[1]:({...r}=e,n[0]=e,n[1]=r);let i;return n[2]===r?i=n[3]:(i=(0,_.jsx)(t,{...r}),n[2]=r,n[3]=i),i}var C=h.forwardRef((e,t)=>{let n=(0,g.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],n[3]=a):a=n[3],h.useEffect(A,a);let o=t,s;n[4]===r?s=n[5]:(s=p(`app-region-no-drag 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`,r),n[4]=r,n[5]=s);let l;return n[6]!==i||n[7]!==o||n[8]!==s?(l=(0,_.jsx)(c,{ref:o,"data-slot":`dialog-overlay`,className:s,...i}),n[6]=i,n[7]=o,n[8]=s,n[9]=l):l=n[9],l});C.displayName=`DialogOverlay`;function w(e){let t=(0,g.c)(33),n,r,i,s,c,l,u;t[0]===e?(n=t[1],r=t[2],i=t[3],s=t[4],c=t[5],l=t[6],u=t[7]):({className:r,overlayClassName:s,containerClassName:i,children:n,showCloseButton:l,presentation:u,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l,t[7]=u);let d=u===void 0?`default`:u,{t:h}=f(),v=l??d!==`picker`,y=d===`picker`&&`yuri-picker-backdrop`,b;t[8]!==s||t[9]!==y?(b=p(`rounded-none`,y,s),t[8]=s,t[9]=y,t[10]=b):b=t[10];let x;t[11]===b?x=t[12]:(x=(0,_.jsx)(C,{className:b}),t[11]=b,t[12]=x);let w=i??(d===`picker`?`block p-0`:`items-center p-4`),T;t[13]===w?T=t[14]:(T=p(`fixed inset-0 z-50 flex justify-center pointer-events-none`,w),t[13]=w,t[14]=T);let E=d===`picker`&&`yuri-picker-dialog yuri-mobile-overlay-surface yuri-mobile-overlay-surface--translucent yuri-composer-autocomplete-surface fixed left-1/2 top-[10vh] w-[min(42rem,calc(100vw-3rem))] max-w-none -translate-x-1/2 translate-y-0 gap-0 overflow-hidden rounded-3xl border-0 p-0`,D;t[15]!==r||t[16]!==E?(D=p(`app-region-no-drag relative pointer-events-auto bg-background text-foreground flex flex-col w-full max-w-lg max-h-full gap-4 rounded-xl border p-6 shadow-none overflow-y-auto pwa-dialog-content origin-center`,`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]`,E,r),t[15]=r,t[16]=E,t[17]=D):D=t[17];let O;t[18]!==v||t[19]!==h?(O=v&&(0,_.jsxs)(o,{"data-slot":`dialog-close`,className:`ring-offset-background focus:ring-ring data-[open]:bg-interactive-active data-[open]:text-foreground absolute top-2 right-2 rounded-lg opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none text-muted-foreground hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,_.jsx)(m,{name:`close`}),(0,_.jsx)(`span`,{className:`sr-only`,children:h(`dialog.common.actions.close`)})]}),t[18]=v,t[19]=h,t[20]=O):O=t[20];let k;t[21]!==n||t[22]!==d||t[23]!==c||t[24]!==D||t[25]!==O?(k=(0,_.jsxs)(a,{"data-slot":`dialog-content`,"data-state-slot":`dialog`,"data-presentation":d,className:D,...c,children:[n,O]}),t[21]=n,t[22]=d,t[23]=c,t[24]=D,t[25]=O,t[26]=k):k=t[26];let A;t[27]!==k||t[28]!==T?(A=(0,_.jsx)(`div`,{className:T,children:k}),t[27]=k,t[28]=T,t[29]=A):A=t[29];let j;return t[30]!==A||t[31]!==x?(j=(0,_.jsxs)(S,{children:[x,A]}),t[30]=A,t[31]=x,t[32]=j):j=t[32],j}function T(e){let t=(0,g.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`flex flex-col gap-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,_.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function E(e){let t=(0,g.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`flex flex-col-reverse gap-2 bottom-safe-area sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,_.jsx)(`div`,{"data-slot":`dialog-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function D(e){let t=(0,g.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=p(`typography-markdown leading-none font-semibold text-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,_.jsx)(i,{"data-slot":`dialog-title`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function O(e){let t=(0,g.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`text-muted-foreground typography-ui-label`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,_.jsx)(u,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function k(){v=Math.max(0,v-1),v===0&&document.documentElement.classList.remove(`yuri-dialog-open`)}function A(){return v+=1,document.documentElement.classList.add(`yuri-dialog-open`),k}export{T as a,E as i,w as n,D as o,O as r,x as s,b as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.yuri-picker-backdrop{background:color-mix(in srgb, var(--surface-overlay) 55%, transparent);transition-duration:.18s}@media (prefers-reduced-motion:reduce){.yuri-picker-backdrop{transition-duration:0s}}.yuri-picker-dialog{--yuri-picker-header-end-inset:1.5rem;max-height:min(42rem,80dvh)}.yuri-picker-dialog:has(>[data-slot=dialog-close]){--yuri-picker-header-end-inset:3rem}.yuri-picker-dialog .yuri-picker-header{padding:calc(1rem * var(--padding-scale,1)) var(--yuri-picker-header-end-inset) calc(.5rem * var(--padding-scale,1)) calc(1.5rem * var(--padding-scale,1));text-align:left;flex-shrink:0}.yuri-picker-dialog .yuri-picker-title{min-width:0;font-size:calc(13 * var(--dpt));font-weight:500;line-height:calc(20 * var(--dpt))}.yuri-picker-dialog .yuri-picker-search{margin:0 calc(1.5rem * var(--padding-scale,1)) calc(.5rem * var(--padding-scale,1));flex-shrink:0}.yuri-picker-dialog .yuri-picker-search [data-slot=input]{height:calc(2.5rem * var(--padding-scale,1));box-shadow:none;font-size:calc(14 * var(--dpt));line-height:calc(20 * var(--dpt));background:0 0}.yuri-picker-dialog .yuri-picker-search:has(svg) [data-slot=input]{padding-left:calc(1.5rem * var(--padding-scale,1));padding-right:0}.yuri-picker-dialog .yuri-picker-search>svg,.yuri-picker-dialog .yuri-picker-search>.relative>svg{left:0}.yuri-picker-dialog .yuri-picker-search:focus-within{box-shadow:inset 0 -1px 0 var(--interactive-border)}.yuri-picker-dialog .yuri-picker-list{overscroll-behavior:contain;min-height:0;padding:calc(.25rem * var(--padding-scale,1)) calc(.5rem * var(--padding-scale,1)) calc(.75rem * var(--padding-scale,1));flex:1;overflow-y:auto}.yuri-picker-dialog .yuri-picker-row{min-width:0;min-height:calc(2.25rem * var(--padding-scale,1));padding:calc(.5rem * var(--padding-scale,1)) calc(1rem * var(--padding-scale,1));border:0;border-radius:.5rem}.yuri-picker-dialog .yuri-picker-row+.yuri-picker-row{margin-top:calc(.125rem * var(--padding-scale,1))}.yuri-picker-dialog .yuri-picker-label{font-size:calc(13 * var(--dpt));font-weight:400;line-height:calc(20 * var(--dpt))}.yuri-picker-dialog .yuri-picker-meta{font-size:calc(11 * var(--dpt));font-weight:400;line-height:calc(17 * var(--dpt))}.yuri-picker-dialog .yuri-picker-empty{padding:calc(2.5rem * var(--padding-scale,1)) calc(1rem * var(--padding-scale,1));font-size:calc(12 * var(--dpt));line-height:calc(20 * var(--dpt));border:0}.yuri-picker-dialog .yuri-picker-footer{padding:calc(.25rem * var(--padding-scale,1)) calc(1.5rem * var(--padding-scale,1)) calc(1rem * var(--padding-scale,1));flex-shrink:0}.yuri-picker-dialog .yuri-picker-section+.yuri-picker-section{margin-top:calc(.75rem * var(--padding-scale,1))}.yuri-picker-dialog .yuri-picker-section-title{padding:0 calc(1rem * var(--padding-scale,1)) calc(.25rem * var(--padding-scale,1));font-size:calc(11 * var(--dpt));font-weight:400;line-height:calc(17 * var(--dpt))}.yuri-picker-dialog .yuri-picker-form{margin:0 calc(1.5rem * var(--padding-scale,1)) calc(.75rem * var(--padding-scale,1));flex-shrink:0}.yuri-picker-dialog .yuri-picker-rows>.yuri-picker-row{margin-block:0}.yuri-picker-dialog .yuri-picker-rows>.yuri-picker-row+.yuri-picker-row{margin-top:calc(.125rem * var(--padding-scale,1))}.yuri-picker-dialog .yuri-help-shortcut-row{align-items:center;gap:calc(1rem * var(--padding-scale,1));grid-template-columns:minmax(0,1fr) minmax(0,45%);display:grid}
|